This commit is contained in:
@ -3,21 +3,27 @@ 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")]
|
||||
[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();
|
||||
[Route("agvPutTask")]
|
||||
|
||||
HttpHelper http = new HttpHelper();
|
||||
AgvHelper agv = new AgvHelper();
|
||||
string bindCtnrAndBinUrl = ConfigurationManager.AppSettings["bindCtnrAndBinUrl"];
|
||||
[Route("agvPutTask")]//WMS=>WCS生成任务接口
|
||||
[HttpPost]
|
||||
public RetMesModel agvPutTask([FromBody] TaskModel model)
|
||||
{
|
||||
@ -210,7 +216,7 @@ namespace Epost.DPS.Controllers
|
||||
|
||||
|
||||
|
||||
[Route("agvCancleTask")]
|
||||
[Route("agvCancleTask")]//WMS=>WCS取消任务
|
||||
[HttpPost]
|
||||
public RetMesModel agvCancleTask([FromBody]AgvCancleModel model)
|
||||
{
|
||||
@ -237,10 +243,19 @@ namespace Epost.DPS.Controllers
|
||||
if (orderdt != null && orderdt.Rows.Count > 0)
|
||||
{
|
||||
|
||||
res.returnCode = "0000";
|
||||
res.returnDesc = "成功!";
|
||||
res.returnFlag = "1";
|
||||
|
||||
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 {
|
||||
@ -268,13 +283,13 @@ namespace Epost.DPS.Controllers
|
||||
response.returnnode = res;
|
||||
retMes.Response = response;
|
||||
string resinfo = JsonHelper.SerializeObject(retMes) ;
|
||||
logBLL.InsertLog("取消任务接口", "agvCancleTask", "/api/TaskAPI/agvCancleTask", JsonHelper.SerializeObject(model), resinfo, 0, res.returnDesc, DateTime.Now);
|
||||
logBLL.InsertLog("WMS=>WCS取消任务接口", "agvCancleTask", "/api/TaskAPI/agvCancleTask", JsonHelper.SerializeObject(model), resinfo, 0, res.returnDesc, DateTime.Now);
|
||||
return retMes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Route("agvBindPodAndBerth")]
|
||||
[Route("agvBindPodAndBerth")]//WMS=>WCS绑定解绑
|
||||
[HttpPost]
|
||||
public RetMesModel agvBindPodAndBerth([FromBody] agvBindPodModel model)
|
||||
{
|
||||
@ -297,19 +312,44 @@ namespace Epost.DPS.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
bindCtnrAndBinReq reqModel = new bindCtnrAndBinReq();
|
||||
reqModel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
|
||||
reqModel.ctnrTyp = "1";//agv提供
|
||||
reqModel.indBind = item.indBind;
|
||||
string agvloc = inOrderBLL.GetLocation(" and wmsloc = '" + item.positionCode + "'");
|
||||
reqModel.stgBinCode = agvloc;
|
||||
if (item.indBind == "1")
|
||||
{
|
||||
reqModel.ctnrCode = agvloc;
|
||||
}
|
||||
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";
|
||||
res.returnCode = "0000";
|
||||
res.returnDesc = "绑定/解绑成功!";
|
||||
res.returnFlag = "1";
|
||||
}
|
||||
else
|
||||
{
|
||||
res.returnCode = "0000";
|
||||
res.returnDesc = "绑定/解绑失败!";
|
||||
res.returnFlag = "1";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -322,7 +362,7 @@ namespace Epost.DPS.Controllers
|
||||
response.returnnode = res;
|
||||
retMes.Response = response;
|
||||
string resinfo = JsonHelper.SerializeObject(retMes);
|
||||
logBLL.InsertLog("agv绑定解绑接口", "agvBindPodAndBerth", "/api/TaskAPI/agvBindPodAndBerth", JsonHelper.SerializeObject(model), resinfo, 0, res.returnDesc, DateTime.Now);
|
||||
logBLL.InsertLog("WMS=>WCS绑定解绑接口", "agvBindPodAndBerth", "/api/TaskAPI/agvBindPodAndBerth", JsonHelper.SerializeObject(model), resinfo, 0, res.returnDesc, DateTime.Now);
|
||||
return retMes;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user