Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | gridOptions.columns = gridOptions.columns.slice(0, 11); //清除动态生成的列重新查询 |
| | | request.post(`/report/processCardProgress/${form.orderId}`, column).then((res) => { |
| | | request.post(`/report/processCardProgressReport/${form.orderId}`, column).then((res) => { |
| | | if (res.code == 200) { |
| | | if (res.data.data.length === 0) { |
| | | ElMessage.warning(t('report.noDataFoundForThisOrder')) |
| | |
| | | } |
| | | |
| | | //流程卡进度 |
| | | @ApiOperation("流程卡进度") |
| | | @ApiOperation("订单流程卡进度") |
| | | @PostMapping("/processCardProgress/{orderId}") |
| | | public Result processCardProgress(@PathVariable String orderId, @RequestBody List<Integer> columns) { |
| | | return Result.seccess(reportService.processCardProgressSv(orderId, columns)); |
| | | } |
| | | @ApiOperation("报表流程卡进度") |
| | | @PostMapping("/processCardProgressReport/{orderId}") |
| | | public Result processCardProgressReport(@PathVariable String orderId, @RequestBody List<Integer> columns) { |
| | | return Result.seccess(reportService.processCardProgressReportSv(orderId, columns)); |
| | | } |
| | | @ApiOperation("流程卡进度汇总") |
| | | @SaCheckPermission("selectOrder.search") |
| | | @PostMapping("/processCardProgressCollect/{orderId}") |
| | |
| | | |
| | | List<Map<String, String>> processCardProgressCollectMp(String orderId); |
| | | |
| | | List<Map<String, String>> processCardProgressReportMp(String orderId); |
| | | |
| | | |
| | | // Map<String, Integer> getWorkInProgressTotal( |
| | | // @Param("selectTime1") Date selectTime1, @Param("selectTime2") Date selectTime2, |
| | |
| | | map.put("title", uniqueList); |
| | | return null; |
| | | } |
| | | |
| | | public Map<String, Object> processCardProgressReportSv(String orderId, List<Integer> columns) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //获取表格内容数据 |
| | | map.put("data", reportMapper.processCardProgressReportMp(orderId)); |
| | | |
| | | //获取表头工序筛选数据 |
| | | List<Map<String, String>> processFilterList = orderProcessDetailMapper.filterOrderProcess(orderId); |
| | | List<Map<String, String>> processList = processFilterList; |
| | | |
| | | List<String> filterList = new ArrayList<>(); |
| | | //循环遍历数组,判断此序号当前的工序 |
| | | for (int i = 1; i < processFilterList.size(); i++) { |
| | | filterList.add(processFilterList.get(i).get("process")); |
| | | List<Map<String, String>> lastProcessList = |
| | | orderProcessDetailMapper.filterLastProcess( |
| | | orderId, |
| | | String.valueOf(processFilterList.get(i).get("order_number")), |
| | | String.valueOf(processFilterList.get(i).get("technology_number")), |
| | | String.valueOf(processFilterList.get(i).get("id")) |
| | | ); |
| | | if (!lastProcessList.isEmpty()) { |
| | | int finalI = i; |
| | | lastProcessList.forEach(lastProcess -> { |
| | | if (filterList.contains(lastProcess.get("process"))) { |
| | | processList.add(lastProcess); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | // 使用HashSet来记录已经遇到的value值 |
| | | Set<String> seenValues = new HashSet<>(); |
| | | // 创建一个新的List来存储结果 |
| | | List<Map<String, String>> uniqueList = new ArrayList<>(); |
| | | |
| | | // 反向遍历原始List |
| | | for (int i = processList.size() - 1; i >= 0; i--) { |
| | | Map<String, String> maps = processList.get(i); |
| | | String value = maps.values().iterator().next(); // 假设每个Map只有一个value |
| | | |
| | | // 如果value还没有被看到过,就添加到结果List和HashSet中 |
| | | if (!seenValues.contains(value)) { |
| | | uniqueList.add(0, maps); // 添加到结果List的开头,以保持原顺序 |
| | | seenValues.add(value); |
| | | } |
| | | } |
| | | map.put("title", uniqueList); |
| | | |
| | | |
| | | List<Map<String, Object>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId); |
| | | List<Map<String, Integer>> rowCount = new ArrayList<>(); |
| | | columns.forEach(col -> { |
| | | getRowCount.forEach(row -> { |
| | | Map<String, Integer> getRow = new HashMap<>(); |
| | | // { row: 0, col: 1, rowspan: 3, colspan: 0}, |
| | | Object rowNumObj = row.get("RowNum"); |
| | | if (rowNumObj instanceof Double) { |
| | | getRow.put("row", ((Double) rowNumObj).intValue()); |
| | | } else if (rowNumObj instanceof Integer) { |
| | | getRow.put("row", (Integer) rowNumObj); |
| | | } |
| | | getRow.put("col", col); |
| | | getRow.put("rowspan", (Integer) row.get("rowCount")); |
| | | getRow.put("colspan", 0); |
| | | rowCount.add(getRow); |
| | | }); |
| | | }); |
| | | |
| | | |
| | | map.put("mergeCells", rowCount); |
| | | |
| | | return map; |
| | | } |
| | | } |
| | |
| | | order by a.process_id |
| | | |
| | | </select> |
| | | |
| | | <select id="processCardProgressReportMp"> |
| | | select a.product_name, |
| | | b.glass_child, |
| | | d.order_type, |
| | | concat(c.process_id, '/', c.technology_number) as process_id, |
| | | c.process_id as 'processId', |
| | | c.order_id, |
| | | c.order_number, |
| | | c.technology_number, |
| | | b.child_width, |
| | | b.child_height, |
| | | c.quantity, |
| | | c.quantity-ifnull(c.termination_quantity,0) as thisQuantity,/*用于判断是否改变颜色*/ |
| | | e.reportWorkQuantity, |
| | | e.reportWorkQuantityShow, |
| | | e.reportWorkQuantityCount, |
| | | e.reportWorkTime, |
| | | e.broken_num, |
| | | c.quantity-ifnull(c.termination_quantity,0) as glassQuantity, |
| | | c.quantity*a.area as gross_area, |
| | | c.quantity-ifnull(c.termination_quantity,0) as quantityShow, |
| | | (c.quantity-ifnull(c.termination_quantity,0))*a.compute_area as grossAreaShow, |
| | | ifnull(f.inventory, 0) as inventoryShow, |
| | | round(ifnull(f.inventory, 0) * a.compute_area, 2) as inventoryAreaShow, -- 库存面积 |
| | | ifnull(dd.quantity, 0) as shippedQuantityShow, -- 发货数量 |
| | | (ifnull(c.received_quantity, 0))*a.compute_area as StorageAreaShow,-- 入库面积 |
| | | |
| | | if(c.technology_number=1,(c.quantity-ifnull(c.termination_quantity,0))*a.compute_area,0) as grossArea, |
| | | if(c.technology_number=1,ifnull(f.inventory, 0) ,0) as inventory, |
| | | if(c.technology_number=1,round(ifnull(f.inventory, 0) * a.compute_area, 2),0) as inventoryArea, |
| | | if(c.technology_number=1,ifnull(dd.quantity, 0) ,0) as shippedQuantity, |
| | | if(c.technology_number=1,(ifnull(c.received_quantity, 0))*a.compute_area,0) as StorageArea, |
| | | |
| | | |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')),'') AS glassNumber, |
| | | b.`group` |
| | | |
| | | from pp.flow_card as c |
| | | left join |
| | | sd.order_detail as a |
| | | on c.order_id = a.order_id |
| | | and c.order_number = a.order_number |
| | | left join sd.order_glass_detail as b |
| | | on c.order_id = b.order_id |
| | | and b.order_number = c.order_number |
| | | and c.technology_number = b.technology_number |
| | | left join sd.`order` as d |
| | | on c.order_id = d.order_id |
| | | left join mm.finished_goods_inventory as f |
| | | on c.order_id = f.order_id and f.order_number = c.order_number |
| | | left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number |
| | | left join (SELECT process_id, |
| | | order_number, |
| | | technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", if(technology_number!=1 and (bd.nickname='stepD' || bd.nickname='stepB' ) ,0,reporting_work_num), "\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num, "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityShow, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num_count, "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", IFNULL(date(update_time),''), "\"")), |
| | | '}' |
| | | ) as reportWorkTime |
| | | FROM sd.order_process_detail as a |
| | | left join (SELECT DISTINCT basic_name,nickname from sd.basic_data as bd where bd.basic_category = 'process') as bd |
| | | on a.process = bd.basic_name |
| | | where a.order_id = #{orderId} |
| | | GROUP BY process_id, a.order_number, a.technology_number |
| | | |
| | | |
| | | ) as e |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | and e.order_number = c.order_number |
| | | where a.order_id = #{orderId} and d.create_order>0 and c.quantity-ifnull(c.termination_quantity,0)>0 |
| | | group by c.order_number, |
| | | c.technology_number, |
| | | c.process_id |
| | | order by c.process_id, c.order_number, c.technology_number |
| | | </select> |
| | | </mapper> |