You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
126 lines
4.6 KiB
126 lines
4.6 KiB
3 months ago
|
using Newtonsoft.Json;
|
||
|
using System;
|
||
|
using XS_Model;
|
||
|
using XS_DAL;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using Newtonsoft.Json.Linq;
|
||
|
|
||
|
namespace XS_BLL
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 搬运确认
|
||
|
/// </summary>
|
||
|
public class AGV_MOVECONFIRM_BLL
|
||
|
{
|
||
|
#region 全局参数
|
||
|
/// <summary>
|
||
|
/// 接口地址,请求路径
|
||
|
/// </summary>
|
||
|
public static string InterfaceAdd = Global.upper_WMSURL + "agv/moveConfirm";//请求路径
|
||
|
/// <summary>
|
||
|
/// 接口名称,接口日志文件名
|
||
|
/// </summary>
|
||
|
public static string InterfaceName = "AGV_MOVECONFIRM";
|
||
|
/// <summary>
|
||
|
/// 接口描述
|
||
|
/// </summary>
|
||
|
public static string InterfaceNote = "搬运确认";
|
||
|
/// <summary>
|
||
|
/// 接口流向
|
||
|
/// </summary>
|
||
|
public static string InterfaceFlow = "WCS==>>WMS";
|
||
|
/// <summary>
|
||
|
/// 请求JSON
|
||
|
/// </summary>
|
||
|
public static string reqJson = string.Empty;
|
||
|
/// <summary>
|
||
|
/// 反馈JSON
|
||
|
/// </summary>
|
||
|
public static string retJson = string.Empty;
|
||
|
|
||
|
#endregion
|
||
|
|
||
|
/// <summary>
|
||
|
/// 测试--搬运确认
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
public static string response_AGV_MOVECONFIRM()
|
||
|
{
|
||
|
JObject dataJson = null;
|
||
|
string json = JsonConvert.SerializeObject(new
|
||
|
{
|
||
|
code = 0, //调试时自行约定,只要类型对应接口,后面不做说明
|
||
|
success = true, // 当为false的时候,则不用进入到分拨的线体,直行到异常线体口
|
||
|
msg = "", //"XXX数据,成功接收"
|
||
|
data = dataJson
|
||
|
});
|
||
|
|
||
|
#region json
|
||
|
JObject objMis = new JObject();
|
||
|
objMis.Add(new JProperty("code", 0));
|
||
|
objMis.Add(new JProperty("success", true));
|
||
|
objMis.Add(new JProperty("msg", ""));
|
||
|
|
||
|
JObject objDate = new JObject();
|
||
|
objMis.Add(new JProperty("data", objDate));
|
||
|
json = JsonConvert.DeserializeObject(objMis.ToString()).ToString();
|
||
|
#endregion
|
||
|
return json;
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 搬运确认
|
||
|
/// </summary>
|
||
|
public static void AGV_MOVECONFIRM()
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
IO_CONTROL model = new IO_CONTROL();
|
||
|
List<IO_CONTROL> modelList = new List<IO_CONTROL>();
|
||
|
IO_CONTROL_APPLY caModle = new IO_CONTROL_APPLY();
|
||
|
List<IO_CONTROL_APPLY> acModelList = new List<IO_CONTROL_APPLY>();
|
||
|
|
||
|
modelList = model.GetModelList(" CONTROL_STATUS in(980,999)");//900 WCS 任务删除、980 取空异常完成
|
||
|
|
||
|
foreach (var item in modelList)
|
||
|
{
|
||
|
#region reqJson
|
||
|
JObject objMis = new JObject();
|
||
|
//objMis.Add(new JProperty("taskId", UtilityBLL.GetUuid()));//接口交互 任务号 谁发起,谁生成
|
||
|
objMis.Add(new JProperty("taskId", DateTime.Now.ToString("yyyyMMddHHmmss")));//接口交互 任务号
|
||
|
objMis.Add(new JProperty("taskNo", ""));//任务主键
|
||
|
objMis.Add(new JProperty("containerCode", item.STOCK_BARCODE));//托盘条码
|
||
|
|
||
|
objMis.Add(new JProperty("taskStatus", item.CONTROL_STATUS));//任务状态 新加
|
||
|
|
||
|
#endregion
|
||
|
reqJson = JsonConvert.DeserializeObject(objMis.ToString()).ToString();
|
||
|
|
||
|
retJson = HttpHelper.PostJson(InterfaceAdd, reqJson);
|
||
|
|
||
|
string retSuccess = UtilityBLL.GetReceiveValues(retJson, "success");
|
||
|
string code = UtilityBLL.GetReceiveValues(retJson, "code");
|
||
|
|
||
|
if (new string[] { "900", "980", "999" }.Contains(item.CONTROL_STATUS.ToString()) && code == "0")
|
||
|
{
|
||
|
model.Delete(" CONTROL_ID = '" + item.CONTROL_ID + "'");
|
||
|
}
|
||
|
|
||
|
|
||
|
#region 添加接口日志 及界面显示
|
||
|
UtilityBLL.CreateINTERFACE_LOG(InterfaceName, InterfaceFlow, reqJson, retJson, InterfaceNote);
|
||
|
#endregion
|
||
|
}
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
new DisplaySet().ErrorAddListBoxItem(InterfaceName, ex.Message);
|
||
|
new DisplaySet().AddListBoxItem(InterfaceName, ex.Message);
|
||
|
|
||
|
UtilityBLL.CreateINTERFACE_LOG(InterfaceName, InterfaceFlow, reqJson, retJson + ex.Message, InterfaceNote);
|
||
|
LogHelper.ErrorLog(ex);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|