| | |
| | | using HH.WCS.DaYang.dispatch; |
| | | using HH.WCS.DaYang.process; |
| | | using HH.WCS.DaYang.util; |
| | | using HH.WCS.DaYang.wms; |
| | | using System.Collections.Generic; |
| | | using System.Web.Http; |
| | | using static HH.WCS.DaYang.api.ApiModel; |
| | | using static HH.WCS.DaYang.api.OtherModel; |
| | | using static System.Net.WebRequestMethods; |
| | | |
| | | namespace HH.WCS.DaYang.api { |
| | | namespace HH.WCS.DaYang.api |
| | | { |
| | | /// <summary> |
| | | /// mobox3调用,脚本中调用 |
| | | /// </summary> |
| | | public class MoboxController : System.Web.Http.ApiController { |
| | | public class MoboxController : System.Web.Http.ApiController |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 任务暂停的请求 |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public SimpleResult PauseTask() { |
| | | public SimpleResult PauseTask() |
| | | { |
| | | var result = new SimpleResult(); |
| | | //ManualTaskSwitch [{"Area":"AAA","State":0}] |
| | | //准备一个数据模型,作为开关,收到暂停请求后,打开,后续相关流程的任务不再推送 |
| | |
| | | //收到暂停请求后, |
| | | return result; |
| | | } |
| | | public SimpleResult RecoverTask() { |
| | | public SimpleResult RecoverTask() |
| | | { |
| | | var result = new SimpleResult(); |
| | | //ManualTaskSwitch [{"Area":"AAA","State":0}] |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public SimpleResult CancelTask(MoboxTaskBase model) { |
| | | public SimpleResult CancelTask(MoboxTaskBase model) |
| | | { |
| | | var result = new SimpleResult(); |
| | | var task = WCSHelper.GetTask(model.TaskNo); |
| | | if (task != null) { |
| | | if (task.N_B_STATE == 0) { |
| | | if (task != null) |
| | | { |
| | | if (task.N_B_STATE == 0) |
| | | { |
| | | //等待直接修改状态为取消 |
| | | WCSHelper.UpdateStatus(model.TaskNo, 4); |
| | | result.resultMsg = "任务等待,直接取消"; |
| | | } |
| | | else if (task.N_B_STATE != 3 && task.N_B_STATE != 4) { |
| | | //已推送但是没有完成或者取消,通知hosttoagv |
| | | NDCHelper.Cancel(task.S_CODE.Trim()); |
| | | result.resultMsg = "任务取消已经发送给小车"; |
| | | else if (task.N_B_STATE != 3 && task.N_B_STATE != 4) |
| | | { |
| | | var url = Settings.tableUrls.Find(a => a.id == 2); |
| | | if (url != null) |
| | | { |
| | | HttpHelper http = new HttpHelper(); |
| | | var CancelResult = http.CancelTask(task, url.url); |
| | | if (CancelResult != null && CancelResult.Code ==200) |
| | | { |
| | | WCSHelper.UpdateStatus(model.TaskNo, 4); |
| | | result.resultMsg = "任务取消已下发"; |
| | | } |
| | | else |
| | | { |
| | | result.resultMsg = "任务取消失败"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"任务取消,未找到对应取消任务接口,请检查配置文件"); |
| | | } |
| | | |
| | | } |
| | | else { |
| | | else |
| | | { |
| | | result.resultCode = 1; |
| | | result.resultMsg = "任务已结束"; |
| | | } |
| | | } |
| | | else { |
| | | else |
| | | { |
| | | result.resultCode = 1; |
| | | result.resultMsg = "任务不存在"; |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public SimpleResult CompleteTask(MoboxTaskBase model) { |
| | | public SimpleResult CompleteTask(MoboxTaskBase model) |
| | | { |
| | | var result = new SimpleResult(); |
| | | return result; |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public SimpleResult PalletSorting(PalletSorting model) { |
| | | public SimpleResult PalletSorting(PalletSorting model) |
| | | { |
| | | return ApiHelper.PalletSorting(model); |
| | | } |
| | | /// <summary> |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public SimpleResult PalletSorting1(PalletSorting1 model) { |
| | | public SimpleResult PalletSorting1(PalletSorting1 model) |
| | | { |
| | | return ApiHelper.PalletSorting1(model); |
| | | } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public SimpleResult Instock(InstockInfo model) { |
| | | public SimpleResult Instock(InstockInfo model) |
| | | { |
| | | return ApiHelper.Instock(model); |
| | | |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public SimpleResult ShippingOrderExecute(ShippingOrderCheck model) { |
| | | public SimpleResult ShippingOrderExecute(ShippingOrderCheck model) |
| | | { |
| | | return ApiHelper.ShippingOrderExecute(model); |
| | | |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public SimpleResult SortingOrderExecute(SortingOrderCheck model) { |
| | | public SimpleResult SortingOrderExecute(SortingOrderCheck model) |
| | | { |
| | | return ApiHelper.SortingOrderExecute(model); |
| | | |
| | | } |
| | |
| | | /// 分拣结果确认(前端拦截数量不可以超过分拣明细中 F_QTY-F_ACC_SR_QTY的数量) |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public SimpleResult SortingResultCheck(List<SortingResultCheck> models) { |
| | | public SimpleResult SortingResultCheck(List<SortingResultCheck> models) |
| | | { |
| | | return ApiHelper.SortingResultCheck(models); |
| | | |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public SimpleResult CheckSortingWholeCntr(CheckSortingWholeCntr model) { |
| | | public SimpleResult CheckSortingWholeCntr(CheckSortingWholeCntr model) |
| | | { |
| | | return ApiHelper.CheckSortingWholeCntr(model); |
| | | |
| | | } |