Browse Source

货柜接口调用逻辑修改

master
陆晔 2 years ago
parent
commit
131f16d355
  1. 2
      ICSSoft.FromERP/ICSSoft.FromERP/App.config
  2. 6
      ICSSoft.FromERP/ICSSoft.FromERP/ICSSAPDocGet.cs
  3. BIN
      ICSSoft.FromERP/Root/ICSSoft.Frame.Data.Entity.dll
  4. 2
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs
  5. 8
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs
  6. 101
      WMS-BS/NFine.Application/WMS/PickMaterialApp.cs
  7. 289
      WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs
  8. 7
      WMS-BS/NFine.Data/Extensions/HTTPHelper.cs
  9. 10
      WMS-BS/NFine.Web/Areas/WMS/Controllers/WMSCreateItemLotController.cs
  10. 14
      WMS-BS/NFine.Web/Areas/WMS/Views/WMSCreateItemLot/CreateItemLot.cshtml
  11. 6
      WMS-BS/NFine.Web/Configs/database.config

2
ICSSoft.FromERP/ICSSoft.FromERP/App.config

@ -9,7 +9,7 @@
<add key="ERPDB" value="[192.168.1.218].[ICS_WMS_NW]"/>
<add key="WHCode" value=""/>
<add key="Date" value=""/>
<add key="DocNo" value="010002611620"/>
<add key="DocNo" value=""/>
<!--测试-->
<!--<add key="HGpostUrlStr" value="http://58.210.216.118:8382/api/jobs/CFG-IMP-ORDINI"/>-->
<!--正式-->

6
ICSSoft.FromERP/ICSSoft.FromERP/ICSSAPDocGet.cs

@ -72,7 +72,7 @@ namespace ICSSoft.FromERP
DocInfo.DANJU = "";
DocInfo.CHG_DATE = DateTime.Now.Year + "-" + DateTime.Now.Month.ToString().PadLeft(2, '0') + "-" + DateTime.Now.Day.ToString().PadLeft(2, '0');
}
DocInfo.SET_NOTMODIFY = "";
DocInfo.SET_NOTMODIFY = "X";
DocInfo.CLEAR_NOTMODIFY = "";
DocInfo.WERKS = dr["WorkPointCode"].ToString();
DocInfo.Z_HEAD = new SAPGetDocInfoZS.ZWMS_SK_HEAD[1];
@ -702,8 +702,8 @@ namespace ICSSoft.FromERP
#region 委外退料单同步(单据类型:06)
#endregion
#region 生产领料单同步(单据类型:01 03 17)
HeadInfo = HeadInfoList.Where(a => a.LEIXING == "01" || a.LEIXING == "03" || a.LEIXING == "17");
#region 生产领料单同步(单据类型:01 03 17 20
HeadInfo = HeadInfoList.Where(a => a.LEIXING == "01" || a.LEIXING == "03" || a.LEIXING == "17" || a.LEIXING == "20");
foreach (SAPGetDocInfoZS.ZWMS_SK_HEAD Info in HeadInfo)
{
try

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

Binary file not shown.

2
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs

@ -314,7 +314,7 @@ namespace ICSSoft.DataProject
SAPCallBackDocVPN.ZWMS_SK_WS_PZ1 Info = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ1();
Info.NEWID = Identification;
Info.DANJU = dt.Rows[i]["ApplyCode"].ToString();
if (dt.Rows[i]["EATTRIBUTE"].ToString() == "01")
if (dt.Rows[i]["EATTRIBUTE"].ToString() == "01" && dt.Rows[i]["EATTRIBUTE"].ToString() == "20")
{
Info.STATE = "1";
}

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

@ -552,7 +552,7 @@ namespace ICSSoft.DataProject
string WHCode = "";
string LotNo = "";
#region 根据传入的料号和数量自动生成条码
if (BusinessCode == "采购入库-采购到货单")
if (TransType == "2")
{
string ExtensionID = "";
string Pre = "DN" + TransCode + TransLine;
@ -584,7 +584,7 @@ namespace ICSSoft.DataProject
throw new Exception(language.GetNameByCode("WMSAPIInfo215"));
}
}
else if (BusinessCode == "产成品入库-产成品入库单")
else if (TransType == "18")
{
string ExtensionID = "";
string Pre = "KCP" + TransCode + TransLine;
@ -616,7 +616,7 @@ namespace ICSSoft.DataProject
throw new Exception(language.GetNameByCode("WMSAPIInfo215"));
}
}
else if (BusinessCode == "生产退料-生产退料单-领料申请单")
else if (TransType == "16")
{
string ExtensionID = "";
string Pre = "MA" + TransCode + TransLine;
@ -759,7 +759,7 @@ namespace ICSSoft.DataProject
LEFT JOIN ICSWareHouseLotInfoLog B ON B.LotNo=A.LotNo AND B.TransType='15' AND B.WorkPoint=A.WorkPoint
WHERE A.LotNo='{0}' AND B.TransCode='{1}' AND B.TransSequence='{2}' AND A.WorkPoint='{3}'
DELETE FROM ICSWareHouseLotInfoLog
WHERE LotNo='{0}' AND TransCode='{1} AND TransSequence='{2}' AND WorkPoint='{3}' AND TransType='15'";
WHERE LotNo='{0}' AND TransCode='{1}' AND TransSequence='{2}' AND WorkPoint='{3}' AND TransType='15'";
sql = string.Format(sql, LotNo, TransCode, TransSequence, WorkPoint);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
{

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

@ -14,6 +14,7 @@ using Newtonsoft.Json;
using System.Configuration;
using System.Data.SqlClient;
using ICS.Data;
using NFine.Domain._03_Entity.WMS;
namespace NFine.Application.WMS
{
@ -237,7 +238,7 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'";
left join ICSMOPickMerge e on a.ID=e.SourceID and a.WorkPoint=e.WorkPoint
left join ICSExtension f on a.ExtensionID=f.ID and a.WorkPoint=f.WorkPoint
where a.ApplyCode='{0}' and a.WorkPoint='{1}' and a.EATTRIBUTE!='17'";
if (!string.IsNullOrWhiteSpace(queryJson))
{
if (!string.IsNullOrWhiteSpace(queryParam["WHCode"].ToString()))
@ -1593,6 +1594,7 @@ left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLo
// }
public DataTable GetICSMOPickMergeTemp(string ID, string Type)
{
string postUrlStr = System.Configuration.ConfigurationManager.AppSettings["HGDocpostUrlStr"].ToString();
string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
string MUSERNAME = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName;
string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
@ -1910,15 +1912,98 @@ c.Sequence,
}
#region 拣料时增加条码出入库记录,修改库存锁定数量,以作占料处理
string BusinessCode = string.Empty;
if (Type == "2") { BusinessCode = "13"; }
if (Type == "12") { BusinessCode = "14"; }
if (Type == "5") { BusinessCode = "5"; }
if (Type == "7") { BusinessCode = "19"; }
if (Type == "8") { BusinessCode = "24"; }
if (Type == "10") { BusinessCode = "47"; }
string TransType = "";
if (Type == "2") { BusinessCode = "13"; TransType = "生产发料-生产订单备料表"; }
if (Type == "12") { BusinessCode = "14"; TransType = "生产发料-领料申请单"; }
if (Type == "5") { BusinessCode = "6"; TransType = "委外发料-委外领料申请单"; }
if (Type == "7") { BusinessCode = "19"; TransType = "销售发货-销售发货单"; }
if (Type == "8") { BusinessCode = "24"; TransType = "杂发"; }
if (Type == "10") { BusinessCode = "47"; TransType = "调拨申请单"; }
string Identification = Guid.NewGuid().ToString();
var pikTbLogTime = DateTime.Now;
string pikTbLogsql = string.Empty;
List<string> DocNoList = new List<string>();
string InspectJosn = "";
string InspectJosnHead = "";
string InspectJosnBody = "";
InspectJosn += "{";
InspectJosn += "\"IMP_ORDINI\":[";
InspectJosn += "货柜主表区域预留";
InspectJosn += "],";
InspectJosn += "\"IMP_ORDINI_RIGHE\":[";
InspectJosn += "货柜子表区域预留";
InspectJosn += "]";
InspectJosn += "}";
foreach (DataRow PickLog in table.Rows)
{
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, PickLog["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(PickLog["Code"].ToString()))
{
DocNoList.Add(PickLog["Code"].ToString());
}
InspectJosnBody += "{";
InspectJosnBody += "\"RIG_ORDINE\":\"" + PickLog["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\": " + PickLog["SendQTY"].ToString() + ",";
InspectJosnBody += "\"RIG_HOSTINF\": \"" + PickLog["Sequence"].ToString() + "\"";
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.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 + "");
}
}
}
foreach (DataRow PickLog in table.Rows)
{
pikTbLogsql += @"INSERT INTO ICSWareHouseLotInfoLog(ID,Identification,TransCode,TransSequence,LotNo,InvCode,
@ -2437,7 +2522,7 @@ c.Sequence,
GROUP BY c.MOCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,x.MergeID,a.ExtensionID";
#endregion
}
if (Type == "2" || Type=="12")
if (Type == "2" || Type == "12")
{
#region 工单领料SQL
sqls = @" select

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

@ -2748,181 +2748,188 @@ CAST( (a.Quantity-ISNULL(c.LOTQTY,0)) as DECIMAL(18,{0})) as thisCreateQty,isnu
}
//单据上传货柜
public string DocUpLoadToHG(string DocNoList,string Type, string WorkPoint)
public string DocUpLoadToHG(string DocNoList,string Type)
{
string postUrlStr = System.Configuration.ConfigurationManager.AppSettings["HGDocpostUrlStr"].ToString();
string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
string MUSERNAME = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName;
string WorkPoints = NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(',');
string DocNoInfo = DocNoList.TrimEnd(',');
string InspectJosn = "";
#region 检验合格单
if (Type == "7")
try
{
InspectJosn += "{";
InspectJosn += "\"IMP_ORDINI\":[";
foreach (string DocNO in DocNoInfo.Split(','))
string postUrlStr = System.Configuration.ConfigurationManager.AppSettings["HGDocpostUrlStr"].ToString();
string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
string MUSERNAME = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName;
string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(',');
string DocNoInfo = DocNoList.TrimEnd(',');
string InspectJosn = "";
#region 检验合格单
if (Type == "7")
{
InspectJosn += "{";
InspectJosn += "\"ORD_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"ORD_DES\":\"采购入库-采购到货单\",";
InspectJosn += "\"ORD_TIPOOP\":\"V\",";
InspectJosn += "\"ORD_CLIENTE\":\"" + WorkPoint + "\"";
InspectJosn += "},";
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "],";
InspectJosn += "\"IMP_ORDINI_RIGHE\":[";
InspectJosn += "\"IMP_ORDINI\":[";
foreach (string DocNO in DocNoInfo.Split(','))
{
InspectJosn += "{";
InspectJosn += "\"ORD_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"ORD_DES\":\"采购入库-采购到货单\",";
InspectJosn += "\"ORD_TIPOOP\":\"V\",";
InspectJosn += "\"ORD_CLIENTE\":\"" + WorkPoint + "\"";
InspectJosn += "},";
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "],";
InspectJosn += "\"IMP_ORDINI_RIGHE\":[";
foreach (string DocNO in DocNoInfo.Split(','))
{
string sql = @" select A.DNCode,A.Sequence,A.InvCode,A.Quantity,B.LocationCode AS Area from ICSDeliveryNotice A
foreach (string DocNO in DocNoInfo.Split(','))
{
string sql = @" select A.DNCode,A.Sequence,A.InvCode,A.Quantity,B.LocationCode AS Area from ICSDeliveryNotice A
INNER JOIN ICSInventoryDetail B ON B.WHCode=A.WHCode AND B.INVCode=A.InvCode AND B.WorkPoint=A.WorkPoint
where A.DNCode='{0}' and A.WorkPoint='{1}'";
sql = string.Format(sql, DocNO, WorkPoint);
DataTable dt = Repository().FindTableBySql(sql.ToString());
for (int i = 0; i < dt.Rows.Count; i++)
{
//RIG_ELERUOLI_GEST-区域-出入库都要
//RIG_ELEBAIE-机器出口-出库-出库才要
InspectJosn += "{";
InspectJosn += "\"RIG_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"RIG_ARTICOLO\": \"" + dt.Rows[i]["InvCode"].ToString() + "\",";
InspectJosn += "\"RIG_SUB1\": \"\",";
InspectJosn += "\"RIG_SUB2\": \"\",";
InspectJosn += "\"RIG_ELERUOLI_GEST\": \"" + dt.Rows[i]["Area"].ToString() + "\",";
InspectJosn += "\"RIG_QTAR\": " + dt.Rows[i]["Quantity"].ToString() + ",";
InspectJosn += "\"RIG_HOSTINF\": " + dt.Rows[i]["Sequence"].ToString() + "";
InspectJosn += "},";
sql = string.Format(sql, DocNO, WorkPoint);
DataTable dt = Repository().FindTableBySql(sql.ToString());
for (int i = 0; i < dt.Rows.Count; i++)
{
//RIG_ELERUOLI_GEST-区域-出入库都要
//RIG_ELEBAIE-机器出口-出库-出库才要
InspectJosn += "{";
InspectJosn += "\"RIG_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"RIG_ARTICOLO\": \"" + dt.Rows[i]["InvCode"].ToString() + "\",";
InspectJosn += "\"RIG_SUB1\": \"\",";
InspectJosn += "\"RIG_SUB2\": \"\",";
InspectJosn += "\"RIG_ELERUOLI_GEST\": \"" + dt.Rows[i]["Area"].ToString() + "\",";
InspectJosn += "\"RIG_QTAR\": " + dt.Rows[i]["Quantity"].ToString() + ",";
InspectJosn += "\"RIG_HOSTINF\": " + dt.Rows[i]["Sequence"].ToString() + "";
InspectJosn += "},";
}
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "]";
InspectJosn += "}";
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "]";
InspectJosn += "}";
}
#endregion
#endregion
#region 机加工成品入库单
if (Type == "9")
{
InspectJosn += "{";
InspectJosn += "\"IMP_ORDINI\":[";
foreach (string DocNO in DocNoInfo.Split(','))
#region 机加工成品入库单
if (Type == "9")
{
InspectJosn += "{";
InspectJosn += "\"ORD_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"ORD_DES\":\"产成品入库-产成品入库单\",";
InspectJosn += "\"ORD_TIPOOP\":\"V\",";
InspectJosn += "\"ORD_CLIENTE\":\"" + WorkPoint + "\"";
InspectJosn += "},";
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "],";
InspectJosn += "\"IMP_ORDINI_RIGHE\":[";
InspectJosn += "\"IMP_ORDINI\":[";
foreach (string DocNO in DocNoInfo.Split(','))
{
InspectJosn += "{";
InspectJosn += "\"ORD_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"ORD_DES\":\"产成品入库-产成品入库单\",";
InspectJosn += "\"ORD_TIPOOP\":\"V\",";
InspectJosn += "\"ORD_CLIENTE\":\"" + WorkPoint + "\"";
InspectJosn += "},";
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "],";
InspectJosn += "\"IMP_ORDINI_RIGHE\":[";
foreach (string DocNO in DocNoInfo.Split(','))
{
string sql = @" select A.RCVCode,A.Sequence,A.InvCode,A.Quantity,B.LocationCode AS Area from ICSManufactureReceive A
foreach (string DocNO in DocNoInfo.Split(','))
{
string sql = @" select A.RCVCode,A.Sequence,A.InvCode,A.Quantity,B.LocationCode AS Area from ICSManufactureReceive A
INNER JOIN ICSInventoryDetail B ON B.WHCode=A.WHCode AND B.INVCode=A.InvCode AND B.WorkPoint=A.WorkPoint
where A.RCVCode='{0}' and A.WorkPoint='{1}'";
sql = string.Format(sql, DocNO, WorkPoint);
DataTable dt = Repository().FindTableBySql(sql.ToString());
for (int i = 0; i < dt.Rows.Count; i++)
{
//RIG_ELERUOLI_GEST-区域-出入库都要
//RIG_ELEBAIE-机器出口-出库-出库才要
InspectJosn += "{";
InspectJosn += "\"RIG_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"RIG_ARTICOLO\": \"" + dt.Rows[i]["InvCode"].ToString() + "\",";
InspectJosn += "\"RIG_SUB1\": \"\",";
InspectJosn += "\"RIG_SUB2\": \"\",";
InspectJosn += "\"RIG_ELERUOLI_GEST\": \"" + dt.Rows[i]["Area"].ToString() + "\",";
InspectJosn += "\"RIG_QTAR\": " + dt.Rows[i]["Quantity"].ToString() + ",";
InspectJosn += "\"RIG_HOSTINF\": " + dt.Rows[i]["Sequence"].ToString() + "";
InspectJosn += "},";
sql = string.Format(sql, DocNO, WorkPoint);
DataTable dt = Repository().FindTableBySql(sql.ToString());
for (int i = 0; i < dt.Rows.Count; i++)
{
//RIG_ELERUOLI_GEST-区域-出入库都要
//RIG_ELEBAIE-机器出口-出库-出库才要
InspectJosn += "{";
InspectJosn += "\"RIG_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"RIG_ARTICOLO\": \"" + dt.Rows[i]["InvCode"].ToString() + "\",";
InspectJosn += "\"RIG_SUB1\": \"\",";
InspectJosn += "\"RIG_SUB2\": \"\",";
InspectJosn += "\"RIG_ELERUOLI_GEST\": \"" + dt.Rows[i]["Area"].ToString() + "\",";
InspectJosn += "\"RIG_QTAR\": " + dt.Rows[i]["Quantity"].ToString() + ",";
InspectJosn += "\"RIG_HOSTINF\": " + dt.Rows[i]["Sequence"].ToString() + "";
InspectJosn += "},";
}
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "]";
InspectJosn += "}";
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "]";
InspectJosn += "}";
}
#endregion
#endregion
#region 生产退料单
if (Type == "12")
{
InspectJosn += "{";
InspectJosn += "\"IMP_ORDINI\":[";
foreach (string DocNO in DocNoInfo.Split(','))
#region 生产退料单
if (Type == "12")
{
InspectJosn += "{";
InspectJosn += "\"ORD_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"ORD_DES\":\"生产退料-生产退料单-领料申请单\",";
InspectJosn += "\"ORD_TIPOOP\":\"V\",";
InspectJosn += "\"ORD_CLIENTE\":\"" + WorkPoint + "\"";
InspectJosn += "},";
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "],";
InspectJosn += "\"IMP_ORDINI_RIGHE\":[";
InspectJosn += "\"IMP_ORDINI\":[";
foreach (string DocNO in DocNoInfo.Split(','))
{
InspectJosn += "{";
InspectJosn += "\"ORD_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"ORD_DES\":\"生产退料-生产退料单-领料申请单\",";
InspectJosn += "\"ORD_TIPOOP\":\"V\",";
InspectJosn += "\"ORD_CLIENTE\":\"" + WorkPoint + "\"";
InspectJosn += "},";
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "],";
InspectJosn += "\"IMP_ORDINI_RIGHE\":[";
foreach (string DocNO in DocNoInfo.Split(','))
{
string sql = @" select A.ApplyNegCode,B.Sequence,B.InvCode,B.Quantity,C.LocationCode AS Area from ICSMOApplyNeg A
foreach (string DocNO in DocNoInfo.Split(','))
{
string sql = @" select A.ApplyNegCode,B.Sequence,B.InvCode,B.Quantity,C.LocationCode AS Area from ICSMOApplyNeg A
INNER JOIN ICSMOApplyNegDetail B ON B.ApplyNegCode=A.ApplyNegCode AND B.WorkPoint=A.WorkPoint
INNER JOIN ICSInventoryDetail C ON C.WHCode=B.WHCode AND C.INVCode=B.InvCode AND C.WorkPoint=B.WorkPoint
where A.ApplyNegCode='{0}' and A.WorkPoint='{1}'";
sql = string.Format(sql, DocNO, WorkPoint);
DataTable dt = Repository().FindTableBySql(sql.ToString());
for (int i = 0; i < dt.Rows.Count; i++)
{
//RIG_ELERUOLI_GEST-区域-出入库都要
//RIG_ELEBAIE-机器出口-出库-出库才要
InspectJosn += "{";
InspectJosn += "\"RIG_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"RIG_ARTICOLO\": \"" + dt.Rows[i]["InvCode"].ToString() + "\",";
InspectJosn += "\"RIG_SUB1\": \"\",";
InspectJosn += "\"RIG_SUB2\": \"\",";
InspectJosn += "\"RIG_ELERUOLI_GEST\": \"" + dt.Rows[i]["Area"].ToString() + "\",";
InspectJosn += "\"RIG_QTAR\": " + dt.Rows[i]["Quantity"].ToString() + ",";
InspectJosn += "\"RIG_HOSTINF\": " + dt.Rows[i]["Sequence"].ToString() + "";
InspectJosn += "},";
sql = string.Format(sql, DocNO, WorkPoint);
DataTable dt = Repository().FindTableBySql(sql.ToString());
for (int i = 0; i < dt.Rows.Count; i++)
{
//RIG_ELERUOLI_GEST-区域-出入库都要
//RIG_ELEBAIE-机器出口-出库-出库才要
InspectJosn += "{";
InspectJosn += "\"RIG_ORDINE\":\"" + DocNO + "\",";
InspectJosn += "\"RIG_ARTICOLO\": \"" + dt.Rows[i]["InvCode"].ToString() + "\",";
InspectJosn += "\"RIG_SUB1\": \"\",";
InspectJosn += "\"RIG_SUB2\": \"\",";
InspectJosn += "\"RIG_ELERUOLI_GEST\": \"" + dt.Rows[i]["Area"].ToString() + "\",";
InspectJosn += "\"RIG_QTAR\": " + dt.Rows[i]["Quantity"].ToString() + ",";
InspectJosn += "\"RIG_HOSTINF\": " + dt.Rows[i]["Sequence"].ToString() + "";
InspectJosn += "},";
}
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "]";
InspectJosn += "}";
}
InspectJosn = InspectJosn.TrimEnd(',');
InspectJosn += "]";
InspectJosn += "}";
}
#endregion
string result = "";
if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"]))
{
#region 货柜接口调用前日志
object logID = Guid.NewGuid();
string logsql = @"insert into ICSWMS_HGLog
#endregion
string result = "";
if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"]))
{
#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
result = HTTPHelper.RestFulGet(InspectJosn, postUrlStr);
#region 货柜接口调用后日志
logsql = @"update ICSWMS_HGLog set ReturnResult='{0}'
logsql = string.Format(logsql, logID, InspectJosn, "", WorkPoint, MUSER, MUSERNAME);
SqlHelper.CmdExecuteNonQueryLi(logsql);
#endregion
result = HTTPHelper.RestFulGet(InspectJosn, postUrlStr);
#region 货柜接口调用后日志
logsql = @"update ICSWMS_HGLog set ReturnResult='{0}'
where ID='{1}'";
logsql = string.Format(logsql, result, logID);
SqlHelper.CmdExecuteNonQueryLi(logsql);
#endregion
if (!result.Contains("successo"))
{
ICSHGResult hgresult = JsonConvert.DeserializeObject<ICSHGResult>(result.TrimStart('[').TrimEnd(']'));
throw new Exception("货柜单据传输接口调用报错,主要报错信息:" + hgresult.PrimaryError + ",次要报错信息:" + hgresult.SecondaryError + "");
logsql = string.Format(logsql, result, logID);
SqlHelper.CmdExecuteNonQueryLi(logsql);
#endregion
if (!result.Contains("successo"))
{
ICSHGResult hgresult = JsonConvert.DeserializeObject<ICSHGResult>(result.TrimStart('[').TrimEnd(']'));
throw new Exception("货柜单据传输接口调用报错,主要报错信息:" + hgresult.PrimaryError + ",次要报错信息:" + hgresult.SecondaryError + "");
}
}
return "";
}
catch (Exception ex)
{
return ex.Message;
}
return "";
}
public object GetDecimalDigits()

7
WMS-BS/NFine.Data/Extensions/HTTPHelper.cs

@ -44,8 +44,11 @@ namespace NFine.Data.Extensions
{
try
{
var userName = "ADVANCED";
var password = "SYSTEM08";
var userName = "TEST";
var password = "12345678";
//正式地址
//var userName = "ADVANCED";
//var password = "SYSTEM08";
var client = new RestClient(url);
client.Authenticator = new HttpBasicAuthenticator(userName, password);
var request = new RestRequest(Method.POST);

10
WMS-BS/NFine.Web/Areas/WMS/Controllers/WMSCreateItemLotController.cs

@ -1103,12 +1103,12 @@ where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoin
}
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult DocUpLoadToHG(string DocNoList,string Type, string WorkPoint)
//[HttpPost]
//[HandlerAjaxOnly]
//[ValidateAntiForgeryToken]
public ActionResult DocUpLoadToHG(string DocNoList,string Type)
{
string msg = App.DocUpLoadToHG(DocNoList, Type, WorkPoint);
string msg = App.DocUpLoadToHG(DocNoList, Type);
if (msg == "")
{
return Success("上传成功!");

14
WMS-BS/NFine.Web/Areas/WMS/Views/WMSCreateItemLot/CreateItemLot.cshtml

@ -3123,6 +3123,11 @@
}
function btnCallHG() {
var DocNOList = "";
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
if (ids.length == 0) {
$.modalAlertNew("WMS00110");
return;
}
if (Type == '7') {
for (var i in ids) {
DocNOList += $("#gridList").jqGrid('getRowData', ids[i]).DNCode + ',';
@ -3153,16 +3158,11 @@
}
}
}
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
if (ids.length == 0) {
$.modalAlertNew("WMS00110");
return;
}
if (DisPatchCodeList != "") {
if (DocNOList != "") {
$.modalConfirm("确定上传货柜吗?", function (r) {
if (r) {
$.submitForm({
url: "/WMS/WMSCreateItemLot/DocUpLoadToHG?DocNoList=" + DocNOList + "&Type=" + Type + "&WorkPoint=" + WorkPoints + "&" + Math.random(),
url: "/WMS/WMSCreateItemLot/DocUpLoadToHG?DocNoList=" + DocNOList + "&Type=" + Type,
async: false,
success: function () {
$.currentWindow().$("#gridList").trigger("reloadGrid");

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

@ -2,12 +2,12 @@
<connectionStrings>
<!--218-->
<!--<add name="connstr" connectionString="QY3xOGKaqLDAWHboKsGgYkeMX7+IwpdqnP0JCXzIDJKlO3CmS40Eu1hSp7qSHtWUOvWQfS7mO1eq67j/rrKE9zqbXvLhsjwllmCT5VESOfU=" providerName="System.Data.SqlClient" />-->
<!--纽威-->
<!--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="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" />

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