Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | const route = currentRoute.value |
| | | |
| | | let processId = route.query.processId |
| | | let merge = null |
| | | //第一次加载数据 |
| | | |
| | | request.post(`/processCard/flowCardDetail/${processId}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | merge = res.data.merge |
| | | console.log(merge) |
| | | if(merge != 0){ |
| | | gridOptions.toolbarConfig.buttons[0].name='取消合并' |
| | | } |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | |
| | | type: 'warning', |
| | | } |
| | | ).then(()=>{ |
| | | request.post("/processCard/mergeFlowCard", flowData.value).then((res) => { |
| | | request.post(`/processCard/mergeFlowCard/${merge}`, flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({path: '/main/processCard/SelectProcessCard', query:{random:Math.random()}}) |
| | |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | titleSelectJson.value.processType = res.data.process |
| | | titleSelectJson.value.processType.unshift(newItem.value) |
| | | produceList.forEach(item => { |
| | | item.mmTotal = sumMmValues(item.workProcessName); |
| | | }); |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | |
| | | |
| | | total.value = res.data.footSum |
| | | produceList = deepClone(res.data.data) |
| | | produceList.forEach(item => { |
| | | item.mmTotal = sumMmValues(item.workProcessName); |
| | | }); |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | xGrid.value.loadData(res.data.data) |
| | | produceList = res.data.data |
| | | produceList.forEach(item => { |
| | | item.mmTotal = sumMmValues(item.workProcessName); |
| | | }); |
| | | console.log(produceList) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | const sumMmValues = (workProcessName) => { |
| | | if (!workProcessName) return 0; |
| | | |
| | | return workProcessName |
| | | .split('+') // 拆分每个部分 |
| | | .map(part => { |
| | | const match = part.match(/^(\d+)(?=mm)/); // 提取 mm 前面的数字 |
| | | return match ? parseInt(match[1], 10) : 0; |
| | | }) |
| | | .reduce((sum, num) => sum + num, 0); // 求和 |
| | | } |
| | | //页脚跳转 |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | |
| | | pageNum.value=1 |
| | | total.value = res.data.footSum |
| | | produceList = deepClone(res.data.data) |
| | | produceList.forEach(item => { |
| | | item.mmTotal = sumMmValues(item.workProcessName); |
| | | }); |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading=false |
| | | } else { |
| | |
| | | {field: 'code', width: 100, title: t('reportingWorks.glassNumber')}, |
| | | {field: 'width', width: 90, title: t('order.width')}, |
| | | {field: 'height', width: 90, title: t('order.height')}, |
| | | {field: 'mmTotal', width: 90, title: t('order.totalThickness')}, |
| | | {field: 'workProcessName', width: 120, title: t('report.workProcessName')}, |
| | | {field: 'edgingType', width: 110, title: t('order.edgingType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'completedQuantity', width: 90, title: t('reportingWorks.completedQuantity')}, |
| | |
| | | } |
| | | |
| | | @ApiOperation("合并流程卡接口") |
| | | @PostMapping("/mergeFlowCard") |
| | | public Result mergeFlowCard(@RequestBody Map<String, Object> object) { |
| | | return Result.seccess(flowCardService.mergeFlowCard(object)); |
| | | @PostMapping("/mergeFlowCard/{merge}") |
| | | public Result mergeFlowCard(@RequestBody Map<String, Object> object, |
| | | @PathVariable Integer merge) { |
| | | return Result.seccess(flowCardService.mergeFlowCard(object,merge)); |
| | | } |
| | | @ApiOperation("汉玻获取流程卡接口") |
| | | @PostMapping("/getProcessCardList/hanbo") |
| | |
| | | Boolean updatePrintNumberMp(String processId, Integer orderNumber); |
| | | |
| | | String getOrderIdByProcessId(String processId); |
| | | |
| | | Boolean updateFlowCardIsMerge(String processId); |
| | | |
| | | Integer flowCardDetailMergeMp(String processId); |
| | | } |
| | |
| | | |
| | | |
| | | import com.example.erp.dto.pp.*; |
| | | import com.example.erp.entity.pp.DamageDetails; |
| | | import com.example.erp.entity.pp.Report; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | |
| | | List<YieldDTO> exportYieldMp(List<LocalDate> date, String process); |
| | | |
| | | List<TeamOutputDTO> teamOutputMp(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String selectProcesses, TeamOutputDTO teamOutputDTO); |
| | | List<TeamOutputDTO> teamOutputMp(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String selectProcesses, String laminating, TeamOutputDTO teamOutputDTO); |
| | | |
| | | Map<String, Integer> teamOutputPageTotal(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String selectProcesses, TeamOutputDTO teamOutputDTO); |
| | | |
| | |
| | | |
| | | Map<String,Float> teamOutputFootSum(Date selectTime1, Date selectTime2, String selectProcesses, TeamOutputDTO teamOutputDTO); |
| | | |
| | | String getLaminating(String selectProcesses); |
| | | |
| | | |
| | | // Map<String, Integer> getWorkInProgressTotal( |
| | | // @Param("selectTime1") Date selectTime1, @Param("selectTime2") Date selectTime2, |
| | |
| | | public Object flowCardDetailSv(String processId, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.flowCardDetailMp(processId, flowCard)); |
| | | map.put("merge", flowCardMapper.flowCardDetailMergeMp(processId)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | public String mergeFlowCard(Map<String, Object> object) { |
| | | public String mergeFlowCard(Map<String, Object> object, Integer merge) { |
| | | String returns = "false"; |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | List<Map<String, Object>> flowCardList1 = flowCardMapper.selectFlowCardMerge(flowCardList.get(0).getProcessId()); |
| | | int index = 1; |
| | | for (int i = 0; i < flowCardList1.size(); i++) { |
| | | if (Integer.valueOf(flowCardList1.get(i).get("count2").toString()) > 1) { |
| | | List<Integer> technologyNumber = Arrays.stream(flowCardList1.get(i).get("count1").toString().split(",")) |
| | | .map(Integer::parseInt) |
| | | .collect(Collectors.toList()); |
| | | flowCardMapper.updateFlowCardMerge(flowCardList.get(0).getProcessId(), technologyNumber, index); |
| | | index += 1; |
| | | returns = "true"; |
| | | if (merge == 0){ |
| | | int index = 1; |
| | | for (int i = 0; i < flowCardList1.size(); i++) { |
| | | if (Integer.valueOf(flowCardList1.get(i).get("count2").toString()) > 1) { |
| | | List<Integer> technologyNumber = Arrays.stream(flowCardList1.get(i).get("count1").toString().split(",")) |
| | | .map(Integer::parseInt) |
| | | .collect(Collectors.toList()); |
| | | flowCardMapper.updateFlowCardMerge(flowCardList.get(0).getProcessId(), technologyNumber, index); |
| | | index += 1; |
| | | returns = "true"; |
| | | } |
| | | } |
| | | }else {//取消合并 |
| | | flowCardMapper.updateFlowCardIsMerge(flowCardList.get(0).getProcessId()); |
| | | returns = "true"; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportMapper.teamOutputMp(offset, pageSize, selectTime1, selectTime2,selectProcesses, teamOutputDTO)); |
| | | String laminating = reportMapper.getLaminating(selectProcesses); |
| | | map.put("data", reportMapper.teamOutputMp(offset, pageSize, selectTime1, selectTime2,selectProcesses,laminating, 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)); |
| | |
| | | left join sd.order_detail as od on od.order_id = SUBSTRING(fc.process_id,1,10) and od.order_number = fc.order_sort |
| | | left join sd.`order` as o on o.order_id = SUBSTRING(fc.process_id,1,10) |
| | | left join pp.`flow_card` as fcd on fcd.process_id=fc.process_id and fcd.technology_number=ogd.technology_number and fcd.order_number=od.order_number |
| | | where fc.project_no = #{printProject} |
| | | where fc.project_no = #{printProject} and fc.process_id is not null and fc.process_id!="" |
| | | GROUP BY fc.process_id, ogd.technology_number |
| | | order by fc.process_id, ogd.technology_number |
| | | </select> |
| | |
| | | <select id="getOrderIdByProcessId"> |
| | | select order_id from pp.flow_card where process_id = #{processId} limit 1; |
| | | </select> |
| | | |
| | | <select id="flowCardDetailMergeMp"> |
| | | select merge from pp.flow_card where process_id = #{processId} group by id ORDER BY merge desc LIMIT 1 |
| | | </select> |
| | | |
| | | <update id="updateFlowCardIsMerge"> |
| | | update pp.flow_card fc set fc.merge=0 |
| | | where fc.process_id = #{processId} |
| | | </update> |
| | | </mapper> |
| | |
| | | JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code, |
| | | rw.reviewed, |
| | | rw.examine_time, |
| | | GROUP_CONCAT(ogd.glass_child SEPARATOR '+') as workProcessName |
| | | -- GROUP_CONCAT(ogd.glass_child SEPARATOR '+') as workProcessName |
| | | CASE |
| | | WHEN #{laminating} = 'laminating' THEN GROUP_CONCAT(ogd.glass_child SEPARATOR '+') |
| | | ELSE MAX( ogd.glass_child ) |
| | | END AS workProcessName |
| | | 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 |
| | |
| | | rw.teams_groups_name |
| | | ) as subquery |
| | | </select> |
| | | |
| | | <select id="getLaminating"> |
| | | select IFNULL(nickname,'') from sd.basic_data where basic_category='process' and basic_name=#{selectProcesses} |
| | | </select> |
| | | </mapper> |