|
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collections;
|
|
@@ -176,4 +177,88 @@ public class ContractEvent extends BaseController {
|
|
|
throw new BusinessException("执行事件出错,请联系管理员!");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public String mainTypeFlow1(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
|
|
|
+ try {
|
|
|
+ String flowInstanceId = flowInstance.get("id").toString();
|
|
|
+ Contract entity = contractService.selectByInstanceId(flowInstanceId);
|
|
|
+ if(entity != null && entity.getMainType() != null && (entity.getMainType() == 2 || entity.getMainType() == 3)){
|
|
|
+ return "true";
|
|
|
+ }
|
|
|
+ return "false";
|
|
|
+ } catch (Exception ex) {
|
|
|
+ return error(ex.getMessage(), ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public String mainTypeFlow2(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
|
|
|
+ try {
|
|
|
+ String flowInstanceId = flowInstance.get("id").toString();
|
|
|
+ Contract entity = contractService.selectByInstanceId(flowInstanceId);
|
|
|
+ if(entity != null && entity.getMainType() != null && entity.getMainType() == 1){
|
|
|
+ return "true";
|
|
|
+ }
|
|
|
+ return "false";
|
|
|
+ } catch (Exception ex) {
|
|
|
+ return error(ex.getMessage(), ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public String amountGt5(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
|
|
|
+ try {
|
|
|
+ String flowInstanceId = flowInstance.get("id").toString();
|
|
|
+ Contract entity = contractService.selectByInstanceId(flowInstanceId);
|
|
|
+ if(entity != null && entity.getContractAmount() != null && entity.getContractAmount().compareTo(new BigDecimal("50000")) > 0 ){
|
|
|
+ return "true";
|
|
|
+ }
|
|
|
+ return "false";
|
|
|
+ } catch (Exception ex) {
|
|
|
+ return error(ex.getMessage(), ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public String amountLe5(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
|
|
|
+ try {
|
|
|
+ String flowInstanceId = flowInstance.get("id").toString();
|
|
|
+ Contract entity = contractService.selectByInstanceId(flowInstanceId);
|
|
|
+ if(entity != null && entity.getContractAmount() != null && entity.getContractAmount().compareTo(new BigDecimal("50000")) <= 0 ){
|
|
|
+ return "true";
|
|
|
+ }
|
|
|
+ return "false";
|
|
|
+ } catch (Exception ex) {
|
|
|
+ return error(ex.getMessage(), ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public String amountGt20(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
|
|
|
+ try {
|
|
|
+ String flowInstanceId = flowInstance.get("id").toString();
|
|
|
+ Contract entity = contractService.selectByInstanceId(flowInstanceId);
|
|
|
+ if(entity != null && entity.getContractAmount() != null && entity.getContractAmount().compareTo(new BigDecimal("200000")) > 0 ){
|
|
|
+ return "true";
|
|
|
+ }
|
|
|
+ return "false";
|
|
|
+ } catch (Exception ex) {
|
|
|
+ return error(ex.getMessage(), ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public String amountLe20(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
|
|
|
+ try {
|
|
|
+ String flowInstanceId = flowInstance.get("id").toString();
|
|
|
+ Contract entity = contractService.selectByInstanceId(flowInstanceId);
|
|
|
+ if(entity != null && entity.getContractAmount() != null && entity.getContractAmount().compareTo(new BigDecimal("200000")) <= 0 ){
|
|
|
+ return "true";
|
|
|
+ }
|
|
|
+ return "false";
|
|
|
+ } catch (Exception ex) {
|
|
|
+ return error(ex.getMessage(), ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|