From 260c6e54c4f100ca49376a6afd70f73843868171 Mon Sep 17 00:00:00 2001 From: bklLiudl <673013083@qq.com> Date: 星期三, 28 八月 2024 08:49:35 +0800 Subject: [PATCH] 组托收货测试 --- Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs | 56 ++++++++++++++++++++++++++++++++------------------------ 1 files changed, 32 insertions(+), 24 deletions(-) diff --git a/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs b/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs index c7bb748..f2de73b 100644 --- a/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs +++ b/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs @@ -31,7 +31,12 @@ /// <returns></returns> public List<BllQualityInspectDto> GetBllQualityList(BllQualityInspect model) { - string str = "select q.Id Id,q.InspectNo InspectNo,q.ASNNo ASNNo,q.LotNo LotNo,q.SupplierLot SupplierLot,q.SkuNo SkuNo,q.SkuName SkuName,q.Standard Standard,q.PassQty PassQty,q.FailQty FailQty,q.Origin Origin,q.InspectTime InspectTime,q.IsOut IsOut,q.Demo Demo,q.IsQualified IsQualified,q.IsDel IsDel,q.CreateTime CreateTime,u.RealName CreateUserName,q.UpdateTime UpdateTime,q.UpdateUser UpdateUserName from BllQualityInspect q left join SysUserInfor u on q.CreateUser = u.id where q.IsDel = @isdel"; + string str = "select q.Id Id,q.InspectNo InspectNo,q.ASNNo ASNNo,q.LotNo LotNo,q.SupplierLot SupplierLot," + + "q.SkuNo SkuNo,q.SkuName SkuName,q.Standard Standard,q.PassQty PassQty,q.FailQty FailQty,q.Origin Origin," + + "q.InspectTime InspectTime,q.IsOut IsOut,q.Demo Demo,q.IsQualified IsQualified,q.IsDel IsDel,q.CreateTime " + + "CreateTime,u.RealName CreateUserName,q.UpdateTime UpdateTime,q.UpdateUser UpdateUserName " + + "from BllQualityInspect q " + + "left join SysUserInfor u on q.CreateUser = u.id where q.IsDel = @isdel"; ////鍒ゆ柇鍏ュ簱鍗曞彿鏄惁涓虹┖ //if (!string.IsNullOrEmpty(model.ASNNo)) @@ -111,23 +116,25 @@ { throw new Exception("鎵规鍙蜂笉鍙负绌猴紝璇锋牳鏌ワ紒"); } - //int isTui = 0; //楠岃瘉鍏ュ簱鍗曞彿鏄惁涓虹┖ - if (!string.IsNullOrEmpty(model.ASNNo)) + if (string.IsNullOrEmpty(model.ASNNo)) { - //鏌ヨ鏄惁涓洪��璐у叆搴撳崟鎹� - var Arrival = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.ASNNo == model.ASNNo && a.Type == "3"); - if (Arrival == null) - { - throw new Exception("鍙湁鍏ュ簱鍗曟嵁涓洪��璐у叆搴撳崟鍙緭鍏� 鍏ュ簱鍗曞彿锛岃鏍告煡锛�"); - } + throw new Exception("鍏ュ簱鍗曞彿涓嶅彲涓虹┖锛�"); - //鑾峰彇鍏ュ簱鍗曟槑缁� - var ArrivalDetail = Db.Queryable<BllArrivalNoticeDetail>().First(a => a.IsDel == "0" && a.ASNNo == model.ASNNo && a.LotNo.Contains(model.LotNo) && a.SkuNo == model.SkuNo); - if (ArrivalDetail == null) - { - throw new Exception("杈撳叆鐨勬壒娆℃垨鐗╂枡淇℃伅涓庡叆搴撳崟鎹笉绗︼紝璇锋牳鏌ワ紒"); - } + + //鏌ヨ鏄惁涓洪��璐у叆搴撳崟鎹� + //var Arrival = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.ASNNo == model.ASNNo && a.Type == "3"); + //if (Arrival == null) + //{ + // throw new Exception("鍙湁鍏ュ簱鍗曟嵁涓洪��璐у叆搴撳崟鍙緭鍏� 鍏ュ簱鍗曞彿锛岃鏍告煡锛�"); + //} + + ////鑾峰彇鍏ュ簱鍗曟槑缁� + //var ArrivalDetail = Db.Queryable<BllArrivalNoticeDetail>().First(a => a.IsDel == "0" && a.ASNNo == model.ASNNo && a.LotNo.Contains(model.LotNo) && a.SkuNo == model.SkuNo); + //if (ArrivalDetail == null) + //{ + // throw new Exception("杈撳叆鐨勬壒娆℃垨鐗╂枡淇℃伅涓庡叆搴撳崟鎹笉绗︼紝璇锋牳鏌ワ紒"); + //} //isTui = 1; } @@ -148,7 +155,13 @@ //} ////鏌ユ壘鍚屾壒娆� 鍚屽崟鎹� 鍏ュ簱鍗曚俊鎭�� - //BllArrivalNoticeDetail arrivalDetail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.ASNNo == model.ASNNo && m.LotNo == model.LotNo); + BllArrivalNoticeDetail arrivalDetail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" + && m.ASNNo == model.ASNNo && m.LotNo == model.LotNo && m.SkuNo == model.SkuNo); + if (arrivalDetail == null) + { + throw new Exception("鏈壘鍒板叆搴撳崟淇℃伅锛�"); + } + arrivalDetail.InspectStatus = model.IsQualified; model.Origin = "WMS"; //鏉ユ簮 model.CreateTime = Db.GetDate(); //鍒涘缓鏃ユ湡 @@ -171,24 +184,19 @@ model.PassQty += item.Qty; //淇敼搴撳瓨鏄庣粏鍚堟牸鐘舵�� item.InspectStatus = "1"; //1鍚堟牸 - //foreach (var b1 in box) - //{ - // b1.InspectMark = "1"; //1鍚堟牸 - //} } else //涓嶅悎鏍� { //涓嶅悎鏍� 鐩稿悓鎵规銆佸叆搴撳崟搴撳瓨淇℃伅鍏ㄩ儴鏀逛负涓嶅悎鏍肩墿鏂� 涓斾笉鍚堟牸鏁伴噺澧炲姞涓哄悓鎵规鍚屽崟鍙疯鐗╂枡鍏ㄩ儴鏁伴噺涔嬪拰 model.FailQty += item.Qty; item.InspectStatus = "2"; //2涓嶅悎鏍� - //foreach (var b1 in box) - //{ - // b1.InspectMark = "2"; //2涓嶅悎鏍� - //} } + Db.Updateable(box).ExecuteCommand(); Db.Updateable(item).ExecuteCommand(); } + + Db.Updateable(arrivalDetail).ExecuteCommand(); var isquality = Db.Insertable(model).ExecuteCommand(); return isquality; -- Gitblit v1.8.0