Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -322,5 +322,9 @@
|
||||
/// 一楼中储仓出库工位
|
||||
/// </summary>
|
||||
public const string ZZCSSX111012 = "32609251845653";
|
||||
/// <summary>
|
||||
/// 料箱id
|
||||
/// </summary>
|
||||
public const string LIAOXIANGID = "26037262680357";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,13 @@ using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
@@ -19,6 +21,7 @@ using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
using Result = Tnb.WarehouseMgr.Entities.Dto.Outputs.Result;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
|
||||
@@ -86,6 +89,7 @@ namespace Tnb.WarehouseMgr
|
||||
// && a.carry_status == ((int)EnumCarryStatus.空闲).ToString() && a.is_lock == 0 && b.is_lock == 0 && b.is_type == ((int)EnumLocationType.存储库位).ToString())
|
||||
// .ToListAsync();
|
||||
// 判断最终目标库位是否可以放置当前载具
|
||||
WmsEmptyOutstockH wmsEmptyOutstockH = null;
|
||||
if (carrys?.Count > 0)
|
||||
{
|
||||
WmsCarryH curCarry = carrys[^carrys.Count];
|
||||
@@ -95,8 +99,12 @@ namespace Tnb.WarehouseMgr
|
||||
throw new AppFriendlyException("该载具无法放置到目标库位", 500);
|
||||
}
|
||||
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYOUTSTK_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
// VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYOUTSTK_ID, true);
|
||||
// await _runService.Create(templateEntity, input);
|
||||
|
||||
wmsEmptyOutstockH = JsonConvert.DeserializeObject<WmsEmptyOutstockH>(JsonConvert.SerializeObject(input.data));
|
||||
wmsEmptyOutstockH.id = SnowflakeIdHelper.NextId();
|
||||
await _db.Insertable(wmsEmptyOutstockH).ExecuteCommandAsync();
|
||||
|
||||
}
|
||||
|
||||
@@ -144,7 +152,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
WmsPretaskH preTask = new()
|
||||
{
|
||||
org_id = _userManager.User.OrganizeId,
|
||||
org_id = wmsEmptyOutstockH.org_id,
|
||||
startlocation_id = sPoint?.location_id!,
|
||||
startlocation_code = sPoint?.location_code!,
|
||||
endlocation_id = ePoint?.location_id!,
|
||||
@@ -163,9 +171,10 @@ namespace Tnb.WarehouseMgr
|
||||
carry_code = carrys![i].carry_code,
|
||||
area_id = sPoint?.area_id!,
|
||||
area_code = it.Key,
|
||||
require_id = input.data["ReturnIdentity"].ToString(),
|
||||
// require_id = input.data["ReturnIdentity"].ToString(),
|
||||
require_id = wmsEmptyOutstockH.id,
|
||||
require_code = input.data[nameof(preTask.bill_code)]?.ToString()!,
|
||||
create_id = _userManager.UserId,
|
||||
create_id = wmsEmptyOutstockH.create_id,
|
||||
create_time = DateTime.Now
|
||||
};
|
||||
|
||||
@@ -184,7 +193,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
GenPreTaskUpInput preTaskUpInput = new()
|
||||
{
|
||||
RquireId = input.data["ReturnIdentity"].ToString()!,
|
||||
RquireId = wmsEmptyOutstockH.id!,
|
||||
CarryId = carrys![i].id,
|
||||
CarryStartLocationId = points!.FirstOrDefault()!.location_id!,
|
||||
CarryStartLocationCode = points!.FirstOrDefault()!.location_code!,
|
||||
@@ -201,7 +210,7 @@ namespace Tnb.WarehouseMgr
|
||||
status = WmsWareHouseConst.BILLSTATUS_ON_ID,
|
||||
carry_id = carrys[i].id,
|
||||
carry_code = carrys[i].carry_code,
|
||||
create_id = _userManager.UserId,
|
||||
create_id = wmsEmptyOutstockH.create_id,
|
||||
create_time = DateTime.Now
|
||||
};
|
||||
_ = await _db.Insertable(wmsEmptyOutstockD)
|
||||
@@ -300,6 +309,7 @@ namespace Tnb.WarehouseMgr
|
||||
[nameof(WmsEmptyOutstockH.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID,
|
||||
[nameof(WmsEmptyOutstockH.qty)] = input.qty,
|
||||
[nameof(WmsEmptyOutstockH.biz_type)] = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID,
|
||||
["warehouse_id"] = input.warehouse_id,
|
||||
[nameof(WmsEmptyOutstockH.create_id)] = input.create_id,
|
||||
[nameof(WmsEmptyOutstockH.create_time)] = DateTime.Now
|
||||
};
|
||||
@@ -312,10 +322,11 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message,ex);
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
return ToApiResult();
|
||||
return new Result();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user