报工相关文件添加 修改报工的最小值以及报工新增修改非本工序修改刺破明细表状态
| | |
| | | if(route.query.processId !== undefined && route.query.processId!=='' && route.query.processId!=null ){ |
| | | titleUploadData.value.processId = route.query.processId |
| | | } |
| | | // route.query.reportingWorkId = 'BG2403140039' |
| | | //route.query.reportingWorkId = 'BG2403150004' |
| | | //判断是否传入报工编号 |
| | | if(route.query.reportingWorkId !== '' && route.query.reportingWorkId!=null){ |
| | | request.post(`reportingWork/selectUpdateReportingWork/${route.query.reportingWorkId}`).then(res=>{ |
| | |
| | | return new Error('请输入整数,并且大于等于0') |
| | | }else if((row.completedQuantity*1+brokenNum*1)>row.quantity*1){ |
| | | return new Error((`${row.completedQuantity}+${brokenNum}>${row.quantity}`)) |
| | | } |
| | | if(titleUploadData.value.reportingWorkId!=null && row.completedQuantity<row.minQuantity){ |
| | | return new Error(`请输入大于等于${row.minQuantity}的数字`) |
| | | } |
| | | |
| | | } |
| | |
| | | // 如果已经在seenIds中,返回false以过滤掉这个对象 |
| | | return false; |
| | | }); |
| | | const notFinishList = xGrid.value.getTableData().fullData.filter(item =>{ |
| | | return item.saveFlag === false |
| | | }) |
| | | for(let item of uniqueByOrderNum){ |
| | | if(!checkSameNumForId(xGrid.value.getTableData().fullData,item.order_number)){ |
| | | if(!checkSameNumForId(notFinishList,item.order_number)){ |
| | | ElMessage.error(`请检查订单序号: ${item.order_number} 报工数量是否相同!`) |
| | | return false |
| | | } |
| | |
| | | damageDetail.setOrderNumber(reportingWorkDetail.getOrderNumber()); |
| | | damageDetail.setProcessId(reportingWork.getProcessId()); |
| | | damageDetail.setTechnologyNumber(reportingWorkDetail.getTechnologyNumber()); |
| | | if(damageDetail.getResponsibleProcess()!=reportingWork.getThisProcess()){ |
| | | damageDetail.setQualityInsStatus(1); |
| | | } |
| | | damageDetailsMapper.insert(damageDetail); |
| | | }); |
| | | } |
| | |
| | | .setSql("reporting_work_num =reporting_work_num +"+orderProcessDetail.getReportingWorkNum()) |
| | | .setSql("broken_num =broken_num +"+orderProcessDetail.getBrokenNum()); |
| | | orderProcessDetailMapper.update(null,updateWrapper); |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | |
| | | //判断完工数量和刺破数量是否为0,为0则不插入到数据库 |
| | | if(!(reportingWorkDetail.getCompletedQuantity()==0 && reportingWorkDetail.getBreakageQuantity()==0)){ |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | } |
| | | |
| | | //更新流程卡表的报工数量 |
| | | if(Objects.equals(reportingWork.getNextProcess(), "")){ |
| | | LambdaUpdateWrapper<FlowCard> flowCardLambdaUpdateWrapper = |
| | |
| | | List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails(); |
| | | //每一条报工数据循环插入次破明细表 |
| | | if(damageDetails!=null && !damageDetails.isEmpty()){ |
| | | damageDetails.forEach(damageDetailsMapper::insert); |
| | | damageDetails.forEach(damageDetail->{ |
| | | if(!Objects.equals(reportingWork.getThisProcess(), damageDetail.getResponsibleProcess())){ |
| | | damageDetail.setQualityInsStatus(1); |
| | | } |
| | | damageDetailsMapper.insert(damageDetail); |
| | | }); |
| | | } |
| | | //插入报工数据 |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | |
| | | od.shape, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | odpd.reporting_work_num as completed, |
| | | odpd.broken_num as onceBroken, |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | FROM |
| | | sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | |
| | | od.shape, |
| | | odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.reporting_work_num as completed, |
| | | odpd.broken_num as onceBroken, |
| | | ogd.`group` |
| | | ogd.`group`, |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | |
| | | |
| | | FROM |
| | |
| | | a.completed_quantity as 'completedQuantity', -- 完工数 |
| | | a.breakage_quantity as 'breakageQuantity', -- 破损数 |
| | | f.completed_quantity as thisQuantitySum ,-- 本工序完工和 |
| | | if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag, |
| | | <if test="nextProcess != null and nextProcess != ''"> -- 非最后一道工序 |
| | | ifnull(g.completed_quantity,0) as nextQuantitySum, -- 后工序已完成 |
| | | if((f.completed_quantity |
| | |
| | | ) as minQuantity -- 修改最小数 |
| | | </if> |
| | | <if test="nextProcess == null or nextProcess == ''"> -- 最后一道工序 |
| | | c.received_quantity, -- 已入库数量 |
| | | c.inventory_quantity, -- 库存数量 |
| | | # c.received_quantity, -- 已入库数量 |
| | | # c.inventory_quantity, -- 库存数量 |
| | | if(ifnull(inventory_quantity,0) |
| | | -ifnull(c.received_quantity,0) |
| | | >= a.completed_quantity,0, |
| | |
| | | od.shape, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | odpd.reporting_work_num as completed, |
| | | odpd.broken_num as onceBroken, |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | FROM |
| | | sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | |
| | | od.shape, |
| | | odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.reporting_work_num as completed, |
| | | odpd.broken_num as onceBroken, |
| | | ogd.`group` |
| | | ogd.`group`, |
| | | if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交 |
| | | |
| | | |
| | | FROM |
| | |
| | | a.completed_quantity as 'completedQuantity', -- 完工数 |
| | | a.breakage_quantity as 'breakageQuantity', -- 破损数 |
| | | f.completed_quantity as thisQuantitySum ,-- 本工序完工和 |
| | | if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag, |
| | | <if test="nextProcess != null and nextProcess != ''"> -- 非最后一道工序 |
| | | ifnull(g.completed_quantity,0) as nextQuantitySum, -- 后工序已完成 |
| | | if((f.completed_quantity |
| | |
| | | ) as minQuantity -- 修改最小数 |
| | | </if> |
| | | <if test="nextProcess == null or nextProcess == ''"> -- 最后一道工序 |
| | | c.received_quantity, -- 已入库数量 |
| | | c.inventory_quantity, -- 库存数量 |
| | | # c.received_quantity, -- 已入库数量 |
| | | # c.inventory_quantity, -- 库存数量 |
| | | if(ifnull(inventory_quantity,0) |
| | | -ifnull(c.received_quantity,0) |
| | | >= a.completed_quantity,0, |