| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("GoodpackOffline")] |
| | | [Route("goodpack-offline")] |
| | | public SimpleResult GoodpackOffline(GoodpackOfflineInfo model) { |
| | | LogHelper.InfoApi("好运箱-满托下线入库(PDA)", model); |
| | | return MoboxService.GoodpackOffline(model); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空托/空箱绑定 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public SimpleResult EmptyBind(EmptyBindInfo model) { |
| | | LogHelper.InfoApi("空托/空箱绑定", model); |
| | | ///// <summary> |
| | | ///// 空托/空箱入库绑定(PDA) |
| | | ///// </summary> |
| | | ///// <param name="model"></param> |
| | | ///// <returns></returns> |
| | | //public SimpleResult EmptyBind(EmptyBindInfo model) { |
| | | // LogHelper.InfoApi("空托/空箱绑定", model); |
| | | |
| | | if (model.CntrType == "托盘") { |
| | | //LogHelper.Info($"触发API:空托绑定 " + JsonConvert.SerializeObject(model), "API"); |
| | | return MoboxService.EmptyBindPallet(model); |
| | | } |
| | | else if (model.CntrType == "好运箱") { |
| | | //LogHelper.Info($"触发API:空箱绑定 " + JsonConvert.SerializeObject(model), "API"); |
| | | return MoboxService.EmptyBindGoodpack(model); |
| | | } |
| | | else { |
| | | return BuildSimpleResult(-1, $"不合法的容器类型:'{model.CntrType}'"); |
| | | } |
| | | } |
| | | // if (model.CntrType == "托盘") { |
| | | // //LogHelper.Info($"触发API:空托绑定 " + JsonConvert.SerializeObject(model), "API"); |
| | | // return MoboxService.EmptyBindPallet(model); |
| | | // } |
| | | // else if (model.CntrType == "好运箱") { |
| | | // //LogHelper.Info($"触发API:空箱绑定 " + JsonConvert.SerializeObject(model), "API"); |
| | | // return MoboxService.EmptyBindGoodpack(model); |
| | | // } |
| | | // else { |
| | | // return BuildSimpleResult(-1, $"不合法的容器类型:'{model.CntrType}'"); |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 空托/空箱入库(PDA) |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("empty-inbound")] |
| | | public SimpleResult EmptyInbound(EmptyInboundInfo model) { |
| | | LogHelper.InfoApi("空托/空箱入库", model); |
| | | |
| | | var db = DbHelper.GetDbClient(); |
| | | var locCntrRel = db.Queryable<TN_Loc_Container>() |
| | | .Where(lc => lc.S_LOC_CODE == model.LocCode).First(); |
| | | .Where(lc => lc.S_CNTR_CODE == model.CntrCode).First(); |
| | | |
| | | if (locCntrRel == null) { |
| | | return BuildSimpleResult(-1, $"不存在已绑定容器的货位号:'{model.LocCode}'"); |
| | | return BuildSimpleResult(-1, $"不存在已绑定容器的货位号:'{model.CnteType}'"); |
| | | } |
| | | |
| | | if (locCntrRel.S_CNTR_TYPE == "托盘") { |
| | |
| | | } |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 空托/空箱上线(PDA) |
| | | ///// </summary> |
| | | ///// <returns> |
| | | ///// 人工使用PDA扫码,根据物料类型判断上线空托/空箱 |
| | | ///// </returns> |
| | | //public SimpleResult EmptyOnline(EmptyOnlineInfo model) { |
| | | // var db = DbHelper.GetDbClient(); |
| | | // var locCntrRel = db.Queryable<TN_Loc_Container>() |
| | | // .LeftJoin<TN_CG_Detail>((lc, cd) => lc.S_CNTR_CODE == cd.S_CNTR_CODE) |
| | | // .Where((lc, cd) => cd.S_ITEM_CODE == model.ItemCode) |
| | | // .First(); |
| | | |
| | | // if (locCntrRel.S_CNTR_TYPE == "托盘") { |
| | | |
| | | // return MoboxService.EmptyOnlinePallet(new EmptyOnlinePalletInfo { |
| | | // CntId = locCntrRel.S_CNTR_CODE, |
| | | // EndLoc = model.EndLoc |
| | | // }); |
| | | // } |
| | | // else if (locCntrRel.S_CNTR_TYPE == "好运箱") { |
| | | |
| | | // return MoboxService.EmptyOnlineGoodpack(new EmptyOnlineGoodpackInfo { |
| | | // CntId = locCntrRel.S_CNTR_CODE, |
| | | // EndLoc = model.EndLoc |
| | | // }); |
| | | // } |
| | | // else { |
| | | // return BuildSimpleResult(-1, $"不合法的容器类型:'{locCntrRel.S_CNTR_CODE}'"); |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 空托/空箱上线(PDA) |
| | | /// 托盘-空托上线(PDA) |
| | | /// </summary> |
| | | /// <returns> |
| | | /// 人工使用PDA扫码,根据物料类型判断上线空托/空箱 |
| | | /// </returns> |
| | | public SimpleResult EmptyOnline(EmptyOnlineInfo model) { |
| | | var db = DbHelper.GetDbClient(); |
| | | var locCntrRel = db.Queryable<TN_Loc_Container>() |
| | | .LeftJoin<TN_CG_Detail>((lc, cd) => lc.S_CNTR_CODE == cd.S_CNTR_CODE) |
| | | .Where((lc, cd) => cd.S_CG_ID == model.CgId) |
| | | .First(); |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("empty-online-pallet")] |
| | | public SimpleResult EmptyOnlinePallet(EmptyOnlinePalletInfo model) { |
| | | return MoboxService.EmptyOnlinePallet(model); |
| | | } |
| | | |
| | | if (locCntrRel.S_CNTR_TYPE == "托盘") { |
| | | /// <summary> |
| | | /// 好运箱-空箱上线(PDA) |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("empty-online-goodpack")] |
| | | public SimpleResult EmptyOnlineGoodpack(EmptyOnlineGoodpackInfo model) { |
| | | return MoboxService.EmptyOnlineGoodpack(model); |
| | | } |
| | | |
| | | return MoboxService.EmptyOnlinePallet(new EmptyOnlinePalletInfo { |
| | | CntId = locCntrRel.S_CNTR_CODE, |
| | | EndLoc = model.EndLoc |
| | | }); |
| | | } |
| | | else if (locCntrRel.S_CNTR_TYPE == "好运箱") { |
| | | ///// <summary> |
| | | ///// 合格回库/不合格移库 |
| | | ///// </summary> |
| | | ///// <param name="model"></param> |
| | | ///// <returns></returns> |
| | | //[HttpPost] |
| | | //[Route("CheckShift")] |
| | | //public SimpleResult CheckShift(CheckShiftInfo model) { |
| | | // LogHelper.InfoApi("合格回库/不合格移库", model); |
| | | |
| | | return MoboxService.EmptyOnlineGoodpack(new EmptyOnlineGoodpackInfo { |
| | | CntId = locCntrRel.S_CNTR_CODE, |
| | | EndLoc = model.EndLoc |
| | | }); |
| | | } |
| | | else { |
| | | return BuildSimpleResult(-1, $"不合法的容器类型:'{locCntrRel.S_CNTR_CODE}'"); |
| | | } |
| | | // if (model.Qualified) { |
| | | // return MoboxService.QualifiedBack(model); |
| | | // } |
| | | // else { |
| | | // return MoboxService.UnqualifiedShift(model); |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 合格回库(PDA) |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("qualified-back")] |
| | | public SimpleResult QualifiedBack(QualifiedBackInfo model) { |
| | | return MoboxService.QualifiedBack(model); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 不合格移库(PDA) |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("unqualified-shift")] |
| | | public SimpleResult UnqualifiedShift(UnqualifiedShiftInfo model) { |
| | | return MoboxService.UnqualifiedShift(model); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 余料尾箱回库(PDA) |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("rest-back")] |
| | | public SimpleResult RestBack(RestBackInfo model) { |
| | | return MoboxService.RestBack(model); |
| | | } |
| | | #endregion |
| | | |
| | | #region Mobox 接口 |
| | | /// <summary> |
| | | /// 成品胶出库(WMS) |
| | | /// 成品胶出库(PDA) |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("finished-outbound")] |
| | | public SimpleResult FinishedOutbound(FinishedOutboundInfo model) { |
| | | LogHelper.InfoApi("成品胶出库(WMS)", model); |
| | | if (model.Forced) { |
| | | LogHelper.InfoApi("成品胶出库(PDA)", model); |
| | | if (model.ForcedOut) { |
| | | return MoboxService.FinishedOutboundForce(model); |
| | | } |
| | | return MoboxService.FinishedOutbound(model); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 抽检-创建抽检单(WMS) |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("create-check-order")] |
| | | public SimpleResult CreateCheckOrder(CreateCheckOrderInfo model) { |
| | | return MoboxService.CreateCheckOrder(model); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 移库-创建移库任务(WMS) |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("shift-storage")] |
| | | public SimpleResult CreateShiftOrder(CreateShiftOrderInfo model) { |
| | | return MoboxService.CreateShiftOrder(model); |
| | | } |
| | | #endregion |
| | | } |
| | | } |