Browse Source

移库逻辑

master
冒林杰 2 years ago
parent
commit
9f6ac32fad
  1. 4
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs
  2. 55
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
  3. 22
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs
  4. 1
      ICSSoft.WMS.WebAPI/ICSSoft.Entity/BarCodeModel.cs

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

@ -628,7 +628,7 @@ namespace ICSSoft.DataProject
LEFT JOIN ICSOutsourcingOrder y ON x.OODetailID=y.OODetailID AND x.WorkPoint=y.WorkPoint
LEFT JOIN ICSOApply z ON m.ApplyDetailID=z.ApplyDetailID AND m.WorkPoint=z.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
INNER JOIN ICSConfiguration conv ON conv.Code='CompleteVerification' AND a.WorkPoint=con.WorkPoint
INNER JOIN ICSConfiguration conv ON conv.Code='CompleteVerification' AND a.WorkPoint=conv.WorkPoint
WHERE a.Identification='{0}' AND a.ERPUpload='0' AND ISNULL(a.LogID, '')=''
GROUP BY ISNULL(y.DepCode, ''),a.ToWarehouseCode,ISNULL(z.ApplyCode, y.OOCode),a.MUSER,a.InvCode,m.PickID,m.ApplyDetailID,con.Enable,conv.Enable,lot.Amount,lot.Quantity
,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, ''),
@ -649,7 +649,7 @@ namespace ICSSoft.DataProject
LEFT JOIN ICSOutsourcingOrder y ON x.OODetailID=y.OODetailID AND x.WorkPoint=y.WorkPoint
LEFT JOIN ICSOApply z ON m.ApplyDetailID=z.ApplyDetailID AND m.WorkPoint=z.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
INNER JOIN ICSConfiguration conv ON conv.Code='CompleteVerification' AND a.WorkPoint=con.WorkPoint
INNER JOIN ICSConfiguration conv ON conv.Code='CompleteVerification' AND a.WorkPoint=conv.WorkPoint
WHERE a.Identification='{0}' AND a.ERPUpload='0' AND ISNULL(a.LogID, '')<>''
GROUP BY ISNULL(y.DepCode, ''),a.ToWarehouseCode,ISNULL(z.ApplyCode, y.OOCode),a.MUSER,a.InvCode,m.PickID,m.ApplyDetailID,con.Enable,conv.Enable,lot.Amount,lot.Quantity
,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, ''),

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

@ -1515,33 +1515,32 @@ namespace ICSSoft.DataProject
#region 出库检验是否符合源头单据
string msg = string.Empty;
bool isLimit = false;
if (isOut&& TransType != TransTypeEnum.TransferLibrary.GetDescription()) // && TransType != TransTypeEnum.LOTSplit.GetDescription()
{
//string Lot ="";
//if (TransType == TransTypeEnum.TransferLibrary.GetDescription())
//{
// foreach (DataRow drLot in table.Rows)
// {
// Lot = drLot["LotNo"].ToString();
// string sql = @"SELECT WarehouseCode FROM ICSWareHouseLotInfo a WHERE LotNo='{0}' AND WorkPoint='{1}'";
// sql = string.Format(sql, Lot, WorkPoint);
// DataTable dt = DBHelper.SQlReturnData(sql, cmd);
// if (dt == null || dt.Rows.Count <= 0)
// {
// throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo171"), LotNo));
// }
// string whcode = dt.Rows[0]["WarehouseCode"].ToString();
// IF("+whcode+@" != '{8}')
//BEGIN
// RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo394"), "{8}",whcode) + @"', 16, 1);
// RETURN
// END
// }
if (isOut) // && TransType != TransTypeEnum.LOTSplit.GetDescription()
{//&& TransType != TransTypeEnum.TransferLibrary.GetDescription()
string Lot = "";
string workP = "";
if (TransType == TransTypeEnum.TransferLibrary.GetDescription())
{
foreach (DataRow drLot in table.Rows)
{
Lot = drLot["LotNo"].ToString();
sql = @"SELECT WarehouseCode FROM ICSWareHouseLotInfo a WHERE LotNo='{0}' AND WorkPoint='{1}'";
sql = string.Format(sql, Lot, JsonData.WorkPoint);
DataTable dt = DBHelper.SQlReturnData(sql, cmd);
if (dt == null || dt.Rows.Count <= 0)
{
throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo171"), Lot));
}
string whcode = dt.Rows[0]["WarehouseCode"].ToString();
if (!JsonData.WHCode.Equals(whcode))
{
throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo395"), JsonData.WHCode, whcode));
}
}
//}
//else
//{
}
else
{
if (string.IsNullOrEmpty(JsonData.TransCode))
{
throw new Exception(language.GetNameByCode("WMSAPIInfo001"));//"单据号不能为空!"
@ -1554,7 +1553,7 @@ namespace ICSSoft.DataProject
DataView dataView = TransData.DefaultView;
foreach (DataRow drLot in table.Rows)
{
string Lot = drLot["LotNo"].ToString();
Lot = drLot["LotNo"].ToString();
//盘点不需要对比以下属性
if (TransType == TransTypeEnum.Check.GetDescription())
continue;
@ -1622,7 +1621,7 @@ namespace ICSSoft.DataProject
isLimit = true;
}
}
//}
}
}
#endregion

22
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs

@ -887,19 +887,25 @@ namespace ICSSoft.DataProject
try
{
// IF("+whcode+@" != '{8}')
// BEGIN
// RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo394"), "{8}",whcode) + @"', 16, 1);
// RETURN
//END
string sql = @"SELECT WarehouseCode FROM ICSWareHouseLotInfo a WHERE LotNo='{0}' AND WorkPoint='{1}'";
sql = string.Format(sql, LotNo,WorkPoint);
DataTable dt = DBHelper.SQlReturnData(sql, cmd);
if (dt == null || dt.Rows.Count <= 0)
{
throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo171"), LotNo));
}
string whcode = dt.Rows[0]["WarehouseCode"].ToString();
///添加日志
string sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}')
sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}')
BEGIN
RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo060"), "{2}") + @"',16,1);
RETURN
END
IF('" + whcode + @"' != '{8}')
BEGIN
RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo394"), "{8}", whcode) + @"', 16, 1);
RETURN
END
INSERT INTO ICSWareHouseLotInfoLog(ID,Identification,TransCode,TransSequence,LotNo,InvCode,
FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity,

1
ICSSoft.WMS.WebAPI/ICSSoft.Entity/BarCodeModel.cs

@ -21,5 +21,6 @@ namespace ICSSoft.Entity
/// 用于排除本次已扫描的条码(多个用'',分割,如:'001','002')
/// </summary>
public string ScanLotCode { get; set; }
public string WHCode { get; set; }
}
}
Loading…
Cancel
Save