质量bug
This commit is contained in:
@@ -60,5 +60,12 @@ namespace Tnb.ProductionMgr.Interfaces
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<string> ReportInstock(CheckCompleteInput input,PrdReport report = null,ISqlSugarClient db = null);
|
Task<string> ReportInstock(CheckCompleteInput input,PrdReport report = null,ISqlSugarClient db = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// /生产任务下发,开始 、结束、完成
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<dynamic> PrdTaskRelease(PrdTaskReleaseUpInput input, ISqlSugarClient db = null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1110,7 +1110,7 @@ namespace Tnb.ProductionMgr
|
|||||||
/// <exception cref="ArgumentNullException"></exception>
|
/// <exception cref="ArgumentNullException"></exception>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> PrdTaskRelease(PrdTaskReleaseUpInput input)
|
public async Task<dynamic> PrdTaskRelease(PrdTaskReleaseUpInput input,ISqlSugarClient db = null)
|
||||||
{
|
{
|
||||||
int row = -1;
|
int row = -1;
|
||||||
if (input is null)
|
if (input is null)
|
||||||
@@ -1126,10 +1126,17 @@ namespace Tnb.ProductionMgr
|
|||||||
{
|
{
|
||||||
throw new ArgumentException($"{nameof(input.Behavior)} not be null or empty");
|
throw new ArgumentException($"{nameof(input.Behavior)} not be null or empty");
|
||||||
}
|
}
|
||||||
ISqlSugarClient db = _repository.AsSugarClient();
|
|
||||||
|
bool tranFlag = true;
|
||||||
|
if (db==null)
|
||||||
|
{
|
||||||
|
tranFlag = false;
|
||||||
|
db = _repository.AsSugarClient();
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await db.Ado.BeginTranAsync();
|
if(tranFlag) await db.Ado.BeginTranAsync();
|
||||||
List<PrdMoTask> prdTaskList = new List<PrdMoTask>();
|
List<PrdMoTask> prdTaskList = new List<PrdMoTask>();
|
||||||
//var taskList = await _db.Queryable<PrdMoTask>().Where(it => input.TaskIds.Contains(it.id) && it.mo_task_status == DictConst.ToBeScheduledEncode).ToListAsync();
|
//var taskList = await _db.Queryable<PrdMoTask>().Where(it => input.TaskIds.Contains(it.id) && it.mo_task_status == DictConst.ToBeScheduledEncode).ToListAsync();
|
||||||
//if (taskList?.Count > 0)
|
//if (taskList?.Count > 0)
|
||||||
@@ -1606,12 +1613,12 @@ namespace Tnb.ProductionMgr
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await db.Ado.CommitTranAsync();
|
if(tranFlag) await db.Ado.CommitTranAsync();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.Error(e.Message,e);
|
Log.Error(e.Message,e);
|
||||||
await db.Ado.RollbackTranAsync();
|
if(tranFlag) await db.Ado.RollbackTranAsync();
|
||||||
throw Oops.Bah(e.Message);
|
throw Oops.Bah(e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
|||||||
using Tnb.WarehouseMgr.Interfaces;
|
using Tnb.WarehouseMgr.Interfaces;
|
||||||
using Tnb.ProductionMgr.Interfaces;
|
using Tnb.ProductionMgr.Interfaces;
|
||||||
using Tnb.ProductionMgr.Entities;
|
using Tnb.ProductionMgr.Entities;
|
||||||
|
using Tnb.ProductionMgr.Entities.Dto;
|
||||||
using Tnb.WarehouseMgr.Entities.Enums;
|
using Tnb.WarehouseMgr.Entities.Enums;
|
||||||
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
||||||
using Tnb.WarehouseMgr.Entities;
|
using Tnb.WarehouseMgr.Entities;
|
||||||
@@ -151,7 +152,11 @@ namespace Tnb.QcMgr
|
|||||||
// }
|
// }
|
||||||
BasMaterial basMaterial = await db.Queryable<BasMaterial>().Where(x=>x.id==moTask.material_id).FirstAsync();
|
BasMaterial basMaterial = await db.Queryable<BasMaterial>().Where(x=>x.id==moTask.material_id).FirstAsync();
|
||||||
PrdReport prdReport = await db.Queryable<PrdReport>().SingleAsync(x => x.id == QcCheckExecH.report_id);
|
PrdReport prdReport = await db.Queryable<PrdReport>().SingleAsync(x => x.id == QcCheckExecH.report_id);
|
||||||
UserEntity userEntity = await db.Queryable<UserEntity>().SingleAsync(x => x.Id == prdReport.create_id);
|
UserEntity userEntity = null;
|
||||||
|
if (prdReport != null)
|
||||||
|
{
|
||||||
|
userEntity = await db.Queryable<UserEntity>().SingleAsync(x => x.Id == prdReport.create_id);
|
||||||
|
}
|
||||||
CheckTaskOut CheckTaskOut = new()
|
CheckTaskOut CheckTaskOut = new()
|
||||||
{
|
{
|
||||||
mainid = id,
|
mainid = id,
|
||||||
@@ -382,7 +387,25 @@ namespace Tnb.QcMgr
|
|||||||
check_result = ((EnumCheckConclusion)dic[CheckTaskInput.result]).ToString(),
|
check_result = ((EnumCheckConclusion)dic[CheckTaskInput.result]).ToString(),
|
||||||
},prdReport,db);
|
},prdReport,db);
|
||||||
}
|
}
|
||||||
|
}else if (QcCheckExecH.checktype == WmsWareHouseConst.XUNJIAN_ID)
|
||||||
|
{
|
||||||
|
if (CheckTaskInput.result == "no")
|
||||||
|
{
|
||||||
|
PrdMoTask prdMoTask = await db.Queryable<PrdMoTask>().Where(x=>x.mo_task_code==QcCheckExecH.mo_task_code && x.id!=null).FirstAsync();
|
||||||
|
await _prdMoTaskService.PrdTaskRelease(new PrdTaskReleaseUpInput()
|
||||||
|
{
|
||||||
|
TaskIds = NPOI.Util.Arrays.AsList(prdMoTask.id),
|
||||||
|
Behavior = "Pause",
|
||||||
|
PauseReeson = "巡检不合格"
|
||||||
|
});
|
||||||
|
List<string> carryCodes = await db.Queryable<PrdReport>().Where(x=>x.mo_task_id==prdMoTask.id).Select(x=>x.material_box_code).Distinct().ToListAsync();
|
||||||
|
await db.Updateable<WmsCarryH>()
|
||||||
|
.SetColumns(x => x.is_check == ((int)EnumCheckConclusion.暂控).ToString())
|
||||||
|
.Where(x => carryCodes.Contains(x.carry_code))
|
||||||
|
.ExecuteCommandAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await db.Ado.CommitTranAsync();
|
await db.Ado.CommitTranAsync();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -420,6 +443,7 @@ namespace Tnb.QcMgr
|
|||||||
.Select((a, b, c, d, e, f, g, h) => new Result
|
.Select((a, b, c, d, e, f, g, h) => new Result
|
||||||
{
|
{
|
||||||
mainid = a.id,
|
mainid = a.id,
|
||||||
|
bill_code = a.bill_code,
|
||||||
material_name = b.name,
|
material_name = b.name,
|
||||||
material_code = b.code,
|
material_code = b.code,
|
||||||
material_standard = b.material_standard,
|
material_standard = b.material_standard,
|
||||||
|
|||||||
Reference in New Issue
Block a user