齐套出库、分拣业务代码调整
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Tnb.WarehouseMgr
|
||||
/// </summary>
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSKITTINGINSTK_ID)]
|
||||
[ServiceModule(BizTypeId)]
|
||||
public class WmsKittingInStkService : BaseWareHouseService
|
||||
public class WmsKittingInStkService : BaseWareHouseService, IWmsKittingInStkService
|
||||
{
|
||||
private const string BizTypeId = "26165655816741";
|
||||
private readonly ISqlSugarClient _db;
|
||||
@@ -125,7 +125,7 @@ namespace Tnb.WarehouseMgr
|
||||
carryCodes = input.data["tablefield130"].ToObject<List<WmsCarryCode>>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<WmsPretaskCode> pretaskCodes = new();
|
||||
foreach (var pt in preTasks)
|
||||
{
|
||||
@@ -166,8 +166,10 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Updateable<WmsKittingInstock>().SetColumns(it => new WmsKittingInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||
var status = ((int)EnumCarryStatus.齐套).ToString();
|
||||
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.data[nameof(WmsHandleH.carry_id)].ToString());
|
||||
if (carry?.out_status != status) {
|
||||
if (carryCodes?.Count>0) {
|
||||
if (carry?.out_status != status)
|
||||
{
|
||||
if (carryCodes?.Count > 0)
|
||||
{
|
||||
carryCodes.ForEach(x =>
|
||||
{
|
||||
x.id = SnowflakeIdHelper.NextId();
|
||||
@@ -176,7 +178,7 @@ namespace Tnb.WarehouseMgr
|
||||
x.create_time = DateTime.Now;
|
||||
});
|
||||
await _db.Insertable(carryCodes).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH
|
||||
@@ -207,6 +209,28 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
var row = await _db.Updateable<WmsKittingInstock>().SetColumns(it => new WmsKittingInstock { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
|
||||
var kittingIn = await _db.Queryable<WmsKittingInstock>().SingleAsync(it => it.id == input.requireId);
|
||||
if (kittingIn != null)
|
||||
{
|
||||
var kittingOut = await _db.Queryable<WmsKittingoutH>().SingleAsync(it => it.id == kittingIn.source_id);
|
||||
if (kittingOut != null)
|
||||
{
|
||||
var locaion = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == kittingOut.location_id);
|
||||
if (locaion != null && locaion.is_type.ToEnum<EnumLocationType>() != EnumLocationType.存储库位)
|
||||
{
|
||||
kittingOut.status = WmsWareHouseConst.BILLSTATUS_TOBESHIPPED_ID;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
kittingOut.status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID;
|
||||
}
|
||||
kittingOut.carry_id = kittingIn.carry_id;
|
||||
kittingOut.carry_code = kittingIn.carry_code;
|
||||
await _db.Updateable(kittingOut).UpdateColumns(it => new { it.status, it.carry_id, it.carry_code }).ExecuteCommandAsync();
|
||||
|
||||
}
|
||||
}
|
||||
if (row < 1) throw Oops.Oh(ErrorCode.COM1001);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user