Browse Source

[消息组件][添加][改造,统一替换原来发送方式]

release_toaliyun_real
luozukai 7 years ago
parent
commit
a2888b2ecf
3 changed files with 60 additions and 27 deletions
  1. +2
    -0
      mallinkAdmin/src/main/java/com/iformall/UserApplication.java
  2. +40
    -12
      mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java
  3. +18
    -15
      mallinkAdmin/src/main/resources/application-dev.yml

+ 2
- 0
mallinkAdmin/src/main/java/com/iformall/UserApplication.java View File

@@ -1,6 +1,7 @@
package com.iformall; package com.iformall;


import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.rocketmq.starter.annotation.EnableRocketMQ;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -18,6 +19,7 @@ import tk.mybatis.spring.annotation.MapperScan;
@EnableSwagger2 @EnableSwagger2
@EnableEncryptableProperties @EnableEncryptableProperties
@EnableAsync @EnableAsync
@EnableRocketMQ
public class UserApplication { public class UserApplication {


@Value("${fm.exception}") @Value("${fm.exception}")


+ 40
- 12
mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java View File

@@ -1,12 +1,14 @@
package com.iformall.controller; package com.iformall.controller;


import com.iformall.common.ResultData; 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 com.iformall.service.WxFlowService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.flowable.engine.RuntimeService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -23,14 +25,7 @@ public class WxFlowAbleController extends BaseController {
@Autowired @Autowired
private WxFlowService wxFlowService; private WxFlowService wxFlowService;
@Autowired @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\"}]}") @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") @PostMapping("/start")
@@ -39,6 +34,12 @@ public class WxFlowAbleController extends BaseController {
return wxFlowService.start(params,super.getUser().getId(),super.getUser().getName(),super.getTenantId()); 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({ @ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", 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"); logger.debug("[" + getIpAddr() + "] FlowAbleController::list");
return wxFlowService.list(flowType,pageNum,pageSize,super.getUser().getId()); 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\":\"\"}") @ApiOperation(value = "驳回",notes = "{\"taskId\":\"\",\"processInstanceId\":\"\",\"remark\":\"\"}")
@PostMapping(value = "reject") @PostMapping(value = "reject")
public ResultData reject(@RequestBody Map<String, String> params) {
public ResultData reject(@RequestBody Map<String, Object> params) {
return wxFlowService.reject(params,super.getUser().getId(),super.getUser().getName(),super.getTenantId()); 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<String, Object> params) {
return wxFlowService.setBack(params,super.getUser().getId(),super.getUser().getName());
}

/** /**
* 生成流程图 * 生成流程图
* *


+ 18
- 15
mallinkAdmin/src/main/resources/application-dev.yml View File

@@ -1,6 +1,6 @@
spring: spring:
profiles: profiles:
include: rabbitMQ
include: rocketMQ
# JDBC # JDBC
datasource: datasource:
url: jdbc:mysql://202.165.179.86:3306/mallinkDev?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false 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 auth: true
starttls: starttls:
enable: true 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: aws:
clientRegion: cn-northwest-1 clientRegion: cn-northwest-1
@@ -93,7 +99,4 @@ logging:
level: level:
tk.mybatis: debug tk.mybatis: debug
com.iformall: debug com.iformall: debug
path: ./logs/admin

#rocketMQ
rocketmq.name-server: 127.0.0.1:9876
path: ./logs/admin

Loading…
Cancel
Save