浏览代码

入职登记调整

sangwenwei 6 月之前
父节点
当前提交
6591a02a42

+ 2 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/domain/EnrollmentRegistration.java

@@ -90,4 +90,6 @@ public class EnrollmentRegistration extends BaseEntity {
     private List<String> roleIdList;
     @TableField(exist = false)
     private List<String> postIdList;
+    @TableField(exist = false)
+    private String companyId; //公司id
 }

+ 20 - 13
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/service/EnrollmentRegistrationService.java

@@ -1,6 +1,7 @@
 package com.jeeplus.human.enrollment.enrollmentRegistration.service;
 
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.TypeReference;
@@ -80,6 +81,9 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
         if (StringUtils.isNotBlank(projectReportData.getDepartment())) {
             queryWrapper.eq("a.department",projectReportData.getDepartment());
         }
+        if (StringUtils.isNotBlank(projectReportData.getCompanyId())) {
+            queryWrapper.eq("so.parent_id",projectReportData.getCompanyId());
+        }
         IPage<EnrollmentRegistration> list = mapper.findList(page, queryWrapper);
         return list;
 
@@ -471,23 +475,26 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
         // 查询基础信息表
         EnrollmentRegistration info = mapper.getById(id);
         //根据用户查询岗位和角色信息
-        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(info.getUserId());
-        ArrayList<String> roles = new ArrayList<>();
-        ArrayList<String> posts = new ArrayList<>();
-        if (userDTO != null){
-            if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())){
-                for (RoleDTO roleDTO : userDTO.getRoleDTOList()) {
-                    roles.add(roleDTO.getId());
+        if (ObjectUtil.isNotEmpty(info)){
+            UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(info.getUserId());
+            ArrayList<String> roles = new ArrayList<>();
+            ArrayList<String> posts = new ArrayList<>();
+            if (userDTO != null){
+                if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())){
+                    for (RoleDTO roleDTO : userDTO.getRoleDTOList()) {
+                        roles.add(roleDTO.getId());
+                    }
                 }
-            }
-            if (CollectionUtil.isNotEmpty(userDTO.getPostDTOList())){
-                for (PostDTO postDTO : userDTO.getPostDTOList()) {
-                    posts.add(postDTO.getId());
+                if (CollectionUtil.isNotEmpty(userDTO.getPostDTOList())){
+                    for (PostDTO postDTO : userDTO.getPostDTOList()) {
+                        posts.add(postDTO.getId());
+                    }
                 }
             }
+            info.setRoleIdList(roles);
+            info.setPostIdList(posts);
         }
-        info.setRoleIdList(roles);
-        info.setPostIdList(posts);
+
         return info;
     }
 

+ 21 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/OfficeController.java

@@ -126,6 +126,27 @@ public class OfficeController {
     }
 
     /**
+     * 获取机构JSON数据(评估,会计)。
+     *
+     * @param extId   排除的ID
+     * @param type    类型(1:公司;2:部门)
+     * @param showAll 是否显示不可用数据 1 显示 0 隐藏
+     * @return
+     */
+    @ApiLog("获取部门数据(评估,会计)")
+    @GetMapping("treeDataPgAndKj")
+    public ResponseEntity <List <OfficeDTO>> treeDataPgAndKj(@RequestParam(required = false) String tenantId,
+                                                      @RequestParam(required = false) String parentId,
+                                                      @RequestParam(required = false) String extId,
+                                                      @RequestParam(required = false) String type,
+                                                      @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
+        List <OfficeDTO> list = officeService.findListPgAndKj ( tenantId, parentId );
+        //List <OfficeDTO> rootTree = officeService.getRootTree (list, extId, type, showAll,"1" );
+        List <OfficeDTO> rootTree = officeService.getOldRootTree (parentId,list, extId, type, showAll );
+        return ResponseEntity.ok ( rootTree );
+    }
+
+    /**
      * 获取机构JSON数据。
      *
      * @param extId   排除的ID

+ 19 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/OfficeService.java

@@ -89,6 +89,25 @@ public class OfficeService extends TreeService <OfficeMapper, Office> {
         return baseMapper.findList ( queryWrapper );
     }
 
+
+    /**
+     * 获取列表(会计,评估)
+     *
+     * @return
+     */
+    public List <OfficeDTO> findListPgAndKj(String tenantId, String parentId) {
+        QueryWrapper<Office> queryWrapper = new QueryWrapper();
+        //根据当前人的所属部门去查相关数据
+        queryWrapper.like ( StringUtils.isNotBlank ( parentId ), "a.parent_ids", "," + parentId + "," );
+
+        queryWrapper.eq("a.del_flag", 0);
+        queryWrapper.and(wrapper -> wrapper.eq("a.tenant_id", "10003").or().eq("a.tenant_id", "10001"));
+
+        queryWrapper.orderByAsc ( "a.sort" );
+        return baseMapper.findList ( queryWrapper );
+    }
+
+
     /**
      * 获取列表
      *