Преглед на файлове

访问其他系统待办

lizhenhao преди 2 години
родител
ревизия
cec291e9e6
променени са 25 файла, в които са добавени 1549 реда и са изтрити 22 реда
  1. 24 12
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/common/CommonApi.java
  2. 8 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/controller/ReimbursementInfoController.java
  3. 56 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java
  4. 1 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/SaveInfoDto.java
  5. 47 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/config/RestTemplateConfig.java
  6. 42 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/controller/ccpm/FlowController.java
  7. 67 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/controller/ccpm/ReimbursementController.java
  8. 41 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/ReimbursementAmountInfo.java
  9. 96 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/ReimbursementDetailInfo.java
  10. 94 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/ReimbursementDetailInfoContract.java
  11. 98 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/ReimbursementDetailInfoOther.java
  12. 93 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/ReimbursementDetailInfoProcured.java
  13. 94 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/SaveInfoDto.java
  14. 18 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/WorkAttachmentDto.java
  15. 90 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/service/ccpm/flow/FlowRequest.java
  16. 45 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/service/ccpm/flow/FlowService.java
  17. 50 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/service/ccpm/reimbursement/ReimbursementRequest.java
  18. 84 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/service/ccpm/reimbursement/ReimbursementService.java
  19. 309 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/utils/ConvertServiceUtil.java
  20. 96 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/utils/RestTemplateService.java
  21. 43 9
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java
  22. 38 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/FlowTaskService.java
  23. 2 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/vo/ProcessVo.java
  24. 4 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/vo/TaskVo.java
  25. 9 1
      jeeplus-web/src/main/resources/application-development.yml

+ 24 - 12
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/common/CommonApi.java

@@ -33,20 +33,32 @@ public class CommonApi {
      */
     @GetMapping("/getTaskNameByProcInsId")
     public ResponseEntity<String> getTaskNameByProcInsId(@RequestParam("procInsId") String 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 ResponseEntity.ok(flowNode.getName());
+        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 ResponseEntity.ok("");
+        return "";
     }
 }

+ 8 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/controller/ReimbursementInfoController.java

@@ -25,6 +25,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 @RestController
@@ -138,4 +139,11 @@ public class ReimbursementInfoController {
         IPage<RetureListDto> listDtoIPage = service.relationReimbursementList(page, id);
         return ResponseEntity.ok(listDtoIPage);
     }
+
+    @ApiOperation(value = "报销审核")
+    @PostMapping(value = "/auditFunc")
+    public Map<String,Object> auditFunc(@RequestBody SaveInfoDto saveInfoDto) {
+        Map<String, Object> res = service.auditFunc(saveInfoDto);
+        return res;
+    }
 }

+ 56 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java

@@ -1,13 +1,17 @@
 package com.jeeplus.test.reimbursement.reimbursementInfo.service;
 
 import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.flowable.model.Flow;
 import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.sys.domain.Office;
 import com.jeeplus.sys.mapper.OfficeMapper;
@@ -15,6 +19,7 @@ import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.DictUtils;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.common.CommonApi;
 import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.*;
 import com.jeeplus.test.manytomany.domain.Student;
 import com.jeeplus.test.mould.service.SerialnumTplService;
@@ -29,8 +34,10 @@ import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.TreeUserDto;
 import com.jeeplus.test.workContract.service.WorkContractService;
 import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
 import com.jeeplus.test.workContract.service.dto.WorkContractInfoDto;
+import org.flowable.engine.history.HistoricActivityInstance;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -700,4 +707,53 @@ public class ReimbursementInfoService {
         return iPage;
     }
 
+    @Autowired
+    private CommonApi commonApi;
+
+    /**
+     * 报销审核
+     * @param saveInfoDto
+     * @return
+     */
+    public Map<String,Object> auditFunc(SaveInfoDto saveInfoDto) {
+        Map<String,Object> result = new HashMap<>();
+        result.put("success", "false");
+        result.put("message", "操作失败");
+        if (Objects.nonNull(saveInfoDto) && StringUtils.isNotBlank(saveInfoDto.getId()) && StringUtils.isNotBlank(saveInfoDto.getFlag())) {
+            String id = saveInfoDto.getId(); // 报销数据id
+            String flag = saveInfoDto.getFlag(); // 审核标记  yes通过  no驳回
+            SaveInfoDto reim = this.findById(id);
+            if (Objects.nonNull(reim) && StringUtils.isNotBlank(reim.getType()) && "2".equals(reim.getType())) { // 确保当时数据处于“待审核”状态
+                if ( StringUtils.isNotBlank(reim.getProcInsId())) {
+                    try {
+                        RetureListDto upStatusParam = new RetureListDto();
+                        upStatusParam.setId(id);
+                        if ("yes".equals(flag)) {
+                            String taskName = commonApi.getTaskName(reim.getProcInsId());
+                            if (StringUtils.isNotBlank(taskName) && "公司领导审批".equals(taskName)) {
+                                // “公司领导审批” 节点审核通过时,才会将审核状态改为 “审核通过”
+                                upStatusParam.setType("5"); // 审核状态设置为审核完成
+                            } else {
+                                upStatusParam.setType("2");
+                            }
+                        } else {
+                            upStatusParam.setType("4"); // 审核状态设置为审核驳回
+                        }
+                        this.updateStatusById(upStatusParam); // 修改数据的审核状态
+                        flowTaskService.auditByProcInsIdAndFlag(reim.getProcInsId(), flag, null); // 审核操作
+                        result.put("success", "false");
+                        result.put("message", "操作成功");
+                    }catch (Exception e) {
+                        e.printStackTrace();
+                        result.put("success", "false");
+                        result.put("message", "操作失败");
+                    }
+                }
+            } else {
+                result.put("success", "false");
+                result.put("message", "操作失败,数据已发生改变或不存在,请刷新数据");
+            }
+        }
+        return result;
+    }
 }

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/SaveInfoDto.java

@@ -87,5 +87,6 @@ public class SaveInfoDto extends BaseEntity {
 
     private String departmentName;
 
+    private String flag; // yes通过  no驳回
 
 }

+ 47 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/config/RestTemplateConfig.java

@@ -0,0 +1,47 @@
+package com.jeeplus.centerservice.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.http.client.ClientHttpRequestFactory;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.client.RestTemplate;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+@Configuration
+public class RestTemplateConfig {
+
+    @Bean
+    public RestTemplate restTemplate(ClientHttpRequestFactory factory) {
+        RestTemplate restTemplate = new RestTemplate(factory);
+        restTemplate.getMessageConverters().add(new WxMappingJackson2HttpMessageConverter());
+        return restTemplate;
+    }
+
+    @Bean
+    public ClientHttpRequestFactory simpleClientHttpRequestFactory() {
+        SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
+        factory.setConnectTimeout(15000); // 连接超时时间 (两端连接时间) 15秒
+        factory.setReadTimeout(50000); // 访问超时时间 (建立连接后从另一端读取资源所用时间) 5秒
+        // 设置代理
+        //factory.setProxy(null);
+        return factory;
+    }
+
+    public class WxMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter {
+        public WxMappingJackson2HttpMessageConverter(){
+            List<MediaType> mediaTypes = new ArrayList<>();
+            mediaTypes.add(MediaType.TEXT_PLAIN);
+            mediaTypes.add(MediaType.TEXT_HTML);
+            setSupportedMediaTypes(mediaTypes);
+        }
+    }
+}

+ 42 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/controller/ccpm/FlowController.java

@@ -0,0 +1,42 @@
+package com.jeeplus.centerservice.controller.ccpm;
+
+import com.jeeplus.centerservice.dto.reimbursement.SaveInfoDto;
+import com.jeeplus.centerservice.service.ccpm.flow.FlowService;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("ccpm_flow")
+public class FlowController {
+
+    @Resource
+    private FlowService flowService;
+
+    /**
+     * 获取流程历史
+     * @param procInsId
+     * @return
+     */
+    @GetMapping("getHistoicFlowList")
+    public ResponseEntity getHistoicFlowList(String procInsId) {
+        List<Map<String, Object>> histoicFlowList = flowService.getHistoicFlowList(procInsId);
+        return ResponseEntity.ok (histoicFlowList);
+    }
+
+    /**
+     * 获取流程流向图
+     * @param procInsId
+     * @return
+     */
+    @GetMapping("getFlowChart")
+    public ResponseEntity getFlowChart(String procInsId) {
+        List<Map<String, Object>> flowChart = flowService.getFlowChart(procInsId);
+        return ResponseEntity.ok (flowChart);
+    }
+}

+ 67 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/controller/ccpm/ReimbursementController.java

@@ -0,0 +1,67 @@
+package com.jeeplus.centerservice.controller.ccpm;
+
+import com.jeeplus.centerservice.dto.reimbursement.SaveInfoDto;
+import com.jeeplus.centerservice.service.ccpm.reimbursement.ReimbursementService;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/ccpm_reimbursement")
+public class ReimbursementController {
+
+
+    @Resource
+    private ReimbursementService reimbursementService;
+
+    /**
+     * 根据id查询报销详情
+     * @param id
+     * @return
+     */
+    @GetMapping("getReimbursementById")
+    public ResponseEntity getReimbursementById(String id) {
+        SaveInfoDto saveInfoDto = reimbursementService.getReimbursementById(id);
+        return ResponseEntity.ok (saveInfoDto);
+    }
+
+    /**
+     * 报销审核
+     * @param id
+     * @param flag yes 审核通过 no 审核失败
+     * @return
+     */
+    @GetMapping("reimAudit")
+    public ResponseEntity reimAudit(String id, String flag) {
+        Map<String, Object> resultMap = this.reimbursementService.reimAudit(id, flag, "bmzr");
+        return ResponseEntity.ok (resultMap);
+    }
+
+    /**
+     * 报销重新申请
+     * @param id
+     * @return
+     */
+    @GetMapping("reimReapply")
+    public ResponseEntity reimReapply(String id) {
+        Map<String, Object> resultMap = this.reimbursementService.reimAudit(id, "yes", "modifyApply");
+        return ResponseEntity.ok (resultMap);
+    }
+
+    /**
+     * 报销申请删除
+     * @param id
+     * @return
+     */
+    @GetMapping("deleteReim")
+    public ResponseEntity deleteReim(String id) {
+        Map<String, Object> resultMap = this.reimbursementService.deleteReim(id);
+        return ResponseEntity.ok (resultMap);
+    }
+
+
+}

+ 41 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/ReimbursementAmountInfo.java

@@ -0,0 +1,41 @@
+package com.jeeplus.centerservice.dto.reimbursement;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName(value = "reimbursement_amount_info")
+public class ReimbursementAmountInfo extends BaseEntity {
+
+    /**
+     * 关联id
+     */
+    private String infoId;
+
+    /**
+     * 发票代码
+     */
+    private String code;
+
+    /**
+     * 发票编号
+     */
+    private String number;
+
+    /**
+     * 金额
+     */
+    private String amount;
+
+    /**
+     * 税额
+     */
+    private String taxAmount;
+
+    /**
+     * 价税合计
+     */
+    private String count;
+
+}

+ 96 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/ReimbursementDetailInfo.java

@@ -0,0 +1,96 @@
+package com.jeeplus.centerservice.dto.reimbursement;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName(value = "reimbursement_detail_info")
+public class ReimbursementDetailInfo 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 String sort;
+
+    /**
+     * 出差天数ccpm
+     */
+    private String evectionNumber;
+
+    /**
+     * 收据张数ccpm
+     */
+    private String receiptNumbers;
+}
+

+ 94 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/ReimbursementDetailInfoContract.java

@@ -0,0 +1,94 @@
+package com.jeeplus.centerservice.dto.reimbursement;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 评估-报销详情信息表
+ * @TableName reimbursement_detail_info_contract
+ */
+@TableName(value ="reimbursement_detail_info_contract")
+@Data
+public class ReimbursementDetailInfoContract extends BaseEntity implements Serializable {
+
+    /**
+     * 基础表id
+     */
+    private String infoId;
+
+    /**
+     * 报销人
+     */
+    private String userId;
+
+    /**
+     * 报销人名称
+     */
+    @TableField(exist = false)
+    private String userName;
+
+    /**
+     * 报销部门
+     */
+    private String deptId;
+
+    /**
+     * 报销部门名称
+     */
+    @TableField(exist = false)
+    private String deptName;
+
+    /**
+     * 报销类型
+     */
+    private String typeId;
+
+    /**
+     * 报销类型名称
+     */
+    @TableField(exist = false)
+    private String typeName;
+
+    /**
+     * 报销合同
+     */
+    private String contractId;
+
+    /**
+     * 报销合同名称
+     */
+    @TableField(exist = false)
+    private String contractName;
+
+    /**
+     * 报告号
+     */
+    private String reportNumber;
+
+    /**
+     * 费用(元)
+     */
+    private String number;
+
+    /**
+     * 收据张数
+     */
+    private Integer receiptNumber;
+
+    /**
+     * 出差天数
+     */
+    private Integer days;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 98 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/ReimbursementDetailInfoOther.java

@@ -0,0 +1,98 @@
+package com.jeeplus.centerservice.dto.reimbursement;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 评估-报销详情信息表
+ * @TableName reimbursement_detail_info_other
+ */
+@TableName(value ="reimbursement_detail_info_other")
+@Data
+public class ReimbursementDetailInfoOther extends BaseEntity implements Serializable {
+
+    /**
+     * 基础表id
+     */
+    private String infoId;
+
+    /**
+     * 报销人
+     */
+    private String userId;
+
+    /**
+     * 报销人名称
+     */
+    @TableField(exist = false)
+    private String userName;
+
+    /**
+     * 报销部门
+     */
+    private String deptId;
+
+    /**
+     * 报销部门名称
+     */
+    @TableField(exist = false)
+    private String deptName;
+
+    /**
+     * 报销类型
+     */
+    private String typeId;
+
+    /**
+     * 报销类型名称
+     */
+    @TableField(exist = false)
+    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 String sort;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 93 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/ReimbursementDetailInfoProcured.java

@@ -0,0 +1,93 @@
+package com.jeeplus.centerservice.dto.reimbursement;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 评估-报销详情信息表
+ * @TableName reimbursement_detail_info_procured
+ */
+@TableName(value ="reimbursement_detail_info_procured")
+@Data
+public class ReimbursementDetailInfoProcured extends BaseEntity implements Serializable {
+
+    /**
+     * 基础表id
+     */
+    private String infoId;
+
+    /**
+     * 报销人
+     */
+    private String userId;
+
+    /**
+     * 报销人名称
+     */
+    @TableField(exist = false)
+    private String userName;
+
+    /**
+     * 报销部门
+     */
+    private String deptId;
+
+    /**
+     * 报销部门名称
+     */
+    @TableField(exist = false)
+    private String deptName;
+
+    /**
+     * 报销类型
+     */
+    private String typeId;
+
+    /**
+     * 报销类型名称
+     */
+    @TableField(exist = false)
+    private String typeName;
+
+    /**
+     * 报销项目
+     */
+    private String projectId;
+
+    /**
+     * 报销项目名称
+     */
+    private String projectName;
+
+    /**
+     * 报告号
+     */
+    private String reportNumber;
+
+    /**
+     * 费用(元)
+     */
+    private String number;
+
+    /**
+     * 收据张数
+     */
+    private Integer receiptNumber;
+
+    /**
+     * 出差天数
+     */
+    private Integer days;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 94 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/SaveInfoDto.java

@@ -0,0 +1,94 @@
+package com.jeeplus.centerservice.dto.reimbursement;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class SaveInfoDto extends BaseEntity {
+
+    //合同编号类型(字典值)
+    public static final String BIZ_CODE = "5";
+
+    /**
+     * 经办人id
+     */
+    private String userId;
+
+    /**
+     * 经办人名称
+     */
+    private String userName;
+
+    /**
+     * 报销编号
+     */
+    private String no;
+
+    /**
+     * 所属部门
+     */
+    private String department;
+
+    /**
+     * 报销日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date reimDate;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 状态
+     */
+    private String type;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     *
+     */
+    private String processInstanceId;
+
+    private List<ReimbursementDetailInfo> detailInfos;
+    private List<ReimbursementDetailInfoContract> detailInfoContracts;
+    private List<ReimbursementDetailInfoOther> detailInfoOthers;
+    private List<ReimbursementDetailInfoProcured> detailInfoProcured;
+
+    private List<ReimbursementAmountInfo> amountInfos;
+
+    private List<WorkAttachmentDto> files;
+    /**
+     * 报销类型
+     */
+    private String sourceType;
+
+    /**
+     * 采购编号
+     */
+    private String purchaseNo;
+
+    private String purchaseId;
+
+    private String departmentName;
+
+    // 流程历史
+    List<Map<String,Object>> histoicFlowList;
+
+    // 流程流向图
+    List<Map<String,Object>> flowChart;
+
+
+}

+ 18 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/dto/reimbursement/WorkAttachmentDto.java

@@ -0,0 +1,18 @@
+package com.jeeplus.centerservice.dto.reimbursement;
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.Data;
+
+@Data
+public class WorkAttachmentDto extends BaseDTO {
+
+    private String name;
+
+    private String size;
+
+    private String url;
+
+    private String lsUrl;
+
+}

+ 90 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/service/ccpm/flow/FlowRequest.java

@@ -0,0 +1,90 @@
+package com.jeeplus.centerservice.service.ccpm.flow;
+
+import cn.hutool.core.util.StrUtil;
+import com.jeeplus.centerservice.utils.RestTemplateService;
+import com.jeeplus.flowable.model.Flow;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class FlowRequest {
+
+    @Resource
+    private RestTemplateService restTemplateService;
+
+    /**
+     * 根据procInsId查询流程流向图
+     * @param procInsId
+     * @return
+     */
+    public Object getFlowChart(String procInsId) {
+        String token = "";
+        Map<String, Object> param = new HashMap<>();
+        param.put("procInsId", procInsId);
+        Object flowChart = restTemplateService.getCCPM("/a/act/task/getFlowChart", token, param);
+        return flowChart;
+    }
+
+    /**
+     * 根据procInsId查询流程历史
+     * @param procInsId
+     * @return
+     */
+    public Object getHistoicFlowList(String procInsId) {
+        String token = "";
+        Map<String, Object> param = new HashMap<>();
+        param.put("procInsId", procInsId);
+        Object histoicFlow = restTemplateService.getCCPM("/a/act/task/getHistoicFlowList", token, param);
+        return histoicFlow;
+    }
+
+    /**
+     * 根据待办id及类型  删除待办信息
+     * @param notifyId
+     * @param type
+     * @return
+     */
+    public Object deleteNotify(String notifyId, String type) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("notifyId", notifyId);
+        paramMap.put("type", type);
+        Object result = restTemplateService.getCCPM("/a/workprojectnotify/workProjectNotify/deleteNotify", token, paramMap);
+        return result;
+    }
+
+    /**
+     * 查询待办信息
+     * @param flow
+     * @return
+     */
+    public Object getNotifyList(Flow flow) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        // 设置查询条件
+        if (flow.getBeginDate () != null) { // 创建时间
+            SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            paramMap.put("startDate", formatter.format(flow.getBeginDate ()));
+        }
+        if (flow.getEndDate () != null) { // 创建时间
+            SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            paramMap.put("endDate", formatter.format(flow.getEndDate ()));
+        }
+        if (StrUtil.isNotBlank (flow.getTitle ())) { // 标题
+            paramMap.put("title", flow.getTitle ());
+        }
+        if (com.jeeplus.sys.utils.StringUtils.isNotEmpty(flow.getAssigneeName())) { // 流程发起人
+            paramMap.put("userName", flow.getAssigneeName());
+        }
+        paramMap.put("size", -1);
+        paramMap.put("count", -1);
+        Object response = restTemplateService.getCCPM("/a/workprojectnotify/workProjectNotify/getList", token, paramMap);
+        return response;
+    }
+}

+ 45 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/service/ccpm/flow/FlowService.java

@@ -0,0 +1,45 @@
+package com.jeeplus.centerservice.service.ccpm.flow;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.jeeplus.centerservice.dto.reimbursement.SaveInfoDto;
+import com.jeeplus.centerservice.utils.ConvertServiceUtil;
+import com.jeeplus.sys.utils.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class FlowService {
+
+    @Resource
+    private FlowRequest flowRequest;
+
+    /**
+     * 获取流程历史
+     * @param procInsId
+     * @return
+     */
+    public List<Map<String,Object>> getHistoicFlowList(String procInsId) {
+        Object histoicFlow = flowRequest.getHistoicFlowList(procInsId);
+        List<Map<String,Object>> histoicFlows = JSONArray.parseArray(JSON.toJSONString(histoicFlow));
+        List<Map<String,Object>> histoicFlowList = ConvertServiceUtil.convertHisFlowList(histoicFlows); // 格式转换
+        return histoicFlowList;
+    }
+
+    /**
+     * 获取流程流向图
+     * @param procInsId
+     * @return
+     */
+    public List<Map<String,Object>> getFlowChart(String procInsId) {
+        Object flowChart = flowRequest.getFlowChart(procInsId);
+        List<Map<String,Object>> flowCharts = JSONArray.parseArray(JSON.toJSONString(flowChart)); // 格式转换
+        return flowCharts;
+    }
+}

+ 50 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/service/ccpm/reimbursement/ReimbursementRequest.java

@@ -0,0 +1,50 @@
+package com.jeeplus.centerservice.service.ccpm.reimbursement;
+
+import com.jeeplus.centerservice.utils.RestTemplateService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class ReimbursementRequest {
+
+    @Resource
+    private RestTemplateService restTemplateService;
+
+    /**
+     * 根据报销数据id查询报销详情
+     * @param id
+     * @return
+     */
+    public Object getById(String id) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("id", id);
+        Object res = restTemplateService.getCCPM("/a/workreimbursement/workReimbursement/getById", token, paramMap);
+        return res;
+    }
+
+    /**
+     * 报销审核 通过、驳回、重新发起
+     * @param resp
+     * @param taskDefKey
+     * @param flag
+     * @return
+     */
+    public Object saveAuditFunc(Map<String, Object> resp, String taskDefKey, String flag) {
+        String token = "";
+        Map<String, Object> createBy = new HashMap<>();
+        createBy.put("id", resp.get("handleId").toString());
+        Map<String, Object> act = new HashMap<>();
+        act.put("taskDefKey", taskDefKey);
+        act.put("flag", flag);
+        resp.put("act", act);
+        resp.put("createBy", createBy);
+        Object res = restTemplateService.postCCPM("/a/workreimbursement/workReimbursement/saveAuditFunc", token, null, resp);
+        return res;
+    }
+}

+ 84 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/service/ccpm/reimbursement/ReimbursementService.java

@@ -0,0 +1,84 @@
+package com.jeeplus.centerservice.service.ccpm.reimbursement;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jeeplus.centerservice.dto.reimbursement.SaveInfoDto;
+import com.jeeplus.centerservice.service.ccpm.flow.FlowRequest;
+import com.jeeplus.centerservice.utils.ConvertServiceUtil;
+import com.jeeplus.sys.utils.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class ReimbursementService {
+
+    @Resource
+    private ReimbursementRequest reimbursementRequest;
+
+    @Resource
+    private FlowRequest flowRequest;
+
+    /**
+     * 查询报销待办详情
+     * @param id
+     * @return
+     */
+    public SaveInfoDto getReimbursementById(String id) {
+        Object response = reimbursementRequest.getById(id); // 报销详情
+        SaveInfoDto saveInfoDto = ConvertServiceUtil.convertReim(response); // 格式转换
+        if (Objects.nonNull(saveInfoDto) && StringUtils.isNotBlank(saveInfoDto.getProcInsId())) {
+            // 流程流向图
+            Object flowChart = flowRequest.getFlowChart(saveInfoDto.getProcInsId());
+            List<Map<String,Object>> flowCharts = JSONArray.parseArray(JSON.toJSONString(flowChart)); // 格式转换
+            saveInfoDto.setFlowChart(flowCharts);
+            // 流程历史
+            Object histoicFlow = flowRequest.getHistoicFlowList(saveInfoDto.getProcInsId());
+            List<Map<String,Object>> histoicFlows = JSONArray.parseArray(JSON.toJSONString(histoicFlow));
+            List<Map<String,Object>> histoicFlowList = ConvertServiceUtil.convertHisFlowList(histoicFlows); // 格式转换
+            saveInfoDto.setHistoicFlowList(histoicFlowList);
+        }
+        return saveInfoDto;
+    }
+
+    /**
+     * 报销审核通过、驳回
+     * @param id
+     * @param flag
+     * @param taskDefKey
+     * @return
+     */
+    public Map<String, Object> reimAudit(String id, String flag, String taskDefKey) {
+        Map<String, Object> resultMap = new HashMap<>();
+        Object response = reimbursementRequest.getById(id); // 报销详情
+        Map<String, Object> resp = JSONObject.parseObject(JSON.toJSONString(response));
+        Object result = reimbursementRequest.saveAuditFunc(resp, taskDefKey, flag); // 审核通过、审核驳回
+        resultMap = JSONObject.parseObject(JSON.toJSONString(result));
+        return resultMap;
+
+    }
+
+    /**
+     * 删除报销待办
+     * @param id
+     * @return
+     */
+    public Map<String, Object> deleteReim(String id) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try{
+            Object result = flowRequest.deleteNotify(id,"13"); // 13代表报销模块
+            resultMap = JSONObject.parseObject(JSON.toJSONString(result));
+        } catch (Exception e) {
+            resultMap.put("code", 0);
+            resultMap.put("msg", "报销信息删除失败");
+        }
+        return resultMap;
+    }
+}

+ 309 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/utils/ConvertServiceUtil.java

@@ -0,0 +1,309 @@
+package com.jeeplus.centerservice.utils;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.centerservice.dto.reimbursement.ReimbursementAmountInfo;
+import com.jeeplus.centerservice.dto.reimbursement.ReimbursementDetailInfo;
+import com.jeeplus.centerservice.dto.reimbursement.SaveInfoDto;
+import com.jeeplus.centerservice.dto.reimbursement.WorkAttachmentDto;
+import com.jeeplus.flowable.vo.ProcessVo;
+import com.jeeplus.flowable.vo.TaskVo;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.Global;
+import com.jeeplus.sys.utils.StringUtils;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+public class ConvertServiceUtil {
+
+    /**
+     * 批量将ccpm系统待办返回的字段转换为当前系统待办需要的字段
+     * @param res
+     * @return
+     */
+    public static List<ProcessVo> convertProcessVoList(List<Map<String, Object>> res) throws Exception {
+        ArrayList<ProcessVo> processVoList = new ArrayList<>();
+        String ccpm_task = Global.getConfig("CCPM_TASK"); // 获取ccpm可查看的待办数据
+        if (StringUtils.isNotBlank(ccpm_task)) {
+            String[] taskAliasList = ccpm_task.split(","); // 获取到ccpm待办
+            if(CollectionUtil.isNotEmpty(res) && ArrayUtil.isNotEmpty(taskAliasList)) {
+                String[] distinctTaskAlias = ArrayUtil.distinct(taskAliasList); // ccpm待办去重
+                for (Map<String, Object> item : res) {
+                    for (String taskAlias : distinctTaskAlias) {
+                        if (taskAlias.equals(item.get("type").toString()) && item.get("remarks").toString().contains("待审批")) {
+                            ProcessVo processVo = convertProcessVo(item);
+                            processVoList.add(processVo);
+                        }
+                    }
+                }
+            }
+        }
+        return processVoList;
+    }
+    /**
+     * ccpm系统待办返回的字段转换为当前系统待办需要的字段
+     * @param map
+     * @return
+     */
+    public static ProcessVo convertProcessVo(Map<String, Object> map) throws Exception {
+        ProcessVo processVo = new ProcessVo();
+        Map<String, String> vars = new HashMap();
+        TaskVo task = new TaskVo();
+        if (CollectionUtil.isNotEmpty(map)) {
+            // 标题
+            if (Objects.nonNull(map.get("title"))){
+                vars.put("title", map.get("title").toString());
+            }
+            // 流程名称
+            if (Objects.nonNull(map.get("typeLabel"))){
+                processVo.setProcessDefinitionName(map.get("typeLabel").toString());
+            }
+            // 当前环节
+            if (Objects.nonNull(map.get("notifyRole"))){
+                task.setName(map.get("notifyRole").toString());
+            }
+            // 流程发起人
+            if (Objects.nonNull(map.get("createUserName"))){
+                vars.put("userName", map.get("createUserName").toString());
+            }
+            // 创建时间
+            if (Objects.nonNull(map.get("createDate"))){
+                task.setCreateTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(map.get("createDate").toString()));
+            }
+            // 流程id
+            if (Objects.nonNull(map.get("id"))){
+                task.setId(map.get("id").toString());
+            }
+            // 数据id
+            if (Objects.nonNull(map.get("notifyId"))){
+                vars.put("notifyId", map.get("notifyId").toString());
+            }
+            // 审批状态
+            if (Objects.nonNull(map.get("remarks"))){
+                vars.put("remarks", map.get("remarks").toString());
+            }
+        }
+        processVo.setVars(vars);
+        processVo.setTask(task);
+        processVo.setBelongProject("ccpm");
+        processVo.setStatus ("todo");
+        return processVo;
+    }
+
+    /**
+     * 将结果排序后分页
+     * 由于是根据数据中的creaTime字段来进行排序,所以此字段不可以为空,否则会报空指针
+     * @param page
+     * @param list
+     * @return
+     */
+    public static Page getSortAndPaging(Page page,List<ProcessVo> list) {
+        // 将数据按照creaTime倒序排序
+        List<ProcessVo> sort = CollectionUtil.sort(list, new Comparator<ProcessVo>() {
+            @Override
+            public int compare(ProcessVo o1, ProcessVo o2) {
+                return o2.getTask().getCreateTime().compareTo(o1.getTask().getCreateTime());
+            }
+        });
+        // 将数据分页
+        page.setTotal(list.size());
+        List<ProcessVo> records = new ArrayList<>();
+        int startIndex = (int) ((page.getCurrent() - 1) * page.getSize());
+        for (int i = 0; i < page.getSize() ; i ++) {
+            if (startIndex == list.size() || ObjectUtil.isEmpty(list.get(startIndex))) {
+                break;
+            }
+            records.add(list.get(startIndex));
+            startIndex++;
+        }
+        page.setRecords(records);
+        return page;
+    }
+
+    /**
+     * ccpm报销转换
+     * @param response
+     * @return
+     */
+    public static SaveInfoDto convertReim(Object response) {
+        SaveInfoDto result = new SaveInfoDto();
+        if (Objects.nonNull(response)) {
+            Map<String, Object> resp = JSONObject.parseObject(JSON.toJSONString(response));
+            if (CollectionUtil.isNotEmpty(resp)) {
+                // processInstanceId
+                if (ObjectUtil.isNotEmpty(resp.get("processInstanceId"))) {
+                    result.setProcInsId(resp.get("processInstanceId").toString());
+                }
+                // 经办人
+                if (ObjectUtil.isNotEmpty(resp.get("submitterName"))) { // 报销人
+                    result.setUserName(resp.get("submitterName").toString());
+                }
+                // 报销编号
+                if (ObjectUtil.isNotEmpty(resp.get("number"))) { // 报销编号
+                    result.setNo(resp.get("number").toString());
+                }
+                // 所属部门
+                if (ObjectUtil.isNotEmpty(resp.get("officeName"))) { // 所属部门
+                    result.setDepartmentName(resp.get("officeName").toString());
+                }
+                // 报销日期
+                if (ObjectUtil.isNotEmpty(resp.get("createDate"))) { // 报销日期、创建时间
+                    result.setReimDate(DateUtil.parse(resp.get("createDate").toString()));
+                }
+                // 备注
+                if (ObjectUtil.isNotEmpty(resp.get("remarks"))) { // 备注
+                    result.setRemarks(resp.get("remarks").toString());
+                }
+                // 附件
+                if (ObjectUtil.isNotEmpty(resp.get("workAttachments"))) {
+                    String jsonString = JSON.toJSONString(resp.get("workAttachments"));
+                    List<Object> attachmentList = JSON.parseArray(jsonString, Object.class);
+                    List<WorkAttachmentDto> attachments = new ArrayList<>();
+                    if (CollectionUtil.isNotEmpty(attachmentList)) {
+                        attachmentList.stream().forEach(attachment -> {
+                            WorkAttachmentDto attachmentDto = new WorkAttachmentDto();
+                            UserDTO userDTO = new UserDTO();
+                            Map<String, Object> fileMap = JSONObject.parseObject(JSON.toJSONString(attachment));
+                            if (ObjectUtil.isNotEmpty(fileMap.get("attachmentName"))) { // 附件名称
+                                attachmentDto.setName(fileMap.get("attachmentName").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(fileMap.get("createName"))) { // 创建人
+                                userDTO.setName(fileMap.get("createName").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(fileMap.get("createDate"))) { // 创建时间
+                                attachmentDto.setCreateDate(DateUtil.parse(fileMap.get("createDate").toString()));
+                            }
+                            if (ObjectUtil.isNotEmpty(fileMap.get("url"))) { // 文件地址
+                                attachmentDto.setUrl(fileMap.get("url").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(fileMap.get("temporaryUrl"))) { // 文件临时地址
+                                attachmentDto.setLsUrl(fileMap.get("temporaryUrl").toString());
+                            }
+                            attachmentDto.setCreateBy(userDTO);
+                            attachments.add(attachmentDto);
+                        });
+                    }
+                    result.setFiles(attachments);
+                }
+                // 专用发票信息
+                if (ObjectUtil.isNotEmpty(resp.get("reimbursementVATTaxes"))) {
+                    String jsonString = JSON.toJSONString(resp.get("reimbursementVATTaxes"));
+                    List<Object> reimVATTaxeList = JSON.parseArray(jsonString, Object.class);
+                    List<ReimbursementAmountInfo> reimbursementAmountInfoList = new ArrayList<>();
+                    if (CollectionUtil.isNotEmpty(reimVATTaxeList)) {
+                        reimVATTaxeList.stream().forEach(reim -> {
+                            ReimbursementAmountInfo reimbursementAmountInfo = new ReimbursementAmountInfo();
+                            Map<String, Object> vaTaxeMap = JSONObject.parseObject(JSON.toJSONString(reim));
+                            if (ObjectUtil.isNotEmpty(vaTaxeMap.get("invoiceCode"))) { // 发票代码
+                                reimbursementAmountInfo.setCode(vaTaxeMap.get("invoiceCode").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(vaTaxeMap.get("invoiceNumber"))) { // 发票号
+                                reimbursementAmountInfo.setNumber(vaTaxeMap.get("invoiceNumber").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(vaTaxeMap.get("money"))) { // 金额
+                                reimbursementAmountInfo.setAmount(vaTaxeMap.get("money").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(vaTaxeMap.get("taxAmount"))) { // 税额
+                                reimbursementAmountInfo.setTaxAmount(vaTaxeMap.get("taxAmount").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(vaTaxeMap.get("sumMoney"))) { // 价税合计
+                                reimbursementAmountInfo.setCount(vaTaxeMap.get("sumMoney").toString());
+                            }
+                            reimbursementAmountInfoList.add(reimbursementAmountInfo);
+                        });
+                    }
+                    result.setAmountInfos(reimbursementAmountInfoList);
+                }
+                // 报销详情
+                if (ObjectUtil.isNotEmpty(resp.get("workAccountList"))) {
+                    String jsonString = JSON.toJSONString(resp.get("workAccountList"));
+                    List<Object> workAccountList = JSON.parseArray(jsonString, Object.class);
+                    List<ReimbursementDetailInfo> reimbursementDetailInfos = new ArrayList<>();
+                    if (CollectionUtil.isNotEmpty(workAccountList)) {
+                        workAccountList.stream().forEach(detail -> {
+                            Map<String, Object> detailMap = JSONObject.parseObject(JSON.toJSONString(detail));
+                            ReimbursementDetailInfo detailInfo = new ReimbursementDetailInfo();
+                            if (ObjectUtil.isNotEmpty(detailMap.get("reimbursementName"))) { // 报销人
+                                detailInfo.setUserName(detailMap.get("reimbursementName").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(detailMap.get("officeId"))) { // 报销部门
+                                detailInfo.setDeptName(detailMap.get("officeId").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(detailMap.get("typeName"))) { // 报销类别
+                                detailInfo.setTypeName(detailMap.get("typeName").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(detailMap.get("project"))) { // 报销项目
+                                Map<String, Object> projectMap = JSONObject.parseObject(JSON.toJSONString(detailMap.get("project")));
+                                if (ObjectUtil.isNotEmpty(projectMap.get("projectName"))) {
+                                    detailInfo.setProjectName(projectMap.get("projectName").toString());
+                                }
+                            }
+                            if (ObjectUtil.isNotEmpty(detailMap.get("projectReportNumber"))) { // 报告号
+                                detailInfo.setReportNumber(detailMap.get("projectReportNumber").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(detailMap.get("money"))) { // 费用(元)
+                                detailInfo.setNumber(detailMap.get("money").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(detailMap.get("bills"))) { // 收据张数
+                                detailInfo.setReceiptNumbers(detailMap.get("bills").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(detailMap.get("evectionNumber"))) { // 出差天数
+                                detailInfo.setEvectionNumber(detailMap.get("evectionNumber").toString());
+                            }
+                            if (ObjectUtil.isNotEmpty(detailMap.get("remarks"))) { // 内容
+                                detailInfo.setContent(detailMap.get("remarks").toString());
+                            }
+                            reimbursementDetailInfos.add(detailInfo);
+                        });
+                    }
+                    result.setDetailInfos(reimbursementDetailInfos);
+                }
+            }
+        }
+        return result;
+    }
+
+    /**
+     * ccpm流程历史转换
+     * @param list
+     * @return
+     */
+    public static List<Map<String,Object>> convertHisFlowList(List<Map<String, Object>> list) {
+        if (CollectionUtil.isNotEmpty(list)) {
+            list.stream().forEach(item -> {
+                // beginDate日期格式化后重新赋值
+                if (Objects.nonNull(item.get("beginDate"))) {
+                    Long beginDate = Long.valueOf(String.valueOf(item.get("beginDate")));
+                    item.remove("beginDate");
+                    item.put("beginDate",formatLongDate(beginDate));
+                }
+                // endDate日期格式化后重新赋值
+                if (Objects.nonNull(item.get("endDate"))) {
+                    Long beginDate = Long.valueOf(String.valueOf(item.get("endDate")));
+                    item.remove("endDate");
+                    item.put("endDate",formatLongDate(beginDate));
+                }
+            });
+        }
+        return list;
+    }
+
+    /**
+     * 将Long类型时间转换为String时间格式
+     * @param date
+     * @return
+     */
+    public static String formatLongDate (Long date) {
+        Date dt=new Date(date);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
+        String format = sdf.format(dt);
+        return format;
+    }
+}

+ 96 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/utils/RestTemplateService.java

@@ -0,0 +1,96 @@
+package com.jeeplus.centerservice.utils;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.jeeplus.sys.utils.Global;
+import com.jeeplus.sys.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import java.nio.charset.Charset;
+import java.util.Map;
+import java.util.Objects;
+
+@Component
+public class RestTemplateService {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    /**
+     * 访问post接口 - CCPM 系统
+     * @param path 接口路径
+     * @param token token
+     * @param paramMap 请求参数-路径后
+     * @param bodyMap 请求参数-请求体
+     * @return
+     */
+    public Object postCCPM(String path, String token, Map<String, Object> paramMap, Map<String, Object> bodyMap) {
+        return httpRequest(HttpMethod.POST, token, paramMap, bodyMap, Global.getConfig("CCPM_PATH"), path);
+    }
+
+    /**
+     * 访问get接口 - CCPM 系统
+     * @param path 接口路径
+     * @param token token
+     * @param paramMap 请求参数-路径后
+     * @return
+     */
+    public Object getCCPM(String path, String token, Map<String, Object> paramMap) {
+        return httpRequest(HttpMethod.GET, token, paramMap, null, Global.getConfig("CCPM_PATH"), path);
+    }
+
+    /**
+     * 访问远程接口方法
+     * @param method 请求类型
+     * @param token token
+     * @param paramMap 请求参数-路径后
+     * @param bodyMap 请求参数-请求体
+     * @param hostAddress 服务host地址
+     * @param path 接口路径
+     * @return
+     */
+    public Object httpRequest(HttpMethod method, String token, Map<String, Object> paramMap, Map<String, Object> bodyMap, String hostAddress, String path) {
+        JSONObject jsonObject = new JSONObject();
+        if (CollectionUtil.isNotEmpty(bodyMap)) {
+            jsonObject = new JSONObject(bodyMap); // 另一端接口需要使用@RequestBody来接收此参数
+        }
+        String url = getUrl(hostAddress, path, paramMap);
+        HttpHeaders httpHeaders = new HttpHeaders();
+//        httpHeaders.add("token",token);
+        httpHeaders.add("Accept", MediaType.ALL_VALUE);
+        httpHeaders.add("cookie", "jeeplus.session.id=0635611b0f5a4401836262c7d23ae98e");
+        httpHeaders.setContentType(new MediaType("application","json", Charset.forName("UTF-8")));
+        HttpEntity<Object> entity = new HttpEntity<>(jsonObject,httpHeaders);
+        ResponseEntity<Object> responseEntity = restTemplate.exchange(url, method, entity, Object.class);
+        return responseEntity.getBody();
+    }
+
+    /**
+     * 将参数拼接到请求路径中
+     * @param hostAddress 服务host地址
+     * @param path 接口路径
+     * @param map 请求参数
+     * @return
+     */
+    public String getUrl(String hostAddress, String path, Map<String, Object> map) {
+        String url = hostAddress + path;
+        StringBuilder paramStr = new StringBuilder();
+        if (CollectionUtil.isNotEmpty(map)) {
+            for (String key : map.keySet()) {
+                Object o = map.get(key);
+                if (Objects.nonNull(o)) {
+//                    String value = URLEncoder.encode(o.toString(), "utf-8");
+                    paramStr.append("&").append(key).append("=").append(o);
+                }
+            }
+        }
+        if (StringUtils.isNotBlank(paramStr.toString())){
+            String param = paramStr.substring(1).toString(); // 去掉第一个&
+            url = url + "?" + param;
+        }
+        return url;
+    }
+}

+ 43 - 9
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java

@@ -4,10 +4,14 @@
 package com.jeeplus.flowable.controller;
 
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.jeeplus.centerservice.service.ccpm.flow.FlowRequest;
 import com.jeeplus.common.utils.Collections3;
 import com.jeeplus.extension.domain.NodeSetting;
 import com.jeeplus.extension.service.NodeSettingService;
@@ -15,6 +19,8 @@ import com.jeeplus.flowable.model.ActRuTaskInfo;
 import com.jeeplus.flowable.model.Flow;
 import com.jeeplus.flowable.model.TaskComment;
 import com.jeeplus.flowable.service.FlowTaskService;
+import com.jeeplus.centerservice.utils.ConvertServiceUtil;
+import com.jeeplus.centerservice.utils.RestTemplateService;
 import com.jeeplus.flowable.vo.HisTaskVo;
 import com.jeeplus.flowable.vo.ProcessVo;
 import com.jeeplus.mail.domain.Mail;
@@ -23,9 +29,7 @@ import com.jeeplus.mail.domain.MailCompose;
 import com.jeeplus.mail.service.MailBoxService;
 import com.jeeplus.mail.service.MailComposeService;
 import com.jeeplus.mail.service.MailService;
-import com.jeeplus.mail.service.mapstruct.MailWrapper;
 import com.jeeplus.sys.constant.CommonConstants;
-import com.jeeplus.sys.domain.User;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.UserUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -42,11 +46,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * 流程个人任务相关Controller
@@ -83,12 +86,43 @@ public class FlowableTaskController {
     @Autowired
     private MailService mailService;
 
+    @Resource
+    private RestTemplateService restTemplateService;
+
+    @Resource
+    private FlowRequest flowRequest;
 
 
     @GetMapping("todo")
-    public ResponseEntity todoListData(Page <ProcessVo> page, Flow flow) {
-        page = flowTaskService.todoList(page, flow);
-        return ResponseEntity.ok (page);
+    public ResponseEntity todoListData(Page <ProcessVo> page, Flow flow) throws Exception {
+        Page <ProcessVo> pageList = flowTaskService.todoList(new Page<>(1, -1), flow);
+        List<ProcessVo> list = new ArrayList<>();
+        // 访问ccpm
+        Object response = flowRequest.getNotifyList(flow);
+        List<Map<String, Object>> res = JSONObject.parseArray(JSON.toJSONString(response));
+        // ccpm待办查询返回结果
+        List<ProcessVo> processVos = ConvertServiceUtil.convertProcessVoList(res);
+        // 整合全部查询结果
+        list.addAll(pageList.getRecords()); // 当前系统查询数据
+        list.addAll(processVos); // ccpm返回数据
+        // 将整合后的结果排序后分页
+        Page sortAndPaging = ConvertServiceUtil.getSortAndPaging(page, list);
+        return ResponseEntity.ok (sortAndPaging);
+    }
+
+    @GetMapping("allTodo")
+    public ResponseEntity allTodo(Flow flow) {
+        Page <ProcessVo> pageList = flowTaskService.todoList(new Page<>(1, -1), flow);
+        pageList.getRecords().stream().forEach(item->{
+            // 查询审核人
+            if (Objects.nonNull(item.getTask()) && StringUtils.isNotBlank(item.getTask().getAssignee())) {
+                UserDTO userDTO = UserUtils.get(item.getTask().getAssignee());
+                if (Objects.nonNull(userDTO) && StringUtils.isNotBlank(userDTO.getName())) {
+                    item.getTask().setAssignee(userDTO.getName());
+                }
+            }
+        });
+        return ResponseEntity.ok (pageList.getRecords());
     }
 
     /**

+ 38 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/FlowTaskService.java

@@ -1009,4 +1009,42 @@ public class FlowTaskService {
         } );
         return assignList;
     }
+
+    /**
+     * 审核通过或驳回
+     * @param procInsId
+     * @param flag “yes”通过  “no”驳回
+     * @param assignee 设置下一步处理人
+     */
+    public void auditByProcInsIdAndFlag(String procInsId,String flag,String assignee) throws Exception {
+        // 获取审核操作需要的参数
+        List<Flow> flows = this.historicTaskList(procInsId);
+        Flow flow = flows.get(flows.size() - 1);
+        Flow saveParam = new Flow();
+        HistoricActivityInstance histIns = flow.getHistIns();
+        saveParam.setTaskId(histIns.getTaskId());
+        saveParam.setTaskDefKey(histIns.getActivityId());
+        saveParam.setProcInsId(histIns.getProcessInstanceId());
+        saveParam.setProcDefId(histIns.getProcessDefinitionId());
+        Map<String, Object> vars = Maps.newHashMap();
+        TaskComment comment = new TaskComment();
+        if ("yes".equals(flag)) {
+            vars.put("agree", true); // 审核通过
+            comment.setType(ActionType.AGREE.getType());
+            comment.setStatus(ActionType.AGREE.getStatus());
+        } else {
+            vars.put("agree", false); // 审核驳回
+            comment.setType(ActionType.REJECT.getType());
+            comment.setStatus(ActionType.REJECT.getStatus());
+        }
+        saveParam.setComment(comment);
+        this.auditSave(saveParam, vars); // 流程审核操作
+        //指定下一步处理人
+        if(StringUtils.isNotBlank(assignee)){
+            Task task = taskService.createTaskQuery().processInstanceId(procInsId).active().singleResult();
+            if(task != null){
+                taskService.setAssignee(task.getId(), assignee);
+            }
+        }
+    }
 }

+ 2 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/vo/ProcessVo.java

@@ -25,6 +25,8 @@ public class ProcessVo {
     private String status; //流程状态
     private String level; //状态级别,用于控制在前台显示的颜色
 
+    private String belongProject; // 所属系统 ccpm cpa ...
+
     public String getId(){ // 流程实例id 作为列表的id
         return processInstanceId;
     }

+ 4 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/vo/TaskVo.java

@@ -1,6 +1,8 @@
 package com.jeeplus.flowable.vo;
 
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.flowable.task.api.TaskInfo;
 
 import java.util.Date;
@@ -9,6 +11,8 @@ import java.util.Date;
  * 当前活动任务节点
  */
 @Data
+@AllArgsConstructor
+@NoArgsConstructor
 public class TaskVo {
     private String id;
     private String name;

+ 9 - 1
jeeplus-web/src/main/resources/application-development.yml

@@ -144,7 +144,7 @@ mybatis-plus:
 
 #是否开启 swagger,生产环境请关闭
 swagger:
-  enable: true
+  enable: false
 
 #cas服务端的地址
 cas:
@@ -245,8 +245,16 @@ approval_YC_category_id: 2932214418853044239
 #报告用印流程id(盐城)
 report_YC_category_id: 2933233458312618324
 
+#容联云
 rong_userid: 8a216da86715511501673e331c24171e
 rong_token: 3d7dc58c6a334ad6887317efbf847e41
 app_id: 8a216da86715511501673e331c741725
 template_id: 435329
 code_type: 1
+
+#其他系统的地址
+CCPM_PATH:  http://localhost:8888
+#待办中展示其他系统的流程
+#ccpm =》 13 报销申请、19 项目登记
+CCPM_TASK:  13,39
+