浏览代码

Merge remote-tracking branch 'origin/master'

sangwenwei 1 年之前
父节点
当前提交
86085b3e1e
共有 34 个文件被更改,包括 1082 次插入94 次删除
  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. 5 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/domain/CwProjectInfoData.java
  5. 3 1
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/xml/CwProjectInfoMapper.xml
  6. 21 4
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/service/CwProjectReportService.java
  7. 94 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/controller/CwProjectReportBorrowController.java
  8. 49 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/domain/CwProjectReportBorrow.java
  9. 42 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/domain/CwProjectReportBorrowMessage.java
  10. 8 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/CwProjectReportArchiveMapper.java
  11. 36 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/CwProjectReportBorrowMapper.java
  12. 11 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/CwProjectReportBorrowMessageMapper.java
  13. 24 1
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/xml/CwProjectReportArchiveMapper.xml
  14. 77 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/xml/CwProjectReportBorrowMapper.xml
  15. 16 2
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/CwProjectReportArchiveService.java
  16. 274 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/CwProjectReportBorrowService.java
  17. 53 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/dto/CwProjectReportArchiveDTO.java
  18. 48 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/dto/CwProjectReportBorrowDto.java
  19. 4 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/dto/WorkAttachmentArchiveDto.java
  20. 1 1
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportCancellApplyArchived/service/ReportCancellApplyArchivedService.java
  21. 3 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/CwWorkClientBaseMapper.java
  22. 2 1
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/xml/CwWorkClientBaseMapper.xml
  23. 6 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/service/CwWorkClientService.java
  24. 5 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/service/dto/CwWorkClientBaseDTO.java
  25. 3 11
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableProcessController.java
  26. 3 2
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/MyNoticeController.java
  27. 10 1
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/MyNoticeListMapper.java
  28. 10 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/xml/MyNoticeListMapper.xml
  29. 33 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/MyNoticeService.java
  30. 96 1
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java
  31. 1 1
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java
  32. 3 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml
  33. 15 1
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/OfficeService.java
  34. 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,
            pa.proc_ins_id as procInsIdArchive,
            d.id AS issued_id,
            d.id AS issued_id,
            d.proc_ins_id AS procInsId4,
            d.proc_ins_id AS procInsId4,
-           d.status AS issued_status,
+           ifnull(d.status,"0") as issued_status,
            wci.no AS contract_no,
            wci.no AS contract_no,
            art.ID_ as task_id,
            art.ID_ as task_id,
            art1.ID_ as task_id_audit1,
            art1.ID_ as task_id_audit1,
@@ -660,74 +660,83 @@
 
 
     <select id="getListByidList" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
     <select id="getListByidList" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         SELECT
         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
         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>
         <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=",">
             <foreach collection="idList" item="id" index="index" open="(" close=")" separator=",">
                 #{id}
                 #{id}
             </foreach>
             </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) {
         if (info.getCreateDates() != null && info.getCreateDates().length > 0) {
             wrapper.between("a.create_time", info.getCreateDates()[0], info.getCreateDates()[1]);
             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 ( ));
         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())){
             if (StringUtils.isNotBlank(cwProjectRecordsDTO.getCreateId())){
                 queryWrapper.eq("a.create_by_id", 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);
         IPage<CwProjectRecordsDTO> list = cwProjectRecordsMapper.findList(page, queryWrapper);

+ 5 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/domain/CwProjectInfoData.java

@@ -21,6 +21,11 @@ import java.util.List;
 public class CwProjectInfoData extends BaseEntity {
 public class CwProjectInfoData extends BaseEntity {
 
 
     /**
     /**
+     * 报告主办人
+     */
+    private String reportCreateName;
+
+    /**
      * 报告作废标记
      * 报告作废标记
      */
      */
     private String deleteSign;
     private String deleteSign;

+ 3 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/xml/CwProjectInfoMapper.xml

@@ -40,7 +40,9 @@
         SELECT DISTINCT report_number FROM `cw_project_report_new_line` WHERE report_number like CONCAT('%',#{projectNo},'%') ORDER BY report_number desc limit 1
         SELECT DISTINCT report_number FROM `cw_project_report_new_line` WHERE report_number like CONCAT('%',#{projectNo},'%') ORDER BY report_number desc limit 1
     </select>
     </select>
     <select id="getById" resultType="com.jeeplus.finance.projectReport.domain.CwProjectInfoData">
     <select id="getById" resultType="com.jeeplus.finance.projectReport.domain.CwProjectInfoData">
-        select * from cw_project_report_new_line where id = #{id}
+        select a.*,su.name as reportCreateName from cw_project_report_new_line a
+        left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
+        where a.id = #{id}
     </select>
     </select>
     <select id="getId" resultType="java.lang.String">
     <select id="getId" resultType="java.lang.String">
         select id from cw_project_report_new_line where report_id = #{id} and del_flag = '0'
         select id from cw_project_report_new_line where report_id = #{id} and del_flag = '0'

+ 21 - 4
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/service/CwProjectReportService.java

@@ -755,7 +755,10 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
                 if ( null != reportData){
                 if ( null != reportData){
                     List<ProjectReportWorkAttachmentDTO> dtos = attachmentMapper.selectByInfoId(reportData.getId());
                     List<ProjectReportWorkAttachmentDTO> dtos = attachmentMapper.selectByInfoId(reportData.getId());
                     if (null != dtos){
                     if (null != dtos){
-                        dtos.forEach(d->{
+
+                        Iterator<ProjectReportWorkAttachmentDTO> it = dtos.iterator();
+                        while(it.hasNext()){
+                            ProjectReportWorkAttachmentDTO d = it.next();
                             //根据id查出cw_project_report_file文件表的其他信息
                             //根据id查出cw_project_report_file文件表的其他信息
                             //未签章附件
                             //未签章附件
                             CwProjectReportFile file = attachmentMapper.selectInfoByFileId(d.getId(),"0");
                             CwProjectReportFile file = attachmentMapper.selectInfoByFileId(d.getId(),"0");
@@ -774,6 +777,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
                                 d.setCreateBy(userDTO);
                                 d.setCreateBy(userDTO);
                                 d.setCreateTime(file.getCreateTime());
                                 d.setCreateTime(file.getCreateTime());
                                 dtoList.add(d);
                                 dtoList.add(d);
+                                it.remove();
                             }
                             }
 
 
                             //已签章附件
                             //已签章附件
@@ -793,19 +797,32 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
                                 d.setCreateBy(userDTO2);
                                 d.setCreateBy(userDTO2);
                                 d.setCreateTime(signatureFile.getCreateTime());
                                 d.setCreateTime(signatureFile.getCreateTime());
                                 signatureList.add(d);
                                 signatureList.add(d);
+                                it.remove();
                             }
                             }
-                        });
+                        }
                         reportData.setCwFileInfoList(dtoList);
                         reportData.setCwFileInfoList(dtoList);
                         reportData.setSignatureFileList(signatureList);
                         reportData.setSignatureFileList(signatureList);
                     }
                     }
+                    //将附件信息查出
                     // 查询附件信息
                     // 查询附件信息
                     List<WorkAttachmentInfo> fileInfo2 = reportMapper.findDtos(reportData.getId());
                     List<WorkAttachmentInfo> fileInfo2 = reportMapper.findDtos(reportData.getId());
+                    List<WorkAttachmentInfo> reportFileList = Lists.newArrayList();
+                    if(CollectionUtils.isNotEmpty(dtos) && CollectionUtils.isNotEmpty(fileInfo2)){
+                        for (ProjectReportWorkAttachmentDTO dto : dtos) {
+                            for (WorkAttachmentInfo workAttachmentDto : fileInfo2) {
+                                if(dto.getId().equals(workAttachmentDto.getId())){
+                                    reportFileList.add(workAttachmentDto);
+                                }
+                            }
+                        }
+                    }
+
                     if (CollectionUtils.isNotEmpty(dtos)) {
                     if (CollectionUtils.isNotEmpty(dtos)) {
-                        for (WorkAttachmentInfo i : fileInfo2) {
+                        for (WorkAttachmentInfo i : reportFileList) {
                             i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
                             i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
                         }
                         }
                     }
                     }
-                    reportData.setCwFileInfoList2(fileInfo2);
+                    reportData.setCwFileInfoList2(reportFileList);
                     //设置历史报告列表
                     //设置历史报告列表
                     //根据项目id查出所有的信息
                     //根据项目id查出所有的信息
                     List<CwProjectReportData> byProjectList = reportMapper.getByProjectId(reportData.getProjectId());
                     List<CwProjectReportData> byProjectList = reportMapper.getByProjectId(reportData.getProjectId());

+ 94 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/controller/CwProjectReportBorrowController.java

@@ -0,0 +1,94 @@
+package com.jeeplus.finance.projectReportArchive.controller;
+
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrow;
+import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrowMessage;
+import com.jeeplus.finance.projectReportArchive.service.CwProjectReportBorrowService;
+import com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportBorrowDto;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:50
+ **/
+@Api(tags ="财务-报告借用")
+@RestController
+@RequestMapping(value = "/project/report/borrow")
+public class CwProjectReportBorrowController {
+
+    @Resource
+    private CwProjectReportBorrowService borrowService;
+
+    /**
+     * 合同登记新增/修改
+     */
+    @ApiOperation(value = "报告借用新增/修改")
+    @PostMapping(value = "save")
+    public ResponseEntity<String> save(@RequestBody CwProjectReportBorrowDto workContractBorrowDto) throws Exception{
+        String id = borrowService.saveInfo(workContractBorrowDto);
+        return ResponseUtil.newInstance().add("businessTable", "cw_project_report_borrow").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody CwProjectReportBorrowDto workContractBorrowDto) {
+        borrowService.updateStatusById(workContractBorrowDto);
+    }
+
+    /**
+     * 根据contractInfoId修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusByContractInfoId")
+    public void updateStatusByContractInfoId(@RequestBody CwProjectReportBorrowDto workContractBorrowDto) {
+        borrowService.updateStatusByContractInfoId(workContractBorrowDto);
+    }
+
+    /**
+     * 根据id查询
+     */
+    @ApiOperation(value = "根据id查询")
+    @GetMapping(value = "findById")
+    public CwProjectReportBorrow findById(@RequestParam String id) {
+        return borrowService.findById(id);
+    }
+
+    /**
+     * 根据contractInfoId查询
+     */
+    @ApiOperation(value = "根据contractInfoId查询")
+    @GetMapping(value = "findByContractInfoId")
+    public CwProjectReportBorrow findByContractInfoId(@RequestParam String id) {
+        return borrowService.findByContractInfoId(id);
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态借用表status")
+    @PostMapping(value = "updateMessageStatusById")
+    public void updateMessageStatusById(@RequestBody CwProjectReportBorrowDto workContractBorrowDto) {
+        borrowService.updateMessageByBorrowId(workContractBorrowDto, workContractBorrowDto.getType());
+    }
+
+    @ApiOperation(value = "根据id删除借用表信息")
+    @GetMapping(value = "deleteById")
+    public void deleteById(@RequestParam String id) {
+        borrowService.deleteById(id);
+    }
+
+    @ApiOperation(value = "根据id查询借用表信息")
+    @GetMapping(value = "findMessageList")
+    public List<CwProjectReportBorrowMessage> findMessageList(@RequestParam String id) {
+        return borrowService.findMessageList(id);
+    }
+}

+ 49 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/domain/CwProjectReportBorrow.java

@@ -0,0 +1,49 @@
+package com.jeeplus.finance.projectReportArchive.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.finance.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:53
+ **/
+@Data
+@TableName("cw_project_report_borrow")
+public class CwProjectReportBorrow extends BaseEntity {
+
+    /**
+     * 附件
+     */
+    @TableField(exist = false)
+    private List<WorkAttachmentArchiveDto> WorkAttachmentDtoList;
+
+    private String archiveId;
+
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    private String projectName;
+
+    private String reportNo;
+
+    private String clientName;
+
+    private String borrowName;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowData;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowRetData;
+
+    private String remarks;
+
+    private String borrowType;
+
+}

+ 42 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/domain/CwProjectReportBorrowMessage.java

@@ -0,0 +1,42 @@
+package com.jeeplus.finance.projectReportArchive.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:54
+ **/
+@Data
+@TableName("cw_project_report_borrow_message")
+public class CwProjectReportBorrowMessage extends BaseEntity {
+
+    private String projectReportBorrowId;
+
+    private String projectName;
+
+    private String borrowName;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowData;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowRetData;
+
+    private String borrowType;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date retData;
+
+    private String contractId;  //合同id
+
+    private String contractCreateById;  //合同创建人id
+
+    private String processDefinitionId;  //流程defId
+    private String procInsId;  //流程procInsId
+
+}

+ 8 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/CwProjectReportArchiveMapper.java

@@ -9,14 +9,22 @@ import com.jeeplus.finance.invoice.domain.CwFinanceInvoice;
 import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportArchive;
 import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportArchive;
 import com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
 import com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
 import com.jeeplus.finance.projectReportArchive.service.dto.ReportDTO;
 import com.jeeplus.finance.projectReportArchive.service.dto.ReportDTO;
+import com.jeeplus.finance.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
+import java.util.List;
+
 @Mapper
 @Mapper
 //@InterceptorIgnore(tenantLine = "true")
 //@InterceptorIgnore(tenantLine = "true")
 public interface CwProjectReportArchiveMapper extends BaseMapper<CwProjectReportArchive> {
 public interface CwProjectReportArchiveMapper extends BaseMapper<CwProjectReportArchive> {
+    @InterceptorIgnore(tenantLine = "true")
+    List<WorkAttachmentArchiveDto> findDtos(@Param("id") String id);
+
+    void updateBorrowTypeById(@Param("id") String id, @Param("status")String status);
     //@InterceptorIgnore(tenantLine = "true")
     //@InterceptorIgnore(tenantLine = "true")
     IPage<CwProjectReportArchiveDTO> findList(Page<CwProjectReportArchiveDTO> page, @Param("currentUser") UserDTO currentUser, @Param("isBmzr") String isBmzr, @Param("officeIds") String officeIds, @Param(Constants.WRAPPER) QueryWrapper<CwProjectReportArchive> queryWrapper, @Param("sta") String sta);
     IPage<CwProjectReportArchiveDTO> findList(Page<CwProjectReportArchiveDTO> page, @Param("currentUser") UserDTO currentUser, @Param("isBmzr") String isBmzr, @Param("officeIds") String officeIds, @Param(Constants.WRAPPER) QueryWrapper<CwProjectReportArchive> queryWrapper, @Param("sta") String sta);
 
 

+ 36 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/CwProjectReportBorrowMapper.java

@@ -0,0 +1,36 @@
+package com.jeeplus.finance.projectReportArchive.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrow;
+import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrowMessage;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:52
+ **/
+public interface CwProjectReportBorrowMapper extends BaseMapper<CwProjectReportBorrow> {
+
+    void updateStatusById(@Param("id") String id, @Param("borrowType")String borrowType);
+
+    void updateStatusByContractInfoId(@Param("id") String id, @Param("borrowType")String borrowType);
+
+    CwProjectReportBorrow selectFileByContractInfoId (@Param("id") String id);
+
+    void updateMessageByBorrowId(@Param("id") String id, @Param("borrowType")String borrowType, @Param("type")String type);
+
+    void deleteMessageById(@Param("id") String id);
+
+    List<CwProjectReportBorrowMessage> findMessageList(@Param("id") String id);
+
+    CwProjectReportBorrow selectByInfoId(String id);
+
+    /**
+     * 查询临期合同借用信息
+     * @param adventDay
+     * @return
+     */
+    List<CwProjectReportBorrowMessage> getAdventMessageList(@Param("adventDay") String adventDay);
+}

+ 11 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/CwProjectReportBorrowMessageMapper.java

@@ -0,0 +1,11 @@
+package com.jeeplus.finance.projectReportArchive.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrowMessage;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:59
+ **/
+public interface CwProjectReportBorrowMessageMapper extends BaseMapper<CwProjectReportBorrowMessage> {
+}

+ 24 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/xml/CwProjectReportArchiveMapper.xml

@@ -236,8 +236,12 @@
         cw_prnl.report_no,
         cw_prnl.report_no,
         date_format(cw_prnl.report_date,'%Y-%m-%d') as report_date,
         date_format(cw_prnl.report_date,'%Y-%m-%d') as report_date,
         art.ID_ as task_id,
         art.ID_ as task_id,
+        crb.borrow_type,
+        crb.create_by_id as borrowUserId,
+        crb.proc_ins_id as procInsId2,
         (case when cw_pa.audit_date is null then timestampdiff(day,cw_prnl.report_date,now()) when cw_pa.audit_date is not null then timestampdiff(day,cw_prnl.report_date,cw_pa.audit_date) end) as archiveDay
         (case when cw_pa.audit_date is null then timestampdiff(day,cw_prnl.report_date,now()) when cw_pa.audit_date is not null then timestampdiff(day,cw_prnl.report_date,cw_pa.audit_date) end) as archiveDay
         from cw_project_report_archive cw_pa
         from cw_project_report_archive cw_pa
+        left join cw_project_report_borrow crb on crb.archive_id = cw_pa.id and crb.del_flag = '0'
         left join cw_work_client_base cw_wcb on cw_pa.audited_units = cw_wcb.id and cw_wcb.del_flag = '0'
         left join cw_work_client_base cw_wcb on cw_pa.audited_units = cw_wcb.id and cw_wcb.del_flag = '0'
         left join sys_user su on su.id = cw_pa.create_by_id and su.del_flag = '0'
         left join sys_user su on su.id = cw_pa.create_by_id and su.del_flag = '0'
         left join sys_office so on so.id = su.office_id and so.del_flag ='0'
         left join sys_office so on so.id = su.office_id and so.del_flag ='0'
@@ -303,7 +307,7 @@
             left join sys_user su2 on su2.id = cw_pr.signature_annotator2 and su2.del_flag = '0'
             left join sys_user su2 on su2.id = cw_pr.signature_annotator2 and su2.del_flag = '0'
             where cw_prnl.del_flag = '0'
             where cw_prnl.del_flag = '0'
         ) b on b.report_id = cw_pa.report_id
         ) b on b.report_id = cw_pa.report_id
-        where cw_pa.del_flag = '0' and cw_pa.id = ${id}
+        where cw_pa.del_flag = '0' and cw_pa.id = #{id}
     </select>
     </select>
 
 
     <select id="findReportList" resultType="com.jeeplus.finance.projectReportArchive.service.dto.ReportDTO">
     <select id="findReportList" resultType="com.jeeplus.finance.projectReportArchive.service.dto.ReportDTO">
@@ -354,6 +358,22 @@
         from cw_project_report_archive cw_pa
         from cw_project_report_archive cw_pa
         where cw_pa.del_flag = '0' and cw_pa.report_id = #{reportId}
         where cw_pa.del_flag = '0' and cw_pa.report_id = #{reportId}
     </select>
     </select>
+    <select id="findDtos" resultType="com.jeeplus.finance.projectReportArchive.service.dto.WorkAttachmentArchiveDto">
+        SELECT
+			wa.id,
+			wa.url,
+			wa.attachment_name AS `name`,
+			wa.create_by_id AS `by`,
+			wa.create_time,
+			cw_paf.file_type,
+            cw_paf.remarks as remarks
+		FROM
+			work_attachment wa
+			left join cw_project_report_archive_file cw_paf on cw_paf.work_attachment_id = wa.id and cw_paf.del_flag = '0'
+		WHERE
+			wa.del_flag = 0
+			AND wa.attachment_id = #{id}
+    </select>
 
 
     <update id="updateInfoById">
     <update id="updateInfoById">
         update
         update
@@ -411,4 +431,7 @@
         update_time = #{updateTime}
         update_time = #{updateTime}
         where id = #{id} ;
         where id = #{id} ;
     </update>
     </update>
+    <update id="updateBorrowTypeById">
+        UPDATE cw_project_report_archive SET `borrow_type` = #{status} WHERE del_flag = 0 AND id = #{id}
+    </update>
 </mapper>
 </mapper>

+ 77 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/xml/CwProjectReportBorrowMapper.xml

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.projectReportArchive.mapper.CwProjectReportBorrowMapper">
+
+    <update id="updateStatusById">
+        UPDATE cw_project_report_borrow SET borrow_type = #{borrowType} WHERE del_flag = 0 AND id = #{id}
+    </update>
+    <update id="updateStatusByContractInfoId">
+        UPDATE cw_project_report_borrow SET borrow_type = #{borrowType} WHERE del_flag = 0 AND archive_id = #{id}
+    </update>
+    <update id="updateMessageByBorrowId">
+        UPDATE cw_project_report_borrow_message SET borrow_type = #{borrowType}
+        <if test="type != null and type != ''">
+            ,ret_data = NOW()
+        </if>
+        WHERE del_flag = 0 AND project_report_borrow_id = #{id} order by create_time desc limit 1
+    </update>
+    <update id="deleteMessageById">
+        UPDATE cw_project_report_borrow_message SET del_flag = 1
+		WHERE del_flag = 0 AND project_report_borrow_id = #{id} order by create_time desc limit 1
+    </update>
+    <select id="selectFileByContractInfoId"
+            resultType="com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrow">
+        SELECT * FROM `cw_project_report_borrow` WHERE del_flag = 0 AND archive_id = #{id}
+    </select>
+    <select id="findMessageList"
+            resultType="com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrowMessage">
+        SELECT
+			id,
+			create_by_id,
+			create_time,
+			update_by_id,
+			update_time,
+			del_flag,
+			project_report_borrow_id,
+			project_name,
+			borrow_name,
+			DATE_FORMAT(borrow_data,'%Y-%m-%d') as borrow_data,
+			DATE_FORMAT(borrow_ret_data,'%Y-%m-%d') as borrow_ret_data,
+			borrow_type,
+			DATE_FORMAT( ret_data, '%Y-%m-%d' ) AS ret_data
+		 FROM cw_project_report_borrow_message WHERE del_flag = 0 AND project_report_borrow_id = #{id}
+		 order by create_time desc
+    </select>
+    <select id="selectByInfoId"
+            resultType="com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrow">
+        select * from cw_project_report_borrow where archive_id = #{id}
+    </select>
+
+
+    <select id="getAdventMessageList" resultType="com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrowMessage">
+        SELECT
+			a.id,
+			a.create_by_id,
+			wci.create_by_id as "contractCreateById",
+			wcb.archive_id as "contractId",
+			wcb.proc_ins_id as "procInsId",
+			wcb.process_definition_id as "processDefinitionId",
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
+			a.del_flag,
+			a.project_report_borrow_id,
+			a.contract_name,
+			a.borrow_name,
+			DATE_FORMAT(a.borrow_data,'%Y-%m-%d') as borrow_data,
+			DATE_FORMAT(a.borrow_ret_data,'%Y-%m-%d') as borrow_ret_data,
+			a.borrow_type,
+			DATE_FORMAT( a.ret_data, '%Y-%m-%d' ) AS ret_data
+		 FROM cw_project_report_borrow_message a
+		 left join cw_project_report_borrow wcb on wcb.id = a.project_report_borrow_id
+		 left join cw_project_report_archive wci on wci.id = wcb.archive_id
+		 WHERE a.del_flag = 0 and a.ret_data is null
+			and now() > date_add(a.borrow_ret_data,interval #{adventDay} day)
+		 order by a.create_time desc
+    </select>
+</mapper>

+ 16 - 2
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/CwProjectReportArchiveService.java

@@ -25,6 +25,7 @@ import com.jeeplus.finance.projectReportArchive.mapper.CwProjectReportArchiveMap
 import com.jeeplus.finance.projectReportArchive.mapper.CwProjectReportArchiveReportMapper;
 import com.jeeplus.finance.projectReportArchive.mapper.CwProjectReportArchiveReportMapper;
 import com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
 import com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
 import com.jeeplus.finance.projectReportArchive.service.dto.ReportDTO;
 import com.jeeplus.finance.projectReportArchive.service.dto.ReportDTO;
+import com.jeeplus.finance.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
 import com.jeeplus.finance.projectReportArchive.service.mapstruct.CwProjectReportArchiveWrapper;
 import com.jeeplus.finance.projectReportArchive.service.mapstruct.CwProjectReportArchiveWrapper;
 import com.jeeplus.flowable.feign.IFlowableApi;
 import com.jeeplus.flowable.feign.IFlowableApi;
 //import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
 //import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
@@ -335,7 +336,20 @@ public class CwProjectReportArchiveService extends ServiceImpl<CwProjectReportAr
      * @return
      * @return
      */
      */
     public CwProjectReportArchiveDTO queryById(String id) {
     public CwProjectReportArchiveDTO queryById(String id) {
-        return cwProjectReportArchiveMapper.queryById(id);
+        CwProjectReportArchiveDTO d = cwProjectReportArchiveMapper.queryById(id);
+        if (null != d){
+            List<WorkAttachmentArchiveDto> fileList = Lists.newArrayList();
+            // 查询附件信息
+            List<WorkAttachmentArchiveDto> dtos = cwProjectReportArchiveMapper.findDtos(id);
+            if (CollectionUtils.isNotEmpty(dtos)) {
+                for (WorkAttachmentArchiveDto i : dtos) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+            }
+            fileList.addAll(dtos);
+            d.setWorkAttachmentDtoList(fileList);
+        }
+        return d;
     }
     }
 
 
     /**
     /**
@@ -362,7 +376,7 @@ public class CwProjectReportArchiveService extends ServiceImpl<CwProjectReportAr
         }else{  //新增
         }else{  //新增
             cwProjectReportArchiveMapper.insert(cwProjectReportArchive);
             cwProjectReportArchiveMapper.insert(cwProjectReportArchive);
         }
         }
-        //this.saveOrUpdate(cwProjectReportArchive);
+//        this.saveOrUpdate(cwProjectReportArchive);
         if (ObjectUtil.isNotEmpty(cwProjectReportArchiveDTO)) {
         if (ObjectUtil.isNotEmpty(cwProjectReportArchiveDTO)) {
             // 附件
             // 附件
 //            ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda().eq(WorkAttachment::getAttachmentId, cwProjectReportArchive.getId()));
 //            ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda().eq(WorkAttachment::getAttachmentId, cwProjectReportArchive.getId()));

+ 274 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/CwProjectReportBorrowService.java

@@ -0,0 +1,274 @@
+package com.jeeplus.finance.projectReportArchive.service;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.google.common.collect.Lists;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrow;
+import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportBorrowMessage;
+import com.jeeplus.finance.projectReportArchive.mapper.CwProjectReportArchiveMapper;
+import com.jeeplus.finance.projectReportArchive.mapper.CwProjectReportBorrowMapper;
+import com.jeeplus.finance.projectReportArchive.mapper.CwProjectReportBorrowMessageMapper;
+import com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
+import com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportBorrowDto;
+import com.jeeplus.finance.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
+import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.sys.feign.IDictApi;
+import com.jeeplus.sys.feign.ITenantApi;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:51
+ **/
+@Service
+public class CwProjectReportBorrowService {
+
+    @Resource
+    private CwProjectReportArchiveMapper cwProjectReportArchiveMapper;
+
+    @Resource
+    private CwProjectReportBorrowMapper borrowMapper;
+
+    @Resource
+    private CwProjectReportBorrowMessageMapper messageMapper;
+
+    @Resource
+    private CwProjectReportArchiveMapper infoMapper;
+
+    @Resource
+    private IFlowableApi flowTaskService;
+
+    public String saveInfo(CwProjectReportBorrowDto workContractBorrowDto) throws Exception {
+        if (StringUtils.isNotEmpty(workContractBorrowDto.getId())) {
+            CwProjectReportBorrow info = borrowMapper.selectById( workContractBorrowDto.getId());
+            if (info != null) {
+                infoMapper.updateBorrowTypeById(info.getArchiveId(),workContractBorrowDto.getBorrowType());
+                return update(workContractBorrowDto, info.getArchiveId());
+            }
+        }
+        return add(workContractBorrowDto);
+    }
+
+    /**
+     * 报告借用新增
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String add(CwProjectReportBorrowDto workContractBorrowDto) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        String id = UUID.randomUUID().toString().replace("-", "");
+        CwProjectReportBorrow borrow = new CwProjectReportBorrow();
+        BeanUtils.copyProperties(workContractBorrowDto, borrow);
+        borrow.setId(id);
+        borrow.setArchiveId(workContractBorrowDto.getId());
+        borrow.setCreateById(userDTO.getId());
+        borrow.setCreateTime(new Date());
+        borrow.setUpdateById(userDTO.getId());
+        borrow.setUpdateTime(new Date());
+        borrowMapper.insert(borrow);
+        //借用记录信息
+        this.saveMessage(workContractBorrowDto, id);
+        return id;
+    }
+
+    /**
+     * 合同登记修改
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String update(CwProjectReportBorrowDto workContractBorrowDto, String id) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        CwProjectReportBorrow borrow = new CwProjectReportBorrow();
+        BeanUtils.copyProperties(workContractBorrowDto, borrow);
+        borrow.setArchiveId(id);
+        borrow.setUpdateById(userDTO.getId());
+        borrow.setUpdateTime(new Date());
+        borrowMapper.updateById(borrow);
+        //借用记录信息
+        this.saveMessage(workContractBorrowDto, workContractBorrowDto.getId());
+        return borrow.getId();
+    }
+    /**
+     * 根据id修改status
+     */
+    public void updateStatusById(CwProjectReportBorrowDto workContractBorrowDto) {
+        borrowMapper.updateStatusById(workContractBorrowDto.getId(), workContractBorrowDto.getBorrowType());
+    }
+
+    public void updateStatusByContractInfoId(CwProjectReportBorrowDto workContractBorrowDto) {
+        infoMapper.updateBorrowTypeById(workContractBorrowDto.getId(),workContractBorrowDto.getBorrowType());
+        borrowMapper.updateStatusByContractInfoId(workContractBorrowDto.getId(), workContractBorrowDto.getBorrowType());
+    }
+
+    public CwProjectReportBorrow findById(String id) {
+        CwProjectReportBorrow borrow = borrowMapper.selectById(id);
+        if (borrow == null) {
+            LambdaQueryWrapper<CwProjectReportBorrow> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(CwProjectReportBorrow::getArchiveId, id);
+            borrow = borrowMapper.selectOne(wrapper);
+        }
+        if (null != borrow){
+            List<WorkAttachmentArchiveDto> fileList = Lists.newArrayList();
+            // 查询附件信息
+            List<WorkAttachmentArchiveDto> dtos = cwProjectReportArchiveMapper.findDtos(borrow.getArchiveId());
+            if (CollectionUtils.isNotEmpty(dtos)) {
+                for (WorkAttachmentArchiveDto i : dtos) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+            }
+            fileList.addAll(dtos);
+            borrow.setWorkAttachmentDtoList(fileList);
+        }
+        return borrow;
+    }
+
+    public CwProjectReportBorrow findByContractInfoId(String id) {
+        return borrowMapper.selectFileByContractInfoId(id);
+    }
+
+    /**
+     * 借用记录保存
+     * @param workContractBorrowDto
+     * @param id
+     * @return
+     */
+    public void saveMessage (CwProjectReportBorrowDto workContractBorrowDto, String id) {
+        //保存借用信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        CwProjectReportBorrowMessage message = new CwProjectReportBorrowMessage();
+        BeanUtils.copyProperties(workContractBorrowDto, message);
+        String messageId = UUID.randomUUID().toString().replace("-", "");
+        message.setId(messageId);
+        message.setCreateById(userDTO.getId());
+        message.setCreateTime(new Date());
+        message.setUpdateById(userDTO.getId());
+        message.setUpdateTime(new Date());
+        message.setProjectReportBorrowId(id);
+        message.setBorrowType(workContractBorrowDto.getBorrowType());
+        messageMapper.insert(message);
+    }
+
+    /**
+     * 根据contractBorrowId修改borrowType
+     */
+    public void updateMessageByBorrowId(CwProjectReportBorrowDto workContractBorrowDto, String type) {
+        if ("reture".equals(type)) {
+            CwProjectReportBorrow borrow = borrowMapper.selectFileByContractInfoId(workContractBorrowDto.getId());
+            if (borrow != null) {
+                borrowMapper.updateMessageByBorrowId(borrow.getId(), workContractBorrowDto.getBorrowType(), type);
+            }
+        } else {
+            borrowMapper.updateMessageByBorrowId(workContractBorrowDto.getId(), workContractBorrowDto.getBorrowType(), null);
+        }
+    }
+
+    public void deleteById(String id) {
+        LambdaQueryWrapper<CwProjectReportBorrow> wrapper = new LambdaQueryWrapper<CwProjectReportBorrow>();
+        wrapper.eq(CwProjectReportBorrow::getArchiveId, id);
+        CwProjectReportBorrow borrow = borrowMapper.selectOne(wrapper);
+        if (borrow != null) {
+            borrowMapper.deleteMessageById(borrow.getId());
+        }
+    }
+
+    public List<CwProjectReportBorrowMessage> findMessageList(String id) {
+        CwProjectReportBorrow borrow = findByContractInfoId(id);
+        if (borrow != null) {
+            return borrowMapper.findMessageList(borrow.getId());
+        }
+        return null;
+    }
+
+    /**
+     * 查询临期合同借用信息
+     * @return
+     */
+    public List<CwProjectReportBorrowMessage> getAdventMessageList() {
+        String adventDay = SpringUtil.getBean ( IDictApi.class ).getDictLabel("advent_day", "cw_borrow_advent", "");
+//        String adventDay = DictUtils.getDictLabel("advent_day", "cw_borrow_advent", "");
+        adventDay = "-" + adventDay;
+        List<CwProjectReportBorrowMessage> adventMessageList = borrowMapper.getAdventMessageList(adventDay);
+        if(null != adventMessageList && adventMessageList.size()>0){
+            for (CwProjectReportBorrowMessage info : adventMessageList) {
+                String taskName = null;
+                String titleStr = null;
+
+                //如果当前时间大于过期时间
+                //Date类的一个方法,如果info.getAdventDateDate()早于 new Date() 返回true,否则返回false
+                if(info.getBorrowRetData().before(new Date())){
+                    taskName = "合同【"+ info.getProjectName()+"】借用已超期";
+                    titleStr = "合同【"+ info.getProjectName()+"】借用已超期。超期时间:"+dateToString(info.getBorrowRetData()) +"。";
+                }else{
+                    taskName = "合同【"+ info.getProjectName()+"】即将借用超期";
+                    titleStr = "合同【"+ info.getProjectName()+"】即将借用超期。超期时间:"+dateToString(info.getBorrowRetData());
+                }
+
+
+                //计算两日期之间的天数
+                Integer interval = Integer.valueOf(this.getInterval(info.getBorrowRetData(), new Date()));
+                if(interval > 0){
+                    titleStr = titleStr + "已超期:" + interval + "天。请尽快归还";
+                }
+
+                Set<String> noticeUserSet = new HashSet<String>();
+                if(StringUtils.isNotBlank(info.getBorrowName())){
+                    String tenantId = SpringUtil.getBean ( ITenantApi.class ).getCurrentTenantId ( );
+                    UserDTO borrowUser = SpringUtil.getBean ( IUserApi.class ).getByLoginName(info.getBorrowName(),tenantId);
+                    if(null != borrowUser && StringUtils.isNotBlank(borrowUser.getId())){
+                        noticeUserSet.add(borrowUser.getId());
+                    }
+                }
+                if(StringUtils.isNotBlank(info.getContractCreateById())){
+                    noticeUserSet.add(info.getContractCreateById());
+                }
+            }
+        }
+        return null;
+    }
+
+
+    /**
+     * 计算两日期相差天数
+     * @param beginDate
+     * @param endDate
+     * @return
+     * @throws Exception
+     */
+    public String getInterval(Date beginDate, Date endDate){
+        long day = 0;
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        try {
+            if(beginDate != null){
+                String begin = sdf.format(beginDate);
+                beginDate  = sdf.parse(begin);
+            }
+            if(endDate!= null){
+                String end= sdf.format(endDate);
+                endDate= sdf.parse(end);
+            }
+        } catch (Exception e){
+            e.getMessage();
+        }
+        day = (endDate.getTime()-beginDate.getTime())/(24*60*60*1000);
+        return String.valueOf(day);
+    }
+    public static String dateToString(Date date) {
+        SimpleDateFormat sformat = new SimpleDateFormat("yyyy-MM-dd");//日期格式
+
+        String s = sformat.format(date);
+
+        return s;
+    }
+
+}

+ 53 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/dto/CwProjectReportArchiveDTO.java

@@ -1,6 +1,7 @@
 package com.jeeplus.finance.projectReportArchive.service.dto;
 package com.jeeplus.finance.projectReportArchive.service.dto;
 
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.jeeplus.core.service.dto.BaseDTO;
 import com.jeeplus.core.service.dto.BaseDTO;
 import com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO;
 import lombok.Data;
 import lombok.Data;
@@ -14,6 +15,26 @@ import java.util.List;
 
 
 public class CwProjectReportArchiveDTO extends BaseDTO {
 public class CwProjectReportArchiveDTO extends BaseDTO {
 
 
+    @TableField(exist = false)
+    private String taskBorrowId;
+
+    /**
+     * 借用状态
+     */
+    private String borrowType;
+
+    /**
+     * 借用人id
+     */
+    @TableField(exist = false)
+    private String borrowUserId;
+
+    /**
+     * 借用流程id
+     */
+    @TableField(exist = false)
+    private String procInsId2;
+
     public static final String BIZ_CODE = "15";
     public static final String BIZ_CODE = "15";
 
 
     /**
     /**
@@ -227,6 +248,38 @@ public class CwProjectReportArchiveDTO extends BaseDTO {
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
+    public String getTaskBorrowId() {
+        return taskBorrowId;
+    }
+
+    public void setTaskBorrowId(String taskBorrowId) {
+        this.taskBorrowId = taskBorrowId;
+    }
+
+    public String getProcInsId2() {
+        return procInsId2;
+    }
+
+    public void setProcInsId2(String procInsId2) {
+        this.procInsId2 = procInsId2;
+    }
+
+    public String getBorrowType() {
+        return borrowType;
+    }
+
+    public void setBorrowType(String borrowType) {
+        this.borrowType = borrowType;
+    }
+
+    public String getBorrowUserId() {
+        return borrowUserId;
+    }
+
+    public void setBorrowUserId(String borrowUserId) {
+        this.borrowUserId = borrowUserId;
+    }
+
     public String getRemarks() {
     public String getRemarks() {
         return remarks;
         return remarks;
     }
     }

+ 48 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/dto/CwProjectReportBorrowDto.java

@@ -0,0 +1,48 @@
+package com.jeeplus.finance.projectReportArchive.service.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 14:00
+ **/
+@Data
+public class CwProjectReportBorrowDto extends BaseDTO {
+
+    private String reportId;
+
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    private String projectName;
+
+    private String reportNo;
+
+    private String clientName;
+
+    private String borrowName;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowData;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowRetData;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date createDate;
+
+    private String remarks;
+
+    private String borrowType;
+
+    private String type;
+
+}

+ 4 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/dto/WorkAttachmentArchiveDto.java

@@ -7,6 +7,10 @@ import lombok.Data;
 @Data
 @Data
 public class WorkAttachmentArchiveDto extends BaseDTO {
 public class WorkAttachmentArchiveDto extends BaseDTO {
 
 
+    private String cwRemarks;
+
+    private String by;
+
     private String name; // 文件名称
     private String name; // 文件名称
 
 
     private String size; // 文件大小
     private String size; // 文件大小

+ 1 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportCancellApplyArchived/service/ReportCancellApplyArchivedService.java

@@ -256,7 +256,7 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
             CwProjectReport report = reportMapper.getByNewLineId(byId.getReportId());
             CwProjectReport report = reportMapper.getByNewLineId(byId.getReportId());
             reportDTO.setReportNo(byId.getReportNo());
             reportDTO.setReportNo(byId.getReportNo());
             reportDTO.setReportDate(byId.getReportDate());
             reportDTO.setReportDate(byId.getReportDate());
-            reportDTO.setReportCreateName(byId.getCreateById());
+            reportDTO.setReportCreateName(byId.getReportCreateName());
             reportDTO.setSignatureAnnotator1Name(report.getSignatureAnnotator1Name());
             reportDTO.setSignatureAnnotator1Name(report.getSignatureAnnotator1Name());
             reportDTO.setSignatureAnnotator2Name(report.getSignatureAnnotator2Name());
             reportDTO.setSignatureAnnotator2Name(report.getSignatureAnnotator2Name());
         } else {
         } else {

+ 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.CwWorkClientBase;
 import com.jeeplus.finance.workClientInfo.domain.CwWorkClientTemp;
 import com.jeeplus.finance.workClientInfo.domain.CwWorkClientTemp;
 import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBaseDTO;
 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.CwWorkClientContactDTO;
 import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientTempDTO;
 import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientTempDTO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
@@ -55,6 +56,8 @@ public interface CwWorkClientBaseMapper extends BaseMapper<CwWorkClientBase> {
     List<String> getNoByIdArray(@Param("idArray") String[] idArray);
     List<String> getNoByIdArray(@Param("idArray") String[] idArray);
 
 
     public IPage<CwWorkClientBaseDTO> getInfoList(Page<CwWorkClientBaseDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwWorkClientBase> queryWrapper);
     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>
         </foreach>
     </select>
     </select>
 
 
-    <select id="getInfoList" resultMap="BaseResultMap">
+    <select id="getInfoList" resultType="com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBaseDTO">
         select
         select
         <include refid="Base_Column_List"></include>,
         <include refid="Base_Column_List"></include>,
         su.name as user_name,
         su.name as user_name,
@@ -395,6 +395,7 @@
         cw_mlt.name as manage_level_type_name,
         cw_mlt.name as manage_level_type_name,
         cw_ot.name as organization_type_name,
         cw_ot.name as organization_type_name,
         su1.name as update_user_name,
         su1.name as update_user_name,
+        cw_wct.client_id AS client_id,
         art.ID_ as task_id
         art.ID_ as task_id
         from cw_work_client_base cw_wcb
         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'
         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();
         long l2 = System.currentTimeMillis();
         System.out.println("查询客户信息列表treeService1:" + (l2-l1));
         System.out.println("查询客户信息列表treeService1:" + (l2-l1));
         IPage<CwWorkClientBaseDTO> list = cwWorkClientBaseMapper.getInfoList(page, queryWrapper);
         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();
         long l3 = System.currentTimeMillis();
         System.out.println("查询客户信息列表treeService2:" + (l3-l2));
         System.out.println("查询客户信息列表treeService2:" + (l3-l2));
         return list;
         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";
     public static final String BIZ_CODE = "11";
 
 
     /**
     /**
+     * 客户分类表id
+     */
+    private String clientId;
+
+    /**
      * 备注信息
      * 备注信息
      */
      */
     private String remarks;
     private String remarks;

+ 3 - 11
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableProcessController.java

@@ -46,20 +46,12 @@ public class FlowableProcessController {
      * 流程定义列表
      * 流程定义列表
      */
      */
     @GetMapping("list")
     @GetMapping("list")
-    public ResponseEntity processListData(Page <Map> page, String id) {
+    public ResponseEntity processListData(Page <Map> page, String category) {
         /*
         /*
          * 保存两个对象,一个是ProcessDefinition(流程定义),一个是Deployment(流程部署)
          * 保存两个对象,一个是ProcessDefinition(流程定义),一个是Deployment(流程部署)
          */
          */
-        page = flowProcessService.processList ( page, id );
-
-        List<Map> records = page.getRecords();
-        Map resultMap = new HashMap();
-        for (Map map : records) {
-            if(id.equals(map.get("id"))){
-                resultMap = map;
-            }
-        }
-        return ResponseEntity.ok ( resultMap );
+        page = flowProcessService.processList ( page, category );
+        return ResponseEntity.ok ( page );
     }
     }
 
 
     @GetMapping("exist")
     @GetMapping("exist")

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

@@ -1,6 +1,7 @@
 package com.jeeplus.flowable.controller;
 package com.jeeplus.flowable.controller;
 
 
 import cn.hutool.extra.spring.SpringUtil;
 import cn.hutool.extra.spring.SpringUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.common.TokenProvider;
@@ -29,8 +30,8 @@ public class MyNoticeController {
 
 
     @GetMapping("/list")
     @GetMapping("/list")
     @ApiOperation(value = "待办列表")
     @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);
         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
      * @return
      */
      */
     @InterceptorIgnore(tenantLine = "true")
     @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);
     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
      * @param wrapper
      * @return
      * @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
 			and a.type = 0
 		</where>
 		</where>
 	</select>
 	</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 id="insertMyNotice">
 		insert into my_notice_list (
 		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 cn.hutool.extra.spring.SpringUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 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.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.common.TokenProvider;
@@ -64,6 +65,38 @@ public class MyNoticeService {
         return listPage;
         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{
     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();
         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
      * @param page
      * @return
      * @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("用户数据列表")
     @ApiLog("用户数据列表")
     @ApiOperation(value = "用户数据列表")
     @ApiOperation(value = "用户数据列表")
     //@PreAuthorize("hasAuthority('sys:user:list')")
     //@PreAuthorize("hasAuthority('sys:user:list')")
@@ -205,7 +284,7 @@ public class UserController {
                 queryWrapper.eq("sc.type",userDTO.getCertType());
                 queryWrapper.eq("sc.type",userDTO.getCertType());
             }
             }
             if ( userDTO.getTenantDTO ( ) != null && StrUtil.isNotBlank ( userDTO.getTenantDTO ( ).getId ( ) ) ) {
             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 );
         IPage <UserDTO> result = userService.findPage ( page, queryWrapper );
@@ -225,6 +304,22 @@ public class UserController {
         return ResponseEntity.ok ( result );
         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
      * @return
      */
      */
     @InterceptorIgnore(tenantLine = "true")
     @InterceptorIgnore(tenantLine = "true")
-    List<Office> getChildren(@Param("rootId")String rootId);
+    List<Office> getChildren(@Param("rootId")String rootId,@Param("companyId")String companyId);
 
 
     /**
     /**
      * 获取到所有parent_id为‘0’的评估部门数据
      * 获取到所有parent_id为‘0’的评估部门数据

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

@@ -191,6 +191,9 @@
         WHERE
         WHERE
             del_flag = 0
             del_flag = 0
             and parent_id = #{rootId}
             and parent_id = #{rootId}
+        <if test="companyId != null and companyId != ''">
+            and id = #{companyId}
+        </if>
     </select>
     </select>
     <select id="getAccessChildren" resultType="com.jeeplus.sys.domain.Office">
     <select id="getAccessChildren" resultType="com.jeeplus.sys.domain.Office">
         SELECT
         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.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Maps;
+import com.jeeplus.common.SecurityUtils;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.common.constant.CommonConstants;
 import com.jeeplus.common.constant.CommonConstants;
 import com.jeeplus.common.constant.enums.OfficeTypeEnum;
 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.service.mapstruct.OfficeWrapper;
 import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.sys.utils.UserUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 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) {
     public List <OfficeDTO> getRootTree(List<OfficeDTO> list, String extId, String type, String showAll, String showMyOffice) {
         List<OfficeDTO> offices = Lists.newArrayList ();
         List<OfficeDTO> offices = Lists.newArrayList ();
         // 获取到所有parent_id为‘0’的部门数据
         // 获取到所有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<Office> children = super.getChildren(new Office(OfficeDTO.getRootId()));
         List<OfficeDTO> rootTrees = OfficeWrapper.INSTANCE.toDTO (children);
         List<OfficeDTO> rootTrees = OfficeWrapper.INSTANCE.toDTO (children);
         for (OfficeDTO root : rootTrees) {
         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.collection.CollectionUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 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.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 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.CacheNames;
 import com.jeeplus.common.constant.CommonConstants;
 import com.jeeplus.common.constant.CommonConstants;
 import com.jeeplus.common.redis.RedisUtils;
 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.Office;
 import com.jeeplus.sys.domain.SysConfig;
 import com.jeeplus.sys.domain.SysConfig;
 import com.jeeplus.sys.domain.User;
 import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.mapper.OfficeMapper;
 import com.jeeplus.sys.mapper.OfficeMapper;
 import com.jeeplus.sys.mapper.UserMapper;
 import com.jeeplus.sys.mapper.UserMapper;
 import com.jeeplus.sys.service.dto.CertDTO;
 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 );
+
+
+    }
+
 
 
     /**
     /**
      * 自定义分页检索
      * 自定义分页检索