出库签收代码调整
This commit is contained in:
@@ -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<WmsDistaskH> repository)
|
||||
private readonly IWmsCarryService _wareCarryService;
|
||||
private readonly IDictionaryDataService _dictionaryDataService;
|
||||
private static Dictionary<string, object> _dicBizType = new();
|
||||
public WmsSignForDeliveryService(ISqlSugarRepository<WmsDistaskH> repository, IWmsCarryService wareCarryService, IDictionaryDataService dictionaryDataService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_wareCarryService = wareCarryService;
|
||||
_dictionaryDataService = dictionaryDataService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据载具ID获取,对应的执行任务记录
|
||||
@@ -35,10 +46,40 @@ namespace Tnb.WarehouseMgr
|
||||
var item = await _db.Queryable<WmsDistaskH>().FirstAsync(it => it.carry_id == carryId && it.status == WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID && it.is_sign == 0);
|
||||
return item;
|
||||
}
|
||||
/// <summary>
|
||||
/// 出库签收
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[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<WmsCarryH>().SingleAsync(it => it.id == input.carryId);
|
||||
if (carry != null)
|
||||
{
|
||||
var disTask = await _db.Queryable<WmsDistaskH>().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<BasLocation>().SingleAsync(it => it.id == carry.location_id);
|
||||
loc.is_use = "0";
|
||||
await _db.Updateable(loc).UpdateColumns(it => it.is_use).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user