Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | total.value = res.data.footSum |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | |
| | | request.post(`/report/damageReport/${pageNum.value}/${total.pageSize}/${startTime}/${newEndTime}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | total.value = res.data.footSum |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | |
| | | request.post(`/report/damageReport/${pageNum.value}/${total.pageSize}/${startTime}/${newEndTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.value = res.data.footSum |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | |
| | | request.post(`/report/damageReport/1/${total.pageSize}/${startTime}/${newEndTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.value = res.data.footSum |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | |
| | | } |
| | | const List = ["breakageQuantity",'area',] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | // return footSum(data, column.field) |
| | | return total.value?.[column.field] ?? 0 |
| | | } |
| | | return '' |
| | | }) |
| | |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | total.value = res.data.footSum |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | titleSelectJson.value.processType = res.data.process |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | request.post(`/report/selectProcessToBeCompleted/${pageNum.value}/${total.pageSize}/${startTime}/${newEndTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | total.value = res.data.footSum |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | total.value = res.data.footSum |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | |
| | | } |
| | | const List = ["quantity",'childArea','actualArea','completeNum','completeArea','incompleteNum','incompleteArea'] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | //return footSum(data, column.field) |
| | | return total.value?.[column.field] ?? 0 |
| | | } |
| | | return '' |
| | | }) |
| | |
| | | request.post(`/report/teamOutput/1/${total.pageSize}/${startTime}/${newEndTime}/${selectProcesses}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.value = res.data.footSum |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | |
| | | request.post(`/report/teamOutput/${pageNum.value}/${total.pageSize}/${startTime}/${newEndTime}/${selectProcesses}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | total.value = res.data.footSum |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | |
| | | request.post(`/report/teamOutput/${pageNum.value}/${total.pageSize}/${startTime}/${newEndTime}/${selectProcesses}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.value = res.data.footSum |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | | total.value = res.data.footSum |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading=false |
| | |
| | | } |
| | | const List = ["completedQuantity",'area',] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | //return footSum(data, column.field) |
| | | return total.value?.[column.field] ?? 0 |
| | | } |
| | | return '' |
| | | }) |
| | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | total.value = res.data.footSum |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | titleSelectJson.value.processType = res.data.process |
| | | titleSelectJson.value.processType.splice(0,1) |
| | |
| | | if (optionVal == '') { |
| | | optionVal = null |
| | | } |
| | | console.log(selectProcesses) |
| | | request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.value = res.data.footSum |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | total.value = res.data.footSum |
| | | xGrid.value.reloadData(res.data.data) |
| | | gridOptions.loading = false |
| | | } else { |
| | |
| | | } |
| | | const List = ["quantity",'stockNum','stockArea',] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | //return footSum(data, column.field) |
| | | return total.value?.[column.field] ?? 0 |
| | | } |
| | | return '' |
| | | }) |
| | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | total.value = res.data.footSum |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | // 使用map方法来处理每个对象 |
| | | let modifiedCollection = produceList.map(item => { |
| | |
| | | let newEndTime = date.toISOString().split('T')[0]; // 获取 YYYY-MM-DD 格式的字符串 |
| | | request.post(`/reportingWork/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${newEndTime}/${inputVal}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | |
| | | total.value = res.data.footSum |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | // 使用map方法来处理每个对象 |
| | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | total.value = res.data.footSum |
| | | produceList=res.data.data |
| | | // 使用map方法来处理每个对象 |
| | | let modifiedCollection = produceList.map(item => { |
| | |
| | | } |
| | | const List = ["thisCompletedQuantity",'completedArea','thisWornQuantity','wornArea'] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | //return footSum(data, column.field) |
| | | return total.value?.[column.field] ?? 0 |
| | | } |
| | | return '' |
| | | }) |
| | |
| | | Boolean updateOrderProcessDetailCancel(@Param("patchLog") PatchLog patchLog,@Param("reportingWork") ReportingWork reportingWork); |
| | | |
| | | Boolean updateReplenishCancel(@Param("patchLog") PatchLog patchLog); |
| | | |
| | | Integer selectProjectCount(String processId); |
| | | } |
| | | |
| | |
| | | |
| | | List<TeamOutputDTO> exportTeamOutputMp(List<LocalDate> date, String process); |
| | | |
| | | Map<String,Float> workInProgressOrderFootSum(String orderId, String inputProject, String selectProcesses, WorkInProgressDTO workInProgressDTO); |
| | | |
| | | Map<String,Float> processToBeCompletedFootSum(Date selectTime1, Date selectTime2, String orderId, String inputProject, String selectProcesses, Report report); |
| | | |
| | | Map<String,Float> damageReportFootSum(Date selectTime1, Date selectTime2, DamageReportDTO damageReportDTO); |
| | | |
| | | Map<String,Float> teamOutputFootSum(Date selectTime1, Date selectTime2, String selectProcesses, TeamOutputDTO teamOutputDTO); |
| | | |
| | | |
| | | // Map<String, Integer> getWorkInProgressTotal( |
| | | // @Param("selectTime1") Date selectTime1, @Param("selectTime2") Date selectTime2, |
| | |
| | | String getProcessLaminating(String process); |
| | | |
| | | String selectOrderid(String processIdStr); |
| | | |
| | | Map<String,Float> getFootSum(Date selectTime1, Date selectTime2, String orderId, ReportingWork reportingWork); |
| | | } |
| | |
| | | List<PatchLog> patchLoglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("patchLog")), PatchLog.class); |
| | | if (!patchLoglist.isEmpty()){ |
| | | for (PatchLog patchLog : patchLoglist) { |
| | | //查询是否已生成工程号 |
| | | Integer projectCount = patchMapper.selectProjectCount(patchLog.getProcessId()); |
| | | //查询流程卡工艺流程 |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(patchLog.getProcessId(), String.valueOf(patchLog.getTechnologyNumber())); |
| | | if (technologicalProcess!=null || !technologicalProcess.equals("")) { |
| | | String[] processList = technologicalProcess.split("->"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = processList[0]; |
| | | Integer firstStep=reportingWorkMapper.getFirstStep(patchLog.getProcessId(),patchLog.getOrderSort(),patchLog.getTechnologyNumber(),interceptProcess); |
| | | if (firstStep>=patchLog.getPatchNum()){ |
| | | ReportingWork reportingWork = reportingWorkMapper |
| | | .selectOne(new QueryWrapper<ReportingWork>().eq("reporting_work_id",patchLog.getReportingWorkId())); |
| | | //修改小片流程卡数量 |
| | | patchMapper.updateOrderProcessDetailCancel(patchLog,reportingWork); |
| | | //审核 |
| | | patchMapper.updateReplenishCancel(patchLog); |
| | | } |
| | | else { |
| | | saveState = false; |
| | | } |
| | | }else{ |
| | | if (projectCount == 0){ |
| | | if (technologicalProcess!=null || !technologicalProcess.equals("")) { |
| | | String[] processList = technologicalProcess.split("->"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = processList[0]; |
| | | Integer firstStep=reportingWorkMapper.getFirstStep(patchLog.getProcessId(),patchLog.getOrderSort(),patchLog.getTechnologyNumber(),interceptProcess); |
| | | if (firstStep>=patchLog.getPatchNum()){ |
| | | ReportingWork reportingWork = reportingWorkMapper |
| | | .selectOne(new QueryWrapper<ReportingWork>().eq("reporting_work_id",patchLog.getReportingWorkId())); |
| | | //修改小片流程卡数量 |
| | | patchMapper.updateOrderProcessDetailCancel(patchLog,reportingWork); |
| | | //审核 |
| | | patchMapper.updateReplenishCancel(patchLog); |
| | | } |
| | | else { |
| | | saveState = false; |
| | | } |
| | | }else{ |
| | | saveState = false; |
| | | } |
| | | |
| | | Log log = new Log(); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("updateCancelReviewSv补片反审"); |
| | | log.setOperatorId((String) object.get("userId")); |
| | | log.setOperator((String) object.get("userName")); |
| | | logService.saveLog(log); |
| | | } else { |
| | | saveState = false; |
| | | } |
| | | |
| | | Log log = new Log(); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("updateCancelReviewSv补片反审"); |
| | | log.setOperatorId((String) object.get("userId")); |
| | | log.setOperator((String) object.get("userName")); |
| | | logService.saveLog(log); |
| | | } |
| | | } |
| | | |
| | |
| | | /* 根据销售单号汇总*/ |
| | | map.put("data", reportMapper.workInProgressOrderMp(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO)); |
| | | map.put("total", reportMapper.workInProgressOrderTotal(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO)); |
| | | |
| | | map.put("footSum" ,reportMapper.workInProgressOrderFootSum(orderId, inputProject, selectProcesses, workInProgressDTO)); |
| | | }else if(optionVal.equals("2")){ |
| | | /* 根流程卡号汇总*/ |
| | | map.put("data", reportMapper.workInProgressProcessMp(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO)); |
| | | map.put("total", reportMapper.workInProgressProcessTotal(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO)); |
| | | map.put("footSum" ,reportMapper.workInProgressOrderFootSum(orderId, inputProject, selectProcesses, workInProgressDTO)); |
| | | |
| | | } else if (optionVal.equals("3")) { |
| | | |
| | | } else { |
| | | //没有选择分组 |
| | | map.put("data", reportMapper.workInProgressMp(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO)); |
| | | map.put("total", reportMapper.workInProgressTotal(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO)); |
| | | map.put("footSum" ,reportMapper.workInProgressOrderFootSum(orderId, inputProject, selectProcesses, workInProgressDTO)); |
| | | |
| | | } |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportMapper.processToBeCompletedMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report)); |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | map.put("footSum" ,reportMapper.processToBeCompletedFootSum(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report)); |
| | | |
| | | return map; |
| | | } |
| | | |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportMapper.selectDamageReportMp(offset, pageSize, selectTime1, selectTime2, damageReportDTO)); |
| | | map.put("total", reportMapper.getDamageReportPageTotal(offset, pageSize, selectTime1, selectTime2, damageReportDTO)); |
| | | map.put("footSum" ,reportMapper.damageReportFootSum(selectTime1, selectTime2, damageReportDTO)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | map.put("data", reportMapper.teamOutputMp(offset, pageSize, selectTime1, selectTime2,selectProcesses, teamOutputDTO)); |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | map.put("total", reportMapper.teamOutputPageTotal(offset, pageSize, selectTime1, selectTime2,selectProcesses, teamOutputDTO)); |
| | | map.put("footSum" ,reportMapper.teamOutputFootSum(selectTime1, selectTime2,selectProcesses, teamOutputDTO)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportingWorkMapper.selectReportingWorkMp(offset, pageSize, selectTime1, selectTime2, orderId, reportingWork)); |
| | | map.put("total", reportingWorkMapper.getPageTotal(offset, pageSize, selectTime1, selectTime2, orderId, reportingWork)); |
| | | map.put("footSum" ,reportingWorkMapper.getFootSum(selectTime1, selectTime2, orderId,reportingWork)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | update pp.patch_log set reviewer=null,review_status=0,update_time=now() where id=#{patchLog.id} |
| | | </update> |
| | | |
| | | <select id="selectProjectCount"> |
| | | SELECT COUNT(*) |
| | | FROM flow_card |
| | | WHERE process_id= #{processId} and project_no IS not NULL; |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | and date(scheduled_start_time) <= #{date[1]} |
| | | GROUP BY ps.order_id, ps.processes |
| | | </select> |
| | | |
| | | <select id="workInProgressOrderFootSum"> |
| | | SELECT |
| | | SUM(od.quantity) AS quantity, |
| | | SUM(odpds.reporting_work_num_count + IFNULL(c.patchNumSum, 0) - odpd.reporting_work_num_count - odpd.broken_num) AS stockNum, |
| | | SUM(ROUND(ogd.child_width * ogd.child_height * |
| | | (odpds.reporting_work_num_count + IFNULL(c.patchNumSum, 0) - odpd.reporting_work_num_count - odpd.broken_num) / 1000000, 2)) AS stockArea |
| | | FROM sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | | ON od.order_id = ogd.order_id |
| | | AND od.order_number = ogd.order_number |
| | | LEFT JOIN flow_card AS fc |
| | | ON fc.order_id = ogd.order_id |
| | | AND fc.production_id = ogd.production_id |
| | | AND fc.order_number = ogd.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | LEFT JOIN sd.order_process_detail AS odpd |
| | | ON odpd.order_id = fc.order_id |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | AND odpd.process_id = fc.process_id |
| | | LEFT JOIN sd.order_process_detail AS odpds |
| | | ON odpds.id = odpd.id - 1 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | SUM(rw.rework_num) AS patchNumSum, |
| | | rw.process_id, |
| | | rw.order_sort, |
| | | rw.technology_number, |
| | | rwk.this_process |
| | | FROM rework AS rw |
| | | LEFT JOIN reporting_work AS rwk |
| | | ON rw.reporting_work_id = rwk.reporting_work_id |
| | | WHERE rwk.this_process = #{selectProcesses} |
| | | AND rw.review_status >= 0 |
| | | GROUP BY rw.process_id, rw.order_sort, rw.technology_number |
| | | ) AS c |
| | | ON c.process_id = fc.process_id |
| | | AND c.order_sort = fc.order_number |
| | | AND c.technology_number = fc.technology_number |
| | | LEFT JOIN sd.`order` AS o |
| | | ON o.order_id = od.order_id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.process_id, |
| | | a.teams_groups_name, |
| | | a.next_process, |
| | | b.technology_number, |
| | | b.order_number |
| | | FROM reporting_work AS a |
| | | LEFT JOIN reporting_work_detail AS b |
| | | ON a.reporting_work_id = b.reporting_work_id |
| | | GROUP BY a.process_id, a.teams_groups_name, a.next_process, b.order_number, b.technology_number |
| | | ) AS rws |
| | | ON rws.process_id = fc.process_id |
| | | AND rws.order_number = fc.order_number |
| | | AND rws.technology_number = fc.technology_number |
| | | AND rws.next_process = #{selectProcesses} |
| | | WHERE o.create_order > 0 |
| | | AND odpds.reporting_work_num_count + IFNULL(c.patchNumSum, 0) - odpd.reporting_work_num_count - odpd.broken_num != 0 |
| | | and odpd.process = #{selectProcesses} |
| | | and position(#{orderId} in od.order_id) |
| | | and position(#{inputProject} in o.project) |
| | | <if test="workInProgressDTO.customerName != null and workInProgressDTO.customerName != ''"> |
| | | and o.customer_name regexp #{workInProgressDTO.customerName} |
| | | </if> |
| | | <if test="workInProgressDTO.project != null and workInProgressDTO.project != ''"> |
| | | and o.project regexp #{workInProgressDTO.project} |
| | | </if> |
| | | <if test="workInProgressDTO.orderId != null and workInProgressDTO.orderId != ''"> |
| | | and o.order_id regexp #{workInProgressDTO.orderId} |
| | | </if> |
| | | <if test="workInProgressDTO.batch != null and workInProgressDTO.batch != ''"> |
| | | and o.batch regexp #{workInProgressDTO.batch} |
| | | </if> |
| | | <if test="workInProgressDTO.processId != null and workInProgressDTO.processId != ''"> |
| | | and fc.process_id regexp #{workInProgressDTO.processId} |
| | | </if> |
| | | order by o.order_id, fc.process_id |
| | | </select> |
| | | |
| | | <select id="processToBeCompletedFootSum"> |
| | | SELECT |
| | | SUM(fc.quantity) AS quantity, |
| | | ROUND(SUM(ogd.child_width * ogd.child_height) / 1000000, 2) AS childArea, |
| | | ROUND(SUM(ogd.child_width * ogd.child_height * fc.quantity) / 1000000, 2) AS actualArea, |
| | | SUM(odpd.reporting_work_num) AS completeNum, |
| | | ROUND(SUM(ogd.child_width * ogd.child_height * odpd.reporting_work_num) / 1000000, 2) AS completeArea, |
| | | SUM(fc.quantity - odpd.reporting_work_num) AS incompleteNum, |
| | | ROUND(SUM(ogd.child_width * ogd.child_height * (fc.quantity - odpd.reporting_work_num)) / 1000000, 2) AS incompleteArea |
| | | FROM sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | | ON od.order_id = ogd.order_id |
| | | AND od.order_number = ogd.order_number |
| | | LEFT JOIN flow_card AS fc |
| | | ON fc.order_id = ogd.order_id |
| | | AND fc.production_id = ogd.production_id |
| | | AND fc.order_number = ogd.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | LEFT JOIN sd.order_process_detail AS odpd |
| | | ON odpd.order_id = fc.order_id |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | AND odpd.process_id = fc.process_id |
| | | LEFT JOIN sd.`order` AS o |
| | | ON o.order_id = od.order_id |
| | | WHERE o.create_order > 0 |
| | | and odpd.process = #{selectProcesses} |
| | | and o.create_time >= #{selectTime1} |
| | | AND o.create_time < #{selectTime2} |
| | | AND POSITION('' IN od.order_id) |
| | | AND POSITION('' IN o.project) |
| | | AND fc.quantity - odpd.reporting_work_num > 0; |
| | | |
| | | </select> |
| | | |
| | | <select id="damageReportFootSum"> |
| | | SELECT |
| | | SUM(dd.breakage_quantity) AS breakageQuantity, |
| | | ROUND(SUM(ogd.child_width * ogd.child_height * dd.breakage_quantity) / 1000000, 2) AS area |
| | | FROM |
| | | sd.ORDER AS o |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw ON rw.order_id = o.order_id |
| | | LEFT JOIN damage_details AS dd ON dd.reporting_work_id = rw.reporting_work_id |
| | | AND dd.order_number = ogd.order_number |
| | | AND dd.technology_number = ogd.technology_number |
| | | LEFT JOIN sd.order_detail AS od ON o.order_id = od.order_id |
| | | AND od.order_number = ogd.order_number |
| | | WHERE |
| | | rw.reporting_work_time >= #{selectTime1} |
| | | AND rw.reporting_work_time < #{selectTime2} |
| | | AND dd.available = 0; |
| | | <if test="damageReportDTO.orderId != null and damageReportDTO.orderId != ''"> |
| | | and o.order_id regexp #{damageReportDTO.orderId} |
| | | </if> |
| | | <if test="damageReportDTO.project != null and damageReportDTO.project != ''"> |
| | | and o.project regexp #{damageReportDTO.project} |
| | | </if> |
| | | <if test="damageReportDTO.processId != null and damageReportDTO.processId != ''"> |
| | | and rw.process_id regexp #{damageReportDTO.processId} |
| | | </if> |
| | | <if test="damageReportDTO.orderNumber != null and damageReportDTO.orderNumber != ''"> |
| | | and dd.order_number regexp #{damageReportDTO.orderNumber} |
| | | </if> |
| | | <if test="damageReportDTO.technologyNumber != null and damageReportDTO.technologyNumber != ''"> |
| | | and dd.technology_number regexp #{damageReportDTO.technologyNumber} |
| | | </if> |
| | | <if test="damageReportDTO.responsibleProcess != null and damageReportDTO.responsibleProcess != ''"> |
| | | and dd.responsible_process regexp #{damageReportDTO.responsibleProcess} |
| | | </if> |
| | | <if test="damageReportDTO.responsibleTeam != null and damageReportDTO.responsibleTeam != ''"> |
| | | and dd.responsible_team regexp #{damageReportDTO.responsibleTeam} |
| | | </if> |
| | | <if test="damageReportDTO.responsibleEquipment != null and damageReportDTO.responsibleEquipment != ''"> |
| | | and dd.responsible_equipment regexp #{damageReportDTO.responsibleEquipment} |
| | | </if> |
| | | <if test="damageReportDTO.breakageType != null and damageReportDTO.breakageType != ''"> |
| | | and dd.breakage_type regexp #{damageReportDTO.breakageType} |
| | | </if> |
| | | <if test="damageReportDTO.breakageReason != null and damageReportDTO.breakageReason != ''"> |
| | | and dd.breakage_reason regexp #{damageReportDTO.breakageReason} |
| | | </if> |
| | | <if test="damageReportDTO.glassChild != null and damageReportDTO.glassChild != ''"> |
| | | and ogd.glass_child regexp #{damageReportDTO.glassChild} |
| | | </if> |
| | | <if test="damageReportDTO.glassNumber != null and damageReportDTO.glassNumber != ''"> |
| | | and ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') regexp #{damageReportDTO.glassNumber} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="teamOutputFootSum"> |
| | | select SUM(completed_quantity) as completedQuantity, |
| | | ifnull(SUM(ROUND(width * height * completed_quantity / 1000000, 2)),0) AS area |
| | | from ( |
| | | SELECT |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | o.project, |
| | | rw.process_id, |
| | | fc.order_number, |
| | | MAX( ogd.child_width ) as width, |
| | | MAX( ogd.child_height ) as height, |
| | | rwd.completed_quantity as completed_quantity |
| | | FROM |
| | | reporting_work as rw left join reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id |
| | | left join flow_card as fc on fc.order_id=rw.order_id and fc.process_id=rw.process_id and fc.order_number=rwd.order_number and fc.technology_number=rwd.technology_number |
| | | left join sd.order_glass_detail as ogd on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number and ogd.technology_number=fc.technology_number |
| | | left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.`order` as o on o.order_id=od.order_id |
| | | where o.create_order>0 and rw.reviewed_state>=0 and rwd.completed_quantity>0 |
| | | AND rw.reporting_work_time >= #{selectTime1} |
| | | AND rw.reporting_work_time < #{selectTime2} |
| | | and position(#{selectProcesses} in rw.this_process) |
| | | <if test="teamOutputDTO.thisProcess != null and teamOutputDTO.thisProcess != ''"> |
| | | and rw.this_process regexp #{teamOutputDTO.thisProcess} |
| | | </if> |
| | | <if test="teamOutputDTO.teamsGroupsName != null and teamOutputDTO.teamsGroupsName != ''"> |
| | | and rw.teams_groups_name regexp #{teamOutputDTO.teamsGroupsName} |
| | | </if> |
| | | <if test="teamOutputDTO.project != null and teamOutputDTO.project != ''"> |
| | | and o.project regexp #{teamOutputDTO.project} |
| | | </if> |
| | | <if test="teamOutputDTO.processId != null and teamOutputDTO.processId != ''"> |
| | | and rw.process_id regexp #{teamOutputDTO.processId} |
| | | </if> |
| | | <if test="teamOutputDTO.edgingType != null and teamOutputDTO.edgingType != ''"> |
| | | and od.edging_type regexp #{teamOutputDTO.edgingType} |
| | | </if> |
| | | GROUP BY |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rwd.order_number |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.process_id, |
| | | rwd.order_number, |
| | | rw.reporting_work_time, |
| | | rw.teams_groups_name |
| | | ) as subquery |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="selectOrderid"> |
| | | select order_id from pp.flow_card where process_id=#{processIdStr} group by order_id |
| | | </select> |
| | | |
| | | <select id="getFootSum"> |
| | | SELECT |
| | | ifnull(SUM(this_completed_quantity),0) AS thisCompletedQuantity, |
| | | ifnull(SUM(ROUND(child_width * child_height * this_completed_quantity / 1000000, 2)),0) AS completedArea, |
| | | ifnull(SUM(this_worn_quantity),0) AS thisWornQuantity, |
| | | ifnull(SUM(ROUND(child_width * child_height * this_worn_quantity / 1000000, 2)),0) AS wornArea |
| | | FROM ( |
| | | -- 先对 reporting_work_id 进行去重 |
| | | SELECT |
| | | rw.reporting_work_id, |
| | | MAX(rw.this_completed_quantity) AS this_completed_quantity, |
| | | MAX(rw.this_worn_quantity) AS this_worn_quantity, |
| | | MAX(ogd.child_width) AS child_width, |
| | | MAX(ogd.child_height) AS child_height |
| | | FROM sd.order AS o |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | | ON ogd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw |
| | | ON rw.order_id = ogd.order_id |
| | | AND rw.production_id = ogd.production_id |
| | | WHERE rw.reviewed_state != 2 |
| | | and rw.reporting_work_time >= #{selectTime1} |
| | | AND rw.reporting_work_time < #{selectTime2} |
| | | and position(#{orderId} in rw.order_id) |
| | | AND rw.reviewed_state != -1 |
| | | AND o.create_order > 0 |
| | | <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''"> |
| | | and rw.reporting_work_id regexp #{reportingWork.reportingWorkId} |
| | | </if> |
| | | <if test="reportingWork.orderId != null and reportingWork.orderId != ''"> |
| | | and o.order_id regexp #{reportingWork.orderId} |
| | | </if> |
| | | <if test="reportingWork.processId != null and reportingWork.processId != ''"> |
| | | and rw.process_id regexp #{reportingWork.processId} |
| | | </if> |
| | | <if test="reportingWork.order.project != null and reportingWork.order.project != ''"> |
| | | and o.project regexp #{reportingWork.order.project} |
| | | </if> |
| | | <if test="reportingWork.order.batch != null and reportingWork.order.batch != ''"> |
| | | and o.batch regexp #{reportingWork.order.batch} |
| | | </if> |
| | | <if test="reportingWork.thisProcess != null and reportingWork.thisProcess != ''"> |
| | | and rw.this_process regexp #{reportingWork.thisProcess} |
| | | </if> |
| | | <if test="reportingWork.deviceName != null and reportingWork.deviceName != ''"> |
| | | and rw.device_name regexp #{reportingWork.deviceName} |
| | | </if> |
| | | <if test="reportingWork.teamsGroupsName != null and reportingWork.teamsGroupsName != ''"> |
| | | and rw.teams_groups_name regexp #{reportingWork.teamsGroupsName} |
| | | </if> |
| | | GROUP BY rw.reporting_work_id -- 按 reporting_work_id 进行分组,确保唯一 |
| | | |
| | | ) AS subquery; |
| | | |
| | | </select> |
| | | </mapper> |