姜鹏 1 week ago
parent
commit
4861b3dc14
  1. 6
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs
  2. 23
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs
  3. 17
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

6
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs

@ -665,7 +665,7 @@ INTO #NewTempERP
from ICSWareHouseLotInfoLog
WHERE Identification='{0}' AND ERPUpload='0' AND BusinessCode = '14'
SELECT (CASE WHEN isnull(conWhCode.Enable,0)='0' then a.FromWarehouseCode ELSE '' END)+b.ApplyCode+a.MUSER+ISNULL(b.SourceCode,'')+ISNULL(c.DepCode,'') AS Costre,a.FromWarehouseCode AS WarehouseCode,b.ApplyCode,ISNULL(b.SourceCode,'') AS SourceCode,ISNULL(c.DepCode,'') AS DepCode,a.MUSER,ROW_NUMBER() OVER (ORDER BY a.FromWarehouseCode,b.ApplyCode,b.ApplyDetailID,a.InvCode) AS Sequence,
SELECT (CASE WHEN isnull(conWhCode.Enable,0)='0' then a.FromWarehouseCode ELSE '' END)+b.ApplyCode+a.MUSER+ISNULL(b.SourceCode,'')+ISNULL(c.DepCode,'') AS Costre,b.ApplyID,a.FromWarehouseCode AS WarehouseCode,b.ApplyCode,ISNULL(b.SourceCode,'') AS SourceCode,ISNULL(c.DepCode,'') AS DepCode,a.MUSER,ROW_NUMBER() OVER (ORDER BY a.FromWarehouseCode,b.ApplyCode,b.ApplyDetailID,a.InvCode) AS Sequence,
a.InvCode,SUM(a.Quantity) AS Quantity,CASE inv.AmountEnable WHEN '1' THEN SUM(a.Quantity*(b.Amount/b.Quantity)) ELSE '0' END AS Amount,b.ApplyDetailID,con.Enable AS UpdateTodoQuantity,conStock.Enable AS UpdateStock,conWhCode.Enable AS ErpWhCode
,a.WorkPoint,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,conv.Enable AS CompleteVerification
@ -682,11 +682,11 @@ SELECT (CASE WHEN isnull(conWhCode.Enable,0)='0' then a.FromWarehouseCode ELSE '
INNER JOIN ICSConfiguration conv ON conv.Code='CompleteVerification001' AND a.WorkPoint=conv.WorkPoint
INNER JOIN ICSConfiguration conStock ON conStock.Code='UpdateStock002' AND a.WorkPoint=conStock.WorkPoint
INNER JOIN ICSConfiguration conWhCode ON conWhCode.Code='ERPWHCode' AND a.WorkPoint=conWhCode.WorkPoint
GROUP BY inv.AmountEnable,conWhCode.Enable,a.FromWarehouseCode,b.ApplyCode,b.SourceCode,c.DepCode,a.MUSER,a.InvCode,b.ApplyDetailID,con.Enable,conv.Enable,conStock.Enable
GROUP BY b.ApplyID,inv.AmountEnable,conWhCode.Enable,a.FromWarehouseCode,b.ApplyCode,b.SourceCode,c.DepCode,a.MUSER,a.InvCode,b.ApplyDetailID,con.Enable,conv.Enable,conStock.Enable
,a.WorkPoint,ISNULL(ext.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,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, ''),b.EATTRIBUTE2,b.EATTRIBUTE4,b.EATTRIBUTE,b.EATTRIBUTE7,a.transcode,b.EATTRIBUTE5 ,b.EATTRIBUTE8,b.EATTRIBUTE3
SELECT DISTINCT Costre,WorkPoint,ISNULL(DepCode,'') AS DepCode,CASE WHEN isnull(ErpWhCode,0)='0' then WarehouseCode ELSE '' END AS WHCode,'' AS SourceType,ApplyCode AS SourceCode,ISNULL(SourceCode,'') AS IssueCode ,MUSER AS [User],SYSDATETIME() AS MTime,UpdateTodoQuantity,CompleteVerification,UpdateStock,DocType,ClientCode,HcFree4,HcFree2,HcFree3,HcFree1 FROM #TempERP
SELECT DISTINCT Costre,WorkPoint,ISNULL(DepCode,'') AS DepCode,CASE WHEN isnull(ErpWhCode,0)='0' then WarehouseCode ELSE '' END AS WHCode,'' AS SourceType,ApplyID AS SourceCode,ISNULL(SourceCode,'') AS IssueCode ,MUSER AS [User],SYSDATETIME() AS MTime,UpdateTodoQuantity,CompleteVerification,UpdateStock,DocType,ClientCode,HcFree4,HcFree2,HcFree3,HcFree1 FROM #TempERP
SELECT Costre,Sequence,InvCode,Quantity,Amount,CASE WHEN isnull(ErpWhCode,0)='1' then WarehouseCode ELSE '' END AS WHCode,ApplyDetailID AS SourceDetailID,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10,Project,Dep FROM #TempERP
DROP TABLE #TempERP

23
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs

@ -2014,7 +2014,9 @@ DROP TABLE #NewTempERP";
string sql = @"DECLARE @Status VARCHAR(10)
SELECT @Status=c.Status FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSODeliveryNotice c ON b.TransCode=c.ODNCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSOutsourcingOrder D ON B.TransCode=D.OOCode AND B.TransSequence=D.Sequence AND B.WorkPoint=D.WorkPoint
INNER JOIN ICSODeliveryNotice c ON C.OODetailID=D.OODetailID AND A.InvCode=C.InvCode AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSOASNDetail E ON E.LotNo=A.LotNo AND C.OASNCode=E.OASNCode AND E.WorkPoint=A.WorkPoint
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND c.ODNType='1'
IF (@Status IS NULL)
@ -2030,11 +2032,15 @@ DROP TABLE #NewTempERP";
UPDATE c SET RCVQuantity=ISNULL(RCVQuantity,0)+'{2}'
FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSODeliveryNotice c ON b.TransCode=c.ODNCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSOutsourcingOrder D ON B.TransCode=D.OOCode AND B.TransSequence=D.Sequence AND B.WorkPoint=D.WorkPoint
INNER JOIN ICSODeliveryNotice c ON C.OODetailID=D.OODetailID AND A.InvCode=C.InvCode AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSOASNDetail E ON E.LotNo=A.LotNo AND C.OASNCode=E.OASNCode AND E.WorkPoint=A.WorkPoint
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND c.ODNType='1'
IF EXISTS(SELECT a.LotNo FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSODeliveryNotice c ON b.TransCode=c.ODNCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSOutsourcingOrder D ON B.TransCode=D.OOCode AND B.TransSequence=D.Sequence AND B.WorkPoint=D.WorkPoint
INNER JOIN ICSODeliveryNotice c ON C.OODetailID=D.OODetailID AND A.InvCode=C.InvCode AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSOASNDetail E ON E.LotNo=A.LotNo AND C.OASNCode=E.OASNCode AND E.WorkPoint=A.WorkPoint
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND c.ODNType='1'
AND dbo.GetExcessInQty(c.InvCode, c.WorkPoint, 'OverIn005', c.Quantity,1,1,'')<c.RCVQuantity)
BEGIN
@ -2092,7 +2098,7 @@ INTO #NewTempERP
from ICSWareHouseLotInfoLog
WHERE Identification='{0}' AND ERPUpload='0'
SELECT c.VenCode+a.ToWarehouseCode+c.ODNCode+a.MUSER AS Costre,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.ODNCode ,a.MUSER,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.ODNDetailID,a.InvCode) AS Sequence,d.OOCode,d.OODetailID,
SELECT c.VenCode+a.ToWarehouseCode+c.ODNCode+a.MUSER AS Costre,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.ODNCode ,c.ODNID,d.OOID,a.MUSER,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.ODNDetailID,a.InvCode) AS Sequence,d.OOCode,d.OODetailID,
a.InvCode,SUM(a.Quantity) AS Quantity,CASE inv.AmountEnable WHEN '1' THEN SUM(a.Quantity*(lot.Amount/lot.Quantity)) ELSE '0' END AS Amount,isnull((c.UnitPrice),0) as UnitPrice,c.Currency,c.ODNDetailID,con.Enable AS UpdateTodoQuantity,conStock.Enable AS UpdateStock
,a.WorkPoint,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
@ -2103,15 +2109,16 @@ SELECT c.VenCode+a.ToWarehouseCode+c.ODNCode+a.MUSER AS Costre,c.VenCode,a.ToWar
INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.ToWarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSODeliveryNotice c ON b.TransCode=c.ODNCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
inner join ICSOutsourcingOrder d on c.OODetailID=d.OODetailID and c.WorkPoint=d.WorkPoint
INNER JOIN ICSOutsourcingOrder D ON B.TransCode=D.OOCode AND B.TransSequence=D.Sequence AND B.WorkPoint=D.WorkPoint
INNER JOIN ICSODeliveryNotice c ON C.OODetailID=D.OODetailID AND A.InvCode=C.InvCode AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSOASNDetail E ON E.LotNo=A.LotNo AND C.OASNCode=E.OASNCode AND E.WorkPoint=A.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
INNER JOIN ICSConfiguration conStock ON conStock.Code='UpdateStock001' AND a.WorkPoint=conStock.WorkPoint
GROUP BY d.OOCode,d.OODetailID,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.ODNCode,c.ODNID,a.MUSER,a.InvCode,c.ODNDetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conStock.Enable
GROUP BY c.ODNID,d.OOID,d.OOCode,d.OODetailID,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.ODNCode,c.ODNID,a.MUSER,a.InvCode,c.ODNDetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conStock.Enable
,a.WorkPoint,ISNULL(ext.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,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,WarehouseCode AS WHCode,ODNCode,OOCode,MUSER AS [User],SYSDATETIME() AS MTime,UpdateTodoQuantity,UpdateStock FROM #TempERP
SELECT DISTINCT Costre,WorkPoint,VenCode,WarehouseCode AS WHCode,ODNID as ODNCode, OOID AS OOCode,MUSER AS [User],SYSDATETIME() AS MTime,UpdateTodoQuantity,UpdateStock FROM #TempERP
SELECT Costre,Sequence,InvCode,Quantity,Amount,ODNDetailID,OODetailID,WarehouseCode AS WHCode,Currency,UnitPrice,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10
FROM #TempERP

17
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

@ -6111,6 +6111,18 @@ LEFT JOIN (SELECT SUM(Quantity) AS sumQty,SUM(InQuantity) AS sumIsQty,WorkPoint,
tableName = @"ICSSDN a ";
where = @" a.WorkPoint='{1}' AND a.Type='1' AND a.Status<>'3' and a.Quantity-ISNULL(a.SDNQuantity,0)>0 and a.EATTRIBUTE5='已检验'";
orderby = @" a.MTIME DESC";
}
#endregion
#region 销售出库(合并发料)
else if (TransType == TransTypeEnum.DisPatchInspect.GetDescription())
{
columns = @" DISTINCT a.SDNCode AS TransCode,a.MTIME";
tableName = @"ICSSDN a ";
where = @" a.WorkPoint='{1}' AND a.Type='1' AND a.Status<>'3' and a.Quantity-ISNULL(a.SDNQuantity,0)>0";
orderby = @" a.MTIME DESC";
@ -7787,6 +7799,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
|| TransType == TransTypeEnum.MOIssueDoc.GetDescription() //生产发料
|| TransType == TransTypeEnum.MOIssueAutoDoc.GetDescription() //生产发料——自动出库
|| TransType == TransTypeEnum.SalesShipmentDoc.GetDescription() //销售出库
|| TransType == TransTypeEnum.DisPatchInspect.GetDescription() //销售出库
|| TransType == TransTypeEnum.SalesShipmentOutDoc.GetDescription() //销售出库
|| TransType == TransTypeEnum.OneStepTransferDocIn.GetDescription() //一步调拨
|| TransType == TransTypeEnum.StepTransferDocIn.GetDescription() //调拨
@ -8634,10 +8647,6 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
for (int i = 0; i < ZLtable.Rows.Count; i++)
{
if (TransType == TransTypeEnum.DisPatchInspect.GetDescription())
{
JsonData.TransType = "销售发货-销售发货单";
}
string zlName = ZLtable.Rows[i]["Name"].ToString();
string zlTransCode = ZLtable.Rows[i]["BusinessCode"].ToString();
string Enable = ZLtable.Rows[i]["Enable"].ToString();

Loading…
Cancel
Save