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.
1904 lines
72 KiB
1904 lines
72 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.ServiceModel;
|
|
using System.Data;
|
|
using System.Collections;
|
|
//using System.Web.Script.Serialization;
|
|
using System.Text.RegularExpressions;
|
|
using CommonLib;
|
|
using System.Threading;
|
|
using DBFactory;
|
|
using ICommLayer;
|
|
using CommLayerFactory;
|
|
//using System.Security;
|
|
using System.Security.Cryptography;
|
|
using System.Web;
|
|
using System.Net;
|
|
using System.IO;
|
|
using System.Xml.Serialization;
|
|
using Newtonsoft.Json;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
namespace WcfControlMonitorLib
|
|
{
|
|
public class CCallService
|
|
{
|
|
|
|
public class WMS_WCS_PARAM_OUT_MOVE
|
|
{
|
|
public string groupid { get; set; }//任务组号
|
|
public string msgTime { get; set; }//下发时间
|
|
public string externalOrderNo { get; set; }//业务单号
|
|
public string region { get; set; }//出库的库位组
|
|
public int priority { get; set; }// 优先级
|
|
public List<OUT_MOVE_DATA> tasks { get; set; }
|
|
//检查参数是否缺失
|
|
public bool CheckParamNotNull(out string error)
|
|
{
|
|
|
|
StringBuilder message = new StringBuilder();
|
|
if (groupid == String.Empty)
|
|
{
|
|
message.Append("缺少groupid参数。");
|
|
|
|
}
|
|
if (msgTime == String.Empty)
|
|
{
|
|
message.Append("缺少msgTime参数。");
|
|
|
|
}
|
|
if (externalOrderNo == String.Empty)
|
|
{
|
|
message.Append("缺少externalOrderNo参数。");
|
|
|
|
}
|
|
if (region == String.Empty)
|
|
{
|
|
message.Append("缺少region参数。");
|
|
|
|
}
|
|
//if (priority == String.Empty)
|
|
//{
|
|
// message.Append("缺少timestamp参数。");
|
|
|
|
//}
|
|
if (tasks == null||tasks.Count==0)
|
|
{
|
|
message.Append("缺少tasks参数。");
|
|
|
|
}
|
|
|
|
error = message.ToString();
|
|
|
|
if (message.Length == 0)
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
#region OUT_MOVE_DATA 下发任务 山东时代
|
|
public class OUT_MOVE_DATA
|
|
//JSON格式业务数据
|
|
{
|
|
/// <summary>
|
|
/// 任务ID
|
|
/// </summary>
|
|
public string taskId { get; set; }
|
|
/// <summary>
|
|
/// 业务单号
|
|
/// </summary>
|
|
public string externalOrderNo { get; set; }
|
|
/// <summary>
|
|
/// 任务类型 1.入库,2:出库,3:移库,4.越库?
|
|
/// </summary>
|
|
public int taskType { get; set; }
|
|
/// <summary>
|
|
/// 任务起点
|
|
/// </summary>
|
|
public string startNode { get; set; }
|
|
/// <summary>
|
|
/// 起始巷道
|
|
/// </summary>
|
|
public string startLaneway { get; set; }
|
|
/// <summary>
|
|
/// 起始排
|
|
/// </summary>
|
|
public int startRow { get; set; }
|
|
/// <summary>
|
|
/// 起始列
|
|
/// </summary>
|
|
public int startColumn { get; set; }
|
|
/// <summary>
|
|
/// 起始层
|
|
/// </summary>
|
|
public int startLayer { get; set; }
|
|
/// <summary>
|
|
/// 起始深度
|
|
/// </summary>
|
|
public int startDepth { get; set; }
|
|
/// <summary>
|
|
/// 任务终点
|
|
/// </summary>
|
|
public string endNode { get; set; }
|
|
/// <summary>
|
|
/// 目标巷道
|
|
/// </summary>
|
|
public string endLaneway { get; set; }
|
|
/// <summary>
|
|
/// 目标排
|
|
/// </summary>
|
|
public int endRow { get; set; }
|
|
/// <summary>
|
|
/// 目标列
|
|
/// </summary>
|
|
public int endColumn { get; set; }
|
|
/// <summary>
|
|
/// 目标层
|
|
/// </summary>
|
|
public int endLayer { get; set; }
|
|
/// <summary>
|
|
/// 目标深度
|
|
/// </summary>
|
|
public int endDepth { get; set; }
|
|
/// <summary>
|
|
/// 目标库位组
|
|
/// </summary>
|
|
public string endGroup { get; set; }
|
|
/// <summary>
|
|
//拆包间编码
|
|
/// </summary>
|
|
public string unpackingRomCode { get; set; }
|
|
/// <summary>
|
|
/// 拆包间库位编码
|
|
/// </summary>
|
|
public string unpackingRomWhLocationCode { get; set; }
|
|
/// <summary>
|
|
/// 搬运类型
|
|
/// </summary>
|
|
public int carryType { get; set; }
|
|
/// <summary>
|
|
/// 容器编码
|
|
/// </summary>
|
|
public string containerCode { get; set; }
|
|
/// <summary>
|
|
/// 物料编码
|
|
/// </summary>
|
|
public string materialCode { get; set; }
|
|
/// <summary>
|
|
/// 物料名称
|
|
/// </summary>
|
|
public string materialName { get; set; }
|
|
/// <summary>
|
|
/// 物料类型
|
|
/// </summary>
|
|
public string materialType { get; set; }
|
|
/// <summary>
|
|
/// 批次号
|
|
/// </summary>
|
|
public string batchNo { get; set; }
|
|
/// <summary>
|
|
/// 宽度
|
|
/// </summary>
|
|
public string referTag { get; set; }
|
|
/// <summary>
|
|
/// 供应商批次号
|
|
/// </summary>
|
|
public string supplierBatch { get; set; }
|
|
/// <summary>
|
|
/// 载具尺寸
|
|
/// </summary>
|
|
public string containerSize { get; set; }
|
|
/// <summary>
|
|
/// 数量
|
|
/// </summary>
|
|
public double qty { get; set; }
|
|
/// <summary>
|
|
/// 贴纸信息
|
|
/// </summary>
|
|
public List<LCS_lotInfo> lotInfo { get; set; }
|
|
}
|
|
public class LCS_lotInfo {
|
|
/// <summary>
|
|
/// 贴纸编号
|
|
/// </summary>
|
|
public string lotID { get; set; }
|
|
/// <summary>
|
|
/// 物料编码
|
|
/// </summary>
|
|
public string MaterialCode { get; set; }
|
|
/// <summary>
|
|
/// 物料名称
|
|
/// </summary>
|
|
public string MaterialName { get; set; }
|
|
/// <summary>
|
|
/// 批次号
|
|
/// </summary>
|
|
public string batchNo { get; set; }
|
|
/// <summary>
|
|
/// 宽度
|
|
/// </summary>
|
|
public string referTag { get; set; }
|
|
/// <summary>
|
|
/// 供应商批次号
|
|
/// </summary>
|
|
public string supplierBatchNo { get; set; }
|
|
/// <summary>
|
|
/// 数量
|
|
/// </summary>
|
|
public double qty { get; set; }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region OUT_MOVE_RES 出库返回 山东时代
|
|
|
|
public class OUT_MOVE_RES //JSON格式业务数据
|
|
{
|
|
public int code { get; set; }//处理状态。0,成功,1异常
|
|
public string msg { get; set; }//返回消息
|
|
public object data { get; set; }
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region//test stackstatus
|
|
public class WMS_WCS_111
|
|
{
|
|
public string method { get; set; }
|
|
//public string client_customerid { get; set; }
|
|
//public string client_db { get; set; }
|
|
//public string messageid { get; set; }
|
|
//public string apptoken { get; set; }
|
|
//public string appkey { get; set; }
|
|
//public string sign { get; set; }
|
|
public string timestamp { get; set; }
|
|
|
|
//public object data { get; set; } //需要根据method进行类型转换
|
|
public List<STATUS_111> data { get; set; }
|
|
|
|
|
|
//检查参数是否缺失
|
|
public bool CheckParamNotNull(out string error)
|
|
{
|
|
|
|
StringBuilder message = new StringBuilder();
|
|
if (method == String.Empty)
|
|
{
|
|
message.Append("缺少method参数。");
|
|
|
|
}
|
|
//if (client_customerid == String.Empty)
|
|
//{
|
|
// message.Append("缺少client_customerid参数。");
|
|
|
|
//}
|
|
//if (client_db == String.Empty)
|
|
//{
|
|
// message.Append("缺少client_db参数。");
|
|
|
|
//}
|
|
//if (messageid == String.Empty)
|
|
//{
|
|
// message.Append("缺少messageid参数。");
|
|
|
|
//}
|
|
//if (apptoken == String.Empty)
|
|
//{
|
|
// message.Append("缺少apptoken参数。");
|
|
|
|
//}
|
|
//if (appkey == String.Empty)
|
|
//{
|
|
// message.Append("缺少appkey参数。");
|
|
|
|
//}
|
|
//if (sign == String.Empty)
|
|
//{
|
|
// message.Append("缺少sign参数。");
|
|
|
|
//}
|
|
if (timestamp == String.Empty)
|
|
{
|
|
message.Append("缺少timestamp参数。");
|
|
|
|
}
|
|
if (data == null)
|
|
{
|
|
message.Append("缺少data参数。");
|
|
|
|
}
|
|
|
|
error = message.ToString();
|
|
|
|
if (message.Length == 0)
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
//public FLUX_SYSTEM_PARAM(string[] str)
|
|
//{
|
|
// for (int i = 0; i < str.Length; i++)
|
|
// {
|
|
// if (str[i].Contains("method") == true)
|
|
// {
|
|
// this.method = str[i].Split('=')[1];
|
|
// continue;
|
|
// }
|
|
// if (str[i].Contains("client_customerid") == true)
|
|
// {
|
|
// this.client_customerid = str[i].Split('=')[1];
|
|
// continue;
|
|
// }
|
|
// if (str[i].Contains("client_db") == true)
|
|
// {
|
|
// this.client_db = str[i].Split('=')[1];
|
|
// continue;
|
|
// }
|
|
// if (str[i].Contains("messageid") == true)
|
|
// {
|
|
// this.messageid = str[i].Split('=')[1];
|
|
// continue;
|
|
// }
|
|
// if (str[i].Contains("apptoken") == true)
|
|
// {
|
|
// this.apptoken = str[i].Split('=')[1];
|
|
// continue;
|
|
// }
|
|
// if (str[i].Contains("appkey") == true)
|
|
// {
|
|
// this.appkey = str[i].Split('=')[1];
|
|
// continue;
|
|
// }
|
|
// if (str[i].Contains("sign") == true)
|
|
// {
|
|
// this.sign = str[i].Split('=')[1];
|
|
// continue;
|
|
// }
|
|
// if (str[i].Contains("timestamp") == true)
|
|
// {
|
|
// this.timestamp = str[i].Split('=')[1];
|
|
// continue;
|
|
// }
|
|
// if (str[i].Contains("data") == true)
|
|
// {
|
|
// //this.data = str[i].Split('=')[1]; //业务数据
|
|
// continue;
|
|
// }
|
|
// }
|
|
//}
|
|
}
|
|
public class WCS_WMS_111
|
|
{
|
|
public string method { get; set; }
|
|
//public string client_customerid { get; set; }
|
|
//public string client_db { get; set; }
|
|
//public string messageid { get; set; }
|
|
//public string apptoken { get; set; }
|
|
//public string appkey { get; set; }
|
|
//public string sign { get; set; }
|
|
public string timestamp { get; set; }
|
|
|
|
//public object data { get; set; } // //dzf 出库和移库
|
|
public List<OUT_MOVE_RES> data { get; set; }
|
|
|
|
//public WCS_WMS_PARAM()
|
|
//{
|
|
// method = "";
|
|
// //client_customerid = "aa";
|
|
// //client_db = " ";
|
|
// //messageid = "";
|
|
// //apptoken = "";
|
|
// //appkey = "";
|
|
// //sign = "";
|
|
// timestamp = "";
|
|
// data = new object();
|
|
//}
|
|
|
|
//public static string MD5Encrypt64(string data)
|
|
//{
|
|
// MD5 md5 = new MD5CryptoServiceProvider();
|
|
// Encoding utf8 = Encoding.UTF8;
|
|
// string sign2 = HttpUtility.UrlEncode((Convert.ToBase64String(md5.ComputeHash(Encoding.Default.GetBytes(appSecret + data + appSecret)))).ToUpper(), utf8);
|
|
// return sign2;
|
|
//}
|
|
|
|
//检查参数是否缺失
|
|
public bool CheckParamNotNull(out string error)
|
|
{
|
|
|
|
StringBuilder message = new StringBuilder();
|
|
if (method == String.Empty)
|
|
{
|
|
message.Append("缺少method参数。");
|
|
|
|
}
|
|
//if (client_customerid == String.Empty)
|
|
//{
|
|
// message.Append("缺少client_customerid参数。");
|
|
|
|
//}
|
|
//if (client_db == String.Empty)
|
|
//{
|
|
// message.Append("缺少client_db参数。");
|
|
|
|
//}
|
|
//if (messageid == String.Empty)
|
|
//{
|
|
// message.Append("缺少messageid参数。");
|
|
|
|
//}
|
|
//if (apptoken == String.Empty)
|
|
//{
|
|
// message.Append("缺少apptoken参数。");
|
|
|
|
//}
|
|
//if (appkey == String.Empty)
|
|
//{
|
|
// message.Append("缺少appkey参数。");
|
|
|
|
//}
|
|
//if (sign == String.Empty)
|
|
//{
|
|
// message.Append("缺少sign参数。");
|
|
|
|
//}
|
|
if (timestamp == String.Empty)
|
|
{
|
|
message.Append("缺少timestamp参数。");
|
|
|
|
}
|
|
if (data == null)
|
|
{
|
|
message.Append("缺少data参数。");
|
|
|
|
}
|
|
|
|
error = message.ToString();
|
|
|
|
if (message.Length == 0)
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
#region STATUS_111 多穿设备状态
|
|
|
|
public class STATUS_111 //JSON格式业务数据
|
|
{
|
|
public string stackindex { get; set; }//任务编号(索引)
|
|
public string positon { get; set; }//层
|
|
public string battery { get; set; }//电量
|
|
public string laneout { get; set; }//巷道内外
|
|
public string runstatus { get; set; }//状态
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
#region 入库WCS山东时代
|
|
public class WMS_WCS_PARAM_IN
|
|
{
|
|
/// <summary>
|
|
/// 任务ID
|
|
/// </summary>
|
|
public string taskId { get; set; }
|
|
/// <summary>
|
|
/// 任务类型
|
|
/// </summary>
|
|
public int taskType { get; set; }
|
|
/// <summary>
|
|
/// 任务起点
|
|
/// </summary>
|
|
public string startNode { get; set; }
|
|
/// <summary>
|
|
/// 起始巷道
|
|
/// </summary>
|
|
public string startLaneway { get; set; }
|
|
/// <summary>
|
|
/// 优先级
|
|
/// </summary>
|
|
public string priority { get; set; }
|
|
/// <summary>
|
|
/// 任务终点
|
|
/// </summary>
|
|
public string endNode { get; set; }
|
|
/// <summary>
|
|
/// 目标巷道
|
|
/// </summary>
|
|
public string endLaneway { get; set; }
|
|
/// <summary>
|
|
/// 目标排
|
|
/// </summary>
|
|
public int endRow { get; set; }
|
|
/// <summary>
|
|
/// 目标列
|
|
/// </summary>
|
|
public int endColumn { get; set; }
|
|
/// <summary>
|
|
/// 目标层
|
|
/// </summary>
|
|
public int endLayer { get; set; }
|
|
/// <summary>
|
|
/// 目标深度
|
|
/// </summary>
|
|
public int endDepth { get; set; }
|
|
/// <summary>
|
|
/// 目标库位组
|
|
/// </summary>
|
|
public string endGroup { get; set; }
|
|
/// <summary>
|
|
/// 容器编码
|
|
/// </summary>
|
|
public string containerCode { get; set; }
|
|
}
|
|
public class WCS_WMS_PARAM_IN
|
|
{
|
|
public int code { get; set; }
|
|
|
|
public string msg { get; set; }
|
|
|
|
public object data { get; set; }
|
|
|
|
|
|
|
|
}
|
|
#endregion
|
|
|
|
//#region IN_DATA 入库 民航二所
|
|
//public class IN_DATA
|
|
////JSON格式业务数据
|
|
//{
|
|
// /// <summary>
|
|
// ///
|
|
// /// </summary>
|
|
// public string taskId { get; set; }
|
|
// /// <summary>
|
|
// ///
|
|
// /// </summary>
|
|
// public string containerCode { get; set; }
|
|
// /// <summary>
|
|
// ///
|
|
// /// </summary>
|
|
// public string sourceAddress { get; set; }
|
|
// /// <summary>
|
|
// ///
|
|
// /// </summary>
|
|
// public string targetAddress { get; set; }
|
|
// /// <summary>
|
|
// ///
|
|
// /// </summary>
|
|
// public string tasklevel { get; set; }
|
|
|
|
//}
|
|
//#endregion
|
|
|
|
//#region IN_RES 入库返回
|
|
|
|
//public class IN_RES //JSON格式业务数据
|
|
//{
|
|
// public string code { get; set; }//处理状态。00,成功,01异常
|
|
// public string msg { get; set; }//返回消息
|
|
// public string taskId { get; set; }
|
|
//}
|
|
//#endregion
|
|
|
|
|
|
#region CANCEL_DATA WMS取消任务 山东时代
|
|
public class WMS_WCS_PARAM_CANCEL
|
|
{
|
|
public string taskId { get; set; }//任务编号(索引)
|
|
public string msgTime { get; set; }//
|
|
}
|
|
|
|
public class WCS_WMS_PARAM_CANCEL
|
|
{
|
|
|
|
public int code { get; set; }//处理状态。0,成功,1异常
|
|
public string msg { get; set; }//返回消息
|
|
public object data { get; set; }
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region CANCEL_RES_Priority WMS调整任务优先级
|
|
public class WMS_WCS_PARAM_Priority {
|
|
/// <summary>
|
|
/// 任务编码
|
|
/// </summary>
|
|
public string taskId { get; set; }
|
|
/// <summary>
|
|
/// 任务优先级
|
|
/// </summary>
|
|
public string priority { get; set; }
|
|
/// <summary>
|
|
/// 下发时间
|
|
/// </summary>
|
|
public string msgTime { get; set; }
|
|
}
|
|
|
|
public class WCS_WMS_PARAM_Priority //JSON格式业务数据
|
|
{
|
|
public int code { get; set; }//状态(0 成功,1 失败)
|
|
public string msg { get; set; }//返回消息,描述信息
|
|
public object data { get; set; }
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 状态上报 山东
|
|
/// <summary>
|
|
/// 任务上报
|
|
/// </summary>
|
|
public class WCS_WMS_PARAM_UPDATE
|
|
{
|
|
/// <summary>
|
|
/// 任务ID
|
|
/// </summary>
|
|
public string taskId { get; set; }
|
|
/// <summary>
|
|
/// 任务状态任务执行过程中的状态,1:任务 开始 2:任务结束
|
|
/// </summary>
|
|
public int taskStatus { get; set; }
|
|
/// <summary>
|
|
/// 出库取货库位编码 出库取到货时传 入(取到货时必 填)出库及移库 必填
|
|
/// </summary>
|
|
public string startSpaceCode{ get; set; }
|
|
/// <summary>
|
|
/// 入库放货库位编码 入库放完货后传 入(放货完成后必填)入库及移库必填
|
|
/// </summary>
|
|
public string endSpaceCode { get; set;}
|
|
/// <summary>
|
|
/// 是否需要给AGV下发搬运任务 后续任务是否需要下发给 AGV搬运;0:不需要1:需要;如出库到输送线末端,需要 AGV 搬运则需回传 1,如某个出库口临时需要人工搬运,则为 0
|
|
/// </summary>
|
|
public string sendAgv { get; set; }
|
|
/// <summary>
|
|
/// 上报时间
|
|
/// </summary>
|
|
public string reportTime { get; set; }
|
|
/// <summary>
|
|
/// 上报信息
|
|
/// </summary>
|
|
public string reportInfo { get; set; }
|
|
}
|
|
|
|
public class WMS_WCS_PARAM_UPDATE
|
|
{
|
|
public int code { get; set; }
|
|
public string msg { get; set; }
|
|
public object data { get; set; }
|
|
}
|
|
#endregion
|
|
#region 入库申请 山东
|
|
|
|
|
|
public class InboundApply //JSON格式业务数据
|
|
{
|
|
/// <summary>
|
|
/// 容器编码
|
|
/// </summary>
|
|
public string containerCode { get; set; }
|
|
/// <summary>
|
|
/// 任务起点 输送线号
|
|
/// </summary>
|
|
public string startNode { get; set; }
|
|
/// <summary>
|
|
/// 请求类型 1实物,2空托
|
|
/// </summary>
|
|
public int requestType { get; set; }//状态(10 执行中 30故障 999完成)
|
|
/// <summary>
|
|
/// 请求任务类型 1入库请求 2.请求库位为 1 时 WMS 仅校验任务是否允许入库,
|
|
/// 不返回具体的目标库位,为 2 时WMS 返回具体的目标库位
|
|
/// </summary>
|
|
public int requestTaskType { get; set; }//
|
|
/// <summary>
|
|
////高度 1.低,2高
|
|
/// </summary>
|
|
public int requestHeight { get; set; }
|
|
/// <summary>
|
|
/// 载具尺寸 载具尺寸(不是必须)
|
|
/// </summary>
|
|
public string containerSize { get; set; }
|
|
/// <summary>
|
|
/// 载具重量
|
|
/// </summary>
|
|
public double weight { get; set; }
|
|
/// <summary>
|
|
/// 上报时间
|
|
/// </summary>
|
|
public string msgTime { get; set; }
|
|
}
|
|
|
|
public class InboundApplyBack
|
|
{
|
|
public int code { get; set; }//状态(0 成功,1 失败)
|
|
public string msg { get; set; }//返回消息,描述信息
|
|
public InBoundApplyBackData data { get; set; }
|
|
}
|
|
public class InBoundApplyBackData {
|
|
/// <summary>
|
|
/// 返回时间
|
|
/// </summary>
|
|
public string msgTime { get; set; }
|
|
/// <summary>
|
|
/// 任务ID
|
|
/// </summary>
|
|
public string taskId { get; set; }
|
|
/// <summary>
|
|
/// 任务类型
|
|
/// </summary>
|
|
public int taskType { get; set; }
|
|
/// <summary>
|
|
/// 任务起点
|
|
/// </summary>
|
|
public string startNode { get; set; }
|
|
/// <summary>
|
|
/// 任务终点
|
|
/// </summary>
|
|
public string endNode { get; set; }
|
|
/// <summary>
|
|
/// 目标巷道
|
|
/// </summary>
|
|
public string endLaneway { get; set; }
|
|
/// <summary>
|
|
/// 目标排
|
|
/// </summary>
|
|
public int endRow { get; set; }
|
|
/// <summary>
|
|
/// 目标列
|
|
/// </summary>
|
|
public int endColumn { get; set; }
|
|
/// <summary>
|
|
/// 目标层
|
|
/// </summary>
|
|
public int endLayer { get; set; }
|
|
/// <summary>
|
|
/// 目标深位
|
|
/// </summary>
|
|
public int endDepth { get; set; }
|
|
/// <summary>
|
|
/// 物料编码
|
|
/// </summary>
|
|
public string materialCode { get; set; }
|
|
/// <summary>
|
|
/// 物流名称
|
|
/// </summary>
|
|
public string materialName { get; set; }
|
|
/// <summary>
|
|
/// 物料类型
|
|
/// </summary>
|
|
public string materialType { get; set; }
|
|
/// <summary>
|
|
/// 批次号
|
|
/// </summary>
|
|
public string batchNo { get; set; }
|
|
/// <summary>
|
|
/// 数量
|
|
/// </summary>
|
|
public double qty { get; set; }
|
|
/// <summary>
|
|
/// 载具尺寸
|
|
/// </summary>
|
|
public string containerSize { get; set; }
|
|
/// <summary>
|
|
/// 优先级
|
|
/// </summary>
|
|
public int priority { get; set; }
|
|
/// <summary>
|
|
/// 载具重量
|
|
/// </summary>
|
|
public double weight { get; set; }
|
|
/// <summary>
|
|
/// 容器条码
|
|
/// </summary>
|
|
public string containerCode { get; set; }
|
|
}
|
|
#endregion
|
|
#region WCS->LCS请求AGV 取货 无用
|
|
public class WCS_WMS_RequestAGV {
|
|
/// <summary>
|
|
/// 任务ID
|
|
/// </summary>
|
|
public string taskId { get; set; }
|
|
/// <summary>
|
|
/// (站台号)
|
|
/// </summary>
|
|
public string fromStation { get; set; }
|
|
/// <summary>
|
|
/// (拆包间/产线投料口,站点,站台)
|
|
/// </summary>
|
|
public string toStation { get; set; }
|
|
/// <summary>
|
|
/// 目标库位组
|
|
/// </summary>
|
|
public string endGroup { get; set; }
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public string pallteId { get; set; }
|
|
/// <summary>
|
|
/// 0-小(粉料),1-中(箔材),2-大。根据需要可以扩展成托盘轮廓尺寸
|
|
/// </summary>
|
|
public string pallteType { get; set; }
|
|
/// <summary>
|
|
/// 包括物料号和箱号,json 数组,例如 [{"lotId":"S23333","material":"Aa123"}]。支持一托多箱一物料号,也支持一托多箱多物料号。
|
|
/// </summary>
|
|
public string lotInfo { get; set; }
|
|
/// <summary>
|
|
/// 1-100 ,数值越大越优先
|
|
/// </summary>
|
|
public int priorityP { get; set; }
|
|
/// <summary>
|
|
/// 1-物料 2-空托盘
|
|
/// </summary>
|
|
public int taskType { get; set; }
|
|
}
|
|
public class WCS_WMS_RequestAGVBack {
|
|
public int code { get; set; }
|
|
public string msg { get; set; }
|
|
public RequestAGVBackData data { get; set; }
|
|
|
|
}
|
|
public class RequestAGVBackData {
|
|
public string msgTime { get; set; }
|
|
public string taskId { get; set; }
|
|
}
|
|
#endregion
|
|
#region
|
|
#region WCS 允许 AGV 可取可放 返回站台状态
|
|
public class LCS_WCS_AGVStationStauts {
|
|
public string taskId { get; set; }
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public int pickput { get; set; }
|
|
/// <summary>
|
|
/// 需要入库的载具条码,如托盘条码
|
|
/// </summary>
|
|
public string containerCode{get;set;}
|
|
/// <summary>
|
|
/// WCS站台号
|
|
/// </summary>
|
|
public string toStation { get; set; }
|
|
/// <summary>
|
|
/// 是否需要整形 送出 true(需要)|false(不需要)
|
|
/// </summary>
|
|
public bool isReshaping { get; set; }
|
|
/// <summary>
|
|
/// 1-物料 2-空托
|
|
/// </summary>
|
|
public int cargoType { get; set; }
|
|
}
|
|
|
|
public class LCS_WCS_AGVStationStautsBack {
|
|
public int code { get; set; }
|
|
public string msg { get; set; }
|
|
public LCS_WCS_AGVStationStautsBackData data { get; set; }
|
|
|
|
}
|
|
public class LCS_WCS_AGVStationStautsBackData {
|
|
public int putStatus { get; set; }
|
|
public string taskId { get; set; }
|
|
}
|
|
#endregion
|
|
|
|
#endregion
|
|
#region LCS 返回 AGV 取放货状态给 WCS 取放完成与否
|
|
public class LCS_WCS_AGVStatus {
|
|
/// <summary>
|
|
/// 任务ID
|
|
/// </summary>
|
|
public string taskId { get; set; }
|
|
/// <summary>
|
|
/// 目标站台
|
|
/// </summary>
|
|
public string toStation { get; set; }
|
|
/// <summary>
|
|
/// AGV运行状态 21-取货完成 23-放货完成 56 已离开
|
|
/// </summary>
|
|
public int agvTaskStatus { get; set; }
|
|
}
|
|
public class LCS_WCS_AGVStatusBack {
|
|
public int code { get; set; }
|
|
public string msg { get; set; }
|
|
public LCS_WCS_AGVStatusBackData data { get; set; }
|
|
}
|
|
public class LCS_WCS_AGVStatusBackData {
|
|
/// <summary>
|
|
/// 任务ID唯一
|
|
/// </summary>
|
|
public string taskId { get; set; }
|
|
}
|
|
#endregion
|
|
|
|
//#region DELETE_TASK_DATA 向管理申请删除任务
|
|
//public class DELETE_TASK_DATA
|
|
//{
|
|
|
|
// public string taskId { get; set; }//任务编号(索引)
|
|
// public string containerCode { get; set; }//条码
|
|
|
|
//}
|
|
//#endregion
|
|
|
|
//#region DELETE_TASK_RES 取消任务返回
|
|
//public class DELETE_TASK_RES
|
|
//{
|
|
// public string code { get; set; }//状态(0 成功,1 失败)
|
|
// public string msg { get; set; }//返回消息,描述信息
|
|
// public string taskId { get; set; }
|
|
//}
|
|
//#endregion
|
|
|
|
|
|
|
|
public static event RefreshMonitorEventHandler RefreshMonitor;
|
|
public static void OnRefreshMonitor(RefreshMonitorEventArgs e)
|
|
{
|
|
if (RefreshMonitor != null)
|
|
{
|
|
RefreshMonitor(e);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// post请求方法
|
|
/// </summary>
|
|
/// <param name="pContent"></param>
|
|
/// <param name="address"></param>
|
|
/// <param name="sResult"></param>
|
|
/// <returns></returns>
|
|
|
|
public static bool Invok_WMS_new( string pContent, string address, out string sResult)
|
|
{
|
|
object result = new object();
|
|
try
|
|
|
|
{
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "DealCallService", "发送报文:", pContent, "");
|
|
|
|
//json参数 //创建一个HTTP请求
|
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address);
|
|
//Post请求方式
|
|
request.Method = "POST";
|
|
request.Timeout = 4500;
|
|
//内容类型
|
|
request.ContentType = "application/json;charset=UTF-8";
|
|
//将Json字符串转化为字节
|
|
byte[] byteData = Encoding.UTF8.GetBytes(pContent);
|
|
|
|
int length = byteData.Length;
|
|
//设置请求的ContentLength
|
|
request.ContentLength = length;
|
|
//发送请求,获得请求流
|
|
Stream writer = request.GetRequestStream();//获取用于写入请求数据的Stream对象
|
|
//将请求参数写入流
|
|
writer.Write(byteData, 0, length);
|
|
writer.Close();
|
|
//获得响应流
|
|
var response = (HttpWebResponse)request.GetResponse();
|
|
var responseString = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("utf-8")).ReadToEnd();
|
|
sResult = responseString;
|
|
if (!address.Contains("state"))
|
|
{
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "DealCallService", "收到报文:", responseString, "");
|
|
}
|
|
return true;
|
|
|
|
}
|
|
catch (System.Net.WebException ex)
|
|
{
|
|
sResult = ex.Message;
|
|
var mResponse = ex.Response as HttpWebResponse;
|
|
var responseStream = mResponse.GetResponseStream();
|
|
if (responseStream != null)
|
|
{
|
|
var streamReader = new StreamReader(responseStream, Encoding.GetEncoding("utf-8"));
|
|
//获取返回的信息
|
|
result = streamReader.ReadToEnd();
|
|
streamReader.Close();
|
|
responseStream.Close();
|
|
}
|
|
result = "获取数据失败,请重试!" + address + ex.ToString() + " 返回数据" + result;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 任务状态上报
|
|
/// </summary>
|
|
/// <param name="ask_data"></param>
|
|
/// <param name="resp_data"></param>
|
|
/// <returns></returns>
|
|
public static string UpdateTaskStatusToWMS(int Managertask_Id,out WMS_WCS_PARAM_UPDATE resp_data)
|
|
{
|
|
string bResult = string.Empty;
|
|
bool sResult = true;
|
|
string outJson = string.Empty;
|
|
resp_data = null;
|
|
try
|
|
{
|
|
sql.Clear();
|
|
DataView data = new DataView();
|
|
sql.Append(string.Format("select CONTROL_ID,MANAGE_ID,CONTROL_TASK_TYPE, STOCK_BARCODE, START_WAREHOUSE_CODE,START_DEVICE_CODE, END_WAREHOUSE_CODE, END_DEVICE_CODE, CONTROL_BEGIN_TIME,CONTROL_STATUS,NeedAGV from IO_CONTROL where FMANAGE_ID={0}", Managertask_Id));
|
|
data = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
WCS_WMS_PARAM_UPDATE upd = new WCS_WMS_PARAM_UPDATE();//传参解析使用
|
|
if (data.Count > 0) {
|
|
upd.taskId = Managertask_Id.ToString();
|
|
upd.taskStatus = Convert.ToInt32(data[0]["CONTROL_STATUS"]);
|
|
if (Convert.ToInt32(data[0]["CONTROL_TASK_TYPE"]) == 1) {
|
|
upd.endSpaceCode = data[0]["END_WAREHOUSE_CODE"].ToString();
|
|
}
|
|
else if (Convert.ToInt32(data[0]["CONTROL_TASK_TYPE"]) == 2) {
|
|
upd.startSpaceCode = data[0]["START_WAREHOUSE_CODE"].ToString();
|
|
}
|
|
else if (Convert.ToInt32(data[0]["CONTROL_TASK_TYPE"]) == 3) {
|
|
upd.startSpaceCode = data[0]["START_WAREHOUSE_CODE"].ToString();
|
|
upd.endSpaceCode = data[0]["END_WAREHOUSE_CODE"].ToString();
|
|
}
|
|
upd.sendAgv =data[0]["NeedAGV"].ToString();
|
|
upd.reportTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
upd.reportInfo = null;
|
|
WMS_WCS_PARAM_UPDATE upd_res = new WMS_WCS_PARAM_UPDATE();//返回值
|
|
|
|
string data_json_string = Model.JsonHelper.Serializer(upd);
|
|
|
|
sResult = Invok_WMS_new(data_json_string, CStaticClass.ManageServiceAddress, out outJson);
|
|
|
|
if (sResult == false)
|
|
{
|
|
bResult = outJson;
|
|
}
|
|
else
|
|
{
|
|
upd_res = Model.JsonHelper.Deserialize<WMS_WCS_PARAM_UPDATE>(outJson);//WMS的返回值需要反序列化
|
|
|
|
}
|
|
}
|
|
return bResult;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
bResult = ex.Message;
|
|
return bResult;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
///输送线入库申请
|
|
/// </summary>
|
|
/// <param name="barcode">条码</param>
|
|
/// <param name="startNode">扫码站台</param>
|
|
/// <param name="requestType">1: 入库申请2:请求库位</param>
|
|
/// <param name="resp_data">返回数据</param>
|
|
/// <returns></returns>
|
|
public static ResultMessage RequestToWMS(string barcode, string startNode,string requestType, out InboundApplyBack resp_data)
|
|
{
|
|
ResultMessage result = new ResultMessage();
|
|
//string bResult = string.Empty;
|
|
// bool sResult = false;
|
|
string outJson = string.Empty;
|
|
resp_data = null;
|
|
try
|
|
{
|
|
InboundApply inboundApply = new InboundApply();
|
|
// InboundApplyBack inboundApplyBack = new InboundApplyBack();
|
|
inboundApply.msgTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
inboundApply.containerCode = barcode;
|
|
inboundApply.weight = 0;
|
|
inboundApply.requestType = 1; //1 实物2 空托 / 空箱
|
|
inboundApply.startNode =startNode;
|
|
inboundApply.containerSize = null;
|
|
inboundApply.requestHeight = 1;//1低,2高
|
|
inboundApply.requestTaskType = 2;//1: 入库申请2:请求库位为 1 时 WMS 仅校验任务是否允许入库,不返回具体的目标库位,为 2 时WMS 返回具体的目标库位
|
|
string data_json_string = Model.JsonHelper.Serializer(inboundApply);
|
|
result.sResult = Invok_WMS_new(data_json_string, CStaticClass.ManageServiceAddressTwo, out outJson);
|
|
if (result.sResult == false)
|
|
{
|
|
result.message = outJson;
|
|
}
|
|
else
|
|
{
|
|
resp_data = Model.JsonHelper.Deserialize<InboundApplyBack>(outJson);//将wms回复的信息反序列化
|
|
//返回
|
|
if (resp_data.code == 0)//成功
|
|
{
|
|
result.sResult = true;
|
|
result.message = resp_data.msg;
|
|
}
|
|
else//失败
|
|
{
|
|
if (resp_data.msg == "")
|
|
{
|
|
result.sResult = false;
|
|
result.message = "返回为null";
|
|
}
|
|
else
|
|
{
|
|
result.sResult = false;
|
|
result.message = resp_data.msg;
|
|
}
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.sResult = false;
|
|
result.message = ex.Message;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
#region 不使用
|
|
//public static string RequestAGV (int Managertask_Id, string requestType, out RequestAGVBackData resp_data)
|
|
//{
|
|
// string bResult = string.Empty;
|
|
// bool sResult = false;
|
|
// string outJson = string.Empty;
|
|
// resp_data = null;
|
|
// try
|
|
// {
|
|
// WCS_WMS_RequestAGV RequestAGV = new WCS_WMS_RequestAGV();//传入参数
|
|
// WCS_WMS_RequestAGVBack RequestAGVBack = new WCS_WMS_RequestAGVBack();//传出参数
|
|
// sql.Clear();
|
|
// DataView data = new DataView();
|
|
// sql.Append(string.Format("select CONTROL_ID,MANAGE_ID,CONTROL_TASK_TYPE, STOCK_BARCODE, START_WAREHOUSE_CODE,START_DEVICE_CODE, END_WAREHOUSE_CODE, END_DEVICE_CODE, CONTROL_BEGIN_TIME,CONTROL_STATUS,NeedAGV from IO_CONTROL where FMANAGE_ID={0}", Managertask_Id));
|
|
// data = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
// if (data.Count > 0) {
|
|
// RequestAGV.taskId = Managertask_Id.ToString();
|
|
// RequestAGV.fromStation = data[0]["START_DEVICE_CODE"].ToString();
|
|
// RequestAGV.toStation = data[0]["END_DEVICE_CODE"].ToString();
|
|
// RequestAGV.pallteId= data[0]["STOCK_BARCOD"].ToString();
|
|
// RequestAGV.pallteType = "1";
|
|
// RequestAGV.taskType = 1;
|
|
// string data_json_string = Model.JsonHelper.Serializer(RequestAGVBack);
|
|
// sResult = Invok_WMS_new(data_json_string, CStaticClass.ManageServiceAddressThree, out outJson);
|
|
// if (sResult == false)
|
|
// {
|
|
// bResult = outJson;
|
|
// }
|
|
// else
|
|
// {
|
|
// RequestAGVBack = Model.JsonHelper.Deserialize<WCS_WMS_RequestAGVBack>(outJson);//将wms回复的信息反序列化
|
|
|
|
// if (RequestAGVBack.code == 0)
|
|
// {
|
|
// bResult = "";
|
|
// resp_data = RequestAGVBack.data;
|
|
// }
|
|
// else
|
|
// {
|
|
// if (RequestAGVBack.msg == "")
|
|
// {
|
|
// bResult = "返回为null";
|
|
// }
|
|
// else
|
|
// {
|
|
// bResult = RequestAGVBack.msg;
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// return bResult;
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// bResult = ex.Message;
|
|
// return bResult;
|
|
// }
|
|
//}
|
|
//public static string UpdateStatusToWMS(List<STACKSTATUS_DATA> ask_data, out STACKSTATUS_RES_DATA resp_data)
|
|
//{
|
|
// string bResult = string.Empty;
|
|
// bool sResult = true;
|
|
// string outJson = string.Empty;
|
|
// resp_data = null;
|
|
// try
|
|
// {
|
|
// WCS_WMS_PARAM_STACK_STATUS updatestatus = new WCS_WMS_PARAM_STACK_STATUS();
|
|
// WMS_WCS_PARAM_STACK_STATUS updatestatusres = new WMS_WCS_PARAM_STACK_STATUS();
|
|
// updatestatus.method = "wcs_stack_status";
|
|
// updatestatus.timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
// updatestatus.data = ask_data;
|
|
|
|
// string data_json_string = Model.JsonHelper.Serializer(updatestatus);
|
|
|
|
|
|
// sResult = Invok_WMS_new(data_json_string, CStaticClass.ManageServiceAddressThree, out outJson);
|
|
|
|
// if (sResult == false)
|
|
// {
|
|
// bResult = outJson;
|
|
|
|
// }
|
|
// else
|
|
// {
|
|
// updatestatusres = Model.JsonHelper.Deserialize<WMS_WCS_PARAM_STACK_STATUS>(outJson);//将wms回复的信息反序列化
|
|
// STACKSTATUS_RES_DATA outdata = updatestatusres.data;
|
|
|
|
// if (outdata.code == "00" || outdata.code == "0")
|
|
// {
|
|
// bResult = "";
|
|
// resp_data = outdata;
|
|
// }
|
|
// else
|
|
// {
|
|
// if (outdata.msg == "")
|
|
// {
|
|
// bResult = "返回为null";
|
|
// }
|
|
// else
|
|
// {
|
|
// bResult = outdata.msg;
|
|
// }
|
|
// }
|
|
// }
|
|
// return bResult;
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// bResult = ex.Message;
|
|
// return bResult;
|
|
// }
|
|
//}
|
|
|
|
|
|
|
|
//向wms上报纸箱任务
|
|
|
|
|
|
//测试出库任务
|
|
//public static string TestOut(OUT_DATA ask_data, out string resp_data1)
|
|
//{
|
|
|
|
// OUT_RES resp_data = new OUT_RES();
|
|
|
|
|
|
// string bResult = string.Empty;
|
|
// bool sResult = true;
|
|
// string outJson = string.Empty;
|
|
// resp_data = null;
|
|
// try
|
|
// {
|
|
// WCS_WMS_PARAM outData = new WCS_WMS_PARAM();
|
|
// outData.method = "wcs_request_out";
|
|
// outData.client_customerid = "aa";
|
|
// outData.client_db = "";
|
|
// outData.messageid = "";
|
|
// outData.apptoken = "";
|
|
// outData.appkey = "";
|
|
// outData.sign = "";
|
|
// outData.timestamp = "";
|
|
// outData.data = ask_data;
|
|
|
|
// string data_json_string = Model.JsonHelper.Serializer(outData);
|
|
|
|
// sResult = Invok_WMS_new( data_json_string, out outJson);
|
|
|
|
|
|
|
|
// if (sResult == false)
|
|
// {
|
|
// bResult = outJson;
|
|
// }
|
|
// else
|
|
// {
|
|
// resp_data = Model.JsonHelper.Deserialize<OUT_RES>(outJson);
|
|
// if (resp_data.code != "1")
|
|
// {
|
|
// if (resp_data.msg == "")
|
|
// {
|
|
// bResult = "返回为null";
|
|
// }
|
|
// else
|
|
// {
|
|
// bResult = resp_data.msg;
|
|
// }
|
|
// }
|
|
// else
|
|
// {
|
|
// bResult = "";
|
|
// //resp_data = outdata;
|
|
// }
|
|
// }
|
|
// resp_data1 = "true";
|
|
|
|
// return bResult;
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// bResult = ex.Message;
|
|
// resp_data1 = "false";
|
|
// return bResult;
|
|
// }
|
|
//}
|
|
#endregion
|
|
|
|
static DBOperator dbo = CStaticClass.dbo;
|
|
static DBOperator dboMan = CStaticClass.dboM;
|
|
static StringBuilder sql = new StringBuilder();
|
|
static StringBuilder[] wv = { new StringBuilder("2") };
|
|
static StringBuilder[] witemnames = { new StringBuilder("") };
|
|
static Model.MDevice devinfo = new Model.MDevice();
|
|
static CCommonFunction ccf = new CCommonFunction();
|
|
static Thread mythread;
|
|
static Thread mythreadUpdatestatus;
|
|
static Thread threadAGVStatusSend;
|
|
static bool exitThread = false;
|
|
static bool exitThreadInRequestDeal = false;
|
|
static bool exitThreadInAGVPLCAsk = false;
|
|
static CGetState cgs = new CGetState();
|
|
|
|
static string _CCallServiceError = "";//监控调度类错误说明
|
|
|
|
public static string CCallServiceError
|
|
{
|
|
get { return _CCallServiceError; }
|
|
set { _CCallServiceError = value; }
|
|
}
|
|
|
|
//static Dictionary<string, string> ErrorStation = new Dictionary<string, string>
|
|
//{
|
|
// {"12005","12006"},{"12008","12007"},{"22009","22008"}
|
|
//};
|
|
|
|
//任务执行状态上报定时器
|
|
private static void BeginListen()
|
|
{//20091107
|
|
while (!exitThread)
|
|
{
|
|
try
|
|
{
|
|
string bResult = "";
|
|
DataView dv = new DataView(); DataView dvl = new DataView();
|
|
string dtime = DateTime.Now.ToString("u");
|
|
dtime = dtime.Substring(0, dtime.Length - 1);
|
|
//int AutoManageIdx = 0; int a = 0;
|
|
//string FSTARTCELL = ""; string FENDCELL = "";
|
|
//int FSTARTDEVICE = 0; int FENDDEVICE = 0;
|
|
//int flaneway = 0; int fstack = 0;
|
|
//int FControlTaskType = 0;
|
|
|
|
sql.Clear();
|
|
sql.Append("select * from IO_CONTROL WHERE CONTROL_STATUS < 900 and CONTROL_Status<>0 and IsSendLCS=0 and CONTROL_TASK_TYPE=1");//查询还未发送给WMS但是任务状态已经是拆分完的状态的任务 数据库加一个IsSendLCS字段
|
|
DataView dataIOtaskstart = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dataIOtaskstart.Count > 0) {
|
|
for (int i = 0; i < dataIOtaskstart.Count; i++)
|
|
{
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "taskStatusReporstart", "准备开始调用wms服务:", $"ID:{dataIOtaskstart[i]["MANAGE_ID"]},条码{dataIOtaskstart[i]["STOCK_BARCODE"]}");
|
|
UpdateTaskStatusToWMS(Convert.ToInt16(dataIOtaskstart[i]["MANAGE_ID"]),out WMS_WCS_PARAM_UPDATE resp_data);
|
|
if (resp_data.code == 0)
|
|
{ //成功
|
|
sql.Clear();
|
|
sql.Append($"update IO_Control set IsSendLCS=1 where MANAGE_ID={dataIOtaskstart[i]["MANAGE_ID"]}");//查询还未发送给WMS但是任务状态已经是拆分完的状态的任务
|
|
dbo.ExceSQL(sql.ToString());
|
|
}
|
|
else {
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "taskStatusReporstart", "开始调用wms服务失败:", $"返回报错{resp_data.data}:{resp_data.msg}");
|
|
}
|
|
}
|
|
}
|
|
sql.Clear();
|
|
sql.Append("select * from IO_CONTROL WHERECONTROL_STATUS = 999 OR CONTROL_STATUS = 900 OR CONTROL_STATUS = 970 and IsSendLCS=1 and CONTROL_TASK_TYPE=1");//查询还未发送给WMS但是任务状态已经是完成的状态的任务
|
|
DataView dataIOtask2finish = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dataIOtask2finish.Count > 0)
|
|
{
|
|
for (int i = 0; i < dataIOtask2finish.Count; i++)
|
|
{
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "taskStatusReporfinish", "准备开始调用wms服务:", $"ID:{dataIOtask2finish[i]["MANAGE_ID"]},条码{dataIOtask2finish[i]["STOCK_BARCODE"]}");
|
|
UpdateTaskStatusToWMS(Convert.ToInt16(dataIOtask2finish[i]["MANAGE_ID"]), out WMS_WCS_PARAM_UPDATE resp_data);
|
|
if (resp_data.code == 0)
|
|
{ //成功
|
|
sql.Clear();
|
|
sql.Append($"delete from IO_CONTROL where MANAGE_ID={dataIOtask2finish[i]["MANAGE_ID"]}");//查询还未发送给WMS但是任务状态已经是拆分完的状态的任务
|
|
dbo.ExceSQL(sql.ToString());
|
|
}
|
|
else {
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "taskStatusReporstart", "开始调用wms服务失败:", $"返回报错{resp_data.data}:{resp_data.msg}");
|
|
}
|
|
}
|
|
}
|
|
sql.Clear();
|
|
sql.Append("select * from IO_CONTROL WHERECONTROL_STATUS = 999 OR CONTROL_STATUS = 900 OR CONTROL_STATUS = 970 and CONTROL_TASK_TYP991");//直接删除回退任务
|
|
DataView dataIOBacktaskfinish = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dataIOBacktaskfinish.Count > 0)
|
|
{
|
|
for (int i = 0; i < dataIOBacktaskfinish.Count; i++)
|
|
{
|
|
sql.Clear();
|
|
sql.Append($"delete from IO_CONTROL where MANAGE_ID={dataIOtask2finish[i]["MANAGE_ID"]}");//查询还未发送给WMS但是任务状态已经是拆分完的状态的任务
|
|
dbo.ExceSQL(sql.ToString());
|
|
}
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
_CCallServiceError = ex.StackTrace + ex.Message;
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "DealCallService", "调用接口时异常:", "19999", "清除所有申请!");
|
|
//dbo.ExecuteSql(string.Format("UPDATE IO_CONTROL_APPLY set APPLY_TASK_STATUS = 2 where APPLY_TASK_STATUS = 0"));
|
|
}
|
|
finally
|
|
{
|
|
Thread.Sleep(1000);
|
|
}
|
|
}
|
|
}
|
|
|
|
private static void BeginListenUpdatestatus()
|
|
{//20091107
|
|
while (!exitThreadInRequestDeal)
|
|
{
|
|
try
|
|
{
|
|
DataView dv = new DataView(); DataView dvl = new DataView();
|
|
string dtime = DateTime.Now.ToString("u");
|
|
dtime = dtime.Substring(0, dtime.Length - 1);
|
|
sql.Clear();
|
|
sql.Append("select * from IO_CONTROL_APPLY WHERE CONTROL_APPLY_TYPE =1 and APPLY_TASK_STATUS=0");//查询还未发送给WMS但是任务状态已经是拆分完的状态的任务 数据库加一个IsSendLCS字段
|
|
DataView dataInRequest = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dataInRequest.Count > 0)
|
|
{
|
|
for (int i = 0; i < dataInRequest.Count; i++)
|
|
{
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "inboundApply", "准备开始调用wms服务:", $"Barcode:{dataInRequest[i]["STOCK_BARCODE"]},站台{dataInRequest[i]["DEVICE_CODE"]}");
|
|
ResultMessage result = RequestToWMS(dataInRequest[i]["STOCK_BARCODE"].ToString(), dataInRequest[i]["DEVICE_CODE"].ToString(), "2", out InboundApplyBack resp_data);
|
|
if (result.sResult)
|
|
{ //成功
|
|
IO_CONTROL iO_CONTROL = new IO_CONTROL(resp_data.data, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
iO_CONTROL.Insert_IOCONTROL();//暂不考虑插入失败的情况 写入IO入库任务
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "inboundApply", "开始调用wms服务成功败:", $"返回信息{resp_data.data}:{resp_data.msg}");
|
|
}
|
|
else
|
|
{
|
|
//暂定通讯失败和接口返回失败都直接回退
|
|
sql.Clear();
|
|
sql.Append("select F_EndDevice from T_Base_Route WHERE F_StartDevice =").Append(dataInRequest[i]["DEVICE_CODE"]).Append(" and F_RouteKind=4");//查询回退任务的终点位置
|
|
DataView dataBackTask = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
IO_CONTROL iO_CONTROL = new IO_CONTROL(dataInRequest[i]["DEVICE_CODE"].ToString(), dataBackTask[0]["F_EndDevice"].ToString(), dataInRequest[i]["STOCK_BARCODE"].ToString());
|
|
iO_CONTROL.Insert_IOCONTROL();//暂不考虑插入失败的情况 写入IO入库任务
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "inboundApply", "开始调用wms服务失败:", $"返回报错{resp_data.data}:{resp_data.msg}");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
_CCallServiceError = ex.StackTrace + ex.Message;
|
|
CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "inboundApply", "调用WMS接口失败", "19999", $"{ex.Message}");
|
|
}
|
|
finally
|
|
{
|
|
Thread.Sleep(1000);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
private static void BeginListenAgvData(){
|
|
while (!exitThreadInAGVPLCAsk)
|
|
{
|
|
try {
|
|
DataView dv = new DataView(); DataView dvl = new DataView();
|
|
string dtime = DateTime.Now.ToString("u");
|
|
dtime = dtime.Substring(0, dtime.Length - 1);
|
|
sql.Clear();
|
|
sql.Append("select * from T_AGVIOStation ");//查询还未发送给WMS但是任务状态已经是拆分完的状态的任务 数据库加一个IsSendLCS字段
|
|
DataView data = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
for (int i=0; i < data.Count;i++) {
|
|
Model.MDevice md = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[i]["F_DeviceIndex"]));
|
|
if (md.RunState.ToString()!= data[i]["F_AGVStatus"].ToString())//当前状态和数据库不一样,则下发数据
|
|
{
|
|
SControlMonitor sControl = new SControlMonitor();
|
|
sControl.WriteDBDataConveyor(Convert.ToInt32(dv[i]["F_DeviceIndex"]), "DB2", dv[i]["F_AGVStatus"].ToString(), out string errtext);
|
|
//
|
|
}
|
|
}
|
|
}
|
|
catch(Exception ex) {
|
|
}
|
|
}
|
|
}
|
|
public static void EndListen()
|
|
{//20091107
|
|
exitThread = true;
|
|
|
|
if (mythread != null)
|
|
{
|
|
|
|
mythread.Abort();
|
|
mythread = null;
|
|
}
|
|
|
|
|
|
exitThreadInRequestDeal = true;
|
|
|
|
if (mythreadUpdatestatus != null)
|
|
{
|
|
|
|
mythreadUpdatestatus.Abort();
|
|
mythreadUpdatestatus = null;
|
|
}
|
|
|
|
}
|
|
|
|
public static void StartListen()
|
|
{
|
|
//LayerStatus.LAYER.Clear();
|
|
//sql.Clear();
|
|
//sql.Append("select * from SHUTTLE_LAYER_STATUS");
|
|
//DataView dv = new DataView();
|
|
//dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
//for (int i = 0; i < dv.Count; i++)
|
|
//{
|
|
// LayerStatus.LAYER.Add(Convert.ToInt32(dv[i]["F_Layer"]), Convert.ToInt32(dv[i]["F_UpdateNo"]));
|
|
//}
|
|
exitThread = false;
|
|
mythread = new Thread(new ThreadStart(BeginListen));
|
|
mythread.IsBackground = true;
|
|
mythread.Start();
|
|
|
|
exitThreadInRequestDeal = false;
|
|
mythreadUpdatestatus = new Thread(new ThreadStart(BeginListenUpdatestatus)); //
|
|
mythreadUpdatestatus.IsBackground = true;
|
|
mythreadUpdatestatus.Start();
|
|
|
|
|
|
|
|
}
|
|
public static void StartListenPLC() {
|
|
exitThreadInAGVPLCAsk = false;
|
|
threadAGVStatusSend = new Thread(new ThreadStart(BeginListenAgvData)); //
|
|
threadAGVStatusSend.IsBackground = true;
|
|
threadAGVStatusSend.Start();
|
|
}
|
|
public static void EndListenPLC()
|
|
{
|
|
exitThreadInAGVPLCAsk = true;
|
|
|
|
if (threadAGVStatusSend != null)
|
|
{
|
|
|
|
threadAGVStatusSend.Abort();
|
|
threadAGVStatusSend = null;
|
|
}
|
|
}
|
|
}
|
|
public class ResultMessage {//通用返回信息类
|
|
public bool sResult { get; set; }
|
|
public string message { get; set; }
|
|
}
|
|
public static class LayerStatus
|
|
{
|
|
public static Dictionary<int, int> LAYER = new Dictionary<int, int>();
|
|
|
|
|
|
}
|
|
#region IOControl
|
|
public class IO_CONTROL
|
|
{
|
|
static DBOperator dbo = CStaticClass.dbo;
|
|
static DBOperator dboMan = CStaticClass.dboM;
|
|
string wms_id;
|
|
int relative_id;
|
|
string barcode;
|
|
string startdevice;
|
|
string enddevice;
|
|
string begintime;
|
|
int control_type;
|
|
string warehouse = "1";
|
|
string tasklevel;
|
|
int needAgv = 0;
|
|
public StringBuilder error_code = new StringBuilder();
|
|
|
|
StringBuilder sql = new StringBuilder();
|
|
|
|
//public IO_CONTROL(CCallService.WMS_WCS_PARAM_IN indata, string time, string level)//入库
|
|
//{
|
|
// error_code.Clear();
|
|
// wms_id = indata.taskId;
|
|
// relative_id = -1;
|
|
// barcode = indata.containerCode;
|
|
// if (indata.taskType == 2 || indata.taskType == 3)
|
|
// { //起点是库位
|
|
// // startdevice = outdata.startRow.ToString("D2") + "-" + outdata.startColumn.ToString("D2") + "-" + outdata.startLayer.ToString("D2");
|
|
// enddevice = indata.endNode;
|
|
// }
|
|
// else if (indata.taskType == 1 || indata.taskType == 4) //终点是库位
|
|
// {
|
|
// startdevice = indata.startNode;
|
|
// enddevice = indata.endRow.ToString("D2") + "-" + indata.endColumn.ToString("D2") + "-" + indata.endLayer.ToString("D2");
|
|
// }
|
|
// control_type = 1;
|
|
// string dTime1 = DateTime.Now.ToString("u");
|
|
// begintime = dTime1.Substring(0, dTime1.Length - 1);
|
|
// tasklevel = level;
|
|
|
|
//}
|
|
public IO_CONTROL(CCallService.InBoundApplyBackData indata, string time) {
|
|
error_code.Clear();
|
|
wms_id = indata.taskId;
|
|
relative_id = -1;
|
|
barcode = indata.containerCode;
|
|
if (indata.taskType == 2 || indata.taskType == 3)
|
|
{ //起点是库位
|
|
// startdevice = outdata.startRow.ToString("D2") + "-" + outdata.startColumn.ToString("D2") + "-" + outdata.startLayer.ToString("D2");
|
|
enddevice = indata.endNode;
|
|
}
|
|
else if (indata.taskType == 1 ) //终点是库位
|
|
{
|
|
startdevice = indata.startNode;
|
|
enddevice = indata.endRow.ToString("D2") + "-" + indata.endColumn.ToString("D2") + "-" + indata.endLayer.ToString("D2");
|
|
}
|
|
control_type = 1;
|
|
string dTime1 = DateTime.Now.ToString("u");
|
|
begintime = dTime1.Substring(0, dTime1.Length - 1);
|
|
tasklevel = "10";
|
|
}
|
|
|
|
public IO_CONTROL(string startStation,string endStation,string Barcode)
|
|
{
|
|
error_code.Clear();
|
|
wms_id = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
relative_id = -1;
|
|
barcode = Barcode;
|
|
startdevice = startStation;
|
|
enddevice = endStation;
|
|
control_type = 99;//标记回退任务,完成后不请求LCS直接删除
|
|
string dTime1 = DateTime.Now.ToString("u");
|
|
begintime = dTime1.Substring(0, dTime1.Length - 1);
|
|
tasklevel = "10";
|
|
}
|
|
|
|
public IO_CONTROL(CCallService.OUT_MOVE_DATA outdata, string time, int controltype, string level)//出库 移库
|
|
{
|
|
error_code.Clear();
|
|
wms_id = outdata.taskId;
|
|
relative_id = -1;
|
|
barcode = outdata.containerCode;
|
|
if (outdata.taskType == 2 || outdata.taskType == 3)
|
|
{ //起点是库位
|
|
startdevice = outdata.startRow.ToString("D2") + "-" + outdata.startColumn.ToString("D2") + "-" + outdata.startLayer.ToString("D2");
|
|
enddevice = outdata.endNode;
|
|
}
|
|
else if (outdata.taskType == 1 || outdata.taskType == 4) //终点是库位
|
|
{
|
|
startdevice = outdata.startNode;
|
|
enddevice = outdata.endRow.ToString("D2") + "-" + outdata.endColumn.ToString("D2") + "-" + outdata.endLayer.ToString("D2");
|
|
}
|
|
control_type = controltype;
|
|
string dTime1 = DateTime.Now.ToString("u");
|
|
begintime = dTime1.Substring(0, dTime1.Length - 1);
|
|
tasklevel = level;
|
|
needAgv = outdata.carryType == 2 ? 1 : 0;
|
|
}
|
|
//检查参数是否正确 需要优化
|
|
bool CheckData()
|
|
{
|
|
Dictionary<string, WEBAPI_CKECKING> all_checking = new Dictionary<string, WEBAPI_CKECKING>();
|
|
|
|
#region 从数据库中读取要检测的SQL
|
|
sql.Clear();
|
|
sql.Append("select * from WEBAPI_CKECKING");
|
|
DataView dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
for (int i = 0; i < dv.Count; i++)
|
|
{
|
|
WEBAPI_CKECKING wac = new WEBAPI_CKECKING();
|
|
|
|
wac.check_id = dv[i]["CKECK_ID"].ToString();
|
|
wac.check_name = dv[i]["CKECK_NAME"].ToString();
|
|
wac.sql = dv[i]["SQL"].ToString();
|
|
wac.des = dv[i]["DESCRIPTION"].ToString();
|
|
|
|
all_checking.Add(wac.check_name, wac);
|
|
}
|
|
#endregion
|
|
|
|
error_code.Clear();
|
|
|
|
#region 检查是否重复,CONTROL_ID, 托盘码重复, 起始货位重复,终止货位重复(结果大于零)
|
|
|
|
sql.Clear();
|
|
sql.Append(string.Format(all_checking["CONTROL_ID_REPEAT"].sql, wms_id));
|
|
if (dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView.Count > 0)
|
|
{
|
|
error_code.Append(";").Append(all_checking["CONTROL_ID_REPEAT"].des); //fid重复
|
|
}
|
|
|
|
//sql.Clear();
|
|
//sql.Append(string.Format(all_checking["BARCODE_REPEAT"].sql, barcode));
|
|
//if (dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView.Count > 0)
|
|
//{
|
|
// error_code.Append(";").Append(all_checking["BARCODE_REPEAT"].des); //托盘条码重复
|
|
//}
|
|
if (string.IsNullOrEmpty(tasklevel))
|
|
{
|
|
error_code.Append(";").Append("任务优先级为空");
|
|
}
|
|
if (string.IsNullOrEmpty(wms_id))
|
|
{
|
|
error_code.Append(";").Append("任务号为空");
|
|
}
|
|
if (string.IsNullOrEmpty(barcode))
|
|
{
|
|
error_code.Append(";").Append("条码为空");
|
|
}
|
|
|
|
if (int.TryParse(this.wms_id, out int controlid) == false)
|
|
{
|
|
error_code.Append(";").Append(all_checking["CONTROL_ID_NOT_NUM"].des); //controlid不为数字
|
|
}
|
|
|
|
|
|
if (control_type == 2)//出库任务
|
|
{
|
|
|
|
sql.Clear();
|
|
sql.Append(string.Format(all_checking["START_CEEE_REPEAT"].sql, startdevice, control_type));
|
|
if (dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView.Count > 0)
|
|
{
|
|
error_code.Append(";").Append(all_checking["START_CEEE_REPEAT"].des); //起始货位重复
|
|
}
|
|
if (this.startdevice.Length != 8)
|
|
{
|
|
error_code.Append(";").Append("起点").Append(all_checking["CELL_LENGTH_ERROR"].des); //起点货位编码长度错误
|
|
}
|
|
sql.Clear();
|
|
sql.Append(string.Format(all_checking["CELL_NOT_EXIST"].sql, startdevice));
|
|
if (dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView.Count == 0)
|
|
{
|
|
error_code.Append(";").Append("起点").Append(all_checking["CELL_NOT_EXIST"].des); //起点货位不存在
|
|
|
|
}
|
|
|
|
int endGate = 0;
|
|
if (int.TryParse(this.enddevice, out endGate) == false)
|
|
{
|
|
error_code.Append(";").Append(all_checking["END_GATE_ERROR"].des); //终点站台不正确,无法转为整数
|
|
}
|
|
|
|
sql.Clear();
|
|
sql.Append(string.Format(all_checking["END_GATE_NOT_EXIST"].sql, enddevice));
|
|
if (dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView.Count == 0)
|
|
{
|
|
error_code.Append(";").Append(all_checking["END_GATE_NOT_EXIST"].des); //终点站台不存在
|
|
}
|
|
|
|
}
|
|
|
|
if (control_type == 1)//入库任务
|
|
{
|
|
sql.Clear();
|
|
sql.Append(string.Format(all_checking["END_CEEE_REPEAT"].sql, enddevice, control_type));
|
|
if (dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView.Count > 0)
|
|
{
|
|
error_code.Append(";").Append(all_checking["END_CEEE_REPEAT"].des); //终点货位重复
|
|
}
|
|
if (this.enddevice.Length != 8)
|
|
{
|
|
error_code.Append(";").Append("终点").Append(all_checking["CELL_LENGTH_ERROR"].des); //终点货位编码长度错误
|
|
}
|
|
|
|
sql.Clear();
|
|
sql.Append(string.Format(all_checking["CELL_NOT_EXIST"].sql, enddevice));
|
|
if (dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView.Count == 0)
|
|
{
|
|
error_code.Append(";").Append("终点").Append(all_checking["CELL_NOT_EXIST"].des); //终点货位不存在
|
|
}
|
|
sql.Clear();
|
|
sql.Append(string.Format(all_checking["START_GATE_NOT_EXIST"].sql, startdevice));
|
|
if (dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView.Count == 0)
|
|
{
|
|
error_code.Append(";").Append(all_checking["START_GATE_NOT_EXIST"].des); //起点站台不存在
|
|
}
|
|
}
|
|
#region 校验代码需优化20250310
|
|
if (control_type == 3) //移库任务
|
|
{
|
|
if (this.startdevice.Length != 8)
|
|
{
|
|
error_code.Append(";").Append("起点").Append(all_checking["CELL_LENGTH_ERROR"].des); //终点货位编码长度错误
|
|
}
|
|
if (this.enddevice.Length != 8)
|
|
{
|
|
error_code.Append(";").Append("终点").Append(all_checking["CELL_LENGTH_ERROR"].des); //终点货位编码长度错误
|
|
}
|
|
|
|
sql.Clear();
|
|
sql.Append(string.Format(all_checking["CELL_NOT_EXIST"].sql, startdevice));
|
|
if (dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView.Count == 0)
|
|
{
|
|
error_code.Append(";").Append("起点").Append(all_checking["CELL_NOT_EXIST"].des); //起点货位不存在
|
|
|
|
}
|
|
sql.Clear();
|
|
sql.Append(string.Format(all_checking["CELL_NOT_EXIST"].sql, enddevice));
|
|
if (dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView.Count == 0)
|
|
{
|
|
error_code.Append(";").Append("终点").Append(all_checking["CELL_NOT_EXIST"].des); //终点货位不存在
|
|
}
|
|
|
|
//移库任务如果不同层,校验不要移
|
|
if (startdevice.Substring(6, 2) != enddevice.Substring(6, 2))
|
|
{
|
|
error_code.Append(";").Append("移库任务起点终点层值不同");
|
|
}
|
|
if (startdevice == enddevice)
|
|
{
|
|
error_code.Append(";").Append("移库任务起点终点相同");
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
//检查托盘码
|
|
|
|
if (error_code.Length == 0)
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
//
|
|
public bool Insert_IOCONTROL()
|
|
{
|
|
if (CheckData() == true)
|
|
{
|
|
try
|
|
{
|
|
sql.Clear();
|
|
sql.Append(string.Format("INSERT INTO IO_CONTROL (CONTROL_ID, RELATIVE_CONTROL_ID, MANAGE_ID, STOCK_BARCODE, CONTROL_TASK_TYPE, CONTROL_TASK_LEVEL," +
|
|
" START_WAREHOUSE_CODE, START_DEVICE_CODE, END_WAREHOUSE_CODE, END_DEVICE_CODE, CONTROL_BEGIN_TIME,CONTROL_STATUS,NeedAgv) " +
|
|
"VALUES( {0},'{1}','{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}',{11})",
|
|
wms_id, -1, 0, barcode, control_type, tasklevel, warehouse, startdevice, warehouse, enddevice, begintime, 0, needAgv));
|
|
dbo.ExceSQL(sql.ToString());
|
|
return true;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
error_code.Append("WCS插入IO_ONTROL表失败!");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
|
|
}
|
|
public class WEBAPI_CKECKING
|
|
{
|
|
public string check_id;
|
|
public string check_name;
|
|
public string sql;
|
|
public string des;
|
|
}
|
|
#endregion
|
|
}
|