bug
This commit is contained in:
@@ -13,6 +13,7 @@ using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.BasicData.Entities;
|
||||
@@ -55,6 +56,7 @@ namespace Tnb.WarehouseMgr
|
||||
/// <returns></returns>
|
||||
public async Task<Entities.Dto.Outputs.Result> PrdInstock(WmsPrdInstockInput input)
|
||||
{
|
||||
Logger.LogInformation($"【PrdInstock】传入参数 {JsonConvert.SerializeObject(input)}");
|
||||
try
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
@@ -62,6 +64,7 @@ namespace Tnb.WarehouseMgr
|
||||
WmsPrdInstockH prdInstockH = _db.Queryable<WmsPrdInstockH>().Where(r => r.prd_bill_code == input.prd_bill_code).First();
|
||||
|
||||
string prd_instock_code_id = "";
|
||||
string type = "";
|
||||
// 新建主表
|
||||
if (prdInstockH == null)
|
||||
{
|
||||
@@ -85,6 +88,7 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Insertable(wmsPrdInstockH).ExecuteCommandAsync();
|
||||
|
||||
prd_instock_code_id = wmsPrdInstockH.id;
|
||||
type = input.type;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -95,6 +99,8 @@ namespace Tnb.WarehouseMgr
|
||||
pqty = input.pqty,
|
||||
rqty = input.rqty
|
||||
}).Where(r => r.id == prd_instock_code_id).ExecuteCommandAsync();
|
||||
|
||||
type = prdInstockH.type;
|
||||
}
|
||||
|
||||
List<WmsPrdInstockD> WmsPrdInstockDs = new List<WmsPrdInstockD>();
|
||||
@@ -152,9 +158,12 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
BasLocation endlocation_ssx = null;
|
||||
string startlocation_id_ssx = null;
|
||||
// 注塑线边库到2,4输送线
|
||||
if (startLocation.wh_id == "32604516180501")
|
||||
|
||||
|
||||
if (type == "25019163616533")
|
||||
{
|
||||
Logger.LogInformation($"【PrdInstock】注塑车间生产提报");
|
||||
// 注塑线边库到2,4输送线
|
||||
// 根据ZSSSXCTU01 ZSSSXCTU02任务数平均分配任务
|
||||
endlocation_ssx = await _db.Queryable<BasLocation>().Where(r => new string[2] { "32624148726549", "32624157608981" }.Contains(r.id)).OrderBy("is_lock, task_nums, location_code").FirstAsync();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
|
||||
@@ -169,35 +178,87 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
startlocation_id_ssx = "32609093546005";
|
||||
}
|
||||
|
||||
WmsCarryH wmsCarryH = await _db.Queryable<WmsCarryH>().Where(r => r.id == wmsPrdInstockD.carry_id).FirstAsync();
|
||||
|
||||
// 生成到输送线任务
|
||||
CommonCreatePretaskInput commonCreatePretaskInput1 = new CommonCreatePretaskInput();
|
||||
commonCreatePretaskInput1.startlocation_id = startLocation.id;
|
||||
commonCreatePretaskInput1.endlocation_id = endlocation_ssx.id;
|
||||
commonCreatePretaskInput1.carry_id = wmsCarryH.id;
|
||||
commonCreatePretaskInput1.carry_code = wmsCarryH.carry_code;
|
||||
commonCreatePretaskInput1.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
commonCreatePretaskInput1.biz_type = "";
|
||||
commonCreatePretaskInput1.require_id = wmsPrdInstockD.id;
|
||||
commonCreatePretaskInput1.isExcuteMission = false;
|
||||
Entities.Dto.Outputs.Result res1 = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput1);
|
||||
if (res1.code != HttpStatusCode.OK)
|
||||
{
|
||||
throw new Exception($"注塑车间生成到输送线的任务失败 {res1.msg}");
|
||||
}
|
||||
|
||||
// 生成到中储仓任务
|
||||
CommonCreatePretaskInput commonCreatePretaskInput2 = new CommonCreatePretaskInput();
|
||||
commonCreatePretaskInput2.startlocation_id = startlocation_id_ssx;
|
||||
commonCreatePretaskInput2.endlocation_id = endLocation.id;
|
||||
commonCreatePretaskInput2.carry_id = wmsCarryH.id;
|
||||
commonCreatePretaskInput2.carry_code = wmsCarryH.carry_code;
|
||||
commonCreatePretaskInput2.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
commonCreatePretaskInput2.biz_type = WmsWareHouseConst.BIZTYPE_WMSPRDINSTOCK_ID;
|
||||
commonCreatePretaskInput2.require_id = wmsPrdInstockD.id;
|
||||
commonCreatePretaskInput2.isChangeCarryLoc2StartLoc = false;
|
||||
|
||||
Entities.Dto.Outputs.Result res2 = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput2);
|
||||
if (res2.code != HttpStatusCode.OK)
|
||||
{
|
||||
throw new Exception($"注塑车间生成到中储仓的任务失败 {res2.msg}");
|
||||
}
|
||||
}
|
||||
else if (type == "25019172714005")
|
||||
{
|
||||
Logger.LogInformation($"【PrdInstock】挤出车间生产提报");
|
||||
WmsCarryH wmsCarryH = await _db.Queryable<WmsCarryH>().Where(r => r.id == wmsPrdInstockD.carry_id).FirstAsync();
|
||||
|
||||
// 生成到中储仓任务
|
||||
CommonCreatePretaskInput commonCreatePretaskInput2 = new CommonCreatePretaskInput();
|
||||
commonCreatePretaskInput2.startlocation_id = startLocation.id;
|
||||
commonCreatePretaskInput2.endlocation_id = endLocation.id;
|
||||
commonCreatePretaskInput2.carry_id = wmsCarryH.id;
|
||||
commonCreatePretaskInput2.carry_code = wmsCarryH.carry_code;
|
||||
commonCreatePretaskInput2.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
commonCreatePretaskInput2.biz_type = WmsWareHouseConst.BIZTYPE_WMSPRDINSTOCK_ID;
|
||||
commonCreatePretaskInput2.require_id = wmsPrdInstockD.id;
|
||||
commonCreatePretaskInput2.isChangeCarryLoc2StartLoc = false;
|
||||
|
||||
Entities.Dto.Outputs.Result res2 = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput2);
|
||||
if (res2.code != HttpStatusCode.OK)
|
||||
{
|
||||
throw new Exception($"挤出车间生成到中储仓的任务失败 {res2.msg}");
|
||||
}
|
||||
}
|
||||
else if (type == "25019191681045")
|
||||
{
|
||||
Logger.LogInformation($"【PrdInstock】包装车间生产提报");
|
||||
WmsCarryH wmsCarryH = await _db.Queryable<WmsCarryH>().Where(r => r.id == wmsPrdInstockD.carry_id).FirstAsync();
|
||||
|
||||
// 生成到中储仓任务
|
||||
CommonCreatePretaskInput commonCreatePretaskInput2 = new CommonCreatePretaskInput();
|
||||
commonCreatePretaskInput2.startlocation_id = startLocation.id;
|
||||
commonCreatePretaskInput2.endlocation_id = endLocation.id;
|
||||
commonCreatePretaskInput2.carry_id = wmsCarryH.id;
|
||||
commonCreatePretaskInput2.carry_code = wmsCarryH.carry_code;
|
||||
commonCreatePretaskInput2.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
commonCreatePretaskInput2.biz_type = WmsWareHouseConst.BIZTYPE_WMSPRDINSTOCK_ID;
|
||||
commonCreatePretaskInput2.require_id = wmsPrdInstockD.id;
|
||||
commonCreatePretaskInput2.isChangeCarryLoc2StartLoc = false;
|
||||
|
||||
Entities.Dto.Outputs.Result res2 = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput2);
|
||||
if (res2.code != HttpStatusCode.OK)
|
||||
{
|
||||
throw new Exception($"包装车间生成到中储仓的任务失败 {res2.msg}");
|
||||
}
|
||||
}
|
||||
|
||||
WmsCarryH wmsCarryH = await _db.Queryable<WmsCarryH>().Where(r => r.id == wmsPrdInstockD.carry_id).FirstAsync();
|
||||
|
||||
// 生成到输送线任务
|
||||
CommonCreatePretaskInput commonCreatePretaskInput1 = new CommonCreatePretaskInput();
|
||||
commonCreatePretaskInput1.startlocation_id = startLocation.id;
|
||||
commonCreatePretaskInput1.endlocation_id = endlocation_ssx.id;
|
||||
commonCreatePretaskInput1.carry_id = wmsCarryH.id;
|
||||
commonCreatePretaskInput1.carry_code = wmsCarryH.carry_code;
|
||||
commonCreatePretaskInput1.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
commonCreatePretaskInput1.biz_type = "";
|
||||
commonCreatePretaskInput1.require_id = wmsPrdInstockD.id;
|
||||
commonCreatePretaskInput1.isExcuteMission = false;
|
||||
Entities.Dto.Outputs.Result res1 = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput1);
|
||||
|
||||
// 生成到中储仓任务
|
||||
CommonCreatePretaskInput commonCreatePretaskInput2 = new CommonCreatePretaskInput();
|
||||
commonCreatePretaskInput2.startlocation_id = startlocation_id_ssx;
|
||||
commonCreatePretaskInput2.endlocation_id = endLocation.id;
|
||||
commonCreatePretaskInput2.carry_id = wmsCarryH.id;
|
||||
commonCreatePretaskInput2.carry_code = wmsCarryH.carry_code;
|
||||
commonCreatePretaskInput2.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
commonCreatePretaskInput2.biz_type = WmsWareHouseConst.BIZTYPE_WMSPRDINSTOCK_ID;
|
||||
commonCreatePretaskInput2.require_id = wmsPrdInstockD.id;
|
||||
commonCreatePretaskInput2.isExcuteMission = false;
|
||||
commonCreatePretaskInput2.isChangeCarryLoc2StartLoc = false;
|
||||
|
||||
Entities.Dto.Outputs.Result res2 = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user