浏览代码

报销审批

sangwenwei 1 年之前
父节点
当前提交
65d3075453
共有 30 个文件被更改,包括 1966 次插入0 次删除
  1. 11 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/controller/BorrowController.java
  2. 2 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/BorrowMapper.java
  3. 15 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/xml/BorrowMapper.xml
  4. 35 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/service/BorrowService.java
  5. 13 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/controller/PaymentController.java
  6. 3 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/mapper/PaymentMapper.java
  7. 16 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/mapper/xml/PaymentMapper.xml
  8. 29 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/service/PaymentService.java
  9. 2 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectMapper.java
  10. 46 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml
  11. 4 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java
  12. 116 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/controller/JyReimbursementInfoController.java
  13. 43 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementAmountInfo.java
  14. 84 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementDetailInfoBorrow.java
  15. 79 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementDetailInfoOther.java
  16. 84 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementDetailInfoPayment.java
  17. 79 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementDetailInfoProject.java
  18. 52 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementInfo.java
  19. 9 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementAmountInfoMapper.java
  20. 13 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoBorrowMapper.java
  21. 40 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoMapper.java
  22. 10 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoOtherMapper.java
  23. 14 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoPaymentMapper.java
  24. 16 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoProjectMapper.java
  25. 23 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/xml/JyReimbursementInfoBorrowMapper.xml
  26. 252 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/xml/JyReimbursementInfoMapper.xml
  27. 20 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/xml/JyReimbursementInfoPaymentMapper.xml
  28. 549 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/service/JyReimbursementInfoService.java
  29. 205 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/service/dto/JyReimbursementInfoDTO.java
  30. 102 0
      jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/modules/flowable/listener/ApplyListener.java

+ 11 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/controller/BorrowController.java

@@ -2,6 +2,7 @@ package com.jeeplus.business.borrow.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.borrow.domain.BorrowMoney;
 import com.jeeplus.business.borrow.service.BorrowService;
 import com.jeeplus.business.borrow.service.dto.BorrowDTO;
 import com.jeeplus.business.borrow.service.dto.RefundDTO;
@@ -106,4 +107,14 @@ public class BorrowController {
     }
 
 
+    /**
+     * 根据当前登录人查找借款信息
+     */
+    @ApiOperation(value = "根据当前登录人查找信息")
+    @GetMapping(value = "listByUserId")
+    public ResponseEntity<IPage<BorrowMoney>> listByUserId(BorrowMoney borrowMoney, Page<BorrowDTO> page) throws Exception {
+        IPage<BorrowMoney> pageList=borrowService.listByUserId(borrowMoney,page);
+        return ResponseEntity.ok(pageList);
+    }
+
 }

+ 2 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/BorrowMapper.java

@@ -26,4 +26,6 @@ public interface BorrowMapper extends BaseMapper<BorrowMoney> {
     void updateInfoById(@Param("borrowMoney") BorrowMoney borrowMoney);
     @InterceptorIgnore(tenantLine = "true")
     void updateRefundInfoById(@Param("refundInfo") Refund refundInfo);
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<BorrowMoney> listByUserId(@Param(Constants.WRAPPER)QueryWrapper<BorrowMoney> queryWrapper, Page<BorrowDTO> page);
 }

+ 15 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/mapper/xml/BorrowMapper.xml

@@ -98,5 +98,20 @@
         where id=#{refundInfo.id}
     </update>
 
+    <select id="listByUserId" resultType="com.jeeplus.business.borrow.domain.BorrowMoney">
+        select
+            a.id,
+            a.no,
+            a.money_lower,
+            a.reason,
+            so.name as officeName,
+            su.name as createName
+        from jy_borrow_money a
+        left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
+        left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        ${ew.customSqlSegment}
+        and a.status = '5'
+    </select>
+
 
 </mapper>

+ 35 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/borrow/service/BorrowService.java

@@ -11,17 +11,21 @@ import com.jeeplus.business.borrow.mapper.RefundMapper;
 import com.jeeplus.business.borrow.service.dto.BorrowDTO;
 import com.jeeplus.business.borrow.service.dto.RefundDTO;
 import com.jeeplus.business.project.service.dto.JyProjectDTO;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoBorrow;
+import com.jeeplus.business.reimbursement.mapper.JyReimbursementInfoBorrowMapper;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.utils.StringUtils;
+import org.apache.ibatis.javassist.runtime.Desc;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.Date;
+import java.util.List;
 import java.util.UUID;
 @Service
 public class BorrowService {
@@ -32,6 +36,8 @@ public class BorrowService {
     @Resource
     private RefundMapper refundMapper;
 
+    @Resource
+    private JyReimbursementInfoBorrowMapper jyReimbursementInfoBorrowMapper;
 
     /**
      * 列表管理
@@ -72,6 +78,19 @@ public class BorrowService {
             }
         }
         IPage<BorrowDTO> pageList=borrowMapper.findPageList(queryWrapper,page);
+        //获取借款报销表中的信息
+        List<JyReimbursementDetailInfoBorrow> borrowList=jyReimbursementInfoBorrowMapper.getList();
+        borrowList.stream().forEach(item->{
+            pageList.getRecords().stream().forEach(data->{
+                if (item.getProjectId().equals(data.getId())){
+                    Float moneyLower=Float.parseFloat(data.getMoneyLower());
+                    Float number=Float.parseFloat(item.getNumber());
+                    Float money=moneyLower-number;
+                    data.setFinalMoney(money.toString());
+                    data.setRefundLower(item.getNumber());
+                }
+            });
+        });
         return pageList;
     }
 
@@ -213,4 +232,20 @@ public class BorrowService {
         refundInfo.setId(borrowDTO.getRefundId());
         borrowMapper.updateRefundInfoById(refundInfo);
     }
+
+    /**
+     * 根据当前登录人获取借款信息
+     * @param borrowMoney
+     * @param page
+     * @return
+     */
+    public IPage<BorrowMoney> listByUserId(BorrowMoney borrowMoney, Page<BorrowDTO> page) throws Exception {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        QueryWrapper<BorrowMoney> queryWrapper = QueryWrapperGenerator.buildQueryCondition(borrowMoney, BorrowMoney.class);
+        queryWrapper.eq("a.create_by_id",userDTO.getId());
+        queryWrapper.orderByDesc("a.update_time");
+        IPage<BorrowMoney> moneyList = borrowMapper.listByUserId(queryWrapper,page);
+        return moneyList;
+    }
 }

+ 13 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/controller/PaymentController.java

@@ -2,7 +2,9 @@ package com.jeeplus.business.payment.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.borrow.domain.BorrowMoney;
 import com.jeeplus.business.borrow.service.dto.BorrowDTO;
+import com.jeeplus.business.payment.domain.Payment;
 import com.jeeplus.business.payment.service.PaymentService;
 import com.jeeplus.business.payment.service.dto.PaymentDTO;
 import com.jeeplus.common.utils.ResponseUtil;
@@ -80,4 +82,15 @@ public class PaymentController {
     public void adminEditForm(@RequestBody PaymentDTO paymentDTO){
         paymentService.adminEditForm(paymentDTO);
     }
+
+    /**
+     * 根据当前登录人查找借款信息
+     */
+    @ApiOperation(value = "根据当前登录人查找信息")
+    @GetMapping(value = "listByUserId")
+    public ResponseEntity<IPage<Payment>> listByUserId(Payment payment, Page<BorrowDTO> page) throws Exception {
+        IPage<Payment> pageList=paymentService.listByUserId(payment,page);
+        return ResponseEntity.ok(pageList);
+    }
+
 }

+ 3 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/mapper/PaymentMapper.java

@@ -6,6 +6,7 @@ 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.business.borrow.service.dto.BorrowDTO;
 import com.jeeplus.business.payment.domain.Payment;
 import com.jeeplus.business.payment.service.dto.PaymentDTO;
 import org.apache.ibatis.annotations.Mapper;
@@ -21,4 +22,6 @@ public interface PaymentMapper extends BaseMapper<Payment> {
     void updateStatusById(@Param("id") String id, @Param("status") String status);
     @InterceptorIgnore(tenantLine = "true")
     void updateInfoById(@Param("payment") Payment payment);
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<Payment> listByUserId(@Param(Constants.WRAPPER)QueryWrapper<Payment> queryWrapper, Page<BorrowDTO> page);
 }

+ 16 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/mapper/xml/PaymentMapper.xml

@@ -93,4 +93,20 @@
         where id = #{payment.id}
     </update>
 
+    <select id="listByUserId" resultType="com.jeeplus.business.payment.domain.Payment">
+        select
+            a.id,
+            a.no,
+            a.payment_lower,
+            a.reason,
+            a.payment_time,
+            so.name as officeName,
+            su.name as createName
+        from jy_payment a
+        left join sys_user su on a.payment_user = su.id and su.del_flag = '0'
+        left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        ${ew.customSqlSegment}
+        and a.status = '5'
+    </select>
+
 </mapper>

+ 29 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/payment/service/PaymentService.java

@@ -5,12 +5,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.borrow.domain.BorrowMoney;
 import com.jeeplus.business.borrow.service.dto.BorrowDTO;
 import com.jeeplus.business.payment.domain.Payment;
 import com.jeeplus.business.payment.mapper.PaymentMapper;
 import com.jeeplus.business.payment.service.dto.PaymentDTO;
 import com.jeeplus.business.project.domain.JyProject;
 import com.jeeplus.business.project.mapper.JyProjectMapper;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoPayment;
+import com.jeeplus.business.reimbursement.mapper.JyReimbursementInfoPaymentMapper;
 import com.jeeplus.business.workClientInfo.domain.dto.JyWorkClientInfosDto;
 import com.jeeplus.business.workClientInfo.mapper.JyWorkClientBankMapper;
 import com.jeeplus.business.workClientInfo.mapper.JyWorkClientInfoMapper;
@@ -26,6 +29,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.UUID;
 
 @Service
@@ -40,6 +44,9 @@ public class PaymentService {
     @Resource
     private JyWorkClientService jyWorkClientService;
 
+    @Resource
+    private JyReimbursementInfoPaymentMapper jyReimbursementInfoPaymentMapper;
+
 
     /*
     列表
@@ -77,6 +84,18 @@ public class PaymentService {
             }
         }
         IPage<PaymentDTO> pageList=paymentMapper.findPageList(queryWrapper,page);
+        List<JyReimbursementDetailInfoPayment> list = jyReimbursementInfoPaymentMapper.getList();
+        list.stream().forEach(item->{
+            pageList.getRecords().stream().forEach(data->{
+                if (item.getProjectId().equals(data.getId())){
+                    Float moneyLower=Float.parseFloat(data.getPaymentLower());
+                    Float number=Float.parseFloat(item.getNumber());
+                    Float money=moneyLower-number;
+                    data.setFinalMoney(money.toString());
+                    data.setRefund(item.getNumber());
+                }
+            });
+        });
         return pageList;
 
 
@@ -230,4 +249,14 @@ public class PaymentService {
 
         paymentMapper.updateInfoById(payment);
     }
+
+    public IPage<Payment> listByUserId(Payment payment, Page<BorrowDTO> page) throws Exception {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        QueryWrapper<Payment> queryWrapper = QueryWrapperGenerator.buildQueryCondition(payment, Payment.class);
+        queryWrapper.eq("a.create_by_id",userDTO.getId());
+        queryWrapper.orderByDesc("a.update_time");
+        IPage<Payment> moneyList = paymentMapper.listByUserId(queryWrapper,page);
+        return moneyList;
+    }
 }

+ 2 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectMapper.java

@@ -50,4 +50,6 @@ public interface JyProjectMapper extends BaseMapper<JyProject> {
     IPage<JyProject> getByCreateOffice(@Param("id")String id, Page<JyProject> page,  @Param(Constants.WRAPPER)QueryWrapper<JyProject> wrapper);
     @InterceptorIgnore(tenantLine = "true")
     List<JyProjectDTO> getByIdNoArchive(@Param("id")String id);
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyProject> getListByIds(@Param("ids") List idList);
 }

+ 46 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml

@@ -910,5 +910,51 @@
     </select>
 
 
+    <select id="getListByIds" resultType="com.jeeplus.business.project.domain.JyProject">
+        select
+        a.id,
+        a.create_by_id as create_by,
+        a.create_time,
+        a.update_by_id,
+        a.update_time,
+        a.del_flag,
+        a.name,
+        a.no,
+        a.contract_id,
+        a.contract_name,
+        a.client,
+        a.client_name,
+        a.status,
+        a.id as projectId,
+        a.first_instance_status,
+        a.second_instance_status,
+        a.third_instance_status,
+        a.report_issuance,
+        a.out_instance,
+        a.reports_submit,
+        a.review_status,
+        a.contract_status,
+        a.project_place,
+        a.build_place,
+        a.project_overview,
+        a.special,
+        a.contract_project_no,
+        (SELECT su.name from sys_user su where a.project_leader = su.id) as projectLeader,
+        a.proc_ins_id,
+        a.process_definition_id
+        from jy_project_record a
+         <where>
+            a.del_flag=0
+            and a.id in
+            <foreach collection="ids" open="(" close=")" separator="," item="id">
+                #{id}
+            </foreach>
+        </where>
+
+    </select>
+
+
+
+
 
 </mapper>

+ 4 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java

@@ -1896,4 +1896,8 @@ public class JyProjectService {
         });
         return projectDTOList;
     }
+
+    public List<JyProject> getListByIds(List idList) {
+        return jyProjectMapper.getListByIds(idList);
+    }
 }

+ 116 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/controller/JyReimbursementInfoController.java

@@ -0,0 +1,116 @@
+package com.jeeplus.business.reimbursement.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.project.service.dto.JyProjectDTO;
+import com.jeeplus.business.reimbursement.service.JyReimbursementInfoService;
+import com.jeeplus.business.reimbursement.service.dto.JyReimbursementInfoDTO;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.flowable.feign.IFlowableApi;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@RestController
+@Api(tags ="报销管理")
+@RequestMapping(value = "/reimbursement")
+public class JyReimbursementInfoController {
+
+    @Resource
+    private JyReimbursementInfoService jyReimbursementInfoService;
+
+    @Resource
+    private IFlowableApi flowTaskService;
+
+
+    /**
+     * 列表
+     */
+    @ApiOperation(value = "列表查询")
+    @GetMapping("/list")
+    public ResponseEntity<IPage<JyReimbursementInfoDTO>> list(Page<JyReimbursementInfoDTO> page, JyReimbursementInfoDTO dto) throws Exception{
+        IPage<JyReimbursementInfoDTO> iPage = jyReimbursementInfoService.list(page, dto);
+        iPage.getRecords().stream().forEach(i -> {
+            // 报销审批
+            if (StringUtils.isNotBlank(i.getTaskId()) && StringUtils.isNotBlank(i.getStatus())) {
+                if ("2".equals(i.getStatus())) { // “审核中”的数据要获取数据审核人
+                    i.setAuditUserIds(flowTaskService.getTaskAuditUsers(i.getTaskId()));  // 获取数据审核人
+                }
+            }
+        });
+        return ResponseEntity.ok(iPage);
+    }
+
+
+    /**
+     * 新增/修改
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "新增、修改")
+    @PostMapping("/save")
+    public ResponseEntity<String> save(@RequestBody JyReimbursementInfoDTO dto) throws Exception{
+        String s = jyReimbursementInfoService.save(dto);
+        return ResponseUtil.newInstance().add("businessTable", "jy_reimbursement_info")
+                .add("businessId", s)
+                .ok ("操作成功");
+    }
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "删除")
+    @DeleteMapping("/remove")
+    public ResponseEntity<String> remove(@RequestParam String id){
+        String s = jyReimbursementInfoService.remove(id);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 查询
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "查询")
+    @GetMapping("/findById")
+    public ResponseEntity<JyReimbursementInfoDTO> findById(@RequestParam String id) throws Exception{
+        JyReimbursementInfoDTO dto = jyReimbursementInfoService.findById(id);
+        return ResponseEntity.ok(dto);
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody JyReimbursementInfoDTO dto) {
+        jyReimbursementInfoService.updateStatusById(dto);
+    }
+
+    /**
+     * 项目列表查询
+     * @param ids
+     * @return
+     */
+    @ApiOperation(value = "列表查询")
+    @GetMapping("/queryByProIds")
+    public ResponseEntity<List<JyProjectDTO>> queryByProIds(String ids){
+        List<JyProjectDTO> jyProjects = jyReimbursementInfoService.queryByProIds(ids);
+        return ResponseEntity.ok(jyProjects);
+    }
+
+
+
+
+
+
+
+}

+ 43 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementAmountInfo.java

@@ -0,0 +1,43 @@
+package com.jeeplus.business.reimbursement.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 嘉溢-报销专用发票信息表
+ **/
+@Data
+@TableName(value = "jy_reimbursement_amount_info")
+public class JyReimbursementAmountInfo extends BaseEntity {
+
+    /**
+     * 关联id
+     */
+    private String infoId;
+
+    /**
+     * 发票代码
+     */
+    private String code;
+
+    /**
+     * 发票编号
+     */
+    private String number;
+
+    /**
+     * 金额
+     */
+    private String amount;
+
+    /**
+     * 税额
+     */
+    private String taxAmount;
+
+    /**
+     * 价税合计
+     */
+    private String count;
+}

+ 84 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementDetailInfoBorrow.java

@@ -0,0 +1,84 @@
+package com.jeeplus.business.reimbursement.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName("jy_reimbursement_detail_info_borrow")
+public class JyReimbursementDetailInfoBorrow extends BaseEntity {
+    /**
+     * 关联id
+     */
+    private String infoId;
+
+    /**
+     * 报销人
+     */
+    private String userId;
+
+    /**
+     * 报销人名称
+     */
+    private String userName;
+
+    /**
+     * 报销部门
+     */
+    private String deptId;
+
+    /**
+     * 报销部门名称
+     */
+    private String deptName;
+
+    /**
+     * 报销类型
+     */
+    private String typeId;
+
+    /**
+     * 报销类型名称
+     */
+    private String typeName;
+
+    /**
+     * 报销项目
+     */
+    private String projectId;
+
+    /**
+     * 报销项目名称
+     */
+    private String projectName;
+
+    /**
+     * 报告号
+     */
+    private String reportNumber;
+
+    /**
+     * 费用(元)
+     */
+    private String number;
+
+    /**
+     * 收据张数
+     */
+    private Integer receiptNumber;
+
+    /**
+     * 出差天数
+     */
+    private Integer days;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 借款金额
+     */
+    private Integer moneyLower;
+}

+ 79 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementDetailInfoOther.java

@@ -0,0 +1,79 @@
+package com.jeeplus.business.reimbursement.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName("jy_reimbursement_detail_info_other")
+public class JyReimbursementDetailInfoOther extends BaseEntity {
+    /**
+     * 关联id
+     */
+    private String infoId;
+
+    /**
+     * 报销人
+     */
+    private String userId;
+
+    /**
+     * 报销人名称
+     */
+    private String userName;
+
+    /**
+     * 报销部门
+     */
+    private String deptId;
+
+    /**
+     * 报销部门名称
+     */
+    private String deptName;
+
+    /**
+     * 报销类型
+     */
+    private String typeId;
+
+    /**
+     * 报销类型名称
+     */
+    private String typeName;
+
+    /**
+     * 报销项目
+     */
+    private String projectId;
+
+    /**
+     * 报销项目名称
+     */
+    private String projectName;
+
+    /**
+     * 报告号
+     */
+    private String reportNumber;
+
+    /**
+     * 费用(元)
+     */
+    private String number;
+
+    /**
+     * 收据张数
+     */
+    private Integer receiptNumber;
+
+    /**
+     * 出差天数
+     */
+    private Integer days;
+
+    /**
+     * 内容
+     */
+    private String content;
+}

+ 84 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementDetailInfoPayment.java

@@ -0,0 +1,84 @@
+package com.jeeplus.business.reimbursement.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName("jy_reimbursement_detail_info_payment")
+public class JyReimbursementDetailInfoPayment extends BaseEntity {
+    /**
+     * 关联id
+     */
+    private String infoId;
+
+    /**
+     * 报销人
+     */
+    private String userId;
+
+    /**
+     * 报销人名称
+     */
+    private String userName;
+
+    /**
+     * 报销部门
+     */
+    private String deptId;
+
+    /**
+     * 报销部门名称
+     */
+    private String deptName;
+
+    /**
+     * 报销类型
+     */
+    private String typeId;
+
+    /**
+     * 报销类型名称
+     */
+    private String typeName;
+
+    /**
+     * 报销项目
+     */
+    private String projectId;
+
+    /**
+     * 报销项目名称
+     */
+    private String projectName;
+
+    /**
+     * 报告号
+     */
+    private String reportNumber;
+
+    /**
+     * 费用(元)
+     */
+    private String number;
+
+    /**
+     * 收据张数
+     */
+    private Integer receiptNumber;
+
+    /**
+     * 出差天数
+     */
+    private Integer days;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 付款金额
+     */
+    private Integer paymentLower;
+}

+ 79 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementDetailInfoProject.java

@@ -0,0 +1,79 @@
+package com.jeeplus.business.reimbursement.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName("jy_reimbursement_detail_info_project")
+public class JyReimbursementDetailInfoProject extends BaseEntity {
+    /**
+     * 关联id
+     */
+    private String infoId;
+
+    /**
+     * 报销人
+     */
+    private String userId;
+
+    /**
+     * 报销人名称
+     */
+    private String userName;
+
+    /**
+     * 报销部门
+     */
+    private String deptId;
+
+    /**
+     * 报销部门名称
+     */
+    private String deptName;
+
+    /**
+     * 报销类型
+     */
+    private String typeId;
+
+    /**
+     * 报销类型名称
+     */
+    private String typeName;
+
+    /**
+     * 报销项目
+     */
+    private String projectId;
+
+    /**
+     * 报销项目名称
+     */
+    private String projectName;
+
+    /**
+     * 报告号
+     */
+    private String reportNumber;
+
+    /**
+     * 费用(元)
+     */
+    private String number;
+
+    /**
+     * 收据张数
+     */
+    private Integer receiptNumber;
+
+    /**
+     * 出差天数
+     */
+    private Integer days;
+
+    /**
+     * 内容
+     */
+    private String content;
+}

+ 52 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/domain/JyReimbursementInfo.java

@@ -0,0 +1,52 @@
+package com.jeeplus.business.reimbursement.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 报销基本信息
+ */
+
+@Data
+@TableName("jy_reimbursement_info")
+public class JyReimbursementInfo extends BaseEntity {
+
+    /**
+     * 报销编号
+     */
+    private String no;
+
+    /**
+     * 报销类型
+     */
+    private String applyType;
+
+    /**
+     * 流程信息
+     */
+    private String procInsId;
+    private String processDefinitionId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    @TableField(exist = false)
+    private String createName;
+    @TableField(exist = false)
+    private String departmentName;
+    @TableField(exist = false)
+    private String department;
+    @TableField(exist = false)
+    private String userId;
+
+
+}

+ 9 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementAmountInfoMapper.java

@@ -0,0 +1,9 @@
+package com.jeeplus.business.reimbursement.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementAmountInfo;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface JyReimbursementAmountInfoMapper extends BaseMapper<JyReimbursementAmountInfo> {
+}

+ 13 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoBorrowMapper.java

@@ -0,0 +1,13 @@
+package com.jeeplus.business.reimbursement.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoBorrow;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoProject;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface JyReimbursementInfoBorrowMapper extends BaseMapper<JyReimbursementDetailInfoBorrow> {
+    List<JyReimbursementDetailInfoBorrow> getList();
+}

+ 40 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoMapper.java

@@ -0,0 +1,40 @@
+package com.jeeplus.business.reimbursement.mapper;
+
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+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.business.reimbursement.domain.*;
+import com.jeeplus.business.reimbursement.service.dto.JyReimbursementInfoDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface JyReimbursementInfoMapper extends BaseMapper<JyReimbursementInfo> {
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<JyReimbursementInfoDTO> findPageList(Page<JyReimbursementInfoDTO> page, @Param(Constants.WRAPPER) QueryWrapper<JyReimbursementInfoDTO> queryWrapper);
+
+    List<WorkAttachmentInfo> findList(@Param("id") String id);
+
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
+    @InterceptorIgnore(tenantLine = "true")
+    JyReimbursementInfo findById(@Param("id") String id);
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyReimbursementDetailInfoBorrow> getBorrowDetailList(@Param("id")String id);
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyReimbursementDetailInfoPayment> getPaymentDetailList(@Param("id")String id);
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyReimbursementDetailInfoOther> getOtherDetailList(@Param("id")String id);
+
+    List<WorkAttachmentInfo> findFiles(@Param("id") String id);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyReimbursementDetailInfoProject> getProjectDetailList(@Param("id")String id);
+
+    void updateStatusById(@Param("status") String status,@Param("id") String id);
+}

+ 10 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoOtherMapper.java

@@ -0,0 +1,10 @@
+package com.jeeplus.business.reimbursement.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoOther;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoProject;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface JyReimbursementInfoOtherMapper extends BaseMapper<JyReimbursementDetailInfoOther> {
+}

+ 14 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoPaymentMapper.java

@@ -0,0 +1,14 @@
+package com.jeeplus.business.reimbursement.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoBorrow;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoPayment;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoProject;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface JyReimbursementInfoPaymentMapper extends BaseMapper<JyReimbursementDetailInfoPayment> {
+    List<JyReimbursementDetailInfoPayment> getList();
+}

+ 16 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoProjectMapper.java

@@ -0,0 +1,16 @@
+package com.jeeplus.business.reimbursement.mapper;
+
+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.business.reimbursement.domain.JyReimbursementDetailInfoProject;
+import com.jeeplus.business.reimbursement.domain.JyReimbursementInfo;
+import com.jeeplus.business.reimbursement.service.dto.JyReimbursementInfoDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface JyReimbursementInfoProjectMapper extends BaseMapper<JyReimbursementDetailInfoProject> {
+}

+ 23 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/xml/JyReimbursementInfoBorrowMapper.xml

@@ -0,0 +1,23 @@
+<?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.business.reimbursement.mapper.JyReimbursementInfoBorrowMapper">
+    <select id="getList" resultType="com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoBorrow">
+        select
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.del_flag,
+            a.info_id,
+            a.user_id,
+            a.dept_id,
+            a.type_id,
+            a.project_id,
+            a.report_number,
+            a.number,
+            a.money_lower
+        from jy_reimbursement_detail_info_borrow a
+    </select>
+
+
+
+</mapper>

+ 252 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/xml/JyReimbursementInfoMapper.xml

@@ -0,0 +1,252 @@
+<?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.business.reimbursement.mapper.JyReimbursementInfoMapper">
+
+    <select id="findPageList"
+            resultType="com.jeeplus.business.reimbursement.service.dto.JyReimbursementInfoDTO">
+        SELECT
+		DISTINCT a.id,
+			a.`no`,
+			(CASE
+			WHEN a.apply_type = 1 THEN b.type_id
+			WHEN a.apply_type = 2 THEN b2.type_id
+			WHEN a.apply_type = 3 THEN b3.type_id
+									ELSE b4.type_id END) AS type_id,
+			(CASE
+			WHEN a.apply_type = 1 THEN t.name
+			WHEN a.apply_type = 2 THEN t2.name
+			WHEN a.apply_type = 3 THEN t3.name
+									ELSE t4.name END) AS type_name,
+			(CASE
+			WHEN a.apply_type = 1 THEN b.project_id
+			WHEN a.apply_type = 2 THEN b2.project_id
+			WHEN a.apply_type = 3 THEN b3.project_id
+									ELSE b4.project_id END) AS project_id,
+			(CASE
+			WHEN a.apply_type = 1 THEN b.project_name
+			WHEN a.apply_type = 2 THEN b2.project_name
+			WHEN a.apply_type = 3 THEN b3.project_name
+									ELSE b4.project_name END) AS project_name,
+			(CASE
+			WHEN a.apply_type = 1 THEN b.report_number
+			WHEN a.apply_type = 2 THEN b2.report_number
+			WHEN a.apply_type = 3 THEN b3.report_number
+									ELSE b4.report_number END) AS report_number,
+			(CASE
+			WHEN a.apply_type = 1 THEN so.name
+			WHEN a.apply_type = 2 THEN so2.name
+			WHEN a.apply_type = 3 THEN so3.name
+									ELSE so4.name END) AS dept_name,
+			(CASE
+			WHEN a.apply_type = 1 THEN us.name
+			WHEN a.apply_type = 2 THEN us2.name
+			WHEN a.apply_type = 3 THEN us3.name
+									ELSE us4.name END) AS name,
+			(CASE
+			WHEN a.apply_type = 1 THEN b.`number`
+			WHEN a.apply_type = 2 THEN b2.`number`
+			WHEN a.apply_type = 3 THEN b3.`number`
+									ELSE b4.`number` END) AS `number`,
+			c.name as createName,
+			o.name as officeName,
+			a.create_time,
+			a.status,
+			a.proc_ins_id,
+			a.process_definition_id,
+			d.ID_ AS task_id,
+			a.create_by_id as createById,
+			a.apply_type
+		FROM
+			jy_reimbursement_info a
+
+			LEFT JOIN jy_reimbursement_detail_info_borrow b ON a.id = b.info_id AND b.del_flag = 0
+			left join jy_reimbursement_type_info t on b.type_id = t.id and t.del_flag = 0
+			left join jy_borrow_money p on p.id = b.project_id and p.del_flag = 0
+			left join sys_office so on so.id = b.dept_id and so.del_flag = 0
+			left join sys_user us on us.id = b.user_id and us.del_flag = 0
+
+			LEFT JOIN jy_reimbursement_detail_info_payment b2 ON a.id = b2.info_id AND b2.del_flag = 0
+			left join jy_reimbursement_type_info t2 on b2.type_id = t2.id and t2.del_flag = 0
+			left join jy_payment p2 on p2.id = b2.project_id and p2.del_flag = 0
+			left join sys_office so2 on so2.id = b2.dept_id and so2.del_flag = 0
+			left join sys_user us2 on us2.id = b2.user_id and us2.del_flag = 0
+
+			LEFT JOIN jy_reimbursement_detail_info_other b3 ON a.id = b3.info_id AND b3.del_flag = 0
+			left join jy_reimbursement_type_info t3 on b3.type_id = t3.id and t3.del_flag = 0
+			left join jy_project_record p3 on p3.id = b3.project_id and p3.del_flag = 0
+			left join sys_office so3 on so3.id = b3.dept_id and so3.del_flag = 0
+			left join sys_user us3 on us3.id = b3.user_id and us3.del_flag = 0
+
+			LEFT JOIN jy_reimbursement_detail_info_project b4 ON a.id = b4.info_id AND b4.del_flag = 0
+			left join jy_reimbursement_type_info t4 on b4.type_id = t4.id and t4.del_flag = 0
+			left join jy_project_record p4 on p4.id = b4.project_id and p4.del_flag = 0
+			left join sys_office so4 on so4.id = b4.dept_id and so4.del_flag = 0
+			left join sys_user us4 on us4.id = b4.user_id and us4.del_flag = 0
+
+			LEFT JOIN sys_user c ON a.create_by_id =  c.id
+			left join sys_office o on o.id = c.office_id and o.del_flag = 0
+			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+			${ew.customSqlSegment}
+		ORDER BY a.update_time DESC
+    </select>
+
+	<select id="findList" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+        SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+    </select>
+	<select id="findIsExit" resultType="java.lang.Integer">
+        SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+			AND attachment_name = #{name}
+    </select>
+
+	<select id="findById" resultType="com.jeeplus.business.reimbursement.domain.JyReimbursementInfo">
+		select
+			a.id,
+			a.no,
+			a.apply_type,
+			a.proc_ins_id,
+			a.process_definition_id,
+			a.remarks,
+			a.create_time,
+			a.status,
+			c.id as userId,
+			c.name as createName,
+			o.id as department,
+			o.name as departmentName
+		from jy_reimbursement_info a
+		LEFT JOIN sys_user c ON a.create_by_id = c.id
+		left join sys_office o on o.id = c.office_id and o.del_flag = 0
+		where a.id = #{id}
+	</select>
+
+	<select id="findFiles" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by_id AS `by`,
+			create_time
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+	</select>
+
+	<select id="getOtherDetailList" resultType="com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoOther">
+		select
+		a.id,
+		a.create_by_id,
+		a.create_time,
+		a.del_flag,
+		a.info_id,
+		a.user_id,
+		a.dept_id,
+		a.type_id,
+		a.project_id,
+		a.report_number,
+		a.number,
+		su.name as user_name,
+		so.name as dept_name,
+		jy_type.name as type_name,
+		a.project_name as project_name
+		from jy_reimbursement_detail_info_other a
+		left join sys_user su on a.user_id = su.id and su.del_flag = '0'
+		left join sys_office so on a.dept_id = so.id and so.del_flag = '0'
+		left join jy_reimbursement_type_info jy_type on jy_type.id = a.type_id and jy_type.del_flag = '0'
+		where a.del_flag = '0' and a.info_id = #{id}
+		order by a.number asc
+	</select>
+
+	<select id="getBorrowDetailList" resultType="com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoBorrow">
+		select
+		a.id,
+		a.create_by_id,
+		a.create_time,
+		a.del_flag,
+		a.info_id,
+		a.user_id,
+		a.dept_id,
+		a.type_id,
+		a.project_id,
+		a.report_number,
+		a.number,
+		a.money_lower,
+		su.name as user_name,
+		so.name as dept_name,
+		jy_type.name as type_name,
+		a.project_name as project_name
+		from jy_reimbursement_detail_info_borrow a
+		left join sys_user su on a.user_id = su.id and su.del_flag = '0'
+		left join sys_office so on a.dept_id = so.id and so.del_flag = '0'
+		left join jy_reimbursement_type_info jy_type on jy_type.id = a.type_id and jy_type.del_flag = '0'
+		left join jy_borrow_money bm on a.project_id = bm.id and bm.del_flag = '0'
+		where a.del_flag = '0' and a.info_id = #{id}
+		order by a.number asc
+	</select>
+
+	<select id="getPaymentDetailList" resultType="com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoPayment">
+		select
+		a.id,
+		a.create_by_id,
+		a.create_time,
+		a.del_flag,
+		a.info_id,
+		a.user_id,
+		a.dept_id,
+		a.type_id,
+		a.project_id,
+		a.report_number,
+		a.number,
+		a.payment_lower,
+		su.name as user_name,
+		so.name as dept_name,
+		jy_type.name as type_name,
+		a.project_name as project_name
+		from jy_reimbursement_detail_info_payment a
+		left join sys_user su on a.user_id = su.id and su.del_flag = '0'
+		left join sys_office so on a.dept_id = so.id and so.del_flag = '0'
+		left join jy_reimbursement_type_info jy_type on jy_type.id = a.type_id and jy_type.del_flag = '0'
+		left join jy_payment jp on a.project_id = jp.id and jp.del_flag = '0'
+		where a.del_flag = '0' and a.info_id = #{id}
+		order by a.number asc
+	</select>
+
+	<select id="getProjectDetailList" resultType="com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoProject">
+		select
+		a.id,
+		a.create_by_id,
+		a.create_time,
+		a.del_flag,
+		a.info_id,
+		a.user_id,
+		a.dept_id,
+		a.type_id,
+		a.project_id,
+		a.report_number,
+		a.number,
+		su.name as user_name,
+		so.name as dept_name,
+		jy_type.name as type_name,
+		pr.name as project_name
+		from jy_reimbursement_detail_info_project a
+		left join sys_user su on a.user_id = su.id and su.del_flag = '0'
+		left join sys_office so on a.dept_id = so.id and so.del_flag = '0'
+		left join jy_reimbursement_type_info jy_type on jy_type.id = a.type_id and jy_type.del_flag = '0'
+		left join jy_project_record pr on a.project_id = pr.id and pr.del_flag = '0'
+		where a.del_flag = '0' and a.info_id = #{id}
+		order by a.number asc
+	</select>
+
+	<update id="updateStatusById">
+		UPDATE jy_reimbursement_info SET status = #{status}
+		WHERE id = #{id}
+	</update>
+
+
+</mapper>

+ 20 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/xml/JyReimbursementInfoPaymentMapper.xml

@@ -0,0 +1,20 @@
+<?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.business.reimbursement.mapper.JyReimbursementInfoPaymentMapper">
+    <select id="getList" resultType="com.jeeplus.business.reimbursement.domain.JyReimbursementDetailInfoPayment">
+    select
+    a.id,
+    a.create_by_id,
+    a.create_time,
+    a.del_flag,
+    a.info_id,
+    a.user_id,
+    a.dept_id,
+    a.type_id,
+    a.project_id,
+    a.report_number,
+    a.number,
+    a.payment_lower
+    from jy_reimbursement_detail_info_payment a
+    </select>
+</mapper>

+ 549 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/service/JyReimbursementInfoService.java

@@ -0,0 +1,549 @@
+package com.jeeplus.business.reimbursement.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.project.mapper.JyProjectMapper;
+import com.jeeplus.business.project.service.JyProjectService;
+import com.jeeplus.business.project.service.dto.JyProjectDTO;
+import com.jeeplus.business.reimbursement.domain.*;
+import com.jeeplus.business.reimbursement.mapper.*;
+import com.jeeplus.business.reimbursement.service.dto.JyReimbursementInfoDTO;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IOfficeApi;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.service.dto.OfficeDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class JyReimbursementInfoService {
+    @Resource
+    private JyReimbursementInfoMapper jyReimbursementInfoMapper;
+
+    @Resource
+    private JyProjectService jyProjectService;
+
+    @Resource
+    private JyReimbursementInfoPaymentMapper jyReimbursementInfoPaymentMapper;
+
+    @Resource
+    private JyReimbursementInfoProjectMapper jyReimbursementInfoProjectMapper;
+
+    @Resource
+    private JyReimbursementInfoBorrowMapper jyReimbursementInfoBorrowMapper;
+
+    @Resource
+    private JyReimbursementInfoOtherMapper jyReimbursementInfoOtherMapper;
+
+    @Resource
+    private JyReimbursementAmountInfoMapper jyReimbursementAmountInfoMapper;
+
+    @Resource
+    private JyProjectMapper jyProjectMapper;
+
+
+    /**
+     * 列表查询
+     * @param page
+     * @param dto
+     * @return
+     */
+    public IPage<JyReimbursementInfoDTO> list(Page<JyReimbursementInfoDTO> page, JyReimbursementInfoDTO dto) throws Exception {
+        QueryWrapper<JyReimbursementInfoDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(dto, JyReimbursementInfoDTO.class);
+        queryWrapper.eq("a.del_flag", 0);
+        // 报销时间
+        if (dto.getDates() != null) {
+            queryWrapper.between("a.create_time", dto.getDates()[0], dto.getDates()[1]);
+        }
+        // 经办人
+        if (StringUtils.isNotEmpty(dto.getHandled())) {
+            queryWrapper.apply("(a.create_by_id = {0} OR c.name LIKE {1})", dto.getHandled(), "%" + dto.getHandled() + "%");
+        }
+        // 报销人
+        if (StringUtils.isNotEmpty(dto.getReimBy())) {
+            queryWrapper.apply("( b.user_id = {0} OR us.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b2.user_id = {0} OR us2.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b3.user_id = {0} OR us3.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b4.user_id = {0} OR us4.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+        }
+        // 报销状态
+        if (StringUtils.isNotEmpty(dto.getStatus())) {
+            queryWrapper.eq("a.status", dto.getStatus());
+        }
+        // 报销部门
+        if (StringUtils.isNotEmpty(dto.getDepartment())) {
+            queryWrapper.apply("( b.dept_id = {0} OR so.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b2.dept_id = {0} OR so2.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b3.dept_id = {0} OR so3.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b4.dept_id = {0} OR so4.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+
+        }
+        // 报销类别
+        if (StringUtils.isNotEmpty(dto.getRemiType())) {
+            queryWrapper.apply(" (b.type_id = {0} OR t.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b2.type_id = {0} OR t2.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b3.type_id = {0} OR t3.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b4.type_id = {0} OR t4.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+
+        }
+        // 报销金额
+        if (dto.getAmounts() != null) {
+            if (StringUtils.isNotEmpty(dto.getAmounts()[0])) {
+                queryWrapper.and(w ->
+                        w.ge("b.number", Double.parseDouble(dto.getAmounts()[0]))
+                                .or().ge("b2.number", Double.parseDouble(dto.getAmounts()[0]))
+                                .or().ge("b3.number", Double.parseDouble(dto.getAmounts()[0]))
+                                .or().ge("b4.number", Double.parseDouble(dto.getAmounts()[0]))
+                );
+            }
+            if (dto.getAmounts().length>1 && StringUtils.isNotEmpty(dto.getAmounts()[1])) {
+                queryWrapper.and(w ->
+                        w.le("b.number", Double.parseDouble(dto.getAmounts()[1]))
+                                .or().le("b2.number", Double.parseDouble(dto.getAmounts()[1]))
+                                .or().le("b3.number", Double.parseDouble(dto.getAmounts()[1]))
+                                .or().le("b4.number", Double.parseDouble(dto.getAmounts()[1]))
+                );
+            }
+        }
+        // 报销类型
+        if (StringUtils.isNotBlank(dto.getApplyType())) {
+            queryWrapper.eq("a.apply_type", dto.getApplyType());
+        }
+        IPage<JyReimbursementInfoDTO> list = jyReimbursementInfoMapper.findPageList(page, queryWrapper);
+        list.getRecords().stream().forEach(item -> {
+            if (StringUtils.isNotBlank(item.getApplyType()) && "4".equals(item.getApplyType())) { //项目报销
+                if (StringUtils.isNotBlank(item.getProjectId())) {
+                    String proName = selectProjectByIds(item.getProjectId());
+                    item.setProjectName(proName);
+                }
+            }
+        });
+        return list;
+
+    }
+
+    /**
+     * 根据项目id查询项目名称
+     * @param ids 以逗号分隔的多个项目id字符串
+     * @return
+     */
+    public String selectProjectByIds(String ids) {
+        String projectName = "";
+        String[] split = ids.split(",");
+        List<String> idList = Arrays.asList(split);
+        List<JyProject> list = jyProjectService.getListByIds(idList);
+        if (CollectionUtil.isNotEmpty(list)) {
+            projectName = list.stream().map(JyProject::getName).collect(Collectors.joining(","));
+        }
+        return projectName;
+    }
+
+
+    /**
+     * 新增/修改
+     * @param dto
+     * @return
+     */
+    public String save(JyReimbursementInfoDTO dto) throws Exception {
+        // 获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        if (StringUtils.isNotEmpty(dto.getId())) {
+            return update(dto, userDTO);
+        } else {
+            return add(dto, userDTO);
+        }
+    }
+
+    public String add(JyReimbursementInfoDTO dto, UserDTO userDTO) throws Exception{
+        // 生成id
+        String id = UUID.randomUUID().toString().replace("-", "");
+        // 生成编号
+        String no = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), dto.BIZ_CODE, TokenProvider.getCurrentToken());
+        // 保存基础信息表信息
+        JyReimbursementInfo jyReimbursementInfo = new JyReimbursementInfo();
+        BeanUtils.copyProperties(dto, jyReimbursementInfo);
+        jyReimbursementInfo.setId(id);
+        jyReimbursementInfo.setNo(no);
+        jyReimbursementInfo.setCreateById(userDTO.getId());
+        jyReimbursementInfo.setCreateTime(new Date());
+        jyReimbursementInfo.setUpdateById(userDTO.getId());
+        jyReimbursementInfo.setUpdateTime(new Date());
+        jyReimbursementInfo.setDelFlag(0);
+        jyReimbursementInfoMapper.insert(jyReimbursementInfo);
+        // 保存项目详情列表信息
+        if (CollectionUtils.isNotEmpty(dto.getInfoProjects())) {
+            for (JyReimbursementDetailInfoProject detailInfo : dto.getInfoProjects()) {
+                // 保存基础表信息主键值
+                String pid = UUID.randomUUID().toString().replace("-", "");
+                detailInfo.setId(pid);
+                detailInfo.setInfoId(id);
+                jyReimbursementInfoProjectMapper.insert(detailInfo);
+            }
+        }
+        // 保存借款详情列表信息
+        if (CollectionUtils.isNotEmpty(dto.getInfoborrows())) {
+            for (JyReimbursementDetailInfoBorrow detailInfo : dto.getInfoborrows()) {
+                // 保存基础表信息主键值
+                String pid = UUID.randomUUID().toString().replace("-", "");
+                detailInfo.setId(pid);
+                detailInfo.setInfoId(id);
+                jyReimbursementInfoBorrowMapper.insert(detailInfo);
+            }
+        }
+        // 保存付款详情列表信息
+        if (CollectionUtils.isNotEmpty(dto.getInfoPayments())) {
+            for (JyReimbursementDetailInfoPayment detailInfo : dto.getInfoPayments()) {
+                // 保存基础表信息主键值
+                String pid = UUID.randomUUID().toString().replace("-", "");
+                detailInfo.setId(pid);
+                detailInfo.setInfoId(id);
+                jyReimbursementInfoPaymentMapper.insert(detailInfo);
+            }
+        }
+        // 保存其他报销详情列表信息
+        if (CollectionUtils.isNotEmpty(dto.getInfoOthers())) {
+            for (JyReimbursementDetailInfoOther detailInfo : dto.getInfoOthers()) {
+                // 保存基础表信息主键值
+                String pid = UUID.randomUUID().toString().replace("-", "");
+                detailInfo.setId(pid);
+                detailInfo.setInfoId(id);
+                jyReimbursementInfoOtherMapper.insert(detailInfo);
+            }
+        }
+        // 保存专用发票列表信息
+        if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
+            for (JyReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
+                // 生成id
+                String amountId = UUID.randomUUID().toString().replace("-", "");
+                amountInfo.setId(amountId);
+                amountInfo.setCreateById(userDTO.getId());
+                amountInfo.setCreateTime(new Date());
+                amountInfo.setUpdateById(userDTO.getId());
+                amountInfo.setUpdateTime(new Date());
+                amountInfo.setDelFlag(0);
+                // 保存基础表信息主键值
+                amountInfo.setInfoId(id);
+                jyReimbursementAmountInfoMapper.insert(amountInfo);
+            }
+        }
+        // 保存附件列表信息
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            saveFiles(dto.getFiles(), userDTO, id);
+        }
+        return id;
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentInfo dto : list) {
+            WorkAttachmentInfo i = new WorkAttachmentInfo();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateTime(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateTime(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("jyReimbursement");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+//            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            Map<String,String> map = new HashMap<>();
+            String workAttachment = JSON.toJSONString((i));
+            String userDTOInfo = JSON.toJSONString((userDTO));
+            map.put("workAttachment",workAttachment);
+            map.put("userDTO",userDTOInfo);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+            j++;
+        }
+    }
+
+    public String update(JyReimbursementInfoDTO dto, UserDTO userDTO) {
+        // 修改基础信息
+        JyReimbursementInfo info = new JyReimbursementInfo();
+        BeanUtils.copyProperties(dto, info);
+        info.setUpdateById(userDTO.getId());
+        info.setUpdateTime(new Date());
+        jyReimbursementInfoMapper.updateById(info);
+        // 修改报销详情列表信息
+        // 删除原有数据
+        LambdaQueryWrapper<JyReimbursementDetailInfoProject> detailWrapper = new LambdaQueryWrapper<>();
+        detailWrapper.eq(JyReimbursementDetailInfoProject::getInfoId, dto.getId());
+        jyReimbursementInfoProjectMapper.delete(detailWrapper);
+        // 删除借款列表
+        LambdaQueryWrapper<JyReimbursementDetailInfoBorrow> detailWrapperContract = new LambdaQueryWrapper<>();
+        detailWrapperContract.eq(JyReimbursementDetailInfoBorrow::getInfoId, dto.getId());
+        jyReimbursementInfoBorrowMapper.delete(detailWrapperContract);
+        // 删除付款列表
+        LambdaQueryWrapper<JyReimbursementDetailInfoPayment> detailWrapperReport = new LambdaQueryWrapper<>();
+        detailWrapperReport.eq(JyReimbursementDetailInfoPayment::getInfoId, dto.getId());
+        jyReimbursementInfoPaymentMapper.delete(detailWrapperReport);
+        // 删除其他报销表
+        LambdaQueryWrapper<JyReimbursementDetailInfoOther> detailWrapperOthers = new LambdaQueryWrapper<>();
+        detailWrapperOthers.eq(JyReimbursementDetailInfoOther::getInfoId, dto.getId());
+        jyReimbursementInfoOtherMapper.delete(detailWrapperOthers);
+
+        // 保存项目详情列表信息
+        if (CollectionUtils.isNotEmpty(dto.getInfoProjects())) {
+            for (JyReimbursementDetailInfoProject detailInfo : dto.getInfoProjects()) {
+                // 保存基础表信息主键值
+                String id = UUID.randomUUID().toString().replace("-", "");
+                detailInfo.setId(id);
+                detailInfo.setInfoId(dto.getId());
+                jyReimbursementInfoProjectMapper.insert(detailInfo);
+            }
+        }
+        // 保存借款详情列表信息
+        if (CollectionUtils.isNotEmpty(dto.getInfoborrows())) {
+            for (JyReimbursementDetailInfoBorrow detailInfo : dto.getInfoborrows()) {
+                // 保存基础表信息主键值
+                String id = UUID.randomUUID().toString().replace("-", "");
+                detailInfo.setId(id);
+                detailInfo.setInfoId(dto.getId());
+                jyReimbursementInfoBorrowMapper.insert(detailInfo);
+            }
+        }
+        // 保存付款详情列表信息
+        if (CollectionUtils.isNotEmpty(dto.getInfoPayments())) {
+            for (JyReimbursementDetailInfoPayment detailInfo : dto.getInfoPayments()) {
+                // 保存基础表信息主键值
+                String id = UUID.randomUUID().toString().replace("-", "");
+                detailInfo.setId(id);
+                detailInfo.setInfoId(dto.getId());
+                jyReimbursementInfoPaymentMapper.insert(detailInfo);
+            }
+        }
+        // 保存其他报销详情列表信息
+        if (CollectionUtils.isNotEmpty(dto.getInfoOthers())) {
+            for (JyReimbursementDetailInfoOther detailInfo : dto.getInfoOthers()) {
+                // 保存基础表信息主键值
+                String id = UUID.randomUUID().toString().replace("-", "");
+                detailInfo.setId(id);
+                detailInfo.setInfoId(dto.getId());
+                jyReimbursementInfoOtherMapper.insert(detailInfo);
+            }
+        }
+
+        // 修改专用发票信息列表
+        // 删除原有数据
+        LambdaQueryWrapper<JyReimbursementAmountInfo> amountWrapper = new LambdaQueryWrapper<>();
+        amountWrapper.eq(JyReimbursementAmountInfo::getInfoId, dto.getId());
+        jyReimbursementAmountInfoMapper.delete(amountWrapper);
+        if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
+            for (JyReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
+                // 生成id
+                String amountId = UUID.randomUUID().toString().replace("-", "");
+                amountInfo.setId(amountId);
+                amountInfo.setCreateById(userDTO.getId());
+                amountInfo.setCreateTime(new Date());
+                amountInfo.setUpdateById(userDTO.getId());
+                amountInfo.setUpdateTime(new Date());
+                amountInfo.setDelFlag(0);
+                // 保存基础表信息主键值
+                amountInfo.setInfoId(dto.getId());
+                jyReimbursementAmountInfoMapper.insert(amountInfo);
+            }
+        }
+        // 修改附件信息列表
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            updateFiles(dto.getFiles(), userDTO, dto.getId());
+        }
+        return dto.getId();
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentInfo dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachmentInfo> infoList = jyReimbursementInfoMapper.findList(id);
+        if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+//                    ossServiceMapper.deleteById(i.getId());
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = jyReimbursementInfoMapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachmentInfo i = new WorkAttachmentInfo();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateTime(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateTime(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("jyReimbursement");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                Map<String,String> map = new HashMap<>();
+                String workAttachment = JSON.toJSONString((i));
+                String userDTOInfo = JSON.toJSONString((userDTO));
+                map.put("workAttachment",workAttachment);
+                map.put("userDTO",userDTOInfo);
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+//                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    public String remove(String id) {
+        //删除基本信息
+        jyReimbursementInfoMapper.deleteById(id);
+        // 修改报销详情列表信息
+        // 删除原有数据
+        LambdaQueryWrapper<JyReimbursementDetailInfoProject> detailWrapper = new LambdaQueryWrapper<>();
+        detailWrapper.eq(JyReimbursementDetailInfoProject::getInfoId,id);
+        jyReimbursementInfoProjectMapper.delete(detailWrapper);
+        // 删除借款列表
+        LambdaQueryWrapper<JyReimbursementDetailInfoBorrow> detailWrapperContract = new LambdaQueryWrapper<>();
+        detailWrapperContract.eq(JyReimbursementDetailInfoBorrow::getInfoId, id);
+        jyReimbursementInfoBorrowMapper.delete(detailWrapperContract);
+        // 删除付款列表
+        LambdaQueryWrapper<JyReimbursementDetailInfoPayment> detailWrapperReport = new LambdaQueryWrapper<>();
+        detailWrapperReport.eq(JyReimbursementDetailInfoPayment::getInfoId,id);
+        jyReimbursementInfoPaymentMapper.delete(detailWrapperReport);
+        // 删除其他报销表
+        LambdaQueryWrapper<JyReimbursementDetailInfoOther> detailWrapperOthers = new LambdaQueryWrapper<>();
+        detailWrapperOthers.eq(JyReimbursementDetailInfoOther::getInfoId, id);
+        jyReimbursementInfoOtherMapper.delete(detailWrapperOthers);
+        // 修改专用发票信息列表
+        // 删除原有数据
+        LambdaQueryWrapper<JyReimbursementAmountInfo> amountWrapper = new LambdaQueryWrapper<>();
+        amountWrapper.eq(JyReimbursementAmountInfo::getInfoId, id);
+        jyReimbursementAmountInfoMapper.delete(amountWrapper);
+        SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(id);
+        return "操作成功";
+    }
+
+    public JyReimbursementInfoDTO findById(String id) {
+        JyReimbursementInfoDTO jyReimbursementInfoDTO = new JyReimbursementInfoDTO();
+        // 查询基础信息表
+        JyReimbursementInfo info = jyReimbursementInfoMapper.findById(id);
+            // 项目报销详情
+            List<JyReimbursementDetailInfoProject> detailList = jyReimbursementInfoMapper.getProjectDetailList(id);
+            detailList.stream().forEach(projectDetail -> {
+                if (StringUtils.isNotBlank(projectDetail.getProjectId())) {
+                    String proName = selectProjectByIds(projectDetail.getProjectId());
+                    projectDetail.setProjectName(proName);
+                } else {
+                    projectDetail.setProjectName("");
+                }
+            });
+        jyReimbursementInfoDTO.setInfoProjects(detailList);
+            // 借款报销详情
+        jyReimbursementInfoDTO.setInfoborrows(jyReimbursementInfoMapper.getBorrowDetailList(id));
+            // 付款报销详情
+        jyReimbursementInfoDTO.setInfoPayments(jyReimbursementInfoMapper.getPaymentDetailList(id));
+            // 其他报销
+        jyReimbursementInfoDTO.setInfoOthers(jyReimbursementInfoMapper.getOtherDetailList(id));
+            // 查询专用发票信息列表
+            LambdaQueryWrapper<JyReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            amountInfoLambdaQueryWrapper.eq(JyReimbursementAmountInfo::getInfoId, id);
+            List<JyReimbursementAmountInfo> amountInfos = jyReimbursementAmountInfoMapper.selectList(amountInfoLambdaQueryWrapper);
+        jyReimbursementInfoDTO.setAmountInfos(amountInfos);
+            // 查询附件信息
+            List<WorkAttachmentInfo> files = jyReimbursementInfoMapper.findFiles(id);
+            if (CollectionUtils.isNotEmpty(files)) {
+                for (WorkAttachmentInfo i : files) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+            }
+        jyReimbursementInfoDTO.setFiles(files);
+            if (ObjectUtils.isNotEmpty(info)){
+                jyReimbursementInfoDTO.setApplyType(info.getApplyType());
+                jyReimbursementInfoDTO.setRemarks(info.getRemarks());
+                jyReimbursementInfoDTO.setUserId(info.getUserId());
+                jyReimbursementInfoDTO.setCreateName(info.getCreateName());
+                jyReimbursementInfoDTO.setDepartment(info.getDepartment());
+                jyReimbursementInfoDTO.setDepartmentName(info.getDepartmentName());
+                jyReimbursementInfoDTO.setCreateTime(info.getCreateTime());
+                jyReimbursementInfoDTO.setNo(info.getNo());
+                jyReimbursementInfoDTO.setId(info.getId());
+                jyReimbursementInfoDTO.setStatus(info.getStatus());
+                jyReimbursementInfoDTO.setProcInsId(info.getProcInsId());
+            }
+
+        return jyReimbursementInfoDTO;
+    }
+
+
+    public void updateStatusById(JyReimbursementInfoDTO dto) {
+        jyReimbursementInfoMapper.updateStatusById(dto.getStatus(),dto.getId());
+    }
+
+
+    public List<JyProjectDTO> queryByProIds(String ids) {
+        String[] split = ids.split(",");
+        ArrayList<JyProjectDTO> projects = new ArrayList<>();
+        for (String s : split) {
+            JyProjectDTO byId = jyProjectService.findById(s);
+            projects.add(byId);
+        }
+        return projects;
+    }
+}

+ 205 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/service/dto/JyReimbursementInfoDTO.java

@@ -0,0 +1,205 @@
+package com.jeeplus.business.reimbursement.service.dto;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.business.reimbursement.domain.*;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class JyReimbursementInfoDTO extends BaseEntity {
+
+    //报销编号(字典值)
+    public static final String BIZ_CODE = "40";
+
+    /**
+     * 基础表主键值
+     */
+    private String id;
+
+    /**
+     * 报销编号
+     */
+
+    private String no;
+
+    /**
+     * 报销类别id
+     */
+    private String typeId;
+
+    /**
+     * 报销类别
+     */
+
+    private String typeName;
+
+    /**
+     * 报销项目id
+     */
+    private String projectId;
+
+    /**
+     * 报销项目
+     */
+
+    private String projectName;
+
+
+    /**
+     * 报告号
+     */
+
+    private String reportNumber;
+
+    /**
+     * 经办人
+     */
+
+    private String createName;
+
+    /**
+     * 报销人
+     */
+
+    private String name;
+
+    /**
+     * 报销部门
+     */
+
+    private String deptName;
+
+    /**
+     * 报销日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date createTime;
+
+    /**
+     * 报销金额
+     */
+
+    private BigDecimal number;
+
+    /**
+     * 报销状态
+     */
+
+    private String status;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     *
+     */
+    private String processDefinitionId;
+
+    private String taskId;
+
+    //报销类型
+    private String applyType;
+
+    /**
+     * 创建人id
+     */
+    private String createById;
+
+    private List<WorkAttachmentInfo> files;
+
+    /**
+     * 数据审核人  报销
+     */
+    private List<String> auditUserIds;
+
+
+    /**
+     * 报销项目
+     */
+    private String project;
+
+    /**
+     * 报销时间
+     */
+    private String[] dates;
+
+    /**
+     * 经办人
+     */
+    private String handled;
+
+    /**
+     * 报销人
+     */
+    private String reimBy;
+
+    /**
+     * 报销状态
+     */
+    private String type;
+
+    /**
+     * 报销部门
+     */
+    private String department;
+
+    /**
+     * 报销类别
+     */
+    private String remiType;
+
+    /**
+     * 报销金额
+     */
+    private String[] amounts;
+
+
+    private List<JyReimbursementAmountInfo> amountInfos;
+
+    private List<JyReimbursementDetailInfoBorrow> infoborrows;
+    private List<JyReimbursementDetailInfoOther> infoOthers;
+    private List<JyReimbursementDetailInfoPayment> infoPayments;
+    private List<JyReimbursementDetailInfoProject> infoProjects;
+
+
+    /**
+     * 收据张数
+     */
+    private Integer receiptNumber;
+
+    /**
+     * 出差天数
+     */
+    private Integer days;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    //备注
+    private String remarks;
+
+    /**
+     * 借款金额
+     */
+    private Integer moneyLower;
+
+    /**
+     * 付款金额
+     */
+    private Integer paymentLower;
+
+    private String userId;
+    private String departmentName;
+
+
+}

+ 102 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/modules/flowable/listener/ApplyListener.java

@@ -0,0 +1,102 @@
+package com.jeeplus.modules.flowable.listener;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.jeeplus.extension.domain.FlowCopy;
+import com.jeeplus.extension.service.FlowCopyService;
+import com.jeeplus.flowable.model.ActRuTaskInfo;
+import com.jeeplus.flowable.model.Flow;
+import com.jeeplus.flowable.service.FlowTaskService;
+import com.jeeplus.flowable.service.MyNoticeService;
+import com.jeeplus.sys.feign.IPostApi;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.PostDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.SneakyThrows;
+import org.flowable.engine.RuntimeService;
+import org.flowable.engine.delegate.DelegateExecution;
+import org.flowable.engine.delegate.ExecutionListener;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+@Component("ApplyListener")
+public class ApplyListener implements ExecutionListener {
+    @SneakyThrows
+    public void notify(DelegateExecution delegateExecution) {
+        String eventName = delegateExecution.getEventName ( );
+        System.out.println("--------- delegateExecution -----------" + delegateExecution);
+
+        if ( "start".equals ( eventName ) ) {
+            System.out.println ( "start=========" );
+        } else if ( "end".equals ( eventName ) ) {
+            //根据这里的 delegateExecution的id去act_ru_task表中查该流程的数据 对应表中的EXECUTION_ID_
+            ActRuTaskInfo task = SpringUtil.getBean(MyNoticeService.class).getTaskInfoByID(delegateExecution.getId());
+
+            if (null != task) {
+                List<Flow> flows = SpringUtil.getBean(FlowTaskService.class).historicTaskList(task.getProcInstId());
+                //根据PROC_DEF_ID_去act_re_deployment中查询流程的名称
+                String substring = task.getProcDefId().substring(0, task.getProcDefId().indexOf(":"));
+                String actName = SpringUtil.getBean(FlowTaskService.class).getActNameByDefId(substring);
+
+                String titleName = "";
+                // 根据流程定义ID查询流程实例
+                ProcessInstance processInstance = SpringUtil.getBean(RuntimeService.class).createProcessInstanceQuery()
+                        .processInstanceId(task.getProcInstId())
+                        .singleResult();
+
+                if (processInstance != null) {
+                    // 获取流程实例标题变量名(假设标题存储在名为"title"的变量中)
+                    String titleVariableName = "title";
+
+                    // 查询流程实例的标题变量
+                    Object title = SpringUtil.getBean(RuntimeService.class).getVariable(processInstance.getId(), titleVariableName);
+
+                    if (title != null) {
+                        titleName = title.toString();
+                    } else {
+                        // 如果标题变量不存在或者没有值,可以返回默认标题
+                        titleName = "";
+                    }
+                }
+                Flow flow = new Flow();
+                for (int i=0;i<flows.size();i++){
+                    if (flows.get(i).getComment().getMessage().equals("发起流程")){
+                        flow = flows.get(i);
+                    }
+                }
+
+                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+                UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(flow.getAssigneeId());
+                //获取到岗位为财务和出纳的人员信息
+                ArrayList<UserDTO> userDTOS = new ArrayList<>();
+
+
+                PostDTO postDTOByName1 = SpringUtil.getBean(IPostApi.class).getPostDTOByName("出纳");
+                List<UserDTO> listByPostId1 = SpringUtil.getBean(IUserApi.class).findListByPostId(postDTOByName1.getId());
+                userDTOS.addAll(listByPostId1);
+                String finalTitleName = titleName;
+                userDTOS.stream().forEach(item->{
+                    FlowCopy flowCopy = new FlowCopy();
+                    flowCopy.setProcDefId(task.getProcDefId());
+//                        flowCopy.setProcDefId(task.getProcDefId());
+                    flowCopy.setProcInsName(finalTitleName);
+                    flowCopy.setProcInsId(task.getProcInstId());
+                    flowCopy.setUserId(item.getId());
+                    SpringUtil.getBean(FlowCopyService.class).save(flowCopy);
+
+                });
+
+
+            }
+
+            System.out.println ( "end=========" );
+        } else if ( "take".equals ( eventName ) ) {//连线监听
+            System.out.println ( "take=========" );
+        }
+
+    }
+}