| | |
| | | private Boolean approvalFlag; |
| | | |
| | | public Boolean getApprovalFlag() { |
| | | String id=getUserId(); |
| | | Long id=getUserId(); |
| | | SysUser sysUser = sysUserService.getSysUser(id); |
| | | // 不是管理员时 |
| | | if (sysUser.getSeeFlag().getKey() != SeeFlag.MANAGE.getKey() |
| | |
| | | this.approvalUserList = approvalUserList; |
| | | } |
| | | |
| | | private String adminApproveUserId; |
| | | private Long adminApproveUserId; |
| | | |
| | | private List<SysUser> adminApproveUserIdSelectList; |
| | | |
| | |
| | | |
| | | SysUser first = null; |
| | | for (SysUser sysUser : applyUserSelectList) { |
| | | if ("15fc90a1f7bf43bda01313904b543195".equalsIgnoreCase(sysUser.getRoleId())) { |
| | | if (sysUser.getName().equals("连悦")) { |
| | | first = sysUser; |
| | | } else if (!sysUser.getAccount().equals("admin")){ |
| | | adminApproveUserIdSelectList.add(sysUser); |
| | | } |
| | | if (sysUser.getRoleId()==1L) { |
| | | // if (!sysUser.getAccount().equals("admin")){ |
| | | // adminApproveUserIdSelectList.add(sysUser); |
| | | // } |
| | | adminApproveUserIdSelectList.add(sysUser); |
| | | } |
| | | } |
| | | if (first != null) { |
| | | adminApproveUserIdSelectList.add(0, first); |
| | | } |
| | | |
| | | /*for(SysUser sysUser : adminApproveUserIdSelectList){ |
| | | if(sysUser.getName().equals("admin")){ |
| | | adminApproveUserIdSelectList.remove(sysUser); |
| | | } |
| | | }*/ |
| | | |
| | | } |
| | | |
| | | public void onApprovalBtnClick() { |
| | |
| | | return; |
| | | } |
| | | |
| | | this.dangerousFlag = false; |
| | | 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; |
| | | } |
| | | |
| | | Long currentUserId = getUserId(); |
| | | if(opeApply.getBeforeApproveUserId()!=null&&!opeApply.getApproveUserId().equals(currentUserId)){ |
| | | FacesUtils.warn("提示您已审批完成,请等待二级审批者审批"); |
| | | return; |
| | | } |
| | | /* if (DangerousFlag.DANGEROUS == opeApply.getReagent().getDangerousFlag()) { |
| | | if (!"15fc90a1f7bf43bda01313904b543195".equals(this.getUser().getRoleId())) { |
| | | dangerousFlag = true; |
| | |
| | | }*/ |
| | | String controlProducts = opeApply.getReagent().getControlProducts(); |
| | | if (StringUtils.isNotBlank(controlProducts)) { |
| | | String baseMetaValue = baseMetaService.getBaseMetaValue(controlProducts); |
| | | if (StringUtils.isNotBlank(baseMetaValue) && !"15fc90a1f7bf43bda01313904b543195".equals(this.getUser().getRoleId())) { |
| | | dangerousFlag = true; |
| | | } |
| | | dangerousFlag = true; |
| | | checkMap.put(1, 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) { |
| | | FacesUtils.warn("请选择系统管理员审批。"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | List<String> applyIds = new ArrayList<>(); |
| | | List<String> adminApplyIds = new ArrayList<>(); |
| | | List<String> firstUserIds = new ArrayList<>(); |
| | | Long currentUserId = getUserId(); |
| | | List<Long> applyIds = new ArrayList<>(); |
| | | List<Long> adminApplyIds = new ArrayList<>(); |
| | | List<Long> firstUserIds = new ArrayList<>(); |
| | | for (OpeApply opeApply : this.selectedList) { |
| | | /* if (DangerousFlag.DANGEROUS == opeApply.getReagent().getDangerousFlag()) { |
| | | adminApplyIds.add(opeApply.getId()); |
| | | } else { |
| | | applyIds.add(opeApply.getId()); |
| | | }*/ |
| | | |
| | | String baseMetaValue = baseMetaService.getBaseMetaValue(opeApply.getReagent().getControlProducts()); |
| | | if (this.dangerousFlag && StringUtils.isNotBlank(baseMetaValue)) { |
| | | if (this.dangerousFlag&&opeApply.getBeforeApproveUserId()==null) { |
| | | adminApplyIds.add(opeApply.getId()); |
| | | firstUserIds.add(opeApply.getApproveUserId()); |
| | | } else { |
| | | applyIds.add(opeApply.getId()); |
| | | } |
| | | if(opeApply.getBeforeApproveUserId()!=null&&!opeApply.getApproveUserId().equals(currentUserId)){ |
| | | FacesUtils.warn("提示您已审批完成,请等待二级审批者审批"); |
| | | return; |
| | | } |
| | | } |
| | | boolean result = this.opeApplyService.updateSelectedOpeApplyStatus(memo, applyIds, adminApproveUserId, adminApplyIds,firstUserIds); |
| | |
| | | FacesUtils.warn("请将拒绝理由输入在批注中。"); |
| | | return; |
| | | } |
| | | |
| | | List<String> applyIds = new ArrayList<String>(); |
| | | Long currentUserId = getUserId(); |
| | | List<Long> applyIds = new ArrayList<Long>(); |
| | | for (OpeApply opeApply : this.selectedList) { |
| | | applyIds.add(opeApply.getId()); |
| | | if(opeApply.getBeforeApproveUserId()!=null&&!opeApply.getApproveUserId().equals(currentUserId)){ |
| | | FacesUtils.warn("二级审批无权限"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | this.opeApplyService.updateOpeApplyStatus(ApplyStatus.REFUSE, this.memo, applyIds); |
| | |
| | | Map<String, Integer> tempMap = new HashMap<String,Integer>(); |
| | | List<OpeApply> realDataList = new ArrayList<>(); |
| | | //map=null; |
| | | String approveUserId = getUserId(); |
| | | Long approveUserId = getUserId(); |
| | | if(selectedList!=null&selectedList.size()>0){ |
| | | realDataList=selectedList; |
| | | }else { |
| | |
| | | dataRow.createCell(0).setCellValue(dataList.get(i).getApplyCode()== null ? "": String.valueOf(dataList.get(i).getApplyCode())); |
| | | dataRow.createCell(1).setCellValue(dataList.get(i).getReagent().getProductSn()== null ? "": String.valueOf(dataList.get(i).getReagent().getProductSn())); |
| | | dataRow.createCell(2).setCellValue(dataList.get(i).getReagent().getName()== null ? "": String.valueOf(dataList.get(i).getReagent().getName())); |
| | | dataRow.createCell(3).setCellValue(dataList.get(i).getReagent().getControlProducts()== null ? "": String.valueOf(baseMetaService.getBaseMetaValue(dataList.get(i).getReagent().getControlProducts()))); |
| | | dataRow.createCell(4).setCellValue(dataList.get(i).getReagent().getReagentFormat()== null ? "": String.valueOf(baseMetaService.getBaseMetaValue(dataList.get(i).getReagent().getReagentFormat()))); |
| | | dataRow.createCell(5).setCellValue(dataList.get(i).getReagent().getMainMetering()== null ? "": String.valueOf(dataList.get(i).getReagent().getMainMetering())+baseMetaService.getBaseMetaValue(dataList.get(i).getReagent().getReagentUnit())); |
| | | dataRow.createCell(3).setCellValue(dataList.get(i).getReagent().getControlProducts()== null ? "": String.valueOf(dataList.get(i).getReagent().getControlProducts())); |
| | | dataRow.createCell(4).setCellValue(dataList.get(i).getReagent().getReagentFormat()== null ? "": String.valueOf(dataList.get(i).getReagent().getReagentFormat())); |
| | | dataRow.createCell(5).setCellValue(dataList.get(i).getReagent().getMainMetering()== null ? "": String.valueOf(dataList.get(i).getReagent().getMainMetering())+dataList.get(i).getReagent().getReagentUnit()); |
| | | dataRow.createCell(6).setCellValue(dataList.get(i).getReagent().getPrice()== null ? "": String.valueOf(dataList.get(i).getReagent().getPrice())); |
| | | dataRow.createCell(7).setCellValue(String.valueOf(dataList.get(i).getNum())); |
| | | dataRow.createCell(8).setCellValue(dataList.get(i).getReagent().getCas()== null ? "": String.valueOf(dataList.get(i).getReagent().getCas())); |
| | | dataRow.createCell(9).setCellValue(dataList.get(i).getReagent().getReagentCharacter()== null ? "": String.valueOf(baseMetaService.getBaseMetaValue(dataList.get(i).getReagent().getReagentCharacter()))); |
| | | dataRow.createCell(9).setCellValue(dataList.get(i).getReagent().getReagentCharacter()== null ? "": String.valueOf(dataList.get(i).getReagent().getReagentCharacter())); |
| | | dataRow.createCell(10).setCellValue(dataList.get(i).getReagent().getProductHomeName()== null ? "": String.valueOf(dataList.get(i).getReagent().getProductHomeName())); |
| | | dataRow.createCell(11).setCellValue(dataList.get(i).getReagent().getReagentType()== null ? "": String.valueOf(baseMetaService.getBaseMetaValue(dataList.get(i).getReagent().getReagentType()))); |
| | | dataRow.createCell(11).setCellValue(dataList.get(i).getReagent().getReagentType()== null ? "": String.valueOf(dataList.get(i).getReagent().getReagentType())); |
| | | |
| | | dataRow.createCell(12).setCellValue(String.valueOf(dataList.get(i).getApplyUserName())); |
| | | dataRow.createCell(13).setCellValue(String.valueOf(dataList.get(i).getCreateTime())); |
| | |
| | | dataRow.createCell(15).setCellValue(String.valueOf(dataList.get(i).getApproveUserName())); |
| | | } |
| | | dataRow.createCell(16).setCellValue(String.valueOf(dataList.get(i).getStatus().getText())); |
| | | SysProject project = sysProjectService.getProjectByProId(dataList.get(i).getObjective()); |
| | | SysProject project = sysProjectService.getSysProject(dataList.get(i).getProjectId()); |
| | | dataRow.createCell(17).setCellValue(project.getProjectName()==null ?"":String.valueOf(project.getProjectName())); |
| | | } |
| | | |
| | |
| | | public List<OpeApply> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) { |
| | | List<OpeApply> list = null; |
| | | //try { |
| | | String approveUserId = getUserId(); |
| | | Long approveUserId = getUserId(); |
| | | int count = 0; |
| | | if (StringUtils.isNotBlank(approveUserId)) { |
| | | if (approveUserId!=null) { |
| | | count = opeApplyService.getOpeApplyTotalCountForApproval(applyUserName,approvaUserName,reagentName, startDeadline, endDeadline, status, null, approveUserId, null, null,null); |
| | | } |
| | | this.setRowCount(count); |
| | |
| | | list.get(i).setApproveUserName(list.get(i).getSecondUserName()); |
| | | list.get(i).setSecondUserName(name); |
| | | }*/ |
| | | if(list.get(i).getBeforeApproveUserId()!=null&&!list.get(i).getBeforeApproveUserId().equals("")){ |
| | | if(list.get(i).getBeforeApproveUserId()!=null){ |
| | | String name=list.get(i).getApproveUserName(); |
| | | list.get(i).setFirst(list.get(i).getFirName()); |
| | | list.get(i).setSecond(name); |
| | |
| | | // } |
| | | // } |
| | | // } |
| | | return opeApplyService.getOpeApply(rowKey); |
| | | Long id=Long.valueOf(rowKey); |
| | | return opeApplyService.getOpeApply(id); |
| | | } |
| | | }; |
| | | } |
| | |
| | | /** |
| | | * 审批者名称取得 |
| | | */ |
| | | public String getUserName(String approveUserId) { |
| | | if (!StringUtils.isEmpty(approveUserId)) { |
| | | |
| | | for (SysUser user : this.getApplyUserSelectList()) { |
| | | |
| | | if (user.getId().equals(approveUserId)) { |
| | | return user.getName(); |
| | | } |
| | | public String getUserName(Long approveUserId) { |
| | | if (approveUserId!=null) { |
| | | SysUser user=this.sysUserService.getSysUser(approveUserId); |
| | | if(user!=null){ |
| | | return user.getName(); |
| | | } |
| | | } |
| | | |
| | | return ""; |
| | | } |
| | | |
| | |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public String getAdminApproveUserId() { |
| | | public Long getAdminApproveUserId() { |
| | | return adminApproveUserId; |
| | | } |
| | | |
| | | public void setAdminApproveUserId(String adminApproveUserId) { |
| | | public void setAdminApproveUserId(Long adminApproveUserId) { |
| | | this.adminApproveUserId = adminApproveUserId; |
| | | } |
| | | |