chenlu
2025-09-23 62914e8c873328712742f789e5fdea1a1a46c121
流程卡打印、报工层数过多问题修改
4个文件已修改
83 ■■■■ 已修改文件
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -65,6 +65,25 @@
        this.reportingWorkMapper = reportingWorkMapper;
    }
    //将层数字符串用逗号隔开
    public static String splitTechNumbers(String input) {
        if (input == null || input.isEmpty()) {
            return "";
        }
        List<String> result = new ArrayList<>();
        for (int i = 0; i < input.length(); i++) {
            // 特殊处理 "10"
            if (input.charAt(i) == '1' && i + 1 < input.length() && input.charAt(i + 1) == '0') {
                result.add("10");
                i++; // 跳过下一个字符
            } else {
                result.add(String.valueOf(input.charAt(i)));
            }
        }
        return String.join(",", result);
    }
    //流程卡管理查询
    public Map<String, Object> selectProcessCard(Integer pageNum, Integer pageSize,List<String> selectDate, FlowCard flowCard) {
        Integer offset = (pageNum - 1) * pageSize;
@@ -383,10 +402,10 @@
                        if (compound == null
                                || "null".equals(compound)
                                || compound.trim().isEmpty()){
                            List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), flowCard.getTechnologyNumber(), flowCard.getProcess(),flashback,landingSequence);
                            List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), splitTechNumbers(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,landingSequence);
                            itemmap.put("detailList", detailList);
                        }else {//有需要同架的层
                            List<Map<String, Object>> detailList = flowCardMapper.getDetailCompoundList(flowCard.getProcessId(), flowCard.getTechnologyNumber(), flowCard.getProcess(),flashback,compound,landingSequence);
                            List<Map<String, Object>> detailList = flowCardMapper.getDetailCompoundList(flowCard.getProcessId(), splitTechNumbers(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,splitTechNumbers(compound),landingSequence);
                            itemmap.put("detailList", detailList);
                        }
                    } else {
@@ -409,10 +428,11 @@
                            if (compound == null
                                    || "null".equals(compound)
                                    || compound.trim().isEmpty()){
                                List<Map<String, Object>> detailList = flowCardMapper.getDetailListLike(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,landingSequence);
                                List<Map<String, Object>> detailList = flowCardMapper.getDetailListLike(flowCard.getProcessId(), splitTechNumbers(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,landingSequence);
                                itemmap.put("detailList", detailList);
                            }else {//有需要同架的层
                                List<Map<String, Object>> detailList = flowCardMapper.getDetailListLikeCompound(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,compound,landingSequence);
                                List<Map<String, Object>> detailList = flowCardMapper.getDetailListLikeCompound(flowCard.getProcessId(), splitTechNumbers(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,splitTechNumbers(compound),landingSequence);
                                itemmap.put("detailList", detailList);
                            }
                        }
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -89,12 +89,32 @@
        this.reportingWorkTransferMapper = reportingWorkTransferMapper;
    }*/
    //将层数字符串用逗号隔开
    public static String splitTechNumbers(String input) {
        if (input == null || input.isEmpty()) {
            return "";
        }
        List<String> result = new ArrayList<>();
        for (int i = 0; i < input.length(); i++) {
            // 特殊处理 "10"
            if (input.charAt(i) == '1' && i + 1 < input.length() && input.charAt(i + 1) == '0') {
                result.add("10");
                i++; // 跳过下一个字符
            } else {
                result.add(String.valueOf(input.charAt(i)));
            }
        }
        return String.join(",", result);
    }
    public Map<String, Object> AddSelectLastWorkSv(String processIdStr, String technologyStr, String process, String reportType) {
        Map<String, Object> map = new HashMap<>();
        //获取报工工序是否为复合工程
        String laminating = reportingWorkMapper.getProcessLaminating(process);
        //查询流程卡工艺流程
        String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr,technologyStr);
        String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr,splitTechNumbers(technologyStr));
        if (technologicalProcess!=null || !technologicalProcess.equals("")){
            String[] processList = technologicalProcess.split("->");
@@ -123,7 +143,7 @@
                        nextProcess = processList[i + 1];
                    }
                    //查询当前工序的表头数据
                    map.put("data", reportingWorkMapper.AddSelectLastWorkMp(processIdStr, technologyStr, previousProcess, nextProcess, process,reportType));
                    map.put("data", reportingWorkMapper.AddSelectLastWorkMp(processIdStr, splitTechNumbers(technologyStr), previousProcess, nextProcess, process,reportType));
                    map.put("thisProcess", processList);
                    break;
                }
@@ -144,12 +164,12 @@
            //查询本工序报工需要哪几层,上工序是什么
            String obtainTechnology = reportingWorkMapper.SelectWorkTechnologyMp(processIdStr);
            map.put("numberList", flowCardMapper.getGlassNumber(technologyStr,processIdStr));
            map.put("numberList", flowCardMapper.getGlassNumber(splitTechNumbers(technologyStr),processIdStr));
            //判断本工序是不是第一道工序
            if (interceptProcess.equals(process)) {
                //是第一道工序,查询流程卡数据
                map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr, technologyStr, process,reportType));
                map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr, splitTechNumbers(technologyStr), process,reportType));
            } else {
                ReportingWork retrievedData = (ReportingWork) map.get("data");
                if (retrievedData!=null){
@@ -157,7 +177,7 @@
                    //根据审核状态查询未审核数据
                   // if (reviewedState==1){//已审核
                        //不是第一道工序,查询报工数据
                        List<Map<String,String>>  details = reportingWorkMapper.SelectReworlDetailMp(processIdStr, technologyStr, process,previousProcess,laminating);
                        List<Map<String,String>>  details = reportingWorkMapper.SelectReworlDetailMp(processIdStr, splitTechNumbers(technologyStr), process,previousProcess,laminating);
                        if(process.equals("中空")){
                            //获取该流程卡订单号
                            String orderId = reportingWorkMapper.selectOrderid(processIdStr);
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -811,7 +811,7 @@
                              fcs.technology_number = fc.technology_number
                               and fcs.process = #{process}
        where fc.process_id = #{processId}
          and position(fc.technology_number in #{technologyNumber})
          and FIND_IN_SET(fc.technology_number , #{technologyNumber})
        group by fc.process_id, fc.order_number
        <choose>
            <!-- 当 landingSequence != 1 且 flashback != 1 时,按 landing_sequence 倒序 -->
@@ -1479,7 +1479,7 @@
        from sd.order_detail as od
                 left join flow_card as fc on od.order_id = fc.order_id and od.order_number = fc.order_number
        where fc.process_id = #{processId}
          and POSITION(fc.technology_number in #{technologyNumber})
          and  FIND_IN_SET(fc.technology_number , #{technologyNumber})
        GROUP BY other_columns
        order by IF(fc.sort != NULL or fc.sort != '', fc.sort, fc.order_number)
    </select>
@@ -1629,7 +1629,7 @@
                              fcs.technology_number = fc.technology_number
                               and fcs.process = #{process}
        where fc.process_id = #{processId}
          and position(fc.technology_number in #{technologyNumber})
          and  FIND_IN_SET(fc.technology_number , #{technologyNumber})
        group by fc.process_id, fc.order_number, fc.technology_number
        <choose>
            <when test="landingSequence != 1 and flashback != 1">
@@ -3533,7 +3533,8 @@
        fcs.technology_number = fc.technology_number
        and fcs.process = #{process}
        where fc.process_id = #{processId}
        and position(fc.technology_number in #{compound})
        and
        FIND_IN_SET(fc.technology_number , #{compound})
        group by fc.process_id, fc.order_number
        <choose>
            <when test="landingSequence != 1 and flashback != 1">
@@ -3589,7 +3590,7 @@
        fcs.technology_number = fc.technology_number
        and fcs.process = #{process}
        where fc.process_id = #{processId}
        and position(fc.technology_number in #{compound})
        and FIND_IN_SET(fc.technology_number , #{compound})
        group by fc.process_id, fc.order_number
        <choose>
            <when test="landingSequence != 1 and flashback != 1">
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -84,7 +84,7 @@
                   from reporting_work as a
                       left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id
                   where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr}
                     and  POSITION(b.technology_number in #{technologyStr})
                     and  FIND_IN_SET(b.technology_number , #{technologyStr})
                   ) as rw
        on rw.process_id = fc.process_id
        left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id and rwd.technology_number=fc.technology_number
@@ -113,7 +113,7 @@
                       left join flow_card as fc on fc.order_id=o.order_id and fc.order_number=ogd.order_number and fc.technology_number=ogd.technology_number
                       where fc.process_id = #{processIdStr}
                         and o.create_order>0
                         and POSITION(fc.technology_number in #{technologyStr})
                         and FIND_IN_SET(fc.technology_number , #{technologyStr})
                       limit 1),'') as  process
    </select>
@@ -166,7 +166,7 @@
                where
                reporting_work.this_process = #{process}
                and a.process_id=#{processIdStr}
                and POSITION(a.technology_number in #{technologyStr})
                and FIND_IN_SET(a.technology_number , #{technologyStr})
                and a.review_status = 1
                group by a.process_id,a.order_sort,a.technology_number
            ) as patch
@@ -177,7 +177,7 @@
        WHERE
            fc.process_id = #{processIdStr}
          AND  POSITION(fc.technology_number in #{technologyStr})
          AND  FIND_IN_SET(fc.technology_number , #{technologyStr})
          AND odpd.process = #{process}
          and if(#{reportType}=1,o.order_type!='样品订单',o.order_id!='')
        and o.create_order>0 and fc.quantity - ifnull(fc.termination_quantity,0)>0
@@ -223,7 +223,7 @@
            from sd.order_glass_detail
            where order_id = ogd.order_id
            and order_number = ogd.order_number
            and POSITION(technology_number in #{technologyStr})
            and  FIND_IN_SET(technology_number , #{technologyStr})
            limit 1)
        </if>
@@ -262,7 +262,7 @@
        left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id
        where this_process=#{previousProcess} and process_id= #{processIdStr} and a.reviewed_state>=0
        <if test="laminating == ''">
            AND POSITION(b.technology_number in #{technologyStr})
            AND FIND_IN_SET(b.technology_number , #{technologyStr})
        </if>
        GROUP BY b.order_number,b.technology_number
        ) as rws
@@ -272,7 +272,7 @@
        AND odpd.process = #{process}
        <if test="laminating == ''">
            AND POSITION(fc.technology_number in #{technologyStr})
            AND FIND_IN_SET(fc.technology_number , #{technologyStr})
        </if>
        order by fc.order_number
    </select>