|
@ -1152,8 +1152,8 @@ left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLo |
|
|
// sql += " WHERE 1=1 and e.ID is null ";
|
|
|
// sql += " WHERE 1=1 and e.ID is null ";
|
|
|
sqlString.Append($@"select * from (select row_number() over(partition by a.TransferNO order by a.TransferNO) row,
|
|
|
sqlString.Append($@"select * from (select row_number() over(partition by a.TransferNO order by a.TransferNO) row,
|
|
|
a.TransferNO as Code,a.ID,CONVERT(varchar(100),a.CreateDateTime,23) as MTIME,a.CreatePerson as MUSER, |
|
|
a.TransferNO as Code,a.ID,CONVERT(varchar(100),a.CreateDateTime,23) as MTIME,a.CreatePerson as MUSER, |
|
|
g.Status as Status1, |
|
|
|
|
|
f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, |
|
|
|
|
|
|
|
|
g.Status as Status1,f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, |
|
|
|
|
|
case when max(k.TransCode) is null then '未占料' else '已占料' end as IsOccupy, |
|
|
f.cFree2,f.cFree3,f.cFree4,f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10 |
|
|
f.cFree2,f.cFree3,f.cFree4,f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10 |
|
|
from ICSTransfer a |
|
|
from ICSTransfer a |
|
|
left join ICSMOPickMerge e on a.ID = e.SourceID and a.WorkPoint = e.WorkPoint |
|
|
left join ICSMOPickMerge e on a.ID = e.SourceID and a.WorkPoint = e.WorkPoint |
|
@ -1954,30 +1954,30 @@ c.Sequence, |
|
|
} |
|
|
} |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
#region 占料前增加验证,如果条码数量超出实际需要领料数量,直接报错。
|
|
|
|
|
|
string chksql = @"select InvCode,WHCode,SUM(Quantity) as Quantity from ICSMOApply
|
|
|
|
|
|
where ApplyCode in ({0}) and WorkPoint='{1}' |
|
|
|
|
|
GROUP BY InvCode,WHCode";
|
|
|
|
|
|
chksql = string.Format(chksql, ID, WorkPoint); |
|
|
|
|
|
var chkdata = Repository().FindDataSetBySql(chksql); |
|
|
|
|
|
DataTable chktable = dataset.Tables[0]; |
|
|
|
|
|
foreach (DataRow chkdr in chktable.Rows) |
|
|
|
|
|
{ |
|
|
|
|
|
decimal ZLQty = 0; |
|
|
|
|
|
for (int i = 0; i < table.Rows.Count; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
if (table.Rows[i]["WarehouseCode"].ToString() == chkdr["WHCode"].ToString() |
|
|
|
|
|
&& table.Rows[i]["InvCode"].ToString() == chkdr["InvCode"].ToString()) |
|
|
|
|
|
{ |
|
|
|
|
|
ZLQty += Convert.ToDecimal(table.Rows[i]["SendQTY"].ToString()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (Convert.ToDecimal(chkdr["Quantity"]) < ZLQty) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new Exception("物料:"+ chkdr["InvCode"].ToString() + "实际拣料数量大于单据需求数量,请尝试重新拣料。"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
//#region 占料前增加验证,如果条码数量超出实际需要领料数量,直接报错。
|
|
|
|
|
|
//string chksql = @"select InvCode,WHCode,SUM(Quantity) as Quantity from ICSMOApply
|
|
|
|
|
|
// where ApplyCode in ({0}) and WorkPoint='{1}'
|
|
|
|
|
|
// GROUP BY InvCode,WHCode";
|
|
|
|
|
|
//chksql = string.Format(chksql, ID, WorkPoint);
|
|
|
|
|
|
//var chkdata = Repository().FindDataSetBySql(chksql);
|
|
|
|
|
|
//DataTable chktable = dataset.Tables[0];
|
|
|
|
|
|
//foreach (DataRow chkdr in chktable.Rows)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// decimal ZLQty = 0;
|
|
|
|
|
|
// for (int i = 0; i < table.Rows.Count; i++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (table.Rows[i]["WarehouseCode"].ToString() == chkdr["WarehouseCode"].ToString()
|
|
|
|
|
|
// && table.Rows[i]["InvCode"].ToString() == chkdr["InvCode"].ToString())
|
|
|
|
|
|
// {
|
|
|
|
|
|
// ZLQty += Convert.ToDecimal(table.Rows[i]["SendQTY"].ToString());
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (Convert.ToDecimal(chkdr["iQuantity"]) < ZLQty)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// throw new Exception("物料:"+ chkdr["InvCode"].ToString() + "实际拣料数量大于单据需求数量,请尝试重新拣料。");
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
//#endregion
|
|
|
if (table.Rows.Count != 0) |
|
|
if (table.Rows.Count != 0) |
|
|
{ |
|
|
{ |
|
|
#region 拣料时增加条码出入库记录,修改库存锁定数量,以作占料处理
|
|
|
#region 拣料时增加条码出入库记录,修改库存锁定数量,以作占料处理
|
|
|