| | |
| | | |
| | | 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; |
| | |
| | | if(StringUtils.isBlank(opeApply.getBeforeApproveUserId())){ |
| | | dangerousFlag = true; |
| | | } |
| | | |
| | | }else{//其他情形:管制品打开二级审批 |
| | | String controlProducts = opeApply.getReagent().getControlProducts(); |
| | | if (StringUtils.isNotBlank(controlProducts)) { |
| | |
| | | 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; |
| | |
| | | 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<>(); |
| | |
| | | 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); |
| | |
| | | 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); |