|
@ -2855,22 +2855,45 @@ a.ExtensionID |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
columns = @"(a.Quantity-a.lockQuantity) AS Quantity,
|
|
|
|
|
|
(a.Quantity-a.lockQuantity)*(lot.Amount/lot.Quantity) AS Amount, |
|
|
|
|
|
'' AS LogID, |
|
|
|
|
|
a.WarehouseCode AS WHCode, |
|
|
|
|
|
wh.WarehouseName AS WHName, |
|
|
|
|
|
inv.LotEnable, |
|
|
|
|
|
a.LocationCode, |
|
|
|
|
|
loc.LocationName, |
|
|
|
|
|
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,";
|
|
|
|
|
|
|
|
|
|
|
|
tableName = @"ICSWareHouseLotInfo a
|
|
|
|
|
|
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 ICSWarehouse wh ON a.WarehouseCode=wh.WarehouseCode AND a.WorkPoint=wh.WorkPoint |
|
|
|
|
|
INNER JOIN ICSLocation loc ON a.LocationCode=loc.LocationCode AND a.WorkPoint=loc.WorkPoint |
|
|
|
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.WarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint";
|
|
|
|
|
|
|
|
|
if(TransType == TransTypeEnum.Check.GetDescription()) |
|
|
|
|
|
{ |
|
|
|
|
|
columns = @"case when inv.AmountEnable='1' then (a.Quantity-a.lockQuantity)*(lot.Amount/lot.Quantity) else (a.Quantity-a.lockQuantity) end AS Quantity,
|
|
|
|
|
|
(a.Quantity-a.lockQuantity)*(lot.Amount/lot.Quantity) AS Amount, |
|
|
|
|
|
'' AS LogID, |
|
|
|
|
|
a.WarehouseCode AS WHCode, |
|
|
|
|
|
wh.WarehouseName AS WHName, |
|
|
|
|
|
inv.LotEnable, |
|
|
|
|
|
a.LocationCode, |
|
|
|
|
|
loc.LocationName, |
|
|
|
|
|
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,";
|
|
|
|
|
|
|
|
|
|
|
|
tableName = @"ICSWareHouseLotInfo a
|
|
|
|
|
|
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 ICSWarehouse wh ON a.WarehouseCode=wh.WarehouseCode AND a.WorkPoint=wh.WorkPoint |
|
|
|
|
|
INNER JOIN ICSLocation loc ON a.LocationCode=loc.LocationCode AND a.WorkPoint=loc.WorkPoint |
|
|
|
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.WarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint";
|
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
columns = @"(a.Quantity-a.lockQuantity) AS Quantity,
|
|
|
|
|
|
(a.Quantity-a.lockQuantity)*(lot.Amount/lot.Quantity) AS Amount, |
|
|
|
|
|
'' AS LogID, |
|
|
|
|
|
a.WarehouseCode AS WHCode, |
|
|
|
|
|
wh.WarehouseName AS WHName, |
|
|
|
|
|
inv.LotEnable, |
|
|
|
|
|
a.LocationCode, |
|
|
|
|
|
loc.LocationName, |
|
|
|
|
|
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,";
|
|
|
|
|
|
|
|
|
|
|
|
tableName = @"ICSWareHouseLotInfo a
|
|
|
|
|
|
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 ICSWarehouse wh ON a.WarehouseCode=wh.WarehouseCode AND a.WorkPoint=wh.WorkPoint |
|
|
|
|
|
INNER JOIN ICSLocation loc ON a.LocationCode=loc.LocationCode AND a.WorkPoint=loc.WorkPoint |
|
|
|
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.WarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint";
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3447,21 +3470,25 @@ a.ExtensionID |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//先进先出判断
|
|
|
|
|
|
var result = CanOut(Lot, JsonData.WorkPoint, JsonData.ScanLotCode, sqlnew, cmd, language); |
|
|
|
|
|
//0 - 已经是最早的批次
|
|
|
|
|
|
//1 - 不管控
|
|
|
|
|
|
//2 - 提醒
|
|
|
|
|
|
//3 - 限制
|
|
|
|
|
|
if (result == "2") |
|
|
|
|
|
{ |
|
|
|
|
|
msg += string.Format(language.GetNameByCode("WMSAPIInfo178"), Lot) + Environment.NewLine; |
|
|
|
|
|
} |
|
|
|
|
|
else if (result == "3") |
|
|
|
|
|
|
|
|
if(TransType != TransTypeEnum.OtherOutDoc.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
msg += string.Format(language.GetNameByCode("WMSAPIInfo179"), Lot) + Environment.NewLine; |
|
|
|
|
|
isLimit = true; |
|
|
|
|
|
|
|
|
//先进先出判断
|
|
|
|
|
|
var result = CanOut(Lot, JsonData.WorkPoint, JsonData.ScanLotCode, sqlnew, cmd, language); |
|
|
|
|
|
//0 - 已经是最早的批次
|
|
|
|
|
|
//1 - 不管控
|
|
|
|
|
|
//2 - 提醒
|
|
|
|
|
|
//3 - 限制
|
|
|
|
|
|
if (result == "2") |
|
|
|
|
|
{ |
|
|
|
|
|
msg += string.Format(language.GetNameByCode("WMSAPIInfo178"), Lot) + Environment.NewLine; |
|
|
|
|
|
} |
|
|
|
|
|
else if (result == "3") |
|
|
|
|
|
{ |
|
|
|
|
|
msg += string.Format(language.GetNameByCode("WMSAPIInfo179"), Lot) + Environment.NewLine; |
|
|
|
|
|
isLimit = true; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -11986,7 +12013,7 @@ END"; |
|
|
if (string.IsNullOrEmpty(item.User)) |
|
|
if (string.IsNullOrEmpty(item.User)) |
|
|
{ |
|
|
{ |
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo018"));//"操作人不能为空!");
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo018"));//"操作人不能为空!");
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
if (string.IsNullOrEmpty(item.WorkPoint)) |
|
|
if (string.IsNullOrEmpty(item.WorkPoint)) |
|
|
{ |
|
|
{ |
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo004"));//"站点不能为空!"
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo004"));//"站点不能为空!"
|
|
@ -12013,6 +12040,16 @@ END"; |
|
|
//创建盘点单
|
|
|
//创建盘点单
|
|
|
foreach (var itemInfo in item.detail) |
|
|
foreach (var itemInfo in item.detail) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
string chekksql = @"select d.EATTRIBUTE1 FROM ICSInventoryLot c
|
|
|
|
|
|
INNER JOIN ICSInventory d on c.InvCode=d.InvCode and c.WorkPoint=d.WorkPoint |
|
|
|
|
|
WHERE c.WorkPoint='{1}' and c.lotno='{2}' and d.AmountEnable='1'";
|
|
|
|
|
|
chekksql = string.Format(chekksql, item.CheckCode, item.WorkPoint, itemInfo.LotNo); |
|
|
|
|
|
DataTable dta = DBHelper.SQlReturnData(chekksql, cmd); |
|
|
|
|
|
if (dta.Rows.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
itemInfo.ActualQuantity = (decimal.Parse(itemInfo.ActualQuantity) * decimal.Parse(dta.Rows[0]["EATTRIBUTE1"].ToString())).ToString(); |
|
|
|
|
|
} |
|
|
sql = @"IF NOT EXISTS(SELECT LotNo FROM ICSWareHouseLotInfo WHERE LotNo='{1}' AND WorkPoint='{3}')
|
|
|
sql = @"IF NOT EXISTS(SELECT LotNo FROM ICSWareHouseLotInfo WHERE LotNo='{1}' AND WorkPoint='{3}')
|
|
|
BEGIN |
|
|
BEGIN |
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo076") + @"',16,1); |
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo076") + @"',16,1); |
|
@ -16304,7 +16341,47 @@ a.ExtensionID |
|
|
END |
|
|
END |
|
|
" + sql;
|
|
|
" + sql;
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (TransType == TransTypeEnum.Check.GetDescription()) |
|
|
|
|
|
{ |
|
|
|
|
|
sql = @"IF EXISTS(SELECT LotNo FROM ICSCheckDetail a
|
|
|
|
|
|
LEFT JOIN ICSCheck b ON a.CheckID=b.ID AND a.WorkPoint=b.WorkPoint |
|
|
|
|
|
WHERE b.CheckCode='{6}' AND a.LotNo='{2}' AND a.WorkPoint='{3}') |
|
|
|
|
|
BEGIN |
|
|
|
|
|
IF ('{8}'='初盘') |
|
|
|
|
|
BEGIN |
|
|
|
|
|
IF EXISTS(SELECT LotNo FROM ICSCheckDetail a |
|
|
|
|
|
LEFT JOIN ICSCheck b ON a.CheckID=b.ID AND a.WorkPoint=b.WorkPoint |
|
|
|
|
|
WHERE b.CheckCode='{6}' AND a.LotNo='{2}' AND a.WorkPoint='{3}' AND a.PrimaryQuantity>0) |
|
|
|
|
|
BEGIN |
|
|
|
|
|
RAISERROR('当前条码已初盘,请确认!', 16, 1); |
|
|
|
|
|
RETURN; |
|
|
|
|
|
END |
|
|
|
|
|
END |
|
|
|
|
|
ELSE IF ('{8}'='抽盘') |
|
|
|
|
|
BEGIN |
|
|
|
|
|
IF EXISTS(SELECT LotNo FROM ICSCheckDetail a |
|
|
|
|
|
LEFT JOIN ICSCheck b ON a.CheckID=b.ID AND a.WorkPoint=b.WorkPoint |
|
|
|
|
|
WHERE b.CheckCode='{6}' AND a.LotNo='{2}' AND a.WorkPoint='{3}' AND a.CheckQuantity>0) |
|
|
|
|
|
BEGIN |
|
|
|
|
|
RAISERROR('当前条码已抽盘,请确认!', 16, 1); |
|
|
|
|
|
RETURN; |
|
|
|
|
|
END |
|
|
|
|
|
END |
|
|
|
|
|
ELSE |
|
|
|
|
|
BEGIN |
|
|
|
|
|
IF EXISTS(SELECT LotNo FROM ICSCheckDetail a |
|
|
|
|
|
LEFT JOIN ICSCheck b ON a.CheckID=b.ID AND a.WorkPoint=b.WorkPoint |
|
|
|
|
|
WHERE b.CheckCode='{6}' AND a.LotNo='{2}' AND a.WorkPoint='{3}' AND a.ReplayQuantity>0) |
|
|
|
|
|
BEGIN |
|
|
|
|
|
RAISERROR('当前条码已复盘,请确认!', 16, 1); |
|
|
|
|
|
RETURN; |
|
|
|
|
|
END |
|
|
|
|
|
END |
|
|
|
|
|
END |
|
|
|
|
|
" + sql;
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (iszl) |
|
|
if (iszl) |
|
|
{ |
|
|
{ |
|
@ -16329,23 +16406,44 @@ a.ExtensionID |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
columns = @"(a.Quantity-a.lockQuantity) AS Quantity,
|
|
|
|
|
|
(a.Quantity-a.lockQuantity)*(lot.Amount/lot.Quantity) AS Amount, |
|
|
|
|
|
'' AS LogID, |
|
|
|
|
|
a.WarehouseCode AS WHCode, |
|
|
|
|
|
wh.WarehouseName AS WHName, |
|
|
|
|
|
inv.LotEnable, |
|
|
|
|
|
a.LocationCode, |
|
|
|
|
|
lot.ProductDate, |
|
|
|
|
|
loc.LocationName, |
|
|
|
|
|
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,";
|
|
|
|
|
|
|
|
|
|
|
|
tableName = @"ICSWareHouseLotInfo a
|
|
|
|
|
|
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 ICSWarehouse wh ON a.WarehouseCode=wh.WarehouseCode AND a.WorkPoint=wh.WorkPoint |
|
|
|
|
|
INNER JOIN ICSLocation loc ON a.LocationCode=loc.LocationCode AND a.WorkPoint=loc.WorkPoint |
|
|
|
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.WarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint";
|
|
|
|
|
|
|
|
|
if (TransType == TransTypeEnum.Check.GetDescription()) |
|
|
|
|
|
{ |
|
|
|
|
|
columns = @"case when inv.AmountEnable='1' then (a.Quantity-a.lockQuantity)*(lot.Amount/lot.Quantity) else (a.Quantity-a.lockQuantity) end AS Quantity,
|
|
|
|
|
|
(a.Quantity-a.lockQuantity)*(lot.Amount/lot.Quantity) AS Amount, |
|
|
|
|
|
'' AS LogID, |
|
|
|
|
|
a.WarehouseCode AS WHCode, |
|
|
|
|
|
wh.WarehouseName AS WHName, |
|
|
|
|
|
inv.LotEnable, |
|
|
|
|
|
a.LocationCode, |
|
|
|
|
|
loc.LocationName, |
|
|
|
|
|
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,";
|
|
|
|
|
|
|
|
|
|
|
|
tableName = @"ICSWareHouseLotInfo a
|
|
|
|
|
|
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 ICSWarehouse wh ON a.WarehouseCode=wh.WarehouseCode AND a.WorkPoint=wh.WorkPoint |
|
|
|
|
|
INNER JOIN ICSLocation loc ON a.LocationCode=loc.LocationCode AND a.WorkPoint=loc.WorkPoint |
|
|
|
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.WarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint";
|
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
columns = @"(a.Quantity-a.lockQuantity) AS Quantity,
|
|
|
|
|
|
(a.Quantity-a.lockQuantity)*(lot.Amount/lot.Quantity) AS Amount, |
|
|
|
|
|
'' AS LogID, |
|
|
|
|
|
a.WarehouseCode AS WHCode, |
|
|
|
|
|
wh.WarehouseName AS WHName, |
|
|
|
|
|
inv.LotEnable, |
|
|
|
|
|
a.LocationCode, |
|
|
|
|
|
loc.LocationName, |
|
|
|
|
|
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,";
|
|
|
|
|
|
|
|
|
|
|
|
tableName = @"ICSWareHouseLotInfo a
|
|
|
|
|
|
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 ICSWarehouse wh ON a.WarehouseCode=wh.WarehouseCode AND a.WorkPoint=wh.WorkPoint |
|
|
|
|
|
INNER JOIN ICSLocation loc ON a.LocationCode=loc.LocationCode AND a.WorkPoint=loc.WorkPoint |
|
|
|
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.WarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint";
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -16786,7 +16884,7 @@ a.ExtensionID |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
sql = string.Format(sql, columns, tableName, JsonData.Code, JsonData.WorkPoint, zlqty, UName,JsonData.TransCode,JsonData.TransSequence); |
|
|
|
|
|
|
|
|
sql = string.Format(sql, columns, tableName, JsonData.Code, JsonData.WorkPoint, zlqty, UName,JsonData.TransCode,JsonData.TransSequence,JsonData.CheckKind); |
|
|
log.Debug("条码sql:" + sql); |
|
|
log.Debug("条码sql:" + sql); |
|
|
table = DBHelper.SQlReturnData(sql, cmd); |
|
|
table = DBHelper.SQlReturnData(sql, cmd); |
|
|
} |
|
|
} |
|
|