出库申请业务回更代码提交

This commit is contained in:
2023-06-28 10:37:49 +08:00
parent 73f0232f0b
commit c665a59fd9
2 changed files with 72 additions and 44 deletions

View File

@@ -17,6 +17,7 @@ using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Tnb.BasicData.Entities;
using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Attributes;
using Tnb.WarehouseMgr.Entities.Consts;
using Tnb.WarehouseMgr.Entities.Dto;
using Tnb.WarehouseMgr.Entities.Enums;
@@ -28,8 +29,10 @@ namespace Tnb.WarehouseMgr
/// 出库申请业务类
/// </summary>
[OverideVisualDev(ModuleConsts.MODULE_WMSOUTSTOCK_ID)]
[ServiceModule(BizTypeId)]
public class WmsOutStockService : BaseWareHouseService, IWmsOutStockService
{
private const string BizTypeId = "26191522660645";
private readonly ISqlSugarClient _db;
private readonly IDictionaryDataService _dictionaryDataService;
private readonly IRunService _runService;
@@ -271,6 +274,10 @@ namespace Tnb.WarehouseMgr
public override async Task ModifyAsync(WareHouseUpInput input)
{
if (input == null) throw new ArgumentNullException("input");
try
{
var carryId = input.carryIds[^input.carryIds.Count];
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == carryId);
if (carry != null)
@@ -285,6 +292,10 @@ namespace Tnb.WarehouseMgr
outStockCodes.ForEach(x =>
{
var billDId = otds?.Find(xx => xx.material_id == x.material_id && xx.code_batch == x.code_batch)?.id;
if (billDId.IsNullOrEmpty())
{
billDId = otds?.Find(xx => xx.material_id == x.material_id)?.id;
}
x.id = SnowflakeIdHelper.NextId();
x.bill_id = input.requireId;
x.bill_d_id = billDId;
@@ -321,5 +332,11 @@ namespace Tnb.WarehouseMgr
}
}
}
catch (Exception ex)
{
throw;
}
}
}
}

View File

@@ -66,6 +66,12 @@ namespace Tnb.WarehouseMgr
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.carryId);
if (carry != null)
{
if (carry.location_id.IsNotEmptyOrNull())
{
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == carry.location_id);
loc.is_use = (int)EnumCarryStatus.;
await _db.Updateable(loc).UpdateColumns(it => it.is_use).ExecuteCommandAsync();
}
var disTask = await _db.Queryable<WmsDistaskH>().SingleAsync(it => it.id == input.disTaskId);
if (disTask != null)
{
@@ -77,18 +83,23 @@ namespace Tnb.WarehouseMgr
case "寄存出库":
case "齐套出库":
case "一般出库":
{
WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List<string> { input.carryId } };
await DoUpdate(upInput); //回更业务
await _wareCarryService.UpdateNullCarry(carry);
}
break;
}
}
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == carry.location_id);
loc.is_use = (int)EnumCarryStatus.;
await _db.Updateable(loc).UpdateColumns(it => it.is_use).ExecuteCommandAsync();
case "载具移出":
{
WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List<string> { input.carryId } };
await DoUpdate(upInput); //回更业务
}
}
break;
}
}
}
}
await _db.Ado.CommitTranAsync();
}
catch (Exception)