From 25bdc6af840413977214d1014a56a5d2d134d2e2 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 26 Jun 2023 18:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=AD=BE=E6=94=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Consts/WmsWareHouseConst.cs | 4 ++ .../Dto/Inputs/SignForDeliveryInput.cs | 27 ++++++++++ .../Tnb.WarehouseMgr/WmsCarryService.cs | 2 +- .../WmsSignForDeliveryService.cs | 49 +++++++++++++++++-- 4 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs index e2154202..83daa894 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs @@ -15,6 +15,10 @@ namespace Tnb.WarehouseMgr.Entities.Consts /// public const string WMS_INSTOCK_D_BILL_STATUS_TYPEID = "25065133038101"; /// + /// 业务类型TypeId + /// + public const string WMS_BIZTYPE_ID = "25043955941909"; + /// /// 预任务生成EnCode /// public const string WMS_PRETASK_H_ENCODE = "PreTaskGen"; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs new file mode 100644 index 00000000..75ddcae5 --- /dev/null +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +{ + /// + /// 出库签收输入参数 + /// + public class SignForDeliveryInput + { + /// + /// 任务ID + /// + public string disTaskId { get; set; } + /// + /// 载具ID + /// + public string carryId { get; set; } + /// + /// 服务模块 + /// + public string serviceModule { get; set; } + } +} diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs index 26f9547e..2596f2f4 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs @@ -164,7 +164,7 @@ namespace Tnb.WarehouseMgr carryObj.location_id = null; carryObj.location_code = null; carryObj.out_status = "0"; - carryObj.is_check = 0; + carryObj.is_check = 1; carryObj.status = 1; carryObj.bale_num = null; carryObj.collocation_scheme_id = null; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs index e9c2809f..9242aa8d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs @@ -1,15 +1,22 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; +using JNPF.Common.Contracts; using JNPF.Common.Enums; +using JNPF.Common.Extension; using JNPF.FriendlyException; +using JNPF.Systems.Interfaces.System; using Microsoft.AspNetCore.Mvc; using Microsoft.CodeAnalysis.Operations; using SqlSugar; +using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Consts; +using Tnb.WarehouseMgr.Entities.Dto.Inputs; +using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr { @@ -19,10 +26,14 @@ namespace Tnb.WarehouseMgr public class WmsSignForDeliveryService : BaseWareHouseService { private readonly ISqlSugarClient _db; - - public WmsSignForDeliveryService(ISqlSugarRepository repository) + private readonly IWmsCarryService _wareCarryService; + private readonly IDictionaryDataService _dictionaryDataService; + private static Dictionary _dicBizType = new(); + public WmsSignForDeliveryService(ISqlSugarRepository repository, IWmsCarryService wareCarryService, IDictionaryDataService dictionaryDataService) { _db = repository.AsSugarClient(); + _wareCarryService = wareCarryService; + _dictionaryDataService = dictionaryDataService; } /// /// 根据载具ID获取,对应的执行任务记录 @@ -35,10 +46,40 @@ namespace Tnb.WarehouseMgr var item = await _db.Queryable().FirstAsync(it => it.carry_id == carryId && it.status == WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID && it.is_sign == 0); return item; } + /// + /// 出库签收 + /// + /// [HttpPost] - public async Task SaveData() + public async Task SignForDelivery(SignForDeliveryInput input) { - + if (_dicBizType.Count < 1) + { + _dicBizType = await _dictionaryDataService.GetDictionaryByTypeId(WmsWareHouseConst.WMS_BIZTYPE_ID); + } + var carry = await _db.Queryable().SingleAsync(it => it.id == input.carryId); + if (carry != null) + { + var disTask = await _db.Queryable().SingleAsync(it => it.id == input.disTaskId); + if (disTask != null) + { + if (_dicBizType.ContainsKey(disTask.biz_type)) + { + switch (_dicBizType[disTask.biz_type]) + { + case "空载具出库": + case "寄存出库": + case "齐套出库": + case "一般出库": + await _wareCarryService.UpdateNullCarry(carry); + break; + } + } + } + var loc = await _db.Queryable().SingleAsync(it => it.id == carry.location_id); + loc.is_use = "0"; + await _db.Updateable(loc).UpdateColumns(it => it.is_use).ExecuteCommandAsync(); + } } } }