diff --git a/mallinkAdmin/src/main/java/com/iformall/UserApplication.java b/mallinkAdmin/src/main/java/com/iformall/UserApplication.java index f1c776d8b..f72f27524 100644 --- a/mallinkAdmin/src/main/java/com/iformall/UserApplication.java +++ b/mallinkAdmin/src/main/java/com/iformall/UserApplication.java @@ -1,6 +1,7 @@ package com.iformall; import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; +import org.rocketmq.starter.annotation.EnableRocketMQ; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -18,6 +19,7 @@ import tk.mybatis.spring.annotation.MapperScan; @EnableSwagger2 @EnableEncryptableProperties @EnableAsync +@EnableRocketMQ public class UserApplication { @Value("${fm.exception}") diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java index 823a6ca53..516177e4d 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java @@ -1,12 +1,14 @@ package com.iformall.controller; import com.iformall.common.ResultData; -import com.iformall.mq.MqProducer; +import com.iformall.domain.po.WxFlowRecord; +import com.iformall.enums.EnumFlowRecordStatus; import com.iformall.service.WxFlowService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import org.flowable.engine.RuntimeService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -23,14 +25,7 @@ public class WxFlowAbleController extends BaseController { @Autowired private WxFlowService wxFlowService; @Autowired - private MqProducer mqProducer; - - @ApiOperation(value = "mqSend",notes = "") - @PostMapping("/mqSend") - public ResultData mqSend() throws Throwable{ - mqProducer.sendMessage("aaaa","topic-1","tag-1","key1"); - return new ResultData(); - } + RuntimeService runtimeService; @ApiOperation(value = "启动流程",notes = "{\"businessId\":\"221178539888607232\",\"businessType\":1,\"remark\":\"意见意见。\",\"taskAssignee\":[{\"taskKey\":\"firstTaskUser\",\"assignee\":\"243650055783841792\"},{\"taskKey\":\"secondTaskUser\",\"assignee\":\"\"}],\"variables\":[{\"key\":\"contractType\",\"value\":\"1\"},{\"key\":\"contractNumber\",\"value\":\"1111\"}]}") @PostMapping("/start") @@ -39,6 +34,12 @@ public class WxFlowAbleController extends BaseController { return wxFlowService.start(params,super.getUser().getId(),super.getUser().getName(),super.getTenantId()); } + @GetMapping(value = "/del") + public ResultData list(String id) { + runtimeService.deleteProcessInstance(id, "驳回"); + return new ResultData(); + } + /** * 用户代办列表 */ @@ -47,13 +48,30 @@ public class WxFlowAbleController extends BaseController { @ApiImplicitParams({ @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "flowType", value = "流程类型,1合同流程 2账单流程", dataType = "int", paramType = "query", required = true) + @ApiImplicitParam(name = "flowType", value = "流程类型,1合同流程 2账单流程", dataType = "string", paramType = "query", required = true) }) - public ResultData list(Integer flowType,Integer pageNum, Integer pageSize) { + public ResultData list(String flowType,Integer pageNum, Integer pageSize) { logger.debug("[" + getIpAddr() + "] FlowAbleController::list"); return wxFlowService.list(flowType,pageNum,pageSize,super.getUser().getId()); } + /** + * 我的申请列表 + */ + @ApiOperation("我的申请列表") + @GetMapping(value = "/myApplyList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), + }) + public ResultData myApplyList(@ModelAttribute WxFlowRecord record, Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] FlowAbleController::myApplyList"); + record.setUserId(super.getUser().getId()); + record.setStatus(EnumFlowRecordStatus.NEW.getCode()); + return new ResultData(wxFlowService.listAsPage(record,pageNum,pageSize)); + } + + /** * 审批历史 */ @@ -94,10 +112,20 @@ public class WxFlowAbleController extends BaseController { */ @ApiOperation(value = "驳回",notes = "{\"taskId\":\"\",\"processInstanceId\":\"\",\"remark\":\"\"}") @PostMapping(value = "reject") - public ResultData reject(@RequestBody Map params) { + public ResultData reject(@RequestBody Map params) { return wxFlowService.reject(params,super.getUser().getId(),super.getUser().getName(),super.getTenantId()); } + + /** + * 撤回 + */ + @ApiOperation(value = "撤回",notes = "{\"taskId\":\"\",\"processInstanceId\":\"\",\"remark\":\"\"}") + @PostMapping(value = "setBack") + public ResultData setBack(@RequestBody Map params) { + return wxFlowService.setBack(params,super.getUser().getId(),super.getUser().getName()); + } + /** * 生成流程图 * diff --git a/mallinkAdmin/src/main/resources/application-dev.yml b/mallinkAdmin/src/main/resources/application-dev.yml index 621f6a392..46d261d0d 100644 --- a/mallinkAdmin/src/main/resources/application-dev.yml +++ b/mallinkAdmin/src/main/resources/application-dev.yml @@ -1,6 +1,6 @@ spring: profiles: - include: rabbitMQ + include: rocketMQ # JDBC datasource: url: jdbc:mysql://202.165.179.86:3306/mallinkDev?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false @@ -53,16 +53,22 @@ spring: auth: true starttls: enable: true - -#rocketmq: -# name-server: 127.0.0.1:9876 -# producer: -# retry-times-when-send-async-failed: 0 -# send-msg-timeout: 300000 -# compress-msg-body-over-howmuch: 4096 -# max-message-size: 4194304 -# retry-another-broker-when-not-store-ok: false -# retry-times-when-send-failed: 2 + rocketmq: + nameServer: 127.0.0.1:9876 + producer: + retry-times-when-send-async-failed: 0 + send-msg-timeout: 300000 + compress-msg-body-over-howmuch: 4096 + max-message-size: 4194304 + retry-another-broker-when-not-store-ok: false + retry-times-when-send-failed: 2 + rabbitmq: + host: 202.165.179.86 + port: 5672 + username: guest + password: guest + publisher-confirms: true + virtual-host: / aws: clientRegion: cn-northwest-1 @@ -93,7 +99,4 @@ logging: level: tk.mybatis: debug com.iformall: debug - path: ./logs/admin - -#rocketMQ -rocketmq.name-server: 127.0.0.1:9876 \ No newline at end of file + path: ./logs/admin \ No newline at end of file