add-调所有接口初步连贯

master
liuwf 1 month ago
parent d5a9d14f69
commit 70a34a1e99

@ -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");
/// <summary>
/// 容器指定封发扫描接口
@ -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<CsbResult>(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
/// <summary>
/// 新容器入库-调拨单号验证接口
/// </summary>
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<CsbResult>(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
/// <summary>
/// 新容器入库-按送货单接收容器接口
/// </summary>
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<CsbResult>(str);
logHelper.Info($"新容器入库-按送货单接收容器接口返回信息:{jsonChange.ModeToJson(res)}");
}
@ -224,27 +198,18 @@ namespace SlnMesnac.RfidUpload.Business
/// <summary>
/// 6.6.新容器入库-按送货单反馈接收结果接口
/// </summary>
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<CsbResult>(str);
logHelper.Info($"新容器入库-按送货单反馈接收结果接口返回信息:{jsonChange.ModeToJson(res)}");
}
@ -256,31 +221,22 @@ namespace SlnMesnac.RfidUpload.Business
/// <summary>
/// 容器封发-获取调拨单和封发计划
/// </summary>
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<CsbResult>(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
/// <summary>
/// 容器封发-验证封发计划
/// </summary>
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<CsbResult>(str);
var str = webApiClientApp.UploadAsync("transferOrderFfjhCheckByCsb", "TdjStockTransferOrderffjhCheckQuery", jsonString);
res = JsonConvert.DeserializeObject<CsbResult>(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
/// <summary>
/// 容器封发-接收容器条码
/// </summary>
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<CsbResult>(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
/// <summary>
/// 容器封发-反馈接收结果
/// </summary>
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<CsbResult>(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
/// <summary>
/// 容器直连配发-获取邮路卸交站
/// </summary>
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<CsbResult>(str);
var str = webApiClientApp.UploadAsync("findStationSequenceByCsb", "TdjContainerAllotQuery", jsonString);
res = JsonConvert.DeserializeObject<CsbResult>(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;
}
}
/// <summary>
/// 容器直连配发-校验发运计划
/// </summary>
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<CsbResult>(str);
var str = webApiClientApp.UploadAsync("tranPlanCheckByCsb", "TdjContainerAllotQuery", jsonString);
res = JsonConvert.DeserializeObject<CsbResult>(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;
}
}
/// <summary>
/// 容器直连配发-开始配发
/// </summary>
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<CsbResult>(str);
var str = webApiClientApp.UploadAsync("containerAllotByCsb", "containerAllotByCsb", jsonString);
res = JsonConvert.DeserializeObject<CsbResult>(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;
}
}
/// <summary>
/// 容器直连配发-反馈接收结果
/// </summary>
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<CsbResult>(str);
var str = webApiClientApp.UploadAsync("containerAllotResultByCsb", "TdjContainerAllotQuery", jsonString);
res = JsonConvert.DeserializeObject<CsbResult>(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;
}
}
}

@ -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; }
}
}

@ -33,5 +33,9 @@ namespace SlnMesnac.RfidUpload.Model.apiParam
public string msg { get; set; }
public List<Object> @object { get; set; }
public string code { get; set; }
public string csbCode { get; set; }
public string message { get; set; }
}
}

@ -75,6 +75,41 @@ namespace SlnMesnac.RfidUpload.TouchSocket
return result;
}
public string UploadAsync(string apiName, string paramName, string paramStr)
{
string result = string.Empty;
try
{
//logger.Info($"请求CSB接口调用服务,参数:{paramStr}");
ContainerInbound container = new ContainerInbound
{
code = 103,
requestURL = appConfig.requestURL,
sysCode = appConfig.sysCode,
password = appConfig.password,
ak = appConfig.ak,
sk = appConfig.sk,
apiName = apiName,
paramName = paramName,
containerRegisterQuery = paramStr
};
var str = jsonChange.ModeToJson(container);
logger.Info($"请求CSB接口调用服务,参数:{str}");
result = Post("http://127.0.0.1:9090/api/uploadCsb", container);
logger.Info($"CSB接口返回信息:{result}");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
result = e.Message;
logger.Info($"请求CSB接口调用服务异常:{e.Message}");
}
return result;
}
public string UploadAsync(string paramStr)
{
string result = string.Empty;

@ -0,0 +1,89 @@
<Window x:Class="SlnMesnac.RfidUpload.UI.ContainerTransferOrderWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SlnMesnac.RfidUpload.UI"
mc:Ignorable="d"
Title="库存容器封发配发" Height="650" Width="1350">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="Gray" BorderThickness="0,0,0,2" CornerRadius="0" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="封发计划:" FontSize="16" FontWeight="Black" Foreground="#006699" Margin="10,0,0,0"/>
<TextBox Text="{Binding FFPlan}" FontSize="16" Grid.Row="1" Width="180" Height="30" VerticalContentAlignment="Center" HorizontalAlignment="Center" Padding="5">
<TextBox.Template>
<ControlTemplate TargetType="TextBox">
<Border Background="#EBF4FD" BorderBrush="White" BorderThickness="1" CornerRadius="5">
<ScrollViewer x:Name="PART_ContentHost" />
</Border>
</ControlTemplate>
</TextBox.Template>
</TextBox>
<!--<TextBlock Text="调入局:" FontSize="16" FontWeight="Black" Foreground="#006699" Margin="10,0,0,0"/>
<TextBox Text="{Binding DRJ}" FontSize="16" Grid.Row="1" Width="180" Height="30" VerticalContentAlignment="Center" HorizontalAlignment="Center" Padding="5">
<TextBox.Template>
<ControlTemplate TargetType="TextBox">
<Border Background="#EBF4FD" BorderBrush="White" BorderThickness="1" CornerRadius="5">
<ScrollViewer x:Name="PART_ContentHost" />
</Border>
</ControlTemplate>
</TextBox.Template>
</TextBox>-->
<TextBlock Text="生成时间:" FontSize="16" FontWeight="Black" Foreground="#006699" Margin="20,0,0,0"/>
<!-- 开始时间选择器 -->
<DatePicker x:Name="StartDatePicker" Width="150" Margin="10,0,0,0" VerticalAlignment="Center" SelectedDate="{Binding StartDate, Mode=TwoWay}" />
<TextBlock Text="至" FontSize="16" FontWeight="Black" Foreground="#006699" Margin="10,0,0,0"/>
<!-- 结束时间选择器 -->
<DatePicker x:Name="EndDatePicker" Width="150" Margin="10,0,0,0" VerticalAlignment="Center" SelectedDate="{Binding EndDate, Mode=TwoWay}" />
<!-- 查询按钮 -->
<Button Content="查询" Command="{Binding QueryCommand}" Style="{StaticResource BUTTON_AGREE}" Width="80" Height="30" Background="#007DFA" BorderBrush="#007DFA" Margin="10,0,10,0"/>
<Button Content="拉取调拨单" Command="{Binding GetTransferOrderCommand}" Style="{StaticResource BUTTON_AGREE}" Width="80" Height="30" Background="#007DFA" BorderBrush="#007DFA" Margin="10,0,10,0"/>
</StackPanel>
</Border>
<DataGrid Grid.Row="1" Name="DG" ItemsSource="{Binding TransferOrderInfoItems}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
Foreground="#0288d1" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding no}" Header="序号" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding dbdh}" Header="调拨单号" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding jsdw}" Header="调入局" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding ffjhNo}" Header="封发计划编号" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding rqzlbm}" Header="容器种类编码" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding rqzlmc}" Header="容器种类名称" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding rqxhbm}" Header="容器型号编码" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding rqxhmc}" Header="容器型号名称" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding kdbsl}" Header="可调拨数量" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding ffjhscrq,StringFormat=\{0:MM月dd日 HH:mm.ss.ffff\}}" Header="生成日期" Width="*" IsReadOnly="True"/>
<DataGridTemplateColumn Header="操作" Width="1.5*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<!--<Button Content="编辑" Command="{Binding DataContext.CabinetUpdateCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" CommandParameter="{Binding}" Style="{StaticResource BUTTON_AGREE}" FontSize="14" Width="80" Height="30" Background="#009999" BorderBrush="#FF36B5C1" VerticalAlignment="Center" HorizontalAlignment="Center"/>-->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="封发配发" Command="{Binding DataContext.ExecuteCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" CommandParameter="{Binding}" Style="{StaticResource BUTTON_AGREE}" FontSize="14" Width="80" Height="30" Background="#009999" BorderBrush="#FF36B5C1" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,5,0"/>
<Button Content="更新" Visibility="Collapsed" Command="{Binding DataContext.ExecuteCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" CommandParameter="{Binding}" Style="{StaticResource BUTTON_AGREE}" FontSize="14" Width="80" Height="30" Background="#009999" BorderBrush="#FF36B5C1" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,5,0"/>
<Button Content="删除" Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" CommandParameter="{Binding}" Style="{StaticResource BUTTON_AGREE}" FontSize="14" Width="80" Height="30" Background="#009999" BorderBrush="#FF36B5C1" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,0,0,0"/>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Window>

@ -0,0 +1,35 @@
using SlnMesnac.RfidUpload.UI.viewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace SlnMesnac.RfidUpload.UI
{
/// <summary>
/// TransferOrderWindow.xaml 的交互逻辑
/// </summary>
public partial class ContainerTransferOrderWindow : Window
{
//private TransferOrderViewModel orderViewModel = new TransferOrderViewModel();
public ContainerTransferOrderWindow(ContainerTransferOrderViewModel containerOrderViewModel)
{
InitializeComponent();
this.DataContext = containerOrderViewModel;
containerOrderViewModel.SuccessEvent += () =>
{
this.Close();
};
}
}
}

@ -55,7 +55,7 @@
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal">
<Button Content="打开串口" Command="{Binding OpenSerialPortCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009900" BorderBrush="#009900" Margin="10,0,10,0"/>
<Button Content="打开串口" Command="{Binding OpenSerialPortCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009900" BorderBrush="#009900" Margin="10,0,10,0" />
<Button Content="关闭串口" Command="{Binding CloseSerialPortCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
<Button Content="导出文件" Command="{Binding ExportFilesCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#007DFA" BorderBrush="#007DFA" Margin="0,0,10,0"/>
<Button Content="清空列表" Command="{Binding EmptyFilesCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="Orange" BorderBrush="Orange" Margin="0,0,10,0"/>

@ -14,9 +14,6 @@ namespace SlnMesnac.RfidUpload.UI
this.DataContext = new MainWindowViewModel();
}
private void Button_Click()
{
}
}
}

@ -0,0 +1,64 @@
<Window x:Class="SlnMesnac.RfidUpload.UI.SelectRouterWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SlnMesnac.RfidUpload.UI"
mc:Ignorable="d"
Title="新容器入库" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="Gray" BorderThickness="0,0,0,2" CornerRadius="0" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="邮路代码:" FontSize="16" FontWeight="Black" Foreground="#006699" Margin="10,0,0,0"/>
<TextBox x:Name="RouteCode" FontSize="16" Grid.Row="1" Width="180" Height="30" VerticalContentAlignment="Center" HorizontalAlignment="Center" Padding="5">
<TextBox.Template>
<ControlTemplate TargetType="TextBox">
<Border Background="#EBF4FD" BorderBrush="White" BorderThickness="1" CornerRadius="5">
<ScrollViewer x:Name="PART_ContentHost" />
</Border>
</ControlTemplate>
</TextBox.Template>
</TextBox>
<Button Content="获取卸交站" Background="Gray" x:Name="QueryButton" Style="{StaticResource BUTTON_AGREE}" Width="80" Height="30" BorderBrush="#007DFA" Margin="10,0,10,0" Click="QueryButton_Click"/>
<Button Content="封发配发" Background="GreenYellow" x:Name="HandOutButton" Style="{StaticResource BUTTON_AGREE}" Width="80" Height="30" BorderBrush="#007DFA" Margin="10,0,10,0" Click="HandOutButton_Click"/>
</StackPanel>
</Border>
<DataGrid Grid.Row="1" Name="InstitutionList" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
Foreground="#0288d1" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding no}" Header="序号" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding stationOrgCode}" Header="机构代码" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding stationOrgName}" Header="机构名称" Width="4*" IsReadOnly="True"/>
<DataGridTemplateColumn Header="操作" Width="1.5*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<!--<Button Content="编辑" Command="{Binding DataContext.CabinetUpdateCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" CommandParameter="{Binding}" Style="{StaticResource BUTTON_AGREE}" FontSize="14" Width="80" Height="30" Background="#009999" BorderBrush="#FF36B5C1" VerticalAlignment="Center" HorizontalAlignment="Center"/>-->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="执行配发" Click="ExecuteCommand_Click" Style="{StaticResource BUTTON_AGREE}" FontSize="14" Width="80"
Height="30" Background="#009999" BorderBrush="#FF36B5C1"
VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,5,0"/>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Window>

@ -0,0 +1,172 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SlnMesnac.RfidUpload.Business;
using SlnMesnac.RfidUpload.Common;
using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.apiParam;
using SlnMesnac.RfidUpload.UI.viewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using TouchSocket.Core;
using static SlnMesnac.RfidUpload.UI.SelectRouterWindow;
namespace SlnMesnac.RfidUpload.UI
{
/// <summary>
/// containerStorageQueryByCsb.xaml 的交互逻辑
/// </summary>
public partial class SelectRouterWindow : Window
{
#region 委托事件
/// <summary>
/// model-新容器入库-调拨单号验证状态成功1失败-1
/// model-容器封发-验证封发计划接口状态成功2失败-1
/// dbdh-调拨单号
/// status- 1-正常
/// </summary>
/// <param name="status"></param>
/// <param name="dbdh"></param>
public delegate void RefreshSubmitVerifyDelegate(int model, string msg, TransferOrderInfo transferOrderInfo = null);
public static event RefreshSubmitVerifyDelegate RefreshSubmitVerifyEvent;
#endregion
private CsbHandleBusiness csbHandleBusiness = CsbHandleBusiness.Instance;
TransferOrderInfo _transferOrderInfo;
public SelectRouterWindow(TransferOrderInfo transferOrderInfo)
{
_transferOrderInfo = transferOrderInfo;
InitializeComponent();
}
/// <summary>
/// 获取卸交站
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void QueryButton_Click(object sender, RoutedEventArgs e)
{
try
{
if (string.IsNullOrEmpty(this.RouteCode.Text))
{
MessageBox.Show("请先输入邮路代码");
return;
}
CsbHandleBusiness.iNIFile.IniWriteValue("TdjContainerAllotQuery", "routeCode", this.RouteCode.Text);
#region 正式启用
// 自动生成opBatch
string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20);
CsbResult res = csbHandleBusiness.findStationSequenceByCsb(_transferOrderInfo.ffjhNo, opBatch);
if (res.code == "200")
{
if (res.@object != null && res.@object.Count > 0)
{
List<Institution> institutionList = res.@object.ConvertAll(item => JsonConvert.DeserializeObject<Institution>(item.ToString()));
int count = 1;
Console.WriteLine("机构信息:");
foreach (var institution in institutionList)
{
institution.No = count++.ToString();
}
InstitutionList.ItemsSource = institutionList;
}
}
else
{
MessageBox.Show(res.message);
}
#endregion
#region 测试数据
// 初始化数据源
var institutions = new List<Institution>
{
new Institution { No = "1", stationOrgCode = "001", stationOrgName = "机构A" },
new Institution { No = "2", stationOrgCode = "002", stationOrgName = "机构B" },
};
InstitutionList.ItemsSource = institutions;
#endregion
}
catch (Exception ex)
{
MessageBox.Show($"获取卸交站异常:{ex.Message}");
}
}
/// <summary>
/// 封发配发 6.12.容器直连配发-校验发运计划
/// 可不指定机构直接完成容器封发配发
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void HandOutButton_Click(object sender, RoutedEventArgs e)
{
string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20);
CsbResult res = csbHandleBusiness.tranPlanCheckByCsb(_transferOrderInfo.ffjhNo,opBatch,"","");
MessageBox.Show(res.message);
if (res.code == "200")
{
RefreshSubmitVerifyEvent?.Invoke(3, res.message, _transferOrderInfo);
this.Close();
}
}
// 执行配发 6.12.容器直连配发-校验发运计划
// 容器封发完毕后直接向指定机构进行容器配发
private void ExecuteCommand_Click(object sender, RoutedEventArgs e)
{
var button = sender as Button;
var institution = button.DataContext as Institution;
if (institution != null)
{
string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20);
CsbResult res = csbHandleBusiness.tranPlanCheckByCsb(_transferOrderInfo.ffjhNo, opBatch, institution.stationOrgCode,institution.stationOrgName);
if(res.code == "200")
{
RefreshSubmitVerifyEvent?.Invoke(3, res.message, _transferOrderInfo);
this.Close();
}
}
}
/// <summary>
/// 机构实体
/// </summary>
public class Institution
{
public string No { get; set; }
public string stationOrgCode { get; set; }
public string stationOrgName { get; set; }
}
}
}

@ -17,4 +17,13 @@
<ProjectReference Include="..\SlnMesnac.RfidUpload.NLog\SlnMesnac.RfidUpload.NLog.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="SelectRouterWindow.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="ContainerTransferOrderWindow.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
</Project>

@ -0,0 +1,205 @@

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Nancy.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SlnMesnac.RfidUpload.Business;
using SlnMesnac.RfidUpload.Common;
using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.apiParam;
using SlnMesnac.RfidUpload.Model.config;
using SlnMesnac.RfidUpload.TouchSocket;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.ServiceModel.Channels;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.UI.viewModel
* 81e29764-73f1-4de5-bd78-56b96ca165ba
*
* WenJY
*
* 2024-12-06 9:50:16
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.UI.viewModel
{
public partial class ContainerTransferOrderViewModel : ObservableObject
{
#region 委托事件
/// <summary>
/// model-新容器入库-调拨单号验证状态成功1失败-1
/// model-容器封发-验证封发计划接口状态成功2失败-1
/// dbdh-调拨单号
/// status- 1-正常
/// </summary>
/// <param name="status"></param>
/// <param name="dbdh"></param>
public delegate void RefreshSubmitVerifyDelegate(int model, string msg, string dbdh);
public static event RefreshSubmitVerifyDelegate RefreshSubmitVerifyEvent;
#endregion
public delegate void Success();
public event Success SuccessEvent;
private CsbHandleBusiness csbHandleBusiness = CsbHandleBusiness.Instance;
public string _FFPlan = string.Empty;
public string FFPlan
{
get => _FFPlan;
set => SetProperty(ref _FFPlan, value);
}
public string _drj = string.Empty;
public string DRJ
{
get => _drj;
set => SetProperty(ref _drj, value);
}
private DateTime? _startDate;
public DateTime? StartDate
{
get => _startDate;
set
{
_startDate = value;
OnPropertyChanged(nameof(StartDate));
}
}
private DateTime? _endDate;
public DateTime? EndDate
{
get => _endDate;
set
{
_endDate = value;
OnPropertyChanged(nameof(EndDate));
}
}
private ObservableCollection<TransferOrderInfo> _transferOrderInfoItems = new ObservableCollection<TransferOrderInfo>();
public ObservableCollection<TransferOrderInfo> TransferOrderInfoItems
{
get => _transferOrderInfoItems;
set => SetProperty(ref _transferOrderInfoItems, value);
}
[RelayCommand]
private void Query()
{
var info = _FFPlan;
var info2 = _drj;
var info3 = _startDate;
var info4 = _endDate;
}
private AppConfig appConfig = AppConfig.Instance;
private WebApiClientApp webApiClientApp = WebApiClientApp.Instance;
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI");
[RelayCommand]
private void GetTransferOrder()
{
if (_startDate == null || _endDate == null)
{
MessageBox.Show("请选择开始日期或者结束日期");
return;
}
else if (_startDate > _endDate)
{
MessageBox.Show("开始日期不能大于结束日期");
return;
}
#region 正式启用
//CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb("", _startDate.Value.ToString(), _endDate.Value.ToString());
//MessageBox.Show(res.message);
//if (res.code == "200")
//{
// if (res.@object != null && res.@object.Count > 0)
// {
// List<TransferOrderInfo> institutionList = res.@object.ConvertAll(item => JsonConvert.DeserializeObject<TransferOrderInfo>(item.ToString()));
// TransferOrderInfoItems = new ObservableCollection<TransferOrderInfo>(institutionList);
// }
//}
#endregion
#region 测试启用
result res = new result()
{
status = "1",
msg = "测试",
@object = new List<TransferOrderInfo>()
{
new TransferOrderInfo()
{
dbdh = "123",
jsdw = "123",
ffjhNo = "jh123",
ffjhscrq = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
},
new TransferOrderInfo()
{
dbdh = "324",
jsdw = "456",
ffjhNo = "jh456",
ffjhscrq = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
}
}
};
if (res.@object != null)
{
TransferOrderInfoItems = new ObservableCollection<TransferOrderInfo>(res.@object);
}
#endregion
}
/// <summary>
/// 执行分发
/// </summary>
/// <param name="transferOrderInfo"></param>
[RelayCommand]
private void Execute(TransferOrderInfo transferOrderInfo)
{
SelectRouterWindow selectRouterWindow = new SelectRouterWindow(transferOrderInfo);
selectRouterWindow.ShowDialog();
}
}
}
class result1
{
public string status { get; set; }
public string msg { get; set; }
public List<TransferOrderInfo> @object { get; set; }
}

@ -27,7 +27,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
{
TransferOrderViewModel transferOrderViewModel = new TransferOrderViewModel();
ContainerTransferOrderViewModel containerTransferOrderViewModel = new ContainerTransferOrderViewModel();
private readonly LogHelper logger = LogHelper.Instance;
private readonly HandleBusiness _business = HandleBusiness.Instance;
private readonly SerialPortBusiness _serialPortBusiness = SerialPortBusiness.Instance;
@ -226,6 +226,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
{
containerStorageQueryByCsbViewModel.RefreshSubmitVerifyEvent += RefreshSubmitVerify;
TransferOrderViewModel.RefreshSubmitVerifyEvent += RefreshSubmitVerify;
SelectRouterWindow.RefreshSubmitVerifyEvent += RefreshSubmitVerify;
logger.Info("初始化启动");
EmptyFilesCommand = new RelayCommand(EmptyFiles);
ExportFilesCommand = new RelayCommand(ExportFiles);
@ -234,10 +235,6 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
SetWorkModelCommand = new RelayCommand<object>(SetWorkModel);
FinishCommand = new RelayCommand(Finish);
transferOrderViewModel.RefreshTransferOrderInfoEvent += info =>
{
TransferOrderInfoItem = info;
};
this.Init();
}
@ -399,54 +396,41 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
else
{
CsbResult res = csbHandleBusiness.scanAnyContainerCodeByCsb(palletInfo.result);
MessageBox.Show(res.msg);
MessageBox.Show(res.message);
}
}
if (workModelParam == 2) //封发-按调拨单
else if (workModelParam == 2) //封发-按调拨单
{
var info = labelItems.ToList();
var strList = info.Select(x => x.result).ToList();
CsbResult res = csbHandleBusiness.containerScanSealByCsb(TransferOrderInfoItem.ffjhNo, System.Guid.NewGuid().ToString("N").Substring(0, 20), TransferOrderInfoItem.ffjhscrq, "1", jsonChange.ModeToJson(strList));
MessageBox.Show(res.msg);
string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20);
CsbResult res = csbHandleBusiness.containerScanSealByCsb(TransferOrderInfoItem.ffjhNo, System.Guid.NewGuid().ToString("N").Substring(0, 20), TransferOrderInfoItem.ffjhscrq, opBatch, jsonChange.ModeToJson(strList));
MessageBox.Show(res.message);
Task.Run(() =>
{ //2s以后接受反馈接口
Thread.Sleep(2000);
CsbResult res = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, "1");
{ //若干秒以后调反馈接口,确认是否和实际相符
Thread.Sleep(3000);
string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20);
CsbResult res = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
MessageBox.Show(res.message);
});
//JObject jsonObject = new JObject
//{
// ["code"] = 105,
// ["requestURL"] = appConfig.requestURL,
// ["sysCode"] = appConfig.sysCode,
// ["password"] = appConfig.password,
// ["ak"] = appConfig.ak,
// ["sk"] = appConfig.sk,
// ["TdjContainerScanSealQuery"] = new JObject
// {
// ["opOrgCode"] = iNIFile.IniReadValue("BatchOpenQuery", "opOrgCode"),
// ["shopCode"] = "WS51040001",
// ["ffjhNo"] = _transferOrderInfo.ffjhNo,
// ["turnFlag"] = 1,
// ["opBatch"] = System.Guid.NewGuid().ToString("N").Substring(0, 20),
// ["ffjhscrq"] = _transferOrderInfo.ffjhscrq,
// ["batchNo"] = 1,
// ["devicedId"] = iNIFile.IniReadValue("BatchOpenQuery", "devicedId"),
// ["rqtmList"] = jsonChange.ModeToJson(strList)
// }
//};
//string jsonString = jsonObject.ToString();
//WebApiClientApp webApiClientApp = WebApiClientApp.Instance;
//var str = webApiClientApp.UploadAsync(jsonString);
//result res = JsonConvert.DeserializeObject<result>(str);
//MessageBox.Show($"上传包裹信息结果,status:{res.status};msg:{res.msg}");
//if (res.status == "0")
//{
// EmptyFiles();
//}
}else if(workModelParam == -1)
}else if(WorkModelParam == 3) //库存容器封发配发 -- 6.13.容器直连配发-开始配发
{
string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20);
csbHandleBusiness.containerAllotByCsb(TransferOrderInfoItem.ffjhNo,opBatch);
Task.Run(() =>
{
Thread.Sleep(3000);
//若干秒以后调反馈接口,确认是否和实际相符
string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20);
CsbResult res = csbHandleBusiness.containerAllotResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
MessageBox.Show(res.message);
});
}
else if(workModelParam == -1)
{
MessageBox.Show("工作模式错误"); return;
}
@ -487,11 +471,14 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
}
else if (WorkModel == 3) //库存容器封发配发
{
ContainerTransferOrderWindow containerTransferOrderWindow = new ContainerTransferOrderWindow(containerTransferOrderViewModel);
containerTransferOrderWindow.ShowDialog();
}
else if (WorkModel == 4) //卸车容器封发配发
{
ContainerTransferOrderWindow containerTransferOrderWindow = new ContainerTransferOrderWindow(containerTransferOrderViewModel);
containerTransferOrderWindow.ShowDialog();
}
}
@ -617,33 +604,17 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
/// <param name="model"></param>
/// <param name="msg"></param>
/// <param name="dbdh"></param>
private void RefreshSubmitVerify(int model,string msg, string dbbh)
private void RefreshSubmitVerify(int model,string msg,TransferOrderInfo transferOrderInfo=null)
{
appConfig.workModel = model.ToString();
appConfig.workModel = model.ToString();
WorkModelParam = model ;
MainPageDbdh = dbbh;
//App.Current.Dispatcher.BeginInvoke((Action)(() =>
//{
// var newDataGridEnt = new DataGridEnt
// {
// no = labelItems.Count + 1,
// dbdh = dbbh,
// result = msg,
// recordtime = DateTime.Now
// };
// labelItems.Insert(0, newDataGridEnt);
// LabelInfoDataGrid = labelItems;
//}));
if (transferOrderInfo != null)
{
MainPageDbdh = transferOrderInfo.dbdh;
TransferOrderInfoItem = transferOrderInfo;
}
}
}
}

@ -18,6 +18,7 @@ using System.ServiceModel.Channels;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using static SlnMesnac.RfidUpload.UI.SelectRouterWindow;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
@ -55,7 +56,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
/// </summary>
/// <param name="status"></param>
/// <param name="dbdh"></param>
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<TransferOrderInfo> institutionList = res.@object.ConvertAll(item => JsonConvert.DeserializeObject<TransferOrderInfo>(item.ToString()));
// TransferOrderInfoItems = new ObservableCollection<TransferOrderInfo>(institutionList);
// }
//};
//string jsonString = jsonObject.ToString();
//var info = webApiClientApp.UploadAsync(jsonString);
//}
#endregion
//result res = JsonConvert.DeserializeObject<result>(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<TransferOrderInfo>(res.@object);
}
#endregion
}
/// <summary>
/// 执行分发
/// 执行分发 容器封发-验证封发计划
/// </summary>
/// <param name="transferOrderInfo"></param>
[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

@ -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
/// </summary>
/// <param name="status"></param>
/// <param name="dbdh"></param>
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};");
}
}

Loading…
Cancel
Save