ソースを参照

添加创建人查询,通知页面添加分页,创建人查询按钮数据获取修改

wangqiang 1 年間 前
コミット
827288f050
16 ファイル変更313 行追加74 行削除
  1. 76 67
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProjectListMapper.xml
  2. 19 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/service/ProjectListService.java
  3. 6 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/service/CwProjectRecordsService.java
  4. 3 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/CwWorkClientBaseMapper.java
  5. 2 1
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/xml/CwWorkClientBaseMapper.xml
  6. 6 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/service/CwWorkClientService.java
  7. 5 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/service/dto/CwWorkClientBaseDTO.java
  8. 3 2
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/MyNoticeController.java
  9. 10 1
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/MyNoticeListMapper.java
  10. 10 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/xml/MyNoticeListMapper.xml
  11. 33 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/MyNoticeService.java
  12. 96 1
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java
  13. 1 1
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java
  14. 3 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml
  15. 15 1
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/OfficeService.java
  16. 25 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/UserService.java

+ 76 - 67
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProjectListMapper.xml

@@ -140,7 +140,7 @@
            pa.proc_ins_id as procInsIdArchive,
            d.id AS issued_id,
            d.proc_ins_id AS procInsId4,
-           d.status AS issued_status,
+           ifnull(d.status,"0") as issued_status,
            wci.no AS contract_no,
            art.ID_ as task_id,
            art1.ID_ as task_id_audit1,
@@ -660,74 +660,83 @@
 
     <select id="getListByidList" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         SELECT
-            id,
-            contract_id,
-            contract_name,
-            client,
-            client_name,
-            amount,
-            contract_type,
-            NAME,
-            NO,
-            project_type,
-            approval_no,
-            company,
-            project_mould,
-            property_holder,
-            property_holder_name,
-            location,
-            is_first,
-            year_num,
-            check_year,
-            project_manager,
-            project_manager_name,
-            report_type,
-            industry,
-            enterprise_type,
-            risk_level,
-            project_source,
-            estimate,
-            plan_end_time,
-            use_num,
-            appointment,
-            work_hours,
-            remarks,
-            assessment_enterprise,
-            assessment_enterprise_name,
-            link_num,
-            relationship,
-            assessment_way,
-            assessment_objective,
-            assessment_date,
-            num,
-            project_development,
-            delegate_project_type,
-            assessment_object,
-            assessment_range,
-            generate_report_number,
-            work_begin_date,
-            work_end_date,
-            reporting_date,
-            is_have,
-            is_influence,
-            MODE,
-            STATUS,
-            proc_ins_id,
-            process_definition_id,
-            agree_time,
-            agree_user_id,
-            tab_type,
-            create_time,
-            create_by_id,
-            update_time,
-            update_by_id,
-            del_flag,
-            tenant_id
+        a.id,
+        a.contract_id,
+        a.contract_name,
+        a.client,
+        a.client_name,
+        a.amount,
+        a.contract_type,
+        a.NAME,
+        a.NO,
+        a.project_type,
+        a.approval_no,
+        a.company,
+        a.project_mould,
+        a.property_holder,
+        a. property_holder_name,
+        a.location,
+        a.is_first,
+        a.year_num,
+        a.check_year,
+        a.project_manager,
+        a.project_manager_name,
+        a.report_type,
+        a.industry,
+        a.enterprise_type,
+        a.risk_level,
+        a.project_source,
+        a.estimate,
+        a.plan_end_time,
+        a.use_num,
+        a.appointment,
+        a. work_hours,
+        a.remarks,
+        a.assessment_enterprise,
+        a.assessment_enterprise_name,
+        a.link_num,
+        a.relationship,
+        a.assessment_way,
+        a.assessment_objective,
+        a.assessment_date,
+        a.num,
+        a.project_development,
+        a.delegate_project_type,
+        a.assessment_object,
+        a.assessment_range,
+        a.generate_report_number,
+        a.work_begin_date,
+        a.work_end_date,
+        a.reporting_date,
+        a.is_have,
+        a.is_influence,
+        a.MODE,
+        a.STATUS,
+        a.proc_ins_id,
+        a.process_definition_id,
+        a.agree_time,
+        a.agree_user_id,
+        a.tab_type,
+        a.create_time,
+        a.create_by_id,
+        a.update_time,
+        a.update_by_id,
+        a.del_flag,
+        a.tenant_id,
+        pa1.id as auditId1,
+        pa2.id as auditId2,
+        pa3.id as auditId3,
+        pa.id as archive_id
         from
-            program_project_list_info
+            program_project_list_info a
+        LEFT JOIN program_report_no prn ON prn.program_id = a.id and prn.del_flag = '0'
+        LEFT JOIN program_audit pa1 ON pa1.program_id = a.id and pa1.audit_level = '1' and pa1.del_flag = '0'
+        LEFT JOIN program_audit pa2 ON pa2.program_id = a.id and pa2.audit_level = '2' and pa2.del_flag = '0'
+        LEFT JOIN program_audit pa3 ON pa3.program_id = a.id and pa3.audit_level = '3' and pa3.del_flag = '0'
+        LEFT JOIN program_archive pa ON pa.program_id = a.id and pa.del_flag = '0'
         <where>
-            del_flag = 0
-            and id in
+            a.del_flag = 0
+            and a.id in
             <foreach collection="idList" item="id" index="index" open="(" close=")" separator=",">
                 #{id}
             </foreach>

+ 19 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/service/ProjectListService.java

@@ -732,6 +732,25 @@ public class ProjectListService {
         if (info.getCreateDates() != null && info.getCreateDates().length > 0) {
             wrapper.between("a.create_time", info.getCreateDates()[0], info.getCreateDates()[1]);
         }
+        if (StringUtils.isNotBlank(info.getStatus1())){
+            wrapper.eq("pa1.status", info.getStatus1());
+        }
+        if (StringUtils.isNotBlank(info.getStatus2())){
+            wrapper.eq("pa2.status", info.getStatus2());
+        }
+        if (StringUtils.isNotBlank(info.getStatus3())){
+            wrapper.eq("pa3.status", info.getStatus3());
+        }
+        if (StringUtils.isNotBlank(info.getIssuedStatus())){
+            if (info.getIssuedStatus().equals("0")){
+                wrapper.isNull("d.status");
+            }else {
+                wrapper.eq("d.status", info.getIssuedStatus());
+            }
+        }
+        if (StringUtils.isNotBlank(info.getArchiveStatus())){
+            wrapper.eq("pa.status", info.getArchiveStatus());
+        }
         /*//获取当前登录人信息
         UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
         //获取当前登录人所属角色

+ 6 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/service/CwProjectRecordsService.java

@@ -116,6 +116,12 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
             if (StringUtils.isNotBlank(cwProjectRecordsDTO.getCreateId())){
                 queryWrapper.eq("a.create_by_id", cwProjectRecordsDTO.getCreateId());
             }
+            // 创建人
+            if (ObjectUtil.isNotEmpty(cwProjectRecordsDTO.getCreateBy())){
+                if (StringUtils.isNotBlank(cwProjectRecordsDTO.getCreateBy().getName())){
+                    queryWrapper.in("a.create_by_id",cwProjectRecordsDTO.getCreateBy().getName());
+                }
+            }
         }
 
         IPage<CwProjectRecordsDTO> list = cwProjectRecordsMapper.findList(page, queryWrapper);

+ 3 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/CwWorkClientBaseMapper.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jeeplus.finance.workClientInfo.domain.CwWorkClientBase;
 import com.jeeplus.finance.workClientInfo.domain.CwWorkClientTemp;
 import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBaseDTO;
+import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBillingDTO;
 import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientContactDTO;
 import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientTempDTO;
 import org.apache.ibatis.annotations.Mapper;
@@ -55,6 +56,8 @@ public interface CwWorkClientBaseMapper extends BaseMapper<CwWorkClientBase> {
     List<String> getNoByIdArray(@Param("idArray") String[] idArray);
 
     public IPage<CwWorkClientBaseDTO> getInfoList(Page<CwWorkClientBaseDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwWorkClientBase> queryWrapper);
+
+    List<CwWorkClientBillingDTO> getBilling(@Param("id") String id);
 }
 
 

+ 2 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/xml/CwWorkClientBaseMapper.xml

@@ -385,7 +385,7 @@
         </foreach>
     </select>
 
-    <select id="getInfoList" resultMap="BaseResultMap">
+    <select id="getInfoList" resultType="com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBaseDTO">
         select
         <include refid="Base_Column_List"></include>,
         su.name as user_name,
@@ -395,6 +395,7 @@
         cw_mlt.name as manage_level_type_name,
         cw_ot.name as organization_type_name,
         su1.name as update_user_name,
+        cw_wct.client_id AS client_id,
         art.ID_ as task_id
         from cw_work_client_base cw_wcb
         left join sys_user su on su.id = cw_wcb.create_by_id and su.del_flag = '0'

+ 6 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/service/CwWorkClientService.java

@@ -217,6 +217,12 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
         long l2 = System.currentTimeMillis();
         System.out.println("查询客户信息列表treeService1:" + (l2-l1));
         IPage<CwWorkClientBaseDTO> list = cwWorkClientBaseMapper.getInfoList(page, queryWrapper);
+        list.getRecords().forEach(li->{
+            if (StringUtils.isNotBlank(li.getClientId())){
+                List<CwWorkClientBillingDTO> billing = cwWorkClientBaseMapper.getBilling(li.getClientId());
+                li.setCwWorkClientBillingDTOList(billing);
+            }
+        });
         long l3 = System.currentTimeMillis();
         System.out.println("查询客户信息列表treeService2:" + (l3-l2));
         return list;

+ 5 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/service/dto/CwWorkClientBaseDTO.java

@@ -25,6 +25,11 @@ public class CwWorkClientBaseDTO extends BaseDTO {
     public static final String BIZ_CODE = "11";
 
     /**
+     * 客户分类表id
+     */
+    private String clientId;
+
+    /**
      * 备注信息
      */
     private String remarks;

+ 3 - 2
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/MyNoticeController.java

@@ -1,6 +1,7 @@
 package com.jeeplus.flowable.controller;
 
 import cn.hutool.extra.spring.SpringUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.TokenProvider;
@@ -29,8 +30,8 @@ public class MyNoticeController {
 
     @GetMapping("/list")
     @ApiOperation(value = "待办列表")
-    public ResponseEntity noticeList(Page<MyNoticeList> page, String type, String title, String taskName) {
-        Page<MyNoticeList> voPage = service.noticeList(page, type, title, taskName);
+    public ResponseEntity<IPage<MyNoticeList>> noticeList(Page<MyNoticeList> page, String type, String title, String taskName) {
+        IPage<MyNoticeList> voPage = service.noticeList2(page, type, title, taskName);
         return ResponseEntity.ok (voPage);
     }
 

+ 10 - 1
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/MyNoticeListMapper.java

@@ -57,7 +57,7 @@ public interface MyNoticeListMapper extends BaseMapper<MyNoticeList> {
      * @return
      */
     @InterceptorIgnore(tenantLine = "true")
-    void portionRead(List idList);
+    void portionRead(@Param("idList")List idList);
 
     /**
      * 查询 流程信息
@@ -77,6 +77,15 @@ public interface MyNoticeListMapper extends BaseMapper<MyNoticeList> {
     Page<MyNoticeList> selectNoticePage(Page<MyNoticeList> page, @Param(Constants.WRAPPER)QueryWrapper<MyNoticeList> queryWrapper);
 
     /**
+     * 查询我的通知列表数据
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<MyNoticeList> selectNoticePage2(Page<MyNoticeList> page, @Param(Constants.WRAPPER)QueryWrapper<MyNoticeList> queryWrapper);
+
+    /**
      *查询通知信息
      * @param wrapper
      * @return

+ 10 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/xml/MyNoticeListMapper.xml

@@ -140,6 +140,16 @@
 			and a.type = 0
 		</where>
 	</select>
+    <select id="selectNoticePage2" resultType="com.jeeplus.flowable.model.MyNoticeList">
+		SELECT
+		 a.id, a.create_by_id, a.create_time,
+		 a.update_by_id, a.update_time, a.del_flag, a.task_id,
+		 a.title, a.def_id, a.task_name, a.link, a.create_user, a.create_time,
+		 a.type, a.repetition_count, a.notice_id, su.name AS "noticeName"
+		 FROM my_notice_list a
+		 LEFT JOIN sys_user su ON a.notice_id = su.id
+		 ${ew.customSqlSegment}
+	</select>
 
     <insert id="insertMyNotice">
 		insert into my_notice_list (

+ 33 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/MyNoticeService.java

@@ -3,6 +3,7 @@ package com.jeeplus.flowable.service;
 import cn.hutool.extra.spring.SpringUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.common.TokenProvider;
@@ -64,6 +65,38 @@ public class MyNoticeService {
         return listPage;
     }
 
+    /**
+     * 获取待办任务列表
+     *
+     * @return
+     */
+    public IPage<MyNoticeList> noticeList2(Page<MyNoticeList> page, String type, String title, String taskName){
+        // 获取当前登录人名称查询出未查看通知列表
+        QueryWrapper<MyNoticeList> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("a.notice_id", SpringUtil.getBean ( IUserApi.class ).getByToken (TokenProvider.getCurrentToken()).getId());
+        queryWrapper.orderByDesc("a.create_time");
+
+        if (StringUtils.isNotEmpty(type)) {
+            queryWrapper.eq("a.type", Integer.parseInt(type));
+        } else {
+            queryWrapper.eq("a.type", 0);
+        }
+        if (StringUtils.isNotEmpty(title)) {
+            queryWrapper.like("a.title", title);
+        }
+        if (StringUtils.isNotEmpty(taskName)) {
+            queryWrapper.like("a.task_name", taskName);
+        }
+//        Page<MyNoticeList> listPage = mapper.selectPage(page, queryWrapper);
+        IPage<MyNoticeList> listPage = mapper.selectNoticePage2(page, queryWrapper);
+        if (CollectionUtils.isNotEmpty(listPage.getRecords())) {
+            for (MyNoticeList notice : listPage.getRecords()) {
+                notice.setType("0".equals(notice.getType())? "未读":"已读");
+            }
+        }
+        return listPage;
+    }
+
     public String add(String taskId, String title, String defId, String taskName, String createName, String createDate, String noticeName, String noticeId,String createById) throws Exception{
         MyNoticeList notice = new MyNoticeList();
         //是否已保存

+ 96 - 1
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -131,6 +131,85 @@ public class UserController {
      * @param page
      * @return
      */
+    @ApiLog("项目组成员查询用户使用")
+    @ApiOperation(value = "项目组成员查询用户使用")
+    //@PreAuthorize("hasAuthority('sys:user:list')")
+    @GetMapping("memberList")
+    public ResponseEntity memberList(UserDTO userDTO, Page <UserDTO> page) throws Exception {
+
+        QueryWrapper <UserDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( userDTO, UserDTO.class );
+        // 管理员查询不限制
+        if (!UserUtils.getCurrentUserDTO().isAdmin()) {
+            queryWrapper.isNull("a.is_admin");
+            if (ObjectUtil.isNotEmpty(userDTO)){
+                if (ObjectUtil.isNotEmpty(userDTO.getCompanyDTO()) && ObjectUtil.isNotEmpty(userDTO.getOfficeDTO())) {
+                    OfficeDTO officeDTO = UserUtils.getCurrentUserDTO().getOfficeDTO();
+                    if (StringUtils.isNotBlank(userDTO.getCertType())) {
+
+                    }else{
+                        // 当不是精确的部门查询时,再添加下面的筛选条件
+                        if ((StringUtils.isNotBlank(userDTO.getCompanyDTO().getId()) && StringUtils.isBlank(userDTO.getOfficeDTO().getId()))
+                                || "true".equals(userDTO.getSelectAll())) {
+                            // officeDTO.id是空,companyDTO.id不是空的话,说明前端组件点击的集团来进行查询
+                            // selectAll为‘true’的话,说明前端没有选择集团或者部门查询,这个时候要展示全部人员
+                            // 根据当前用户的部门id找到此部门的ids
+                            String ids = officeService.getById(UserUtils.getCurrentUserDTO().getOfficeDTO().getId()).getParentIds();
+                            // 根据ids分隔后的index[2],找到当前用户的所属公司id
+                            String companyId = null;
+                            String[] split = ids.split(",");
+                            // split.length大于2,说明当前登录人所属部门是普通部门,展示部分人员信息
+                            // 否则,当前登录人所属公共类部门(忘了叫什么类部门了,就是总经办那种部门),展示全部人员信息
+                            if(split.length>2){
+                                companyId = split[2];
+                                // 根据公司id,找到此公司下的所有部门
+                                List<Office> officeList = officeService.list(new QueryWrapper<Office>().lambda().eq(Office::getParentId, companyId));
+                                Set officeIdSet = new HashSet();
+                                for (Office office : officeList) {
+                                    if(StringUtils.isNotBlank(office.getId())){
+                                        officeIdSet.add(office.getId());
+                                    }
+                                }
+                                List<String> officeIdList = Lists.newArrayList(officeIdSet);
+                                // 拿到这些部门的id
+                                //List<String> officeIdList = officeList.stream().distinct().map(Office::getId).collect(Collectors.toList());
+                                // 拿到所有公有部门的id
+                                List<String> officePublicIdList = officeService.list(new LambdaQueryWrapper<Office>().eq(Office::getIsPublic,"1")).stream().map(Office::getId).collect(Collectors.toList());
+                                // 拿到直属公司的id
+                                officeIdList.add(companyId);
+                                // 最后得到的所有部门的id
+                                officeIdList.addAll(officePublicIdList);
+                                List<String> lastIds = officeIdList.stream().distinct().collect(Collectors.toList());
+                                // 添加筛选条件为这些部门的id
+                                queryWrapper.in("a.office_id",lastIds);
+                            }
+                        } else if(StringUtils.isBlank(userDTO.getCompanyDTO().getId()) && StringUtils.isNotBlank(userDTO.getOfficeDTO().getId())) {
+                            // officeDTO.id不是空,companyDTO.id是空的话,说明前端组件点击的部门查询
+                            queryWrapper.eq("a.office_id",userDTO.getOfficeDTO().getId());
+                        }
+                    }
+                }
+            }
+        }
+        if (ObjectUtil.isNotEmpty(userDTO)) {
+            // 当certType传值时,获取拥有此资格证类型的人员
+            if (StringUtils.isNotBlank(userDTO.getCertType())) {
+                queryWrapper.eq("sc.type",userDTO.getCertType());
+            }
+            if ( userDTO.getTenantDTO ( ) != null && StrUtil.isNotBlank ( userDTO.getTenantDTO ( ).getId ( ) ) ) {
+            queryWrapper.eq ( "a.tenant_id", userDTO.getTenantDTO ( ).getId ( ) );
+            }
+        }
+        IPage <UserDTO> result = userService.findMemberPage ( page, queryWrapper );
+        return ResponseEntity.ok ( result );
+    }
+
+    /**
+     * 查询列表
+     *
+     * @param userDTO
+     * @param page
+     * @return
+     */
     @ApiLog("用户数据列表")
     @ApiOperation(value = "用户数据列表")
     //@PreAuthorize("hasAuthority('sys:user:list')")
@@ -205,7 +284,7 @@ public class UserController {
                 queryWrapper.eq("sc.type",userDTO.getCertType());
             }
             if ( userDTO.getTenantDTO ( ) != null && StrUtil.isNotBlank ( userDTO.getTenantDTO ( ).getId ( ) ) ) {
-            queryWrapper.eq ( "a.tenant_id", userDTO.getTenantDTO ( ).getId ( ) );
+                queryWrapper.eq ( "a.tenant_id", userDTO.getTenantDTO ( ).getId ( ) );
             }
         }
         IPage <UserDTO> result = userService.findPage ( page, queryWrapper );
@@ -225,6 +304,22 @@ public class UserController {
         return ResponseEntity.ok ( result );
     }
 
+
+    @ApiLog("根据用户id获取被选次数")
+    @ApiOperation(value = "根据用户id获取被选次数")
+    //@PreAuthorize("hasAuthority('sys:user:list')")
+    @GetMapping("getCount")
+    public ResponseEntity getCount(String id){
+        UserDTO userDTO = userService.get(id);
+        if (userDTO.getName().equals("潘中")){
+            userDTO.setAccountantUserFlag(0);
+        }else{
+            userDTO.setAccountantUserFlag(1);
+        }
+        userDTO.setAccountantUserCount(userService.getAccountantUserCount(id));
+        return ResponseEntity.ok(userDTO);
+    }
+
     /**
      * 查询列表
      *

+ 1 - 1
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java

@@ -93,7 +93,7 @@ public interface OfficeMapper extends TreeMapper <Office> {
      * @return
      */
     @InterceptorIgnore(tenantLine = "true")
-    List<Office> getChildren(@Param("rootId")String rootId);
+    List<Office> getChildren(@Param("rootId")String rootId,@Param("companyId")String companyId);
 
     /**
      * 获取到所有parent_id为‘0’的评估部门数据

+ 3 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml

@@ -191,6 +191,9 @@
         WHERE
             del_flag = 0
             and parent_id = #{rootId}
+        <if test="companyId != null and companyId != ''">
+            and id = #{companyId}
+        </if>
     </select>
     <select id="getAccessChildren" resultType="com.jeeplus.sys.domain.Office">
         SELECT

+ 15 - 1
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/OfficeService.java

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.jeeplus.common.SecurityUtils;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.common.constant.CommonConstants;
 import com.jeeplus.common.constant.enums.OfficeTypeEnum;
@@ -22,6 +23,7 @@ import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.service.mapstruct.OfficeWrapper;
 import com.jeeplus.sys.utils.UserUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -222,7 +224,19 @@ public class OfficeService extends TreeService <OfficeMapper, Office> {
     public List <OfficeDTO> getRootTree(List<OfficeDTO> list, String extId, String type, String showAll, String showMyOffice) {
         List<OfficeDTO> offices = Lists.newArrayList ();
         // 获取到所有parent_id为‘0’的部门数据
-        List<Office> children = officeMapper.getChildren(OfficeDTO.getRootId());
+        //获取当前登录人所属的部门
+        List<Office> children = new ArrayList<>();
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        if (!SecurityUtils.getCurrentUserDTO ( ).isAdmin ( )){
+            if (userDTO.getCompanyDTO().getName().contains("评估")||userDTO.getCompanyDTO().getName().contains("会计")){
+                children = officeMapper.getChildren(OfficeDTO.getRootId(),userDTO.getCompanyDTO().getId());
+            } else {
+                children = officeMapper.getChildren(OfficeDTO.getRootId(),"");
+            }
+
+        } else {
+            children = officeMapper.getChildren(OfficeDTO.getRootId(),"");
+        }
 //        List<Office> children = super.getChildren(new Office(OfficeDTO.getRootId()));
         List<OfficeDTO> rootTrees = OfficeWrapper.INSTANCE.toDTO (children);
         for (OfficeDTO root : rootTrees) {

+ 25 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/UserService.java

@@ -6,10 +6,13 @@ package com.jeeplus.sys.service;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.extra.spring.SpringUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jeeplus.common.SecurityUtils;
+import com.jeeplus.common.TokenProvider;
 import com.jeeplus.common.constant.CacheNames;
 import com.jeeplus.common.constant.CommonConstants;
 import com.jeeplus.common.redis.RedisUtils;
@@ -17,6 +20,7 @@ import com.jeeplus.sys.domain.Cert;
 import com.jeeplus.sys.domain.Office;
 import com.jeeplus.sys.domain.SysConfig;
 import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.mapper.OfficeMapper;
 import com.jeeplus.sys.mapper.UserMapper;
 import com.jeeplus.sys.service.dto.CertDTO;
@@ -213,6 +217,27 @@ public class UserService extends ServiceImpl <UserMapper, User> {
 
     }
 
+    /**
+     * 自定义分页检索
+     *
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    public IPage <UserDTO> findMemberPage(Page <UserDTO> page, QueryWrapper queryWrapper) {
+        queryWrapper.eq ( "a.del_flag", CommonConstants.NOT_DELETED ); // 排除已经删除
+        if (!SecurityUtils.getCurrentUserDTO ( ).isAdmin ( )){
+            //根据当前人的所属公司查该公司下的所有人员信息
+            UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+            if (userDTO.getCompanyDTO().getName().contains("评估")||userDTO.getCompanyDTO().getName().contains("会计")){
+                queryWrapper.eq ( "a.company_id", userDTO.getCompanyDTO().getId() );
+            }
+        }
+        return baseMapper.findList ( page, queryWrapper );
+
+
+    }
+
 
     /**
      * 自定义分页检索