质检
This commit is contained in:
@@ -433,44 +433,46 @@ namespace Tnb.QcMgr
|
|||||||
}
|
}
|
||||||
}else if (QcCheckExecH.checktype == WmsWareHouseConst.XUNJIAN_ID || QcCheckExecH.checktype == WmsWareHouseConst.SHOUJIAN_ID || QcCheckExecH.checktype == WmsWareHouseConst.MOJIAN_ID )
|
}else if (QcCheckExecH.checktype == WmsWareHouseConst.XUNJIAN_ID || QcCheckExecH.checktype == WmsWareHouseConst.SHOUJIAN_ID || QcCheckExecH.checktype == WmsWareHouseConst.MOJIAN_ID )
|
||||||
{
|
{
|
||||||
PrdMoTask prdMoTask = await db.Queryable<PrdMoTask>().Where(x=>x.mo_task_code==QcCheckExecH.mo_task_code && x.id!=null).FirstAsync();
|
PrdMoTask prdMoTask = await db.Queryable<PrdMoTask>().Where(x => x.mo_task_code == QcCheckExecH.mo_task_code && x.id != null).FirstAsync();
|
||||||
if (CheckTaskInput.result == "no")
|
if (CheckTaskInput.result == "no")
|
||||||
|
{
|
||||||
|
string pauseReason = QcCheckExecH.checktype == WmsWareHouseConst.XUNJIAN_ID ? "巡检不合格" : QcCheckExecH.checktype == WmsWareHouseConst.SHOUJIAN_ID ? "首检不合格" : "末检不合格";
|
||||||
|
await _prdMoTaskService.PrdTaskRelease2(new PrdTaskReleaseUpInput()
|
||||||
{
|
{
|
||||||
string pauseReason = QcCheckExecH.checktype == WmsWareHouseConst.XUNJIAN_ID ? "巡检不合格" : QcCheckExecH.checktype == WmsWareHouseConst.SHOUJIAN_ID ? "首检不合格" : "末检不合格";
|
TaskIds = NPOI.Util.Arrays.AsList(prdMoTask.id),
|
||||||
await _prdMoTaskService.PrdTaskRelease2(new PrdTaskReleaseUpInput()
|
Behavior = "Pause",
|
||||||
{
|
PauseReeson = pauseReason
|
||||||
TaskIds = NPOI.Util.Arrays.AsList(prdMoTask.id),
|
}, db);
|
||||||
Behavior = "Pause",
|
|
||||||
PauseReeson = pauseReason
|
|
||||||
},db);
|
|
||||||
|
|
||||||
#region 没看懂逻辑,暂时注释
|
#region 没看懂逻辑,暂时注释
|
||||||
//await _prdMoTaskService.SelfTestScrapped2(new SelfTestScrappedInput()
|
//await _prdMoTaskService.SelfTestScrapped2(new SelfTestScrappedInput()
|
||||||
//{
|
//{
|
||||||
// mo_task_id = prdMoTask.id,
|
// mo_task_id = prdMoTask.id,
|
||||||
// scrap_qty = rqty,
|
// scrap_qty = rqty,
|
||||||
// remark = "抽样不合格报废",
|
// remark = "抽样不合格报废",
|
||||||
// categoryItems = new List<SelfTestScrappedInputItem>()
|
// categoryItems = new List<SelfTestScrappedInputItem>()
|
||||||
// {
|
// {
|
||||||
// new SelfTestScrappedInputItem()
|
// new SelfTestScrappedInputItem()
|
||||||
// {
|
// {
|
||||||
// category_id = "25574005966629",
|
// category_id = "25574005966629",
|
||||||
// items = new List<defectItem>()
|
// items = new List<defectItem>()
|
||||||
// {
|
// {
|
||||||
// new defectItem()
|
// new defectItem()
|
||||||
// {
|
// {
|
||||||
// defective_item = "抽样不合格报废",
|
// defective_item = "抽样不合格报废",
|
||||||
// defective_item_qty = rqty
|
// defective_item_qty = rqty
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//}, db);
|
//}, db);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
List<PrdReport> prdReports= await db.Queryable<PrdReport>().Where(x => x.mo_task_id == prdMoTask.id && x.create_time >= CheckTaskInput.startEndTime[0].TimeStampToDateTime() && x.create_time <= CheckTaskInput.startEndTime[1].TimeStampToDateTime()).ToListAsync();
|
//载具需要在中储仓和暂存仓才需要暂控
|
||||||
//List<string> carryCodes = await db.Queryable<PrdReport>().Where(x => x.mo_task_id == prdMoTask.id && x.create_time >= CheckTaskInput.startEndTime[0].TimeStampToDateTime() && x.create_time <= CheckTaskInput.startEndTime[1].TimeStampToDateTime()).Select(x => x.material_box_code).Distinct().ToListAsync();
|
List<PrdReport> prdReports = await db.Queryable<PrdReport>().LeftJoin<WmsCarryH>((a, b) => a.material_box_code == b.carry_code).LeftJoin<BasLocation>((a, b, c) => b.location_id == c.id).LeftJoin<BasWarehouse>((a, b, c, d) => c.wh_id == d.id).Where((a, b, c, d) => a.mo_task_id == prdMoTask.id && a.create_time >= CheckTaskInput.startEndTime[0].TimeStampToDateTime() && a.create_time <= CheckTaskInput.startEndTime[1].TimeStampToDateTime() && (c.wh_id == WmsWareHouseConst.WAREHOUSE_ZC_ID || c.wh_id == WmsWareHouseConst.WAREHOUSE_ZCC_ID)).ToListAsync();
|
||||||
var carryCodes= prdReports.Select(r=>r.material_box_code).Distinct().ToList();
|
if (prdReports != null)
|
||||||
|
{
|
||||||
|
var carryCodes = prdReports.Select(r => r.material_box_code).Distinct().ToList();
|
||||||
if (carryCodes != null && carryCodes.Count > 0)
|
if (carryCodes != null && carryCodes.Count > 0)
|
||||||
{
|
{
|
||||||
await db.Updateable<WmsCarryH>()
|
await db.Updateable<WmsCarryH>()
|
||||||
@@ -512,7 +514,7 @@ namespace Tnb.QcMgr
|
|||||||
|
|
||||||
#region 记录暂控处理单主/子表信息
|
#region 记录暂控处理单主/子表信息
|
||||||
|
|
||||||
if(carryCodes!=null && carryCodes.Count > 0)
|
if (carryCodes != null && carryCodes.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
var basMaterial = await db.Queryable<BasMaterial>().Where(r => r.id == prdMoTask.material_id).FirstAsync();
|
var basMaterial = await db.Queryable<BasMaterial>().Where(r => r.id == prdMoTask.material_id).FirstAsync();
|
||||||
@@ -594,7 +596,6 @@ namespace Tnb.QcMgr
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user