Browse Source

补充提交

yurk 2 years ago
parent
commit
b4ac4b07fd

+ 12 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/PermissionServiceImpl.java

@@ -60,6 +60,8 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
     private SysRoleModuleService sysRoleModuleService;
     @Resource
     private CompanyMapper companyMapper;
+    @Resource
+    private CompanyReportMapper companyReportMapper;
 
 
     //根据角色id获取角色列表
@@ -253,13 +255,19 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
         List<SysFunction> functionList = sysFunctionMapper.selectList(functionQueryWrapper);
         //勾选上角色选中的功能
         List<SysRoleFunction> roleFunctionList = sysRoleFunctionMapper.selectList(new QueryWrapper<SysRoleFunction>().eq("role_id", role));
+        //获取当前公司开启了得报表
+        List<CompanyReport> companyReportList = companyReportMapper.selectList(new QueryWrapper<CompanyReport>().eq("company_id", companyId));
+        List<Integer> formIds = companyReportList.stream().map(CompanyReport::getReportFormId).collect(Collectors.toList());
         List<Integer> funIds = roleFunctionList.stream().map(fun -> fun.getFunctionId()).collect(Collectors.toList());
-        functionList.stream().forEach(fun -> {
+        List<SysFunction> resultFunList=new ArrayList<>();
+        for (SysFunction fun : functionList) {
             if (funIds.contains(fun.getId())) {
                 fun.setChecked(true);
             }
-        });
-
+            if(fun.getReportFormId()==null||(fun.getReportFormId()!=null&&formIds.contains(fun.getReportFormId()))){
+                resultFunList.add(fun);
+            }
+        }
         for (SysModule module : moduleList) {
             if (module.getParentId() == null) {
                 menuList.add(module);
@@ -268,7 +276,7 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
                 module.setChecked(true);
             }
             //赋予菜单对应功能列表
-            module.setFunctionList(functionList.stream().filter(item -> item.getModuleId().equals(module.getId())).collect(Collectors.toList()));
+            module.setFunctionList(resultFunList.stream().filter(item -> item.getModuleId().equals(module.getId())).collect(Collectors.toList()));
         }
         for (SysModule mainMenu : menuList) {
             List<SysModule> list = moduleList.stream().filter(mod -> mainMenu.getId().equals(mod.getParentId())).collect(Collectors.toList());

+ 23 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -1301,6 +1301,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             headCell.setCellValue("时薪");
             headCell.setCellStyle(headStyle);
             headCell = headRow.createCell(7);
+            headCell.setCellValue("证书");
+            headCell.setCellStyle(headStyle);
+            headCell = headRow.createCell(8);
             headCell.setCellValue("状态");
             headCell.setCellStyle(headStyle);
 
@@ -1316,6 +1319,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             }
             List<User> data = userMapper.selectList(queryWrapper);
             List<Department> deptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
+            List<String> collect = data.stream().distinct().map(da -> da.getId()).collect(Collectors.toList());
+            List<UserCert> userCertList=new ArrayList<>();
+            if(collect!=null&&!StringUtils.isEmpty(data)){
+                userCertList = userCertMapper.selectList(new QueryWrapper<UserCert>().in("user_id", collect));
+            }
             for (User item : data) {
                 if (item.getDepartmentId() != 0) {
                     Optional<Department> first = deptList.stream().filter(d -> d.getDepartmentId().equals(item.getDepartmentId())).findFirst();
@@ -1332,8 +1340,21 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 row.createCell(4).setCellValue(item.getDepartmentName());
                 row.createCell(5).setCellValue(item.getMonthCost()==null? 0 : item.getMonthCost().intValue());
                 row.createCell(6).setCellValue(item.getCost() == null?0.0 : item.getCost().doubleValue());
-                row.createCell(7).setCellValue(item.getIsActive()==1?"正常":"已停用");
-
+                List<UserCert> certList = userCertList.stream().distinct().filter(uc -> uc.getUserId().equals(item.getId())).collect(Collectors.toList());
+                if(certList.size()>0){
+                    String s="";
+                    for (int i = 0; i < certList.size(); i++) {
+                        if(i<certList.size()-1){
+                            s+=certList.get(i).getCertName()+",";
+                        }else {
+                            s+=certList.get(i).getCertName();
+                        }
+                    }
+                    row.createCell(7).setCellValue(s);
+                }else {
+                    row.createCell(7).setCellValue("");
+                }
+                row.createCell(8).setCellValue(item.getIsActive()==1?"正常":"已停用");
                 rowNum++;
             }
             //生成Excel文件