Просмотр исходного кода

h5添加提交接口,和修改代码命名

Gogs 4 лет назад
Родитель
Сommit
2c74352d9c

+ 22 - 0
boman-api/boman-api-jflow/src/main/java/com/boman/jflow/api/RemoteJflowProcessService.java

@@ -0,0 +1,22 @@
+package com.boman.jflow.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.boman.domain.constant.ServiceNameConstants;
+import com.boman.domain.dto.AjaxResult;
+import com.boman.domain.dto.ProcessDto;
+import com.boman.domain.dto.TaskDto;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * @author zhong.h
+ * @date 2021年05月26日 15:09
+ **/
+@FeignClient(contextId = "remoteJflowProcessService", name = ServiceNameConstants.JFLOW_SERVICE)
+public interface RemoteJflowProcessService {
+
+    @PostMapping("/jflow/p/c/process/launch")
+    AjaxResult launch(@RequestBody ProcessDto processDto);
+}

+ 3 - 7
boman-api/boman-api-jflow/src/main/java/com/boman/jflow/api/RemoteJflowService.java → boman-api/boman-api-jflow/src/main/java/com/boman/jflow/api/RemoteJflowTaskService.java

@@ -3,7 +3,6 @@ package com.boman.jflow.api;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.domain.constant.ServiceNameConstants;
 import com.boman.domain.dto.AjaxResult;
-import com.boman.domain.dto.ProcessDto;
 import com.boman.domain.dto.TaskDto;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -11,14 +10,11 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
 /**
- * @author shiqian
+ * @author zhong.hui
  * @date 2021年05月26日 15:09
  **/
-@FeignClient(contextId = "remoteJflowService", name = ServiceNameConstants.JFLOW_SERVICE)
-public interface RemoteJflowService {
-
-//    @GetMapping("/jflow/p/cs/task/searchString")
-//    String createProcess();
+@FeignClient(contextId = "remoteJflowTaskService", name = ServiceNameConstants.JFLOW_SERVICE)
+public interface RemoteJflowTaskService {
 
     /**
      * 历史审批接口调用

+ 165 - 3
boman-api/boman-domain/src/main/java/com.boman.domain/dto/ProcessDto.java

@@ -1,16 +1,178 @@
 package com.boman.domain.dto;
 
 
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+import java.util.*;
+
 /**
  * @author shiqian
  * @date 2021年05月26日 15:29
  **/
+@Data
 public class ProcessDto {
 
-    /** 主键 **/
+    /**
+     *
+     */
+    private  String dbname;
+
+    private JSONObject businessObj;
+    /**
+     * 流程实例id
+     */
+    @JSONField
+    private Long instanceId;
+
+    /**
+     * 流程实例id-多个
+     */
+    @JSONField
+    private String instanceIds;
+
+    /**
+     * 流程实例版本
+     */
+    private Integer rev;
+
+    @JSONField
+    private Long initiator;
+
+    /**
+     * 发起人:称谓
+     */
+    @JSONField
+    private String initiatorName;
+
+    /**
+     * 业务数据编号
+     */
+    @JSONField
     private Long businessCode;
 
-    /** 表名 **/
-    private String dbname;
+    /**
+     * 业务数据
+     */
+    @JSONField(serialize = false, deserialize = false)
+    private JSONObject businessBody;
+
+    /**
+     * 业务回调路径
+     */
+    @JSONField
+    private String businessUrl;
+
+    /**
+     * 业务回调路径
+     */
+    @JSONField
+    private String formUrl;
+
+    /**
+     * 业务单据修改明细
+     */
+    @JSONField
+    private JSONObject changeDetail;
+
+    /**
+     * 流程状态
+     */
+    @JSONField
+    private Short status;
+
+    /**
+     * 检索开始时间
+     */
+    @JSONField(format = "yyyy-MM-dd HH:mm")
+    private Date startTime;
+
+    /**
+     * 检索结束时间
+     */
+    @JSONField(format = "yyyy-MM-dd HH:mm")
+    private Date endTime;
+
+    @JSONField
+    private Long moduleId;
+
+    @JSONField(serialize = false, deserialize = false)
+    private Long nodeId;
+
+    @JSONField
+    private Long businessType;
+
+    @JSONField
+    private Long changeUser;
+
+    @JSONField
+    private String userName;
+
+    /**
+     * 业务测单据id的集合
+     */
+    @JSONField(name = "businessCodes")
+    private String businessCodes;
+
+    /**
+     * 业务测英文表名
+     */
+    @JSONField
+    private String businessTypeName;
+
+    /**
+     * 业务系统需要校验的单对象id
+     */
+    @JSONField
+    private List<Long> businessCheckData;
+
+    /**
+     * 异常编号
+     */
+    private String errorCode;
+
+    /**
+     * 索引信息
+     */
+    private String businessNumber;
+
+    /**
+     * 定制页面可能需要提交的业务数据体
+     */
+    @JSONField
+    private JSONObject customizeBody;
+
+    @JSONField(serialize = false, deserialize = false)
+    private Set<Short> statusSets;
+
+    @JSONField(serialize = false, deserialize = false)
+    private List<Long> businessCodeList;
+
+    @JSONField(serialize = false, deserialize = false)
+    private Boolean async;
+
+    /**
+     * 强制终止
+     */
+    private Boolean hardShut;
+
+    /**
+     * 转储业务编号
+     *
+     * @return
+     */
+    public ProcessDto collectBusinessCodes() {
+        Set<Long> businessCodeSet = new HashSet<>(1);
+        if (businessCode != null) {
+            businessCodeSet.add(businessCode);
+        }
+        if (businessCodes != null && businessCodes.trim().length() != 0) {
+            String[] codeArray = businessCodes.trim().split(",");
+            Arrays.stream(codeArray).forEach(code -> businessCodeSet.add(Long.parseLong(code)));
+        }
+        businessCodeList = new ArrayList<>(businessCodeSet);
+        return this;
+    }
 
 }

+ 40 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/JFlowProcessController.java

@@ -0,0 +1,40 @@
+package com.boman.web.core.controller;
+
+import com.boman.domain.dto.AjaxResult;
+import com.boman.domain.dto.ProcessDto;
+import com.boman.web.core.service.jflow.JFlowProcessService;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ *  流程中心控制器
+ *
+ * @author zhong.h
+ * @date 2021-06-22
+ * description:流程中心的web层
+ */
+@RequestMapping("/jflow/process")
+@RestController
+public class JFlowProcessController {
+
+    @Autowired
+    private JFlowProcessService jFlowProcessService;
+
+    /**
+     * 实例发起,重启
+     *
+     * @param processDto
+     * @return
+     */
+    @ApiOperation(value = "发起工作流流程")
+    @RequestMapping(value = "/p/c/launch", method = {RequestMethod.POST})
+    public AjaxResult launch(@RequestBody ProcessDto processDto) {
+        return jFlowProcessService.launch(processDto);
+    }
+}

+ 0 - 1
boman-web-core/src/main/java/com/boman/web/core/controller/JFlowTaskController.java

@@ -3,7 +3,6 @@ package com.boman.web.core.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.domain.dto.TaskDto;
-import com.boman.jflow.api.RemoteJflowService;
 import com.boman.web.core.service.jflow.JFlowTaskService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;

+ 2 - 2
boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java

@@ -21,7 +21,7 @@ import com.boman.domain.dto.RoleMenuDto;
 import com.boman.domain.exception.NoSuchFunctionException;
 import com.boman.gen.api.RemoteGenTableColumnService;
 import com.boman.gen.api.RemoteGenTableService;
-import com.boman.jflow.api.RemoteJflowService;
+import com.boman.jflow.api.RemoteJflowTaskService;
 import com.boman.system.api.RemoteMenuService;
 import com.boman.domain.SysMenu;
 import com.boman.system.api.model.LoginUser;
@@ -92,7 +92,7 @@ public class TableServiceCmdService {
     @Resource
     private RemoteMenuService remoteMenuService;
     @Resource
-    private RemoteJflowService remoteJflowService;
+    private RemoteJflowTaskService remoteJflowTaskService;
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TableServiceCmdService.class);
 

+ 8 - 0
boman-web-core/src/main/java/com/boman/web/core/service/jflow/JFlowProcessService.java

@@ -0,0 +1,8 @@
+package com.boman.web.core.service.jflow;
+
+import com.boman.domain.dto.AjaxResult;
+import com.boman.domain.dto.ProcessDto;
+
+public interface JFlowProcessService {
+    AjaxResult launch(ProcessDto processDto);
+}

+ 21 - 0
boman-web-core/src/main/java/com/boman/web/core/service/jflow/impl/JFlowProcessServiceImpl.java

@@ -0,0 +1,21 @@
+package com.boman.web.core.service.jflow.impl;
+
+import com.boman.domain.dto.AjaxResult;
+import com.boman.domain.dto.ProcessDto;
+import com.boman.jflow.api.RemoteJflowProcessService;
+import com.boman.jflow.api.RemoteJflowTaskService;
+import com.boman.web.core.service.jflow.JFlowProcessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class JFlowProcessServiceImpl implements JFlowProcessService {
+
+    @Autowired
+    private RemoteJflowProcessService remoteJflowProcessService;
+
+    @Override
+    public AjaxResult launch(ProcessDto processDto) {
+        return remoteJflowProcessService.launch(processDto);
+    }
+}

+ 5 - 5
boman-web-core/src/main/java/com/boman/web/core/service/jflow/impl/JFlowTaskServiceImpl.java

@@ -3,7 +3,7 @@ package com.boman.web.core.service.jflow.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.domain.dto.TaskDto;
-import com.boman.jflow.api.RemoteJflowService;
+import com.boman.jflow.api.RemoteJflowTaskService;
 import com.boman.web.core.service.jflow.JFlowTaskService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -12,21 +12,21 @@ import org.springframework.stereotype.Service;
 public class JFlowTaskServiceImpl implements JFlowTaskService {
 
     @Autowired
-    private RemoteJflowService remoteJflowService;
+    private RemoteJflowTaskService remoteJflowTaskService;
 
     @Override
     public AjaxResult historyLoad(TaskDto taskDto) {
-        return remoteJflowService.historySearchInPage(taskDto);
+        return remoteJflowTaskService.historySearchInPage(taskDto);
     }
 
     @Override
     public AjaxResult pendingTaskSearch(TaskDto taskDto) {
-        return remoteJflowService.pendingTaskSearch(taskDto);
+        return remoteJflowTaskService.pendingTaskSearch(taskDto);
     }
 
     @Override
     public JSONObject approvalStatistics(TaskDto taskDto) {
-        return remoteJflowService.approvalStatistics(taskDto);
+        return remoteJflowTaskService.approvalStatistics(taskDto);
     }
 
 }