From b31f32fbfb25c77567e3853e05ca114dd2a00fbe Mon Sep 17 00:00:00 2001
From: chengsc <Demo@DESKTOP-CPA90BF>
Date: 星期一, 14 十月 2024 18:58:22 +0800
Subject: [PATCH] 修改问题
---
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 44 ++++++++++++++++++++++++++++++++++----------
1 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index 71607ea..c905806 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("绠辩爜淇℃伅涓嶅瓨鍦�!");
}
@@ -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