姜鹏 3 days ago
parent
commit
9deb0e9c5c
  1. 32
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs
  2. 18
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs
  3. 8
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseService.cs

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

@ -1010,14 +1010,14 @@ LEFT JOIN ICSConfiguration conWhCode ON conWhCode.Code='ERPWHCode' AND a.WorkPoi
foreach (var item in res) foreach (var item in res)
{ {
JObject jo = (JObject)item; JObject jo = (JObject)item;
JArray resdetail = (JArray)JsonConvert.DeserializeObject(jo["osArriveorderDetailRet"].ToString());
JArray resdetail = (JArray)JsonConvert.DeserializeObject(jo["details"].ToString());
foreach (var detail in resdetail) foreach (var detail in resdetail)
{ {
JObject det = (JObject)detail; JObject det = (JObject)detail;
string ERPupdate = @"update ICSODeliveryNotice set ODNCode='{0}',Sequence='{1}',ODNID='{2}',ODNDetailID='{3}' string ERPupdate = @"update ICSODeliveryNotice set ODNCode='{0}',Sequence='{1}',ODNID='{2}',ODNDetailID='{3}'
where OODetailID='{4}' AND ODNType='1' AND ODNCode='{5}' and Sequence='{6}'"; where OODetailID='{4}' AND ODNType='1' AND ODNCode='{5}' and Sequence='{6}'";
ERPupdate = string.Format(ERPupdate, jo["ODNCode"], det["Sequence"], jo["ID"], det["DetailID"], det["OODetailID"], ODNCode, det["Sequence"].ToString().Substring(0, det["Sequence"].ToString().Length - 1));
ERPupdate = string.Format(ERPupdate, jo["ODNCode"], det["Sequence"], jo["ID"], det["DetailID"], det["OODetailID"], ODNCode, det["WMSSequence"]);
log.Debug("到货单回写sql:"+ERPupdate); log.Debug("到货单回写sql:"+ERPupdate);
if (!DBHelper.ExecuteNonQuery(ERPupdate, cmd)) if (!DBHelper.ExecuteNonQuery(ERPupdate, cmd))
{ {
@ -1191,13 +1191,13 @@ from ICSWareHouseLotInfoLog
WHERE Identification='{0}' AND TransType='13' and BusinessCode ='60' WHERE Identification='{0}' AND TransType='13' and BusinessCode ='60'
SELECT c.VenCode+a.ToWarehouseCode+c.OOCode+a.MUSER+f.ODNCode AS Costre,c.OODetailID+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, '')+ SELECT c.VenCode+a.ToWarehouseCode+c.OOCode+a.MUSER+f.ODNCode AS Costre,c.OODetailID+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, '') AS Costre2,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.OOCode,c.OOID,f.ODNCode,case when ConErp.enable=1 then f.ODNDetailID else '' end ODNDetailID,a.MUSER,f.Sequence AS ODNSequence,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.OOCode,c.OODetailID,a.InvCode) AS Sequence,
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, '') AS Costre2,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.OOCode,c.OOID,f.ODNID AS ODNCode,case when ConErp.enable=1 then f.ODNDetailID else '' end ODNDetailID,a.MUSER,f.Sequence AS ODNSequence,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.OOCode,c.OODetailID,a.InvCode) AS Sequence,
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.OODetailID,con.Enable AS UpdateTodoQuantity,conn.Enable,conStock.Enable AS UpdateStock,conStocknew.Enable AS IsFillClose,conStockneww.Enable AS CompleteVerification,conWhCode.Enable AS ErpWhCode 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.OODetailID,con.Enable AS UpdateTodoQuantity,conn.Enable,conStock.Enable AS UpdateStock,conStocknew.Enable AS IsFillClose,conStockneww.Enable AS CompleteVerification,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, ,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,a.TransSequence,lot.eattribute10 as Reason 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,a.TransSequence,lot.eattribute10 as Reason
INTO #TempERP INTO #TempERP
FROM #NewTempERP a FROM #NewTempERP a
INNER JOIN ICSConfiguration ConErp ON a.WorkPoint=ConErp.WorkPoint AND ConErp.Code='UploadERP002'
INNER JOIN ICSConfiguration ConErp ON a.WorkPoint=ConErp.WorkPoint AND ConErp.Code='UploadERP002'
INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint
INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint
INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint
@ -1213,12 +1213,12 @@ INNER JOIN ICSConfiguration ConErp ON a.WorkPoint=ConErp.WorkPoint AND ConErp.C
AND b.WorkPoint = c.WorkPoint AND b.WorkPoint = c.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
INNER JOIN ICSConfiguration conn ON con.WorkPoint=conn.WorkPoint AND conn.Code='Escrow001' INNER JOIN ICSConfiguration conn ON con.WorkPoint=conn.WorkPoint AND conn.Code='Escrow001'
--INNER JOIN ICSConfiguration ConErp ON a.WorkPoint=ConErp.WorkPoint AND ConErp.Code='UploadERP002'
INNER JOIN ICSConfiguration conStock ON a.WorkPoint=conStock.WorkPoint AND conStock.Code='UpdateStock001'
INNER JOIN ICSConfiguration conStocknew ON a.WorkPoint=conStocknew.WorkPoint AND conStocknew.Code='FillClose002'
INNER JOIN ICSConfiguration conStockneww ON a.WorkPoint=conStockneww.WorkPoint AND conStockneww.Code='CompleteVerification005'
LEFT JOIN ICSConfiguration conWhCode ON conWhCode.Code='ERPWHCode' AND a.WorkPoint=conWhCode.WorkPoint
GROUP BY conWhCode.Enable,ConErp.Enable,conStockneww.Enable,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.OOCode,a.MUSER,f.ODNCode,f.ODNDetailID,f.Sequence,a.TransSequence,a.InvCode,c.OOID,c.OODetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable,conStock.Enable,conStocknew.Enable
--INNER JOIN ICSConfiguration ConErp ON a.WorkPoint=ConErp.WorkPoint AND ConErp.Code='UploadERP002'
INNER JOIN ICSConfiguration conStock ON a.WorkPoint=conStock.WorkPoint AND conStock.Code='UpdateStock001'
INNER JOIN ICSConfiguration conStocknew ON a.WorkPoint=conStocknew.WorkPoint AND conStocknew.Code='FillClose002'
INNER JOIN ICSConfiguration conStockneww ON a.WorkPoint=conStockneww.WorkPoint AND conStockneww.Code='CompleteVerification005'
LEFT JOIN ICSConfiguration conWhCode ON conWhCode.Code='ERPWHCode' AND a.WorkPoint=conWhCode.WorkPoint
GROUP BY conWhCode.Enable,ConErp.Enable,conStockneww.Enable,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.OOCode,a.MUSER,f.ODNID,f.ODNCode,f.ODNDetailID,f.Sequence,a.TransSequence,a.InvCode,c.OOID,c.OODetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable,conStock.Enable,conStocknew.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, ''), ,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, ''),lot.eattribute10 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, ''),lot.eattribute10
@ -1231,11 +1231,11 @@ LEFT JOIN ICSConfiguration conWhCode ON conWhCode.Code='ERPWHCode' AND a.WorkPoi
FROM #TempERP FROM #TempERP
SELECT a.FromWarehouseCode AS WHCode,c.OODetailID+te.ProjectCode+te.BatchCode+te.Version+te.Brand+te.cFree1+te.cFree2+te.cFree3+te.cFree4+te.cFree5+te.cFree6+te.cFree7+te.cFree8+te.cFree9+te.cFree10 AS Costre2, SELECT a.FromWarehouseCode AS WHCode,c.OODetailID+te.ProjectCode+te.BatchCode+te.Version+te.Brand+te.cFree1+te.cFree2+te.cFree3+te.cFree4+te.cFree5+te.cFree6+te.cFree7+te.cFree8+te.cFree9+te.cFree10 AS Costre2,
a.TransCode,a.TransSequence AS Sequence,a.InvCode,SUM(a.Quantity) as Quantity,SUM((a.Quantity)*(c.Amount/c.Quantity)) AS 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
a.TransCode,a.TransSequence AS Sequence,a.InvCode,SUM(a.Quantity) as Quantity,SUM((a.Quantity)*(c.Amount/c.Quantity)) AS 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 #NewDouTempERP a FROM #NewDouTempERP a
INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint
INNER JOIN ICSOutsourcingOrder b ON b.OOCode=a.TransCode AND b.WorkPoint=a.WorkPoint INNER JOIN ICSOutsourcingOrder b ON b.OOCode=a.TransCode AND b.WorkPoint=a.WorkPoint
@ -1245,8 +1245,6 @@ ISNULL(ext.cFree7, '') AS cFree7,ISNULL(ext.cFree8, '') AS cFree8,ISNULL(ext.cFr
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.ToWarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.ToWarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint
INNER JOIN #TempERP te ON te.TransSequence=SUBSTRING(a.TransSequence,1,CHARINDEX('~',a.TransSequence)-1) INNER JOIN #TempERP te ON te.TransSequence=SUBSTRING(a.TransSequence,1,CHARINDEX('~',a.TransSequence)-1)
and c.OODetailID+a.EATTRIBUTE3 = c.OODetailID+te.ProjectCode+te.BatchCode+te.Version+te.Brand+te.cFree1+te.cFree2+te.cFree3+te.cFree4+te.cFree5+te.cFree6+te.cFree7+te.cFree8+te.cFree9+te.cFree10 and c.OODetailID+a.EATTRIBUTE3 = c.OODetailID+te.ProjectCode+te.BatchCode+te.Version+te.Brand+te.cFree1+te.cFree2+te.cFree3+te.cFree4+te.cFree5+te.cFree6+te.cFree7+te.cFree8+te.cFree9+te.cFree10
GROUP BY a.EATTRIBUTE3,a.FromWarehouseCode,c.OODetailID,a.TransCode,a.TransSequence,a.InvCode,c.PickID,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, ''), GROUP BY a.EATTRIBUTE3,a.FromWarehouseCode,c.OODetailID,a.TransCode,a.TransSequence,a.InvCode,c.PickID,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, ''),a.TransSequence,te.ProjectCode,te.BatchCode,te.Version,te.Brand,te.cFree1,te.cFree2,te.cFree3,te.cFree4,te.cFree5,te.cFree6,te.cFree7,te.cFree8,te.cFree9,te.cFree10 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, ''),a.TransSequence,te.ProjectCode,te.BatchCode,te.Version,te.Brand,te.cFree1,te.cFree2,te.cFree3,te.cFree4,te.cFree5,te.cFree6,te.cFree7,te.cFree8,te.cFree9,te.cFree10

18
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs

@ -81,7 +81,7 @@ namespace ICSSoft.DataProject
string ERPupdate = @"update ICSDeliveryNotice set DNCode='{0}',Sequence='{1}',DNID='{2}',DNDetailID='{3}' string ERPupdate = @"update ICSDeliveryNotice set DNCode='{0}',Sequence='{1}',DNID='{2}',DNDetailID='{3}'
where PODetailID='{4}' AND DNType='1' AND DNCode='{5}' and Sequence='{6}'"; where PODetailID='{4}' AND DNType='1' AND DNCode='{5}' and Sequence='{6}'";
ERPupdate = string.Format(ERPupdate, jo["DNCode"], det["Sequence"], jo["ID"], det["DetailID"], det["PODetailID"],DNCode, det["Sequence"].ToString().Substring(0, det["Sequence"].ToString().Length - 1));
ERPupdate = string.Format(ERPupdate, jo["DNCode"], det["Sequence"], jo["ID"], det["DetailID"], det["PODetailID"],DNCode, det["WMSSequence"]);
if (!DBHelper.ExecuteNonQuery(ERPupdate, cmd)) if (!DBHelper.ExecuteNonQuery(ERPupdate, cmd))
{ {
@ -189,7 +189,7 @@ INTO #NewTempERP
from ICSWareHouseLotInfoLog from ICSWareHouseLotInfoLog
WHERE Identification='{0}' AND ERPUpload='0' AND BusinessCode='{1}' WHERE Identification='{0}' AND ERPUpload='0' AND BusinessCode='{1}'
SELECT Identification,c.VenCode+a.ToWarehouseCode+c.POCode+a.MUSER+CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END AS Costre,a.TransCode+a.TransSequence+CONVERT(VARCHAR,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode)) AS Costre2,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.POCode,CASE WHEN(LEN(f.DNDetailID)=36) THEN '' ELSE f.DNCode END AS DNCode,CASE WHEN((LEN(f.DNDetailID)<>36)) THEN '1' ELSE '0' END AS HasDN,a.MUSER,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END AS DNSequence,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode) AS Sequence,a.TransSequence,
SELECT Identification,c.VenCode+a.ToWarehouseCode+c.POCode+a.MUSER+CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END AS Costre,a.TransCode+a.TransSequence+CONVERT(VARCHAR,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode)) AS Costre2,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.POCode,f.DNID AS DNCode,CASE WHEN((LEN(f.DNDetailID)<>36)) THEN '1' ELSE '0' END AS HasDN,a.MUSER,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END AS DNSequence,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode) AS Sequence,a.TransSequence,
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.PODetailID,con.Enable AS UpdateTodoQuantity,conn.Enable,conStock.Enable AS UpdateStock,conStocknew.Enable AS IsFillClose,case when ConErp.enable=1 then f.DNDetailID else '' end AS DNDetailID,conWhCode.Enable AS ErpWhCode 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.PODetailID,con.Enable AS UpdateTodoQuantity,conn.Enable,conStock.Enable AS UpdateStock,conStocknew.Enable AS IsFillClose,case when ConErp.enable=1 then f.DNDetailID else '' end AS DNDetailID,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, ,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 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
@ -213,7 +213,7 @@ LEFT JOIN ICSConfiguration conWhCode ON conWhCode.Code='ERPWHCode' AND a.WorkPoi
where ISNULL(extd.ProjectCode, '')+'~'+CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(extd.BatchCode, '') ELSE '' END+'~'+ISNULL(extd.Version, '')+'~'+ISNULL(extd.Brand, '')+'~'+ where ISNULL(extd.ProjectCode, '')+'~'+CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(extd.BatchCode, '') ELSE '' END+'~'+ISNULL(extd.Version, '')+'~'+ISNULL(extd.Brand, '')+'~'+
ISNULL(extd.cFree1, '')+'~'+ISNULL(extd.cFree2, '')+'~'+ISNULL(extd.cFree3, '')+'~'+ISNULL(extd.cFree4, '')+'~'+ISNULL(extd.cFree5, '')+'~'+ISNULL(extd.cFree6, '')+'~'+ISNULL(extd.cFree7, '')+'~'+ISNULL(extd.cFree8, '')+'~'+ISNULL(extd.cFree9, '')+'~'+ISNULL(extd.cFree10, '')=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(extd.cFree1, '')+'~'+ISNULL(extd.cFree2, '')+'~'+ISNULL(extd.cFree3, '')+'~'+ISNULL(extd.cFree4, '')+'~'+ISNULL(extd.cFree5, '')+'~'+ISNULL(extd.cFree6, '')+'~'+ISNULL(extd.cFree7, '')+'~'+ISNULL(extd.cFree8, '')+'~'+ISNULL(extd.cFree9, '')+'~'+ISNULL(extd.cFree10, '')=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, '') 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, '')
GROUP BY conWhCode.Enable,ConErp.Enable,a.TransCode,a.Identification,a.TransSequence,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.POCode,f.DNDetailID,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END,f.DNID,a.MUSER,a.InvCode,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable,conStock.Enable,conStocknew.Enable
GROUP BY conWhCode.Enable,ConErp.Enable,a.TransCode,a.Identification,a.TransSequence,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.POCode,f.DNDetailID,f.DNID,a.MUSER,a.InvCode,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable,conStock.Enable,conStocknew.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, ''), ,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, ''),f.DNCode 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, ''),f.DNCode
@ -237,9 +237,6 @@ where ISNULL(extd.ProjectCode, '')+'~'+CASE WHEN (invBat.BatchEnable IS NULL AND
SELECT DISTINCT HasDN FROM #TempERP SELECT DISTINCT HasDN FROM #TempERP
DROP TABLE #TempERP DROP TABLE #TempERP
DROP TABLE #NewTempERP DROP TABLE #NewTempERP
"; ";
@ -251,7 +248,7 @@ INTO #NewTempERP
from ICSWareHouseLotInfoLog from ICSWareHouseLotInfoLog
WHERE Identification='{0}' AND ERPUpload='0' AND BusinessCode='{1}' WHERE Identification='{0}' AND ERPUpload='0' AND BusinessCode='{1}'
SELECT Identification,c.VenCode+a.ToWarehouseCode+c.POCode+a.MUSER+CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END AS Costre,a.TransCode+a.TransSequence+CONVERT(VARCHAR,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode)) AS Costre2,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.POCode,CASE WHEN(LEN(f.DNDetailID)=36) THEN '' ELSE f.DNCode END AS DNCode,CASE WHEN((LEN(f.DNDetailID)<>36)) THEN '1' ELSE '0' END AS HasDN,a.MUSER,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END AS DNSequence,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode) AS Sequence,a.TransSequence,
SELECT Identification,c.VenCode+a.ToWarehouseCode+c.POCode+a.MUSER+CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END AS Costre,a.TransCode+a.TransSequence+CONVERT(VARCHAR,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode)) AS Costre2,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.POCode,f.DNID AS DNCode,CASE WHEN((LEN(f.DNDetailID)<>36)) THEN '1' ELSE '0' END AS HasDN,a.MUSER,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END AS DNSequence,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode) AS Sequence,a.TransSequence,
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.PODetailID,con.Enable AS UpdateTodoQuantity,conn.Enable,conStock.Enable AS UpdateStock,conStocknew.Enable AS IsFillClose,case when ConErp.enable=1 then f.DNDetailID else '' end AS DNDetailID 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.PODetailID,con.Enable AS UpdateTodoQuantity,conn.Enable,conStock.Enable AS UpdateStock,conStocknew.Enable AS IsFillClose,case when ConErp.enable=1 then f.DNDetailID else '' end AS DNDetailID
,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, ,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 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
@ -270,7 +267,7 @@ SELECT Identification,c.VenCode+a.ToWarehouseCode+c.POCode+a.MUSER+CASE WHEN(LEN
INNER JOIN ICSConfiguration ConErp ON a.WorkPoint=ConErp.WorkPoint AND ConErp.Code='UploadERP001' INNER JOIN ICSConfiguration ConErp ON a.WorkPoint=ConErp.WorkPoint AND ConErp.Code='UploadERP001'
INNER JOIN ICSConfiguration conStock ON a.WorkPoint=conStock.WorkPoint AND conStock.Code='UpdateStock001' INNER JOIN ICSConfiguration conStock ON a.WorkPoint=conStock.WorkPoint AND conStock.Code='UpdateStock001'
INNER JOIN ICSConfiguration conStocknew ON a.WorkPoint=conStocknew.WorkPoint AND conStocknew.Code='FillClose003' INNER JOIN ICSConfiguration conStocknew ON a.WorkPoint=conStocknew.WorkPoint AND conStocknew.Code='FillClose003'
GROUP BY ConErp.Enable,a.TransCode,a.Identification,a.TransSequence,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.POCode,f.DNDetailID,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END,f.DNID,a.MUSER,a.InvCode,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable,conStock.Enable,conStocknew.Enable
GROUP BY ConErp.Enable,a.TransCode,a.Identification,a.TransSequence,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.POCode,f.DNDetailID,f.DNID,a.MUSER,a.InvCode,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable,conStock.Enable,conStocknew.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, ''), ,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, ''),f.DNCode 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, ''),f.DNCode
@ -294,9 +291,6 @@ INNER JOIN ICSConfiguration conStocknew ON a.WorkPoint=conStocknew.WorkPoint AN
SELECT DISTINCT HasDN FROM #TempERP SELECT DISTINCT HasDN FROM #TempERP
DROP TABLE #TempERP DROP TABLE #TempERP
DROP TABLE #NewTempERP DROP TABLE #NewTempERP
"; ";
@ -2133,7 +2127,7 @@ IF EXISTS(SELECT b.id FROM ICSPurchaseReceive b where rcvcode in
string ERPupdate = @"update ICSDeliveryNotice set DNCode='{0}',Sequence='{1}',DNID='{2}',DNDetailID='{3}' string ERPupdate = @"update ICSDeliveryNotice set DNCode='{0}',Sequence='{1}',DNID='{2}',DNDetailID='{3}'
where PODetailID='{4}' AND DNType='1' AND DNCode='{5}' and Sequence='{6}'"; where PODetailID='{4}' AND DNType='1' AND DNCode='{5}' and Sequence='{6}'";
ERPupdate = string.Format(ERPupdate, jo["DNCode"], det["Sequence"], jo["ID"], det["DetailID"], det["PODetailID"], DNCode, det["WMSSequence"]);
ERPupdate = string.Format(ERPupdate, jo["DNCode"], det["Sequence"], jo["id"], det["DetailID"], det["PODetailID"], DNCode, det["WMSSequence"]);
if (!DBHelper.ExecuteNonQuery(ERPupdate, cmd)) if (!DBHelper.ExecuteNonQuery(ERPupdate, cmd))
{ {

8
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseService.cs

@ -3217,7 +3217,7 @@ DECLARE @bb VARCHAR(10)
{ {
DateTime now = DateTime.Now; DateTime now = DateTime.Now;
string sql = @"select 1 from ICSContainerLot string sql = @"select 1 from ICSContainerLot
where ContainerID=(SELECT DISTINCT ID FROM ICSContainer WHERE ContainerCode='{2}') AND LotNo='{0}' and WorkPoint='{1}'
where ContainerID=(SELECT DISTINCT ID FROM ICSContainer WHERE ContainerCode='{2}' AND WorkPoint='{1}') AND LotNo='{0}' and WorkPoint='{1}'
"; ";
sql = string.Format(sql, LotNo, WorkPoint, ContainerCode); sql = string.Format(sql, LotNo, WorkPoint, ContainerCode);
log.Debug("查询容器条码关联表是否存在sql:" + sql); log.Debug("查询容器条码关联表是否存在sql:" + sql);
@ -3226,7 +3226,7 @@ DECLARE @bb VARCHAR(10)
{ {
///删除条码关联表数据 ///删除条码关联表数据
sql = @"DELETE FROM ICSContainerLot sql = @"DELETE FROM ICSContainerLot
where ContainerID=(SELECT DISTINCT ID FROM ICSContainer WHERE ContainerCode='{2}') AND LotNo='{0}' and WorkPoint='{1}'
where ContainerID=(SELECT DISTINCT ID FROM ICSContainer WHERE ContainerCode='{2}' AND WorkPoint='{1}') AND LotNo='{0}' and WorkPoint='{1}'
"; ";
sql = string.Format(sql, LotNo, WorkPoint, ContainerCode); sql = string.Format(sql, LotNo, WorkPoint, ContainerCode);
@ -3238,7 +3238,7 @@ DECLARE @bb VARCHAR(10)
///记录日志 ///记录日志
sql = @"INSERT INTO ICSContainerLog(ID,ContainerID,ContainerOrLotNo,Type,MUSER,MUSERName,WorkPoint,MTIME) sql = @"INSERT INTO ICSContainerLog(ID,ContainerID,ContainerOrLotNo,Type,MUSER,MUSERName,WorkPoint,MTIME)
VALUES(NEWID(), (SELECT DISTINCT ID FROM ICSContainer WHERE ContainerCode='{0}'), '{1}', '{4}', '{2}', (SELECT DISTINCT F_RealName FROM Sys_SRM_User WHERE F_Account='{2}'), '{3}', GETDATE())";
VALUES(NEWID(), (SELECT DISTINCT ID FROM ICSContainer WHERE ContainerCode='{0}' AND WorkPoint='{3}'), '{1}', '{4}', '{2}', (SELECT DISTINCT F_RealName FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{3}'), '{3}', GETDATE())";
sql = string.Format(sql, ContainerCode, LotNo, User, WorkPoint, Type); sql = string.Format(sql, ContainerCode, LotNo, User, WorkPoint, Type);
if (!DBHelper.ExecuteNonQuery(sql, cmd)) if (!DBHelper.ExecuteNonQuery(sql, cmd))
{ {
@ -3278,7 +3278,7 @@ DECLARE @bb VARCHAR(10)
string sql = @"IF EXISTS(SELECT 1 FROM ICSContainer WHERE ContainerCode='{0}' AND WorkPoint='{2}' AND ContainerID IS NOT NULL AND ContainerID<>'') string sql = @"IF EXISTS(SELECT 1 FROM ICSContainer WHERE ContainerCode='{0}' AND WorkPoint='{2}' AND ContainerID IS NOT NULL AND ContainerID<>'')
BEGIN BEGIN
INSERT INTO ICSContainerLog(ID,ContainerID,ContainerOrLotNo,Type,MUSER,MUSERName,WorkPoint,MTIME) INSERT INTO ICSContainerLog(ID,ContainerID,ContainerOrLotNo,Type,MUSER,MUSERName,WorkPoint,MTIME)
VALUES(NEWID(), '', '{0}', '{3}', '{1}', (SELECT DISTINCT F_RealName FROM Sys_SRM_User WHERE F_Account='{1}'), '{2}', GETDATE())
VALUES(NEWID(), '', '{0}', '{3}', '{1}', (SELECT DISTINCT F_RealName FROM Sys_SRM_User WHERE F_Account='{1}' AND F_Location='{2}'), '{2}', GETDATE())
UPDATE ICSContainer SET ContainerID='',MUSER='{1}', UPDATE ICSContainer SET ContainerID='',MUSER='{1}',
MUSERName=(SELECT DISTINCT F_RealName FROM Sys_SRM_User WHERE F_Account='{1}' AND F_Location='{2}') MUSERName=(SELECT DISTINCT F_RealName FROM Sys_SRM_User WHERE F_Account='{1}' AND F_Location='{2}')

Loading…
Cancel
Save