From f6967e80f54e17bf1386b41748519cc468228183 Mon Sep 17 00:00:00 2001 From: lilili Date: Tue, 4 Jul 2023 09:20:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ICSSoft.DataProject/ICSSubmitService.cs | 21 ++++++-- .../ICSWareHouseLotInfoService.cs | 51 ++++++++++++++++--- 2 files changed, 62 insertions(+), 10 deletions(-) diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index ba3cb15..e5c99bb 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -5996,6 +5996,7 @@ namespace ICSSoft.DataProject public static DataTable LOTSplitCreate(List JsonData) { var language = LanguageHelper.GetName("WMSAPIInfo"); + DataTable printTable = new DataTable(); if (JsonData.Count <= 0) { throw new Exception(language.GetNameByCode("WMSAPIInfo007"));//"传送数据为空!" @@ -6033,13 +6034,25 @@ namespace ICSSoft.DataProject } //拆分后日志 - ICSWareHouseLotInfoService.WareHouseLotInfoLog(Identification, item.LotNo, item.User, item.WorkPoint, "4", + printTable = ICSWareHouseLotInfoService.WareHouseLotInfoLog(Identification, item.LotNo, item.User, item.WorkPoint, "4", TransTypeEnum.LOTSplitAfter.GetDescription(), cmd, language); } - DataTable table = GetData(Identification, 1, cmd); - cmd.Transaction.Commit(); - return table; + //DataTable table = GetData(Identification, 1, cmd); + //cmd.Transaction.Commit(); + //return table; + + if (!printTable.Equals("{}")) + { + cmd.Transaction.Commit(); + return printTable; + } + else + { + DataTable table = GetData(Identification, 1, cmd); + cmd.Transaction.Commit(); + return table; + } } catch (Exception ex) { diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs index 47e89d1..65c3f45 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs @@ -1573,15 +1573,16 @@ namespace ICSSoft.DataProject } if (PrintEnable.Equals("True")) { - sql = @"select A.LotNO AS OLDLotNo , C.Quantity AS OLDLotQty, A.eattribute1 as LotNO, B.Quantity AS LotQty ,b.InvCode,d.INVSTD,d.INVNAME,b.MTIME,A.TransCode + sql = @"select A.LotNO , C.Quantity AS OLDLotQty, B.Quantity AS LotQty ,b.InvCode,d.INVSTD,d.INVNAME,b.MTIME,A.TransCode from ICSWareHouseLotInfolog A left join ICSInventoryLot B on A.LotNO=B.LotNO and a.WorkPoint=b.WorkPoint left join ICSWareHouseLotInfo C ON A.LotNO=C.LotNO and a.WorkPoint=c.WorkPoint left join ICSInventory D on b.INVCODE=d.INVCODE and b.WorkPoint=d.WorkPoint - where a.BusinessCode ='105' - and A.lotno like'{0}%' and a.workpoint='{1}' + where (a.BusinessCode ='{2}' or a.BusinessCode='32') + and A.lotno like '{0}%' and a.workpoint='{1}' + and a.TransCode='{3}' and a.TransSequence='{4}' "; - sql = string.Format(sql, LotNo, tranferWorkpoint); + sql = string.Format(sql, LotNo, WorkPoint, BusinessCode, TransCode, TransSequence); dtLotno = DBHelper.SQlReturnData(sql, cmd); lstDt = dtLotno; } @@ -1786,12 +1787,34 @@ namespace ICSSoft.DataProject /// /// /// - public static void WareHouseLotInfoLog(string Identification, string LotNo, string User, string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary language) + public static DataTable WareHouseLotInfoLog(string Identification, string LotNo, string User, string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary language) { + String LotEnable = ""; + String PrintEnable = ""; + DataTable dtLotno = new DataTable(); + DataTable lstDt = new DataTable(); try { + + + //检验是否分批 + string sql = @"SELECT b.LotEnable,b.PrintEnable FROM ICSInventoryLot a + LEFT JOIN ICSInventory b ON a.InvCode=b.InvCode AND a.WorkPoint=b.WorkPoint + where a.LotNo='{0}' and a.WorkPoint='{1}' + "; + sql = string.Format(sql, LotNo, WorkPoint); + DataTable dt = DBHelper.SQlReturnData(sql, cmd); + if (dt.Rows.Count == 0) + { + throw new Exception(language.GetNameByCode("WMSAPIInfo369")); + } + else + { + LotEnable = dt.Rows[0]["LotEnable"].ToString(); + PrintEnable = dt.Rows[0]["PrintEnable"].ToString(); + } ///添加日志 - string sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}') + sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}') BEGIN RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo060"), "{2}") + @"',16,1); RETURN @@ -1819,11 +1842,27 @@ namespace ICSSoft.DataProject { throw new Exception(language.GetNameByCode("WMSAPIInfo166")); } + + if (PrintEnable.Equals("True")) + { + sql = @"select A.LotNO , C.Quantity AS OLDLotQty, B.Quantity AS LotQty ,b.InvCode,d.INVSTD,d.INVNAME,b.MTIME,A.TransCode + from ICSWareHouseLotInfolog A + left join ICSInventoryLot B on A.LotNO=B.LotNO and a.WorkPoint=b.WorkPoint + left join ICSWareHouseLotInfo C ON A.LotNO=C.LotNO and a.WorkPoint=c.WorkPoint + left join ICSInventory D on b.INVCODE=d.INVCODE and b.WorkPoint=d.WorkPoint + where a.BusinessCode='32' + and A.lotno like '{0}%' and a.workpoint='{1}' + "; + sql = string.Format(sql, LotNo, WorkPoint, BusinessCode); + dtLotno = DBHelper.SQlReturnData(sql, cmd); + lstDt = dtLotno; + } } catch (Exception) { throw; } + return lstDt; } ///