| | |
| | | using Rhea.Common; |
| | | using MailKit.Search; |
| | | using Rhea.Common; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | }; |
| | | } |
| | | } |
| | | //合并发料只适用于包装车间工单发料,雅达包装车间编码:1002310010030758 |
| | | else if (Order.WS_CODE != "1002310010030758") |
| | | { |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = Biz.L("备料任务[{0}]不是包装车间工单发料,无法合并单据发料"); |
| | | action.LocaleMsg = Biz.L("WMS.Out_BIZ_WMS_PREP.AddOrder.PrepNot1002310010030758", Order.ORDER_NO); |
| | | return action; |
| | | } |
| | | |
| | | if (!src.IsNullOrEmpty() && src.ORDER_NO != Order.ORDER_NO) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | action.LocaleMsg = Biz.L("WMS.Out_BIZ_WMS_PREP.AddOrder.NoFound", orderNo, src.ORDER_NO, Order.ORDER_NO); |
| | | return action; |
| | | } |
| | | |
| | | // 查询单据明细,并合并到备料单的备料明细中 |
| | | var dtls = bizType.GetPickList(orderNo); |
| | | |
| | | // 查询单据明细,并合并到备料单的备料明细中 |
| | | var dtls = bizType.GetPickList(orderNo); |
| | | if (dtls.Sum(q => q.QTY_ACT_REQ) <= 0) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | action.LocaleMsg = Biz.L("WMS.Out_BIZ_WMS_PREP.AddOrder.NoNeedPrep", orderNo); |
| | | return action; |
| | | } |
| | | //合并发料只适用于包装车间工单发料 |
| | | if (src.IsNullOrEmpty() && Order.BIZ_TYPE == BIZ_WMS_PREP.BIZ_TYPEs.WorkOrder.GetValue()) |
| | | { |
| | | var wo = Biz.Db.Queryable<BIZ_MES_WO>().Where(q => q.ORDER_NO == orderNo).First(); |
| | | //雅达包装车间编码:1002310010030758 |
| | | if (wo?.WS_CODE == "1002310010030758") |
| | | { |
| | | Order.WS_CODE = wo.WS_CODE; |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = Biz.L("单据[{0}]不是包装车间工单,无法合并单据发料"); |
| | | action.LocaleMsg = Biz.L("WMS.Out_BIZ_WMS_PREP.AddOrder.WoNot1002310010030758", orderNo); |
| | | return action; |
| | | } |
| | | } |
| | | |
| | | Order.SourceOrders = Order.SourceOrders ?? new(); |
| | | Order.SourceDetails = Order.SourceDetails ?? new(); |
| | |
| | | { |
| | | var o = db.Storageable(Order, UserCode).WhereColumns(t => new { t.ORDER_NO, t.GHOST_ROW }).ToStorage(); |
| | | o.AsInsertable.ExecuteCommand(); |
| | | o.AsUpdateable.IgnoreColumns(q => q.ID).UpdateColumns(q => new { q.SOURCE_CODE, q.SOURCE_ORDER, q.UPDATE_TIME, q.UPDATE_USER }).ExecuteCommand(); |
| | | o.AsUpdateable.IgnoreColumns(q => q.ID).UpdateColumns(q => new { q.WS_CODE, q.SOURCE_CODE, q.SOURCE_ORDER, q.UPDATE_TIME, q.UPDATE_USER }).ExecuteCommand(); |
| | | db.Storageable(Order.SourceOrders, UserCode).WhereColumns(t => new { t.ORDER_NO, t.SOURCE_ORDER, t.GHOST_ROW }).ToStorage().AsInsertable.ExecuteCommand(); |
| | | db.Storageable(Order.SourceDetails, UserCode).WhereColumns(t => new { t.ORDER_NO, t.ITEM_CODE, t.GHOST_ROW }).ToStorage().AsInsertable.ExecuteCommand(); |
| | | var d = db.Storageable(Order.Details, UserCode).WhereColumns(t => new { t.ORDER_NO, t.ITEM_CODE, t.GHOST_ROW }).ToStorage(); |