From 2be1922b035c182c3c516427aa68be54badd6938 Mon Sep 17 00:00:00 2001 From: IPC-610 <IPC-610@DESKTOP-6LEOOS3> Date: 星期四, 26 九月 2024 15:15:52 +0800 Subject: [PATCH] 登录页修改 --- Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 42 +++++++++++++++++++++++++++++++++--------- 1 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs index 71607ea..d8ef676 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("绠辩爜淇℃伅涓嶅瓨鍦�!"); } -- Gitblit v1.8.0