diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs index ed180f1..a9a493c 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs @@ -1219,8 +1219,8 @@ namespace ICSSoft.DataProject try { #region ERP - string sql = @"SELECT a.VenCode+a.DepCode+a.DNCode+a.MUSER AS Costre,a.VenCode,a.DepCode,a.ODNCode AS DNCode,a.MUSER,a.MTIME, - a.Sequence,a.InvCode,Sum(x.Quantity) AS Quantity,a.Amount,ISNULL(a.UnitPrice,0) AS UnitPrice,a.Currency,a.ODNDetailID AS DNDetailID + string sql = @"SELECT a.VenCode+a.DepCode+a.ODNCode+a.MUSER AS Costre,a.VenCode,a.DepCode,a.ODNCode,a.MUSER,a.MTIME, + a.Sequence,a.InvCode,Sum(x.Quantity) AS Quantity,a.Amount,ISNULL(a.UnitPrice,0) AS UnitPrice,a.Currency,a.ODNDetailID ,a.WorkPoint,ISNULL(ext.ProjectCode, '') AS ProjectCode,CASE WHEN 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 INTO #TempERP @@ -1233,8 +1233,8 @@ namespace ICSSoft.DataProject a.WorkPoint,ISNULL(ext.ProjectCode, ''),ISNULL(invBat.BatchEnable, ''),ISNULL(ext.BatchCode, ''),ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') - SELECT DISTINCT Costre,WorkPoint,VenCode,DepCode,DNCode,MUSER AS [User],SYSDATETIME() AS MTime FROM #TempERP - SELECT Costre,Sequence,InvCode,Quantity,Amount,UnitPrice,Currency,DNDetailID,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10 + SELECT DISTINCT Costre,WorkPoint,VenCode,DepCode,ODNCode,MUSER AS [User],SYSDATETIME() AS MTime FROM #TempERP + SELECT Costre,Sequence,InvCode,Quantity,Amount,UnitPrice,Currency,ODNDetailID,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10 FROM #TempERP DROP TABLE #TempERP"; diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs index c2b853d..ee9cdda 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs @@ -503,7 +503,7 @@ namespace ICSSoft.DataProject FROM ICSDeliveryNotice a INNER JOIN ICSExtension ext ON a.ExtensionID=ext.ID AND a.WorkPoint=ext.WorkPoint INNER JOIN ICSInventory invBat ON a.InvCode=invBat.InvCode AND a.WorkPoint=invBat.WorkPoint - INNER JOIN ICSDeliveryNotice x ON a.DNDetailID=x.PODetailID AND a.Sequence=x.Sequence AND a.WorkPoint=x.WorkPoint + INNER JOIN ICSDeliveryNotice x ON a.DNDetailID=x.PODetailID AND a.WorkPoint=x.WorkPoint WHERE a.DNCode='{0}' AND a.WorkPoint='{1}' GROUP BY a.VenCode,a.DepCode,a.DNCode,a.MUSER,a.MTIME,a.Sequence,a.InvCode,a.Amount,a.Quantity,a.UnitPrice,a.Currency,a.DNDetailID, a.WorkPoint,ISNULL(ext.ProjectCode, ''),ISNULL(invBat.BatchEnable, ''),ISNULL(ext.BatchCode, ''),ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index e28abb7..78ff50f 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -682,8 +682,8 @@ namespace ICSSoft.DataProject #region 判断是否启用匹配库位 string sqlCheckSign = @"select F_EnabledMark from Sys_SRM_Items where F_EnCode = 'OutWithLocationCode'and F_EnabledMark = '1'"; DataTable flag = DBHelper.SQlReturnData(sqlCheckSign, cmd); - // if (flag != null && flag.Rows.Count > 0) - if (true) + if (flag != null && flag.Rows.Count > 0) + // if (true) { sql = @"select * into #maintemp from (" + sql + @")a select * into #resulttemp from #maintemp @@ -1696,6 +1696,7 @@ namespace ICSSoft.DataProject CheckTrans(dataView, rowFilter, string.Format(language.GetNameByCode("WMSAPIInfo041"), Lot, drLot["InvCode"])); rowFilter += " AND (LEN(ISNULL(WHCode,''))<=0 OR (LEN(ISNULL(WHCode,''))>0 AND WHCode='" + drLot["WHCode"] + "'))"; CheckTrans(dataView, rowFilter, string.Format(language.GetNameByCode("WMSAPIInfo042"), Lot, drLot["WHCode"])); + rowFilter += " AND (LEN(ISNULL(ProjectCode,''))<=0 OR (LEN(ISNULL(ProjectCode,''))>0 AND ProjectCode='" + drLot["ProjectCode"] + "'))"; CheckTrans(dataView, rowFilter, string.Format(language.GetNameByCode("WMSAPIInfo043"), Lot, drLot["ProjectCode"])); rowFilter += "AND (LEN(ISNULL(BatchCode,''))<=0 OR (LEN(ISNULL(BatchCode,''))>0 AND BatchCode='" + drLot["BatchCode"] + "'))"; @@ -4959,7 +4960,7 @@ namespace ICSSoft.DataProject INSERT INTO ICSCheck (ID,CheckCode,SelectLevel,Status,Quantity,Amount,MUSER,MUSERName,MTIME,WorkPoint) SELECT NEWID(),'{0}','{1}','2',SUM(a.Quantity),0,b.F_Account,b.F_RealName,GETDATE(),b.F_Location FROM ICSWareHouseLotInfo a - INNER JOIN Sys_SRM_User b ON b.F_Account='{2}' AND b.F_Location='{3}' + INNER JOIN Sys_SRM_User b ON b.F_Account='{2}' AND b.F_Location='{3}' WHERE SUBSTRING(a.LocationCode,1,{4}) = '{1}' GROUP BY b.F_Account,b.F_RealName,b.F_Location"; sql = string.Format(sql, Code, itemInfo.SelectLevel, item.User, item.WorkPoint, len);