Browse Source

SAP获取库存接口修改

master
陆晔 1 year ago
parent
commit
391d831217
  1. 4
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
  2. 60
      WMS-BS/NFine.Application/WMS/PickMaterialApp.cs
  3. 4
      WMS-BS/NFine.Web/Configs/database.config

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

@ -8436,7 +8436,7 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer
strInvCode += ",'" + INVCode + "'";
}
}
sql += $@" AND A.InvCode IN '{strInvCode}'";
sql += $@" AND A.InvCode IN ({strInvCode})";
}
if (!string.IsNullOrEmpty(JsonData.WHCode))
{
@ -8545,7 +8545,7 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer
strInvCode += ",'" + INVCode + "'";
}
}
sql += $@" AND A.InvCode IN '{strInvCode}'";
sql += $@" AND A.InvCode IN ({strInvCode})";
}
if (!string.IsNullOrEmpty(JsonData.WHCode))
{

60
WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

@ -2162,20 +2162,6 @@ c.Sequence,
}
#endregion
}
// sql += string.Format(@" update b set b.LockQuantity=convert(decimal(18,6),b.LockQuantity)-convert(decimal(18,6),c.Quantity )
// from dbo.ICSWareHouseLotInfo b
//inner join (select sum(Quantity) as Quantity, LotNo from ICSWareHouseLotInfolog where TransCode in ({0})and TransType='15' and WorkPoint='{1}' group by LotNo) c
//on c.LotNo =b.LotNo ", objCode.TrimEnd(','), WorkPoint);
//sql += string.Format(@" delete dbo.ICSWareHouseLotInfoLog where TransCode in({0}) and TransType='15' and WorkPoint='{1}'", objCode.TrimEnd(','), WorkPoint);
pikTbLogsql = @"update b set b.LockQuantity=convert(decimal(18,6),b.LockQuantity)-convert(decimal(18,6),c.Quantity )
from dbo.ICSWareHouseLotInfo b
inner join (select sum(Quantity) as Quantity, LotNo from ICSWareHouseLotInfolog
where TransCode in ({0})and TransType='15' and WorkPoint='{1}' group by LotNo) c
on c.LotNo =b.LotNo
delete dbo.ICSWareHouseLotInfoLog where TransCode in({0}) and TransType='15' and WorkPoint='{1}'";
pikTbLogsql = string.Format(pikTbLogsql, ID, WorkPoint);
foreach (DataRow PickLog in table.Rows)
{
pikTbLogsql += @" IF NOT EXISTS(SELECT TransCode FROM ICSWareHouseLotInfoLog WHERE TransCode='{1}' AND TransSequence='{2}' AND LotNo='{9}' AND WorkPoint='{8}' AND TransType='15')
@ -2200,52 +2186,6 @@ c.Sequence,
, BusinessCode, MUSER, MUSERNAME, pikTbLogTime, WorkPoint, PickLog["LotNO"].ToString());
}
SqlHelper.CmdExecuteNonQueryLi(pikTbLogsql);
#region 重复性检查,如出现一个条码存在同一单据同一行重复占料的情况,删除重复行(插入时有验证,暂时注释)
//foreach (string DocCode in ID.Split(','))
//{
// string chklotno = "";
// string chktranscode = "";
// string chktranssequence = "";
// string rechksql = @"select TransCode,TransSequence,LotNo,Quantity from ICSWareHouseLotInfoLog
// where TransType='15' and TransCode={0}
// and WorkPoint='{1}'
// ORDER BY TransCode,TransSequence,LotNo";
// rechksql = string.Format(rechksql, DocCode, WorkPoint);
// var rechkds = Repository().FindDataSetBySql(rechksql);
// DataTable rechkdt = rechkds.Tables[0];
// foreach (DataRow dr in rechkdt.Rows)
// {
// if (chklotno == "")
// {
// chklotno = dr["LotNo"].ToString();
// chktranscode = dr["TransCode"].ToString();
// chktranssequence = dr["TransSequence"].ToString();
// }
// else
// {
// if (chklotno == dr["LotNo"].ToString() && chktranscode == dr["TransCode"].ToString()
// && chktranssequence == dr["TransSequence"].ToString())
// {
// string delsql = @"update ICSWareHouseLotInfo set LockQuantity-={5}
// where LotNo='{0}' and WorkPoint='{3}'
// delete from ICSWareHouseLotInfoLog
// where LotNo='{0}' and TransCode='{1}' and TransSequence='{2}'
// and WorkPoint='{3}' and Identification!='{4}'";
// delsql = string.Format(delsql, chklotno, chktranscode, chktranssequence, WorkPoint, Identification, dr["Quantity"].ToString());
// SqlHelper.CmdExecuteNonQueryLi(delsql);
// }
// else
// {
// chklotno = dr["LotNo"].ToString();
// chktranscode = dr["TransCode"].ToString();
// chktranssequence = dr["TransSequence"].ToString();
// }
// }
// }
//}
#endregion
#endregion
}

4
WMS-BS/NFine.Web/Configs/database.config

@ -5,10 +5,10 @@
<!--108-->
<!--<add name="connstr" connectionString="JZjXxiMt8L2hkBlLUD8PBo2VxWR5j1mbj0xyJuwPqY46ywhO56rsfUcuYrySELpMcIISP9ZsoeoRM35Azqruwa16sHbPpvUnLjcXO9dQBsCb0fkixsVZhA==" providerName="System.Data.SqlClient" />-->
<!--本地-->
<!--<add name="connstr" connectionString="terx6nSzhBu3PkkAnpCSyozL3WzAB9fHjBxO0NVXmpe6eOA9kowv/TJOuTy7IT8nOsne+r4F4sCVTYdtU25qsA==" providerName="System.Data.SqlClient" />-->
<add name="connstr" connectionString="terx6nSzhBu3PkkAnpCSyozL3WzAB9fHjBxO0NVXmpe6eOA9kowv/TJOuTy7IT8nOsne+r4F4sCVTYdtU25qsA==" providerName="System.Data.SqlClient" />
<!--<add name="connstr" connectionString="rtGBmI26Iovnlhi1pmCU283HlJT7oPnYCzpoKCGyI+c3h86ku+Ux2F7djfwb8dhNZ9BY1kXXzWEL3Ggv1Ma0FLtNl8NdZVmT" providerName="System.Data.SqlClient" />-->
<!--正式-->
<add name="connstr" connectionString="rtGBmI26IovLyEon0NvnkIdIGtERsck4MvG2wvfMHc6XnoqSx8xp4zCTtW6J8SL4+zTBRPXBbFQ4AEnn281E5TY7A1IZOMIr" providerName="System.Data.SqlClient" />
<!--<add name="connstr" connectionString="rtGBmI26IovLyEon0NvnkIdIGtERsck4MvG2wvfMHc6XnoqSx8xp4zCTtW6J8SL4+zTBRPXBbFQ4AEnn281E5TY7A1IZOMIr" providerName="System.Data.SqlClient" />-->
<add name="ERPconnstr" connectionString="Server=192.168.1.218;Initial Catalog=ICS_WMS_NW;User ID=sa;Password=aA123456" providerName="System.Data.SqlClient" />
<add name="ATVERPconnstr" connectionString="Server=10.29.2.71;Initial Catalog=ATW-0717;User ID=sa;Password=atw.erp" providerName="System.Data.SqlClient" />
<add name="MailOpen" connectionString="true" />

Loading…
Cancel
Save