Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -84,7 +84,7 @@ public class ModuleConsts
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模块标识-寄存捆包
|
/// 模块标识-寄存捆包
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string MODULE_WMSINBALE_ID = "26192480520485";
|
public const string MODULE_WMSINBALE_ID = "26192480520485";//26192480520485
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模块标识-出库申请
|
/// 模块标识-出库申请
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -143,11 +143,13 @@ namespace Tnb.WarehouseMgr.Entities.Consts
|
|||||||
/// 预任务生成业务类型-配送申请
|
/// 预任务生成业务类型-配送申请
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string BIZTYPE_WMSDELIVERY_ID = "26585291847957";
|
public const string BIZTYPE_WMSDELIVERY_ID = "26585291847957";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 条码打印状态-已完成
|
/// 条码打印状态-已完成
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string BARCODE_PRINT_STATUS_COMPLETE_ID = "26191372853541";
|
public const string BARCODE_PRINT_STATUS_COMPLETE_ID = "26191372853541";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ namespace Tnb.WarehouseMgr.Entities.Dto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string CarryId { get; set; }
|
public string CarryId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 载具id集合
|
||||||
|
/// </summary>
|
||||||
|
public List<string> CarryIds { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 载具Code
|
/// 载具Code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CarryCode { get; set; }
|
public string CarryCode { get; set; }
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using JNPF.Common.Contracts;
|
||||||
|
using JNPF.Common.Security;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Tnb.WarehouseMgr.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 载具台账主表
|
||||||
|
/// </summary>
|
||||||
|
public partial class WmsCarryH
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 是否签收
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public int is_sign { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
102
WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInbale.cs
Normal file
102
WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInbale.cs
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
using JNPF.Common.Contracts;
|
||||||
|
using JNPF.Common.Security;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Tnb.WarehouseMgr.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 寄存捆包
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("wms_inbale")]
|
||||||
|
public partial class WmsInbale : BaseEntity<string>
|
||||||
|
{
|
||||||
|
public WmsInbale()
|
||||||
|
{
|
||||||
|
id = SnowflakeIdHelper.NextId();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 所属组织
|
||||||
|
/// </summary>
|
||||||
|
public string? org_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 起始库位ID
|
||||||
|
/// </summary>
|
||||||
|
public string? location_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单号
|
||||||
|
/// </summary>
|
||||||
|
public string bill_code { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单据状态
|
||||||
|
/// </summary>
|
||||||
|
public string status { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 业务类型
|
||||||
|
/// </summary>
|
||||||
|
public string biz_type { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 载具ID
|
||||||
|
/// </summary>
|
||||||
|
public string carry_id { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 载具编号
|
||||||
|
/// </summary>
|
||||||
|
public string carry_code { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 入库仓库ID
|
||||||
|
/// </summary>
|
||||||
|
public string warehouse_id { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打包号
|
||||||
|
/// </summary>
|
||||||
|
public string bale_num { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建用户
|
||||||
|
/// </summary>
|
||||||
|
public string create_id { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime create_time { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改用户
|
||||||
|
/// </summary>
|
||||||
|
public string? modify_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? modify_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 扩展
|
||||||
|
/// </summary>
|
||||||
|
public string? extras { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 时间戳(用于并发控制)
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? timestamp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 流程任务Id
|
||||||
|
/// </summary>
|
||||||
|
public string? f_flowtaskid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 流程引擎Id
|
||||||
|
/// </summary>
|
||||||
|
public string? f_flowid { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -157,5 +157,9 @@ public partial class WmsPretaskH : BaseEntity<string>
|
|||||||
/// 优先级
|
/// 优先级
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int priority { get; set; } = 1;
|
public int priority { get; set; } = 1;
|
||||||
|
/// <summary>
|
||||||
|
/// 优先级
|
||||||
|
/// </summary>
|
||||||
|
public int is_sign { get; set; } = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
if (i == 0 || i == items.Count - 1) continue;
|
if (i == 0 || i == items.Count - 1) continue;
|
||||||
items[i].chain_type = "2";
|
items[i].chain_type = "2";
|
||||||
}
|
}
|
||||||
items[items.Count - 1].chain_type = "3";
|
items[^1].chain_type = "3";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -281,7 +281,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
x.status = WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID;
|
x.status = WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID;
|
||||||
x.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_TASK_EXECUTE_ENCODE).GetAwaiter().GetResult();
|
x.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_TASK_EXECUTE_ENCODE).GetAwaiter().GetResult();
|
||||||
x.is_sign = 1;
|
|
||||||
});
|
});
|
||||||
var areaPreTasks = itGroup.ToList();
|
var areaPreTasks = itGroup.ToList();
|
||||||
if (moveNum == 1)
|
if (moveNum == 1)
|
||||||
@@ -522,7 +521,14 @@ namespace Tnb.WarehouseMgr
|
|||||||
//根据载具ID,更新是否锁定和赋值起始库位
|
//根据载具ID,更新是否锁定和赋值起始库位
|
||||||
if (setCarryColumnsExp != null)
|
if (setCarryColumnsExp != null)
|
||||||
{
|
{
|
||||||
await _db.Updateable<WmsCarryH>().SetColumns(setCarryColumnsExp).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
|
if (input.CarryIds?.Count > 0)
|
||||||
|
{
|
||||||
|
await _db.Updateable<WmsCarryH>().SetColumns(setCarryColumnsExp).Where(it => input.CarryIds.Contains(it.id)).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await _db.Updateable<WmsCarryH>().SetColumns(setCarryColumnsExp).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据所有库位更新库位的锁定状态为“锁定”
|
//根据所有库位更新库位的锁定状态为“锁定”
|
||||||
|
|||||||
@@ -113,6 +113,11 @@ namespace Tnb.WarehouseMgr
|
|||||||
preTask.create_time = DateTime.Now;
|
preTask.create_time = DateTime.Now;
|
||||||
return preTask;
|
return preTask;
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
//判断目标库位是否自动签收
|
||||||
|
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
|
||||||
|
if (loc.is_sign ==0 ) {
|
||||||
|
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
|
||||||
|
}
|
||||||
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
|
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
|
||||||
if (isOk)
|
if (isOk)
|
||||||
{
|
{
|
||||||
@@ -128,7 +133,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
await _db.Updateable<WmsMoveOutstock>().SetColumns(it => new WmsMoveOutstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
await _db.Updateable<WmsMoveOutstock>().SetColumns(it => new WmsMoveOutstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||||
|
|
||||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||||
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
it => new WmsCarryH { is_lock = 1},
|
||||||
it => new BasLocation { is_lock = 1 });
|
it => new BasLocation { is_lock = 1 });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
/*//入库取终点
|
/*//入库取终点
|
||||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
||||||
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);*/
|
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);*/
|
||||||
|
//判断目标库位是否自动签收
|
||||||
|
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
|
||||||
//出库取起点,获取所有符合输入的载具规格的载具
|
//出库取起点,获取所有符合输入的载具规格的载具
|
||||||
var setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
|
var setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
|
||||||
var carrys = await _db.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id)
|
var carrys = await _db.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id)
|
||||||
@@ -131,6 +132,11 @@ namespace Tnb.WarehouseMgr
|
|||||||
return preTask;
|
return preTask;
|
||||||
}).ToList();
|
}).ToList();
|
||||||
//更新页面
|
//更新页面
|
||||||
|
//赋值签收状态
|
||||||
|
if (loc.is_sign == 0)
|
||||||
|
{
|
||||||
|
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
|
||||||
|
}
|
||||||
isOk = await _wareHouseService.GenPreTask(preTasks, null);
|
isOk = await _wareHouseService.GenPreTask(preTasks, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -157,11 +163,10 @@ namespace Tnb.WarehouseMgr
|
|||||||
await _db.Insertable(wmsEmptyOutstockD)
|
await _db.Insertable(wmsEmptyOutstockD)
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
|
|
||||||
//根据载具移出Id,回更单据状态
|
//根据空载具出库Id,回更单据状态
|
||||||
await _db.Updateable<WmsEmptyOutstockH>().SetColumns(it => new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
await _db.Updateable<WmsEmptyOutstockH>().SetColumns(it => new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||||
|
|
||||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||||
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
it => new WmsCarryH { is_lock = 1},
|
||||||
it => new BasLocation { is_lock = 1 });
|
it => new BasLocation { is_lock = 1 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Dtos.VisualDev;
|
using JNPF.Common.Dtos.VisualDev;
|
||||||
using JNPF.Common.Extension;
|
using JNPF.Common.Extension;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
@@ -14,8 +15,10 @@ using JNPF.VisualDev.Interfaces;
|
|||||||
using Mapster;
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.WarehouseMgr.Entities;
|
using Tnb.WarehouseMgr.Entities;
|
||||||
using Tnb.WarehouseMgr.Entities.Consts;
|
using Tnb.WarehouseMgr.Entities.Consts;
|
||||||
|
using Tnb.WarehouseMgr.Entities.Dto;
|
||||||
using Tnb.WarehouseMgr.Entities.Enums;
|
using Tnb.WarehouseMgr.Entities.Enums;
|
||||||
using Tnb.WarehouseMgr.Interfaces;
|
using Tnb.WarehouseMgr.Interfaces;
|
||||||
|
|
||||||
@@ -32,76 +35,188 @@ namespace Tnb.WarehouseMgr
|
|||||||
private readonly IRunService _runService;
|
private readonly IRunService _runService;
|
||||||
private readonly IVisualDevService _visualDevService;
|
private readonly IVisualDevService _visualDevService;
|
||||||
private readonly IWareHouseService _wareHouseService;
|
private readonly IWareHouseService _wareHouseService;
|
||||||
|
private readonly IUserManager _userManager;
|
||||||
|
private readonly IBillRullService _billRullService;
|
||||||
|
|
||||||
public WmsOutStockService(
|
public WmsOutStockService(
|
||||||
ISqlSugarRepository<WmsOutstockD> repository,
|
ISqlSugarRepository<WmsOutstockD> repository,
|
||||||
IDictionaryDataService dictionaryDataService,
|
IDictionaryDataService dictionaryDataService,
|
||||||
IRunService runService,
|
IRunService runService,
|
||||||
IVisualDevService visualDevService,
|
IVisualDevService visualDevService,
|
||||||
IWareHouseService wareHouseService)
|
IWareHouseService wareHouseService,
|
||||||
|
IUserManager userManager,
|
||||||
|
IBillRullService billRullService)
|
||||||
{
|
{
|
||||||
_db = repository.AsSugarClient();
|
_db = repository.AsSugarClient();
|
||||||
_dictionaryDataService = dictionaryDataService;
|
_dictionaryDataService = dictionaryDataService;
|
||||||
_runService = runService;
|
_runService = runService;
|
||||||
_visualDevService = visualDevService;
|
_visualDevService = visualDevService;
|
||||||
_wareHouseService = wareHouseService;
|
_wareHouseService = wareHouseService;
|
||||||
|
_userManager = userManager;
|
||||||
|
_billRullService = billRullService;
|
||||||
OverideFuncs.CreateAsync = OutStockApplyFor;
|
OverideFuncs.CreateAsync = OutStockApplyFor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private async Task<dynamic> OutStockApplyFor(VisualDevModelDataCrInput input)
|
private async Task<dynamic> OutStockApplyFor(VisualDevModelDataCrInput input)
|
||||||
{
|
{
|
||||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSOUTSTOCK_ID, true);
|
try
|
||||||
await _runService.Create(templateEntity, input);
|
|
||||||
|
|
||||||
//tablefield120 出库物料明细
|
|
||||||
if (input.data.ContainsKey("tablefield120") && input.data["tablefield120"].IsNotEmptyOrNull())
|
|
||||||
{
|
{
|
||||||
var outStockDList = input.data["tablefield120"].ToObject<List<WmsOutstockD>>();
|
await _db.Ado.BeginTranAsync();
|
||||||
if (outStockDList?.Count > 0)
|
|
||||||
|
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSOUTSTOCK_ID, true);
|
||||||
|
await _runService.Create(templateEntity, input);
|
||||||
|
|
||||||
|
//判断目标库位是否自动签收
|
||||||
|
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
|
||||||
|
|
||||||
|
var carryIds = new List<string>();
|
||||||
|
//tablefield120 出库物料明细
|
||||||
|
if (input.data.ContainsKey("tablefield120") && input.data["tablefield120"].IsNotEmptyOrNull())
|
||||||
{
|
{
|
||||||
List<WmsCarryMat> carryMats = new();
|
var outStockDList = input.data["tablefield120"].ToObject<List<WmsOutstockD>>();
|
||||||
foreach (var os in outStockDList)
|
if (outStockDList?.Count > 0)
|
||||||
{
|
{
|
||||||
var carryCodes = await _db.Queryable<WmsCarryH>().InnerJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
|
List<WmsCarryMat> carryMats = new();
|
||||||
.Where((a, b) => b.material_id == os.material_id && b.code_batch == os.code_batch && a.is_lock == 0 &&
|
List<WmsCarryCode> carryCodes = new();
|
||||||
!string.IsNullOrEmpty(a.location_id) && a.status == (int)EnumCarryStatus.占用)
|
foreach (var os in outStockDList)
|
||||||
.Select<WmsCarryCode>()
|
|
||||||
.ToListAsync();
|
|
||||||
if (carryCodes?.Count > 0)
|
|
||||||
{
|
{
|
||||||
var codeQty = carryCodes.Sum(x => x.codeqty);
|
var carryCodesPart = await _db.Queryable<WmsCarryH>().InnerJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
|
||||||
if (codeQty < os.pr_qty)
|
.Where((a, b) => b.material_id == os.material_id && b.code_batch == os.code_batch && a.is_lock == 0 && !string.IsNullOrEmpty(a.location_id) && a.status == (int)EnumCarryStatus.占用)
|
||||||
|
.Select<WmsCarryCode>()
|
||||||
|
.ToListAsync();
|
||||||
|
if (carryCodesPart?.Count > 0)
|
||||||
{
|
{
|
||||||
throw new AppFriendlyException($"需要出库[{os.pr_qty}],实际库存{codeQty},数量不足", 500);
|
carryCodes.AddRange(carryCodesPart);
|
||||||
|
var codeQty = carryCodes.Sum(x => x.codeqty);
|
||||||
|
if (codeQty < os.pr_qty)
|
||||||
|
{
|
||||||
|
throw new AppFriendlyException($"需要出库[{os.pr_qty}],实际库存{codeQty},数量不足", 500);
|
||||||
|
}
|
||||||
|
var partCarryMats = carryCodesPart.Adapt<List<WmsCarryMat>>();
|
||||||
|
partCarryMats.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.need_qty = (int)os.pr_qty;
|
||||||
|
x.real_qty = codeQty;
|
||||||
|
});
|
||||||
|
carryMats.AddRange(partCarryMats);
|
||||||
}
|
}
|
||||||
var partCarryMats = carryCodes.Adapt<List<WmsCarryMat>>();
|
}
|
||||||
partCarryMats.ForEach(x =>
|
if (carryMats.Count > 0)
|
||||||
|
{
|
||||||
|
carryMats.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||||
|
carryMats = carryMats.OrderBy(o => o.create_time).GroupBy(g => new { g.carry_id, g.material_id, g.code_batch })
|
||||||
|
.Select(x =>
|
||||||
|
{
|
||||||
|
WmsCarryMat? carryMat = x.FirstOrDefault()!;
|
||||||
|
carryMat.real_qty = x.Sum(d => d.real_qty);
|
||||||
|
return carryMat;
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
await _db.Insertable(carryMats).ExecuteCommandAsync();
|
||||||
|
var dic = carryMats.DistinctBy(x => x.carry_id).ToDictionary(x => x.carry_id, x => x.real_qty);
|
||||||
|
var allOutIds = new List<string>();
|
||||||
|
var sortingOutIds = new List<string>();
|
||||||
|
foreach (var pair in dic)
|
||||||
{
|
{
|
||||||
x.need_qty = (int)os.pr_qty;
|
var codes = carryCodes.FindAll(x => x.carry_id == pair.Key);
|
||||||
x.real_qty = codeQty;
|
if (codes?.Count > 0)
|
||||||
});
|
{
|
||||||
carryMats.AddRange(partCarryMats);
|
if (pair.Value == codes.Sum(d => d.codeqty))
|
||||||
|
{
|
||||||
|
allOutIds.Add(pair.Key);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sortingOutIds.Add(pair.Key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
carryIds = allOutIds.Concat(sortingOutIds).ToList();
|
||||||
|
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString() }).Where(it => allOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||||
|
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.分拣出).ToString() }).Where(it => sortingOutIds.Contains(it.id)).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
var carrys = await _db.Queryable<WmsCarryH>().Where(it => carryIds.Contains(it.id)).ToListAsync();
|
||||||
|
if (carrys?.Count > 0)
|
||||||
|
{
|
||||||
|
List<WmsPretaskH> preTasks = new();
|
||||||
|
List<string> locIds = new();
|
||||||
|
foreach (var carry in carrys)
|
||||||
|
{
|
||||||
|
WmsPointH sPoint = null;
|
||||||
|
WmsPointH ePoint = null;
|
||||||
|
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
|
||||||
|
{
|
||||||
|
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carry.location_id);
|
||||||
|
}
|
||||||
|
if (input.data.ContainsKey(nameof(WmsPointH.location_id)) && input.data[nameof(WmsPointH.location_id)].IsNotEmptyOrNull())
|
||||||
|
{
|
||||||
|
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
|
||||||
|
}
|
||||||
|
if (sPoint != null && ePoint != null)
|
||||||
|
{
|
||||||
|
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
||||||
|
locIds.AddRange(points.Select(x => x.location_id).ToList()!);
|
||||||
|
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
||||||
|
if (points?.Count > 0)
|
||||||
|
{
|
||||||
|
if (points.Count <= 2) throw new AppFriendlyException("该路径不存在", 500);
|
||||||
|
var curPreTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
|
||||||
|
{
|
||||||
|
var sPoint = it.FirstOrDefault();
|
||||||
|
var ePoint = it.LastOrDefault();
|
||||||
|
|
||||||
|
WmsPretaskH preTask = new();
|
||||||
|
preTask.org_id = _userManager.User.OrganizeId;
|
||||||
|
preTask.startlocation_id = sPoint?.location_id;
|
||||||
|
preTask.startlocation_code = sPoint?.location_code;
|
||||||
|
preTask.endlocation_id = ePoint?.location_id;
|
||||||
|
preTask.endlocation_code = ePoint?.location_code;
|
||||||
|
preTask.start_floor = sPoint?.floor.ToString();
|
||||||
|
preTask.end_floor = ePoint?.floor.ToString();
|
||||||
|
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
|
||||||
|
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
|
||||||
|
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTSTOCK_ID;
|
||||||
|
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
|
||||||
|
preTask.carry_id = carry.id;
|
||||||
|
preTask.carry_code = carry.carry_code;
|
||||||
|
preTask.area_id = sPoint?.area_id!;
|
||||||
|
preTask.area_code = it.Key;
|
||||||
|
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||||
|
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||||
|
preTask.create_id = _userManager.UserId;
|
||||||
|
preTask.create_time = DateTime.Now;
|
||||||
|
return preTask;
|
||||||
|
}).ToList();
|
||||||
|
if (loc.is_sign == 0)
|
||||||
|
{
|
||||||
|
curPreTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
|
||||||
|
}
|
||||||
|
preTasks.AddRange(curPreTasks);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
|
||||||
|
GenPreTaskUpInput genPreTaskAfterUpInput = new();
|
||||||
|
genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList();
|
||||||
|
genPreTaskAfterUpInput.LocationIds = new HashSet<string>(locIds).ToList();
|
||||||
|
await _wareHouseService.GenInStockTaskHandleAfter(genPreTaskAfterUpInput, it => new WmsCarryH { is_lock = 1 }, it => new BasLocation { is_lock = 1 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (carryMats.Count > 0)
|
else throw new AppFriendlyException($"请输入物料明细", 500);
|
||||||
{
|
|
||||||
carryMats.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
|
||||||
carryMats = carryMats.OrderBy(o => o.create_time).GroupBy(g => new { g.carry_id, g.material_id, g.code_batch })
|
|
||||||
.Select(x =>
|
|
||||||
{
|
|
||||||
WmsCarryMat? carryMat = x.FirstOrDefault()!;
|
|
||||||
carryMat.real_qty = x.Sum(d => d.real_qty);
|
|
||||||
return carryMat;
|
|
||||||
})
|
|
||||||
.ToList();
|
|
||||||
await _db.Insertable(carryMats).ExecuteCommandAsync();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return Task.FromResult(0);
|
await _db.Ado.CommitTranAsync();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
await _db.Ado.RollbackTranAsync();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
return Task.FromResult(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
||||||
if (points?.Count > 0)
|
if (points?.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (points.Count <= 2) throw new AppFriendlyException("该路径不存在", 500);
|
if (points.Count <= 2) throw new AppFriendlyException("该路径不存在", 500);
|
||||||
var preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
|
var preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
|
||||||
{
|
{
|
||||||
@@ -113,7 +114,13 @@ namespace Tnb.WarehouseMgr
|
|||||||
preTask.create_time = DateTime.Now;
|
preTask.create_time = DateTime.Now;
|
||||||
return preTask;
|
return preTask;
|
||||||
}).ToList();
|
}).ToList();
|
||||||
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
|
//判断目标库位是否自动签收
|
||||||
|
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
|
||||||
|
if (loc.is_sign == 0)
|
||||||
|
{
|
||||||
|
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
|
||||||
|
}
|
||||||
|
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
|
||||||
if (isOk)
|
if (isOk)
|
||||||
{
|
{
|
||||||
var preTaskUpInput = new GenPreTaskUpInput();
|
var preTaskUpInput = new GenPreTaskUpInput();
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
/*//入库取终点
|
/*//入库取终点
|
||||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
||||||
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);*/
|
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);*/
|
||||||
|
//判断目标库位是否自动签收
|
||||||
|
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
|
||||||
|
|
||||||
//出库取起点,获取所有符合输入的载具规格的载具
|
//出库取起点,获取所有符合输入的载具规格的载具
|
||||||
var setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
|
var setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
|
||||||
@@ -130,6 +132,10 @@ namespace Tnb.WarehouseMgr
|
|||||||
return preTask;
|
return preTask;
|
||||||
}).ToList();
|
}).ToList();
|
||||||
//更新页面
|
//更新页面
|
||||||
|
if (loc.is_sign == 0)
|
||||||
|
{
|
||||||
|
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
|
||||||
|
}
|
||||||
isOk = await _wareHouseService.GenPreTask(preTasks, null);
|
isOk = await _wareHouseService.GenPreTask(preTasks, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -169,7 +175,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
handleH.create_id = _userManager.UserId;
|
handleH.create_id = _userManager.UserId;
|
||||||
handleH.create_time = DateTime.Now;
|
handleH.create_time = DateTime.Now;
|
||||||
preTaskUpInput.PreTaskRecord = handleH;
|
preTaskUpInput.PreTaskRecord = handleH;
|
||||||
//根据载具移出Id,回更单据状态
|
//根据空载具出库Id,回更单据状态
|
||||||
await _db.Updateable<WmsEmptyOutstockH>().SetColumns(it => new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
await _db.Updateable<WmsEmptyOutstockH>().SetColumns(it => new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||||
|
|
||||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||||
|
|||||||
171
WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs
Normal file
171
WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using JNPF.Common.Core.Manager;
|
||||||
|
using JNPF.Common.Dtos.VisualDev;
|
||||||
|
using JNPF.Common.Enums;
|
||||||
|
using JNPF.Common.Extension;
|
||||||
|
using JNPF.Common.Security;
|
||||||
|
using JNPF.FriendlyException;
|
||||||
|
using JNPF.Systems.Interfaces.System;
|
||||||
|
using JNPF.VisualDev;
|
||||||
|
using JNPF.VisualDev.Entitys;
|
||||||
|
using JNPF.VisualDev.Interfaces;
|
||||||
|
using Mapster;
|
||||||
|
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;
|
||||||
|
using Tnb.WarehouseMgr.Interfaces;
|
||||||
|
|
||||||
|
namespace Tnb.WarehouseMgr
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 寄存捆包
|
||||||
|
/// </summary>
|
||||||
|
[OverideVisualDev(ModuleConsts.MODULE_WMSINBALEINSTKPDA_ID)]
|
||||||
|
[ServiceModule(BizTypeId)]
|
||||||
|
public class WmsPDAInbaleService : BaseWareHouseService
|
||||||
|
{
|
||||||
|
private const string BizTypeId = "26191517767205";
|
||||||
|
private readonly ISqlSugarClient _db;
|
||||||
|
private readonly IRunService _runService;
|
||||||
|
private readonly IVisualDevService _visualDevService;
|
||||||
|
private readonly IWareHouseService _wareHouseService;
|
||||||
|
private readonly IBillRullService _billRullService;
|
||||||
|
private readonly IUserManager _userManager;
|
||||||
|
|
||||||
|
|
||||||
|
public WmsPDAInbaleService(
|
||||||
|
ISqlSugarRepository<WmsCarryH> repository,
|
||||||
|
IRunService runService,
|
||||||
|
IVisualDevService visualDevService,
|
||||||
|
IWareHouseService wareHouseService,
|
||||||
|
IUserManager userManager,
|
||||||
|
IBillRullService billRullService)
|
||||||
|
{
|
||||||
|
_db = repository.AsSugarClient();
|
||||||
|
_runService = runService;
|
||||||
|
_visualDevService = visualDevService;
|
||||||
|
_wareHouseService = wareHouseService;
|
||||||
|
_userManager = userManager;
|
||||||
|
_billRullService = billRullService;
|
||||||
|
OverideFuncs.CreateAsync = Inbale;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<dynamic> Inbale(VisualDevModelDataCrInput input)
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await _db.Ado.BeginTranAsync();
|
||||||
|
|
||||||
|
//VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSINBALEINSTKPDA_ID, true);
|
||||||
|
//await _runService.Create(templateEntity, input);
|
||||||
|
//入库取终点 //出库起点
|
||||||
|
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
||||||
|
var inbaleItem =await _db.Queryable<WmsInbale>().SingleAsync(it => it.bill_code == input.data[nameof(WmsInbale.bill_code)].ToString());
|
||||||
|
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
|
||||||
|
WmsPointH sPoint = null;
|
||||||
|
WmsPointH ePoint = null;
|
||||||
|
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
|
||||||
|
{
|
||||||
|
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
|
||||||
|
}
|
||||||
|
if (endLocations?.Count > 0)
|
||||||
|
{
|
||||||
|
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == endLocations[0].id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sPoint != null && ePoint != null)
|
||||||
|
{
|
||||||
|
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
||||||
|
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
||||||
|
if (points?.Count > 0)
|
||||||
|
{
|
||||||
|
if (points.Count <= 2) throw new AppFriendlyException("该路径不存在", 500);
|
||||||
|
var preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
|
||||||
|
{
|
||||||
|
var sPoint = it.FirstOrDefault();
|
||||||
|
var ePoint = it.LastOrDefault();
|
||||||
|
|
||||||
|
WmsPretaskH preTask = new();
|
||||||
|
preTask.org_id = _userManager.User.OrganizeId;
|
||||||
|
preTask.startlocation_id = sPoint?.location_id;
|
||||||
|
preTask.startlocation_code = sPoint?.location_code;
|
||||||
|
preTask.endlocation_id = ePoint?.location_id;
|
||||||
|
preTask.endlocation_code = ePoint?.location_code;
|
||||||
|
preTask.start_floor = sPoint?.floor.ToString();
|
||||||
|
preTask.end_floor = ePoint?.floor.ToString();
|
||||||
|
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
|
||||||
|
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
|
||||||
|
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSINBALE_ID;
|
||||||
|
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||||
|
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||||
|
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||||
|
preTask.area_id = sPoint?.area_id;
|
||||||
|
preTask.area_code = it.Key;
|
||||||
|
preTask.require_id = inbaleItem.id;
|
||||||
|
preTask.require_code = inbaleItem.bill_code;
|
||||||
|
preTask.create_id = _userManager.UserId;
|
||||||
|
preTask.create_time = DateTime.Now;
|
||||||
|
return preTask;
|
||||||
|
}).ToList();
|
||||||
|
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
|
||||||
|
if (isOk)
|
||||||
|
{
|
||||||
|
var preTaskUpInput = new GenPreTaskUpInput();
|
||||||
|
preTaskUpInput.RquireId = inbaleItem.id;
|
||||||
|
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||||
|
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||||
|
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||||
|
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||||
|
|
||||||
|
WmsHandleH handleH = new();
|
||||||
|
handleH.org_id = _userManager.User.OrganizeId;
|
||||||
|
handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString();
|
||||||
|
handleH.endlocation_id = endLocations[0].id;
|
||||||
|
handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString();
|
||||||
|
handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString();
|
||||||
|
handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString();
|
||||||
|
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
|
||||||
|
handleH.require_id = inbaleItem.id;
|
||||||
|
handleH.require_code = inbaleItem.bill_code;
|
||||||
|
handleH.create_id = _userManager.UserId;
|
||||||
|
handleH.create_time = DateTime.Now;
|
||||||
|
preTaskUpInput.PreTaskRecord = handleH;
|
||||||
|
//根据载具移入Id,回更单据状态
|
||||||
|
await _db.Updateable<WmsInbale>().SetColumns(it => new WmsInbale { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||||
|
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode, carry_status= ((int)EnumCarryStatus.寄存).ToString() },
|
||||||
|
it => new BasLocation { is_lock = 1 });
|
||||||
|
//((int)EnumCarryStatus.寄存).ToString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await _db.Ado.CommitTranAsync();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
await _db.Ado.RollbackTranAsync();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
return Task.FromResult(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task ModifyAsync(WareHouseUpInput input)
|
||||||
|
{
|
||||||
|
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||||
|
var row = await _db.Updateable<WmsInbale>().SetColumns(it => new WmsInbale { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
|
||||||
|
if (row < 1) throw Oops.Oh(ErrorCode.COM1001);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user