This commit is contained in:
47
Epost.TestToolsWeb/Controllers/AgvTaskApiController.cs
Normal file
47
Epost.TestToolsWeb/Controllers/AgvTaskApiController.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using Epost.Common;
|
||||
using Epost.DAL.Cache;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Epost.DPS.Controllers
|
||||
{
|
||||
[RoutePrefix("api/AgvTaskApi")]
|
||||
public class AgvTaskApiController : ApiController
|
||||
{
|
||||
JobDownCacheDAL JobCache = new JobDownCacheDAL();
|
||||
[Route("agvCallback")]
|
||||
[HttpPost]
|
||||
public AgvResultModel agvCallback([FromBody] agvCallbackModel model)
|
||||
{
|
||||
AgvResultModel retModel = new AgvResultModel();
|
||||
|
||||
try
|
||||
{
|
||||
LogHelper.WriteLogInfo("请求报文" + JsonHelper.SerializeObject(model));
|
||||
|
||||
ResultMessageModel data = new ResultMessageModel();
|
||||
data.Parameter = model.reqCode;
|
||||
data.Status = model.method;
|
||||
data.Address = model.taskCode;
|
||||
JobCache.UpdateJobDownModelList(new List<ResultMessageModel>() { data }, EdownCommend.Create);
|
||||
retModel.message = "成功!";
|
||||
retModel.code = "0";
|
||||
retModel.reqCode = model.reqCode;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("agvPutTask异常:" + ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
retModel.message = "请求接口异常!";
|
||||
retModel.code = "-1";
|
||||
retModel.reqCode = model.reqCode;
|
||||
}
|
||||
return retModel;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user