lilili 2 years ago
parent
commit
c8e2985bba
  1. 16
      ICSSoft.FromERP/ICSSoft.FromERP/ICSDeliveryNotice.cs
  2. BIN
      ICSSoft.FromERP/Root/ICSSoft.Frame.Data.Entity.dll
  3. 9
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
  4. 3
      WMS-BS/NFine.Application/NFine.Application.csproj
  5. 257
      WMS-BS/NFine.Application/WMS/PickMaterialApp.cs
  6. 16
      WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs

16
ICSSoft.FromERP/ICSSoft.FromERP/ICSDeliveryNotice.cs

@ -55,8 +55,8 @@ namespace ICSSoft.FromERP
#region 检验合格单同步
foreach (DataRow dr in dt.Rows)
{
SAPGetChkDocInfoZS.ZWMS_SK_WS_CHECK client = new SAPGetChkDocInfoZS.ZWMS_SK_WS_CHECK();
SAPGetChkDocInfoZS.ZWMS_SK_WS_CHECK1 Info = new SAPGetChkDocInfoZS.ZWMS_SK_WS_CHECK1();
SAPGetChkDocInfoVPN.ZWMS_SK_WS_CHECK client = new SAPGetChkDocInfoVPN.ZWMS_SK_WS_CHECK();
SAPGetChkDocInfoVPN.ZWMS_SK_WS_CHECK1 Info = new SAPGetChkDocInfoVPN.ZWMS_SK_WS_CHECK1();
if (DocNO != "")
{
Info.PRUEFLOS = DocNO;
@ -73,20 +73,20 @@ namespace ICSSoft.FromERP
Info.CHG_DATE = DateTime.Now.Year + "-" + DateTime.Now.Month.ToString().PadLeft(2, '0') + "-" + DateTime.Now.Day.ToString().PadLeft(2, '0');
}
Info.WERKS = dr["WorkPointCode"].ToString();
Info.ZCHECK_HEAD = new SAPGetChkDocInfoZS.ZWMS_SK_CHECK_HEAD[1];
Info.ZCHECK_ITEM = new SAPGetChkDocInfoZS.ZWMS_SK_CHECK_ITEM[1];
Info.ZCHECK_HEAD = new SAPGetChkDocInfoVPN.ZWMS_SK_CHECK_HEAD[1];
Info.ZCHECK_ITEM = new SAPGetChkDocInfoVPN.ZWMS_SK_CHECK_ITEM[1];
SAPGetChkDocInfoZS.ZWMS_SK_WS_CHECKResponse result = new SAPGetChkDocInfoZS.ZWMS_SK_WS_CHECKResponse();
SAPGetChkDocInfoVPN.ZWMS_SK_WS_CHECKResponse result = new SAPGetChkDocInfoVPN.ZWMS_SK_WS_CHECKResponse();
client.Timeout = 300000;
result = client.CallZWMS_SK_WS_CHECK(Info);
List<SAPGetChkDocInfoZS.ZWMS_SK_CHECK_ITEM> ItemInfoList = new List<SAPGetChkDocInfoZS.ZWMS_SK_CHECK_ITEM>();
List<SAPGetChkDocInfoVPN.ZWMS_SK_CHECK_ITEM> ItemInfoList = new List<SAPGetChkDocInfoVPN.ZWMS_SK_CHECK_ITEM>();
ItemInfoList.AddRange(result.ZCHECK_ITEM);
foreach (SAPGetChkDocInfoZS.ZWMS_SK_CHECK_HEAD HeadInfo in result.ZCHECK_HEAD)
foreach (SAPGetChkDocInfoVPN.ZWMS_SK_CHECK_HEAD HeadInfo in result.ZCHECK_HEAD)
{
string LineNum = "10";
var ItemInfo = ItemInfoList.Where(a => a.PRUEFLOS == HeadInfo.PRUEFLOS);
foreach (SAPGetChkDocInfoZS.ZWMS_SK_CHECK_ITEM Item in ItemInfo)
foreach (SAPGetChkDocInfoVPN.ZWMS_SK_CHECK_ITEM Item in ItemInfo)
{
str = Item.PRUEFLOS;
string ExtensionID = "";

BIN
ICSSoft.FromERP/Root/ICSSoft.Frame.Data.Entity.dll

Binary file not shown.

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

@ -2850,7 +2850,8 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.ReturnDoc.GetDescription())
ICSWareHouseService.ReturnDocERP(TransType, Identification, cmd, language, BusinessCode);
}
DataTable table = GetData(Identification, 1, cmd);
//DataTable table = GetData(Identification, 1, cmd);
DataTable table = new DataTable();
cmd.Transaction.Commit();
return table;
}
@ -3355,7 +3356,8 @@ namespace ICSSoft.DataProject
}
else
{
DataTable table = GetData(Identification, 2, cmd);
//DataTable table = GetData(Identification, 2, cmd);
DataTable table = new DataTable();
cmd.Transaction.Commit();
return table;
}
@ -3542,7 +3544,8 @@ namespace ICSSoft.DataProject
}
else
{
DataTable table = GetData(Identification, 2, cmd);
//DataTable table = GetData(Identification, 2, cmd);
DataTable table = new DataTable();
cmd.Transaction.Commit();
return table;
}

3
WMS-BS/NFine.Application/NFine.Application.csproj

@ -39,6 +39,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\NFine.Web\bin\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>

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

@ -2067,106 +2067,120 @@ c.Sequence,
if (Type == "2" || Type == "12" || Type == "5")
{
#region 货柜
string InspectJosn = "";
string InspectJosnHead = "";
string InspectJosnBody = "";
InspectJosn += "{";
InspectJosn += "\"IMP_ORDINI\":[";
InspectJosn += "货柜主表区域预留";
InspectJosn += "],";
InspectJosn += "\"IMP_ORDINI_RIGHE\":[";
InspectJosn += "货柜子表区域预留";
InspectJosn += "]";
InspectJosn += "}";
for (int i = 0; i < table.Rows.Count; i++)
{
string hgsql = @"select A.InvCode,A.LocationCode,B.F_Define3,C.LocationCode AS Area
from ICSWareHouseLotInfo A
INNER JOIN Sys_SRM_ItemsDetail B ON B.F_Define2=A.LocationCode AND F_Define4=A.WorkPoint AND F_ItemName='HG_Location'
INNER JOIN ICSInventoryDetail C ON C.INVCode=A.InvCode AND C.WHCode=A.WarehouseCode AND C.WorkPoint=A.WorkPoint
where A.LotNo='{0}' AND A.WorkPoint='{1}'";
hgsql = string.Format(hgsql, table.Rows[i]["LotNO"].ToString(), WorkPoint);
var hgds = Repository().FindDataSetBySql(hgsql);
if (hgds.Tables.Count == 0)
return null;
DataTable hgtable = hgds.Tables[0];
if (hgtable.Rows.Count > 0)
{
if (!DocNoList.Contains(table.Rows[i]["Code"].ToString()))
{
DocNoList.Add(table.Rows[i]["Code"].ToString());
}
InspectJosnBody += "{";
InspectJosnBody += "\"RIG_ORDINE\":\"" + table.Rows[i]["Code"].ToString() + "\",";
InspectJosnBody += "\"RIG_ARTICOLO\": \"" + hgtable.Rows[0]["InvCode"].ToString() + "\",";
InspectJosnBody += "\"RIG_SUB1\": \"\",";
InspectJosnBody += "\"RIG_SUB2\": \"\",";
InspectJosnBody += "\"RIG_ELERUOLI_GEST\": \"" + hgtable.Rows[0]["Area"].ToString() + "\",";
InspectJosnBody += "\"RIG_ELEBAIE\": \"" + hgtable.Rows[0]["F_Define3"].ToString() + "\",";
InspectJosnBody += "\"RIG_QTAR\": " + table.Rows[i]["SendQTY"].ToString() + ",";
if (i == 0)
{
InspectJosnBody += "\"RIG_HOSTINF\": \"" + table.Rows[i]["Sequence"].ToString() + "\"";
}
else
{
if (table.Rows[i]["Code"].ToString() == table.Rows[i - 1]["Code"].ToString() &&
table.Rows[i]["Sequence"].ToString() == table.Rows[i - 1]["Sequence"].ToString())
{
InspectJosnBody += "\"RIG_HOSTINF\": \"" + table.Rows[i]["Sequence"].ToString() + Count.ToString() + "\"";
Count++;
}
else
{
InspectJosnBody += "\"RIG_HOSTINF\": \"" + table.Rows[i]["Sequence"].ToString() + "\"";
Count = 1;
}
}
InspectJosnBody += "},";
}
}
InspectJosnBody = InspectJosnBody.TrimEnd(',');
foreach (string DocNo in DocNoList)
{
InspectJosnHead += "{";
InspectJosnHead += "\"ORD_ORDINE\":\"" + DocNo.TrimStart('\'').TrimEnd('\'') + "\",";
InspectJosnHead += "\"ORD_DES\":\"" + TransType + "\",";
InspectJosnHead += "\"ORD_TIPOOP\":\"P\",";
InspectJosnHead += "\"ORD_CLIENTE\":\"" + WorkPoint + "\"";
InspectJosnHead += "},";
}
InspectJosnHead = InspectJosnHead.TrimEnd(',');
if (InspectJosnBody != "")
{
InspectJosn = InspectJosn.Replace("货柜主表区域预留", InspectJosnHead);
InspectJosn = InspectJosn.Replace("货柜子表区域预留", InspectJosnBody);
if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"]))
{
string callresult = "";
#region 货柜接口调用前日志
object logID = Guid.NewGuid();
string logsql = @"insert into ICSWMS_HGLog
values
('{0}',GETDATE(),'{1}','{2}','{3}','{4}','{5}')";
logsql = string.Format(logsql, logID, InspectJosn, "", WorkPoint, MUSER, MUSERNAME);
SqlHelper.CmdExecuteNonQueryLi(logsql);
#endregion
callresult = HTTPHelper.RestFulGet(InspectJosn, postUrlStr);
#region 货柜接口调用后日志
logsql = @"update ICSWMS_HGLog set ReturnResult='{0}'
where ID='{1}'";
logsql = string.Format(logsql, callresult, logID);
SqlHelper.CmdExecuteNonQueryLi(logsql);
#endregion
//if (!callresult.Contains("successo"))
//{
// ICSHGResult hgresult = JsonConvert.DeserializeObject<ICSHGResult>(callresult.TrimStart('[').TrimEnd(']'));
// throw new Exception("货柜单据传输接口调用报错,主要报错信息:" + hgresult.PrimaryError + ",次要报错信息:" + hgresult.SecondaryError + "");
//}
}
}
//string InspectJosn = "";
//string InspectJosnHead = "";
//string InspectJosnBody = "";
//InspectJosn += "{";
//InspectJosn += "\"IMP_ORDINI\":[";
//InspectJosn += "货柜主表区域预留";
//InspectJosn += "],";
//InspectJosn += "\"IMP_ORDINI_RIGHE\":[";
//InspectJosn += "货柜子表区域预留";
//InspectJosn += "]";
//InspectJosn += "}";
//for (int i = 0; i < table.Rows.Count; i++)
//{
// string hgsql = @"select A.InvCode,A.LocationCode,B.F_Define3,C.LocationCode AS Area
// from ICSWareHouseLotInfo A
// INNER JOIN Sys_SRM_ItemsDetail B ON B.F_Define2=A.LocationCode AND F_Define4=A.WorkPoint AND F_ItemName='HG_Location'
// INNER JOIN ICSInventoryDetail C ON C.INVCode=A.InvCode AND C.WHCode=A.WarehouseCode AND C.WorkPoint=A.WorkPoint
// where A.LotNo='{0}' AND A.WorkPoint='{1}'";
// hgsql = string.Format(hgsql, table.Rows[i]["LotNO"].ToString(), WorkPoint);
// var hgds = Repository().FindDataSetBySql(hgsql);
// if (hgds.Tables.Count == 0)
// return null;
// DataTable hgtable = hgds.Tables[0];
// if (hgtable.Rows.Count > 0)
// {
// if (!DocNoList.Contains(table.Rows[i]["Code"].ToString()))
// {
// DocNoList.Add(table.Rows[i]["Code"].ToString());
// }
// InspectJosnBody += "{";
// InspectJosnBody += "\"RIG_ORDINE\":\"" + table.Rows[i]["Code"].ToString() + "\",";
// InspectJosnBody += "\"RIG_ARTICOLO\": \"" + hgtable.Rows[0]["InvCode"].ToString() + "\",";
// InspectJosnBody += "\"RIG_SUB1\": \"\",";
// InspectJosnBody += "\"RIG_SUB2\": \"\",";
// InspectJosnBody += "\"RIG_ELERUOLI_GEST\": \"" + hgtable.Rows[0]["Area"].ToString() + "\",";
// InspectJosnBody += "\"RIG_ELEBAIE\": \"" + hgtable.Rows[0]["F_Define3"].ToString() + "\",";
// InspectJosnBody += "\"RIG_QTAR\": " + table.Rows[i]["SendQTY"].ToString() + ",";
// if (i == 0)
// {
// InspectJosnBody += "\"RIG_HOSTINF\": \"" + table.Rows[i]["Sequence"].ToString() + "\"";
// }
// else
// {
// if (table.Rows[i]["Code"].ToString() == table.Rows[i - 1]["Code"].ToString() &&
// table.Rows[i]["Sequence"].ToString() == table.Rows[i - 1]["Sequence"].ToString())
// {
// InspectJosnBody += "\"RIG_HOSTINF\": \"" + table.Rows[i]["Sequence"].ToString() + Count.ToString() + "\"";
// Count++;
// }
// else
// {
// InspectJosnBody += "\"RIG_HOSTINF\": \"" + table.Rows[i]["Sequence"].ToString() + "\"";
// Count = 1;
// }
// }
// InspectJosnBody += "},";
// }
//}
//InspectJosnBody = InspectJosnBody.TrimEnd(',');
//foreach (string DocNo in DocNoList)
//{
// InspectJosnHead += "{";
// InspectJosnHead += "\"ORD_ORDINE\":\"" + DocNo.TrimStart('\'').TrimEnd('\'') + "\",";
// InspectJosnHead += "\"ORD_DES\":\"" + TransType + "\",";
// InspectJosnHead += "\"ORD_TIPOOP\":\"P\",";
// InspectJosnHead += "\"ORD_CLIENTE\":\"" + WorkPoint + "\"";
// InspectJosnHead += "},";
//}
//InspectJosnHead = InspectJosnHead.TrimEnd(',');
//if (InspectJosnBody != "")
//{
// InspectJosn = InspectJosn.Replace("货柜主表区域预留", InspectJosnHead);
// InspectJosn = InspectJosn.Replace("货柜子表区域预留", InspectJosnBody);
// if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"]))
// {
// string callresult = "";
// #region 货柜接口调用前日志
// object logID = Guid.NewGuid();
// string logsql = @"insert into ICSWMS_HGLog
// values
// ('{0}',GETDATE(),'{1}','{2}','{3}','{4}','{5}')";
// logsql = string.Format(logsql, logID, InspectJosn, "", WorkPoint, MUSER, MUSERNAME);
// SqlHelper.CmdExecuteNonQueryLi(logsql);
// #endregion
// callresult = HTTPHelper.RestFulGet(InspectJosn, postUrlStr);
// #region 货柜接口调用后日志
// logsql = @"update ICSWMS_HGLog set ReturnResult='{0}'
// where ID='{1}'";
// logsql = string.Format(logsql, callresult, logID);
// SqlHelper.CmdExecuteNonQueryLi(logsql);
// #endregion
// //if (!callresult.Contains("successo"))
// //{
// // ICSHGResult hgresult = JsonConvert.DeserializeObject<ICSHGResult>(callresult.TrimStart('[').TrimEnd(']'));
// // throw new Exception("货柜单据传输接口调用报错,主要报错信息:" + hgresult.PrimaryError + ",次要报错信息:" + hgresult.SecondaryError + "");
// //}
// }
//}
#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')
@ -2191,7 +2205,52 @@ 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
}

16
WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs

@ -18,6 +18,7 @@ namespace NFine.Application.WMS
{
public class WMSCreateItemLotApp : RepositoryFactory<ICSVendor>
{
private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public DataTable GetGridJson(string queryJson, ref Pagination jqgridparam)
{
DataTable dt = new DataTable();
@ -1876,9 +1877,14 @@ WHERE
IsSuccess = "N";
ErrorMessage += result.L_MESSAGE;
}
else
{
log.Debug("批量过账返回值:" + result.Z_NULL + "批量过账返回信息:" + result.L_MESSAGE);
}
}
if (IsSuccess == "N")
{
log.Debug("批量过账返回值:" + IsSuccess + "批量过账返回信息:" + ErrorMessage);
throw new Exception(ErrorMessage);
}
#endregion
@ -3310,15 +3316,15 @@ CAST( (a.Quantity-ISNULL(c.LOTQTY,0)) as DECIMAL(18,{0})) as thisCreateQty,isnu
#region 调用SAP接口(检验合格单为两层结构 一行对应一个序列号)
string IsSuccess = "";
string ErrorMessage = "";
SAPCallBackJYHGDVPN.ZWMS_SK_WS_RUKU Client = new SAPCallBackJYHGDVPN.ZWMS_SK_WS_RUKU();
SAPCallBackJYHGDVPN.ZWMS_SK_WS_RUKU1 Info = new SAPCallBackJYHGDVPN.ZWMS_SK_WS_RUKU1();
SAPCallBackJYHGDVPNCS.ZWMS_SK_WS_RUKU Client = new SAPCallBackJYHGDVPNCS.ZWMS_SK_WS_RUKU();
SAPCallBackJYHGDVPNCS.ZWMS_SK_WS_RUKU1 Info = new SAPCallBackJYHGDVPNCS.ZWMS_SK_WS_RUKU1();
Info.NEWID = dt.Rows[i]["ID"].ToString();
Info.PRUEFLOS = dt.Rows[i]["DNCode"].ToString();
Info.L_LME = System.Decimal.Round(Convert.ToDecimal(dt.Rows[i]["SAPSequence"].ToString()), 3);
Info.SERNP = "";
Info.Z_GERNR = new SAPCallBackJYHGDVPN.ZWEBS_GERNR[0];
Info.Z_GERNR = new SAPCallBackJYHGDVPNCS.ZWEBS_GERNR[0];
SAPCallBackJYHGDVPN.ZWMS_SK_WS_RUKUResponse result = new SAPCallBackJYHGDVPN.ZWMS_SK_WS_RUKUResponse();
SAPCallBackJYHGDVPNCS.ZWMS_SK_WS_RUKUResponse result = new SAPCallBackJYHGDVPNCS.ZWMS_SK_WS_RUKUResponse();
result = Client.CallZWMS_SK_WS_RUKU(Info);
if (result.Z_NULL == "N")
{
@ -3327,6 +3333,7 @@ CAST( (a.Quantity-ISNULL(c.LOTQTY,0)) as DECIMAL(18,{0})) as thisCreateQty,isnu
}
else
{
log.Debug("过账返回值:" + result.Z_NULL + "过账返回信息:" + result.L_MESSAGE);
string updatesql = @"update ICSDeliveryNotice set RCVQuantity+=Convert(decimal(18,6),SAPSequence)
where DNCode='{0}' and WorkPoint='{1}'";
updatesql = string.Format(updatesql, dt.Rows[i]["DNCode"].ToString(), WorkPoint);
@ -3334,6 +3341,7 @@ CAST( (a.Quantity-ISNULL(c.LOTQTY,0)) as DECIMAL(18,{0})) as thisCreateQty,isnu
}
if (IsSuccess == "N")
{
log.Error("过账返回值:" + IsSuccess + "过账返回信息:" + ErrorMessage);
throw new Exception(ErrorMessage);
}
#endregion

|||||||
100:0
Loading…
Cancel
Save