廖井涛
2025-04-10 9425caa266245d82e7442f93cd47c5e263be2242
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -232,6 +232,7 @@
    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;
    }
@@ -879,23 +880,27 @@
    }
    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";
            }
        }