浏览代码

评估模块调整

lizhenhao 2 年之前
父节点
当前提交
297fbc241c
共有 40 个文件被更改,包括 1465 次插入268 次删除
  1. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceBaseMapper.xml
  2. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceDetailMapper.xml
  3. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceInvalidMapper.xml
  4. 26 26
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceMapper.xml
  5. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceReceivablesMapper.xml
  6. 3 3
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/service/FinanceInvoiceService.java
  7. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/fileDict/mapper/xml/ProgramFileDictMapper.xml
  8. 12 12
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectDict/mapper/xml/ProjectDictMapper.xml
  9. 8 41
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/domain/ProgramProjectListInfo.java
  10. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramArchiveMapper.xml
  11. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramAuditAssessPeopleMapper.xml
  12. 10 10
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramAuditMapper.xml
  13. 2 2
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramMembersMapper.xml
  14. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramReportNoMapper.xml
  15. 47 43
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProjectListMapper.xml
  16. 18 15
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/service/ProjectListService.java
  17. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/typeDict/mapper/xml/ProgramTypeDictMapper.xml
  18. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/serviceType/mapper/xml/ProgramServiceTypeMapper.xml
  19. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadDetailMapper.xml
  20. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadInfoMapper.xml
  21. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadIssuedMapper.xml
  22. 6 6
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoContractMapper.xml
  23. 6 6
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoOtherMapper.xml
  24. 6 6
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoProcuredMapper.xml
  25. 20 20
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementInfoMapper.xml
  26. 2 2
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java
  27. 7 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/controller/ReimbursementTypeController.java
  28. 8 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/mapper/ReimbursementTypeMapper.java
  29. 5 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/mapper/xml/ReimbursementTypeMapper.xml
  30. 10 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/service/ReimbursementTypeForTreeDataService.java
  31. 4 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/workContract/controller/WorkContractController.java
  32. 39 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java
  33. 153 0
      jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/controller/CwReimbursementTypeController.java
  34. 64 0
      jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/domain/CwReimbursementTypeInfo.java
  35. 15 0
      jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/domain/OfficeDomain.java
  36. 92 0
      jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/mapper/CwReimbursementTypeMapper.java
  37. 282 0
      jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/mapper/xml/CwReimbursementTypeMapper.xml
  38. 178 0
      jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/service/CwReimbursementTypeForTreeDataService.java
  39. 345 0
      jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/service/CwReimbursementTypeService.java
  40. 21 0
      jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/service/dto/CwReimbursementTypeDto.java

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceBaseMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceBaseDTO">
             <id property="id" column="id" jdbcType="VARCHAR"/>
-            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
-            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
             <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
             <result property="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
             <result property="programName" column="program_name" jdbcType="VARCHAR"/>
@@ -24,10 +24,10 @@
 
     <sql id="Base_Column_List">
         fib.id,
-        fib.create_by,
-        fib.create_date,
-        fib.update_by,
-        fib.update_date,
+        fib.create_by_id,
+        fib.create_time,
+        fib.update_by_id,
+        fib.update_time,
         fib.del_flag,
         fib.invoice_id,
         fib.program_name,

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceDetailMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceDetailDTO">
             <id property="id" column="id" jdbcType="VARCHAR"/>
-            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
-            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
             <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
             <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
             <result property="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
@@ -24,10 +24,10 @@
 
     <sql id="Base_Column_List">
         fid.id,
-        fid.create_by,
-        fid.create_date,
-        fid.update_by,
-        fid.update_date,
+        fid.create_by_id,
+        fid.create_time,
+        fid.update_by_id,
+        fid.update_time,
         fid.del_flag,
         fid.remarks,
         fid.invoice_id,

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceInvalidMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceInvalidDTO">
             <id property="id" column="id" jdbcType="VARCHAR"/>
-            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
-            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
             <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
             <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
             <result property="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
@@ -20,10 +20,10 @@
 
     <sql id="Base_Column_List">
         fii.id,
-        fii.create_by,
-        fii.create_date,
-        fii.update_by,
-        fii.update_date,
+        fii.create_by_id,
+        fii.create_time,
+        fii.update_by_id,
+        fii.update_time,
         fii.del_flag,
         fii.remarks,
         fii.invoice_id,

+ 26 - 26
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceDTO">
             <id property="id" column="id" jdbcType="VARCHAR"/>
-            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
-            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
             <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
             <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
             <result property="type" column="type" jdbcType="VARCHAR"/>
@@ -53,10 +53,10 @@
 
     <sql id="FIR_Column_List">
         fir.id,
-        fir.create_by,
-        fir.create_date,
-        fir.update_by,
-        fir.update_date,
+        fir.create_by_id,
+        fir.create_time,
+        fir.update_by_id,
+        fir.update_time,
         fir.del_flag,
         fir.remarks,
         fir.invoice_id,
@@ -68,10 +68,10 @@
 
     <sql id="FII_Column_List">
         fii.id,
-        fii.create_by,
-        fii.create_date,
-        fii.update_by,
-        fii.update_date,
+        fii.create_by_id,
+        fii.create_time,
+        fii.update_by_id,
+        fii.update_time,
         fii.del_flag,
         fii.remarks,
         fii.invoice_id,
@@ -82,10 +82,10 @@
 
     <sql id="FID_Column_List">
         fid.id,
-        fid.create_by,
-        fid.create_date,
-        fid.update_by,
-        fid.update_date,
+        fid.create_by_id,
+        fid.create_time,
+        fid.update_by_id,
+        fid.update_time,
         fid.del_flag,
         fid.remarks,
         fid.invoice_id,
@@ -100,10 +100,10 @@
 
     <sql id="FIB_Column_List">
         fib.id,
-        fib.create_by,
-        fib.create_date,
-        fib.update_by,
-        fib.update_date,
+        fib.create_by_id,
+        fib.create_time,
+        fib.update_by_id,
+        fib.update_time,
         fib.del_flag,
         fib.invoice_id,
         fib.program_name,
@@ -118,10 +118,10 @@
 
     <sql id="Base_Column_List">
         fi.id,
-        fi.create_by,
-        fi.create_date,
-        fi.update_by,
-        fi.update_date,
+        fi.create_by_id,
+        fi.create_time,
+        fi.update_by_id,
+        fi.update_time,
         fi.del_flag,
         fi.remarks,
         fi.type,
@@ -211,8 +211,8 @@
         art_invalid.ID_ as task_id_invalid
         from finance_invoice fi
         left join finance_invoice_detail cfid on cfid.invoice_id = fi.id and cfid.del_flag = '0'
-        left join sys_user su on fi.create_by = su.id and su.del_flag = '0'
-        left join sys_user_manage_office sumo on sumo.office_id = su.office_id
+        left join sys_user su on fi.create_by_id = su.id and su.del_flag = '0'
+--         left join sys_user_manage_office sumo on sumo.office_id = su.office_id
         left join sys_office so on su.office_id = so.id and so.del_flag = '0'
         left join act_ru_task art on fi.proc_ins_id = art.PROC_INST_ID_
         left join finance_invoice_invalid invalid on invalid.invoice_id = fi.id and invalid.del_flag = '0'

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceReceivablesMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceReceivablesDTO">
             <id property="id" column="id" jdbcType="VARCHAR"/>
-            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
-            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
             <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
             <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
             <result property="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
@@ -21,10 +21,10 @@
 
     <sql id="Base_Column_List">
         fir.id,
-        fir.create_by,
-        fir.create_date,
-        fir.update_by,
-        fir.update_date,
+        fir.create_by_id,
+        fir.create_time,
+        fir.update_by_id,
+        fir.update_time,
         fir.del_flag,
         fir.remarks,
         fir.invoice_id,

+ 3 - 3
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/service/FinanceInvoiceService.java

@@ -82,7 +82,7 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
     public IPage<FinanceInvoiceDTO> findList(Page<FinanceInvoiceDTO> page, FinanceInvoiceDTO financeInvoiceDTO) throws Exception{
         QueryWrapper<FinanceInvoice> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( FinanceInvoiceWrapper.INSTANCE.toEntity(financeInvoiceDTO), FinanceInvoice.class );
         queryWrapper.eq("fi.del_flag","0");
-        queryWrapper.orderByDesc("fi.create_date");
+        queryWrapper.orderByDesc("fi.create_time");
         ArrayList<String> searchIdList = new ArrayList<>();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         AtomicInteger checkNum = new AtomicInteger();
@@ -238,7 +238,7 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
                 }
             }
             if (StringUtils.isNotBlank(financeInvoiceDTO.getOperator())){
-                queryWrapper.like("su.name",financeInvoiceDTO.getOperator());
+                queryWrapper.eq("su.id",financeInvoiceDTO.getOperator());
             }
             if (StringUtils.isNotBlank(financeInvoiceDTO.getReconciliationPeopleName())) {
                 List<User> users = userService.list(new QueryWrapper<User>().lambda().like(User::getName, financeInvoiceDTO.getReconciliationPeopleName()));
@@ -254,7 +254,7 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
                 if (CollectionUtil.isNotEmpty(userList)) {
                     List<String> userIdList = userList.stream().distinct().map(User::getId).collect(Collectors.toList());
                     if (CollectionUtil.isNotEmpty(userIdList)) {
-                        queryWrapper.in("fi.create_by",userIdList);
+                        queryWrapper.in("fi.create_by_id",userIdList);
                     } else {
                         return new Page<FinanceInvoiceDTO>();
                     }

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/fileDict/mapper/xml/ProgramFileDictMapper.xml

@@ -21,10 +21,10 @@
 
     <sql id="Base_Column_List">
         pfd.id,
-        pfd.create_by,
-        pfd.create_date,
-        pfd.update_by,
-        pfd.update_date,
+        pfd.create_by_id,
+        pfd.create_time,
+        pfd.update_by_id,
+        pfd.update_time,
         pfd.del_flag,
         pfd.remarks,
         pfd.parent_id,

+ 12 - 12
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectDict/mapper/xml/ProjectDictMapper.xml

@@ -5,10 +5,10 @@
     <select id="parentList" resultType="com.jeeplus.assess.program.configuration.projectDict.domain.vo.FileDictVo">
         SELECT
             id AS file_id,
-            create_by,
-            create_by,
-            update_by,
-            update_date,
+            create_by_id,
+            create_time,
+            update_by_id,
+            update_time,
             del_flag,
             remarks,
             parent_id,
@@ -29,10 +29,10 @@
             a.id,
             a.required_stage,
             b.id AS file_id,
-            b.create_by,
-            b.create_by,
-            b.update_by,
-            b.update_date,
+            b.create_by_id,
+            b.create_time,
+            b.update_by_id,
+            b.update_time,
             b.del_flag,
             b.remarks,
             b.parent_id,
@@ -89,10 +89,10 @@
             a.id,
             a.required_stage,
             b.id AS file_id,
-            b.create_by,
-            b.create_by,
-            b.update_by,
-            b.update_date,
+            b.create_by_id,
+            b.create_time,
+            b.update_by_id,
+            b.update_time,
             b.del_flag,
             b.remarks,
             b.parent_id,

+ 8 - 41
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/domain/ProgramProjectListInfo.java

@@ -3,6 +3,7 @@ package com.jeeplus.assess.program.configuration.projectList.domain;
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
 import com.jeeplus.core.query.Query;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -13,47 +14,7 @@ import java.util.List;
 
 @Data
 @TableName(value = "program_project_list_info")
-public class ProgramProjectListInfo {
-
-    /**
-     * 实体主键
-     */
-    @TableId
-    private String id;
-
-    /**
-     * 创建日期
-     */
-    @TableField(fill = FieldFill.INSERT)
-    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
-    @Excel(name = "创建时间", width = 30, orderNum = "6")
-    private Date createDate;
-
-    /**
-     * 创建人
-     */
-    @Query(tableColumn = "a.create_by")
-    @TableField(fill = FieldFill.INSERT)
-    private String createBy;
-
-    /**
-     * 更新日期
-     */
-    @TableField(fill = FieldFill.INSERT_UPDATE)
-    private Date updateDate;
-
-    /**
-     * 更新人
-     */
-    @TableField(fill = FieldFill.INSERT_UPDATE)
-    private String updateBy;
-
-    /**
-     * 逻辑删除标记
-     */
-    @TableLogic
-    @TableField(fill = FieldFill.INSERT)
-    private Integer delFlag;
+public class ProgramProjectListInfo extends BaseEntity {
 
     private String contractId;
 
@@ -214,6 +175,12 @@ public class ProgramProjectListInfo {
     private String[] createDates;
 
     /**
+     * 创建人id
+     */
+    @TableField(exist = false)
+    private String createBy;
+
+    /**
      * 是否开票
      */
     @TableField(exist = false)

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramArchiveMapper.xml

@@ -49,10 +49,10 @@
 
     <sql id="Base_Column_List">
         pa.id,
-        pa.create_by,
-        pa.create_date,
-        pa.update_by,
-        pa.update_date,
+        pa.create_by_id,
+        pa.create_time,
+        pa.update_by_id,
+        pa.update_time,
         pa.del_flag,
         pa.remarks,
         pa.program_id,
@@ -91,10 +91,10 @@
     </sql>
     <sql id="Program_Column_List">
         ppli.id,
-        ppli.create_by,
-        ppli.create_date,
-        ppli.update_by,
-        ppli.update_date,
+        ppli.create_by_id,
+        ppli.create_time,
+        ppli.update_by_id,
+        ppli.update_time,
         ppli.del_flag,
         ppli.contract_id,
         ppli.contract_name,

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramAuditAssessPeopleMapper.xml

@@ -18,10 +18,10 @@
 
     <sql id="Base_Column_List">
         paap.id,
-        paap.create_by,
-        paap.create_date,
-        paap.update_by,
-        paap.update_date,
+        paap.create_by_id,
+        paap.create_time,
+        paap.update_by_id,
+        paap.update_time,
         paap.del_flag,
         paap.remarks,
         paap.audit_id,

+ 10 - 10
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramAuditMapper.xml

@@ -31,10 +31,10 @@
 
     <sql id="Base_Column_List">
         pa.id,
-        pa.create_by,
-        pa.create_date,
-        pa.update_by,
-        pa.update_date,
+        pa.create_by_id,
+        pa.create_time,
+        pa.update_by_id,
+        pa.update_time,
         pa.del_flag,
         pa.remarks,
         pa.program_id,
@@ -52,8 +52,8 @@
         pa.status
     </sql>
     <sql id="Program_Column_List">
-        id,create_by,create_date,
-        update_by,update_date,del_flag,
+        id,create_by_id,create_time,
+        update_by_id,update_time,del_flag,
         contract_id,contract_name,client,
         client_name,amount,contract_type,
         name,no,project_type,
@@ -74,10 +74,10 @@
     </sql>
     <sql id="Assess_Column_List">
         paap.id,
-        paap.create_by,
-        paap.create_date,
-        paap.update_by,
-        paap.update_date,
+        paap.create_by_id,
+        paap.create_time,
+        paap.update_by_id,
+        paap.update_time,
         paap.del_flag,
         paap.remarks,
         paap.audit_id,

+ 2 - 2
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramMembersMapper.xml

@@ -19,8 +19,8 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,create_by,create_date,
-        update_by,update_date,del_flag,
+        id,create_by_id,create_time,
+        update_by_id,update_time,del_flag,
         remarks,project_id,user_id,
         status,is_important
     </sql>

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramReportNoMapper.xml

@@ -18,10 +18,10 @@
 
     <sql id="Base_Column_List">
         prn.id,
-        prn.create_by,
-        prn.create_date,
-        prn.update_by,
-        prn.update_date,
+        prn.create_by_id,
+        prn.create_time,
+        prn.update_by_id,
+        prn.update_time,
         prn.del_flag,
         prn.remarks,
         prn.program_id,

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

@@ -5,9 +5,9 @@
    <select id="findContractPageList" resultType="com.jeeplus.assess.workContract.domain.WorkContractInfo">
        SELECT
            a.id,
-           a.create_date,
-           a.update_by,
-           a.update_date,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
            a.del_flag,
            a.client_id,
            a.client_name,
@@ -35,10 +35,10 @@
            a.status,
            a.filed_type,
            a.borrow_type,
-           b.NAME AS create_by
+           b.NAME AS create_by_id
         FROM
             work_contract_info a
-            LEFT JOIN sys_user b ON a.create_by = b.id
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
         WHERE
             a.del_flag = 0
             and a.status != 1
@@ -51,7 +51,7 @@
            <if test="dto.clientName != null and dto.clientName != ''">
                AND a.client_name LIKE CONCAT ('%', #{dto.clientName}, '%')
            </if>
-            ORDER BY a.create_by DESC
+            ORDER BY a.create_by_id DESC
    </select>
 
     <update id="updateStatusById">
@@ -62,10 +62,11 @@
         SELECT
         distinct
            a.id,
-           b.name AS create_by,
-           a.create_date,
-           a.update_by,
-           a.update_date,
+           b.name AS create_by_id,
+           a.create_by_id as create_by,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
            a.del_flag,
            a.contract_id,
            a.contract_name,
@@ -143,7 +144,7 @@
            art_archive.ID_ as task_id_archive
         FROM
             program_project_list_info a
-            LEFT JOIN sys_user b ON a.create_by = b.id
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
             LEFT JOIN sys_user c ON a.project_manager = c.id
             LEFT JOIN work_contract_info wci ON wci.id = a.contract_id and wci.del_flag = '0'
             LEFT JOIN program_report_no prn ON prn.program_id = a.id and prn.del_flag = '0'
@@ -160,16 +161,17 @@
             LEFT JOIN act_ru_task artd ON d.proc_ins_id = artd.PROC_INST_ID_
             LEFT JOIN act_ru_task art_archive ON pa.proc_ins_id = art_archive.PROC_INST_ID_
             ${ew.customSqlSegment}
-            ORDER BY a.update_date DESC
+            ORDER BY a.create_time DESC
     </select>
     <select id="findPageList2" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         SELECT
         distinct
            a.id,
-           b.name AS create_by,
-           a.create_date,
-           a.update_by,
-           a.update_date,
+           b.name AS create_by_id,
+           a.create_by_id as create_by,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
            a.del_flag,
            a.contract_id,
            a.contract_name,
@@ -241,7 +243,7 @@
            wci.no AS contract_no
         FROM
             program_project_list_info a
-            LEFT JOIN sys_user b ON a.create_by = b.id
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
             LEFT JOIN sys_user c ON a.project_manager = c.id
             LEFT JOIN work_contract_info wci ON wci.id = a.contract_id and wci.del_flag = '0'
             LEFT JOIN program_report_no prn ON prn.program_id = a.id and prn.del_flag = '0'
@@ -252,16 +254,17 @@
             left join program_members pm on a.id = pm.project_id
             LEFT JOIN proofread_issued d ON a.id = d.project_id
             ${ew.customSqlSegment}
-            ORDER BY a.update_date DESC
+            ORDER BY a.create_time DESC
     </select>
 
     <select id="findInfoList" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         SELECT
            a.id,
-           b.name AS create_by,
-           a.create_date,
-           a.update_by,
-           a.update_date,
+           b.name AS create_by_id,
+           a.create_by_id as create_by,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
            a.del_flag,
            a.contract_id,
            a.contract_name,
@@ -333,7 +336,7 @@
            d.status AS issued_status
         FROM
             program_project_list_info a
-            LEFT JOIN sys_user b ON a.create_by = b.id
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
             LEFT JOIN sys_user c ON a.project_manager = c.id
             LEFT JOIN program_report_no prn ON prn.program_id = a.id
             LEFT JOIN program_audit pa1 ON pa1.program_id = a.id and pa1.audit_level = '1' and pa1.del_flag = '0'
@@ -342,16 +345,16 @@
             LEFT JOIN program_archive pa ON pa.program_id = a.id and pa.del_flag = '0'
             LEFT JOIN proofread_issued d ON a.id = d.project_id
             ${ew.customSqlSegment}
-            ORDER BY a.update_date DESC
+            ORDER BY a.create_time DESC
     </select>
 
     <select id="getById" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         SELECT
            a.id,
-           b.name AS create_by,
-           a.create_date,
-           a.update_by,
-           a.update_date,
+           b.name AS create_by_id,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
            a.del_flag,
            a.contract_id,
            a.contract_name,
@@ -423,7 +426,7 @@
            d.status AS issued_status
         FROM
             program_project_list_info a
-            LEFT JOIN sys_user b ON a.create_by = b.id
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
             LEFT JOIN sys_user c ON a.project_manager = c.id
             LEFT JOIN program_report_no prn ON prn.program_id = a.id
             LEFT JOIN program_audit pa1 ON pa1.program_id = a.id and pa1.audit_level = '1' and pa1.del_flag = '0'
@@ -484,16 +487,16 @@
                     #{item.id}
                 </foreach>
             </if>
-            ORDER BY a.update_date DESC) AS tab
+            ORDER BY a.create_time DESC) AS tab
             ,(SELECT @i:=0) AS itable
     </select>
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         <id property="id" column="id" jdbcType="VARCHAR"/>
-        <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
-        <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
-        <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
-        <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
+        <result property="createById" column="create_by_id" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateById" column="update_by_id" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
         <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
         <result property="contractId" column="contract_id" jdbcType="VARCHAR"/>
         <result property="contractName" column="contract_name" jdbcType="VARCHAR"/>
@@ -550,10 +553,10 @@
 
     <sql id="Base_Column_List">
         ppli.id,
-        ppli.create_by,
-        ppli.create_date,
-        ppli.update_by,
-        ppli.update_date,
+        ppli.create_by_id,
+        ppli.create_time,
+        ppli.update_by_id,
+        ppli.update_time,
         ppli.del_flag,
         ppli.contract_id,
         ppli.contract_name,
@@ -610,15 +613,16 @@
     <select id="findPage" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         SELECT
         <include refid="Base_Column_List"></include>,
-        su.name AS create_by,
-        sup.name as project_manager_name
+        su.name AS create_by_id,
+        sup.name as project_manager_name,
+        ppli.create_by_id as create_by
         FROM
             program_project_list_info ppli
-            LEFT JOIN sys_user su ON ppli.create_by = su.id
+            LEFT JOIN sys_user su ON ppli.create_by_id = su.id
             LEFT JOIN sys_user sup ON ppli.project_manager = su.id
             LEFT JOIN
             ${ew.customSqlSegment}
-            ORDER BY ppli.update_date DESC
+            ORDER BY ppli.create_time DESC
     </select>
 
     <select id="selectInvoiceFlag" resultType="string">
@@ -636,7 +640,7 @@
         from finance_invoice_base fib
         inner join finance_invoice fi on fi.id = fib.invoice_id and fi.del_flag = '0'
         where fib.del_flag = '0' and fi.status != '9' and fib.program_id = #{id}
-        order by fi.create_date desc
+        order by fi.create_time desc
         limit 1
     </select>
 

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

@@ -106,7 +106,7 @@ public class ProjectListService {
         BeanUtils.copyProperties(dto, info);
         String reportNo = "";
         String id = UUID.randomUUID().toString().replace("-", "");
-        if (dto.getGenerateReportNumber().equals("true")) {
+        if (("true").equals(dto.getGenerateReportNumber())) {
             if(StringUtils.isNotBlank(info.getReportType())){
                 if (info.getReportType().equals("1")){
                     reportNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ProgramReportNoDto.BIZ_CODE);
@@ -126,10 +126,10 @@ public class ProjectListService {
         info.setId(id);
         info.setNo(no);
         info.setApprovalNo(approvalNo);
-        info.setCreateBy(userDTO.getId());
-        info.setCreateDate(new Date());
-        info.setUpdateBy(userDTO.getId());
-        info.setUpdateDate(new Date());
+        info.setCreateById(userDTO.getId());
+        info.setCreateTime(new Date());
+        info.setUpdateById(userDTO.getId());
+        info.setUpdateTime(new Date());
         info.setDelFlag(0);
         info.setTabType(tabType);
         projectListMapper.insert(info);
@@ -163,7 +163,7 @@ public class ProjectListService {
                 projectMemberMapper.insert(member);
                 if (StringUtils.isNotBlank(member.getUserId())) {
 //                    成员的user_id不是"项目负责人"、"项目创建人"的添加到非主要项目组成员id集合中
-                    if (!member.getUserId().equals(info.getProjectManager()) && !member.getUserId().equals(info.getCreateBy())) {
+                    if (!member.getUserId().equals(info.getProjectManager()) && !member.getUserId().equals(info.getCreateById())) {
                         memberIds.add(member.getUserId());
                     }
                 }
@@ -186,10 +186,10 @@ public class ProjectListService {
         p.setIsImportant("1");  // 主要成员
         p.setProjectId(id);
         p.setStatus("0");
-        p.setUserId(info.getCreateBy());  //  项目创建人
+        p.setUserId(info.getCreateById());  //  项目创建人
         programMembers.add(p);
         if (StringUtils.isNotBlank(info.getProjectManager())) {
-            if (!info.getCreateBy().equals(info.getProjectManager())) { // 项目创建人,项目负责人去重一下
+            if (!info.getCreateById().equals(info.getProjectManager())) { // 项目创建人,项目负责人去重一下
                 ProgramMembers m = new ProgramMembers();
                 m.setIsImportant("1");  // 主要成员
                 m.setProjectId(id);
@@ -339,12 +339,12 @@ public class ProjectListService {
         // 修改项目管理列表主表信息
         ProgramProjectListInfo info = new ProgramProjectListInfo();
         BeanUtils.copyProperties(dto, info);
-        info.setUpdateBy(userDTO.getId());
-        info.setUpdateDate(new Date());
+        info.setUpdateById(userDTO.getId());
+        info.setUpdateTime(new Date());
         info.setDelFlag(0);
         projectListMapper.updateById(info);
         String reportNo = "";
-        if (dto.getGenerateReportNumber().equals("true")) {
+        if (("true").equals(dto.getGenerateReportNumber())) {
             ProgramReportNo programReportNo = programReportNoMapper.selectByProgramId(info.getId());
             if (null == programReportNo) {
                 if(StringUtils.isNotBlank(info.getReportType())){
@@ -395,7 +395,7 @@ public class ProjectListService {
                 projectMemberMapper.insert(member);
                 if (StringUtils.isNotBlank(member.getUserId())) {
 //                    成员的user_id不是"项目负责人"、"项目创建人"的添加到非主要项目组成员id集合中
-                    if (!member.getUserId().equals(info.getProjectManager()) && !member.getUserId().equals(info.getCreateBy())) {
+                    if (!member.getUserId().equals(info.getProjectManager()) && !member.getUserId().equals(info.getCreateById())) {
                         memberIds.add(member.getUserId());
                     }
                 }
@@ -419,11 +419,11 @@ public class ProjectListService {
         p.setIsImportant("1");  // 主要成员
         p.setProjectId(dto.getId());
         p.setStatus("0");
-        p.setUserId(byId1.getCreateBy());  //  项目创建人
+        p.setUserId(byId1.getCreateById());  //  项目创建人
         programMembers.add(p);
         if (StringUtils.isNotBlank(info.getProjectManager())) {
             ProgramProjectListInfo byId = projectListMapper.getById(dto.getId());
-            if (!byId.getCreateBy().equals(info.getProjectManager())) { // 项目创建人,项目负责人去重一下
+            if (!byId.getCreateById().equals(info.getProjectManager())) { // 项目创建人,项目负责人去重一下
                 ProgramMembers m = new ProgramMembers();
                 m.setIsImportant("1");  // 主要成员
                 m.setProjectId(dto.getId());
@@ -627,10 +627,13 @@ public class ProjectListService {
 
     public IPage<ProgramProjectListInfo> list(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info, String tabType) throws Exception{
         QueryWrapper<ProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ProgramProjectListInfo.class);
+        if (ObjectUtil.isNotEmpty(info) && StringUtils.isNotBlank(info.getCreateById())) {
+            wrapper.eq("a.create_by_id", info.getCreateById());
+        }
         wrapper.eq("a.del_flag", "0");
         wrapper.eq("a.tab_type", tabType);
         if (info.getCreateDates() != null) {
-            wrapper.between("a.create_date", info.getCreateDates()[0], info.getCreateDates()[1]);
+            wrapper.between("a.create_time", info.getCreateDates()[0], info.getCreateDates()[1]);
         }
         IPage<ProgramProjectListInfo> pageList = projectListMapper.findPageList(page, wrapper);
         pageList.getRecords().stream().forEach(item ->{

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/typeDict/mapper/xml/ProgramTypeDictMapper.xml

@@ -19,10 +19,10 @@
 
     <sql id="Base_Column_List">
         ptd.id,
-        ptd.create_by,
-        ptd.create_date,
-        ptd.update_by,
-        ptd.update_date,
+        ptd.create_by_id,
+        ptd.create_time,
+        ptd.update_by_id,
+        ptd.update_time,
         ptd.del_flag,
         ptd.remarks,
         ptd.type,

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/serviceType/mapper/xml/ProgramServiceTypeMapper.xml

@@ -21,10 +21,10 @@
 
     <sql id="Base_Column_List">
         pst.id,
-        pst.create_by,
-        pst.create_date,
-        pst.update_by,
-        pst.update_date,
+        pst.create_by_id,
+        pst.create_time,
+        pst.update_by_id,
+        pst.update_time,
         pst.del_flag,
         pst.remarks,
         pst.name,

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadDetailMapper.xml

@@ -5,10 +5,10 @@
 	<select id="findByInfoId" resultType="com.jeeplus.assess.proofread.domain.ProofreadDetail">
 		SELECT
 			a.id,
-			a.create_by,
-			a.create_date,
-			a.update_by,
-			a.update_date,
+			a.create_by_id,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
 			a.del_flag,
 			a.info_id,
 			a.type_id,
@@ -27,10 +27,10 @@
 	<select id="findList" resultType="com.jeeplus.assess.proofread.domain.ProofreadDetail">
 		SELECT
 			id AS type_id,
-			create_by,
-			create_date,
-			update_by,
-			update_date,
+			create_by_id,
+			create_time,
+			update_by_id,
+			update_time,
 			del_flag,
 			parent_id,
 			parent_ids,

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadInfoMapper.xml

@@ -5,10 +5,10 @@
 	<select id="findByProjectId" resultType="com.jeeplus.assess.proofread.service.dto.ProofreadInfoDto">
 		SELECT
 			a.id,
-			a.create_by,
-			a.create_date,
-			a.update_by,
-			a.update_date,
+			a.create_by_id,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
 			a.del_flag,
 			a.type,
 			a.project_id,

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadIssuedMapper.xml

@@ -5,10 +5,10 @@
 	<select id="findById" resultType="com.jeeplus.assess.proofread.domain.ProofreadIssued">
 		SELECT
 			a.id,
-			a.create_by,
-			a.create_date,
-			a.update_by,
-			a.update_date,
+			a.create_by_id,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
 			a.del_flag,
 			a.project_id,
 			b.`name` AS project_name,

+ 6 - 6
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoContractMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.ReimbursementDetailInfoContractDTO">
             <id property="id" column="id" jdbcType="VARCHAR"/>
-            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
-            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
             <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
             <result property="infoId" column="info_id" jdbcType="VARCHAR"/>
             <result property="userId" column="user_id" jdbcType="VARCHAR"/>
@@ -24,8 +24,8 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,create_by,create_date,
-        update_by,update_date,del_flag,
+        id,create_by_id,create_time,
+        update_by_id,update_time,del_flag,
         info_id,user_id,dept_id,
         type_id,contract_id,report_number,
         number,receipt_number,days,

+ 6 - 6
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoOtherMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.ReimbursementDetailInfoOtherDTO">
             <id property="id" column="id" jdbcType="VARCHAR"/>
-            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
-            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
             <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
             <result property="infoId" column="info_id" jdbcType="VARCHAR"/>
             <result property="userId" column="user_id" jdbcType="VARCHAR"/>
@@ -28,8 +28,8 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,create_by,create_date,
-        update_by,update_date,del_flag,
+        id,create_by_id,create_time,
+        update_by_id,update_time,del_flag,
         info_id,user_id,user_name,
         dept_id,dept_name,type_id,
         type_name,project_id,project_name,

+ 6 - 6
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoProcuredMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.ReimbursementDetailInfoProcuredDTO">
             <id property="id" column="id" jdbcType="VARCHAR"/>
-            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
-            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
             <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
             <result property="infoId" column="info_id" jdbcType="VARCHAR"/>
             <result property="userId" column="user_id" jdbcType="VARCHAR"/>
@@ -28,8 +28,8 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,create_by,create_date,
-        update_by,update_date,del_flag,
+        id,create_by_id,create_time,
+        update_by_id,update_time,del_flag,
         info_id,user_id,user_name,
         dept_id,dept_name,type_id,
         type_name,project_id,project_name,

+ 20 - 20
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementInfoMapper.xml

@@ -52,10 +52,10 @@
 			a.proc_ins_id,
 			a.process_definition_id,
 			d.ID_ AS task_id,
-			a.create_by as create_id,
+			a.create_by_id as create_id,
 			a.source_type,
-			a.purchase_id,
-			pru.purchase_no
+			a.purchase_id
+-- 			pru.purchase_no
 		FROM
 			reimbursement_info a
 
@@ -85,12 +85,12 @@
 
 
 
-			LEFT JOIN sys_user c ON a.create_by =  c.id
+			LEFT JOIN sys_user c ON a.create_by_id =  c.id
 			left join sys_user_manage_office sumo on sumo.office_id = c.office_id
 			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
-			left join material_management_pruchase_request_basics pru on pru.id = a.purchase_id and pru.del_flag = '0'
+-- 			left join material_management_pruchase_request_basics pru on pru.id = a.purchase_id and pru.del_flag = '0'
 			${ew.customSqlSegment}
-		ORDER BY a.update_date DESC
+		ORDER BY a.update_time DESC
 	</select>
 
 	<select id="findFiles" resultType="com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto">
@@ -98,8 +98,8 @@
 			id,
 			url,
 			attachment_name AS `name`,
-			create_by AS `by`,
-			create_date
+			create_by_id AS `by`,
+			create_time
 		FROM
 			work_attachment
 		WHERE
@@ -154,10 +154,10 @@
 		FROM
 			reimbursement_info a
 			LEFT JOIN reimbursement_detail_info b ON a.id = b.info_id AND b.del_flag = 0
-			LEFT JOIN sys_user c ON a.create_by =  c.id
+			LEFT JOIN sys_user c ON a.create_by_id =  c.id
 			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
 			${ew.customSqlSegment}
-		ORDER BY a.update_date DESC
+		ORDER BY a.update_time DESC
 	</select>
 
 	<select id="relationReimbursementList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.RetureListDto">
@@ -181,12 +181,12 @@
 		FROM
 			reimbursement_info a
 			LEFT JOIN reimbursement_detail_info b ON a.id = b.info_id AND b.del_flag = 0
-			LEFT JOIN sys_user c ON a.create_by =  c.id
+			LEFT JOIN sys_user c ON a.create_by_id =  c.id
 			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
 		WHERE
 			a.del_flag = 0
 			AND a.project_id IN (SELECT id FROM program_project_list_info WHERE del_flag = 0 AND contract_id = #{id})
-		ORDER BY a.update_date DESC
+		ORDER BY a.update_time DESC
 	</select>
 	<select id="findOfficeListByUserName"
 			resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.TreeUserDto">
@@ -199,8 +199,8 @@
 	<select id="getContractDetailList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementDetailInfoContract">
 		select
 		a.id,
-		a.create_by,
-		a.create_date,
+		a.create_by_id,
+		a.create_time,
 		a.del_flag,
 		a.info_id,
 		a.user_id,
@@ -228,8 +228,8 @@
 	<select id="getDetailList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementDetailInfo">
 		select
 		a.id,
-		a.create_by,
-		a.create_date,
+		a.create_by_id,
+		a.create_time,
 		a.del_flag,
 		a.info_id,
 		a.user_id,
@@ -257,8 +257,8 @@
 	<select id="getOtherDetailList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementDetailInfoOther">
 		select
 		a.id,
-		a.create_by,
-		a.create_date,
+		a.create_by_id,
+		a.create_time,
 		a.del_flag,
 		a.info_id,
 		a.user_id,
@@ -286,8 +286,8 @@
 	<select id="getProcuredDetailList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementDetailInfoProcured">
 		select
 		a.id,
-		a.create_by,
-		a.create_date,
+		a.create_by_id,
+		a.create_time,
 		a.del_flag,
 		a.info_id,
 		a.user_id,

+ 2 - 2
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java

@@ -112,7 +112,7 @@ public class ReimbursementInfoService {
         }
         // 经办人
         if (StringUtils.isNotEmpty(dto.getHandled())) {
-            queryWrapper.apply("(a.create_by = {0} OR c.name LIKE {1})", dto.getHandled(), "%" + dto.getHandled() + "%");
+            queryWrapper.apply("(a.create_by_id = {0} OR c.name LIKE {1})", dto.getHandled(), "%" + dto.getHandled() + "%");
         }
         // 报销人
         if (StringUtils.isNotEmpty(dto.getReimBy())) {
@@ -629,7 +629,7 @@ public class ReimbursementInfoService {
         for (TreeUserDto userDto : userList) {
 
             for (TreeUserDto officeDto : officeList) {
-                if(userDto.getParentId().equals(officeDto.getId())){
+                if(StringUtils.isNotBlank(userDto.getParentId()) && userDto.getParentId().equals(officeDto.getId())){
                     list.add(officeDto);
                     list.add(userDto);
                     List<TreeUserDto> treeUserDtos = disposeOfficeTree(officeDto, officeList);

+ 7 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/controller/ReimbursementTypeController.java

@@ -86,4 +86,11 @@ public class ReimbursementTypeController {
         return ResponseEntity.ok(infos);
     }
 
+    @ApiOperation(value = "查询树形")
+    @GetMapping("/treeData1")
+    public ResponseEntity<List<ReimbursementTypeInfo>> treeData1(@RequestParam(required = false) String extId, @RequestParam(required = false) String type) throws Exception{
+        List<ReimbursementTypeInfo> infos = treeService.treeDataForType1(extId, type);
+        return ResponseEntity.ok(infos);
+    }
+
 }

+ 8 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/mapper/ReimbursementTypeMapper.java

@@ -5,6 +5,8 @@ import com.jeeplus.core.domain.TreeMapper;
 import com.jeeplus.assess.reimbursement.reimbursementType.domain.ReimbursementTypeInfo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 public interface ReimbursementTypeMapper extends BaseMapper<ReimbursementTypeInfo>, TreeMapper<ReimbursementTypeInfo> {
 
     /**
@@ -18,4 +20,10 @@ public interface ReimbursementTypeMapper extends BaseMapper<ReimbursementTypeInf
     Integer getNo(@Param("parentId") String parentId);
 
     Integer getLevel(@Param("parentId") String parentId);
+
+    /**
+     * 获取所有业务类型的数据
+     * @return
+     */
+    List<ReimbursementTypeInfo> getAllList();
 }

+ 5 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/mapper/xml/ReimbursementTypeMapper.xml

@@ -32,4 +32,9 @@
 			del_flag = 0
 			AND id = #{parentId}
 	</select>
+
+	<select id="getAllList"
+			resultType="com.jeeplus.assess.reimbursement.reimbursementType.domain.ReimbursementTypeInfo">
+		select * from cw_reimbursement_type_info where  del_flag = '0' order by sort asc
+	</select>
 </mapper>

+ 10 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/service/ReimbursementTypeForTreeDataService.java

@@ -38,6 +38,16 @@ public class ReimbursementTypeForTreeDataService extends TreeService<Reimburseme
         return rootTree;
     }
 
+    public List<ReimbursementTypeInfo> treeDataForType1(String extId, String type) throws Exception{
+        //获取所有的业务类型为1的数据
+        List<ReimbursementTypeInfo> allList = typeMapper.getAllList();
+//        List <ReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <ReimbursementTypeInfo>) entityClass ).orderByAsc ( ReimbursementTypeInfo::getSort ));
+        ReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
+        root.setId ( TreeDTO.getRootId () );
+        List <ReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
+        return rootTree;
+    }
+
     /**
      * 以root为根节点, 将allList从线性列表转为树形列表
      *

+ 4 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/workContract/controller/WorkContractController.java

@@ -18,6 +18,7 @@ import com.jeeplus.assess.workContract.service.dto.WorkContractInfoDto;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
@@ -45,6 +46,9 @@ public class WorkContractController {
         String statusList = workClientInfo.getStatusList();
         String status = workClientInfo.getStatus();
         QueryWrapper<WorkContractInfo> workContractInfoQueryWrapper = QueryWrapperGenerator.buildQueryCondition(workClientInfo, WorkContractInfo.class);
+        if (ObjectUtil.isNotEmpty(workClientInfo) && StringUtils.isNotBlank(workClientInfo.getCreateById())) {
+            workContractInfoQueryWrapper.eq("a.create_by_id", workClientInfo.getCreateById());
+        }
         IPage<WorkContractInfo> list = workContractService.list(page, workContractInfoQueryWrapper, clientName, contractDates, contractAmounts, statusList, status);
         return ResponseEntity.ok (list);
     }

+ 39 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java

@@ -3,6 +3,7 @@
  */
 package com.jeeplus.flowable.controller;
 
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
@@ -21,6 +22,8 @@ import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.service.dto.UserDTO;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
+import org.flowable.bpmn.model.BpmnModel;
+import org.flowable.bpmn.model.FlowNode;
 import org.flowable.bpmn.model.Process;
 import org.flowable.common.engine.impl.identity.Authentication;
 import org.flowable.engine.HistoryService;
@@ -463,4 +466,40 @@ public class FlowableTaskController {
         flow.setFormType(formType);
         return ResponseEntity.ok (flow);
     }
+
+    /**
+     * 根据procInsId获取当前流程节点名称
+     * @param procInsId
+     * @return
+     */
+    @GetMapping("/getTaskNameByProcInsId")
+    public ResponseEntity<String> getTaskNameByProcInsId(@RequestParam("procInsId") String procInsId) {
+        String res = getTaskName(procInsId);
+        return ResponseEntity.ok(res);
+    }
+
+    /**
+     * 根据procInsId获取当前流程节点名称
+     * @param procInsId
+     * @return
+     */
+    public String getTaskName(String procInsId) {
+        if (StringUtils.isNotBlank(procInsId)) {
+            Task task = taskService.createTaskQuery().processInstanceId(procInsId).active().singleResult();
+            if (task!=null) {
+                //获取流程发布Id信息
+                String definitionId = runtimeService.createProcessInstanceQuery().processInstanceId(procInsId).singleResult().getProcessDefinitionId();
+                //获取bpm对象
+                BpmnModel bpmnModel = SpringUtil.getBean (RepositoryService.class).getBpmnModel(definitionId);
+                //传节点定义key 获取当前节点
+                FlowNode flowNode = (FlowNode) bpmnModel.getFlowElement(task.getTaskDefinitionKey());
+                if (ObjectUtil.isNotEmpty(flowNode)) {
+                    if (StringUtils.isNotBlank(flowNode.getName())) {
+                        return flowNode.getName();
+                    }
+                }
+            }
+        }
+        return "";
+    }
 }

+ 153 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/controller/CwReimbursementTypeController.java

@@ -0,0 +1,153 @@
+package com.jeeplus.pubmodules.reimApprovalType.controller;
+
+import com.jeeplus.pubmodules.reimApprovalType.domain.CwReimbursementTypeInfo;
+import com.jeeplus.pubmodules.reimApprovalType.mapper.CwReimbursementTypeMapper;
+import com.jeeplus.pubmodules.reimApprovalType.service.CwReimbursementTypeForTreeDataService;
+import com.jeeplus.pubmodules.reimApprovalType.service.CwReimbursementTypeService;
+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-25 09:18
+ **/
+@RestController
+@Api(tags ="财务-报销类型管理")
+@RequestMapping(value = "/reimbursementApproval/type")
+public class CwReimbursementTypeController {
+
+    @Resource
+    private CwReimbursementTypeService service;
+
+    @Resource
+    private CwReimbursementTypeForTreeDataService treeService;
+
+    @Resource
+    private CwReimbursementTypeMapper mapper;
+
+    /**
+     * 列表查询
+     * @param info
+     * @return
+     */
+    @ApiOperation(value = "列表查询")
+    @GetMapping("/list")
+    public ResponseEntity<List<CwReimbursementTypeInfo>> list(CwReimbursementTypeInfo info) {
+        List<CwReimbursementTypeInfo> list = service.list(info);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 列表查询
+     * @param info
+     * @return
+     */
+    @ApiOperation(value = "列表查询")
+    @GetMapping("/bxList")
+    public ResponseEntity<List<CwReimbursementTypeInfo>> bxList(CwReimbursementTypeInfo info) {
+        List<CwReimbursementTypeInfo> list = service.bxList2(info);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 采购类型列表查询
+     * @param info
+     * @return
+     */
+    @ApiOperation(value = "采购类型列表查询")
+    @GetMapping("/cgList")
+    public ResponseEntity<List<CwReimbursementTypeInfo>> cgList(CwReimbursementTypeInfo info) {
+        List<CwReimbursementTypeInfo> list = service.cgList(info);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 新增/修改
+     * @param info
+     * @return
+     */
+    @ApiOperation(value = "新增/修改")
+    @PostMapping("/save")
+    public ResponseEntity<String> save(@RequestBody CwReimbursementTypeInfo info) {
+        String s = service.save(info);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 根据id查询
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id查询")
+    @GetMapping("/findById")
+    public ResponseEntity<CwReimbursementTypeInfo> findById(String id) {
+        CwReimbursementTypeInfo info = service.getById(id);
+        return ResponseEntity.ok(info);
+    }
+
+    /**
+     * 根据id删除
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id删除")
+    @GetMapping("/deleteById")
+    public ResponseEntity<String> deleteById(String id) {
+        mapper.deleteById(id);
+        return ResponseEntity.ok("操作完成");
+    }
+
+    /**
+     * 查询树形
+     * @param extId 排除的ID
+     * @return
+     */
+    @ApiOperation(value = "查询树形")
+    @GetMapping("/treeData")
+    public ResponseEntity<List<CwReimbursementTypeInfo>> treeData(@RequestParam(required = false) String extId, @RequestParam(required = false) String type) throws Exception{
+        List<CwReimbursementTypeInfo> infos = treeService.treeDataForType(extId, type);
+        return ResponseEntity.ok(infos);
+    }
+
+    /**
+     * 查询树形
+     * @param extId 排除的ID
+     * @return
+     */
+    @ApiOperation(value = "查询树形")
+    @GetMapping("/treeData1")
+    public ResponseEntity<List<CwReimbursementTypeInfo>> treeData1(@RequestParam(required = false) String extId, @RequestParam(required = false) String type) throws Exception{
+        List<CwReimbursementTypeInfo> infos = treeService.treeDataForType1(extId, type);
+        return ResponseEntity.ok(infos);
+    }
+
+    /**
+     * 查询树形
+     * @param extId 排除的ID
+     * @return
+     */
+    @ApiOperation(value = "查询树形")
+    @GetMapping("/summaryTreeData")
+    public ResponseEntity<List<CwReimbursementTypeInfo>> summaryTreeData(@RequestParam(required = false) String extId, @RequestParam(required = false) String type) throws Exception{
+        List<CwReimbursementTypeInfo> infos = treeService.summaryTreeData(extId, type);
+        return ResponseEntity.ok(infos);
+    }
+
+    /**
+     * 查询树形
+     * @param extId 排除的ID
+     * @return
+     */
+    @ApiOperation(value = "查询树形")
+    @GetMapping("/treeData2")
+    public ResponseEntity<List<CwReimbursementTypeInfo>> treeData2(@RequestParam(required = false) String extId, @RequestParam(required = false) String type) throws Exception{
+        List<CwReimbursementTypeInfo> infos = treeService.treeDataForType2(extId, type);
+        return ResponseEntity.ok(infos);
+    }
+
+}

+ 64 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/domain/CwReimbursementTypeInfo.java

@@ -0,0 +1,64 @@
+package com.jeeplus.pubmodules.reimApprovalType.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.jeeplus.core.domain.TreeEntity;
+import com.jeeplus.core.query.Query;
+import com.jeeplus.sys.service.dto.OfficeDTO;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 报销类型信息列表
+ **/
+@Data
+@TableName(value = "cw_reimbursement_type_info")
+public class CwReimbursementTypeInfo extends TreeEntity<CwReimbursementTypeInfo> {
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * 层级
+     */
+    private String level;
+
+    /**
+     * 报销类型名称
+     */
+    @Query
+    private String name;
+
+    /**
+     * 序号
+     */
+    @Query
+    private Integer sort;
+
+    /**
+     * 父节点id
+     */
+    private String parentId;
+
+    private String parentIds;
+
+    @TableField(exist = false)
+    private Boolean disabled = false;
+
+    @TableField(exist = false)
+    private String like;
+
+    //关联部门
+    @TableField(exist = false)
+    private String relateDepartment;
+
+    //报销部门id
+    @TableField(exist = false)
+    private String officeId;
+
+    /**
+     * 关联的officeIdList
+     */
+    private List<String> officeIdList;
+
+    private List<OfficeDTO> officeDTOList;
+}

+ 15 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/domain/OfficeDomain.java

@@ -0,0 +1,15 @@
+package com.jeeplus.pubmodules.reimApprovalType.domain;
+
+import lombok.Data;
+
+/**
+ * @author: 王强
+ * @create: 2023-02-15 13:31
+ **/
+@Data
+public class OfficeDomain {
+    private String id;     //部门id
+    private String name;    //部门名称
+    private String grade;   //部门等级
+    private String parentId; //父级部门id
+}

+ 92 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/mapper/CwReimbursementTypeMapper.java

@@ -0,0 +1,92 @@
+package com.jeeplus.pubmodules.reimApprovalType.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.core.domain.TreeMapper;
+import com.jeeplus.pubmodules.reimApprovalType.domain.CwReimbursementTypeInfo;
+import com.jeeplus.pubmodules.reimApprovalType.domain.OfficeDomain;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-25 09:02
+ **/
+public interface CwReimbursementTypeMapper extends BaseMapper<CwReimbursementTypeInfo>, TreeMapper<CwReimbursementTypeInfo> {
+
+    /**
+     * 查询数据集合
+     * @param queryWrapper
+     * @return
+     */
+    List<CwReimbursementTypeInfo> findList(@Param(Constants.WRAPPER) Wrapper<CwReimbursementTypeInfo> queryWrapper);
+
+
+    List<CwReimbursementTypeInfo> bxList2(@Param(Constants.WRAPPER) Wrapper<CwReimbursementTypeInfo> queryWrapper,
+                                          @Param("officeId") String officeId);
+
+    /**
+     * 查找当前登陆人的部门的信息
+     * @param id
+     * @return
+     */
+    OfficeDomain officeInfo(@Param("id") String id);
+
+    /**
+     * 当前登陆人为三级部门时查二级部门方法
+     * @param id
+     * @return
+     */
+    OfficeDomain officeInfo2(@Param("id") String id);
+
+    /**
+     * 递归方式获取父级部门信息
+     * @param id
+     * @return
+     */
+    List<OfficeDomain> officeInfo3(@Param("id") String id);
+
+    /**
+     * 根据id查询详情信息
+     * @param id
+     * @return
+     */
+    CwReimbursementTypeInfo getById(String id);
+    /**
+     * 根据name和parentId查询名称是否重复
+     * @param name
+     * @param parentId
+     * @return
+     */
+    Integer checkNameIsExist(@Param("name") String name, @Param("parentId") String parentId);
+
+    Integer getNo(@Param("parentId") String parentId);
+
+    Integer getLevel(@Param("parentId") String parentId);
+
+    List<String> getChildId(String id);
+
+    /**
+     * 获取所有业务类型的数据
+     * @return
+     */
+    List<CwReimbursementTypeInfo> getAllList();
+
+    /**
+     * 删除报销类型关联表对应信息
+     * @param id
+     */
+    void deleteReimbursementTypeOfficeInfo(String id);
+
+    /**
+     * 新增报销类型和部门关联信息
+     * @param id
+     * @param OfficeIdList
+     */
+    void saveReimbursementTypeOfficeInfo(@Param("id") String id , @Param("officeIdList") List<String> OfficeIdList);
+}

+ 282 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/mapper/xml/CwReimbursementTypeMapper.xml

@@ -0,0 +1,282 @@
+<?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.pubmodules.reimApprovalType.mapper.CwReimbursementTypeMapper">
+	<resultMap id="BaseResultMap" type="com.jeeplus.pubmodules.reimApprovalType.domain.CwReimbursementTypeInfo">
+		<id property="id" column="id" jdbcType="VARCHAR"/>
+		<result property="createById" column="create_by_id" jdbcType="VARCHAR"/>
+		<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+		<result property="updateById" column="update_by_id" jdbcType="VARCHAR"/>
+		<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+		<result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+
+		<result property="level" column="level" jdbcType="VARCHAR"/>
+		<result property="name" column="name" jdbcType="VARCHAR"/>
+		<result property="sort" column="sort" jdbcType="VARCHAR"/>
+		<result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
+		<result property="parentIds" column="parent_ids" jdbcType="VARCHAR"/>
+		<collection property="officeDTOList" ofType="com.jeeplus.sys.service.dto.OfficeDTO" column="id" select="getOfficeClient"></collection>
+
+	</resultMap>
+
+
+	<sql id="Base_Column_List">
+        a.id,
+        a.create_by_id,
+        a.create_time,
+        a.update_by_id,
+        a.update_time,
+        a.del_flag,
+        a.level,
+		a.name,
+		a.sort,
+		a.parent_id,
+		a.parent_ids
+    </sql>
+
+	<sql id="officeColumns">
+    	so.id as "id",
+        so.parent_id as "parent.id",
+        so.parent_ids as "parentIds",
+        so.name as "name",
+        so.sort as "sort",
+        so.area as "area",
+        so.code as "code",
+        so.type as "type",
+        so.grade as "grade",
+        so.address as "address",
+        so.zip_code as "zipCode",
+        so.master as "master",
+        so.phone as "phone",
+        so.fax as "fax",
+        so.email as "email",
+        so.useable as "useable",
+        so.primary_person as "primaryPerson",
+        so.deputy_person as "deputyPerson",
+		so.create_by_id as "createBy.id",
+		so.create_time as "createTime",
+		so.update_by_id as "updateBy.id",
+		so.update_time as "updateTime",
+        so.remarks as "remarks",
+        so.del_flag as "delFlag",
+        so.is_public as "isPublic",
+        so.administrator as "administrator"
+    </sql>
+
+	<select id="getOfficeClient" resultType="com.jeeplus.sys.service.dto.OfficeDTO">
+		select
+		<include refid="officeColumns"></include>
+		from sys_office so
+		left join cw_reimbursement_type_office_info rtoi on rtoi.office_id = so.id and so.del_flag = '0'
+		where rtoi.reimbursement_type_id = #{id}
+	</select>
+
+
+	<select id="findList" resultMap="BaseResultMap">
+		select
+		<include refid="Base_Column_List"></include>
+		,d.`name` as relateDepartment
+		from cw_reimbursement_type_info a
+		LEFT JOIN
+		(SELECT GROUP_CONCAT(c.name) as name,c.office_id,c.reimbursement_type_id FROM
+		(SELECT name,cw.office_id,cw.reimbursement_type_id
+		FROM cw_reimbursement_type_office_info cw
+		LEFT JOIN sys_office so on cw.office_id = so.id) c GROUP BY c.reimbursement_type_id) d
+		on a.id = d.reimbursement_type_id
+		${ew.customSqlSegment}
+	</select>
+
+
+	<select id="getById" resultMap="BaseResultMap">
+		select
+		<include refid="Base_Column_List"></include>
+		from cw_reimbursement_type_info a
+		<where>
+			a.del_flag = 0 and a.id = #{id}
+		</where>
+	</select>
+
+	<select id="checkNameIsExist" resultType="java.lang.Integer">
+        SELECT
+			COUNT( 0 )
+		FROM
+			cw_reimbursement_type_info
+		WHERE
+			del_flag = 0
+			AND `name` = #{name}
+			AND parent_id = #{parentId}
+    </select>
+    <select id="getNo" resultType="java.lang.Integer">
+        SELECT
+			(MAX(`sort`) + 1) AS `sort`
+		FROM
+			cw_reimbursement_type_info
+		WHERE
+			del_flag = 0
+			AND parent_id = #{parentId}
+    </select>
+    <select id="getLevel" resultType="java.lang.Integer">
+        SELECT
+			(MAX(level) + 1) AS `level`
+		FROM
+			cw_reimbursement_type_info
+		WHERE
+			del_flag = 0
+			AND id = #{parentId}
+    </select>
+	<select id="getChildId" resultType="java.lang.String">
+		select id from cw_reimbursement_type_info where parent_id = #{id}
+	</select>
+	<select id="getAllList"
+			resultType="com.jeeplus.pubmodules.reimApprovalType.domain.CwReimbursementTypeInfo">
+		select * from cw_reimbursement_type_info where  del_flag = '0' order by sort asc
+	</select>
+	<select id="bxList2"
+			resultType="com.jeeplus.pubmodules.reimApprovalType.domain.CwReimbursementTypeInfo">
+		SELECT
+			t.id,
+			t.create_time,
+			t.create_by_id,
+			t.update_time,
+			t.update_by_id,
+			t.del_flag,
+			t.LEVEL,
+			t.NAME,
+			t.sort,
+			t.parent_id,
+			t.parent_ids
+			FROM
+				(
+				SELECT
+					id,
+					create_time,
+					a.create_by_id,
+					a.update_time,
+					a.update_by_id,
+					a.del_flag,
+					a.LEVEL,
+					a.NAME,
+					a.sort,
+					a.parent_id,
+					a.parent_ids
+				FROM
+					cw_reimbursement_type_info a
+				WHERE
+					del_flag = 0
+					AND a.id IN (
+					SELECT
+						id
+					FROM
+						cw_reimbursement_type_info a
+					WHERE
+						del_flag = 0
+					AND a.parent_id NOT IN ( SELECT b.reimbursement_type_id FROM cw_reimbursement_type_office_info b)
+					AND a.id NOT IN ( SELECT b.reimbursement_type_id FROM cw_reimbursement_type_office_info b)
+					)
+					union
+				SELECT
+					id,
+					create_time,
+					a.create_by_id,
+					a.update_time,
+					a.update_by_id,
+					a.del_flag,
+					a.LEVEL,
+					a.NAME,
+					a.sort,
+					a.parent_id,
+					a.parent_ids
+					FROM
+					cw_reimbursement_type_info a
+					WHERE
+					del_flag = 0
+					and a.parent_id in (SELECT b.reimbursement_type_id FROM cw_reimbursement_type_office_info b WHERE b.office_id = #{officeId})
+				union
+				SELECT
+					id,
+					create_time,
+					a.create_by_id,
+					a.update_time,
+					a.update_by_id,
+					a.del_flag,
+					a.LEVEL,
+					a.NAME,
+					a.sort,
+					a.parent_id,
+					a.parent_ids
+					FROM
+					cw_reimbursement_type_info a
+					WHERE
+					del_flag = 0
+					and a.parent_id in
+						(SELECT
+							id
+						FROM
+							cw_reimbursement_type_info a
+						WHERE
+							del_flag = 0
+							and a.parent_id in (SELECT b.reimbursement_type_id FROM cw_reimbursement_type_office_info b WHERE b.office_id = #{officeId})
+						)
+				UNION
+				SELECT
+					id,
+					create_time,
+					a.create_by_id,
+					a.update_time,
+					a.update_by_id,
+					a.del_flag,
+					a.LEVEL,
+					a.NAME,
+					a.sort,
+					a.parent_id,
+					a.parent_ids
+					FROM
+					cw_reimbursement_type_info a
+					WHERE
+					del_flag = 0
+					and a.id in (SELECT b.reimbursement_type_id FROM cw_reimbursement_type_office_info b WHERE b.office_id = #{officeId})
+				) t
+			${ew.customSqlSegment}
+	</select>
+	<select id="officeInfo"
+			resultType="com.jeeplus.pubmodules.reimApprovalType.domain.OfficeDomain">
+		SELECT id,name,grade,parent_id FROM sys_office WHERE id = #{id} and del_flag = 0
+	</select>
+	<select id="officeInfo2"
+			resultType="com.jeeplus.pubmodules.reimApprovalType.domain.OfficeDomain">
+		SELECT id,name,grade,parent_id FROM sys_office WHERE id =
+		(SELECT parent_id FROM sys_office WHERE id = #{id} and del_flag = 0)
+		 and del_flag = 0
+	</select>
+	<select id="officeInfo3"
+			resultType="com.jeeplus.pubmodules.reimApprovalType.domain.OfficeDomain">
+		SELECT T2.ID, T2.parent_id,T2.name,T2.grade
+			FROM
+			(SELECT @r := #{id}, @l := 0) vars,
+			(SELECT
+				@r as _id,
+				(SELECT
+					@r := parent_id
+					FROM
+					sys_office
+					WHERE
+					id = _id
+				) as parent_id,
+				@l := @l + 1 as lv1
+				FROM sys_office h
+				WHERE
+				@r != 0
+			) T1
+		join sys_office T2 on T1._id = T2.id and T2.del_flag = 0
+		ORDER BY grade desc
+	</select>
+
+	<delete id="deleteReimbursementTypeOfficeInfo">
+		delete from cw_reimbursement_type_office_info where reimbursement_type_id = #{id}
+	</delete>
+
+	<insert id="saveReimbursementTypeOfficeInfo">
+		<foreach collection="officeIdList" item="officeId" separator=";">
+			insert into cw_reimbursement_type_office_info(reimbursement_type_id,office_id) values(#{id},#{officeId})
+		</foreach>
+	</insert>
+</mapper>

+ 178 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/service/CwReimbursementTypeForTreeDataService.java

@@ -0,0 +1,178 @@
+package com.jeeplus.pubmodules.reimApprovalType.service;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.jeeplus.core.service.TreeService;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.core.service.dto.TreeDTO;
+import com.jeeplus.pubmodules.reimApprovalType.domain.CwReimbursementTypeInfo;
+import com.jeeplus.pubmodules.reimApprovalType.mapper.CwReimbursementTypeMapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-25 09:01
+ **/
+@Service
+public class CwReimbursementTypeForTreeDataService extends TreeService<CwReimbursementTypeMapper, CwReimbursementTypeInfo> {
+
+    @Resource
+    private CwReimbursementTypeMapper typeMapper;
+
+    /**
+     * 获取JSON树形数据。
+     *
+     * @param extId 排除的ID
+     * @param type 禁选类型
+     * @return
+     */
+    public List<CwReimbursementTypeInfo> treeDataForType(String extId, String type) throws Exception{
+        //获取所有的业务类型为1的数据
+//        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("1");
+        List<CwReimbursementTypeInfo> allList = typeMapper.findList (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
+        CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
+        root.setId ( TreeDTO.getRootId () );
+        List <CwReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
+        return rootTree;
+    }
+
+    /**
+     * 获取JSON树形数据。
+     *
+     * @param extId 排除的ID
+     * @param type 禁选类型
+     * @return
+     */
+    public List<CwReimbursementTypeInfo> treeDataForType1(String extId, String type) throws Exception{
+        //获取所有的业务类型为1的数据
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList();
+//        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
+        CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
+        root.setId ( TreeDTO.getRootId () );
+        List <CwReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
+        return rootTree;
+    }
+
+    /**
+     * 获取JSON树形数据。
+     *
+     * @param extId 排除的ID
+     * @param type 禁选类型
+     * @return
+     */
+    public List<CwReimbursementTypeInfo> summaryTreeData(String extId, String type) throws Exception{
+        //获取所有的业务类型为1的数据
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList();
+        CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
+        root.setId ( TreeDTO.getRootId () );
+        List <CwReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
+        return rootTree;
+    }
+
+    /**
+     * 获取JSON树形数据。
+     *
+     * @param extId 排除的ID
+     * @param type 禁选类型
+     * @return
+     */
+    public List<CwReimbursementTypeInfo> treeDataForType2(String extId, String type) throws Exception{
+        //获取所有的业务类型为1的数据
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList();
+//        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
+        CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
+        root.setId ( TreeDTO.getRootId () );
+        List <CwReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
+        return rootTree;
+    }
+
+    /**
+     * 以root为根节点, 将allList从线性列表转为树形列表
+     *
+     * @param root    根节点, 为空抛出空指针异常
+     * @param allList 所有需要参与构造为树的列表
+     * @param extId   需要排除在树之外的节点(子节点一并被排除)
+     * @return java.util.List<T>
+     * @Author 滕鑫源
+     * @Date 2020/10/23 17:04
+     **/
+    public List <CwReimbursementTypeInfo> formatListToTreeForType (CwReimbursementTypeInfo root, List <CwReimbursementTypeInfo> allList, String extId, String type) {
+        String rootId = root.getId ( );
+        // 最终的树形态
+        List <CwReimbursementTypeInfo> trees = Lists.newArrayList ( );
+
+        // 把需要构造树的所有列表, 根据以父id作为key, 整理为列表
+        Map<String, List <CwReimbursementTypeInfo>> treeMap = Maps.newHashMap ( );
+        for (CwReimbursementTypeInfo entity : allList) {
+            List <CwReimbursementTypeInfo> entities = treeMap.get ( entity.getParentId ( ) );
+            if ( entities == null ) {
+                entities = Lists.newLinkedList ( );
+            }
+
+            // 剔除排除项, 构造treeMap, 转递归为线性操作
+            if ( StrUtil.isBlank ( extId ) || (!extId.equals ( entity.getId ( ) ) && entity.getParentIds ( ).indexOf ( "," + extId + "," ) == -1) ) {
+                entities.add ( entity );
+                treeMap.put ( entity.getParentId ( ), entities );
+            }
+
+            if (StringUtils.isNotEmpty(type)) {
+                //禁选类型设置disable值为true
+                if ("last".equals(type)) {
+                    allList.stream().forEach(item -> {
+                        if (StringUtils.isNotBlank(item.getParentId())) {
+                            if (item.getParentId().equals(entity.getId())) {
+                                entity.setDisabled(true);
+                            }
+                        }
+                    });
+                } else {
+                    if (type.contains(entity.getLevel())) {
+                        entity.setDisabled(true);
+                    }
+                }
+            }
+        }
+
+        // 没有给定的子树, 返回空树
+        if ( treeMap.get ( rootId ) == null || treeMap.get ( rootId ).isEmpty ( ) ) {
+            return trees;
+        }
+
+        // 开始递归格式化
+        List <CwReimbursementTypeInfo> children = treeMap.get ( rootId );
+        for (CwReimbursementTypeInfo parent : children) {
+            formatFillChildren ( parent, treeMap );
+            trees.add ( parent );
+        }
+        if ( StrUtil.equals ( rootId, TreeDTO.getRootId () ) ) {
+            return children;
+        } else {
+            root.setChildren ( trees );
+            return Lists.newArrayList ( root );
+        }
+    }
+    /**
+     * 从treeMap中取出子节点填入parent, 并递归此操作
+     *
+     * @param parent
+     * @param treeMap
+     * @return void
+     * @Author 滕鑫源
+     * @Date 2020/9/30 16:33
+     **/
+    private void formatFillChildren(CwReimbursementTypeInfo parent, Map <String, List <CwReimbursementTypeInfo>> treeMap) {
+        List <CwReimbursementTypeInfo> children = treeMap.get ( parent.getId ( ) );
+        parent.setChildren ( children );
+        if ( children != null && !children.isEmpty ( ) ) {
+            for (CwReimbursementTypeInfo child : children) {
+                formatFillChildren ( child, treeMap );
+            }
+        }
+    }
+}

+ 345 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/service/CwReimbursementTypeService.java

@@ -0,0 +1,345 @@
+package com.jeeplus.pubmodules.reimApprovalType.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.pubmodules.reimApprovalType.domain.CwReimbursementTypeInfo;
+import com.jeeplus.pubmodules.reimApprovalType.domain.OfficeDomain;
+import com.jeeplus.pubmodules.reimApprovalType.mapper.CwReimbursementTypeMapper;
+import com.jeeplus.sys.service.dto.OfficeDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
+//import com.jeeplus.test.materialManagement.materialType.domain.MaterialTypeInfo;
+import org.apache.commons.compress.utils.Lists;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-25 09:13
+ **/
+@Service
+public class CwReimbursementTypeService {
+
+    @Resource
+    private CwReimbursementTypeMapper mapper;
+
+    public List<CwReimbursementTypeInfo> bxList2(CwReimbursementTypeInfo info) {
+        LambdaQueryWrapper<CwReimbursementTypeInfo> wrapper = new LambdaQueryWrapper<>();
+        if(StringUtils.isNotBlank(info.getName())){
+            //根据type模糊查询
+            List<CwReimbursementTypeInfo> cwReimbursementTypeInfoList = mapper.selectList(new QueryWrapper<CwReimbursementTypeInfo>().lambda()
+                    .like(StringUtils.isNotBlank(info.getName()), CwReimbursementTypeInfo::getName, info.getName())
+            );
+            List<String> collect = cwReimbursementTypeInfoList.stream().map(CwReimbursementTypeInfo::getId).collect(Collectors.toList());
+            //materialTypeInfoList的父级id全部获取
+            List<String> cupIdList = cwReimbursementTypeInfoList.stream().map(CwReimbursementTypeInfo::getParentId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
+            //获取materialTypeInfoList的父级id的父级id
+            List<String> cupIdPList = new ArrayList<>();
+            if (CollectionUtil.isNotEmpty(cupIdList)) {
+                cupIdList.stream().forEach(item -> {
+                    CwReimbursementTypeInfo byId = mapper.selectById(item);
+                    if (ObjectUtil.isNotEmpty(byId)) {
+                        if (StringUtils.isNotBlank(byId.getParentId())) {
+                            cupIdPList.add(byId.getParentId());
+                        }
+                    }
+                });
+            }
+            //获取collect的下级id
+            List<String> childIdList = new ArrayList<>();
+            collect.stream().forEach(item -> {
+                List<CwReimbursementTypeInfo> list = mapper.selectList(new LambdaQueryWrapper<CwReimbursementTypeInfo>().eq(CwReimbursementTypeInfo::getParentId, item));
+                if (CollectionUtil.isNotEmpty(list)) {
+                    List<String> collect1 = list.stream().map(CwReimbursementTypeInfo::getId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
+                    if (CollectionUtil.isNotEmpty(collect1)) {
+                        childIdList.addAll(collect1);
+                        //获取collect的下级的下级的id
+                        collect1.stream().forEach(i -> {
+                            List<CwReimbursementTypeInfo> l = mapper.selectList(new LambdaQueryWrapper<CwReimbursementTypeInfo>().eq(CwReimbursementTypeInfo::getParentId, i));
+                            if (CollectionUtil.isNotEmpty(l)) {
+                                List<String> collect2 = l.stream().map(CwReimbursementTypeInfo::getId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
+                                if (CollectionUtil.isNotEmpty(collect2)) {
+                                    childIdList.addAll(collect2);
+                                }
+                            }
+                        });
+                    }
+                }
+            });
+            //将获取到的这几个id集合融合到一起并去重,然后根据id查询,即可得到结果
+            collect.addAll(cupIdList);
+            collect.addAll(cupIdPList);
+            collect.addAll(childIdList);
+
+            List<String> idList = collect.stream().distinct().collect(Collectors.toList());
+            if(CollectionUtil.isNotEmpty(idList)){
+                wrapper.in(CwReimbursementTypeInfo::getId,idList);
+            }else{
+                return new ArrayList<>();
+            }
+        }
+        if (ObjectUtil.isNotEmpty(info)) {
+            if (StringUtils.isNotBlank(info.getLike())){
+                wrapper.likeRight(CwReimbursementTypeInfo::getSort,info.getLike());
+            }
+        }
+//        if (info.getSort() != null) {
+//            wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
+//        }
+
+        wrapper.eq(BaseEntity::getDelFlag, 0);
+        wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
+        //查当前登陆人的父级部门的id为江苏兴光的
+//        OfficeDomain officeInfo = mapper.officeInfo(info.getOfficeId());
+//        if (null != officeInfo && officeInfo.getGrade().equals("2")){
+//            info.setOfficeId(officeInfo.getId());
+//        } else if (null != officeInfo && officeInfo.getGrade().equals("3")) {
+//            officeInfo = mapper.officeInfo2(officeInfo.getId());
+//            if (null != officeInfo){
+//                info.setOfficeId(officeInfo.getId());
+//            }
+//        }
+        //使用递归的方式来查当前登陆人部门父节点信息
+        List<OfficeDomain> officeDomains = mapper.officeInfo3(info.getOfficeId());
+        if (null != officeDomains && officeDomains.size()>0){
+            for (int i=0;i<officeDomains.size()-1;i++){
+                //当get(i)的父级id与 i+1的id相同,并且i+的部门层级为1的时候
+                if (officeDomains.get(i).getParentId().equals(officeDomains.get(i+1).getId()) && StringUtils.isNotBlank(officeDomains.get(i+1).getGrade()) &&
+                        officeDomains.get(i+1).getGrade().equals("1")){
+                    info.setOfficeId(officeDomains.get(i).getId());
+                }
+            }
+        }
+        return mapper.bxList2(wrapper,info.getOfficeId());
+    }
+
+    public List<CwReimbursementTypeInfo> list(CwReimbursementTypeInfo info) {
+        QueryWrapper<CwReimbursementTypeInfo> wrapper = new QueryWrapper<>();
+        if(StringUtils.isNotBlank(info.getName())){
+            //根据type模糊查询
+            List<CwReimbursementTypeInfo> cwReimbursementTypeInfoList = mapper.selectList(new QueryWrapper<CwReimbursementTypeInfo>().lambda()
+                    .like(StringUtils.isNotBlank(info.getName()), CwReimbursementTypeInfo::getName, info.getName())
+            );
+            List<String> collect = cwReimbursementTypeInfoList.stream().map(CwReimbursementTypeInfo::getId).collect(Collectors.toList());
+            //materialTypeInfoList的父级id全部获取
+            List<String> cupIdList = cwReimbursementTypeInfoList.stream().map(CwReimbursementTypeInfo::getParentId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
+            //获取materialTypeInfoList的父级id的父级id
+            List<String> cupIdPList = new ArrayList<>();
+            if (CollectionUtil.isNotEmpty(cupIdList)) {
+                cupIdList.stream().forEach(item -> {
+                    CwReimbursementTypeInfo byId = mapper.selectById(item);
+                    if (ObjectUtil.isNotEmpty(byId)) {
+                        if (StringUtils.isNotBlank(byId.getParentId())) {
+                            cupIdPList.add(byId.getParentId());
+                        }
+                    }
+                });
+            }
+            //获取collect的下级id
+            List<String> childIdList = new ArrayList<>();
+            collect.stream().forEach(item -> {
+                List<CwReimbursementTypeInfo> list = mapper.selectList(new LambdaQueryWrapper<CwReimbursementTypeInfo>().eq(CwReimbursementTypeInfo::getParentId, item));
+                if (CollectionUtil.isNotEmpty(list)) {
+                    List<String> collect1 = list.stream().map(CwReimbursementTypeInfo::getId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
+                    if (CollectionUtil.isNotEmpty(collect1)) {
+                        childIdList.addAll(collect1);
+                        //获取collect的下级的下级的id
+                        collect1.stream().forEach(i -> {
+                            List<CwReimbursementTypeInfo> l = mapper.selectList(new LambdaQueryWrapper<CwReimbursementTypeInfo>().eq(CwReimbursementTypeInfo::getParentId, i));
+                            if (CollectionUtil.isNotEmpty(l)) {
+                                List<String> collect2 = l.stream().map(CwReimbursementTypeInfo::getId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
+                                if (CollectionUtil.isNotEmpty(collect2)) {
+                                    childIdList.addAll(collect2);
+                                }
+                            }
+                        });
+                    }
+                }
+            });
+            //将获取到的这几个id集合融合到一起并去重,然后根据id查询,即可得到结果
+            collect.addAll(cupIdList);
+            collect.addAll(cupIdPList);
+            collect.addAll(childIdList);
+
+            List<String> idList = collect.stream().distinct().collect(Collectors.toList());
+            if(CollectionUtil.isNotEmpty(idList)){
+                wrapper.in("a.id",idList);
+            }else{
+                return new ArrayList<>();
+            }
+        }
+//        wrapper.eq(CwReimbursementTypeInfo::getBusinessType, "1");
+
+        wrapper.eq("a.del_flag", 0);
+        wrapper.orderByAsc("a.sort");
+        return mapper.findList(wrapper);
+    }
+
+
+    /**
+     * 根据id查询项目详情
+     * @param id
+     * @return
+     */
+    public CwReimbursementTypeInfo getById(String id) {
+        CwReimbursementTypeInfo info = mapper.getById(id);
+        if(null != info.getOfficeDTOList() && info.getOfficeDTOList().size()>0){
+            List<String> officeIdList = Lists.newArrayList();
+            for (OfficeDTO office : info.getOfficeDTOList()) {
+                officeIdList.add(office.getId());
+            }
+            info.setOfficeIdList(officeIdList);
+        }
+        return info;
+    }
+
+    public List<CwReimbursementTypeInfo> bxList(CwReimbursementTypeInfo info) {
+        LambdaQueryWrapper<CwReimbursementTypeInfo> wrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotEmpty(info.getName())) {
+            wrapper.like(CwReimbursementTypeInfo::getName, info.getName());
+        }
+        if (ObjectUtil.isNotEmpty(info)) {
+            if (StringUtils.isNotBlank(info.getLike())){
+                wrapper.likeRight(CwReimbursementTypeInfo::getSort,info.getLike());
+            }
+        }
+        if (info.getSort() != null) {
+            wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
+        }
+
+        wrapper.eq(BaseEntity::getDelFlag, 0);
+        wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
+        return mapper.selectList(wrapper);
+    }
+
+    public List<CwReimbursementTypeInfo> cgList(CwReimbursementTypeInfo info) {
+        LambdaQueryWrapper<CwReimbursementTypeInfo> wrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotEmpty(info.getName())) {
+            wrapper.like(CwReimbursementTypeInfo::getName, info.getName());
+        }
+        if (info.getSort() != null) {
+            wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
+        }
+
+        wrapper.eq(BaseEntity::getDelFlag, 0);
+        wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
+        return mapper.selectList(wrapper);
+    }
+
+    public String save(CwReimbursementTypeInfo info) {
+        // parentId未传值,则表示一级菜单
+        if(StringUtils.isEmpty(info.getParentId())) {
+            info.setParentId("0");
+        }
+        // 保存数据
+        if (StringUtils.isNotEmpty(info.getId())) {
+            return update(info);
+        }
+        return add(info);
+    }
+
+    /**
+     * 新增
+     * @param info
+     * @return
+     */
+    public String add(CwReimbursementTypeInfo info) {
+        // 判断名称是否已存在
+        Integer isExist = mapper.checkNameIsExist(info.getName(), info.getParentId());
+        if (isExist > 0) {
+            return "false";
+        }
+        // 获取当前登录人信息
+        UserDTO userDto = UserUtils.getCurrentUserDTO();
+        // 生成id值
+        String id = UUID.randomUUID().toString().replace("-", "");
+        info.setId(id);
+        info.setCreateById(userDto.getId());
+        info.setCreateTime(new Date());
+        info.setUpdateById(userDto.getId());
+        info.setUpdateTime(new Date());
+        info.setDelFlag(0);
+        // 生成序号/层级
+        getNo(info);
+        mapper.insert(info);
+        return "操作完成";
+    }
+
+    /**
+     * 修改
+     * @param info
+     * @return
+     */
+    public String update(CwReimbursementTypeInfo info) {
+        // 获取当前登录人信息
+        UserDTO userDto = UserUtils.getCurrentUserDTO();
+        info.setUpdateById(userDto.getId());
+        info.setUpdateTime(new Date());
+        //对关联的公司id进行处理
+        if (null != info.getOfficeIdList() && info.getOfficeIdList().size()>0) {
+            //首先删除原有关联信息
+            mapper.deleteReimbursementTypeOfficeInfo(info.getId());
+            //将新的关联信息进行保存
+            mapper.saveReimbursementTypeOfficeInfo(info.getId(),info.getOfficeIdList());
+//            info.setOfficeIdList(null);
+        } else if (null != info.getOfficeIdList() && info.getOfficeIdList().isEmpty()){
+            //首先删除原有关联信息
+            mapper.deleteReimbursementTypeOfficeInfo(info.getId());
+        }
+        info.setOfficeIdList(null);
+        mapper.updateById(info);
+        return "操作完成";
+    }
+
+    /**
+     * 生成序号/层级
+     * @param info
+     * @return
+     */
+    public CwReimbursementTypeInfo getNo(CwReimbursementTypeInfo info) {
+        CwReimbursementTypeInfo parentInfo = null;
+        if (!"0".equals(info.getParentId())) {
+            //根据parentId查询父节点信息
+            LambdaQueryWrapper<CwReimbursementTypeInfo> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(BaseEntity::getDelFlag, 0);
+            wrapper.eq(BaseEntity::getId, info.getParentId());
+            parentInfo = mapper.selectOne(wrapper);
+        }
+        //查询序号
+        Integer no = mapper.getNo(info.getParentId());
+        // 该层级下有数据,正常返回序号值
+        if (no != null) {
+            info.setSort(no);
+        } else {
+            // 父节点存在,根据父节点序号生成;不存在,则表示无上级层级,从1开始
+            if (parentInfo != null) {
+                String s = parentInfo.getSort() + "01";
+                info.setSort(Integer.parseInt(s));
+            } else {
+                info.setSort(1);
+            }
+        }
+        // 生成层级
+        //查询层级
+        Integer level = mapper.getLevel(info.getParentId());
+        if (level != null) {
+            info.setLevel(level.toString());
+        } else {
+            // 父节点存在,根据父节点level生成,不存在,则表示无上级层级,从1开始
+            if (parentInfo != null) {
+                Integer i = Integer.parseInt(parentInfo.getLevel())+1;
+                info.setLevel(i.toString());
+            } else {
+                info.setLevel("1");
+            }
+        }
+        return info;
+    }
+}

+ 21 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/service/dto/CwReimbursementTypeDto.java

@@ -0,0 +1,21 @@
+package com.jeeplus.pubmodules.reimApprovalType.service.dto;
+
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-25 09:04
+ **/
+@Data
+public class CwReimbursementTypeDto extends BaseEntity {
+
+    private String level;
+
+    private String name;
+
+    private Integer sort;
+
+    private String parentId;
+
+}