Compare commits
15 Commits
beijing_zh
...
ZhuYou_Wcs
Author | SHA1 | Date | |
---|---|---|---|
85be80759a | |||
78b193a52a | |||
43d0c7e249 | |||
d64bd2fcdf | |||
4e4c0dbb59 | |||
261fde99ce | |||
a867e6244c | |||
7bdb8633db | |||
fb0c29fb89 | |||
de246b1cf2 | |||
90ec40a018 | |||
068fe0a148 | |||
48afa11af7 | |||
7f5e4fcc3f | |||
2219cae500 |
148
Common/AgvHelper.cs
Normal file
148
Common/AgvHelper.cs
Normal file
@ -0,0 +1,148 @@
|
||||
using Epost.Model;
|
||||
using NPOI.POIFS.Crypt.Dsig;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.Common
|
||||
{
|
||||
public class AgvHelper
|
||||
{
|
||||
string agvSchedulingTaskUrl = ConfigurationManager.AppSettings["agvSchedulingTaskUrl"];
|
||||
string bindCtnrAndBinUrl = ConfigurationManager.AppSettings["bindCtnrAndBinUrl"];
|
||||
|
||||
HttpHelper http = new HttpHelper();
|
||||
#region 生成任务单
|
||||
public AgvResultModel genAgvSchedulingTask(AgvSchedulingTaskModel model)
|
||||
{
|
||||
|
||||
AgvResultModel resmodel = new AgvResultModel();
|
||||
try
|
||||
{
|
||||
|
||||
string postData = JsonHelper.SerializeObject(model);
|
||||
LogHelper.WriteLogInfo("调用AGV生成任务单接口请求参数" + postData, LogHelper.Log_Type.INFO);
|
||||
string res = http.HttpPost_Old(agvSchedulingTaskUrl, postData);
|
||||
LogHelper.WriteLogInfo("调用AGV生成任务单接口返回" + res, LogHelper.Log_Type.INFO);
|
||||
if (!string.IsNullOrEmpty(res))
|
||||
{
|
||||
resmodel = JsonHelper.DeserializeObject<AgvResultModel>(res);
|
||||
if (resmodel.code == "0")
|
||||
{
|
||||
LogHelper.WriteLogInfo("调用AGV生成任务单接口返回成功", LogHelper.Log_Type.INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
LogHelper.WriteLogInfo("调用AGV生成任务单接口返回失败" + resmodel.message, LogHelper.Log_Type.ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("调用AGV生成任务单接口返回失败", LogHelper.Log_Type.ERROR);
|
||||
}
|
||||
string resinfo = JsonHelper.SerializeObject(resmodel);
|
||||
|
||||
return resmodel;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
resmodel.code = "-1";
|
||||
resmodel.message = ex.ToString();
|
||||
LogHelper.WriteLogInfo("调用AGV生成任务单接口异常" + ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
return resmodel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 取消任务
|
||||
|
||||
public AgvResultModel cancelTask(cancelTaskModel model)
|
||||
{
|
||||
string url = string.Empty;
|
||||
AgvResultModel resmodel = new AgvResultModel();
|
||||
try
|
||||
{
|
||||
string postData = JsonHelper.SerializeObject(model);
|
||||
LogHelper.WriteLogInfo("调用AGV取消任务接口请求参数" + postData, LogHelper.Log_Type.INFO);
|
||||
string res = http.HttpPost_Old(url, postData);
|
||||
LogHelper.WriteLogInfo("调用AGV取消任务接口返回" + res, LogHelper.Log_Type.INFO);
|
||||
if (!string.IsNullOrEmpty(res))
|
||||
{
|
||||
resmodel = JsonHelper.DeserializeObject<AgvResultModel>(res);
|
||||
if (resmodel.code == "0")
|
||||
{
|
||||
LogHelper.WriteLogInfo("调用AGV取消任务接口返回成功", LogHelper.Log_Type.INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
LogHelper.WriteLogInfo("调用AGV取消任务接口返回失败" + resmodel.message, LogHelper.Log_Type.ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("调用AGV取消任务接口返回失败", LogHelper.Log_Type.ERROR);
|
||||
}
|
||||
|
||||
return resmodel;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
resmodel.code = "-1";
|
||||
resmodel.message = ex.ToString();
|
||||
LogHelper.WriteLogInfo("调用AGV取消任务接口异常" + ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
return resmodel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 绑定解绑
|
||||
|
||||
public bindCtnrAndBinResponse bindCtnrAndBin(string agvloc, string type)
|
||||
{
|
||||
bindCtnrAndBinReq reqModel = new bindCtnrAndBinReq();
|
||||
bindCtnrAndBinResponse resmodel = new bindCtnrAndBinResponse();
|
||||
reqModel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
|
||||
reqModel.ctnrTyp = "1";//agv提供
|
||||
reqModel.indBind = "1";
|
||||
reqModel.stgBinCode = agvloc;
|
||||
reqModel.ctnrCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
|
||||
|
||||
string reqstr = JsonHelper.SerializeObject(reqModel);
|
||||
LogHelper.WriteLogInfo("调用AGV绑定解绑接口请求参数" + reqstr, LogHelper.Log_Type.INFO);
|
||||
string resultStr = http.HttpPost_Old(bindCtnrAndBinUrl, reqstr);
|
||||
|
||||
|
||||
LogHelper.WriteLogInfo("调用AGV绑定解绑接口返回" + resultStr, LogHelper.Log_Type.INFO);
|
||||
if (!string.IsNullOrEmpty(resultStr))
|
||||
{
|
||||
resmodel = JsonHelper.DeserializeObject<bindCtnrAndBinResponse>(resultStr);
|
||||
if (resmodel.code == "0")
|
||||
{
|
||||
LogHelper.WriteLogInfo("调用AGV绑定解绑接口成功", LogHelper.Log_Type.INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
LogHelper.WriteLogInfo("调用AGV绑定解绑接口失败" + resmodel.data, LogHelper.Log_Type.ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("调用AGV绑定解绑接口返回失败", LogHelper.Log_Type.ERROR);
|
||||
}
|
||||
return resmodel;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -53,7 +53,7 @@ namespace Epost.Common
|
||||
sb.Append(b.ToString("x2"));
|
||||
}
|
||||
//所有字符转为大写
|
||||
return sb.ToString().ToUpper();
|
||||
return sb.ToString();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -232,6 +232,36 @@ namespace Epost.Common
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region 对字符串进行Base64编码
|
||||
|
||||
/// <summary>
|
||||
/// 对字符串进行Base64编码
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <returns>string</returns>
|
||||
public static string Base64EnCode(string source)
|
||||
{
|
||||
byte[] bytes = UTF8Encoding.UTF8.GetBytes(source);
|
||||
return Convert.ToBase64String(bytes);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 对字符串进行Base64解码
|
||||
|
||||
/// <summary>
|
||||
/// 对字符串进行Base64解码
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <returns>string</returns>
|
||||
public static string Base64Decode(string source)
|
||||
{
|
||||
byte[] bytes = Convert.FromBase64String(source);
|
||||
return UTF8Encoding.UTF8.GetString(bytes);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -106,6 +106,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AgvHelper.cs" />
|
||||
<Compile Include="CacheHelper.cs" />
|
||||
<Compile Include="ConfigurationOperator.cs" />
|
||||
<Compile Include="ConvertHexHelper.cs" />
|
||||
@ -122,6 +123,7 @@
|
||||
<Compile Include="ModelConvertHelper.cs" />
|
||||
<Compile Include="PingHelper.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Time_TaskHelper.cs" />
|
||||
<Compile Include="XmlHelper.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
72
Common/Time_TaskHelper.cs
Normal file
72
Common/Time_TaskHelper.cs
Normal file
@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.Common
|
||||
{
|
||||
public class Time_TaskHelper
|
||||
{
|
||||
public event System.Timers.ElapsedEventHandler ExecuteTask;
|
||||
|
||||
private static readonly Time_TaskHelper _task = null;
|
||||
private System.Timers.Timer _timer = null;
|
||||
//定义时间
|
||||
private int _interval = 1000;
|
||||
public int Interval
|
||||
{
|
||||
set
|
||||
{
|
||||
_interval = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return _interval;
|
||||
}
|
||||
}
|
||||
|
||||
static Time_TaskHelper()
|
||||
{
|
||||
_task = new Time_TaskHelper();
|
||||
}
|
||||
|
||||
public static Time_TaskHelper Instance()
|
||||
{
|
||||
return _task;
|
||||
}
|
||||
|
||||
//开始
|
||||
public void Start()
|
||||
{
|
||||
if (_timer == null)
|
||||
{
|
||||
_timer = new System.Timers.Timer(_interval);
|
||||
_timer.Elapsed += new System.Timers.ElapsedEventHandler(_timer_Elapsed);
|
||||
_timer.Enabled = true;
|
||||
_timer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
protected void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
if (null != ExecuteTask)
|
||||
{
|
||||
ExecuteTask(sender, e);
|
||||
}
|
||||
}
|
||||
|
||||
//停止
|
||||
public void Stop()
|
||||
{
|
||||
if (_timer != null)
|
||||
{
|
||||
_timer.Stop();
|
||||
_timer.Dispose();
|
||||
_timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -146,9 +146,9 @@ namespace Epost.BLL
|
||||
|
||||
#endregion
|
||||
#region 获取控制器列表
|
||||
public DataTable getLabelList(string controlid)
|
||||
public DataTable getLabelList(string controlid,string batchno)
|
||||
{
|
||||
return dal.getLabelList(controlid);
|
||||
return dal.getLabelList(controlid, batchno);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
24
Epost.BLL/AgvLogInfoBLL.cs
Normal file
24
Epost.BLL/AgvLogInfoBLL.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Epost.DAL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.BLL
|
||||
{
|
||||
public class AgvLogInfoBLL
|
||||
{
|
||||
AgvLogInfoDAL dal = new AgvLogInfoDAL();
|
||||
public bool insertAgvLogInfo(string reqCode, string reqTime, string robotCode, string beginDate, string warnContent, string taskCode)
|
||||
{
|
||||
return dal.insertAgvLogInfo(reqCode,reqTime,robotCode,beginDate,warnContent,taskCode);
|
||||
}
|
||||
|
||||
public DataTable getAgvLogList(string strwhere)
|
||||
{
|
||||
return dal.getAgvLogList(strwhere);
|
||||
}
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ namespace Epost.BLL
|
||||
string IP = ConfigurationManager.AppSettings["WebAPIUrl"];
|
||||
|
||||
#region 初始化数据
|
||||
public ResultModel Initialization_M(bool isback = true)
|
||||
public ResultModel Initialization_T(bool isback = true)
|
||||
{
|
||||
ResultModel resultModel = new ResultModel();
|
||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||
@ -60,6 +60,12 @@ namespace Epost.BLL
|
||||
model.Command = "UNLOCK";
|
||||
model.Timeout = "0.5";
|
||||
list.Add(model);
|
||||
model = new LabelParamModel();
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
model.Address = "9999";
|
||||
model.Command = "LED_OFF";
|
||||
model.Timeout = "0.5";
|
||||
list.Add(model);
|
||||
|
||||
}
|
||||
if (list.Any())
|
||||
@ -84,7 +90,7 @@ namespace Epost.BLL
|
||||
#endregion
|
||||
|
||||
#region 设备检测 查询所有标签
|
||||
public ResultModel GetAllLabelList_M()
|
||||
public ResultModel GetAllLabelList_M(string batchno)
|
||||
{
|
||||
ResultModel model = new ResultModel();
|
||||
try
|
||||
@ -96,11 +102,12 @@ namespace Epost.BLL
|
||||
{
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
DataTable lableDt = addrBLL.getLabelList(item["id"].ToString());
|
||||
DataTable lableDt = addrBLL.getLabelList(item["id"].ToString(), batchno);
|
||||
if (lableDt != null && lableDt.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow labelItem in lableDt.Rows)
|
||||
{
|
||||
string shopid = labelItem["address"].ToString();
|
||||
if (labelItem["addresstype"].ToString() == "2")
|
||||
{
|
||||
LabelParamModel CNlablemodel = new LabelParamModel();
|
||||
@ -115,12 +122,20 @@ namespace Epost.BLL
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(labelItem["shopid"].ToString()))
|
||||
{
|
||||
shopid = labelItem["shopid"].ToString();
|
||||
if (shopid.Length > 4)
|
||||
{
|
||||
shopid = shopid.Substring(shopid.Length-4,4);
|
||||
}
|
||||
}
|
||||
LabelParamModel lablemodel = new LabelParamModel();
|
||||
lablemodel.Address = labelItem["address"].ToString();
|
||||
lablemodel.ControlIP = item["ControlIP"].ToString();
|
||||
lablemodel.Command = "DISPLAY_JOB";
|
||||
lablemodel.Type = "N";
|
||||
lablemodel.Quantity = labelItem["address"].ToString();
|
||||
lablemodel.Quantity = shopid;
|
||||
lablemodel.Uid = labelItem["address"].ToString();
|
||||
lablemodel.Mode = "10";
|
||||
list.Add(lablemodel);
|
||||
@ -432,6 +447,7 @@ namespace Epost.BLL
|
||||
LabelParamModel model = new LabelParamModel();
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
FORMATE_JOB_DATA(model);
|
||||
LED_OFF_CLEAR(item["ControlIP"].ToString());
|
||||
|
||||
}
|
||||
|
||||
|
@ -92,6 +92,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AddressstorageBLL.cs" />
|
||||
<Compile Include="AgvLogInfoBLL.cs" />
|
||||
<Compile Include="BoxPickBLL.cs" />
|
||||
<Compile Include="BoxQueueBLL.cs" />
|
||||
<Compile Include="CommandBLL.cs" />
|
||||
@ -99,12 +100,14 @@
|
||||
<Compile Include="EntityBase.cs" />
|
||||
<Compile Include="ErrorLogBLL.cs" />
|
||||
<Compile Include="HistoryXmlBLL.cs" />
|
||||
<Compile Include="InboundOrdersBLL.cs" />
|
||||
<Compile Include="Light.cs" />
|
||||
<Compile Include="LogXmlBLL.cs" />
|
||||
<Compile Include="MenuInfoBLL.cs" />
|
||||
<Compile Include="ModelConvertHelper.cs" />
|
||||
<Compile Include="OrderBLL.cs" />
|
||||
<Compile Include="OrderControlBLL.cs" />
|
||||
<Compile Include="PalletinfoBLL.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RoleInfoBLL.cs" />
|
||||
<Compile Include="ShopBLL.cs" />
|
||||
@ -112,6 +115,7 @@
|
||||
<Compile Include="StorageLocationBLL.cs" />
|
||||
<Compile Include="OrdersQueueBLL.cs" />
|
||||
<Compile Include="StoreBLL.cs" />
|
||||
<Compile Include="Sys_operate_logBLL.cs" />
|
||||
<Compile Include="UserBLL.cs" />
|
||||
<Compile Include="WmsBLL.cs" />
|
||||
<Compile Include="WmsTaskBLL.cs" />
|
||||
|
102
Epost.BLL/InboundOrdersBLL.cs
Normal file
102
Epost.BLL/InboundOrdersBLL.cs
Normal file
@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Epost.DAL;
|
||||
using Epost.Model;
|
||||
namespace Epost.BLL
|
||||
{
|
||||
public class InboundOrdersBLL
|
||||
{
|
||||
InboundOrdersDAL dal = new InboundOrdersDAL();
|
||||
|
||||
#region 分页获取订单表列表
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
public List<InboundOrdersModel> GetOrdersListByPage(string strWhere, string orderby, int pageSize, int pageIndex, out int recordCount)
|
||||
{
|
||||
int startIndex = 0;
|
||||
int endIndex = 0;
|
||||
if (pageIndex <= 0)
|
||||
pageIndex = 1;
|
||||
//计算查询的开始行数与结束行数
|
||||
startIndex = (pageIndex - 1) * pageSize + 1;
|
||||
endIndex = pageIndex * pageSize;
|
||||
return dal.GetOrdersListByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 查询订单是否已存在
|
||||
public DataTable GetOrdersList(string wmsDocNo)
|
||||
{
|
||||
return dal.GetOrdersList(wmsDocNo);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 查询订单信息
|
||||
public DataTable GetInOrderList(string strwhere)
|
||||
{
|
||||
return dal.GetInOrderList(strwhere);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询订单信息
|
||||
public DataTable GetV_InOrders(string strwhere)
|
||||
{
|
||||
return dal.GetV_InOrders(strwhere);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询坐标信息
|
||||
public string GetLocation(string strwhere,out string type1)
|
||||
{
|
||||
DataTable dt= dal.GetLocation(strwhere);
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
type1 = dt.Rows[0]["type"].ToString();
|
||||
return dt.Rows[0]["agvloc"].ToString();
|
||||
}
|
||||
else {
|
||||
type1 ="";
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region 添加订单
|
||||
public bool InsertOrder(DataTable dt, Dictionary<string, string> diclist)
|
||||
{
|
||||
return dal.InsertOrders(dt, diclist);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 更新订单状态
|
||||
public bool UpInOrderList(string id, string state,string data="")
|
||||
{
|
||||
|
||||
return dal.UpInOrderList(id,state,data);
|
||||
}
|
||||
|
||||
public bool UpInOrder(string id, string errormsg)
|
||||
{
|
||||
|
||||
return dal.UpInOrder(id, errormsg);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 根据agv单号更新订单状态
|
||||
public bool UpInOrderListByAgvid(string agvid, string state)
|
||||
{
|
||||
|
||||
return dal.UpInOrderListByAgvid(agvid, state);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -707,7 +707,7 @@ namespace Epost.BLL
|
||||
demodel.BatchId = item["BatchId"].ToString();
|
||||
demodel.ID = item["ID"].ToString();
|
||||
demodel.GoodsName = item["GoodsName"].ToString();
|
||||
demodel.GoodsType = item["GoodsType"].ToString();
|
||||
|
||||
demodel.Quantity = Convert.ToInt32(item["Quantity"].ToString());
|
||||
demodel.CheckQuantity = Convert.ToInt32(item["CheckQuantity"].ToString());
|
||||
demodel.Sku = item["Sku"].ToString();
|
||||
@ -715,13 +715,13 @@ namespace Epost.BLL
|
||||
demodel.Matchid = item["Matchid"].ToString();
|
||||
demodel.ShopID = item["shopid"].ToString();
|
||||
demodel.BoxCode = item["boxcode"].ToString();
|
||||
demodel.LotNo = item["LotNo"].ToString();
|
||||
|
||||
demodel.Discount = item["Discount"].ToString();
|
||||
demodel.ProdArea = item["ProdArea"].ToString();
|
||||
|
||||
demodel.ColorCode = item["corlorcode"].ToString();
|
||||
demodel.WholeUnit = item["WholeUnit"].ToString();
|
||||
demodel.Unit = item["Unit"].ToString();
|
||||
demodel.TrayCode = item["bkbarcode"].ToString();
|
||||
|
||||
#region 获取库位信息
|
||||
demodel.Block = item["Block"].ToString();
|
||||
demodel.Area = item["Area"].ToString();
|
||||
|
@ -48,7 +48,7 @@ namespace Epost.BLL
|
||||
orderbll.UpOrderstate();
|
||||
UserCacheDAL.ClearUserCodeList();
|
||||
boxcache.ClearBoxList();
|
||||
ResultModel resultModel = comBLL.Initialization_M();
|
||||
ResultModel resultModel = comBLL.Initialization_T();
|
||||
// GetOrderQueue(); //加载任务显示器信息
|
||||
|
||||
return resultModel;
|
||||
@ -73,19 +73,18 @@ namespace Epost.BLL
|
||||
{
|
||||
OrisShow = true;
|
||||
workbll.UpdateWorkModel(WorkEcommendType.Create);
|
||||
//【多少个大区多少个线程】
|
||||
List<AddressstorageModel> Arealist = addrBLL.GetshelfidList();
|
||||
if (Arealist.Any())
|
||||
{
|
||||
////【多少个大区多少个线程】
|
||||
//List<AddressstorageModel> Arealist = addrBLL.GetshelfidList();
|
||||
//if (Arealist.Any())
|
||||
//{
|
||||
Work_JobDownThread downthread = new Work_JobDownThread();
|
||||
downthread.tblock = "01|01";
|
||||
Work_DisplayJobThread jobthread = new Work_DisplayJobThread();
|
||||
jobthread.tblock = "01|01";
|
||||
Work_ScanThread scantherad = new Work_ScanThread();
|
||||
scantherad.tblock = "01|01";
|
||||
foreach (AddressstorageModel item in Arealist)
|
||||
{
|
||||
string block = item.block + "|" + item.shelfid;
|
||||
|
||||
//foreach (AddressstorageModel item in Arealist)
|
||||
//{
|
||||
string block = "01|01";
|
||||
jobthread = new Work_DisplayJobThread();
|
||||
jobthread.id = block;
|
||||
jobthread.tblock = block;
|
||||
@ -101,15 +100,10 @@ namespace Epost.BLL
|
||||
Thread thread = new Thread(new ThreadStart(downthread.Work));
|
||||
thread.Start();
|
||||
|
||||
scantherad = new Work_ScanThread();
|
||||
scantherad.id = block;
|
||||
scantherad.tblock = block;
|
||||
scantherad.OrisShow = OrisShow;
|
||||
Thread scanthread = new Thread(new ThreadStart(scantherad.ScanList));
|
||||
scanthread.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
@ -119,10 +113,10 @@ namespace Epost.BLL
|
||||
|
||||
|
||||
#region 设备检测
|
||||
public ResultModel TestStart()
|
||||
public ResultModel TestStart(string batchno)
|
||||
{
|
||||
|
||||
ResultModel result = comBLL.GetAllLabelList_M();
|
||||
ResultModel result = comBLL.GetAllLabelList_M(batchno);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
40
Epost.BLL/PalletinfoBLL.cs
Normal file
40
Epost.BLL/PalletinfoBLL.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using Epost.DAL;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.BLL
|
||||
{
|
||||
public class PalletinfoBLL
|
||||
{
|
||||
|
||||
PalletinfoDAL dal = new PalletinfoDAL();
|
||||
#region 分页获取订单表列表
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
public List<PalletinfoModel> GetPalletListByPage(string strWhere, string orderby, int pageSize, int pageIndex, out int recordCount)
|
||||
{
|
||||
int startIndex = 0;
|
||||
int endIndex = 0;
|
||||
if (pageIndex <= 0)
|
||||
pageIndex = 1;
|
||||
//计算查询的开始行数与结束行数
|
||||
startIndex = (pageIndex - 1) * pageSize + 1;
|
||||
endIndex = pageIndex * pageSize;
|
||||
return dal.GetPalletListByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加订单
|
||||
public bool InsertPallet(DataTable dt, Dictionary<string, string> diclist)
|
||||
{
|
||||
return dal.InsertPallet(dt, diclist);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -14,26 +14,26 @@ namespace Epost.BLL
|
||||
WmsTaskBLL taskbll = new WmsTaskBLL();
|
||||
public DataTable GetSkuInfoList(string sku)
|
||||
{
|
||||
if (sku.Substring(0, 1) == "2")
|
||||
{
|
||||
if (sku.Substring(1, 1) == "5")
|
||||
{
|
||||
if (sku.Length >= 7)
|
||||
{
|
||||
sku = sku.Substring(2, 6);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (sku.Length >= 7)
|
||||
{
|
||||
sku = sku.Substring(1, 6);
|
||||
}
|
||||
}
|
||||
return dal.GetSkuInfo(sku);
|
||||
}
|
||||
else {
|
||||
//if (sku.Substring(0, 1) == "2")
|
||||
//{
|
||||
// if (sku.Substring(1, 1) == "5")
|
||||
// {
|
||||
// if (sku.Length >= 7)
|
||||
// {
|
||||
// sku = sku.Substring(2, 6);
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// if (sku.Length >= 7)
|
||||
// {
|
||||
// sku = sku.Substring(1, 6);
|
||||
// }
|
||||
// }
|
||||
// return dal.GetSkuInfo(sku);
|
||||
//}
|
||||
//else {
|
||||
return dal.GetSkuInfoList(sku);
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
62
Epost.BLL/Sys_operate_logBLL.cs
Normal file
62
Epost.BLL/Sys_operate_logBLL.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using Epost.DAL;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.BLL
|
||||
{
|
||||
public class Sys_operate_logBLL
|
||||
{
|
||||
|
||||
|
||||
Sys_operate_logDAL dal = new Sys_operate_logDAL();
|
||||
|
||||
#region 分页获取订单表列表
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
public List<Sys_operate_logModel> GetLogListByPage(string strWhere, string orderby, int pageSize, int pageIndex, out int recordCount)
|
||||
{
|
||||
int startIndex = 0;
|
||||
int endIndex = 0;
|
||||
if (pageIndex <= 0)
|
||||
pageIndex = 1;
|
||||
//计算查询的开始行数与结束行数
|
||||
startIndex = (pageIndex - 1) * pageSize + 1;
|
||||
endIndex = pageIndex * pageSize;
|
||||
return dal.GetLogListByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取日志列表
|
||||
public List<Sys_operate_logModel> GetLogDetail(int mid)
|
||||
{
|
||||
return dal.GetLogDetail(mid);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region 添加日志
|
||||
public bool InsertLog(string title, string method, string operate_url, string operate_param, string json_result, int status, string error_msg, DateTime addtime)
|
||||
{
|
||||
Sys_operate_logModel logmodel = new Sys_operate_logModel();
|
||||
logmodel.title = title;
|
||||
logmodel.method = method;
|
||||
logmodel.operate_url = operate_url;
|
||||
logmodel.operate_param = operate_param;
|
||||
logmodel.json_result = json_result;
|
||||
logmodel.status = status;
|
||||
logmodel.error_msg = error_msg;
|
||||
logmodel.addtime = addtime;
|
||||
return dal.InsertLogDetail(logmodel);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ using Epost.DAL.Enum;
|
||||
using Epost.Model;
|
||||
using Epost.Model.resource;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
@ -75,170 +76,33 @@ namespace Epost.BLL
|
||||
public void DisplayJob_M(string tblock)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
string[] nlist = tblock.Split('|');
|
||||
string nblock = nlist[0];
|
||||
string shelfid = nlist[1];
|
||||
List<AddressstorageModel> Arealist = addrBLL.GetAreaList(nblock, shelfid);
|
||||
foreach (AddressstorageModel item in Arealist)
|
||||
{
|
||||
OrdersQueueModel model = new OrdersQueueModel(); ;
|
||||
model.Taskarea = item.area;
|
||||
model.Taskblock = nblock;
|
||||
#region 开始作业
|
||||
DataTable queueDT = queueBLL.getQueueOrderState(model);
|
||||
if (queueDT != null && queueDT.Rows.Count > 0)
|
||||
{
|
||||
//当前区没有作业
|
||||
if (queueDT.Rows[0]["state"].ToString() == "0")
|
||||
{
|
||||
#region 点亮显示器
|
||||
ShowMessageModel_M showmodel = new ShowMessageModel_M();
|
||||
showmodel.Area = shelfid;
|
||||
showmodel.Block = nblock;
|
||||
showmodel.Color = queueDT.Rows[0]["lightcolor"].ToString();//EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
||||
showmodel.Contents = queueDT.Rows[0]["sku"].ToString();
|
||||
showmodel.Title = queueDT.Rows[0]["Shopid"].ToString();
|
||||
showmodel.Islock = true;
|
||||
|
||||
showmodel.IsTwinkle = 0;
|
||||
showmodel.Type = 8;
|
||||
DataTable sudt = orderbll.GetSumList("", queueDT.Rows[0]["sku"].ToString(), nblock);
|
||||
if (sudt != null && sudt.Rows.Count > 0)
|
||||
{
|
||||
showmodel.Qty = sudt.Rows[0]["SumQuantity"].ToString();
|
||||
}
|
||||
comBLL.ShowBoxMessage_M(showmodel);//点亮显示标签
|
||||
#endregion
|
||||
displayOrder(queueDT, nblock, item.area, model);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("标签控制异常:" + ex.Message);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 点亮设备
|
||||
public void displayOrder(DataTable queueDT, string nblock, string narea, OrdersQueueModel model)
|
||||
{
|
||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||
model.Id = Convert.ToInt32(queueDT.Rows[0]["id"].ToString());
|
||||
#region 点亮任务
|
||||
List<JobModel> jobList = JobCache.GetPlanJobList();
|
||||
List<JobModel> isJobList = jobList.FindAll(p => p.Block == nblock && p.Area == narea && p.State != 3);
|
||||
ShowMessageModel showmodel = new ShowMessageModel();
|
||||
//获取当前区任务并加入缓存
|
||||
if (!isJobList.Any())
|
||||
try
|
||||
{
|
||||
model.State = 1;
|
||||
orderbll.GetOrderList(queueDT.Rows[0]["matchid"].ToString(), nblock, queueDT.Rows[0]["sku"].ToString(), narea, queueDT.Rows[0]["usercode"].ToString());
|
||||
List<JobModel> nowJoblist = jobList.FindAll(p => p.State == 0 && p.Block == model.Taskblock && p.Area == model.Taskarea);
|
||||
if (nowJoblist.Any())
|
||||
{
|
||||
var nowmodel = nowJoblist.FirstOrDefault();
|
||||
|
||||
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====sku==" + nowmodel.Sku + "========");
|
||||
#region 点亮任务标签
|
||||
foreach (JobModel item in nowJoblist.ToArray())
|
||||
{
|
||||
|
||||
#region 回显设备锁定
|
||||
if (queueDT.Rows[0]["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue))
|
||||
{
|
||||
#region 开始作业
|
||||
//查询是否有空闲的agv
|
||||
//查询待执行的任务
|
||||
//更新任务状态为执行中
|
||||
|
||||
LabelParamModel locklamodel = new LabelParamModel();
|
||||
locklamodel.Address = item.Address.ToString();
|
||||
locklamodel.ControlIP = item.ControlIP.ToString();
|
||||
locklamodel.Command = "LOCK";
|
||||
locklamodel.Parameter = "11111000";
|
||||
locklamodel.Type = "N";
|
||||
list.Add(locklamodel);
|
||||
|
||||
}
|
||||
#endregion
|
||||
// else
|
||||
//{
|
||||
|
||||
List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
||||
int quantity = item.Quantity;
|
||||
LabelParamModel lamodel = new LabelParamModel();
|
||||
lamodel.Address = item.Address.ToString();
|
||||
lamodel.ControlIP = item.ControlIP.ToString();
|
||||
lamodel.Command = "DISPLAY_JOB";
|
||||
#region 同一个货位的数据合并显示
|
||||
//if (manyJoblist.Count > 1)
|
||||
//{
|
||||
// if (manyJoblist.FindAll(m => m.State == 0).Any())
|
||||
// {
|
||||
// foreach (JobModel mitem in manyJoblist)
|
||||
// {
|
||||
// quantity += mitem.Quantity;
|
||||
// mitem.State = 1;
|
||||
// mitem.ManyState = 1;
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
||||
#endregion
|
||||
lamodel.Type = "N";
|
||||
lamodel.Quantity = quantity.ToString();
|
||||
lamodel.Uid = "U" + item.ID;
|
||||
lamodel.Mode = queueDT.Rows[0]["lightcolor"].ToString() + "0";
|
||||
list.Add(lamodel);
|
||||
//}
|
||||
item.State = 1;
|
||||
item.ColorCode = queueDT.Rows[0]["lightcolor"].ToString();
|
||||
item.DisplayTime = DateTime.Now;
|
||||
}
|
||||
#endregion
|
||||
#region 点亮通道灯
|
||||
comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
||||
#endregion
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo("添加到点亮的list————————:" + list.Count);
|
||||
comBLL.DISPLAY_JOBALL(list);
|
||||
}
|
||||
}
|
||||
else
|
||||
{//无任务
|
||||
LogHelper.WriteLogInfo("点亮====无任务=======================");
|
||||
model.State = 3;
|
||||
}
|
||||
#endregion
|
||||
if (jobList.Any())
|
||||
{
|
||||
|
||||
var finishList = jobList.FindAll(p => p.State == 0);
|
||||
if (!finishList.Any())
|
||||
{
|
||||
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("标签控制异常:" + ex.Message);
|
||||
|
||||
LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
|
||||
foreach (JobModel item in isJobList)
|
||||
{
|
||||
LogHelper.WriteLogInfo("还有未完成任务" + item.Address + item.ID);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -267,7 +267,7 @@ namespace Epost.BLL
|
||||
|
||||
|
||||
ShowMessageModel_M show = new ShowMessageModel_M();
|
||||
show.Title = skudt.Rows[0]["sku_goodsname"].ToString();
|
||||
show.Title = skudt.Rows[0]["goodsname"].ToString();
|
||||
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
||||
show.Block = data.Block;
|
||||
show.Islock = true;
|
||||
|
@ -133,6 +133,16 @@ namespace Epost.DAL
|
||||
return dt;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询控制器下所有标签地址
|
||||
public DataTable getLabelList(string controlid,string batchno)
|
||||
{
|
||||
string sql = string.Format(" select distinct address, state, type, ControlID,addresstype,isnull(shopid,'') as shopid,name,batchno from v_storeaddress where type in (1, 2, 8) and Controlid = '{0}' and batchno='{1}' ",
|
||||
controlid,batchno);
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
#endregion
|
||||
#region 根据区域 查询显示箱号地址
|
||||
public DataTable getAddressByBlock(string block)
|
||||
{
|
||||
|
31
Epost.DAL/AgvLogInfoDAL.cs
Normal file
31
Epost.DAL/AgvLogInfoDAL.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL
|
||||
{
|
||||
|
||||
public class AgvLogInfoDAL
|
||||
{
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
public bool insertAgvLogInfo(string reqCode, string reqTime, string robotCode, string beginDate, string warnContent, string taskCode)
|
||||
{
|
||||
string sql = string.Format("insert into agvLogInfo(reqCode ,reqTime,robotCode,beginDate,warnContent,taskCode,addtime) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')",
|
||||
reqCode,reqTime,robotCode,beginDate,warnContent,
|
||||
taskCode,DateTime.Now.ToString());
|
||||
long x =db.InsertSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public DataTable getAgvLogList(string strwhere)
|
||||
{
|
||||
string sql = string.Format("select * from agvLogInfo where 1=1 "+strwhere);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
}
|
||||
}
|
@ -99,6 +99,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AddressstorageDAL.cs" />
|
||||
<Compile Include="AgvLogInfoDAL.cs" />
|
||||
<Compile Include="BoxPickDAL.cs" />
|
||||
<Compile Include="BoxQueueDAL.cs" />
|
||||
<Compile Include="Cache\BoxCodeCacheDAL.cs" />
|
||||
@ -127,9 +128,11 @@
|
||||
<Compile Include="Enum\SqlLogType.cs" />
|
||||
<Compile Include="ErrorLogDAL.cs" />
|
||||
<Compile Include="HistoryDataDAL.cs" />
|
||||
<Compile Include="InboundOrdersDAL.cs" />
|
||||
<Compile Include="MenuInfoDAL.cs" />
|
||||
<Compile Include="OrcaleDB.cs" />
|
||||
<Compile Include="OrdersDAL.cs" />
|
||||
<Compile Include="PalletinfoDAL.cs" />
|
||||
<Compile Include="PressureTestDAL.cs" />
|
||||
<Compile Include="Properties\Class1.cs" />
|
||||
<Compile Include="ControlDAL.cs" />
|
||||
@ -140,6 +143,7 @@
|
||||
<Compile Include="RoleInfoDAL.cs" />
|
||||
<Compile Include="SkuInfoDAL.cs" />
|
||||
<Compile Include="StoreDAL.cs" />
|
||||
<Compile Include="Sys_operate_logDAL.cs" />
|
||||
<Compile Include="UserDAL.cs" />
|
||||
<Compile Include="WmsDAL.cs" />
|
||||
<Compile Include="WmsDB.cs" />
|
||||
|
149
Epost.DAL/InboundOrdersDAL.cs
Normal file
149
Epost.DAL/InboundOrdersDAL.cs
Normal file
@ -0,0 +1,149 @@
|
||||
using Epost.Common;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL
|
||||
{
|
||||
|
||||
public class InboundOrdersDAL
|
||||
{
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
#region 分页获取订单表列表
|
||||
|
||||
public List<InboundOrdersModel> GetOrdersListByPage(string strWhere, string orderby, int startIndex, int endIndex, out int recordCount)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("SELECT * FROM ( ");
|
||||
strSql.Append(" SELECT ROW_NUMBER() OVER (");
|
||||
if (!string.IsNullOrEmpty(orderby.Trim()))
|
||||
{
|
||||
strSql.Append("order by T." + orderby);
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql.Append("order by id desc");
|
||||
}
|
||||
strSql.Append(")AS Row, T.* from inboundorders T WITH(NOLOCK) ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.Append(" WHERE 1=1 " + strWhere);
|
||||
}
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
List<InboundOrdersModel> list = ModelConvertHelper<InboundOrdersModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
|
||||
strSql.Remove(0, strSql.Length);
|
||||
strSql.Append("SELECT COUNT(*) FROM inboundorders AS T ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.AppendFormat(" WHERE 1=1 {0}", strWhere);
|
||||
}
|
||||
|
||||
object obj = db.GetsqlForDT(strSql.ToString()).Rows[0][0];
|
||||
if (obj != null)
|
||||
recordCount = Convert.ToInt32(obj);
|
||||
else
|
||||
recordCount = 0;
|
||||
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLog(GetType(), ex.Message);
|
||||
recordCount = 0;
|
||||
return new List<InboundOrdersModel>();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region 查询订单是否已存在
|
||||
public DataTable GetOrdersList(string wmsDocNo)
|
||||
{
|
||||
string sql = string.Format("select top 1 * from InboundOrders where wmsDocNo = '{0}'",
|
||||
wmsDocNo);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加订单
|
||||
public bool InsertOrders(DataTable dt, Dictionary<string, string> diclist)
|
||||
{
|
||||
return db.UpdateData(dt, "InboundOrders", diclist);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询订单信息
|
||||
public DataTable GetInOrderList(string strwhere)
|
||||
{
|
||||
string sql = string.Format("select * from InboundOrders where 1=1 "+strwhere);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询订单信息
|
||||
public DataTable GetV_InOrders(string strwhere)
|
||||
{
|
||||
string sql = string.Format("select * from v_InboundOrders where 1=1 " + strwhere);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
#region 查询坐标信息
|
||||
public DataTable GetLocation(string strwhere)
|
||||
{
|
||||
string sql = string.Format("select * from locationInfo where 1=1 " + strwhere);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
#region 更新订单状态
|
||||
public bool UpInOrderList(string id,string state,string data)
|
||||
{
|
||||
string upstr = string.Empty;
|
||||
if (!string.IsNullOrEmpty(data))
|
||||
{
|
||||
upstr = ",agvmsg='',agvid='" + data+"'";
|
||||
}
|
||||
string sql = string.Format("update InboundOrders set state ='{0}'"+ upstr + " where id ='{1}'",
|
||||
state,id);
|
||||
long x= db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 更新订单状态
|
||||
public bool UpInOrder(string id,string errormsg)
|
||||
{
|
||||
|
||||
string sql = string.Format("update InboundOrders set agvmsg='{0}' where id ='{1}'",
|
||||
errormsg, id);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据agv单号更新订单状态
|
||||
public bool UpInOrderListByAgvid(string agvid, string state)
|
||||
{
|
||||
|
||||
string sql = string.Format("update InboundOrders set state ='{0}' where agvid = '{1}'",
|
||||
state, agvid);
|
||||
long x = db.UpdateSql(sql);
|
||||
LogHelper.WriteLogInfo(x+"更新agv状态"+sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -48,7 +48,7 @@ namespace Epost.DAL
|
||||
string sql = string.Empty;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
sql = string.Format("select id, ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP,area, block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ",
|
||||
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP,area, block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode,shopname from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ",
|
||||
|
||||
sku,
|
||||
block, area);
|
||||
@ -56,7 +56,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = string.Format("select id,ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP, area , block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ",
|
||||
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP, area , block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode ,shopname from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ",
|
||||
|
||||
sku,
|
||||
block);
|
||||
@ -90,7 +90,7 @@ namespace Epost.DAL
|
||||
string sql = string.Empty;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
sql = string.Format("select id,ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP,area, block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ",
|
||||
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP,area, block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ",
|
||||
|
||||
sku,
|
||||
block, area);
|
||||
@ -98,7 +98,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = string.Format("select id,ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP, area , block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ",
|
||||
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP, area , block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ",
|
||||
|
||||
sku,
|
||||
block);
|
||||
@ -106,7 +106,7 @@ namespace Epost.DAL
|
||||
}
|
||||
|
||||
|
||||
LogHelper.WriteLogInfo("获取订单信息location-" + sql);
|
||||
LogHelper.WriteLogInfo("获取回显订单信息location-" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -158,7 +158,7 @@ namespace Epost.DAL
|
||||
strwhere += " and matchid = '" + matchid + "'";
|
||||
}
|
||||
|
||||
string sql = string.Format("select sum(Quantity) as SumQuantity, Sum(checkquantity) as SumCkQuantity,boxweight, Discount,unit,wholeunit,matchid ,goodscode,goodsname from v_orders where sku='{0}' and block='{1}' " + strwhere + " group by sku,boxweight, Discount,goodsname,unit,wholeunit,matchid ,goodscode",
|
||||
string sql = string.Format("select sum(Quantity) as SumQuantity, Sum(checkquantity) as SumCkQuantity, Discount,unit,wholeunit,matchid ,goodscode,goodsname from v_orders where sku='{0}' and block='{1}' " + strwhere + " group by sku, Discount,goodsname,unit,wholeunit,matchid ,goodscode",
|
||||
sku,
|
||||
block);
|
||||
LogHelper.WriteLogInfo("获取订单信息-中分" + sql);
|
||||
|
76
Epost.DAL/PalletinfoDAL.cs
Normal file
76
Epost.DAL/PalletinfoDAL.cs
Normal file
@ -0,0 +1,76 @@
|
||||
using Epost.Common;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL
|
||||
{
|
||||
public class PalletinfoDAL
|
||||
{
|
||||
|
||||
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
#region 分页获取订单表列表
|
||||
|
||||
public List<PalletinfoModel> GetPalletListByPage(string strWhere, string orderby, int startIndex, int endIndex, out int recordCount)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("SELECT * FROM ( ");
|
||||
strSql.Append(" SELECT ROW_NUMBER() OVER (");
|
||||
if (!string.IsNullOrEmpty(orderby.Trim()))
|
||||
{
|
||||
strSql.Append("order by T." + orderby);
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql.Append("order by id desc");
|
||||
}
|
||||
strSql.Append(")AS Row, T.* from Palletinfo T WITH(NOLOCK) ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.Append(" WHERE 1=1 " + strWhere);
|
||||
}
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
List<PalletinfoModel> list = ModelConvertHelper<PalletinfoModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
|
||||
strSql.Remove(0, strSql.Length);
|
||||
strSql.Append("SELECT COUNT(*) FROM Palletinfo AS T ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.AppendFormat(" WHERE 1=1 {0}", strWhere);
|
||||
}
|
||||
|
||||
object obj = db.GetsqlForDT(strSql.ToString()).Rows[0][0];
|
||||
if (obj != null)
|
||||
recordCount = Convert.ToInt32(obj);
|
||||
else
|
||||
recordCount = 0;
|
||||
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLog(GetType(), ex.Message);
|
||||
recordCount = 0;
|
||||
return new List<PalletinfoModel>();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加订单
|
||||
public bool InsertPallet(DataTable dt, Dictionary<string, string> diclist)
|
||||
{
|
||||
return db.UpdateData(dt, "Palletinfo", diclist);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
104
Epost.DAL/Sys_operate_logDAL.cs
Normal file
104
Epost.DAL/Sys_operate_logDAL.cs
Normal file
@ -0,0 +1,104 @@
|
||||
using Epost.Common;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL
|
||||
{
|
||||
public class Sys_operate_logDAL
|
||||
{
|
||||
|
||||
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
#region 分页获取日志列表
|
||||
|
||||
public List<Sys_operate_logModel> GetLogListByPage(string strWhere, string orderby, int startIndex, int endIndex, out int recordCount)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("SELECT * FROM ( ");
|
||||
strSql.Append(" SELECT ROW_NUMBER() OVER (");
|
||||
if (!string.IsNullOrEmpty(orderby.Trim()))
|
||||
{
|
||||
strSql.Append("order by T." + orderby);
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql.Append("order by id desc");
|
||||
}
|
||||
strSql.Append(")AS Row, T.* from Sys_operate_log T WITH(NOLOCK) ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.Append(" WHERE 1=1 " + strWhere);
|
||||
}
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
List<Sys_operate_logModel> list = ModelConvertHelper<Sys_operate_logModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
|
||||
strSql.Remove(0, strSql.Length);
|
||||
strSql.Append("SELECT COUNT(*) FROM Sys_operate_log AS T ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.AppendFormat(" WHERE 1=1 {0}", strWhere);
|
||||
}
|
||||
|
||||
object obj = db.GetsqlForDT(strSql.ToString()).Rows[0][0];
|
||||
if (obj != null)
|
||||
recordCount = Convert.ToInt32(obj);
|
||||
else
|
||||
recordCount = 0;
|
||||
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLog(GetType(), ex.Message);
|
||||
recordCount = 0;
|
||||
return new List<Sys_operate_logModel>();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取日志明细
|
||||
|
||||
public List<Sys_operate_logModel> GetLogDetail(int mid)
|
||||
{
|
||||
string sql = string.Format("select * from Sys_operate_log where ID='" + mid + "'");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return ModelConvertHelper<Sys_operate_logModel>.ConvertToList(dt);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 添加日志
|
||||
public bool InsertLogDetail(Sys_operate_logModel model)
|
||||
{
|
||||
string sql = string.Format("insert into Sys_operate_log([title],[method],[operate_url],[operate_param],[json_result],[status],[error_msg],[addtime]) " +
|
||||
"values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}' )",
|
||||
model.title, model.method, model.operate_url, model.operate_param, model.json_result, model.status, model.error_msg, model.addtime);
|
||||
long x = db.UpdateSql(sql);
|
||||
|
||||
if (x > 0)
|
||||
{
|
||||
return true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("添加日志失败" + sql);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
174
Epost.Model/AgvReqModel.cs
Normal file
174
Epost.Model/AgvReqModel.cs
Normal file
@ -0,0 +1,174 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.Model
|
||||
{
|
||||
|
||||
|
||||
#region 生成任务单
|
||||
public class AgvSchedulingTaskModel
|
||||
{
|
||||
public string reqCode { get; set; }
|
||||
public string reqTime { get; set; }
|
||||
public string clientCode { get; set; }
|
||||
public string tokenCode { get; set; }
|
||||
public string taskTyp { get; set; }
|
||||
public string ctnrTyp { get; set; }
|
||||
public string ctnrCode { get; set; }
|
||||
public string ctnrNum { get; set; }
|
||||
public string taskMode { get; set; }
|
||||
public string wbCode { get; set; }
|
||||
public List<Positioncodepath> positionCodePath { get; set; }
|
||||
public string podCode { get; set; }
|
||||
public string podDir { get; set; }
|
||||
public string podTyp { get; set; }
|
||||
public string materialLot { get; set; }
|
||||
public string materialType { get; set; }
|
||||
public string priority { get; set; }
|
||||
public string agvCode { get; set; }
|
||||
public string taskCode { get; set; }
|
||||
public string groupId { get; set; }
|
||||
public string agvTyp { get; set; }
|
||||
public string positionSelStrategy { get; set; }
|
||||
public string data { get; set; }
|
||||
}
|
||||
|
||||
public class Positioncodepath
|
||||
{
|
||||
public string positionCode { get; set; }
|
||||
public string type { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class AgvResultModel
|
||||
{
|
||||
public string code { get; set; }
|
||||
public string data { get; set; }
|
||||
public string message { get; set; }
|
||||
public string reqCode { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 取消任务
|
||||
|
||||
public class cancelTaskModel
|
||||
{
|
||||
public string reqCode { get; set; }
|
||||
public string reqTime { get; set; }
|
||||
public string clientCode { get; set; }
|
||||
public string tokenCode { get; set; }
|
||||
public string forceCancel { get; set; }
|
||||
public string matterArea { get; set; }
|
||||
public string agvCode { get; set; }
|
||||
public string taskCode { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 任务执行通知
|
||||
|
||||
|
||||
public class agvCallbackModel
|
||||
{
|
||||
public string action { get; set; }
|
||||
public string areaCode { get; set; }
|
||||
public string berthCode { get; set; }
|
||||
public string callCode { get; set; }
|
||||
public string callTyp { get; set; }
|
||||
public string clientCode { get; set; }
|
||||
public float cooX { get; set; }
|
||||
public float cooY { get; set; }
|
||||
public string ctnrCode { get; set; }
|
||||
public string ctnrTyp { get; set; }
|
||||
public string currentCallCode { get; set; }
|
||||
public string currentPositionCode { get; set; }
|
||||
public Data data { get; set; }
|
||||
public string dstBinCode { get; set; }
|
||||
public string eqpCode { get; set; }
|
||||
public string indBind { get; set; }
|
||||
public string layer { get; set; }
|
||||
public string mapCode { get; set; }
|
||||
public string mapDataCode { get; set; }
|
||||
public string mapShortName { get; set; }
|
||||
public string materialLot { get; set; }
|
||||
public string materialType { get; set; }
|
||||
public string method { get; set; }
|
||||
public string orgCode { get; set; }
|
||||
public string podCode { get; set; }
|
||||
public string podDir { get; set; }
|
||||
public string podNum { get; set; }
|
||||
public string podTyp { get; set; }
|
||||
public string relatedArea { get; set; }
|
||||
public string reqCode { get; set; }
|
||||
public string reqTime { get; set; }
|
||||
public string roadWayCode { get; set; }
|
||||
public string robotCode { get; set; }
|
||||
public string seq { get; set; }
|
||||
public string stgBinCode { get; set; }
|
||||
public string subTaskNum { get; set; }
|
||||
public string taskCode { get; set; }
|
||||
public string taskTyp { get; set; }
|
||||
public string tokenCode { get; set; }
|
||||
public string username { get; set; }
|
||||
public string wbCode { get; set; }
|
||||
public string whCode { get; set; }
|
||||
}
|
||||
|
||||
public class Data
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 绑定解绑
|
||||
|
||||
public class bindCtnrAndBinReq
|
||||
{
|
||||
public string reqCode { get; set; }
|
||||
public string reqTime { get; set; }
|
||||
public string clientCode { get; set; }
|
||||
public string tokenCode { get; set; }
|
||||
public string ctnrCode { get; set; }
|
||||
public string ctnrTyp { get; set; }
|
||||
public string stgBinCode { get; set; }
|
||||
public string positionCode { get; set; }
|
||||
public string indBind { get; set; }
|
||||
}
|
||||
|
||||
public class bindCtnrAndBinResponse
|
||||
{
|
||||
public string code { get; set; }
|
||||
public string data { get; set; }
|
||||
public bool interrupt { get; set; }
|
||||
public string reqCode { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 告警上报
|
||||
|
||||
public class warnCallbackReq
|
||||
{
|
||||
public string reqCode { get; set; }
|
||||
public string reqTime { get; set; }
|
||||
public string clientCode { get; set; }
|
||||
public string tokenCode { get; set; }
|
||||
public List<warnCallbackData> data { get; set; }
|
||||
}
|
||||
|
||||
public class warnCallbackData
|
||||
{
|
||||
public string robotCode { get; set; }
|
||||
public string beginDate { get; set; }
|
||||
public string warnContent { get; set; }
|
||||
public string taskCode { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
@ -84,6 +84,7 @@
|
||||
<Compile Include="Addresssage\AddressList.cs" />
|
||||
<Compile Include="AddressstorageModel.cs" />
|
||||
<Compile Include="AddressViewModel.cs" />
|
||||
<Compile Include="AgvReqModel.cs" />
|
||||
<Compile Include="Base.cs" />
|
||||
<Compile Include="BoxModel.cs" />
|
||||
<Compile Include="BoxPickModel.cs" />
|
||||
@ -97,6 +98,7 @@
|
||||
<Compile Include="ErrorLogModel.cs" />
|
||||
<Compile Include="ErrorLogViewModel.cs" />
|
||||
<Compile Include="HistoryDataModel.cs" />
|
||||
<Compile Include="InboundOrdersModel.cs" />
|
||||
<Compile Include="JobModel.cs" />
|
||||
<Compile Include="LabelModel.cs" />
|
||||
<Compile Include="LabelParamModel.cs" />
|
||||
@ -114,6 +116,7 @@
|
||||
<Compile Include="OrderRepModel.cs" />
|
||||
<Compile Include="OrderReportModel.cs" />
|
||||
<Compile Include="OrdersModel.cs" />
|
||||
<Compile Include="PalletinfoModel.cs" />
|
||||
<Compile Include="ParameterModel.cs" />
|
||||
<Compile Include="PressureTestModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@ -132,6 +135,8 @@
|
||||
<Compile Include="OrdersQueueModel.cs" />
|
||||
<Compile Include="ShowMessageModel_M.cs" />
|
||||
<Compile Include="StoreModel.cs" />
|
||||
<Compile Include="Sys_operate_logModel.cs" />
|
||||
<Compile Include="TaskModel.cs" />
|
||||
<Compile Include="UserCodeModel.cs" />
|
||||
<Compile Include="UserLoginModel.cs" />
|
||||
<Compile Include="UserModel.cs" />
|
||||
|
44
Epost.Model/InboundOrdersModel.cs
Normal file
44
Epost.Model/InboundOrdersModel.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.Model
|
||||
{
|
||||
public class InboundOrdersModel : Base
|
||||
{
|
||||
int _id = 0;
|
||||
string _wmsDocNo = string.Empty;
|
||||
string _groupTaskId = string.Empty;
|
||||
string _palletId = string.Empty;
|
||||
string _spositionCode = string.Empty;
|
||||
string _dpositionCode = string.Empty;
|
||||
string _priority = string.Empty;
|
||||
string _taskType = string.Empty;
|
||||
string _userId = string.Empty;
|
||||
string _userName = string.Empty;
|
||||
string _notes = string.Empty;
|
||||
string _warehouseId = string.Empty;
|
||||
int _state;
|
||||
private Nullable<DateTime> _addtime;
|
||||
private Nullable<DateTime> _endtime;
|
||||
private Nullable<DateTime> _operationtime;
|
||||
public int id { get => _id; set => _id = value; }
|
||||
public string wmsDocNo { get => _wmsDocNo; set => _wmsDocNo = value; }
|
||||
public string groupTaskId { get => _groupTaskId; set => _groupTaskId = value; }
|
||||
public string palletId { get => _palletId; set => _palletId = value; }
|
||||
public string spositionCode { get => _spositionCode; set => _spositionCode = value; }
|
||||
public string dpositionCode { get => _dpositionCode; set => _dpositionCode = value; }
|
||||
public string priority { get => _priority; set => _priority = value; }
|
||||
public string taskType { get => _taskType; set => _taskType = value; }
|
||||
public string userId { get => _userId; set => _userId = value; }
|
||||
public string userName { get => _userName; set => _userName = value; }
|
||||
public string notes { get => _notes; set => _notes = value; }
|
||||
public string warehouseId { get => _warehouseId; set => _warehouseId = value; }
|
||||
public int state { get => _state; set => _state = value; }
|
||||
public DateTime? addtime { get => _addtime; set => _addtime = value; }
|
||||
public DateTime? endtime { get => _endtime; set => _endtime = value; }
|
||||
public DateTime? operationtime { get => _operationtime; set => _operationtime = value; }
|
||||
}
|
||||
}
|
44
Epost.Model/PalletinfoModel.cs
Normal file
44
Epost.Model/PalletinfoModel.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.Model
|
||||
{
|
||||
public class PalletinfoModel : Base
|
||||
{
|
||||
int _id = 0;
|
||||
string _wmsDocNo = string.Empty;
|
||||
string _groupTaskId = string.Empty;
|
||||
string _palletId = string.Empty;
|
||||
string _sku = string.Empty;
|
||||
string _skuDescr1 = string.Empty;
|
||||
string _qty = string.Empty;
|
||||
string _lotatt01 = string.Empty;
|
||||
string _lotatt02 = string.Empty;
|
||||
string _lotatt04 = string.Empty;
|
||||
string _lotatt07 = string.Empty;
|
||||
string _lotatt08 = string.Empty;
|
||||
string _notes = string.Empty;
|
||||
string _taskType = string.Empty;
|
||||
private Nullable<DateTime> _addtime;
|
||||
private Nullable<DateTime> _endtime;
|
||||
public int id { get => _id; set => _id = value; }
|
||||
public string wmsDocNo { get => _wmsDocNo; set => _wmsDocNo = value; }
|
||||
public string groupTaskId { get => _groupTaskId; set => _groupTaskId = value; }
|
||||
public string palletId { get => _palletId; set => _palletId = value; }
|
||||
public string sku { get => _sku; set => _sku = value; }
|
||||
public string skuDescr1 { get => _skuDescr1; set => _skuDescr1 = value; }
|
||||
public string qty { get => _qty; set => _qty = value; }
|
||||
public string lotatt01 { get => _lotatt01; set => _lotatt01 = value; }
|
||||
public string lotatt02 { get => _lotatt02; set => _lotatt02 = value; }
|
||||
public string lotatt04 { get => _lotatt04; set => _lotatt04 = value; }
|
||||
public string lotatt07 { get => _lotatt07; set => _lotatt07 = value; }
|
||||
public string lotatt08 { get => _lotatt08; set => _lotatt08 = value; }
|
||||
public string notes { get => _notes; set => _notes = value; }
|
||||
public string taskType { get => _taskType; set => _taskType = value; }
|
||||
public DateTime? addtime { get => _addtime; set => _addtime = value; }
|
||||
public DateTime? endtime { get => _endtime; set => _endtime = value; }
|
||||
}
|
||||
}
|
@ -37,4 +37,10 @@ namespace Epost.Model
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BatchModel {
|
||||
string _batchno = string.Empty;
|
||||
|
||||
public string batchno { get => _batchno; set => _batchno = value; }
|
||||
}
|
||||
}
|
||||
|
33
Epost.Model/Sys_operate_logModel.cs
Normal file
33
Epost.Model/Sys_operate_logModel.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.Model
|
||||
{
|
||||
public class Sys_operate_logModel : Base
|
||||
{
|
||||
private int _id = 0;
|
||||
private string _title = string.Empty;
|
||||
private string _method = string.Empty;
|
||||
private string _operate_url = string.Empty;
|
||||
private string _operate_param = string.Empty;
|
||||
private string _json_result = string.Empty;
|
||||
private int _status = 0;
|
||||
private string _error_msg = string.Empty;
|
||||
|
||||
private Nullable<DateTime> _addtime;
|
||||
private Nullable<DateTime> _endtime;
|
||||
public int id { get => _id; set => _id = value; }
|
||||
public string title { get => _title; set => _title = value; }
|
||||
public string method { get => _method; set => _method = value; }
|
||||
public string operate_url { get => _operate_url; set => _operate_url = value; }
|
||||
public string operate_param { get => _operate_param; set => _operate_param = value; }
|
||||
public string json_result { get => _json_result; set => _json_result = value; }
|
||||
public int status { get => _status; set => _status = value; }
|
||||
public string error_msg { get => _error_msg; set => _error_msg = value; }
|
||||
public DateTime? addtime { get => _addtime; set => _addtime = value; }
|
||||
public DateTime? endtime { get => _endtime; set => _endtime = value; }
|
||||
}
|
||||
}
|
220
Epost.Model/TaskModel.cs
Normal file
220
Epost.Model/TaskModel.cs
Normal file
@ -0,0 +1,220 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.Model
|
||||
{
|
||||
#region 生成任务
|
||||
|
||||
#endregion
|
||||
public class TaskModel
|
||||
{
|
||||
public TaskData data { get; set; }
|
||||
}
|
||||
|
||||
public class TaskData
|
||||
{
|
||||
public List<TaskHeader> header { get; set; }
|
||||
}
|
||||
|
||||
public class TaskHeader
|
||||
{
|
||||
public string warehouseId { get; set; }
|
||||
public string wmsDocNo { get; set; }
|
||||
public string priority { get; set; }
|
||||
public string taskType { get; set; }
|
||||
public string userId { get; set; }
|
||||
public string userName { get; set; }
|
||||
public string notes { get; set; }
|
||||
public string udf01 { get; set; }
|
||||
public string udf02 { get; set; }
|
||||
public string udf03 { get; set; }
|
||||
public string udf04 { get; set; }
|
||||
public string udf05 { get; set; }
|
||||
public string udf06 { get; set; }
|
||||
public List<TaskDetail> details { get; set; }
|
||||
public List<TaskDetails2> details2 { get; set; }
|
||||
}
|
||||
|
||||
public class TaskDetail
|
||||
{
|
||||
public string groupTaskId { get; set; }
|
||||
public string palletId { get; set; }
|
||||
public string spositionCode { get; set; }
|
||||
public string dpositionCode { get; set; }
|
||||
public string notes { get; set; }
|
||||
public string udf01 { get; set; }
|
||||
public string udf02 { get; set; }
|
||||
public string udf03 { get; set; }
|
||||
public string udf04 { get; set; }
|
||||
public string udf05 { get; set; }
|
||||
public string udf06 { get; set; }
|
||||
}
|
||||
|
||||
public class TaskDetails2
|
||||
{
|
||||
public string groupTaskId { get; set; }
|
||||
public string palletId { get; set; }
|
||||
public string sku { get; set; }
|
||||
public string skuDescr1 { get; set; }
|
||||
public string qty { get; set; }
|
||||
public string lotatt01 { get; set; }
|
||||
public string lotatt02 { get; set; }
|
||||
public string lotatt04 { get; set; }
|
||||
public string lotatt07 { get; set; }
|
||||
public string lotatt08 { get; set; }
|
||||
public string notes { get; set; }
|
||||
public string udf01 { get; set; }
|
||||
public string udf02 { get; set; }
|
||||
public string udf03 { get; set; }
|
||||
public string udf04 { get; set; }
|
||||
public string udf05 { get; set; }
|
||||
public string udf06 { get; set; }
|
||||
}
|
||||
|
||||
|
||||
#region 接口返回
|
||||
|
||||
public class RetMesModel
|
||||
{
|
||||
public ResponseModel Response { get; set; }
|
||||
}
|
||||
|
||||
public class ResponseModel
|
||||
{
|
||||
public ReturnRes returnnode { get; set; }
|
||||
}
|
||||
|
||||
public class ReturnRes
|
||||
{
|
||||
public string returnCode { get; set; }
|
||||
public string returnDesc { get; set; }
|
||||
public string returnFlag { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 取消任务
|
||||
|
||||
public class AgvCancleModel
|
||||
{
|
||||
public CancleData data { get; set; }
|
||||
}
|
||||
|
||||
public class CancleData
|
||||
{
|
||||
public List<CancleHeader> header { get; set; }
|
||||
}
|
||||
|
||||
public class CancleHeader
|
||||
{
|
||||
public string warehouseId { get; set; }
|
||||
public string groupTaskId { get; set; }
|
||||
public string palletId { get; set; }
|
||||
public string userId { get; set; }
|
||||
public string userName { get; set; }
|
||||
public string notes { get; set; }
|
||||
public string reason { get; set; }
|
||||
public string udf01 { get; set; }
|
||||
public string udf02 { get; set; }
|
||||
public string udf03 { get; set; }
|
||||
public string udf04 { get; set; }
|
||||
public string udf05 { get; set; }
|
||||
public string udf06 { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 绑定解绑
|
||||
|
||||
public class agvBindPodModel
|
||||
{
|
||||
public agvBindData data { get; set; }
|
||||
}
|
||||
|
||||
public class agvBindData
|
||||
{
|
||||
public List<agvBindHeader> header { get; set; }
|
||||
}
|
||||
|
||||
public class agvBindHeader
|
||||
{
|
||||
public string warehouseId { get; set; }
|
||||
public string indBind { get; set; }
|
||||
public string palletId { get; set; }
|
||||
public string positionCode { get; set; }
|
||||
public string userId { get; set; }
|
||||
public string userName { get; set; }
|
||||
public string notes { get; set; }
|
||||
public string udf01 { get; set; }
|
||||
public string udf02 { get; set; }
|
||||
public string udf03 { get; set; }
|
||||
public string udf04 { get; set; }
|
||||
public string udf05 { get; set; }
|
||||
public string udf06 { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 任务执行通知接口
|
||||
|
||||
public class wmsCallbackModel
|
||||
{
|
||||
public callback data { get; set; }
|
||||
}
|
||||
|
||||
public class callback
|
||||
{
|
||||
public List<callbackHeader> header { get; set; }
|
||||
}
|
||||
|
||||
public class callbackHeader
|
||||
{
|
||||
public string warehouseId { get; set; }
|
||||
public string groupTaskId { get; set; }
|
||||
public string wmsDocNo { get; set; }
|
||||
public string reqCode { get; set; }
|
||||
public string reqTime { get; set; }
|
||||
public string method { get; set; }
|
||||
public string currentPositionCode { get; set; }
|
||||
public string robotCode { get; set; }
|
||||
public string taskCode { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 告警
|
||||
|
||||
public class agvexTaskReq
|
||||
{
|
||||
public agvexTaskData data { get; set; }
|
||||
}
|
||||
|
||||
public class agvexTaskData
|
||||
{
|
||||
public List<agvexTaskHeader> header { get; set; }
|
||||
}
|
||||
|
||||
public class agvexTaskHeader
|
||||
{
|
||||
public string reqCode { get; set; }
|
||||
public string reqTime { get; set; }
|
||||
public string clientCode { get; set; }
|
||||
public string tokenCode { get; set; }
|
||||
public string notes { get; set; }
|
||||
public List<agvexTaskList> list { get; set; }
|
||||
}
|
||||
|
||||
public class agvexTaskList
|
||||
{
|
||||
public string robotCode { get; set; }
|
||||
public string taskCode { get; set; }
|
||||
public string beginDate { get; set; }
|
||||
public string warnContent { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
@ -9,6 +9,7 @@ using Epost.Common;
|
||||
using System.Web.Helpers;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Web;
|
||||
|
||||
namespace Epost.TestToolsWeb.Tests.Controllers
|
||||
{
|
||||
@ -19,14 +20,10 @@ namespace Epost.TestToolsWeb.Tests.Controllers
|
||||
[TestMethod]
|
||||
public void d()
|
||||
{
|
||||
string sku = "211100";
|
||||
if (sku.Substring(0, 1) == "2" && sku.Substring(1, 1) != "5")
|
||||
{
|
||||
if (sku.Length >= 7)
|
||||
{
|
||||
sku = sku.Substring(1, 6);
|
||||
}
|
||||
}
|
||||
string ss = "12345678test12345678";
|
||||
string md= EncryptHelper.EncryptMD5By32(ss);
|
||||
string b64= EncryptHelper.Base64EnCode(md).ToUpper();
|
||||
string ddd = HttpUtility.UrlEncode(b64);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
183
Epost.TestToolsWeb/Controllers/AgvTaskApiController.cs
Normal file
183
Epost.TestToolsWeb/Controllers/AgvTaskApiController.cs
Normal file
@ -0,0 +1,183 @@
|
||||
using Epost.BLL;
|
||||
using Epost.Common;
|
||||
using Epost.DAL.Cache;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Http;
|
||||
using static System.Net.WebRequestMethods;
|
||||
|
||||
namespace Epost.DPS.Controllers
|
||||
{
|
||||
[RoutePrefix("service/rest/agvCallbackService")]//agv=>WCS
|
||||
public class AgvTaskApiController : ApiController
|
||||
{
|
||||
Sys_operate_logBLL logBLL = new Sys_operate_logBLL();
|
||||
InboundOrdersBLL inboundBLL = new InboundOrdersBLL();
|
||||
string agvCallbackUrl = ConfigurationManager.AppSettings["agvCallbackUrl"];
|
||||
string agvexTaskUrl = ConfigurationManager.AppSettings["agvexTaskUrl"];
|
||||
HttpHelper http = new HttpHelper();
|
||||
AgvHelper agv = new AgvHelper();
|
||||
AgvLogInfoBLL logbll = new AgvLogInfoBLL();
|
||||
[Route("agvCallback")]
|
||||
[HttpPost]
|
||||
public AgvResultModel agvCallback([FromBody] agvCallbackModel data)
|
||||
{
|
||||
AgvResultModel retModel = new AgvResultModel();
|
||||
|
||||
try
|
||||
{
|
||||
LogHelper.WriteLogInfo("agvCallback请求报文" + JsonHelper.SerializeObject(data));
|
||||
string state = string.Empty;
|
||||
if (data.method == "start")
|
||||
{
|
||||
state = "2";//任务开始启动
|
||||
}
|
||||
else if (data.method == "outbin")
|
||||
{
|
||||
state = "3";//走出储位
|
||||
}
|
||||
else if (data.method == "end")
|
||||
{
|
||||
state = "4";
|
||||
//更新任务已完成
|
||||
wms_callback(data);
|
||||
}
|
||||
else if (data.method == "cancel")
|
||||
{
|
||||
state = "88";
|
||||
wms_callback(data);
|
||||
|
||||
}
|
||||
else { }
|
||||
|
||||
inboundBLL.UpInOrderListByAgvid(data.taskCode, state);
|
||||
|
||||
retModel.message = "成功!";
|
||||
retModel.code = "0";
|
||||
retModel.reqCode = data.reqCode;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("agvCallback异常:" + ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
retModel.message = "请求接口异常!";
|
||||
retModel.code = "-1";
|
||||
retModel.reqCode = data.reqCode;
|
||||
}
|
||||
string resinfo = JsonHelper.SerializeObject(retModel);
|
||||
logBLL.InsertLog("AGV上报WCS", "agvCallback", "/api/AgvTaskApi/agvCallback", JsonHelper.SerializeObject(data), resinfo, 0, "", DateTime.Now);
|
||||
return retModel;
|
||||
}
|
||||
|
||||
public void wms_callback(agvCallbackModel data)
|
||||
{
|
||||
DataTable dt = inboundBLL.GetInOrderList(" and agvid ='" + data.taskCode + "'");
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
wmsCallbackModel backModel = new wmsCallbackModel();
|
||||
List<callbackHeader> list = new List<callbackHeader>();
|
||||
callbackHeader headModel = new callbackHeader();
|
||||
headModel.warehouseId = dt.Rows[0]["warehouseId"].ToString();
|
||||
headModel.groupTaskId = dt.Rows[0]["groupTaskId"].ToString();
|
||||
headModel.wmsDocNo = dt.Rows[0]["wmsDocNo"].ToString();
|
||||
headModel.currentPositionCode = data.currentPositionCode;
|
||||
headModel.robotCode = data.robotCode;
|
||||
headModel.taskCode = data.taskCode;
|
||||
headModel.method = data.method;
|
||||
headModel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
|
||||
headModel.reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
callback back = new callback();
|
||||
list.Add(headModel);
|
||||
back.header = list;
|
||||
backModel.data = back;
|
||||
string reqstr = JsonHelper.SerializeObject(backModel);
|
||||
LogHelper.WriteLogInfo("WCS->WMS任务执行通知请求:" + reqstr + "===" + agvCallbackUrl);
|
||||
string resultStr = http.HttpPost_Old(agvCallbackUrl, reqstr);
|
||||
LogHelper.WriteLogInfo("WCS->WMS任务执行通知返回:" + resultStr);
|
||||
|
||||
logBLL.InsertLog("WCS->WMS任务执行通知", "agvCallback", agvCallbackUrl, reqstr, resultStr, 0, "", DateTime.Now);
|
||||
}
|
||||
}
|
||||
[Route("warnCallback")]
|
||||
[HttpPost]
|
||||
public AgvResultModel warnCallback([FromBody]warnCallbackReq data)
|
||||
{
|
||||
AgvResultModel retModel = new AgvResultModel();
|
||||
|
||||
try
|
||||
{
|
||||
LogHelper.WriteLogInfo("warnCallback请求报文" + JsonHelper.SerializeObject(data));
|
||||
|
||||
//DataTable dt = inboundBLL.GetInOrderList(" and agvid ='" + data.taskCode + "'");
|
||||
//if (dt != null && dt.Rows.Count > 0)
|
||||
//{
|
||||
agvexTaskReq backModel = new agvexTaskReq();
|
||||
agvexTaskData taskdata = new agvexTaskData();
|
||||
List<agvexTaskList> taskList = new List<agvexTaskList>();
|
||||
agvexTaskHeader agvexHeader = new agvexTaskHeader();
|
||||
List<agvexTaskHeader> headerlist = new List<agvexTaskHeader>();
|
||||
List<warnCallbackData> datalist = data.data;
|
||||
string reqcode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
|
||||
bool istrue = true;
|
||||
if (datalist.Any())
|
||||
{
|
||||
foreach (warnCallbackData item in datalist)
|
||||
{
|
||||
agvexTaskList agvextmodel = new agvexTaskList();
|
||||
agvextmodel.robotCode = item.robotCode;
|
||||
agvextmodel.taskCode = item.taskCode;
|
||||
agvextmodel.beginDate = item.beginDate;
|
||||
agvextmodel.warnContent = item.warnContent;
|
||||
taskList.Add(agvextmodel);
|
||||
DataTable logdt= logbll.getAgvLogList(" and robotCode='"+ item.robotCode + "' and warnContent='"+ item.warnContent + "' and addtime>dateadd(minute,-10,GETDATE())");
|
||||
if (logdt != null && logdt.Rows.Count > 0)
|
||||
{
|
||||
istrue = false;
|
||||
}
|
||||
else {
|
||||
logbll.insertAgvLogInfo(reqcode, item.beginDate, item.robotCode, item.beginDate, item.warnContent, item.taskCode);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (istrue) {
|
||||
agvexHeader.list = taskList;
|
||||
agvexHeader.clientCode = data.clientCode;
|
||||
agvexHeader.reqCode = reqcode;
|
||||
agvexHeader.reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
headerlist.Add(agvexHeader);
|
||||
taskdata.header = headerlist;
|
||||
backModel.data = taskdata;
|
||||
|
||||
string reqstr = JsonHelper.SerializeObject(backModel);
|
||||
LogHelper.WriteLogInfo("WCS->WMS告警通知请求:" + reqstr + "===" + agvexTaskUrl);
|
||||
string resultStr = http.HttpPost_Old(agvexTaskUrl, reqstr);
|
||||
LogHelper.WriteLogInfo("WCS->WMS告警通知返回:" + resultStr);
|
||||
|
||||
logBLL.InsertLog("WCS->WMS告警通知", "warnCallback", agvexTaskUrl, reqstr, resultStr, 0, "", DateTime.Now);
|
||||
|
||||
// }
|
||||
}
|
||||
retModel.message = "成功!";
|
||||
retModel.code = "0";
|
||||
retModel.reqCode = data.reqCode;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("agvPutTask异常:" + ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
retModel.message = "请求接口异常!";
|
||||
retModel.code = "-1";
|
||||
retModel.reqCode = data.reqCode;
|
||||
}
|
||||
string resinfo = JsonHelper.SerializeObject(retModel);
|
||||
logBLL.InsertLog("AGV上报WCS", "agvCallback", "/api/AgvTaskApi/agvCallback", JsonHelper.SerializeObject(data), resinfo, 0, "", DateTime.Now);
|
||||
return retModel;
|
||||
}
|
||||
}
|
||||
}
|
@ -46,92 +46,6 @@ namespace Epost.TestToolsWeb.Controllers
|
||||
ViewBag.isWork = isWork;
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
#region 初始化
|
||||
public ActionResult ClearALL()
|
||||
{
|
||||
|
||||
bool result = false;
|
||||
isShow = true;
|
||||
try
|
||||
{
|
||||
|
||||
ResultModel resultModel = contrbll.ClearALL();
|
||||
return Json(new { Success = resultModel.result, Message = resultModel.msg });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return Json(new { Success = result, Message = "失败" });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 开始作业
|
||||
|
||||
public ActionResult StartWork()
|
||||
{
|
||||
isShow = true;
|
||||
|
||||
contrbll.StartWork();
|
||||
isWork = 1;
|
||||
return Json(new { Success = true, Message = "成功" });
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 设备检测
|
||||
public ActionResult TestStart()
|
||||
{
|
||||
|
||||
ResultModel result = contrbll.TestStart();
|
||||
if (result.result == "1")
|
||||
{
|
||||
return Json(new { Success = result, Message = result.msg });
|
||||
}
|
||||
else
|
||||
{
|
||||
return Json(new { Success = result, Message = result.msg });
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 停止检测
|
||||
public ActionResult TestEnd()
|
||||
{
|
||||
contrbll.TestEnd();
|
||||
return Json(new { Success = true, Message = "成功" });
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 结束作业
|
||||
public ActionResult EndWork()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
isShow = false;
|
||||
isWork = 0;
|
||||
isClear = 0;
|
||||
contrbll.EndWork();
|
||||
return Json(new { Success = true, Message = "成功" });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("结束作业异常" + ex.Message);
|
||||
return Json(new { Success = false, Message = "失败" });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -104,21 +104,21 @@ namespace Epost.DPS.Controllers
|
||||
#region 设备检测
|
||||
[Route("TestStart")]
|
||||
[HttpPost]
|
||||
public ResultModel TestStart()
|
||||
public ResultModel TestStart(BatchModel model)
|
||||
{
|
||||
lock (lockinit)
|
||||
{
|
||||
ResultModel res = new ResultModel();
|
||||
try
|
||||
{
|
||||
ResultModel result = contrbll.TestStart();
|
||||
ResultModel result = contrbll.TestStart(model.batchno);
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("GetDataList异常:" + ex.Message);
|
||||
LogHelper.WriteLogInfo("TestStart异常:" + ex.Message);
|
||||
res.msg = "请求异常!";
|
||||
res.result = "-1";
|
||||
return res;
|
||||
|
370
Epost.TestToolsWeb/Controllers/TaskAPIController.cs
Normal file
370
Epost.TestToolsWeb/Controllers/TaskAPIController.cs
Normal file
@ -0,0 +1,370 @@
|
||||
using Epost.BLL;
|
||||
using Epost.Common;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using static System.Net.WebRequestMethods;
|
||||
|
||||
namespace Epost.DPS.Controllers
|
||||
{
|
||||
[RoutePrefix("api/TaskAPI")]//WMS=>WCS
|
||||
public class TaskAPIController : ApiController
|
||||
{
|
||||
InboundOrdersBLL inOrderBLL = new InboundOrdersBLL();
|
||||
PalletinfoBLL palletBLL = new PalletinfoBLL();
|
||||
Sys_operate_logBLL logBLL = new Sys_operate_logBLL();
|
||||
|
||||
HttpHelper http = new HttpHelper();
|
||||
AgvHelper agv = new AgvHelper();
|
||||
string bindCtnrAndBinUrl = ConfigurationManager.AppSettings["bindCtnrAndBinUrl"];
|
||||
[Route("agvPutTask")]//WMS=>WCS生成任务接口
|
||||
[HttpPost]
|
||||
public RetMesModel agvPutTask([FromBody] TaskModel model)
|
||||
{
|
||||
RetMesModel retMes = new RetMesModel();
|
||||
ResponseModel response = new ResponseModel();
|
||||
ReturnRes res = new ReturnRes();
|
||||
try
|
||||
{
|
||||
LogHelper.WriteLogInfo("请求报文" + JsonHelper.SerializeObject(model));
|
||||
|
||||
if (model.data.header.Any())
|
||||
{
|
||||
foreach (TaskHeader item in model.data.header)
|
||||
{
|
||||
if (string.IsNullOrEmpty(item.wmsDocNo) || string.IsNullOrEmpty(item.taskType))
|
||||
{
|
||||
res.returnDesc = "请求参数错误!";
|
||||
res.returnCode = "0001";
|
||||
res.returnFlag = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
DataTable orderdt = inOrderBLL.GetOrdersList(item.wmsDocNo);
|
||||
if (orderdt != null && orderdt.Rows.Count > 0)
|
||||
{
|
||||
res.returnDesc = "订单已存在!";
|
||||
res.returnCode = "0001";
|
||||
res.returnFlag = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
#region datatable创建
|
||||
DataTable dataTable = new DataTable();
|
||||
dataTable.TableName = "InboundOrders";
|
||||
dataTable.Columns.Add(new DataColumn("wmsDocNo", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("groupTaskId", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("palletId", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("spositionCode", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("dpositionCode", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("priority", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("taskType", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("userId", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("userName", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("notes", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("warehouseId", typeof(string)));
|
||||
dataTable.Columns.Add(new DataColumn("addtime", typeof(DateTime)));
|
||||
dataTable.Columns.Add(new DataColumn("state", typeof(int)));
|
||||
#endregion
|
||||
if (item.details.Any())
|
||||
{
|
||||
foreach (TaskDetail detail in item.details)
|
||||
{
|
||||
#region datatable
|
||||
DataRow dataRow = dataTable.NewRow();
|
||||
dataRow["wmsDocNo"] = item.wmsDocNo;
|
||||
dataRow["groupTaskId"] = detail.groupTaskId;
|
||||
dataRow["palletId"] = detail.palletId;
|
||||
dataRow["spositionCode"] = detail.spositionCode;
|
||||
dataRow["dpositionCode"] = detail.dpositionCode;
|
||||
dataRow["priority"] = item.priority;
|
||||
dataRow["taskType"] = item.taskType;
|
||||
dataRow["userId"] = item.userId;
|
||||
dataRow["userName"] = item.userName;
|
||||
dataRow["notes"] = detail.notes;
|
||||
dataRow["warehouseId"] = item.warehouseId;
|
||||
dataRow["addtime"] = DateTime.Now.ToString();
|
||||
dataRow["state"] = "0";
|
||||
dataTable.Rows.Add(dataRow);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#region Dictionary
|
||||
Dictionary<string, string> diclist = new Dictionary<string, string>();
|
||||
diclist.Add("wmsDocNo", "wmsDocNo");
|
||||
diclist.Add("groupTaskId", "groupTaskId");
|
||||
diclist.Add("palletId", "palletId");
|
||||
diclist.Add("spositionCode", "spositionCode");
|
||||
diclist.Add("dpositionCode", "dpositionCode");
|
||||
diclist.Add("priority", "priority");
|
||||
diclist.Add("taskType", "taskType");
|
||||
diclist.Add("userId", "userId");
|
||||
diclist.Add("userName", "userName");
|
||||
diclist.Add("notes", "notes");
|
||||
diclist.Add("warehouseId", "warehouseId");
|
||||
diclist.Add("addtime", "addtime");
|
||||
diclist.Add("state", "state");
|
||||
#endregion
|
||||
bool bo = inOrderBLL.InsertOrder(dataTable, diclist);
|
||||
if (bo)
|
||||
{
|
||||
//添加托盘明细
|
||||
InsertPallet(item);
|
||||
res.returnCode = "0000";
|
||||
res.returnDesc = "成功!";
|
||||
res.returnFlag = "1";
|
||||
}
|
||||
else
|
||||
{
|
||||
res.returnCode = "0001";
|
||||
res.returnDesc = "请求失败,请重试!";
|
||||
res.returnFlag = "0";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("agvPutTask异常:" + ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
res.returnDesc = "请求接口异常!";
|
||||
res.returnCode = "0001";
|
||||
res.returnFlag = "0";
|
||||
}
|
||||
response.returnnode = res;
|
||||
retMes.Response = response;
|
||||
string resinfo = JsonHelper.SerializeObject(retMes) ;
|
||||
logBLL.InsertLog("生成任务单", "agvPutTask", "/api/TaskAPI/agvPutTask", JsonHelper.SerializeObject(model), resinfo, 0, res.returnDesc, DateTime.Now);
|
||||
return retMes;
|
||||
}
|
||||
|
||||
#region 添加托盘明细
|
||||
public bool InsertPallet(TaskHeader item)
|
||||
{
|
||||
try
|
||||
{
|
||||
#region datatable创建
|
||||
DataTable dataTable2 = new DataTable();
|
||||
dataTable2.TableName = "Palletinfo";
|
||||
dataTable2.Columns.Add(new DataColumn("wmsDocNo", typeof(string)));
|
||||
dataTable2.Columns.Add(new DataColumn("groupTaskId", typeof(string)));
|
||||
dataTable2.Columns.Add(new DataColumn("palletId", typeof(string)));
|
||||
dataTable2.Columns.Add(new DataColumn("sku", typeof(string)));
|
||||
dataTable2.Columns.Add(new DataColumn("skuDescr1", typeof(string)));
|
||||
dataTable2.Columns.Add(new DataColumn("qty", typeof(string)));
|
||||
dataTable2.Columns.Add(new DataColumn("taskType", typeof(string)));
|
||||
dataTable2.Columns.Add(new DataColumn("notes", typeof(string)));
|
||||
dataTable2.Columns.Add(new DataColumn("addtime", typeof(DateTime)));
|
||||
|
||||
#endregion
|
||||
if (item.details2.Any())
|
||||
{
|
||||
foreach (TaskDetails2 detail in item.details2)
|
||||
{
|
||||
#region datatable
|
||||
DataRow dataRow1 = dataTable2.NewRow();
|
||||
dataRow1["wmsDocNo"] = item.wmsDocNo;
|
||||
dataRow1["groupTaskId"] = detail.groupTaskId;
|
||||
dataRow1["palletId"] = detail.palletId;
|
||||
dataRow1["sku"] = detail.sku;
|
||||
dataRow1["skuDescr1"] = detail.skuDescr1;
|
||||
dataRow1["qty"] = detail.qty;
|
||||
dataRow1["notes"] = item.notes;
|
||||
dataRow1["taskType"] = item.taskType;
|
||||
dataRow1["addtime"] = DateTime.Now.ToString();
|
||||
|
||||
dataTable2.Rows.Add(dataRow1);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#region Dictionary
|
||||
Dictionary<string, string> diclist1 = new Dictionary<string, string>();
|
||||
diclist1.Add("wmsDocNo", "wmsDocNo");
|
||||
diclist1.Add("groupTaskId", "groupTaskId");
|
||||
diclist1.Add("palletId", "palletId");
|
||||
diclist1.Add("sku", "sku");
|
||||
diclist1.Add("skuDescr1", "skuDescr1");
|
||||
diclist1.Add("qty", "qty");
|
||||
diclist1.Add("notes", "notes");
|
||||
diclist1.Add("taskType", "taskType");
|
||||
diclist1.Add("addtime", "addtime");
|
||||
|
||||
#endregion
|
||||
bool bo = palletBLL.InsertPallet(dataTable2, diclist1);
|
||||
LogHelper.WriteLogInfo(item.wmsDocNo + "添加托盘明细:" + bo);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("添加托盘明细异常:" + ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
[Route("agvCancleTask")]//WMS=>WCS取消任务
|
||||
[HttpPost]
|
||||
public RetMesModel agvCancleTask([FromBody]AgvCancleModel model)
|
||||
{
|
||||
RetMesModel retMes = new RetMesModel();
|
||||
ResponseModel response = new ResponseModel();
|
||||
ReturnRes res = new ReturnRes();
|
||||
try
|
||||
{
|
||||
LogHelper.WriteLogInfo("agvCancleTask请求报文" + JsonHelper.SerializeObject(model));
|
||||
|
||||
if (model.data.header.Any())
|
||||
{
|
||||
foreach (CancleHeader item in model.data.header)
|
||||
{
|
||||
if (string.IsNullOrEmpty(item.groupTaskId) || string.IsNullOrEmpty(item.palletId))
|
||||
{
|
||||
res.returnDesc = "请求参数错误!";
|
||||
res.returnCode = "0001";
|
||||
res.returnFlag = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
DataTable orderdt = inOrderBLL.GetInOrderList(" and groupTaskId='"+item.groupTaskId+ "' and palletId='"+ item.palletId + "' and state=0");
|
||||
if (orderdt != null && orderdt.Rows.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
bool bo= inOrderBLL.UpInOrderList(orderdt.Rows[0]["id"].ToString(), "88", "");
|
||||
if (bo)
|
||||
{
|
||||
res.returnCode = "0000";
|
||||
res.returnDesc = "成功!";
|
||||
res.returnFlag = "1";
|
||||
}
|
||||
else {
|
||||
res.returnCode = "0001";
|
||||
res.returnDesc = "取消失败!!";
|
||||
res.returnFlag = "0";
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
res.returnDesc = "订单不存在/订单已执行!";
|
||||
res.returnCode = "0001";
|
||||
res.returnFlag = "0";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("agvCancleTask异常:" + ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
res.returnDesc = "请求接口异常!";
|
||||
res.returnCode = "0001";
|
||||
res.returnFlag = "0";
|
||||
}
|
||||
response.returnnode = res;
|
||||
retMes.Response = response;
|
||||
string resinfo = JsonHelper.SerializeObject(retMes) ;
|
||||
logBLL.InsertLog("WMS=>WCS取消任务接口", "agvCancleTask", "/api/TaskAPI/agvCancleTask", JsonHelper.SerializeObject(model), resinfo, 0, res.returnDesc, DateTime.Now);
|
||||
return retMes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Route("agvBindPodAndBerth")]//WMS=>WCS绑定解绑
|
||||
[HttpPost]
|
||||
public RetMesModel agvBindPodAndBerth([FromBody] agvBindPodModel model)
|
||||
{
|
||||
RetMesModel retMes = new RetMesModel();
|
||||
ResponseModel response = new ResponseModel();
|
||||
ReturnRes res = new ReturnRes();
|
||||
try
|
||||
{
|
||||
LogHelper.WriteLogInfo("请求报文" + JsonHelper.SerializeObject(model));
|
||||
|
||||
if (model.data.header.Any())
|
||||
{
|
||||
foreach (agvBindHeader item in model.data.header)
|
||||
{
|
||||
if (string.IsNullOrEmpty(item.indBind) || string.IsNullOrEmpty(item.palletId) || string.IsNullOrEmpty(item.positionCode))
|
||||
{
|
||||
res.returnDesc = "请求参数错误!";
|
||||
res.returnCode = "0001";
|
||||
res.returnFlag = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
bindCtnrAndBinReq reqModel = new bindCtnrAndBinReq();
|
||||
reqModel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
|
||||
reqModel.ctnrTyp = "1";//agv提供
|
||||
reqModel.indBind = item.indBind;
|
||||
string type = string.Empty;
|
||||
string agvloc = inOrderBLL.GetLocation(" and wmsloc = '" + item.positionCode + "'",out type );
|
||||
reqModel.stgBinCode = agvloc;
|
||||
if (item.indBind == "1")
|
||||
{
|
||||
reqModel.ctnrCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
|
||||
}
|
||||
string reqstr = JsonHelper.SerializeObject(reqModel);
|
||||
string resultStr = http.HttpPost_Old(bindCtnrAndBinUrl, reqstr);
|
||||
//string resultStr = "{\"code\":\"0\",\"data\":\"\",\"interrupt\":false,\"reqCode\":\"66ee6\"}";
|
||||
logBLL.InsertLog("WCS->AGV绑定解绑", "bindCtnrAndBin", bindCtnrAndBinUrl, reqstr, resultStr, 0, "", DateTime.Now);
|
||||
if (!string.IsNullOrEmpty(resultStr))
|
||||
{
|
||||
bindCtnrAndBinResponse resModel = JsonHelper.DeserializeObject<bindCtnrAndBinResponse>(resultStr);
|
||||
if (resModel.code == "0")
|
||||
{
|
||||
|
||||
res.returnCode = "0000";
|
||||
res.returnDesc = "绑定/解绑成功!";
|
||||
res.returnFlag = "1";
|
||||
}
|
||||
else
|
||||
{
|
||||
res.returnCode = "0000";
|
||||
res.returnDesc = "绑定/解绑失败!";
|
||||
res.returnFlag = "1";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("agvBindPodAndBerth异常:" + ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
res.returnDesc = "请求接口异常!";
|
||||
res.returnCode = "0001";
|
||||
res.returnFlag = "0";
|
||||
}
|
||||
|
||||
response.returnnode = res;
|
||||
retMes.Response = response;
|
||||
string resinfo = JsonHelper.SerializeObject(retMes);
|
||||
logBLL.InsertLog("WMS=>WCS绑定解绑接口", "agvBindPodAndBerth", "/api/TaskAPI/agvBindPodAndBerth", JsonHelper.SerializeObject(model), resinfo, 0, res.returnDesc, DateTime.Now);
|
||||
return retMes;
|
||||
}
|
||||
}
|
||||
}
|
@ -222,8 +222,10 @@
|
||||
<Compile Include="App_Start\RouteConfig.cs" />
|
||||
<Compile Include="App_Start\Startup.Auth.cs" />
|
||||
<Compile Include="App_Start\WebApiConfig.cs" />
|
||||
<Compile Include="Controllers\AgvTaskApiController.cs" />
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
<Compile Include="Controllers\ServerController.cs" />
|
||||
<Compile Include="Controllers\TaskAPIController.cs" />
|
||||
<Compile Include="Controllers\WebAPIController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
||||
<Controller_SelectedScaffolderCategoryPath>root/Controller</Controller_SelectedScaffolderCategoryPath>
|
||||
<Controller_SelectedScaffolderCategoryPath>root/Common/Web API</Controller_SelectedScaffolderCategoryPath>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
|
@ -1,7 +1,10 @@
|
||||
using Epost.Common;
|
||||
using Epost.BLL;
|
||||
using Epost.Common;
|
||||
using Epost.Model;
|
||||
using Epost.TestToolsWeb.App_Start;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
@ -12,11 +15,14 @@ using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Optimization;
|
||||
using System.Web.Routing;
|
||||
using System.Web.WebSockets;
|
||||
|
||||
namespace Epost.TestToolsWeb
|
||||
{
|
||||
public class MvcApplication : System.Web.HttpApplication
|
||||
{
|
||||
InboundOrdersBLL inboundBLL = new InboundOrdersBLL();
|
||||
AgvHelper agv = new AgvHelper();
|
||||
protected void Application_Start()
|
||||
{
|
||||
AreaRegistration.RegisterAllAreas();
|
||||
@ -25,12 +31,65 @@ namespace Epost.TestToolsWeb
|
||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||
BundleConfig.RegisterBundles(BundleTable.Bundles);
|
||||
|
||||
|
||||
Time_TaskHelper.Instance().ExecuteTask += new System.Timers.ElapsedEventHandler(Global_ExecuteTask);
|
||||
Time_TaskHelper.Instance().Interval = 1000 * 10;//表示间隔
|
||||
Time_TaskHelper.Instance().Start();
|
||||
}
|
||||
|
||||
void Global_ExecuteTask(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
//在这里编写需要定时执行的逻辑代码
|
||||
LogHelper.WriteLogInfo("任务执行中");
|
||||
DataTable dt = inboundBLL.GetInOrderList(" and state =0 order by priority,id");
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow row in dt.Rows) {
|
||||
|
||||
AgvSchedulingTaskModel reqmodel = new AgvSchedulingTaskModel();
|
||||
reqmodel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString()+ row["id"].ToString();;
|
||||
List<Positioncodepath> positionList = new List<Positioncodepath>();
|
||||
Positioncodepath pathModel = new Positioncodepath();
|
||||
string type = string.Empty;
|
||||
pathModel.positionCode = inboundBLL.GetLocation(" and wmsloc ='"+ row["spositionCode"].ToString() + "'",out type);
|
||||
#region 手动绑定点位--
|
||||
|
||||
if (type == "1")
|
||||
{
|
||||
LogHelper.WriteLogInfo("绑定点位"+ pathModel.positionCode);
|
||||
agv.bindCtnrAndBin(pathModel.positionCode, type);
|
||||
}
|
||||
#endregion
|
||||
pathModel.type = "05";//agv提供
|
||||
positionList.Add(pathModel);
|
||||
Positioncodepath pathModel2 = new Positioncodepath();
|
||||
pathModel2.positionCode = inboundBLL.GetLocation(" and wmsloc = '"+ row["dpositionCode"].ToString() + "'",out type );
|
||||
pathModel2.type = "05";
|
||||
positionList.Add(pathModel2);
|
||||
reqmodel.positionCodePath = positionList;
|
||||
reqmodel.taskTyp = "ZY01";//agv提供
|
||||
reqmodel.ctnrTyp = "1";
|
||||
AgvResultModel res= agv.genAgvSchedulingTask(reqmodel);
|
||||
if (res.code == "0")
|
||||
{
|
||||
//调用agv成功 更新订单状态
|
||||
inboundBLL.UpInOrderList(row["id"].ToString(), "1", res.data);
|
||||
}
|
||||
else if (res.code == "1")
|
||||
{
|
||||
inboundBLL.UpInOrder(row["id"].ToString(),"AGV告警:"+res.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
protected void Session_Start(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
// 在新会话启动时运行的代码
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -9,13 +9,13 @@
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<publishUrl>D:\驿传\T系列</publishUrl>
|
||||
<DeleteExistingFiles>True</DeleteExistingFiles>
|
||||
<PrecompileBeforePublish>True</PrecompileBeforePublish>
|
||||
<EnableUpdateable>True</EnableUpdateable>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<publishUrl>D:\驿传\zhuyou_wcs</publishUrl>
|
||||
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||
<PrecompileBeforePublish>true</PrecompileBeforePublish>
|
||||
<EnableUpdateable>true</EnableUpdateable>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<WDPMergeOption>DonotMerge</WDPMergeOption>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -6,8 +6,8 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||
<_PublishTargetUrl>D:\驿传\T系列</_PublishTargetUrl>
|
||||
<History>True|2024-09-01T02:13:37.1598955Z;True|2024-08-31T17:27:57.5375469+08:00;True|2022-07-15T16:41:13.9750291+08:00;True|2022-07-14T14:02:20.7983427+08:00;True|2022-07-13T17:40:22.7531000+08:00;True|2022-07-13T17:34:22.9908701+08:00;True|2022-07-13T17:30:06.3588502+08:00;True|2022-07-11T10:32:06.9053981+08:00;True|2021-04-26T10:07:37.4889549+08:00;True|2021-04-09T10:32:51.9130162+08:00;True|2021-04-09T10:31:50.4974012+08:00;</History>
|
||||
<_PublishTargetUrl>D:\驿传\zhuyou_wcs</_PublishTargetUrl>
|
||||
<History>True|2024-12-25T02:39:08.4069954Z;True|2024-12-24T14:23:59.6498280+08:00;True|2024-12-12T10:38:02.5914170+08:00;True|2024-12-05T11:08:47.6560918+08:00;True|2024-12-04T09:59:41.1980682+08:00;True|2024-11-29T15:21:54.3789957+08:00;True|2024-11-29T14:43:30.2764537+08:00;True|2024-11-29T14:05:34.1608373+08:00;True|2024-11-29T13:24:48.7549546+08:00;True|2024-11-29T11:33:32.4546950+08:00;True|2024-11-26T10:08:16.7734518+08:00;True|2024-11-22T14:00:39.7806019+08:00;False|2024-11-04T17:48:25.2781696+08:00;True|2024-11-01T16:04:56.3535724+08:00;True|2024-09-01T10:13:37.1598955+08:00;True|2024-08-31T17:27:57.5375469+08:00;True|2022-07-15T16:41:13.9750291+08:00;True|2022-07-14T14:02:20.7983427+08:00;True|2022-07-13T17:40:22.7531000+08:00;True|2022-07-13T17:34:22.9908701+08:00;True|2022-07-13T17:30:06.3588502+08:00;True|2022-07-11T10:32:06.9053981+08:00;True|2021-04-26T10:07:37.4889549+08:00;True|2021-04-09T10:32:51.9130162+08:00;True|2021-04-09T10:31:50.4974012+08:00;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
@ -33,19 +33,19 @@
|
||||
<publishTime>04/04/2018 15:45:12</publishTime>
|
||||
</File>
|
||||
<File Include="bin/App_global.asax.compiled">
|
||||
<publishTime>09/01/2024 13:28:03</publishTime>
|
||||
<publishTime>12/25/2024 16:29:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/App_global.asax.dll">
|
||||
<publishTime>09/01/2024 13:28:02</publishTime>
|
||||
<publishTime>12/25/2024 16:29:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/BouncyCastle.Crypto.dll">
|
||||
<publishTime>02/24/2020 15:29:24</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Common.dll">
|
||||
<publishTime>09/01/2024 10:13:03</publishTime>
|
||||
<publishTime>12/25/2024 10:38:45</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Common.pdb">
|
||||
<publishTime>09/01/2024 10:13:03</publishTime>
|
||||
<publishTime>12/25/2024 10:38:45</publishTime>
|
||||
</File>
|
||||
<File Include="bin/ComposerSDK.dll">
|
||||
<publishTime>04/29/2020 16:50:14</publishTime>
|
||||
@ -63,31 +63,31 @@
|
||||
<publishTime>10/23/2017 13:15:20</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.BLL.dll">
|
||||
<publishTime>09/01/2024 13:27:54</publishTime>
|
||||
<publishTime>12/25/2024 10:38:46</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.BLL.pdb">
|
||||
<publishTime>09/01/2024 13:27:54</publishTime>
|
||||
<publishTime>12/25/2024 10:38:46</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.BLL.XmlSerializers.dll">
|
||||
<publishTime>08/26/2020 18:09:48</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DAL.dll">
|
||||
<publishTime>09/01/2024 11:27:24</publishTime>
|
||||
<publishTime>12/25/2024 10:38:46</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DAL.pdb">
|
||||
<publishTime>09/01/2024 11:27:24</publishTime>
|
||||
<publishTime>12/25/2024 10:38:46</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DPS.dll">
|
||||
<publishTime>09/01/2024 13:27:56</publishTime>
|
||||
<publishTime>12/25/2024 16:29:12</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DPS.pdb">
|
||||
<publishTime>09/01/2024 13:27:56</publishTime>
|
||||
<publishTime>12/25/2024 16:29:12</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.Model.dll">
|
||||
<publishTime>08/31/2024 17:27:44</publishTime>
|
||||
<publishTime>12/24/2024 14:23:36</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.Model.pdb">
|
||||
<publishTime>08/31/2024 17:27:44</publishTime>
|
||||
<publishTime>12/24/2024 14:23:36</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.TestToolsWeb.dll">
|
||||
<publishTime>09/06/2018 11:57:11</publishTime>
|
||||
@ -5652,7 +5652,7 @@
|
||||
<publishTime>05/30/2022 16:58:47</publishTime>
|
||||
</File>
|
||||
<File Include="PrecompiledApp.config">
|
||||
<publishTime>09/01/2024 13:27:58</publishTime>
|
||||
<publishTime>12/25/2024 16:29:13</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/ai.0.22.9-build00167.js">
|
||||
<publishTime>04/04/2018 15:45:12</publishTime>
|
||||
@ -7572,7 +7572,7 @@
|
||||
<publishTime>07/04/2022 14:22:38</publishTime>
|
||||
</File>
|
||||
<File Include="Web.config">
|
||||
<publishTime>08/31/2024 19:13:15</publishTime>
|
||||
<publishTime>12/24/2024 14:23:41</publishTime>
|
||||
</File>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -11,7 +11,7 @@
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="weijie_dpsEntities" connectionString="metadata=res://*/WJDB.csdl|res://*/WJDB.ssdl|res://*/WJDB.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=weijie_dps;user id=sa;password=123456;min pool size=4;max pool size=4;packet size=3072;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
|
||||
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=BJ_ZhongLiang_DAS;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
|
||||
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=zhuyou_wcs;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
|
||||
<add name="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />
|
||||
|
||||
<add name="WMSConnection" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" />
|
||||
@ -27,12 +27,21 @@
|
||||
<add key="ControlXML" value="/App_Data/EpostController.xml" />
|
||||
<add key="LabelXML" value="/App_Data/AddressStorage.xml" />
|
||||
<add key="ResultsXML" value="/App_Data/Results.xml" />
|
||||
<add key="WebAPIUrl" value="http://192.168.3.65:8051/api/WebAPI/ProcessingResult"/>
|
||||
<add key="WebAPIUrl" value="http://192.168.0.20:8045/api/WebAPI/ProcessingResult"/>
|
||||
<add key="ShowMode" value="1" />
|
||||
<add key="SetupMode" value="\Epost_P\Epost.TestToolsWeb\App_Data\SetupMode.txt" />
|
||||
<add key="CARID" value="HT01" />
|
||||
<add key="ServerAPIURL" value="http://192.168.3.65:8051/api/WebAPI" />
|
||||
<add key="ServerAPIURL" value="http://192.168.0.20:8045/api/WebAPI" />
|
||||
<add key="SleepTime" value="1" />
|
||||
|
||||
<add key="agvSchedulingTaskUrl" value="http://172.18.26.26:8182/rcms/services/rest/hikRpcService/genAgvSchedulingTask" />
|
||||
|
||||
<!--wcs->agv绑定解绑-->
|
||||
<add key="bindCtnrAndBinUrl" value="http://172.18.26.26:8182/rcms/services/rest/hikRpcService/bindCtnrAndBin" />
|
||||
<!--wcs->wms任务执行通知-->
|
||||
<add key="agvCallbackUrl" value="http://172.18.26.30:18080/datahubjson/ZYZY_AGV/?method=agvCallback" />
|
||||
<!--wcs->wms告警-->
|
||||
<add key="agvexTaskUrl" value="http://172.18.26.30:18080/datahubjson/ZYZY_AGV/?method=agvexTask" />
|
||||
</appSettings>
|
||||
<!--
|
||||
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
|
||||
|
Reference in New Issue
Block a user