This commit is contained in:
alex
2023-07-18 10:38:49 +08:00
8 changed files with 153 additions and 129 deletions

View File

@@ -515,7 +515,7 @@ namespace Tnb.ProductionMgr
[HttpGet] [HttpGet]
public async Task<dynamic> GetUnSchedulingList([FromQuery] VisualDevModelListQueryInput input) public async Task<dynamic> GetUnSchedulingList([FromQuery] VisualDevModelListQueryInput input)
{ {
Dictionary<string, object> queryJson = input.queryJson!=null ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : null; Dictionary<string, object> queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
List<string> moStatusList = new List<string>(); List<string> moStatusList = new List<string>();
if (queryJson!=null && queryJson.ContainsKey("mo_stauts")) if (queryJson!=null && queryJson.ContainsKey("mo_stauts"))
{ {

View File

@@ -23,6 +23,7 @@ using Microsoft.AspNetCore.Mvc;
using DbModels; using DbModels;
using JNPF.Common.Extension; using JNPF.Common.Extension;
using JNPF.Common.Filter; using JNPF.Common.Filter;
using JNPF.Common.Security;
using Tnb.ProductionMgr.Entities.Dto.PrdManage; using Tnb.ProductionMgr.Entities.Dto.PrdManage;
using NPOI.OpenXmlFormats; using NPOI.OpenXmlFormats;
using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.Permission;
@@ -116,26 +117,31 @@ namespace Tnb.ProductionMgr
private async Task<dynamic> GetList(VisualDevModelListQueryInput input) private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
{ {
var db = _repository.AsSugarClient(); var db = _repository.AsSugarClient();
Dictionary<string, object> queryJson = input.queryJson!=null ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : null; Dictionary<string, object> queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
string moTaskCode = queryJson!=null && queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : ""; string moTaskCode = queryJson!=null && queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : "";
Dictionary<string, string> dic = new Dictionary<string, string>() Dictionary<string, object> dic = await _dictionaryDataService.GetDicByKey(DictConst.TaskStatus);
DateTime[] planStartDateArr = null;
DateTime[] planEndDateArr = null;
if (queryJson.TryGetValue("plan_start_date", out var value1))
{ {
[DictConst.ToBeStartedEnCode] = "待开工", planStartDateArr = value1.ToObject<long[]>().Select(x=>x.TimeStampToDateTime()).ToArray();
[DictConst.InProgressEnCode] = "进行中", }
[DictConst.ClosedEnCode] = "关闭", if (queryJson.TryGetValue("plan_end_date", out var value2))
[DictConst.ComplatedEnCode] = "完工", {
[DictConst.ToBeScheduledEncode] = "待排产", planEndDateArr = value2.ToObject<long[]>().Select(x=>x.TimeStampToDateTime()).ToArray();
[DictConst.MoStatusPauseCode] = "暂停", }
[DictConst.MoStatusExceptionCode] = "异常",
[DictConst.MoStatusRevokeCode] = "撤销",
};
var result = await db.Queryable<PrdMoTask>() var result = await db.Queryable<PrdMoTask>()
.LeftJoin<EqpEquipment>((a, b) => a.eqp_id == b.id) .LeftJoin<EqpEquipment>((a, b) => a.eqp_id == b.id)
.LeftJoin<BasMaterial>((a, b, c) => a.material_id == c.id) .LeftJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
.LeftJoin<ToolMolds>((a, b, c, d) => a.mold_id == d.id) .LeftJoin<ToolMolds>((a, b, c, d) => a.mold_id == d.id)
//.Where((a,b,c,d)=>(a.mo_task_status==DictConst.ToBeStartedEnCode || a.mo_task_status==DictConst.InProgressEnCode || a.mo_task_status==DictConst.MoStatusExceptionCode)) .Where((a,b,c,d)=>(a.mo_task_status==DictConst.ToBeStartedEnCode || a.mo_task_status==DictConst.InProgressEnCode || a.mo_task_status==DictConst.MoStatusExceptionCode || a.mo_task_status==DictConst.MoStatusPauseCode || a.mo_task_status==DictConst.ComplatedEnCode))
.Where((a,b,c,d)=>a.schedule_type==1) .Where((a,b,c,d)=>a.schedule_type==1)
.WhereIF(!string.IsNullOrEmpty(moTaskCode),(a,b,c,d)=>a.mo_task_code.Contains(moTaskCode)) .WhereIF(!string.IsNullOrEmpty(moTaskCode),(a,b,c,d)=>a.mo_task_code.Contains(moTaskCode))
.WhereIF(planStartDateArr!=null, (a, b, c, d) => a.estimated_start_date>=planStartDateArr[0] && a.estimated_start_date<=planStartDateArr[1])
.WhereIF(planEndDateArr!=null, (a, b, c, d) => a.estimated_end_date>=planEndDateArr[0] && a.estimated_end_date<=planEndDateArr[1])
.OrderByDescending((a, b, c, d) => a.create_time) .OrderByDescending((a, b, c, d) => a.create_time)
.Select((a, b, c, d) => new PrdTaskManageListOutput() .Select((a, b, c, d) => new PrdTaskManageListOutput()
{ {
@@ -152,7 +158,7 @@ namespace Tnb.ProductionMgr
schedule_type = a.schedule_type.ToString() schedule_type = a.schedule_type.ToString()
}) })
.Mapper(x=>x.mo_task_status=dic[x.mo_task_status]) .Mapper(x=>x.mo_task_status=dic[x.mo_task_status].ToString())
.ToPagedListAsync(input.currentPage, input.pageSize); .ToPagedListAsync(input.currentPage, input.pageSize);
return PageResult<PrdTaskManageListOutput>.SqlSugarPageResult(result); return PageResult<PrdTaskManageListOutput>.SqlSugarPageResult(result);
} }

View File

@@ -72,7 +72,7 @@ namespace Tnb.WarehouseMgr
data.wmsCarryCodes = carryCodes.Adapt<List<CarryCodeQueryOutput>>(); data.wmsCarryCodes = carryCodes.Adapt<List<CarryCodeQueryOutput>>();
} }
catch (Exception ex) catch (Exception)
{ {
await _db.Ado.RollbackTranAsync(); await _db.Ado.RollbackTranAsync();
//return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.InternalServerError, ex.Message); //return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.InternalServerError, ex.Message);

View File

@@ -58,12 +58,12 @@ namespace Tnb.WarehouseMgr
_wareHouseService = wareHouseService; _wareHouseService = wareHouseService;
_userManager = userManager; _userManager = userManager;
_billRullService = billRullService; _billRullService = billRullService;
OverideFuncs.CreateAsync = PDAWmsEmptyOut; OverideFuncs.CreateAsync = WmsEmptyOut;
} }
private async Task<dynamic> PDAWmsEmptyOut(VisualDevModelDataCrInput input) private async Task<dynamic> WmsEmptyOut(VisualDevModelDataCrInput input)
{ {
try try
@@ -226,24 +226,26 @@ namespace Tnb.WarehouseMgr
if (input.IsNull()) throw new ArgumentNullException("input"); if (input.IsNull()) throw new ArgumentNullException("input");
try try
{ {
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.location_code && it.is_type != EnumLocationType..ToString()); var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.location_code && it.is_type != EnumLocationType..ToString()) ?? throw new AppFriendlyException("无此库位或为存储库位",500);
var dic = new Dictionary<string, object>(); Dictionary<string, object> dic = new()
dic[nameof(WmsEmptyOutstockH.id)] = SnowflakeIdHelper.NextId(); {
dic[nameof(WmsEmptyOutstockH.org_id)] = input.org_id; [nameof(WmsEmptyOutstockH.id)] = SnowflakeIdHelper.NextId(),
dic[nameof(WmsEmptyOutstockH.location_id)] = location.id; [nameof(WmsEmptyOutstockH.org_id)] = input.org_id,
dic[nameof(WmsEmptyOutstockH.carrystd_id)] = input.carrystd_id; [nameof(WmsEmptyOutstockH.location_id)] = location.id,
dic[nameof(WmsEmptyOutstockH.bill_code)] = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_EMPTYOUTSTK_ENCODE).GetAwaiter().GetResult(); [nameof(WmsEmptyOutstockH.carrystd_id)] = input.carrystd_id,
dic[nameof(WmsEmptyOutstockH.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID; [nameof(WmsEmptyOutstockH.bill_code)] = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_EMPTYOUTSTK_ENCODE).GetAwaiter().GetResult(),
dic[nameof(WmsEmptyOutstockH.qty)] = input.qty; [nameof(WmsEmptyOutstockH.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID,
dic[nameof(WmsEmptyOutstockH.biz_type)] = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID; [nameof(WmsEmptyOutstockH.qty)] = input.qty,
dic[nameof(WmsEmptyOutstockH.create_id)] = input.create_id; [nameof(WmsEmptyOutstockH.biz_type)] = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID,
dic[nameof(WmsEmptyOutstockH.create_time)] = DateTime.Now; [nameof(WmsEmptyOutstockH.create_id)] = input.create_id,
[nameof(WmsEmptyOutstockH.create_time)] = DateTime.Now
};
VisualDevModelDataCrInput visualDevModelDataCrInput = new VisualDevModelDataCrInput VisualDevModelDataCrInput visualDevModelDataCrInput = new VisualDevModelDataCrInput
{ {
data = dic, data = dic,
}; };
await PDAWmsEmptyOut(visualDevModelDataCrInput); await WmsEmptyOut(visualDevModelDataCrInput);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -272,11 +272,11 @@ namespace Tnb.WarehouseMgr
var loc = await _db.Queryable<BasLocation>().FirstAsync(it => it.location_code == input.instock.location_code && it.is_type != EnumLocationType..ToString()); var loc = await _db.Queryable<BasLocation>().FirstAsync(it => it.location_code == input.instock.location_code && it.is_type != EnumLocationType..ToString());
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.instock.carry_code); var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.instock.carry_code);
//如果数据不全, //如果数据不全或有误
if (carry.IsNull() || loc.IsNull() || instockds?.Count < 1 || instockcodes?.Count < 1) if (carry.IsNull() || loc.IsNull() || instockds?.Count < 1 || instockcodes?.Count < 1)
{ {
//报错, 提示数据不全。 //报错, 提示数据不全或有误
throw new AppFriendlyException("数据不全!", 500); throw new AppFriendlyException("数据不全或有误", 500);
} }
// 生成入库申请数据,添加其他数据 主表 // 生成入库申请数据,添加其他数据 主表
instock.id = SnowflakeIdHelper.NextId(); instock.id = SnowflakeIdHelper.NextId();
@@ -346,26 +346,28 @@ namespace Tnb.WarehouseMgr
var sPoint = it.FirstOrDefault(); var sPoint = it.FirstOrDefault();
var ePoint = it.LastOrDefault(); var ePoint = it.LastOrDefault();
WmsPretaskH preTask = new(); WmsPretaskH preTask = new()
preTask.org_id = _userManager.User.OrganizeId; {
preTask.startlocation_id = sPoint?.location_id ?? string.Empty; org_id = _userManager.User.OrganizeId,
preTask.startlocation_code = sPoint?.location_code ?? string.Empty; startlocation_id = sPoint?.location_id ?? string.Empty,
preTask.endlocation_id = ePoint?.location_id ?? string.Empty; startlocation_code = sPoint?.location_code ?? string.Empty,
preTask.endlocation_code = ePoint?.location_code ?? string.Empty; endlocation_id = ePoint?.location_id ?? string.Empty,
preTask.start_floor = sPoint?.floor.ToString(); endlocation_code = ePoint?.location_code ?? string.Empty,
preTask.end_floor = ePoint?.floor.ToString(); start_floor = sPoint?.floor.ToString(),
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(); end_floor = ePoint?.floor.ToString(),
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID; bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
preTask.biz_type = instock?.biz_type ?? string.Empty; status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID; biz_type = instock?.biz_type ?? string.Empty,
preTask.carry_id = instock?.carry_id ?? string.Empty; task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID,
preTask.carry_code = instock?.carry_code ?? string.Empty; carry_id = instock?.carry_id ?? string.Empty,
preTask.area_id = sPoint?.area_id ?? string.Empty; carry_code = instock?.carry_code ?? string.Empty,
preTask.area_code = it.Key; area_id = sPoint?.area_id ?? string.Empty,
preTask.require_id = instock?.id ?? string.Empty; area_code = it.Key,
preTask.require_code = instock?.bill_code ?? string.Empty; require_id = instock?.id ?? string.Empty,
preTask.create_id = _userManager.UserId; require_code = instock?.bill_code ?? string.Empty,
preTask.create_time = DateTime.Now; create_id = _userManager.UserId,
create_time = DateTime.Now
};
return preTask; return preTask;
}).ToList(); }).ToList();
//生成预任务条码信息 //生成预任务条码信息
@@ -395,12 +397,14 @@ namespace Tnb.WarehouseMgr
if (isOk) if (isOk)
{ {
var preTaskUpInput = new GenPreTaskUpInput(); GenPreTaskUpInput preTaskUpInput = new()
preTaskUpInput.RquireId = instock?.id; {
preTaskUpInput.CarryId = instock?.carry_id!; RquireId = instock?.id,
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()?.location_id; CarryId = instock?.carry_id!,
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()?.location_code; CarryStartLocationId = points.FirstOrDefault()?.location_id,
preTaskUpInput.LocationIds = (points?.Select(x => x.location_id)?.ToList() ?? Enumerable.Empty<string?>().ToList()) as List<string>; CarryStartLocationCode = points.FirstOrDefault()?.location_code,
LocationIds = (points?.Select(x => x.location_id)?.ToList() ?? Enumerable.Empty<string?>().ToList()) as List<string>
};
//创建预任务操作记录 //创建预任务操作记录
var operBillId = string.Empty; var operBillId = string.Empty;

View File

@@ -317,11 +317,11 @@ namespace Tnb.WarehouseMgr
List<WmsOutstockD> outstockDs = input.outstockDs.Adapt<List<WmsOutstockD>>(); List<WmsOutstockD> outstockDs = input.outstockDs.Adapt<List<WmsOutstockD>>();
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.outstock.location_code && it.is_type != EnumLocationType..ToString()); var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.outstock.location_code && it.is_type != EnumLocationType..ToString());
//如果数据不全, //如果数据不全或有误
if (location.IsNull() || outstockDs?.Count < 1) if (location.IsNull() || outstockDs?.Count < 1)
{ {
//报错, 提示数据不全。 //报错, 提示数据不全或有误
throw new AppFriendlyException("数据不全!", 500); throw new AppFriendlyException("数据不全或有误", 500);
} }
// 生成出库申请数据,添加其他数据 主表 // 生成出库申请数据,添加其他数据 主表
outstock.id = SnowflakeIdHelper.NextId(); outstock.id = SnowflakeIdHelper.NextId();

View File

@@ -106,24 +106,26 @@ namespace Tnb.WarehouseMgr
{ {
var sPoint = it.FirstOrDefault(); var sPoint = it.FirstOrDefault();
var ePoint = it.LastOrDefault(); var ePoint = it.LastOrDefault();
//生成预任务
WmsPretaskH preTask = new(); WmsPretaskH preTask = new()
preTask.org_id = _userManager.User.OrganizeId; {
preTask.startlocation_id = sPoint?.location_id!; org_id = _userManager.User.OrganizeId,
preTask.startlocation_code = sPoint?.location_code!; startlocation_id = sPoint?.location_id!,
preTask.endlocation_id = ePoint?.location_id!; startlocation_code = sPoint?.location_code!,
preTask.endlocation_code = ePoint?.location_code!; endlocation_id = ePoint?.location_id!,
preTask.start_floor = sPoint?.floor.ToString(); endlocation_code = ePoint?.location_code!,
preTask.end_floor = ePoint?.floor.ToString(); start_floor = sPoint?.floor.ToString(),
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(); end_floor = ePoint?.floor.ToString(),
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID; bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID; status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID; biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID,
preTask.carry_id = carrys![i].id; task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID,
preTask.carry_code = carrys![i].carry_code; carry_id = carrys![i].id,
preTask.area_id = sPoint?.area_id!; carry_code = carrys![i].carry_code,
preTask.area_code = it.Key; area_id = sPoint?.area_id!,
preTask.require_id = input.data["ReturnIdentity"].ToString(); area_code = it.Key,
require_id = input.data["ReturnIdentity"].ToString()
};
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!; preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
preTask.create_id = _userManager.UserId; preTask.create_id = _userManager.UserId;
preTask.create_time = DateTime.Now; preTask.create_time = DateTime.Now;
@@ -139,39 +141,47 @@ namespace Tnb.WarehouseMgr
} }
if (isOk) if (isOk)
{ {
var preTaskUpInput = new GenPreTaskUpInput(); //生成预任务上传输入
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!; GenPreTaskUpInput preTaskUpInput = new()
preTaskUpInput.CarryId = carrys![i].id; {
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!; RquireId = input.data["ReturnIdentity"].ToString()!,
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!; CarryId = carrys![i].id,
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!; CarryStartLocationId = points.FirstOrDefault()!.location_id!,
CarryStartLocationCode = points.FirstOrDefault()!.location_code!,
LocationIds = points.Select(x => x.location_id).ToList()!
};
//更新明细表 //更新明细表
WmsEmptyOutstockD wmsEmptyOutstockD = new(); WmsEmptyOutstockD wmsEmptyOutstockD = new()
wmsEmptyOutstockD.id = SnowflakeIdHelper.NextId(); {
wmsEmptyOutstockD.bill_id = preTaskUpInput.RquireId; id = SnowflakeIdHelper.NextId(),
wmsEmptyOutstockD.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID; bill_id = preTaskUpInput.RquireId,
wmsEmptyOutstockD.location_id = ePoint!.location_id!; biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID,
wmsEmptyOutstockD.status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID; location_id = ePoint!.location_id!,
wmsEmptyOutstockD.carry_id = carrys[i].id; status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID,
wmsEmptyOutstockD.carry_code = carrys[i].carry_code; carry_id = carrys[i].id,
wmsEmptyOutstockD.create_id = _userManager.UserId; carry_code = carrys[i].carry_code,
wmsEmptyOutstockD.create_time = DateTime.Now; create_id = _userManager.UserId,
create_time = DateTime.Now
};
await _db.Insertable(wmsEmptyOutstockD) await _db.Insertable(wmsEmptyOutstockD)
.ExecuteCommandAsync(); .ExecuteCommandAsync();
WmsHandleH handleH = new(); //生成操作记录表
handleH.org_id = _userManager.User.OrganizeId; WmsHandleH handleH = new()
handleH.startlocation_id = carrys?[i].location_id!; {
handleH.endlocation_id = ePoint!.location_id!; org_id = _userManager.User.OrganizeId,
handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!; startlocation_id = carrys?[i].location_id!,
handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString()!; endlocation_id = ePoint!.location_id!,
handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString()!; bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!,
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!; biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString()!,
handleH.require_id = input.data["ReturnIdentity"].ToString(); carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString()!,
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!; carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!,
handleH.create_id = _userManager.UserId; require_id = input.data["ReturnIdentity"].ToString(),
handleH.create_time = DateTime.Now; require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!,
create_id = _userManager.UserId,
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();

View File

@@ -180,26 +180,28 @@ namespace Tnb.WarehouseMgr
var sPoint = it.FirstOrDefault(); var sPoint = it.FirstOrDefault();
var ePoint = it.LastOrDefault(); var ePoint = it.LastOrDefault();
WmsPretaskH preTask = new(); WmsPretaskH preTask = new()
preTask.org_id = _userManager.User.OrganizeId; {
preTask.startlocation_id = sPoint?.location_id!; org_id = _userManager.User.OrganizeId,
preTask.startlocation_code = sPoint?.location_code!; startlocation_id = sPoint?.location_id!,
preTask.endlocation_id = ePoint?.location_id!; startlocation_code = sPoint?.location_code!,
preTask.endlocation_code = ePoint?.location_code!; endlocation_id = ePoint?.location_id!,
preTask.start_floor = sPoint?.floor.ToString(); endlocation_code = ePoint?.location_code!,
preTask.end_floor = ePoint?.floor.ToString(); start_floor = sPoint?.floor.ToString(),
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(); end_floor = ePoint?.floor.ToString(),
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID; bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
preTask.biz_type = ko.biz_type; status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID; biz_type = ko.biz_type,
preTask.carry_id = ko!.carry_id!; task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID,
preTask.carry_code = ko!.carry_code!; carry_id = ko!.carry_id!,
preTask.area_id = sPoint?.area_id!; carry_code = ko!.carry_code!,
preTask.area_code = it.Key; area_id = sPoint?.area_id!,
preTask.require_id = ko.id; area_code = it.Key,
preTask.require_code = ko.bill_code; require_id = ko.id,
preTask.create_id = _userManager.UserId; require_code = ko.bill_code,
preTask.create_time = DateTime.Now; create_id = _userManager.UserId,
create_time = DateTime.Now
};
return preTask; return preTask;
}).ToList(); }).ToList();
if (loc.is_sign == 0) if (loc.is_sign == 0)