chenlu
2024-12-27 f425a29a2273a81478f3533476e3c8bd7743a0e4
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -81,6 +81,8 @@
    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);
@@ -131,31 +133,56 @@
            //查询本工序报工需要哪几层,上工序是什么
            String obtainTechnology = reportingWorkMapper.SelectWorkTechnologyMp(processIdStr);
            map.put("numberList", flowCardMapper.getGlassNumber(Integer.valueOf(technologyStr),processIdStr));
            map.put("numberList", flowCardMapper.getGlassNumber(technologyStr,processIdStr));
            //判断本工序是不是第一道工序
            if (interceptProcess.equals(process)) {
                //是第一道工序,查询流程卡数据
                map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr, technologyStr, process,reportType));
            } else {
                //不是第一道工序,查询报工数据
                List<Map<String,String>>  details = reportingWorkMapper.SelectReworlDetailMp(processIdStr, technologyStr, process,previousProcess);
                if(process.equals("中空")){
                    String orderId = processIdStr.substring(0,10);
                    details.forEach( detail -> {
                        Integer glassId = orderGlassDetailMapper.
                                getMinIdByGroup(orderId,
                                        String.valueOf(detail.get("order_number")),
                                        String.valueOf(detail.get("group")));
                        int listGlassId = Integer.parseInt(String.valueOf(detail.get("glassId")));
                        if(listGlassId  !=glassId){
                            detail.put("rowClass","latter");
                ReportingWork retrievedData = (ReportingWork) map.get("data");
                if (retrievedData!=null){
                    Integer reviewedState = retrievedData.getReviewedState();
                    //根据审核状态查询未审核数据
                    System.out.println(laminating);
                    if (reviewedState==1){//已审核
                        //不是第一道工序,查询报工数据
                        List<Map<String,String>>  details = reportingWorkMapper.SelectReworlDetailMp(processIdStr, technologyStr, process,previousProcess,laminating);
                        if(process.equals("中空")){
                            String orderId = processIdStr.substring(0,10);
                            details.forEach( detail -> {
                                Integer glassId = orderGlassDetailMapper.
                                        getMinIdByGroup(orderId,
                                                String.valueOf(detail.get("order_number")),
                                                String.valueOf(detail.get("group")));
                                int listGlassId = Integer.parseInt(String.valueOf(detail.get("glassId")));
                                if(listGlassId  !=glassId){
                                    detail.put("rowClass","latter");
                                }
                            });
                        }
                    });
                        map.put("Detail",details );
                    }else {
                        //不是第一道工序,查询报工数据
                        List<Map<String,String>>  details = reportingWorkMapper.SelectReworlDetailMpReview(processIdStr, technologyStr, process,previousProcess,laminating);
                        if(process.equals("中空")){
                            String orderId = processIdStr.substring(0,10);
                            details.forEach( detail -> {
                                Integer glassId = orderGlassDetailMapper.
                                        getMinIdByGroup(orderId,
                                                String.valueOf(detail.get("order_number")),
                                                String.valueOf(detail.get("group")));
                                int listGlassId = Integer.parseInt(String.valueOf(detail.get("glassId")));
                                if(listGlassId  !=glassId){
                                    detail.put("rowClass","latter");
                                }
                            });
                        }
                        map.put("Detail",details );
                    }
                }
                map.put("Detail",details );
            }
            // 第一道工序(流程卡数+补片数量-完工数-次破数-返工未完成数-禁用数量)
@@ -287,7 +314,6 @@
            //判断是否大于当前数量并且抛出异常
            if (processNum < (reportingWorkDetail.getBreakageQuantity() + reportingWorkDetail.getCompletedQuantity())) {
                System.out.println(processNum+"--"+reportingWorkDetail.getBreakageQuantity()+"--"+reportingWorkDetail.getCompletedQuantity());
                Map<String, Object> map = new HashMap<>();
                map.put("orderNumber", reportingWorkDetail.getOrderNumber());
                map.put("technologyNumber", reportingWorkDetail.getOrderNumber());
@@ -320,7 +346,7 @@
            }
            //更新流程卡表的报工数量
            if (Objects.equals(reportingWork.getNextProcess(), "")) {
            if (Objects.equals(reportingWork.getNextProcess(), "")|| Objects.equals(reportingWork.getNextProcess(), null)) {
                LambdaUpdateWrapper<FlowCard> flowCardLambdaUpdateWrapper =
                        new LambdaUpdateWrapper<>();
                flowCardLambdaUpdateWrapper