|
@@ -3,12 +3,14 @@ using Newtonsoft.Json;
|
|
|
using ServiceCenter;
|
|
|
using ServiceCenter.Redis;
|
|
|
using ServiceCenter.SqlSugars;
|
|
|
+using SqlSugar.Extensions;
|
|
|
using System.Net.NetworkInformation;
|
|
|
using System.Text;
|
|
|
using WCS.Core;
|
|
|
using WCS.Entity;
|
|
|
using WCS.Entity.Protocol.DataStructure;
|
|
|
using WCS.Entity.Protocol.SRM;
|
|
|
+using WCS.WorkEngineering.Extensions;
|
|
|
using WCS.WorkEngineering.Systems;
|
|
|
using WCS.WorkEngineering.WebApi.Models.WCS.Request;
|
|
|
using WCS.WorkEngineering.WebApi.Models.WCS.Response;
|
|
@@ -43,7 +45,32 @@ namespace WCS.WorkEngineering.WebApi.Controllers
|
|
|
if (task != null)
|
|
|
{
|
|
|
//验证wms是否能取消
|
|
|
- //WmsApi.HandleTaskVerify(task);
|
|
|
+ var res = WmsApi.HandleTaskVerify(new List<int>() { task.ID }, "106");
|
|
|
+ if (res.ResCode == Models.WMS.Response.ResponseStatusCodeEnum.Sucess)
|
|
|
+ {
|
|
|
+ //取消任务
|
|
|
+ var cancelRes = WmsApi.CarryTaskInfo(new List<int>() { task.ID }, "106");
|
|
|
+ if (cancelRes.ResCode == Models.WMS.Response.ResponseStatusCodeEnum.Sucess)
|
|
|
+ {
|
|
|
+ //更新任务状态
|
|
|
+ task.Status = Entity.TaskStatus.Cancel;
|
|
|
+ task.EditTime = DateTime.Now;
|
|
|
+ task.AddWCS_TASK_DTL(db, "未知", "任务取消");
|
|
|
+ db.Default.Updateable(task).ExecuteCommand();
|
|
|
+ response.IsSuccess = true;
|
|
|
+ response.Message = "成功";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ response.IsSuccess = false;
|
|
|
+ response.Message = $"取消任务失败,{cancelRes.ResMsg}";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ response.IsSuccess = false;
|
|
|
+ response.Message = $"取消任务失败,{res.ResMsg}";
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|