using HH.WCS.Mobox3.SXJK.dispatch;
|
using HH.WCS.Mobox3.SXJK.models;
|
using HH.WCS.Mobox3.SXJK.process;
|
using HH.WCS.Mobox3.SXJK.wms;
|
using Newtonsoft.Json;
|
using System.Collections.Generic;
|
using System.Web.Http;
|
using static HH.WCS.Mobox3.SXJK.api.ApiHelper;
|
using static HH.WCS.Mobox3.SXJK.api.ApiModel;
|
using static HH.WCS.Mobox3.SXJK.api.OtherModel;
|
using HH.WCS.Mobox3.SXJK.device;
|
using HH.WCS.Mobox3.SXJK.util;
|
using System.Linq;
|
|
|
namespace HH.WCS.Mobox3.SXJK.api {
|
/// <summary>
|
/// mobox3调用,脚本中调用
|
/// </summary>
|
public class MoboxController : System.Web.Http.ApiController {
|
|
/// <summary>
|
/// 远程启动输送线
|
/// </summary>
|
/// <returns></returns>
|
public SimpleResult remoteBootMachine(remoteBootMachineModel model)
|
{
|
LogHelper.Info("[远程启动输送线]remoteBootMachine 入参:" + JsonConvert.SerializeObject(model), "Mobox");
|
SimpleResult simpleResult = new SimpleResult();
|
bool bo = false;
|
var lineDeviceInfo = Settings.lineDeviceInfos.Where(a => a.deviceNo == model.deviceNo && a.type == 3) .First();
|
if (lineDeviceInfo != null)
|
{
|
bo = S7Helper.WriteInt(lineDeviceInfo.deviceNo, 101, lineDeviceInfo.writeAddr + 18, model.signal);
|
}
|
simpleResult.resultCode = bo ? 0 : 1;
|
LogHelper.Info("[远程启动输送线]remoteBootMachine 出参:" + JsonConvert.SerializeObject(simpleResult), "Mobox");
|
return simpleResult;
|
}
|
|
public class remoteBootMachineModel
|
{
|
public string deviceNo { get; set; }
|
public short signal { get; set; }
|
}
|
|
/// <summary>
|
/// 更新抽检信息
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public SimpleResult updateSpotCheckInfo(SpotCheckListModel model)
|
{
|
LogHelper.Info("updateSpotCheckInfo Request:" + JsonConvert.SerializeObject(model), "Mobox");
|
return ApiHelper.updateSpotCheckInfo(model);
|
}
|
|
/// <summary>
|
/// 任务取消(目前支持ndc)
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public SimpleResult CancelTask(MoboxTaskBase model) {
|
var result = new SimpleResult();
|
var task = WCSHelper.GetTask(model.TaskNo);
|
if (task != null) {
|
if (task.S_B_STATE.Trim() == "等待") {
|
//等待直接修改状态为取消
|
WCSHelper.UpdateStatus(model.TaskNo, "取消");
|
result.resultMsg = "任务等待,直接取消";
|
}
|
else if (task.S_B_STATE.Trim() != "取消" && task.S_B_STATE.Trim() != "完成") {
|
//已推送但是没有完成或者取消,通知hosttoagv
|
NDCHelper.Cancel(task.S_CODE.Trim());
|
result.resultMsg = "任务取消已经发送给小车";
|
}
|
else {
|
result.resultCode = 1;
|
result.resultMsg = "任务已结束";
|
}
|
}
|
else {
|
result.resultCode = 1;
|
result.resultMsg = "任务不存在";
|
}
|
return result;
|
}
|
/// <summary>
|
/// 任务强制完成(目前支持ndc)
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public SimpleResult CompleteTask(MoboxTaskBase model) {
|
var result = new SimpleResult();
|
return result;
|
}
|
|
|
/// <summary>
|
/// 码盘校验
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public SimpleResult PalletSorting(PalletSorting model) {
|
return ApiHelper.PalletSorting(model);
|
}
|
/// <summary>
|
/// 码盘校验不带上架(入库)单号
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public SimpleResult PalletSorting1(PalletSorting1 model) {
|
return ApiHelper.PalletSorting1(model);
|
}
|
/// <summary>
|
/// pda入库申请
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public SimpleResult Instock(InstockInfo model) {
|
return ApiHelper.Instock(model);
|
|
}
|
|
/// <summary>
|
/// 发货单执行
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public SimpleResult ShippingOrderExecute(ShippingOrderCheck model) {
|
return ApiHelper.ShippingOrderExecute(model);
|
|
}
|
/// <summary>
|
/// 分拣单执行
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public SimpleResult SortingOrderExecute(SortingOrderCheck model) {
|
return ApiHelper.SortingOrderExecute(model);
|
|
}
|
/// <summary>
|
/// 分拣结果确认(前端拦截数量不可以超过分拣明细中 F_QTY-F_ACC_SR_QTY的数量)
|
/// </summary>
|
/// <returns></returns>
|
public SimpleResult SortingResultCheck(List<SortingResultCheck> models) {
|
return ApiHelper.SortingResultCheck(models);
|
|
}
|
/// <summary>
|
/// 判断是否是整托分拣
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public SimpleResult CheckSortingWholeCntr(CheckSortingWholeCntr model) {
|
return ApiHelper.CheckSortingWholeCntr(model);
|
|
}
|
}
|
}
|