kongzy
2024-01-30 1123d12eb51d23edcd4a39660ef8cd47802b931d
src/main/java/com/nanometer/smartlab/controller/ApprovalMngController.java
@@ -178,12 +178,17 @@
        this.dangerousFlag = false;//二级审批标志
        this.adminApproveUserId = null;
        Map<Integer,Integer> checkMap=new HashMap<>();
        for (OpeApply opeApply : this.selectedList) {
            if (!this.opeApplyService.isApplyPendingApproval(opeApply)) {
                FacesUtils.warn("只有待审批状态的数据可以审批。");
                return;
            }
            String currentUserId = getUserId();
            if(StringUtils.isNotBlank(opeApply.getBeforeApproveUserId())&&!opeApply.getApproveUserId().equalsIgnoreCase(currentUserId)){
                FacesUtils.warn("提示您已审批完成,请等待二级审批者审批");
                return;
            }
/*           if (DangerousFlag.DANGEROUS == opeApply.getReagent().getDangerousFlag()) {
               if (!"15fc90a1f7bf43bda01313904b543195".equals(this.getUser().getRoleId())) {
                    dangerousFlag = true;
@@ -193,7 +198,6 @@
                if(StringUtils.isBlank(opeApply.getBeforeApproveUserId())){
                    dangerousFlag = true;
                }
            }else{//其他情形:管制品打开二级审批
                String controlProducts = opeApply.getReagent().getControlProducts();
                if (StringUtils.isNotBlank(controlProducts)) {
@@ -201,10 +205,20 @@
                    if (StringUtils.isNotBlank(baseMetaValue) &&StringUtils.isBlank(opeApply.getBeforeApproveUserId())) {
                        dangerousFlag = true;
                    }
                    if(StringUtils.isNotBlank(baseMetaValue)) {
                        checkMap.put(1, 1);
                    }else{
                        checkMap.put(0, 1);
                    }
                }else{
                    checkMap.put(0,1);
                }
            }
        }
        if(checkMap.size()>1){
            FacesUtils.warn("不允许管制品和非管制品同时审批");
            return;
        }
        this.memo = null;
@@ -220,14 +234,12 @@
                return;
            }
            if (this.dangerousFlag) {
                if (this.adminApproveUserId == null || "".equalsIgnoreCase(this.adminApproveUserId)) {
                    FacesUtils.warn("请选择系统管理员审批。");
                    return;
                }
            if (this.dangerousFlag &&(this.adminApproveUserId == null || "".equalsIgnoreCase(this.adminApproveUserId))) {
                   FacesUtils.warn("请选择系统管理员审批。");
                   return;
            }
            String currentUserId = getUserId();
            List<String> applyIds = new ArrayList<>();
            List<String> adminApplyIds = new ArrayList<>();
            List<String> firstUserIds = new ArrayList<>();
@@ -245,6 +257,10 @@
                    firstUserIds.add(opeApply.getApproveUserId());
                } else {
                    applyIds.add(opeApply.getId());
                }
                if(StringUtils.isNotBlank(opeApply.getBeforeApproveUserId())&&!opeApply.getApproveUserId().equalsIgnoreCase(currentUserId)){
                    FacesUtils.warn("提示您已审批完成,请等待二级审批者审批");
                    return;
                }
            }
            boolean result = this.opeApplyService.updateSelectedOpeApplyStatus(memo, applyIds, adminApproveUserId, adminApplyIds,firstUserIds);
@@ -269,10 +285,14 @@
                FacesUtils.warn("请将拒绝理由输入在批注中。");
                return;
            }
            String currentUserId = getUserId();
            List<String> applyIds = new ArrayList<String>();
            for (OpeApply opeApply : this.selectedList) {
                applyIds.add(opeApply.getId());
                if(StringUtils.isNotBlank(opeApply.getBeforeApproveUserId())&&!opeApply.getApproveUserId().equalsIgnoreCase(currentUserId)){
                    FacesUtils.warn("二级审批无权限");
                    return;
                }
            }
            this.opeApplyService.updateOpeApplyStatus(ApplyStatus.REFUSE, this.memo, applyIds);