生产工单 任务单 提报表 相关数量的类型 int 改成 decimal
This commit is contained in:
@@ -802,7 +802,7 @@ namespace Tnb.ProductionMgr
|
||||
// await _qcCheckPlanService.CreateTask(entity);
|
||||
#endregion
|
||||
//根据工单号获取当前工单包含的已排产数
|
||||
int? schedQty = db.Queryable<PrdMoTask>().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty);
|
||||
decimal? schedQty = db.Queryable<PrdMoTask>().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty);
|
||||
|
||||
if (mo != null)
|
||||
{//判断如果当前 工单的已排产数大于工单计划数量则更新工单状态为 已排产
|
||||
@@ -982,7 +982,7 @@ namespace Tnb.ProductionMgr
|
||||
//await db.Insertable(sacipRecord).ExecuteCommandAsync();
|
||||
|
||||
//根据工单号获取当前工单包含的已排产数
|
||||
int? schedQty = _db.Queryable<PrdMoTask>().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty);
|
||||
decimal? schedQty = _db.Queryable<PrdMoTask>().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty);
|
||||
// if (mo != null)
|
||||
// {//判断如果当前 工单的已排产数大于工单计划数量则更新工单状态为 已排产
|
||||
// if (schedQty.HasValue && schedQty.Value >= mo.plan_qty)
|
||||
@@ -2131,8 +2131,8 @@ namespace Tnb.ProductionMgr
|
||||
plan_check_type = WmsWareHouseConst.LINGBUJIANZUIZHONGJIANYAN_ID,
|
||||
|
||||
};
|
||||
int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty;
|
||||
int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty;
|
||||
decimal? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty;
|
||||
decimal? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty;
|
||||
entity.oldpronum = reported + scrap;
|
||||
entity.newpronum = input.reported_qty;
|
||||
// entity.triggerevent = EnumTriggerEvent.生产检定量;
|
||||
@@ -2342,9 +2342,11 @@ namespace Tnb.ProductionMgr
|
||||
// }
|
||||
// }
|
||||
|
||||
if(!isCheckFlag){
|
||||
if(!isCheckFlag)
|
||||
{
|
||||
int takeNum = (int)report.reported_qty.Value;
|
||||
List<PrdVisionResultRecord> prdVisionResultRecords = await _db.Queryable<PrdVisionResultRecord>()
|
||||
.Where(x => x.status == 0 && x.result.ToUpper()=="OK").OrderByDescending(x => x.create_time).Take(report.reported_qty.Value).ToListAsync();
|
||||
.Where(x => x.status == 0 && x.result.ToUpper()=="OK").OrderByDescending(x => x.create_time).Take(takeNum).ToListAsync();
|
||||
|
||||
List<string> ids = prdVisionResultRecords.Select(x => x.id).ToList();
|
||||
|
||||
@@ -2759,8 +2761,8 @@ namespace Tnb.ProductionMgr
|
||||
processid = prdMoTask.process_id,
|
||||
workid = prdMoTask.workstation_id
|
||||
};
|
||||
int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty;
|
||||
int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty;
|
||||
decimal? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty;
|
||||
decimal? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty;
|
||||
entity.oldpronum = reported + scrap;
|
||||
entity.newpronum = input.scrap_qty;
|
||||
entity.triggerevent = EnumTriggerEvent.生产检定量;
|
||||
|
||||
Reference in New Issue
Block a user