From 86985a3e211ab4cc1e94a696c15a6f77d21c462a Mon Sep 17 00:00:00 2001
From: chengsc <Demo@DESKTOP-CPA90BF>
Date: 星期二, 15 十月 2024 18:36:51 +0800
Subject: [PATCH] 修改出库单据问题
---
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 70 +++++++++++++++++++++++-----------
1 files changed, 47 insertions(+), 23 deletions(-)
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index 71607ea..faa19db 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -30,16 +30,33 @@
private static readonly SqlSugarScope Db = DataContext.Db;
// 鑾峰彇鍗曟嵁鍒楄〃
- public List<ArrivalNoticeDto> GetArrivalNotices(ArrivalNoticeVm model)
+ public List<string> GetArrivalNotices(ArrivalNoticeVm model)
{
string sqlString = string.Empty;
try
{
// 鏈叧鍗曠殑鍗曟嵁
- sqlString = $"select * from BllArrivalNotice where Type in ({model.Type}) and Status != '3' and Status != '4' and IsDel='0' order by CreateTime;";
- var modelList = Db.Ado.SqlQuery<ArrivalNoticeDto>(sqlString);
+ //sqlString = $"select * from BllArrivalNotice where Type in ({model.Type}) and Status != '3' and Status != '4' and IsDel='0' order by CreateTime;";
+ //var modelList = Db.Ado.SqlQuery<ArrivalNoticeDto>(sqlString);
- return modelList;
+ //model.Type锛氬崟鎹被鍨� 鍦ㄨ繖閲屼唬琛ㄥ墠绔〉绛剧被鍨嬶細鍗虫爣绛鹃〉绛撅細璐存爣鐗╂枡锛� 鏁伴噺椤电锛氫笉璐磋〃鐗╂枡锛屽師鍥狅細鎳掑緱鍔犲弬鏁�
+ var data = Db.Queryable<BllArrivalNotice>().Where(m => m.IsDel == "0" && m.Status != "3" && m.Status != "4").Select(m=>m.ASNNo).ToList();
+ var list = new List<string>();
+ if (model.Type == "0")//0璐存爣
+ {
+ list = Db.Queryable<BllArrivalNoticeDetail>().Where(m =>m.IsDel == "0" && data.Contains(m.ASNNo) && !string.IsNullOrWhiteSpace(m.PackagNo)).Select(m => m.ASNNo).Distinct().ToList();
+ }
+ else if(model.Type == "1")//1涓嶈创鏍�
+ {
+ list = Db.Queryable<BllArrivalNoticeDetail>().Where(m => m.IsDel == "0" && data.Contains(m.ASNNo) && string.IsNullOrWhiteSpace(m.PackagNo)).Select(m=>m.ASNNo).Distinct().ToList();
+ }
+ else
+ {
+ throw new Exception("椤电绫诲瀷鍙傛暟閿欒");
+ }
+
+
+ return list;
}
catch (Exception ex)
{
@@ -1800,12 +1817,19 @@
{
throw new Exception("璇锋壂鎻忓绠辨潯鐮�!");
}
- var count = Db.Queryable<BllBoxInfo>().Count(m => m.IsDel == "0" && m.Status == "0" && m.BoxNo == model.BoxNo);
- if (count == 0)
+ if (!string.IsNullOrWhiteSpace(model.ASNNo))
{
- GetBoxInfoByFuMa(model.BoxNo, ""); //浠庤祴鐮佺郴缁熻幏鍙栫鐮佷俊鎭�
+ var asnData = Db.Queryable<BllArrivalNotice>().First(m => m.IsDel == "0" && m.ASNNo == model.ASNNo);
+ if (asnData != null && (asnData.Type == "0" || asnData.Type == "3"))
+ {
+ var count = Db.Queryable<BllBoxInfo>().Count(m => m.IsDel == "0" && m.Status == "0" && m.BoxNo == model.BoxNo);
+ if (count == 0)
+ {
+ GetBoxInfoByFuMa(model.BoxNo, ""); //浠庤祴鐮佺郴缁熻幏鍙栫鐮佷俊鎭�
+ }
+ }
+
}
-
string sqlString = $@"SELECT
ASNNo,
BoxNo,
@@ -1819,7 +1843,7 @@
AND BoxNo = '{model.BoxNo}'
GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo; ";
var models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString);
- if (models == null)
+ if (models.Count == 0)
{
throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦�!");
}
@@ -2223,29 +2247,29 @@
factQty += box.Qty;
boxFullQty += box.Qty;
}
- if (boxFullQty > bNum)
- {
- throw new Exception($"缁戝畾澶辫触锛寋g.Key}绠辩爜缁戝畾鏁伴噺澶т簬璇ョ墿鍝佸寘瑁呮暟閲忥紒");
- }
+ //if (boxFullQty > bNum)
+ //{
+ // throw new Exception($"缁戝畾澶辫触锛寋g.Key}绠辩爜缁戝畾鏁伴噺澶т簬璇ョ墿鍝佸寘瑁呮暟閲忥紒");
+ //}
}
Db.Updateable(boxInfoList).ExecuteCommand();
// 鏇存柊鎵樼洏缁戝畾琛�
bind.Qty += factQty;
}
- if (bind.FullQty < bind.Qty && isDeposit == 0 && isTextTable == 0)
- {
- throw new Exception("鎵樼洏缁戝畾鏁伴噺宸茶秴鍑鸿鐗╂枡鍖呰鏁伴噺");
- }
+ //if (bind.FullQty < bind.Qty && isDeposit == 0 && isTextTable == 0)
+ //{
+ // throw new Exception("鎵樼洏缁戝畾鏁伴噺宸茶秴鍑鸿鐗╂枡鍖呰鏁伴噺");
+ //}
- if (bind.FullQty == bind.Qty)
+ if (bind.FullQty <= bind.Qty)
{
bind.BitPalletMark = "0";
}
- if (bind.Qty > pNum && isDeposit == 0 && isTextTable == 0)
- {
- throw new Exception($"缁戝畾澶辫触锛寋bind.PalletNo}鎵樼洏缁戝畾鏁伴噺澶т簬璇ョ墿鍝佹墭鐩樺寘瑁呮暟閲忥紒");
- }
+ //if (bind.Qty > pNum && isDeposit == 0 && isTextTable == 0)
+ //{
+ // throw new Exception($"缁戝畾澶辫触锛寋bind.PalletNo}鎵樼洏缁戝畾鏁伴噺澶т簬璇ョ墿鍝佹墭鐩樺寘瑁呮暟閲忥紒");
+ //}
Db.Updateable(bind).Where(m => m.Id == bindId).ExecuteCommand();
// 鏇存敼鍏ュ簱鍗曟槑缁嗗凡缁勬暟閲�
@@ -2512,7 +2536,7 @@
PackagNo = sku.PackagNo,
IsBale = bindInfo.IsBale,
IsBelt = bindInfo.IsBelt,
-
+ Demo = bindInfo.Demo,
CreateUser = (int)model.CreateUser,
CreateTime = serverTime
};
--
Gitblit v1.8.0