|
@@ -1773,4 +1773,83 @@ public class UserUtils {
|
|
|
List<User> users = userDao.findUserByRoleId(role.getId(), comId);
|
|
|
return users;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 获取总审人员信息
|
|
|
+ */
|
|
|
+ public static List<User> getAuditUserList(String enname,int type,String officeId,String businessType,User userId){
|
|
|
+ //businessType 1:全平台 2:合同模块 3:合同归档 4:项目登记 5:开票管理
|
|
|
+ // 6:退票管理 7:收入管理 8:报销管理 9:月度计划管理 10:案例管理 11:行政管理 12 报告管理13 采购合同管理 14采购管理 15报废管理
|
|
|
+ //16借用管理 17 领用管理 18劳动关系管理 19 加班申请 20 出差申请 21外勤申请 22 转正申请 23 职级调整 24 部门调整 25 请假申请
|
|
|
+ //26 补卡申请 27 考勤审批
|
|
|
+ String name = getRoleActivityEnname(UserUtils.getSelectCompany().getId(),userId);
|
|
|
+ if (!enname.contains(name)){
|
|
|
+ enname = name+enname;
|
|
|
+ }
|
|
|
+ Role role = new Role();
|
|
|
+ role.setEnname(enname);
|
|
|
+ Office office = officeDao.get(officeId);
|
|
|
+ if (StringUtils.isNotBlank(office.getBranchOffice()) || type == 2) {
|
|
|
+ if (type == 2) {
|
|
|
+ role.setOffice(new Office(officeId));
|
|
|
+ } else if (type == 3) {
|
|
|
+ role.setBranchCompany(new Office(office.getBranchOffice()));
|
|
|
+ } else if(type == 1){
|
|
|
+ Office branchOffice = officeDao.get(office.getBranchOffice());
|
|
|
+ if (StringUtils.isNotBlank(branchOffice.getParentId())&& !"0".equals(branchOffice.getParentId())){
|
|
|
+ Office topCompany = officeDao.get(branchOffice.getParentId());
|
|
|
+ if ("1".equals(topCompany.getType())){
|
|
|
+ Office office1 = new Office();
|
|
|
+ office1.setName("总公司");
|
|
|
+ role.setBranchCompany(office1);
|
|
|
+ }else{
|
|
|
+ role.setBranchCompany(new Office(branchOffice.getParentId()));
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ Office office1 = new Office();
|
|
|
+ office1.setName("总公司");
|
|
|
+ role.setBranchCompany(office1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Office office1 = new Office();
|
|
|
+ office1.setName("总公司");
|
|
|
+ role.setBranchCompany(office1);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ Office office1 = new Office();
|
|
|
+ office1.setName("总公司");
|
|
|
+ role.setBranchCompany(office1);
|
|
|
+ }
|
|
|
+ String roleIds = "";
|
|
|
+ List<Role> roles = roleDao.getByRoleActivityEnname(role);
|
|
|
+ for (Role r : roles) {
|
|
|
+ roleIds += r.getId() + ",";
|
|
|
+ }
|
|
|
+ User user = new User();
|
|
|
+ user.setRoleIds(roleIds);
|
|
|
+ List<User> list = userDao.getAuditUserList(user);
|
|
|
+ List<User> users = new ArrayList<>();
|
|
|
+ Set<String> set = new HashSet<>();
|
|
|
+ for (User u:list){
|
|
|
+ ActivityAssignment select = new ActivityAssignment();
|
|
|
+ select.setCreateBy(u);
|
|
|
+ select.setStartDate(new Date());
|
|
|
+ select.setType(businessType);
|
|
|
+ select.setCompanyId(getSelectCompany().getId());
|
|
|
+ ActivityAssignment activityAssignment = activityAssignmentDao.getByUserIdAndDate(select);
|
|
|
+ if (activityAssignment!=null && !activityAssignment.getIsNewRecord()){
|
|
|
+ User activityAssignmentUser = activityAssignment.getUser();
|
|
|
+ activityAssignmentUser.setRemarks(u.getName()+"的委托任务");
|
|
|
+ if (!set.contains(activityAssignmentUser.getId())) {
|
|
|
+ users.add(activityAssignmentUser);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (!set.contains(u.getId())) {
|
|
|
+ users.add(u);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ set.add(u.getId());
|
|
|
+ }
|
|
|
+ return users;
|
|
|
+ }
|
|
|
+
|
|
|
}
|