From 8b7df2039d2060c72c0b58a27c8767c3831581fe Mon Sep 17 00:00:00 2001 From: FoxV Date: Mon, 26 Sep 2022 19:20:38 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=94=9F=E4=BA=A7/=E5=A7=94=E5=A4=96?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E7=BB=99ERP=E4=BC=A0=E5=80=BC=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AD=90=E4=BB=B6=E5=BA=93=E4=BD=8D=202.=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=96=99=E5=93=81=E7=AE=A1=E6=8E=A7=E6=9D=A1=E7=A0=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ICSManufactureService.cs | 5 +- .../ICSOutsourcingService.cs | 5 +- .../ICSWareHouseLotInfoService.cs | 47 ++++++++++++++++--- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs index 6f983ca..825ad46 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs @@ -798,7 +798,7 @@ namespace ICSSoft.DataProject SELECT Costre,Costre2,TransSequence,Sequence,InvCode,Quantity,Amount,MODetailID,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10 FROM #TempERP - SELECT c.MODetailID AS Costre2,a.TransCode,a.TransSequence AS Sequence,a.InvCode,a.Quantity,c.Amount,c.PickID,ISNULL(ext.ProjectCode, '') AS ProjectCode,CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END AS BatchCode,ISNULL(ext.Version, '') AS Version,ISNULL(ext.Brand, '') AS Brand,ISNULL(ext.cFree1, '') AS cFree1,ISNULL(ext.cFree2, '') AS cFree2,ISNULL(ext.cFree3, '') AS cFree3,ISNULL(ext.cFree4, '') AS cFree4,ISNULL(ext.cFree5, '') AS cFree5,ISNULL(ext.cFree6, '') AS cFree6,ISNULL(ext.cFree7, '') AS cFree7,ISNULL(ext.cFree8, '') AS cFree8,ISNULL(ext.cFree9, '') AS cFree9,ISNULL(ext.cFree10, '') AS cFree10 + SELECT c.WHCode,c.MODetailID AS Costre2,a.TransCode,a.TransSequence AS Sequence,a.InvCode,c.Quantity/b.Quantity*a.Quantity as Quantity,c.Amount,c.PickID,ISNULL(ext.ProjectCode, '') AS ProjectCode,CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END AS BatchCode,ISNULL(ext.Version, '') AS Version,ISNULL(ext.Brand, '') AS Brand,ISNULL(ext.cFree1, '') AS cFree1,ISNULL(ext.cFree2, '') AS cFree2,ISNULL(ext.cFree3, '') AS cFree3,ISNULL(ext.cFree4, '') AS cFree4,ISNULL(ext.cFree5, '') AS cFree5,ISNULL(ext.cFree6, '') AS cFree6,ISNULL(ext.cFree7, '') AS cFree7,ISNULL(ext.cFree8, '') AS cFree8,ISNULL(ext.cFree9, '') AS cFree9,ISNULL(ext.cFree10, '') AS cFree10 FROM ICSWareHouseLotInfoLog a INNER JOIN ICSMO b ON b.MOCode=a.TransCode AND b.WorkPoint=a.WorkPoint INNER JOIN ICSMOPick c ON c.MODetailID=b.MODetailID AND c.WorkPoint=b.WorkPoint AND a.TransSequence=b.Sequence+'~'+c.Sequence @@ -833,7 +833,7 @@ namespace ICSSoft.DataProject foreach (var details in resdetails) { JObject dets = (JObject)details; - ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["MODetailID"].ToString(), Identification, det["ERPID"].ToString(), + ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["MODetailID"].ToString(), Identification, dets["ERPID"].ToString(), dets["ERPDetailID"].ToString(), dets["MRCVCode"].ToString(), dets["Sequence"].ToString(), cmd, language); } } @@ -843,6 +843,7 @@ namespace ICSSoft.DataProject { log.Debug(ex.ToString()); log.Debug(resultStr); + throw new Exception(language.GetNameByCode("WMSAPIInfo200") + ex); } } else diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs index 1c75399..11683df 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs @@ -887,7 +887,7 @@ namespace ICSSoft.DataProject SELECT DISTINCT Costre,WorkPoint,VenCode,WarehouseCode AS WHCode,OOCode,ODNCode,MUSER AS [User],SYSDATETIME() AS MTime,Enable,UpdateTodoQuantity,CompleteVerification FROM #TempERP SELECT Costre,Costre2,Sequence,ODNSequence,InvCode,Quantity,Amount,OODetailID,Currency,UnitPrice,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10 FROM #TempERP - SELECT c.OODetailID AS Costre2,a.TransCode,a.TransSequence AS Sequence,a.InvCode,a.Quantity,c.Amount,c.PickID,ISNULL(ext.ProjectCode, '') AS ProjectCode,CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END AS BatchCode,ISNULL(ext.Version, '') AS Version,ISNULL(ext.Brand, '') AS Brand,ISNULL(ext.cFree1, '') AS cFree1,ISNULL(ext.cFree2, '') AS cFree2,ISNULL(ext.cFree3, '') AS cFree3,ISNULL(ext.cFree4, '') AS cFree4,ISNULL(ext.cFree5, '') AS cFree5,ISNULL(ext.cFree6, '') AS cFree6,ISNULL(ext.cFree7, '') AS cFree7,ISNULL(ext.cFree8, '') AS cFree8,ISNULL(ext.cFree9, '') AS cFree9,ISNULL(ext.cFree10, '') AS cFree10 + SELECT c.WHCode,c.OODetailID AS Costre2,a.TransCode,a.TransSequence AS Sequence,a.InvCode,c.Quantity/b.Quantity*a.Quantity as Quantity,c.Amount,c.PickID,ISNULL(ext.ProjectCode, '') AS ProjectCode,CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END AS BatchCode,ISNULL(ext.Version, '') AS Version,ISNULL(ext.Brand, '') AS Brand,ISNULL(ext.cFree1, '') AS cFree1,ISNULL(ext.cFree2, '') AS cFree2,ISNULL(ext.cFree3, '') AS cFree3,ISNULL(ext.cFree4, '') AS cFree4,ISNULL(ext.cFree5, '') AS cFree5,ISNULL(ext.cFree6, '') AS cFree6,ISNULL(ext.cFree7, '') AS cFree7,ISNULL(ext.cFree8, '') AS cFree8,ISNULL(ext.cFree9, '') AS cFree9,ISNULL(ext.cFree10, '') AS cFree10 FROM ICSWareHouseLotInfoLog a INNER JOIN ICSOutsourcingOrder b ON b.OOCode=a.TransCode AND b.WorkPoint=a.WorkPoint INNER JOIN ICSOOPick c ON c.OODetailID=b.OODetailID AND c.WorkPoint=b.WorkPoint AND a.TransSequence=b.Sequence+'~'+c.Sequence @@ -922,7 +922,7 @@ namespace ICSSoft.DataProject foreach (var details in resdetails) { JObject dets = (JObject)details; - ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["OODetailID"].ToString(), Identification, det["ERPID"].ToString(), + ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["OODetailID"].ToString(), Identification, dets["ERPID"].ToString(), dets["ERPDetailID"].ToString(), dets["MRCVCode"].ToString(), dets["Sequence"].ToString(), cmd, language); } } @@ -932,6 +932,7 @@ namespace ICSSoft.DataProject { log.Debug(ex.ToString()); log.Debug(resultStr); + throw new Exception(language.GetNameByCode("WMSAPIInfo200") + ex); } } else diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs index e593499..280715d 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs @@ -178,10 +178,10 @@ namespace ICSSoft.DataProject SELECT c.MOCode AS TransCode, a.MODetailID AS DetailID, - a.InvCode, - b.InvName, - b.InvStd, - a.Quantity, + a.InvCode, + b.InvName, + b.InvStd, + a.Quantity, a.Amount, a.Sequence AS TransSequence, a.IssueQuantity, @@ -478,8 +478,43 @@ namespace ICSSoft.DataProject if (mode.itemCode.Equals("ControlMode02")) { //查询是否存在料品管控的条码 - string jsonStrNew = ICSControlModeService.QueryLotNo(jointLotNo, WorkPoint); - List modelNew = JsonConvert.DeserializeObject>(jsonStrNew); + string sqlStrNew = @"SELECT a.ID, + con.ContainerCode, + con.ContainerName, + a.LotNo, + a.InvCode, + inv.InvName, + inv.InvStd, + inv.InvUnit,-- {0} + inv.AmountUnit, + ext.ID AS ExtensionID, + ext.ProjectCode, + ext.Version, + ext.BatchCode, + ext.Brand, + ext.cFree1, + ext.cFree2, + ext.cFree3, + ext.cFree4, + ext.cFree5, + ext.cFree6, + ext.cFree7, + ext.cFree8, + ext.cFree9, + ext.cFree10, + a.MUSER AS [ USER ], + a.MTIME AS [ MTime ] + FROM + ICSInventoryLot a + LEFT JOIN ICSContainerLot conlot ON a.LotNo = conlot.LotNo AND a.WorkPoint = conlot.WorkPoint + LEFT JOIN ICSContainer con ON conlot.ContainerID = con.ID AND conlot.WorkPoint = con.WorkPoint + INNER JOIN ICSInventory inv ON a.InvCode = inv.InvCode AND a.WorkPoint = inv.WorkPoint + INNER JOIN ICSExtension ext ON a.ExtensionID = ext.ID AND a.WorkPoint = ext.WorkPoint + WHERE a.LotNo='{0}' AND a.WorkPoint='{1}'"; + sqlStrNew = string.Format(sqlStrNew, jointLotNo, WorkPoint); + DataTable table = DBHelper.SQlReturnData(sqlStrNew, cmd); + string json = JsonConvert.SerializeObject(table); + List modelNew = JsonConvert.DeserializeObject>(json); //当不存在料品管控条码时,生成新条码 if (!(modelNew.Count > 0))