diff --git a/SlnMesnac.RfidUpload.Business/CsbHandleBusiness.cs b/SlnMesnac.RfidUpload.Business/CsbHandleBusiness.cs
index a11cc8d..cd43a9e 100644
--- a/SlnMesnac.RfidUpload.Business/CsbHandleBusiness.cs
+++ b/SlnMesnac.RfidUpload.Business/CsbHandleBusiness.cs
@@ -53,7 +53,7 @@ namespace SlnMesnac.RfidUpload.Business
private WebApiClientApp webApiClientApp = WebApiClientApp.Instance;
private LogHelper logHelper = LogHelper.Instance;
private JsonChange jsonChange = JsonChange.Instance;
- private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI");
+ public static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI");
///
/// 容器指定封发扫描接口
@@ -70,6 +70,8 @@ namespace SlnMesnac.RfidUpload.Business
["password"] = appConfig.password,
["ak"] = appConfig.ak,
["sk"] = appConfig.sk,
+ ["apiName"] = "getScanInfoAppointRfidByCSB",
+ ["paramName"] = "containerRegisterQuery",
["containerRegisterQuery"] = new JObject
{
["opOrgCode"] = iNIFile.IniReadValue("ContainerRegisterQuery", "opOrgCode"),
@@ -106,28 +108,18 @@ namespace SlnMesnac.RfidUpload.Business
CsbResult res = new CsbResult();
try
{
-
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 102,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["batchOpenQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("batchOpenQuery", "opOrgCode"),
- ["userCode"] = iNIFile.IniReadValue("batchOpenQuery", "userCode"),
- ["userName"] = iNIFile.IniReadValue("batchOpenQuery", "userName"),
- ["provice"] = iNIFile.IniReadValue("batchOpenQuery", "provice"),
- ["rqtm"] = rqtm,
- ["devicedId"] = iNIFile.IniReadValue("batchOpenQuery", "zbid"),
-
- }
+ ["opOrgCode"] = iNIFile.IniReadValue("batchOpenQuery", "opOrgCode"),
+ ["userCode"] = iNIFile.IniReadValue("batchOpenQuery", "userCode"),
+ ["userName"] = iNIFile.IniReadValue("batchOpenQuery", "userName"),
+ ["provice"] = iNIFile.IniReadValue("batchOpenQuery", "provice"),
+ ["rqtm"] = rqtm,
+ ["devicedId"] = iNIFile.IniReadValue("batchOpenQuery", "devicedId"),
+
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
+ var str = webApiClientApp.UploadAsync("scanAnyContainerCodeByCsb", "batchOpenQuery", jsonString);
res = JsonConvert.DeserializeObject(str);
logHelper.Info($"容器入库接口返回信息:{jsonChange.ModeToJson(res)}");
return res;
@@ -136,7 +128,7 @@ namespace SlnMesnac.RfidUpload.Business
{
logHelper.Error($"容器入库接口处理异常:{ex.Message}", ex);
res.status = "500";
- res.msg = $"新容器入库接口处理异常:{ex.Message}";
+ res.message= $"新容器入库接口处理异常:{ex.Message}";
return res;
}
}
@@ -144,34 +136,25 @@ namespace SlnMesnac.RfidUpload.Business
///
/// 新容器入库-调拨单号验证接口
///
- public CsbResult containerStorageQueryByCsb(string dbbh,string rqtmStart,string rqtmEnd)
+ public CsbResult containerStorageQueryByCsb(string dbbh, string rqtmStart, string rqtmEnd)
{
CsbResult res = new CsbResult();
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["newContainerStorageQuery"] = new JObject
+ ["opOrgCode"] = iNIFile.IniReadValue("newContainerStorageQuery", "opOrgCode"),
+ ["dbbh"] = dbbh,
+ ["devicedId"] = iNIFile.IniReadValue("newContainerStorageQuery", "userName"),
+ ["rqtmSerialList"] = new JObject
{
- ["opOrgCode"] = iNIFile.IniReadValue("newContainerStorageQuery", "opOrgCode"),
- ["dbbh"] = dbbh,
- ["devicedId"] = iNIFile.IniReadValue("newContainerStorageQuery", "userName"),
- ["rqtmSerialList"] = new JObject
- {
- ["rqtmStart"] = rqtmStart,
- ["rqtmEnd"] = rqtmEnd,
- },
+ ["rqtmStart"] = rqtmStart,
+ ["rqtmEnd"] = rqtmEnd,
+ },
- }
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
+ var str = webApiClientApp.UploadAsync("containerStorageQueryByCsb", "newContainerStorageQuery", jsonString);
res = JsonConvert.DeserializeObject(str);
logHelper.Info($"新容器入库-调拨单号验证接口返回信息:{jsonChange.ModeToJson(res)}");
}
@@ -179,7 +162,7 @@ namespace SlnMesnac.RfidUpload.Business
{
logHelper.Error($"新容器入库-调拨单号验证接口处理异常:{ex.Message}", ex);
res.status = "500";
- res.msg = $"新容器入库-调拨单号验证接口处理异常:{ex.Message}";
+ res.message= $"新容器入库-调拨单号验证接口处理异常:{ex.Message}";
}
return res;
@@ -188,30 +171,21 @@ namespace SlnMesnac.RfidUpload.Business
///
/// 新容器入库-按送货单接收容器接口
///
- public void containerStorageBatchQueryByCsb(string trackNo,string batchNo,string rqtmList,string rqtmEnd)
+ public void containerStorageBatchQueryByCsb(string trackNo, string batchNo, string rqtmList, string rqtmEnd)
{
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["newContainerStorageBatchQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("newContainerStorageBatchQuery", "opOrgCode"),
- ["trackNo"] = trackNo,
- ["devicedId"] = iNIFile.IniReadValue("newContainerStorageBatchQuery", "userName"),
- ["batchNo"] = batchNo,
- ["rqtmList"] = rqtmList,
- ["rqtmEnd"] = rqtmEnd,
- }
+ ["opOrgCode"] = iNIFile.IniReadValue("newContainerStorageBatchQuery", "opOrgCode"),
+ ["trackNo"] = trackNo,
+ ["devicedId"] = iNIFile.IniReadValue("newContainerStorageBatchQuery", "devicedId"),
+ ["batchNo"] = batchNo,
+ ["rqtmList"] = rqtmList,
+ ["rqtmEnd"] = rqtmEnd,
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
+ var str = webApiClientApp.UploadAsync("containerStorageBatchQueryByCsb", "newContainerStorageBatchQuery", jsonString);
CsbResult res = JsonConvert.DeserializeObject(str);
logHelper.Info($"新容器入库-按送货单接收容器接口返回信息:{jsonChange.ModeToJson(res)}");
}
@@ -224,27 +198,18 @@ namespace SlnMesnac.RfidUpload.Business
///
/// 6.6.新容器入库-按送货单反馈接收结果接口
///
- public void receContainerStorageByCsb(string trackNo,string msgType)
+ public void receContainerStorageByCsb(string trackNo, string msgType)
{
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["newContainerStorageQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("newContainerStorageQuery", "opOrgCode"),
- ["trackNo"] = trackNo,
- ["msgType"] = msgType,
- }
+ ["opOrgCode"] = iNIFile.IniReadValue("newContainerStorageQuery", "opOrgCode"),
+ ["trackNo"] = trackNo,
+ ["msgType"] = msgType,
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
+ var str = webApiClientApp.UploadAsync("receContainerStorageByCsb", "newContainerStorageQuery", jsonString);
CsbResult res = JsonConvert.DeserializeObject(str);
logHelper.Info($"新容器入库-按送货单反馈接收结果接口返回信息:{jsonChange.ModeToJson(res)}");
}
@@ -256,31 +221,22 @@ namespace SlnMesnac.RfidUpload.Business
///
/// 容器封发-获取调拨单和封发计划
///
- public CsbResult transferOrderFfjhByCsb(string jsdw,string beginDate,string endDate)
+ public CsbResult transferOrderFfjhByCsb(string jsdw, string beginDate, string endDate)
{
CsbResult res = new CsbResult();
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["TdjStockTransferOrderQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("TdjStockTransferOrderQuery", "opOrgCode"),
- ["devicedId"] = iNIFile.IniReadValue("TdjStockTransferOrderQuery", "devicedId"),
- ["jsdw"] = jsdw,
- ["beginDate"] = beginDate,
- ["endDate"] = endDate,
+ ["opOrgCode"] = iNIFile.IniReadValue("TdjStockTransferOrderQuery", "opOrgCode"),
+ ["devicedId"] = iNIFile.IniReadValue("TdjStockTransferOrderQuery", "devicedId"),
+ ["jsdw"] = jsdw,
+ ["beginDate"] = beginDate,
+ ["endDate"] = endDate,
- }
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
+ var str = webApiClientApp.UploadAsync("transferOrderFfjhByCsb", "TdjStockTransferOrderQuery", jsonString);
res = JsonConvert.DeserializeObject(str);
logHelper.Info($"容器封发-获取调拨单和封发计划接口返回信息:{jsonChange.ModeToJson(res)}");
return res;
@@ -289,7 +245,7 @@ namespace SlnMesnac.RfidUpload.Business
{
logHelper.Error($"容器封发-获取调拨单和封发计划接口处理异常:{ex.Message}", ex);
res.status = "500";
- res.msg = $"容器封发-获取调拨单和封发计划接口处理异常:{ex.Message}";
+ res.message= $"容器封发-获取调拨单和封发计划接口处理异常:{ex.Message}";
return res;
}
}
@@ -297,39 +253,30 @@ namespace SlnMesnac.RfidUpload.Business
///
/// 容器封发-验证封发计划
///
- public CsbResult transferOrderFfjhCheckByCsb(string ffjhNo,string ffjhscrq)
+ public CsbResult transferOrderFfjhCheckByCsb(string ffjhNo, string ffjhscrq)
{
CsbResult res = new CsbResult();
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["TdjStockTransferOrderffjhCheckQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("TdjStockTransferOrderffjhCheckQuery", "opOrgCode"),
- ["devicedId"] = iNIFile.IniReadValue("TdjStockTransferOrderffjhCheckQuery", "devicedId"),
- ["ffjhNo"] = ffjhNo,
- ["ffjhscrq"] = ffjhscrq,
+ ["opOrgCode"] = iNIFile.IniReadValue("TdjStockTransferOrderffjhCheckQuery", "opOrgCode"),
+ ["devicedId"] = iNIFile.IniReadValue("TdjStockTransferOrderffjhCheckQuery", "devicedId"),
+ ["ffjhNo"] = ffjhNo,
+ ["ffjhscrq"] = ffjhscrq,
- }
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
- res = JsonConvert.DeserializeObject(str);
+ var str = webApiClientApp.UploadAsync("transferOrderFfjhCheckByCsb", "TdjStockTransferOrderffjhCheckQuery", jsonString);
+ res = JsonConvert.DeserializeObject(str);
logHelper.Info($"容器封发-验证封发计划接口返回信息:{jsonChange.ModeToJson(res)}");
return res;
}
catch (Exception ex)
{
logHelper.Error($"容器封发-验证封发计划接口处理异常:{ex.Message}", ex);
- res.msg = "500";
- res.msg = $"容器封发-验证封发计划接口处理异常:{ex.Message}";
+ res.code = "500";
+ res.message= $"容器封发-验证封发计划接口处理异常:{ex.Message}";
return res;
}
}
@@ -337,35 +284,26 @@ namespace SlnMesnac.RfidUpload.Business
///
/// 容器封发-接收容器条码
///
- public CsbResult containerScanSealByCsb(string ffjhNo,string opBatch,string ffjhscrq,string batchNo,string rqtmList)
+ public CsbResult containerScanSealByCsb(string ffjhNo, string opBatch, string ffjhscrq, string batchNo, string rqtmList)
{
CsbResult res = new CsbResult();
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["TdjContainerScanSealQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerScanSealQuery", "opOrgCode"),
- ["devicedId"] = iNIFile.IniReadValue("TdjContainerScanSealQuery", "devicedId"),
- ["shopCode"] = iNIFile.IniReadValue("TdjContainerScanSealQuery", "shopCode"),
- ["ffjhNo"] = ffjhNo,
- ["turnFlag"] = 1,
- ["opBatch"] = opBatch,
- ["ffjhscrq"] = ffjhscrq,
- ["batchNo"] = batchNo,
- ["rqtmList"] = rqtmList,
+ ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerScanSealQuery", "opOrgCode"),
+ ["devicedId"] = iNIFile.IniReadValue("TdjContainerScanSealQuery", "devicedId"),
+ ["shopCode"] = iNIFile.IniReadValue("TdjContainerScanSealQuery", "shopCode"),
+ ["ffjhNo"] = ffjhNo,
+ ["turnFlag"] = 1,
+ ["opBatch"] = opBatch,
+ ["ffjhscrq"] = ffjhscrq,
+ ["batchNo"] = batchNo,
+ ["rqtmList"] = rqtmList,
- }
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
+ var str = webApiClientApp.UploadAsync("containerScanSealByCsb", "TdjContainerScanSealQuery", jsonString);
res = JsonConvert.DeserializeObject(str);
logHelper.Info($"容器封发-接收容器条码接口返回信息:{jsonChange.ModeToJson(res)}");
return res;
@@ -374,7 +312,7 @@ namespace SlnMesnac.RfidUpload.Business
{
logHelper.Error($"容器封发-接收容器条码接口处理异常:{ex.Message}", ex);
res.status = "500";
- res.msg = $"容器封发-接收容器条码接口处理异常:{ex.Message}";
+ res.message= $"容器封发-接收容器条码接口处理异常:{ex.Message}";
return res;
}
}
@@ -382,29 +320,20 @@ namespace SlnMesnac.RfidUpload.Business
///
/// 容器封发-反馈接收结果
///
- public CsbResult containerScanSealResultByCsb(string ffjhNo,string opBatch)
+ public CsbResult containerScanSealResultByCsb(string ffjhNo, string opBatch)
{
CsbResult res = new CsbResult();
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["TdjContainerScanSealQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerScanSealQuery", "opOrgCode"),
- ["ffjhNo"] = ffjhNo,
- ["opBatch"] = opBatch,
+ ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerScanSealQuery", "opOrgCode"),
+ ["ffjhNo"] = ffjhNo,
+ ["opBatch"] = opBatch,
- }
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
+ var str = webApiClientApp.UploadAsync("containerScanSealResultByCsb", "TdjContainerScanSealQuery", jsonString);
res = JsonConvert.DeserializeObject(str);
logHelper.Info($"容器封发-反馈接收结果接口返回信息:{jsonChange.ModeToJson(res)}");
return res;
@@ -412,7 +341,7 @@ namespace SlnMesnac.RfidUpload.Business
catch (Exception ex)
{
logHelper.Error($"容器封发-反馈接收结果接口处理异常:{ex.Message}", ex);
- res.msg = $"容器封发-反馈接收结果接口处理异常:{ex.Message}";
+ res.message= $"容器封发-反馈接收结果接口处理异常:{ex.Message}";
res.status = "500";
return res;
}
@@ -421,151 +350,136 @@ namespace SlnMesnac.RfidUpload.Business
///
/// 容器直连配发-获取邮路卸交站
///
- public void findStationSequenceByCsb(string ffjhNo,string opBatch)
+ public CsbResult findStationSequenceByCsb(string ffjhNo, string opBatch)
{
+ CsbResult res = new CsbResult();
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["TdjContainerAllotQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "opOrgCode"),
- ["devicedId"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "devicedId"),
- ["shopCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "shopCode"),
- ["routeCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "routeCode"),
- ["ffjhNo"] = ffjhNo,
- ["opBatch"] = opBatch,
- }
+ ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "opOrgCode"),
+ ["devicedId"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "devicedId"),
+ ["shopCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "shopCode"),
+ ["routeCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "routeCode"),
+ ["ffjhNo"] = ffjhNo,
+ ["opBatch"] = opBatch,
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
- CsbResult res = JsonConvert.DeserializeObject(str);
+ var str = webApiClientApp.UploadAsync("findStationSequenceByCsb", "TdjContainerAllotQuery", jsonString);
+ res = JsonConvert.DeserializeObject(str);
logHelper.Info($"容器直连配发-获取邮路卸交站接口返回信息:{jsonChange.ModeToJson(res)}");
+ return res;
}
catch (Exception ex)
{
logHelper.Error($"容器直连配发-获取邮路卸交站接口处理异常:{ex.Message}", ex);
+ res.message = $"容器直连配发-获取邮路卸交站接口处理异常:{ex.Message}";
+ res.code = "500";
+ return res;
}
}
///
/// 容器直连配发-校验发运计划
///
- public void tranPlanCheckByCsb(string ffjhNo,string opBatch,string stationOrgCode,string stationOrgName)
+ public CsbResult tranPlanCheckByCsb(string ffjhNo, string opBatch, string stationOrgCode, string stationOrgName)
{
+ CsbResult res = new CsbResult();
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["TdjContainerAllotQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "opOrgCode"),
- ["devicedId"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "devicedId"),
- ["shopCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "shopCode"),
- ["routeCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "routeCode"),
- ["ffjhNo"] = ffjhNo,
- ["opBatch"] = opBatch,
- ["areaCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "shopName"),
- ["shopName"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "shopName"),
- ["stationOrgCode"] = stationOrgCode,
- ["stationOrgName"] = stationOrgName,
+ ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "opOrgCode"),
+ ["devicedId"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "devicedId"),
+ ["shopCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "shopCode"),
+ ["routeCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "routeCode"),
+ ["ffjhNo"] = ffjhNo,
+ ["opBatch"] = opBatch,
+ ["areaCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "areaCode"),
+ ["shopName"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "shopName"),
+ ["stationOrgCode"] = stationOrgCode,
+ ["stationOrgName"] = stationOrgName,
- }
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
- CsbResult res = JsonConvert.DeserializeObject(str);
+ var str = webApiClientApp.UploadAsync("tranPlanCheckByCsb", "TdjContainerAllotQuery", jsonString);
+ res = JsonConvert.DeserializeObject(str);
logHelper.Info($"容器直连配发-校验发运计划接口返回信息:{jsonChange.ModeToJson(res)}");
+ return res;
}
catch (Exception ex)
{
logHelper.Error($"容器直连配发-校验发运计划接口处理异常:{ex.Message}", ex);
+ res.message = $"容器直连配发-校验发运计划接口处理异常:{ex.Message}";
+ res.code = "500";
+ return res;
}
}
///
/// 容器直连配发-开始配发
///
- public void containerAllotByCsb(string ffjhNo,string opBatch)
+ public CsbResult containerAllotByCsb(string ffjhNo, string opBatch)
{
+ CsbResult res = new CsbResult();
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["TdjContainerAllotQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "opOrgCode"),
- ["devicedId"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "devicedId"),
- ["shopCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "shopCode"),
- ["ffjhNo"] = ffjhNo,
- ["opBatch"] = opBatch,
- ["userCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "userCode"),
- ["userName"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "userName"),
- ["groupCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "groupCode"),
- ["groupName"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "groupName"),
+ ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "opOrgCode"),
+ ["devicedId"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "devicedId"),
+ ["shopCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "shopCode"),
+ ["ffjhNo"] = ffjhNo,
+ ["opBatch"] = opBatch,
+ ["userCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "userCode"),
+ ["userName"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "userName"),
+ ["groupCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "groupCode"),
+ ["groupName"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "groupName"),
- }
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
- CsbResult res = JsonConvert.DeserializeObject(str);
+ var str = webApiClientApp.UploadAsync("containerAllotByCsb", "containerAllotByCsb", jsonString);
+ res = JsonConvert.DeserializeObject(str);
logHelper.Info($"容器直连配发-开始配发接口返回信息:{jsonChange.ModeToJson(res)}");
+ return res;
}
catch (Exception ex)
{
logHelper.Error($"容器直连配发-开始配发接口处理异常:{ex.Message}", ex);
+ res.message = $"容器直连配发-开始配发接口处理异常:{ex.Message}";
+ res.code = "500";
+ return res;
}
}
///
/// 容器直连配发-反馈接收结果
///
- public void containerAllotResultByCsb(string ffjhNo,string opBatch)
+ public CsbResult containerAllotResultByCsb(string ffjhNo, string opBatch)
{
+
+ CsbResult res = new CsbResult();
try
{
- JObject jsonObject = new JObject
+ var jsonObject = new JObject
{
- ["code"] = 103,
- ["requestURL"] = appConfig.requestURL,
- ["sysCode"] = appConfig.sysCode,
- ["password"] = appConfig.password,
- ["ak"] = appConfig.ak,
- ["sk"] = appConfig.sk,
- ["TdjContainerAllotQuery"] = new JObject
- {
- ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "opOrgCode"),
- ["ffjhNo"] = ffjhNo,
- ["opBatch"] = opBatch,
-
- }
+ ["opOrgCode"] = iNIFile.IniReadValue("TdjContainerAllotQuery", "opOrgCode"),
+ ["ffjhNo"] = ffjhNo,
+ ["opBatch"] = opBatch,
+
};
string jsonString = jsonObject.ToString();
- var str = webApiClientApp.UploadAsync(jsonString);
- CsbResult res = JsonConvert.DeserializeObject(str);
+ var str = webApiClientApp.UploadAsync("containerAllotResultByCsb", "TdjContainerAllotQuery", jsonString);
+ res = JsonConvert.DeserializeObject(str);
logHelper.Info($"容器直连配发-反馈接收结果接口返回信息:{jsonChange.ModeToJson(res)}");
+ return res;
}
catch (Exception ex)
{
logHelper.Error($"容器直连配发-反馈接收结果接口处理异常:{ex.Message}", ex);
+ res.message = $"容器直连配发-反馈接收结果接口处理异常:{ex.Message}";
+ res.code = "500";
+ return res;
}
}
}
diff --git a/SlnMesnac.RfidUpload.Model/ContainerInbound.cs b/SlnMesnac.RfidUpload.Model/ContainerInbound.cs
index a85b18f..e69bb31 100644
--- a/SlnMesnac.RfidUpload.Model/ContainerInbound.cs
+++ b/SlnMesnac.RfidUpload.Model/ContainerInbound.cs
@@ -18,5 +18,9 @@ namespace SlnMesnac.RfidUpload.Model
public string ak { get; set; }
public string sk { get; set; }
+
+ public string apiName { get; set; }
+
+ public string paramName { get; set; }
}
}
\ No newline at end of file
diff --git a/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs b/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs
index af0c05f..7a3a964 100644
--- a/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs
+++ b/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs
@@ -33,5 +33,9 @@ namespace SlnMesnac.RfidUpload.Model.apiParam
public string msg { get; set; }
public List
///
///
- public delegate void RefreshSubmitVerifyDelegate(int model, string msg, string dbdh);
+ public delegate void RefreshSubmitVerifyDelegate(int model, string msg, TransferOrderInfo transferOrderInfo = null);
public static event RefreshSubmitVerifyDelegate RefreshSubmitVerifyEvent;
#endregion
@@ -63,9 +64,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
public delegate void Success();
public event Success SuccessEvent;
- public delegate void RefreshTransferOrderInfo(TransferOrderInfo info);
-
- public event RefreshTransferOrderInfo RefreshTransferOrderInfoEvent;
+
private CsbHandleBusiness csbHandleBusiness = CsbHandleBusiness.Instance;
public string _FFPlan = string.Empty;
@@ -138,33 +137,18 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
}
#region 正式启用
//CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb(_drj, _startDate.Value.ToString(), _endDate.Value.ToString());
- //MessageBox.Show(res.msg);
- #endregion
-
- //JObject jsonObject = new JObject
+ //MessageBox.Show(res.message);
+ //if (res.code == "200")
//{
- // ["code"] = 102,
- // ["requestURL"] = appConfig.requestURL,
- // ["sysCode"] = appConfig.sysCode,
- // ["password"] = appConfig.password,
- // ["ak"] = appConfig.ak,
- // ["sk"] = appConfig.sk,
- // ["TdjStockTransferOrderQuery"] = new JObject
+ // if (res.@object != null && res.@object.Count > 0)
// {
- // ["opOrgCode"] = iNIFile.IniReadValue("BatchOpenQuery", "opOrgCode"),
- // ["devicedId"] = iNIFile.IniReadValue("BatchOpenQuery", "devicedId"),
- // ["jsdw"] = _drj,
- // ["beginDate"] = _startDate.ToString(),
- // ["endDate"] = _startDate.ToString(),
+ // List institutionList = res.@object.ConvertAll(item => JsonConvert.DeserializeObject(item.ToString()));
+ // TransferOrderInfoItems = new ObservableCollection(institutionList);
// }
- //};
-
- //string jsonString = jsonObject.ToString();
- //var info = webApiClientApp.UploadAsync(jsonString);
+ //}
+ #endregion
- //result res = JsonConvert.DeserializeObject(info);
- //MessageBox.Show($"获取调拨单结果,status:{res.status};msg:{res.msg};返回内容:{info}");
#region 测试
result res = new result()
@@ -189,15 +173,16 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
}
}
};
- #endregion
if (res.@object != null)
{
TransferOrderInfoItems = new ObservableCollection(res.@object);
}
+ #endregion
+
}
///
- /// 执行分发
+ /// 执行分发 容器封发-验证封发计划
///
///
[RelayCommand]
@@ -206,17 +191,17 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
#region 正式启用
CsbResult res = csbHandleBusiness.transferOrderFfjhCheckByCsb(transferOrderInfo.ffjhNo, transferOrderInfo.ffjhscrq);
- if (res.status == "0" || res.status == "2")
+ if (res.code== "200")
{ //封发计划正常可封发
- MessageBox.Show($"验证调拨单结果,status:{res.status};msg:{res.msg};");
+ MessageBox.Show($"验证调拨单结果,status:{res.code};msg:{res.message};");
SuccessEvent?.Invoke();
- RefreshSubmitVerifyEvent?.Invoke(2, res.msg, transferOrderInfo.dbdh);
- RefreshTransferOrderInfoEvent?.Invoke(transferOrderInfo);
+ RefreshSubmitVerifyEvent?.Invoke(2, res.message,transferOrderInfo);
+
}
else
{
- MessageBox.Show(res.msg);
+ MessageBox.Show(res.message);
return;
}
#endregion
diff --git a/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs
index 09e29d5..0f5c9d4 100644
--- a/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs
+++ b/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs
@@ -1,6 +1,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using SlnMesnac.RfidUpload.Business;
+using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.apiParam;
using System;
using System.Collections.Generic;
@@ -47,7 +48,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
///
///
///
- public delegate void RefreshSubmitVerifyDelegate(int model,string msg, string dbdh);
+ public delegate void RefreshSubmitVerifyDelegate(int model,string msg, TransferOrderInfo transferOrderInfo = null);
public static event RefreshSubmitVerifyDelegate RefreshSubmitVerifyEvent;
#endregion
@@ -85,21 +86,27 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
}
}
+
+
[RelayCommand]
private void Submit()
{
CsbResult res = csbHandleBusiness.containerStorageQueryByCsb(_dbbh, _rqtmStart, _rqtmEnd);
- if (res.status == "0" || res.status == "2")
+ if (res.code == "200")
{
MessageBox.Show($"新容器入库-调拨单号验证通过");
- RefreshSubmitVerifyEvent?.Invoke(1, res.msg, _dbbh);
+ TransferOrderInfo transferOrderInfo = new TransferOrderInfo() {
+ dbdh = _dbbh,
+ };
+
+ RefreshSubmitVerifyEvent?.Invoke(1, res.message, transferOrderInfo);
_window.Close();
}
else
{
- MessageBox.Show($"新容器入库-调拨单号验证失败,status:{res.status};msg:{res.msg};");
+ MessageBox.Show($"新容器入库-调拨单号验证失败,status:{res.code};msg:{res.message};");
}
}