Commit 5c5a87ea authored by chenyuxi's avatar chenyuxi

feat: 不购买商险审核代码提交

parent 5b0899d4
......@@ -114,6 +114,7 @@
<module>yifu-msg</module>
<module>yifu-permission</module>
<module>yifu-ekp</module>
<module>yifu-process</module>
</modules>
<dependencyManagement>
......
......@@ -42,5 +42,6 @@
<module>yifu-common-swagger</module>
<module>yifu-common-ldap</module>
<module>yifu-common-ekp</module>
<module>yifu-common-process</module>
</modules>
</project>
......@@ -202,4 +202,7 @@ public interface CacheConstants {
public static final String MVP_TOC_PHONE_CODE_PREFIX = "MVP_TOC_PHONE_CODE_";
public static final String WX_JSAPI_TICKET = "WX_JSAPI_TICKET";
// 商险不购买审批流分布式锁key InsuranceUnpurchase
public static final String INSURANCEUNPURCHASE_PROCESS_CACHE = ServiceNameConstants.SERVICE_NAME_MVP + "_" + "ProcessCache:InsuranceUnpurchase";
}
......@@ -636,4 +636,18 @@ public interface CommonConstants {
String USER_DIR = "user.dir";
String DOUBLE_LINE = "//";
public static final int THIRTY_INT = 30;
public static final int TWENTY_SEVEN_INT = 27;
/**
*未删除标志
**/
public static final String NOT_DELETE_FLAG = "0";
/**
*已删除标志
**/
public static final String DELETE_FLAG = "1";
//单条数据检索SQL
public static final String SQL_LIMIT_ONE = " limit 1 ";
}
......@@ -50,4 +50,6 @@ public interface ServiceNameConstants {
* hr b端Client id
**/
String CLIENT_ID_HR_B = "hrCustomer";
String SERVICE_NAME_MVP = "mvp";
}
......@@ -93,6 +93,37 @@ public class Common {
return false;
}
/**
* 集合不为空
*
* @param collection
* @return
*/
public static boolean isNotKong(Collection collection) {
return null != collection && collection.size() > 0;
}
/**
* obj不是null
*
* @param obj
* @return
* @author: fxj
*/
public static boolean isNotKong(Object obj) {
return null != obj;
}
/**
* 集合为空
*
* @param collection
* @return
*/
public static boolean isEmpty(Collection collection) {
return null == collection || collection.size() == 0;
}
// 金额验证
public static boolean isNumber(String str) {
// 判断小数点后2位的数字的正则表达式
......
package com.yifu.cloud.plus.v1.yifu.common.core.util.bean;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import java.util.HashSet;
import java.util.Set;
/**
* @auther wangan
* @date 2019/12/3
* bean复制,忽视空串
*/
public class BeanCopyUtils {
public static String[] getNullPropertyNames(Object source) {
final BeanWrapper src = new BeanWrapperImpl(source);
java.beans.PropertyDescriptor[] pds = src.getPropertyDescriptors();
Set<String> emptyNames = new HashSet<>();
for (java.beans.PropertyDescriptor pd : pds) {
Object srcValue = src.getPropertyValue(pd.getName());
if (srcValue == null) {
emptyNames.add(pd.getName());
}
}
String[] result = new String[emptyNames.size()];
return emptyNames.toArray(result);
}
public static void copyProperties(Object src, Object target) {
BeanUtils.copyProperties(src, target, getNullPropertyNames(src));
}
}
......@@ -62,6 +62,18 @@
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-process-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-process</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<properties>
......@@ -69,4 +81,4 @@
<maven.compiler.target>8</maven.compiler.target>
</properties>
</project>
\ No newline at end of file
</project>
package com.yifu.cloud.plus.v1.yifu.common.dapr.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @author chenyuxi
* @date 2025/01/09
* @version 1.7.5
*/
@Data
@Component
@PropertySource("classpath:daprConfig.properties")
@ConfigurationProperties(value = "dapr.process", ignoreInvalidFields = false)
public class DaprProcessProperties {
String appUrl;
String appId;
String appPort;
String httpPort;
String grpcPort;
String metricsPort;
}
package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprProcessProperties;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
/**
* @Author huyc
* @Date 2022-07-18
* @Description
* @Version 1.0
*/
@Log4j2
@EnableConfigurationProperties(DaprProcessProperties.class)
public class ProcessDaprUtils {
@Autowired
private DaprProcessProperties daprProcessProperties;
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>yifu-common-process</artifactId>
<packaging>jar</packaging>
<description>审批流程-工具类</description>
<dependencies>
<!-- core 工具类 -->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-core</artifactId>
</dependency>
<!--UPMS API-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-upms-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>
<!--swagger 注解-->
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
<!--mybatis 依赖-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-mybatis</artifactId>
</dependency>
<!-- 编译表达式 -->
<dependency>
<groupId>com.googlecode.aviator</groupId>
<artifactId>aviator</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>
package com.yifu.cloud.plus.v1.yifu.process.constant;
/**
* @auther wangan
* @date 2020/9/17
*/
public class ProcessConstants {
//审批中心各个节点类型
public static final String PROCESS_NODE_TYPE_CHOICE = "choice";
public static final String PROCESS_NODE_BEGIN = "begin";
public static final String PROCESS_NODE_END = "end";
public static final String PROCESS_NODE_EMBED = "embed";
public static final String PROCESS_NODE_SERVICE = "service";
// 【含风险项目商险不购买申请流程】条件判断审批节点名称
public static final String PROCESS_NODE_INSURANCEUNPURCHASE_REASON_TYPE = "是否为已购买社保";
public static final String PROCESS_NODE_INSURANCEUNPURCHASE_DEPT_PROPERTY = "是否属于子分公司";
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 流程处理权限表(允许多个,多个代表有主办和经办)
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_node_primission")
@Schema(description = "流程处理权限表(允许多个,多个代表有主办和经办)")
public class TNodePrimission extends Model<TNodePrimission> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@Length(max = 255, message = "指定用户处理节点不能超过255个字符")
@Schema(description = "指定用户处理节点")
private String user;
@Length(max = 255, message = "指定权限处理节点不能超过255个字符")
@Schema(description = "指定权限处理节点")
private String role;
@Length(max = 255, message = "指定职位处理节点不能超过255个字符")
@Schema(description = "指定职位处理节点")
private String post;
@Length(max = 255, message = "指定组织处理节点不能超过255个字符")
@Schema(description = "指定组织处理节点")
private String organization;
@NotBlank(message = "与流程申请人关系(0发起人部门主管/1同区域最高级/2所在单位最高级)不能为空")
@Length(max = 1, message = "与流程申请人关系(0发起人部门主管/1同区域最高级/2所在单位最高级)不能超过1个字符")
@Schema(description = "与流程申请人关系(0发起人部门主管/1同区域最高级/2所在单位最高级)")
private String realationCreateUser;
@NotBlank(message = "标识(系统自动生成MD5串)不能为空")
@Length(max = 255, message = "标识(系统自动生成MD5串)不能超过255个字符")
@Schema(description = "标识(系统自动生成MD5串)")
private String logoTitle;
@NotBlank(message = "节点ID不能为空")
@Length(max = 255, message = "节点ID不能超过255个字符")
@Schema(description = "节点ID")
private String nodeId;
@NotBlank(message = "办理类型(0主办/1经办;如果为经办,则必须有主办权限存在)不能为空")
@Length(max = 1, message = "办理类型(0主办/1经办;如果为经办,则必须有主办权限存在)不能超过1个字符")
@Schema(description = "办理类型(0主办/1经办;如果为经办,则必须有主办权限存在)")
private String dealType;
@NotBlank(message = "流程ID不能为空")
@Length(max = 255, message = "流程ID不能超过255个字符")
@Schema(description = "流程ID")
private String processId;
@NotBlank(message = "节点编码不能为空")
@Length(max = 255, message = "节点编码不能超过255个字符")
@Schema(description = "节点编码-关联节点")
private String nodeLogoTitle;
@Length(max = 1, message = "类型:不能超过1个字符")
@Schema(description = "类型:0指定职位;1与申请人关系;2指定权限;3指定用户;4指定组织;5指定角色(crm);6指定事业部配置表")
private Integer type;
@Length(max = 20, message = "指定角色id不能超过20个字符")
@Schema(description = "指定角色id")
private String approvalRole;
@Length(max = 10, message = "指定事业部配置表负责人标识不能超过10个字符")
@Schema(description = "指定事业部配置表负责人标识")
private String divisionIdentification;
@Length(max = 1, message = "是否允许直接通过不能超过1个字符")
@Schema(description = "是否允许直接通过(0:不允许,1允许)")
private String isPass;
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 流程审阅权限表(抄送/仅有查看权限)
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_node_reader_promission")
@Schema(description = "流程审阅权限表(抄送/仅有查看权限)")
public class TNodeReaderPromission extends Model<TNodeReaderPromission> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@Length(max = 255, message = "指定用户处理节点不能超过255个字符")
@Schema(description = "指定用户处理节点")
private String user;
@Length(max = 255, message = "指定权限处理节点不能超过255个字符")
@Schema(description = "指定权限处理节点")
private String role;
@Length(max = 255, message = "指定职位处理节点不能超过255个字符")
@Schema(description = "指定职位处理节点")
private String post;
@Length(max = 255, message = "指定组织处理节点不能超过255个字符")
@Schema(description = "指定组织处理节点")
private String organization;
@NotBlank(message = "与流程申请人关系(0上级/1同区域最高级/2同部门最高级)不能为空")
@Length(max = 1, message = "与流程申请人关系(0上级/1同区域最高级/2同部门最高级)不能超过1个字符")
@Schema(description = "与流程申请人关系(0上级/1同区域最高级/2同部门最高级)")
private String realationCreateUser;
@NotBlank(message = "标识(系统自动生成MD5串)不能为空")
@Length(max = 255, message = "标识(系统自动生成MD5串)不能超过255个字符")
@Schema(description = "标识(系统自动生成MD5串)")
private String logoTitle;
@NotBlank(message = "节点ID不能为空")
@Length(max = 255, message = "节点ID不能超过255个字符")
@Schema(description = "节点ID")
private String nodeId;
@NotBlank(message = "流程ID不能为空")
@Length(max = 255, message = "流程ID不能超过255个字符")
@Schema(description = "流程ID")
private String processId;
@NotBlank(message = "节点编码不能为空")
@Length(max = 255, message = "节点编码不能超过255个字符")
@Schema(description = "节点编码")
private String nodeLogoTitle;
@Length(max = 1, message = "类型:不能超过1个字符")
@Schema(description = "类型:0指定职位;1与申请人关系;2指定权限;3指定用户;4指定组织;5指定角色(crm)")
private Integer type;
@Length(max = 20, message = "指定角色id不能超过20个字符")
@Schema(description = "指定角色id")
private String approvalRole;
@Length(max = 20, message = "指定使用的代码自定义判断的标识字段不能超过20个字符")
@Schema(description = "指定使用的代码自定义判断的标识字段")
private String customizeField;
@Schema(description = "是否代码自定义")
private String isCustomize;
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import java.util.List;
/**
* 流程路由表(节点与节点之间的路由关系)
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_node_route")
@Schema(description = "流程路由表(节点与节点之间的路由关系)")
public class TNodeRoute extends Model<TNodeRoute> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "流程ID不能为空")
@Length(max = 255, message = "流程ID不能超过255个字符")
@Schema(description = "流程ID")
private String processId;
@Length(max = 255, message = "前置节点不能超过255个字符")
@Schema(description = "前置节点")
private String prewNode;
@NotBlank(message = "下个节点不能为空")
@Length(max = 255, message = "下个节点不能超过255个字符")
@Schema(description = "下个节点")
private String nextNode;
@Length(max = 1, message = "连线起点位置不能超过1个字符")
@Schema(description = "连线起点位置")
private String preNodeAnchor;
@Length(max = 1, message = "连线终点位置不能超过1个字符")
@Schema(description = "连线终点位置")
private String nextNodeAnchor;
@Length(max = 100, message = "元素的图形:不能超过100个字符")
@Schema(description = "元素的图形")
private String shape;
@Length(max = 255, message = "标识(系统自动生成MD5串)不能超过255个字符")
@Schema(description = "标识(系统自动生成MD5串)")
private String logoTitle;
@NotBlank(message = "创建人不能为空")
@Length(max = 255, message = "创建人不能超过255个字符")
@Schema(description = "创建人")
private String createUser;
@Schema(description = "创建时间")
private LocalDateTime createDate;
@Length(max = 255, message = "更新人不能超过255个字符")
@Schema(description = "更新人")
private String updateUser;
@Schema(description = "更新时间")
private LocalDateTime updateDate;
@NotBlank(message = "路由名称(默认为“未命名”,添加时需要保存格式为:前置节点名称(to:下一节点名称))不能为空")
@Length(max = 255, message = "路由名称(默认为“未命名”,添加时需要保存格式为:前置节点名称(to:下一节点名称))不能超过255个字符")
@Schema(description = "路由名称(默认为“未命名”,添加时需要保存格式为:前置节点名称(to:下一节点名称))")
private String name;
@Length(max = 255, message = "描述不能超过255个字符")
@Schema(description = "描述")
private String description;
@Schema(description = "顺序号")
private Integer sequenceNo;
@Length(max = 255, message = "默认意见不能超过255个字符")
@Schema(description = "默认意见")
private String opinion;
@NotBlank(message = "意见是否必填(0是/1否)不能为空")
@Length(max = 1, message = "意见是否必填(0是/1否)不能超过1个字符")
@Schema(description = "意见是否必填(0是/1否)")
private String opinionMustFlag;
@NotBlank(message = "路由类型(1默认路由/2回退路由/3转交(转交不触发活动事件))不能为空")
@Length(max = 1, message = "路由类型(1默认路由/2回退路由/3转交(转交不触发活动事件))不能超过1个字符")
@Schema(description = "路由类型(1默认路由/2回退路由/3转交(转交不触发活动事件))")
private String routeType;
@NotBlank(message = "是否优先(0是/1否:仅在分支/并列下使用,单节点路由不存在优先级)不能为空")
@Length(max = 1, message = "是否优先(0是/1否:仅在分支/并列下使用,单节点路由不存在优先级)不能超过1个字符")
@Schema(description = "是否优先(0是/1否:仅在分支/并列下使用,单节点路由不存在优先级)")
private String priorityFlag;
@NotBlank(message = "活动超时时自动流转(0是/1否)不能为空")
@Length(max = 1, message = "活动超时时自动流转(0是/1否)不能超过1个字符")
@Schema(description = "活动超时时自动流转(0是/1否)")
private String timeoutRoam;
@NotBlank(message = "与上一活动处理人相同时自动流转(0是/1否)不能为空")
@Length(max = 1, message = "与上一活动处理人相同时自动流转(0是/1否)不能超过1个字符")
@Schema(description = "与上一活动处理人相同时自动流转(0是/1否)")
private String sameForPrew;
@TableField(exist = false)
List<TNodeRouteCondition> nodeRouteConditionList;
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 流程路由条件
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_node_route_condition")
@Schema(description = "流程路由条件")
public class TNodeRouteCondition extends Model<TNodeRouteCondition> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "条件字段不能为空")
@Length(max = 255, message = "条件字段不能超过255个字符")
@Schema(description = "条件字段")
private String field;
@NotBlank(message = "判断条件:大于/等于/大于等于/小于/小于等于/不等于/包含/不包含不能为空")
@Length(max = 255, message = "判断条件:大于/等于/大于等于/小于/小于等于/不等于/包含/不包含不能超过255个字符")
@Schema(description = "判断条件:大于/等于/大于等于/小于/小于等于/不等于/包含/不包含")
private String conditions;
@NotBlank(message = "参与判定的值(可能存在类型转换)不能为空")
@Length(max = 255, message = "参与判定的值(可能存在类型转换)不能超过255个字符")
@Schema(description = "参与判定的值(可能存在类型转换)")
private String conditionValue;
@NotBlank(message = "与其他条件之间的关系(0没有关系或单独条件/1或的关系/2并且关系)不能为空")
@Length(max = 1, message = "与其他条件之间的关系(0没有关系或单独条件/1或的关系/2并且关系)不能超过1个字符")
@Schema(description = "与其他条件之间的关系(0没有关系或单独条件/1或的关系/2并且关系)")
private String realation;
@NotBlank(message = "流程路由ID不能为空")
@Length(max = 255, message = "流程路由ID不能超过255个字符")
@Schema(description = "流程路由ID")
private String nodeRouteId;
@NotBlank(message = "类型:1.正常条件 2.正则表达式'不能为空")
@Length(max = 255, message = "类型:1.正常条件 2.正则表达式255个字符")
@Schema(description = "类型:1.正常条件 2.正则表达式")
private String type;
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 流程调用配置(子流程调用)
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_node_transfer_config")
@Schema(description = "流程调用配置(子流程调用)")
public class TNodeTransferConfig extends Model<TNodeTransferConfig> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "流程节点ID不能为空")
@Length(max = 255, message = "流程节点ID不能超过255个字符")
@Schema(description = "流程节点ID")
private String nodeId;
@NotBlank(message = "流程ID不能为空")
@Length(max = 255, message = "流程ID不能超过255个字符")
@Schema(description = "流程ID")
private String processId;
@NotBlank(message = "调用方式(0同步/1异步)不能为空")
@Length(max = 1, message = "调用方式(0同步/1异步)不能超过1个字符")
@Schema(description = "调用方式(0同步/1异步)")
private String transferType;
@NotBlank(message = "是否拷贝数据(0是/1否)不能为空")
@Length(max = 1, message = "是否拷贝数据(0是/1否)不能超过1个字符")
@Schema(description = "是否拷贝数据(0是/1否)")
private String copyData;
@NotBlank(message = "是否拷贝附件(0是/1否)不能为空")
@Length(max = 1, message = "是否拷贝附件(0是/1否)不能超过1个字符")
@Schema(description = "是否拷贝附件(0是/1否)")
private String copyAtta;
@NotBlank(message = "启动者(0当前流程的启动者/1上一个活动的处理人/2指定一个启动者)不能为空")
@Length(max = 1, message = "启动者(0当前流程的启动者/1上一个活动的处理人/2指定一个启动者)不能超过1个字符")
@Schema(description = "启动者(0当前流程的启动者/1上一个活动的处理人/2指定一个启动者)")
private String starterType;
@Length(max = 255, message = "启动者(STARTER_TYPE 为2时启用)不能超过255个字符")
@Schema(description = "启动者(STARTER_TYPE 为2时启用)")
private String starter;
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;
/**
* 流程节点表
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_process_node")
@Schema(description = "流程节点表")
public class TProcessNode extends Model<TProcessNode> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**
* 类型:{
* begin:开始
* end:结束
* cancel:取消
* choice:选择
* split:拆分
* parallel:并行
* merge:合并
* embed:流程调用
* delay:定时
* invoke:服务调用
* service:服务
* agent:脚本
* }
*/
@NotBlank(message = "类型:不能为空")
@Length(max = 20, message = "类型:不能超过20个字符")
@Schema(description = "类型")
private String type;
@NotBlank(message = "标识(自动生成MD5串)不能为空")
@Length(max = 255, message = "标识(自动生成MD5串)不能超过255个字符")
@Schema(description = "标识(自动生成MD5串)")
private String logoTitle;
@NotBlank(message = "节点名称不能为空")
@Length(max = 255, message = "节点名称不能超过255个字符")
@Schema(description = "节点名称")
private String name;
@Length(max = 255, message = "节点描述不能超过255个字符")
@Schema(description = "节点描述")
private String description;
@Length(max = 255, message = "表单ID不能超过255个字符")
@Schema(description = "表单ID", name = "form")
private String form;
@NotBlank(message = "是否允许调度(0是/1否)不能为空")
@Length(max = 1, message = "是否允许调度(0是/1否)不能超过1个字符")
@Schema(description = "是否允许调度(0是/1否)")
private String allowDispatch;
@NotBlank(message = "是否允许调度到此活动不能为空")
@Length(max = 1, message = "是否允许调度到此活动不能超过1个字符")
@Schema(description = "是否允许调度到此活动")
private String allowThis;
@NotBlank(message = "流程ID不能为空")
@Length(max = 255, message = "流程ID不能超过255个字符")
@Schema(description = "流程ID")
private String processId;
@NotBlank(message = "经办人是否允许办理完成后进入下一步(0允许/1不允许)不能为空")
@Length(max = 1, message = "经办人是否允许办理完成后进入下一步(0允许/1不允许)不能超过1个字符")
@Schema(description = "经办人是否允许办理完成后进入下一步(0允许/1不允许)")
private String handleAllowNext;
@NotBlank(message = "会签方式(0允许会签/1强制会签/2禁止会签)不能为空")
@Length(max = 1, message = "会签方式(0允许会签/1强制会签/2禁止会签)不能超过1个字符")
@Schema(description = "会签方式(0允许会签/1强制会签/2禁止会签)")
private String countersign;
@NotBlank(message = "回退方式(0不允许/1回退上一步/2回退至起点)不能为空")
@Length(max = 1, message = "回退方式(0不允许/1回退上一步/2回退至起点)不能超过1个字符")
@Schema(description = "回退方式(0不允许/1回退上一步/2回退至起点)")
private String backType;
@Length(max = 100, message = "元素的图形:不能超过100个字符")
@Schema(description = "元素的图形")
private String shape;
@Length(max = 100, message = "节点大小:不能超过100个字符")
@Schema(description = "节点大小")
private String size;
@Length(max = 20, message = "X坐标:不能超过20个字符")
@Schema(description = "X坐标")
private String coordinatex;
@Length(max = 20, message = "Y坐标:不能超过20个字符")
@Schema(description = "Y坐标")
private String coordinatey;
@Length(max = 50, message = "颜色:不能超过50个字符")
@Schema(description = "颜色")
private String color;
@TableField(exist = false)
private List<TNodePrimission> nodePrimissionList = new ArrayList<>();
@TableField(exist = false)
private List<TNodeReaderPromission> nodeReaderPromissionList = new ArrayList<>();
@TableField(exist = false)
private List<TNodeTransferConfig> nodeTransferConfigs;
@Schema(description = "允许加签")
private String allowAddSign;
/**
* 节点抄送权限列表(流程预览使用,将当前节点的抄送权限绑定在下一个节点上,因为当前的代码逻辑不返回抄送节点,有冲突)
* 【之后优化@TableField注解,不能在实体类里面直接用@TableField,要建一个包装类】
*/
@TableField(exist = false)
private List<TNodeReaderPromission> preNodeReaderPromissionList = new ArrayList<>();
}
package com.yifu.cloud.plus.v1.yifu.process.util;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodePrimission;
import java.util.ArrayList;
import java.util.List;
/**
* @author chenyuxi
* @date 2020/9/22
* 通用流程工具类
*/
public class CommonProcessUserUtil {
private CommonProcessUserUtil() {
}
public static final String FEGIN_USER_FAIL = "调用用户服务失败";
public static final String FEGIN_USER_RETURN_FAIL = "调用用户服务回失败";
/**
* 获取crm部门审核人
* @param nodePrimission
* @param departId
* @return List<SysUser>
**/
public static List<SysUser> getDepartAuditUser(TNodePrimission nodePrimission, String departId) {
SysUser remoteSysUser = null;
List<SysUser> remoteSysUserList = new ArrayList<>();
if (CommonConstants.THREE_INT == nodePrimission.getType().intValue()) {
//3.指定用户
if (Common.isEmpty(nodePrimission.getUser())) {
throw new CheckedException("未查询当前流程权限对应的用户");
}
// 查找当前用户
// todo 通过用户id查询用户角色
// remoteSysUser = RemoteRequestUtil.getSysUser(remoteUserService, Integer.parseInt(nodePrimission.getUser()));
remoteSysUserList.add(remoteSysUser);
} else if (CommonConstants.TWO_INT == nodePrimission.getType().intValue()) {
//2.指定角色
if (Common.isEmpty(nodePrimission.getRole())) {
throw new CheckedException("未查询当前流程对应的组织权限");
}
//如果下个节点是角色这要取下个角色是否存在
// remoteSysUser = RemoteRequestUtil.getUserManagerByRoleAndDepartId(remoteUserService, departId, nodePrimission.getRole());
remoteSysUserList.add(remoteSysUser);
} else if (CommonConstants.FIVE_INT == nodePrimission.getType().intValue()){
// 5.指定角色(crm)
if (Common.isEmpty(nodePrimission.getApprovalRole())) {
throw new CheckedException("未查询当前节点配置的审核角色");
}
// remoteSysUserList = RemoteRequestUtil.getUserByRoleIdForCrm(remoteUserService, departId, nodePrimission.getApprovalRole());
}
return remoteSysUserList;
}
}
package com.yifu.cloud.plus.v1.yifu.process.util;
import com.alibaba.fastjson.JSON;
import com.googlecode.aviator.AviatorEvaluator;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* @auther wangan
* @date 2020/9/2
* goole表达式
*/
@Slf4j
public class ExpressionUtil {
private ExpressionUtil() {
}
/**
* @param expression
* @param obj
* @Author: wangan
* @Date: 2020/9/2
* @Description: 根据表达式判断数据大小
* @return: boolean
**/
public static boolean isMatchExpression(String expression, Object obj) {
Map<String, Object> env = new HashMap<>();
if (obj instanceof BigDecimal) {
env.put("x", Double.parseDouble(obj.toString()));
} else {
env.put("x", obj.toString());
}
try {
return (Boolean) AviatorEvaluator.execute(expression, env);
} catch (Exception e) {
log.error("表达式数据{},表达式{}",expression, JSON.toJSONString(env));
log.error("执行异常",e);
throw new CheckedException("表达式执行出错");
}
}
/**
* @param expression
* @param obj1
* @param obj2
* @Author: wangan
* @Date: 2020/9/2
* @Description: 根据表达式判断数据大小
* @return: boolean
**/
public static boolean isMatchExpression(String expression, Object obj1,Object obj2) {
Map<String, Object> env = new HashMap<>();
if (obj1 instanceof BigDecimal) {
env.put("x", Double.parseDouble(obj1.toString()));
} else {
env.put("x", obj1.toString());
}
if (obj2 instanceof BigDecimal) {
env.put("y", Double.parseDouble(obj2.toString()));
} else {
env.put("y", obj2.toString());
}
try {
return (Boolean) AviatorEvaluator.execute(expression, env);
} catch (Exception e) {
log.error("表达式数据{},表达式{}",expression, JSON.toJSONString(env));
log.error("执行异常",e);
throw new CheckedException("表达式执行出错");
}
}
}
package com.yifu.cloud.plus.v1.yifu.process.vo;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* @Description: 流程需要删除的idsVo
* @Author: hgw
* @Date: 2020-7-27 11:04:13
* @return:
**/
@Getter
@Setter
public class DeleteProcessIdsVo implements Serializable {
private static final long serialVersionUID = 1L;
// 节点ids
private String[] nodeIds;
// 子流程ids
private String[] nodeTransferConfigIds;
// 线ids
private String[] roteIds;
// 线权限ids
private String[] roteConditionIds;
// 权限ids
private String[] primissionIds;
// 抄送ids
private String[] readPrimissionIds;
}
package com.yifu.cloud.plus.v1.yifu.process.vo;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodeRoute;
import com.yifu.cloud.plus.v1.yifu.process.entity.TProcessNode;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.List;
/**
* @Description: 流程Vo
* @Author: hgw
* @Date: 2019/10/23 15:40
* @return:
**/
@Getter
@Setter
public class ProcessVo implements Serializable {
private static final long serialVersionUID = 1L;
// 主流程id
private String processId;
private String name;
// 节点list
private List<TProcessNode> processNodeList;
// 流程路由list
private List<TNodeRoute> nodeRouteList;
// 删除的ids
private DeleteProcessIdsVo deleteIdsVo;
// 标志是否是流程预览 0是 1否
private String isPreview;
}
package com.yifu.cloud.plus.v1.yifu.process.vo;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodePrimission;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @program: yifu_cloud
* @description: 流程处理权限vo类
* @author: wangdayu
* @create: 2023-10-23 17:28
* @since:
*/
@Data
public class TNodePrimissionVo extends TNodePrimission implements Serializable {
@Schema(description = "审核人姓名")
private String userName;
}
package com.yifu.cloud.plus.v1.yifu.process.vo;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodeReaderPromission;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @program: yifu_cloud
* @description: 抄送权限vo类
* @author: wangdayu
* @create: 2023-10-23 17:30
* @since:
*/
@Data
public class TNodeReaderPromissionVo extends TNodeReaderPromission implements Serializable {
@Schema(description = "审核人姓名")
private String userName;
}
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* 审批记录表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@Data
@TableName("t_approval_record")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "审批记录表")
public class TApprovalRecord extends BaseEntity {
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "流程id不能为空")
@Length(max = 32, message = "流程id不能超过32个字符")
@Schema(description = "流程id")
private String flowId;
@NotBlank(message = "实体id不能为空")
@Length(max = 32, message = "实体id不能超过32个字符")
@Schema(description = "实体id")
private String domainId;
@NotBlank(message = "节点id不能为空")
@Length(max = 32, message = "节点id不能超过32个字符")
@Schema(description = "节点id")
private String nodeId;
@NotBlank(message = "审核人id不能为空")
@Length(max = 32, message = "审核人id不能超过32个字符")
@Schema(description = "审核人id")
private String approvalMan;
@NotBlank(message = "审核人姓名不能为空")
@Length(max = 50, message = "审核人姓名不能超过50个字符")
@Schema(description = "审核人姓名")
private String approvalManName;
@Schema(description = "审核时间")
private LocalDateTime approvalTime;
@Length(max = 1, message = "审核结果0:通过1:不通过 2 待审核不能超过1个字符")
@Schema(description = "审核结果0:通过1:不通过 2 待审核 3提交")
private String approvalResult;
@Length(max = 500, message = "审核意见不能超过500个字符")
@Schema(description = "审核意见")
private String approvalOpinion;
@Length(max = 1, message = "删除表示 0未删除 1删除不能超过1个字符")
@Schema(description = "删除表示 0未删除 1删除")
@TableLogic
private String deleteFlag;
@Length(max = 1, message = "之前审核记录标识不能超过1个字符")
@Schema(description = "之前审核记录标识 0之前记录 1当前审核记录。用于当前审核流程过滤判断")
private String preFlag;
@Length(max = 32, message = "提交人id不能超过32个字符")
@Schema(description = "提交人id")
private String submitMan;
@Length(max = 32, message = "提交人姓名不能超过32个字符")
@Schema(description = "提交人姓名")
private String submitManName;
@Length(max = 500, message = "申请原因不能超过500个字符")
@Schema(description = "申请原因")
private String reason;
@Length(max = 2, message = "审核类型 0不购买商险审核不能超过2个字符")
@Schema(description = "审核类型 0不购买商险审核")
private String auditType;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Length(max = 50, message = "节点名称不能超过50个字符")
@Schema(description = "节点名称")
private String nodeName;
@Length(max = 300, message = "实体名称不能超过300个字符")
@Schema(description = "实体名称")
private String entityName;
@Schema(description = "提交时间")
private LocalDateTime submitCreateTime;
@Length(max = 1, message = "退回状态 0 未退回 1已退回不能超过1个字符")
@Schema(description = "退回状态 0 未退回 1已退回")
private String backFlag;
@Length(max = 50, message = "退回节点名称不能超过50个字符")
@Schema(description = "退回节点名称")
private String backNodeName;
@Length(max = 32, message = "退回节点Id不能超过32个字符")
@Schema(description = "退回节点Id")
private String backNodeId;
@Length(max = 32, message = "加签节点的id不能超过32个字符")
@Schema(description = "加签节点的id")
private String addSignNodeId;
}
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* 审批抄送记录信息表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@Data
@TableName("t_audit_copy_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "审批抄送记录信息表")
public class TAuditCopyInfo extends BaseEntity {
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "抄送人id不能为空")
@Length(max = 32, message = "抄送人id不能超过32个字符")
@Schema(description = "抄送人id")
private String auditUserId;
@NotBlank(message = "抄送人姓名不能为空")
@Length(max = 32, message = "抄送人姓名不能超过32个字符")
@Schema(description = "抄送人姓名")
private String auditUser;
@Length(max = 32, message = "实体id不能超过32个字符")
@Schema(description = "实体id")
private String domainId;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Length(max = 32, message = "流程id不能超过32个字符")
@Schema(description = "流程id")
private String flowId;
@Length(max = 32, message = "节点id不能超过32个字符")
@Schema(description = "节点id")
private String nodeId;
@Length(max = 1, message = "删除表示 0未删除 1删除不能超过1个字符")
@Schema(description = "删除表示 0未删除 1删除")
@TableLogic
private String deleteFlag;
@Length(max = 50, message = "节点名称不能超过50个字符")
@Schema(description = "节点名称")
private String nodeName;
@Length(max = 2, message = "审核类型 0不购买商险审核不能超过2个字符")
@Schema(description = "审核类型 0不购买商险审核")
private String auditType;
@Length(max = 1, message = "之前审核记录标识 不能超过1个字符")
@Schema(description = "之前审核记录标识 0之前记录 1当前审核记录。用于当前审核流程过滤判断")
private String preFlag;
@Length(max = 32, message = "提交人id不能超过32个字符")
@Schema(description = "提交人id")
private String submitMan;
@Length(max = 32, message = "提交人姓名不能超过32个字符")
@Schema(description = "提交人姓名")
private String submitManName;
@Schema(description = "提交时间")
private LocalDateTime submitCreateTime;
}
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* 审批主流程记录表节点表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@Data
@TableName("t_audit_node_proocess")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "审批主流程记录表节点表")
public class TAuditNodeProocess extends BaseEntity {
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "流程id不能为空")
@Length(max = 32, message = "流程id不能超过32个字符")
@Schema(description = "流程id")
private String processId;
@NotBlank(message = "节点id不能为空")
@Length(max = 32, message = "节点id不能超过32个字符")
@Schema(description = "节点id")
private String nodeId;
@NotBlank(message = "节点类型不能为空")
@Length(max = 32, message = "节点类型不能超过32个字符")
@Schema(description = "节点类型")
private String nodeType;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Length(max = 32, message = "实体id不能超过32个字符")
@Schema(description = "实体id")
private String domainId;
@NotBlank(message = "0主流程,1子流程不能为空")
@Length(max = 1, message = "0主流程,1子流程不能超过1个字符")
@Schema(description = "0主流程,1子流程")
private String mainType;
@Length(max = 255, message = "节点标识不能超过255个字符")
@Schema(description = "节点标识")
private String logoTitle;
@Length(max = 32, message = "节点名称不能超过32个字符")
@Schema(description = "节点名称")
private String nodeName;
@Length(max = 32, message = "流程名称不能超过32个字符")
@Schema(description = "流程名称")
private String processName;
@Length(max = 32, message = "父流程id不能超过32个字符")
@Schema(description = "父流程id")
private String parentProcessId;
@Length(max = 1, message = "删除表示 0未删除 1删除不能超过1个字符")
@Schema(description = "删除表示 0未删除 1删除")
@TableLogic
private String deleteFlag;
@Length(max = 2, message = "审核类型 0客户新增 1.客户信息变更 2合同审核流程 3合同办理 4商机审核 5报价单 6团队共享不能超过2个字符")
@Schema(description = "审核类型 0客户新增 1.客户信息变更 2合同审核流程 3合同办理 4商机审核 5报价单 6团队共享")
private String type;
@Length(max = 32, message = "加签节点的父节点id(不是加签节点的默认设置为0)不能超过32个字符")
@Schema(description = "加签节点的父节点id(不是加签节点的默认设置为0)")
private String addSignParentNodeId;
@Length(max = 32, message = "加签节点的审核部门id(不是加签节点的默认设置为0)不能超过32个字符")
@Schema(description = "加签节点的审核部门id(不是加签节点的默认设置为0)")
private String addSignDepartmentId;
@Length(max = 32, message = "实体名称不能超过32个字符")
@Schema(description = "实体名称")
private String domainName;
@Length(max = 255, message = "加签人id不能超过255个字符")
@Schema(description = "加签人id")
private String addSignApprovalMan;
@Length(max = 255, message = "加签人名字不能超过255个字符")
@Schema(description = "加签人名字")
private String addSignApprovalManName;
}
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -58,6 +55,7 @@ public class TInsuranceUnpurchaseApply extends BaseEntity {
private String companyFlag;
@Schema(description = "是否删除 0未删除/1删除")
@TableLogic
private String deleteFlag;
@Schema(description = "申请状态 0 草稿 1待提交 2 待审核 3 审核通过 4 审核不通过")
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 审批记录表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
*/
@Data
public class TApprovalRecordSearchVo extends TApprovalRecord {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TApprovalRecordService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TApprovalRecordSearchVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 审批记录表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tapprovalrecord" )
@Tag(name = "审批记录表管理")
public class TApprovalRecordController {
private final TApprovalRecordService tApprovalRecordService;
/**
* 简单分页查询
* @param page 分页对象
* @param tApprovalRecord 审批记录表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TApprovalRecord>> getTApprovalRecordPage(Page<TApprovalRecord> page, TApprovalRecordSearchVo tApprovalRecord) {
return new R<>(tApprovalRecordService.getTApprovalRecordPage(page,tApprovalRecord));
}
/**
* 通过实体id和审核类型查询所有的审核记录
* @param domainId 实体id
* @param auditType 审核类型 0不购买商险审核
* @return R<Map<String, Object>> key=auditInfo表示审批记录列表
**/
@Operation(description = "通过实体id查询所有的审核记录")
@GetMapping("/getAuditInfoByDomainIdAndAuditType")
public R<Map<String, Object>> getAuditInfoByDomainIdAndAuditType(@RequestParam String domainId, @RequestParam String auditType) {
if (Common.isEmpty(domainId) || Common.isEmpty(auditType)) {
return R.failed("实体id或审核类型不能为空");
}
return tApprovalRecordService.getAuditInfoByDomainIdAndAuditType(domainId, auditType);
}
/**
* 通过id查询审批记录表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('insurances_tapprovalrecord_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_tapprovalrecord_get')" )
public R<TApprovalRecord> getById(@PathVariable("id" ) String id) {
return R.ok(tApprovalRecordService.getById(id));
}
/**
* 新增审批记录表
* @param tApprovalRecord 审批记录表
* @return R
*/
@Operation(summary = "新增审批记录表", description = "新增审批记录表:hasPermission('insurances_tapprovalrecord_add')")
@SysLog("新增审批记录表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('insurances_tapprovalrecord_add')" )
public R<Boolean> save(@RequestBody TApprovalRecord tApprovalRecord) {
return R.ok(tApprovalRecordService.save(tApprovalRecord));
}
/**
* 修改审批记录表
* @param tApprovalRecord 审批记录表
* @return R
*/
@Operation(summary = "修改审批记录表", description = "修改审批记录表:hasPermission('insurances_tapprovalrecord_edit')")
@SysLog("修改审批记录表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('insurances_tapprovalrecord_edit')" )
public R<Boolean> updateById(@RequestBody TApprovalRecord tApprovalRecord) {
return R.ok(tApprovalRecordService.updateById(tApprovalRecord));
}
/**
* 通过id删除审批记录表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除审批记录表", description = "通过id删除审批记录表:hasPermission('insurances_tapprovalrecord_del')")
@SysLog("通过id删除审批记录表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_tapprovalrecord_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tApprovalRecordService.removeById(id));
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditCopyInfo;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TAuditCopyInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
/**
* 审批抄送记录信息表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tauditcopyinfo" )
@Tag(name = "审批抄送记录信息表管理")
public class TAuditCopyInfoController {
private final TAuditCopyInfoService tAuditCopyInfoService;
/**
* 通过id查询审批抄送记录信息表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('insurances_tauditcopyinfo_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_tauditcopyinfo_get')" )
public R<TAuditCopyInfo> getById(@PathVariable("id" ) String id) {
return R.ok(tAuditCopyInfoService.getById(id));
}
/**
* 新增审批抄送记录信息表
* @param tAuditCopyInfo 审批抄送记录信息表
* @return R
*/
@Operation(summary = "新增审批抄送记录信息表", description = "新增审批抄送记录信息表:hasPermission('insurances_tauditcopyinfo_add')")
@SysLog("新增审批抄送记录信息表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('insurances_tauditcopyinfo_add')" )
public R<Boolean> save(@RequestBody TAuditCopyInfo tAuditCopyInfo) {
return R.ok(tAuditCopyInfoService.save(tAuditCopyInfo));
}
/**
* 修改审批抄送记录信息表
* @param tAuditCopyInfo 审批抄送记录信息表
* @return R
*/
@Operation(summary = "修改审批抄送记录信息表", description = "修改审批抄送记录信息表:hasPermission('insurances_tauditcopyinfo_edit')")
@SysLog("修改审批抄送记录信息表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('insurances_tauditcopyinfo_edit')" )
public R<Boolean> updateById(@RequestBody TAuditCopyInfo tAuditCopyInfo) {
return R.ok(tAuditCopyInfoService.updateById(tAuditCopyInfo));
}
/**
* 通过id删除审批抄送记录信息表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除审批抄送记录信息表", description = "通过id删除审批抄送记录信息表:hasPermission('insurances_tauditcopyinfo_del')")
@SysLog("通过id删除审批抄送记录信息表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_tauditcopyinfo_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tAuditCopyInfoService.removeById(id));
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TAuditNodeProocessService;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
/**
* 审批主流程记录表节点表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tauditnodeproocess" )
@Tag(name = "审批主流程记录表节点表管理")
public class TAuditNodeProocessController {
private final TAuditNodeProocessService tAuditNodeProocessService;
/**
* 通过id查询审批主流程记录表节点表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('insurances_tauditnodeproocess_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_tauditnodeproocess_get')" )
public R<TAuditNodeProocess> getById(@PathVariable("id" ) String id) {
return R.ok(tAuditNodeProocessService.getById(id));
}
/**
* 新增审批主流程记录表节点表
* @param tAuditNodeProocess 审批主流程记录表节点表
* @return R
*/
@Operation(summary = "新增审批主流程记录表节点表", description = "新增审批主流程记录表节点表:hasPermission('insurances_tauditnodeproocess_add')")
@SysLog("新增审批主流程记录表节点表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('insurances_tauditnodeproocess_add')" )
public R<Boolean> save(@RequestBody TAuditNodeProocess tAuditNodeProocess) {
return R.ok(tAuditNodeProocessService.save(tAuditNodeProocess));
}
/**
* 修改审批主流程记录表节点表
* @param tAuditNodeProocess 审批主流程记录表节点表
* @return R
*/
@Operation(summary = "修改审批主流程记录表节点表", description = "修改审批主流程记录表节点表:hasPermission('insurances_tauditnodeproocess_edit')")
@SysLog("修改审批主流程记录表节点表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('insurances_tauditnodeproocess_edit')" )
public R<Boolean> updateById(@RequestBody TAuditNodeProocess tAuditNodeProocess) {
return R.ok(tAuditNodeProocessService.updateById(tAuditNodeProocess));
}
/**
* 通过id删除审批主流程记录表节点表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除审批主流程记录表节点表", description = "通过id删除审批主流程记录表节点表:hasPermission('insurances_tauditnodeproocess_del')")
@SysLog("通过id删除审批主流程记录表节点表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_tauditnodeproocess_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tAuditNodeProocessService.removeById(id));
}
}
......@@ -2,21 +2,29 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceUnpurchaseApply;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceUnpurchaseApplyService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchaseApplySearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
......@@ -29,6 +37,7 @@ import javax.servlet.http.HttpServletResponse;
@RequiredArgsConstructor
@RequestMapping("/tinsuranceunpurchaseapply")
@Tag(name = "含风险项目不购买申请表管理")
@Slf4j
public class TInsuranceUnpurchaseApplyController {
private final TInsuranceUnpurchaseApplyService tInsuranceUnpurchaseApplyService;
......@@ -116,4 +125,118 @@ public class TInsuranceUnpurchaseApplyController {
menuUtil.setAuthSql(user, searchVo);
tInsuranceUnpurchaseApplyService.listExport(response, searchVo);
}
/**
* 审核分页查询
*
* @param page 分页对象
* @param unpurchaseApplySearchVo 不购买申请查询信息
* @param type 0待审核、1已处理、2抄送我
*
* @return R
*/
@Operation(description = "审核分页查询")
@GetMapping("/getAuditPage")
public R<IPage<TInsuranceUnpurchaseApply>> getAuditPage(Page<TInsuranceUnpurchaseApply> page,
TInsuranceUnpurchaseApplySearchVo unpurchaseApplySearchVo,String type) {
YifuUser user = SecurityUtils.getUser();
if(null == user){
return R.failed(ResultConstants.NO_USER);
}
String userId = String.valueOf(user.getId());
return R.ok(tInsuranceUnpurchaseApplyService.getAuditPage(page, unpurchaseApplySearchVo, userId, type));
}
/**
* 审核数量
*
* @return R
*/
@Operation(description = "审核数量查询")
@GetMapping("/getAuditCount")
public R<Map<String,Integer>> getAuditCount() {
YifuUser user = SecurityUtils.getUser();
if(null == user){
return R.failed(ResultConstants.NO_USER);
}
String userId = String.valueOf(user.getId());
return R.ok(tInsuranceUnpurchaseApplyService.getAuditCount(userId));
}
/**
* 提交审核
* @param id 实体id
* @return R<String>
**/
@Operation(description = "提交审核")
@SysLog("提交审核")
@PostMapping("/commitOne")
public R<String> commitOne(@RequestParam String id) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
if (Common.isNotKong(id)) {
String requestId;
String redisKey = CacheConstants.INSURANCEUNPURCHASE_PROCESS_CACHE.concat(id);
try {
requestId = RedisDistributedLock.getLock(redisKey,"10");
} catch (Exception e) {
log.error("获取锁失败:{}", e);
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
if (Common.isNotKong(requestId)) {
R<String> saveR = tInsuranceUnpurchaseApplyService.commitOne(id);
//主动释放锁
RedisDistributedLock.unlock(redisKey, requestId);
return saveR;
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
} else {
return R.failed("请选择提交的记录!");
}
}
/**
* 审核
* @param tApprovalRecord 审批信息
* @return R<String>
**/
@Operation(description = "审核")
@SysLog("审核")
@PostMapping("/audit")
public R<String> audit(@RequestBody TApprovalRecord tApprovalRecord) {
if (Common.isEmpty(tApprovalRecord.getApprovalResult())) {
return R.failed("审核结果不能为空!");
}
if (Common.isNotNull(tApprovalRecord.getApprovalOpinion()) && tApprovalRecord.getApprovalOpinion().length()> 100) {
return R.failed("审核意见不能超过100个字");
}
if (Common.isEmpty(tApprovalRecord.getDomainId())) {
return R.failed("id不能为空!");
}
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
TInsuranceUnpurchaseApply insuranceUnpurchaseApply = tInsuranceUnpurchaseApplyService.getById(tApprovalRecord.getDomainId());
if (Common.isEmpty(insuranceUnpurchaseApply)){
return R.failed("该实体信息不存在!");
}
String requestId;
String redisKey = CacheConstants.INSURANCEUNPURCHASE_PROCESS_CACHE.concat(tApprovalRecord.getDomainId());
try {
requestId = RedisDistributedLock.tryLockAndTime(redisKey, "10");
} catch (Exception e) {
return R.failed(ResultConstants.REQUEST_LOCK_FAIL);
}
if (Common.isNotKong(requestId)) {
return tInsuranceUnpurchaseApplyService.auditAndCommit(insuranceUnpurchaseApply, tApprovalRecord.getApprovalResult(),
tApprovalRecord.getApprovalOpinion(), user);
}
return R.failed(ResultConstants.REQUEST_LOCK_FAIL);
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 审批记录表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@Mapper
public interface TApprovalRecordMapper extends BaseMapper<TApprovalRecord> {
/**
* 审批记录表简单分页查询
* @param tApprovalRecord 审批记录表
* @return
*/
IPage<TApprovalRecord> getTApprovalRecordPage(Page<TApprovalRecord> page, @Param("tApprovalRecord") TApprovalRecord tApprovalRecord);
/**
* 通过实体id和审核类型查询所有的审核记录
*
* @param domainId 实体id
* @param auditType 审核类型 0不购买商险审核
* @return List<TApprovalRecord>
**/
List<TApprovalRecord> getApprovalRecordList(@Param("domainId") String domainId, @Param("auditType") String auditType);
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditCopyInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 审批抄送记录信息表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@Mapper
public interface TAuditCopyInfoMapper extends BaseMapper<TAuditCopyInfo> {
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 审批主流程记录表节点表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@Mapper
public interface TAuditNodeProocessMapper extends BaseMapper<TAuditNodeProocess> {
}
......@@ -40,4 +40,50 @@ public interface TInsuranceUnpurchaseApplyMapper extends BaseMapper<TInsuranceUn
*/
List<TInsuranceUnpurchaseApply> getTInsuranceUnpurchaseApplyExportList(@Param("tInsuranceUnpurchaseApply") TInsuranceUnpurchaseApplySearchVo tInsuranceUnpurchaseApply);
/**
* 待审核分页查询
* @param page 分页信息
* @param tInsuranceUnpurchaseApply 不购买申请查询信息
* @param userId 登录用户id
* @return IPage
*/
IPage<TInsuranceUnpurchaseApply> getAuditPage(Page<TInsuranceUnpurchaseApply> page,
@Param("tInsuranceUnpurchaseApply") TInsuranceUnpurchaseApplySearchVo tInsuranceUnpurchaseApply,
@Param("userId") String userId);
/**
* 已审核分页查询
* @param page 分页信息
* @param tInsuranceUnpurchaseApply 不购买申请查询信息
* @param userId 登录用户id
* @return IPage
*/
IPage<TInsuranceUnpurchaseApply> getHistoryHandlePage(Page<TInsuranceUnpurchaseApply> page,
@Param("tInsuranceUnpurchaseApply") TInsuranceUnpurchaseApplySearchVo tInsuranceUnpurchaseApply,
@Param("userId") String userId);
/**
* 待审核数量
* @param userId 登录用户id
* @return IPage
*/
Integer getAuditCount(@Param("userId") String userId);
/**
* 已审核数量
* @param userId 登录用户id
* @return IPage
*/
Integer getHistoryHandleCount(@Param("userId") String userId);
/**
* 抄送分页查询
* @param page 分页信息
* @param tInsuranceUnpurchaseApply 不购买申请查询信息
* @param userId 登录用户id
* @return IPage
*/
IPage<TInsuranceUnpurchaseApply> getCopyPage(Page<TInsuranceUnpurchaseApply> page,
@Param("tInsuranceUnpurchaseApply") TInsuranceUnpurchaseApplySearchVo tInsuranceUnpurchaseApply,
@Param("userId") String userId);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TApprovalRecordSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
/**
* 审批记录表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
public interface TApprovalRecordService extends IService<TApprovalRecord> {
/**
* 审批记录表简单分页查询
* @param tApprovalRecord 审批记录表
* @return
*/
IPage<TApprovalRecord> getTApprovalRecordPage(Page<TApprovalRecord> page, TApprovalRecordSearchVo tApprovalRecord);
/**
* 通过实体id和审核类型查询所有的审核记录
* @param domainId 实体id
* @param auditType 审核类型 0不购买商险审核
* @return R<Map<String, Object>> key=auditInfo表示审批记录列表
**/
R<Map<String, Object>> getAuditInfoByDomainIdAndAuditType(String domainId, String auditType);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditCopyInfo;
/**
* 审批抄送记录信息表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
public interface TAuditCopyInfoService extends IService<TAuditCopyInfo> {
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* 审批主流程记录表节点表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
public interface TAuditNodeProocessService extends IService<TAuditNodeProocess> {
}
......@@ -3,11 +3,14 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceUnpurchaseApply;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchaseApplySearchVo;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* 含风险项目不购买申请表
......@@ -27,5 +30,38 @@ public interface TInsuranceUnpurchaseApplyService extends IService<TInsuranceUnp
void listExport(HttpServletResponse response, TInsuranceUnpurchaseApplySearchVo searchVo);
/**
* 审核分页
* @param page 分页信息
* @param unpurchaseApplySearchVo 不购买申请查询信息
* @param userId 登录用户id
* @param type 0待审核、1已处理、2抄送我
* @return IPage
*/
IPage<TInsuranceUnpurchaseApply> getAuditPage(Page<TInsuranceUnpurchaseApply> page,
TInsuranceUnpurchaseApplySearchVo unpurchaseApplySearchVo,
String userId, String type);
/**
* 审核数量
* @param userId 登录用户id
* @return IPage
*/
Map<String,Integer> getAuditCount(String userId);
/**
* 提交审核
* @param id 实体id
* @return R<String>
**/
R<String> commitOne(String id) throws CheckedException;
/**
* 审核
* @param insuranceUnpurchaseApply 审批信息
* @return R<String>
**/
R<String> auditAndCommit(TInsuranceUnpurchaseApply insuranceUnpurchaseApply, String approvalResult, String approvalOpinion, YifuUser user)
throws CheckedException;
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Maps;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TApprovalRecordMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TApprovalRecordService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TApprovalRecordSearchVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.Map;
/**
* 审批记录表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@Log4j2
@Service
public class TApprovalRecordServiceImpl extends ServiceImpl<TApprovalRecordMapper, TApprovalRecord> implements TApprovalRecordService {
/**
* 审批记录表简单分页查询
* @param tApprovalRecord 审批记录表
* @return
*/
@Override
public IPage<TApprovalRecord> getTApprovalRecordPage(Page<TApprovalRecord> page, TApprovalRecordSearchVo tApprovalRecord){
return baseMapper.getTApprovalRecordPage(page,tApprovalRecord);
}
/**
* 通过实体id和审核类型查询所有的审核记录
*
* @param domainId 实体id
* @param auditType 审核类型 0不购买商险审核
* @return R<Map < String, Object>> key=auditInfo表示审批记录列表
**/
@Override
public R<Map<String, Object>> getAuditInfoByDomainIdAndAuditType(String domainId, String auditType) {
Map<String, Object> resultMap = Maps.newHashMap();
// 获取审批列表
List<TApprovalRecord> auditInfoList = baseMapper.getApprovalRecordList(domainId, auditType);
resultMap.put("auditInfo", auditInfoList);
return new R<>(resultMap);
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditCopyInfo;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TAuditCopyInfoMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TAuditCopyInfoService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 审批抄送记录信息表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
*/
@Log4j2
@Service
public class TAuditCopyInfoServiceImpl extends ServiceImpl<TAuditCopyInfoMapper, TAuditCopyInfo> implements TAuditCopyInfoService {
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TAuditNodeProocessMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TAuditNodeProocessService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* 审批主流程记录表节点表
*
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
@Log4j2
@Service
public class TAuditNodeProocessServiceImpl extends ServiceImpl<TAuditNodeProocessMapper, TAuditNodeProocess> implements TAuditNodeProocessService {
}
......@@ -4,24 +4,39 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceUnpurchaseApply;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceUnpurchaseApplyMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeRateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceUnpurchaseApplyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl.process.TInsuranceUnpurchaseApplyAuditProcess;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchaseApplySearchVo;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 含风险项目不购买申请表
......@@ -32,6 +47,11 @@ import java.util.List;
@Log4j2
@Service
public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsuranceUnpurchaseApplyMapper, TInsuranceUnpurchaseApply> implements TInsuranceUnpurchaseApplyService {
@Resource
@Lazy
private TInsuranceUnpurchaseApplyAuditProcess tInsuranceUnpurchaseApplyAuditProcess;
/**
* 含风险项目不购买申请表简单分页查询
*
......@@ -43,6 +63,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
return baseMapper.getTInsuranceUnpurchaseApplyPage(page, tInsuranceUnpurchaseApply);
}
@Override
public R deleteById(String id) {
TInsuranceUnpurchaseApply apply = baseMapper.selectById(id);
if (Common.isNotNull(apply)) {
......@@ -100,4 +121,101 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
log.error("执行异常", e);
}
}
/**
* 报价单审核分页
*
* @param page 分页信息
* @param unpurchaseApplySearchVo 不购买申请查询信息
* @param userId 登录用户id
* @param type 0待审核、1已处理、2抄送我
* @return IPage
*/
@Override
public IPage<TInsuranceUnpurchaseApply> getAuditPage(Page<TInsuranceUnpurchaseApply> page, TInsuranceUnpurchaseApplySearchVo unpurchaseApplySearchVo, String userId, String type) {
IPage<TInsuranceUnpurchaseApply> auditUnpurchaseIPage;
if (StringUtils.equals(CommonConstants.ZERO_STRING, type)) {
auditUnpurchaseIPage = baseMapper.getAuditPage(page, unpurchaseApplySearchVo, userId);
} else if (StringUtils.equals(CommonConstants.ONE_STRING, type)) {
auditUnpurchaseIPage = baseMapper.getHistoryHandlePage(page, unpurchaseApplySearchVo, userId);
} else if (StringUtils.equals(CommonConstants.TWO_STRING, type)) {
auditUnpurchaseIPage = baseMapper.getCopyPage(page, unpurchaseApplySearchVo, userId);
}else {
return null;
}
return auditUnpurchaseIPage;
}
/**
* 审核数量
*
* @param userId 登录用户id
* @return IPage
*/
@Override
public Map<String, Integer> getAuditCount(String userId) {
Map<String, Integer> auditCountMap = new HashMap<>();
Integer pendingCount = baseMapper.getAuditCount(userId);
Integer processedCount = baseMapper.getHistoryHandleCount(userId);
auditCountMap.put("pending", pendingCount);
auditCountMap.put("processed", processedCount);
auditCountMap.put("copy",0);
return auditCountMap;
}
/**
* 提交审核
* @param id 实体id
* @return R<String>
**/
@Transactional
@Override
public R<String> commitOne(String id) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
TInsuranceUnpurchaseApply entity = this.getById(id);
if(entity==null){
return R.failed(ResultConstants.FAIL_INFO_NO_MODEL);
}
if(!StringUtils.equals(entity.getStatus(),CommonConstants.ONE_STRING)){
return R.failed("当前记录不为待提交状态");
}
String[] reasonType = {"1", "2"};
if(!ArrayUtils.contains(reasonType, entity.getReasonType())) {
return R.failed("未维护【不购买原因】选项,请联系管理员");
}
// “已购买社保" 并且“项目有审批通过记录”,无需发起审核流程
if(CommonConstants.ONE_STRING.equals(entity.getReasonType()) && CommonConstants.ZERO_STRING.equals(entity.getAuditFlag())){
return R.failed("【已购买社保】并且【项目有审批通过记录】,无需发起审核流程");
}
String[] companyFlag = {"0", "1"};
if(!ArrayUtils.contains(companyFlag, entity.getCompanyFlag())) {
return R.failed("未维护【申请人是否属于子分公司】,请联系管理员");
}
if(Common.isEmpty(entity.getCreateUserDeptId())){
return R.failed("申请人所属部门id不能为空");
}
// 传流程类型 1不购买商险申请,审核类型 0不购买商险审核
// R<List<SysUser>> auditUserListR = tInsuranceUnpurchaseApplyAuditProcess.commitAuditUserList(id, user, entity.getCreateUserDeptId(), CommonConstants.ONE_STRING, CommonConstants.ZERO_STRING,
// "",entity.getApplyNo(),entity,TInsuranceUnpurchaseApply.class);
// if (auditUserListR == null || auditUserListR.getCode() != CommonConstants.SUCCESS || auditUserListR.getData() == null) {
// throw new CheckedException("获取审批人失败,请联系管理员");
// }
entity.setStatus(CommonConstants.TWO_STRING);
this.updateById(entity);
return R.ok(null,"提交成功");
}
@Override
@Transactional
public R<String> auditAndCommit(TInsuranceUnpurchaseApply insuranceUnpurchaseApply, String approvalResult, String approvalOpinion, YifuUser user) {
return R.ok("审核完毕");
// return tInsuranceUnpurchaseApplyAuditProcess.auditUserList(insuranceUnpurchaseApply.getId(), approvalResult, approvalOpinion, user, CommonConstants.ZERO_STRING,
// insuranceUnpurchaseApply, insuranceUnpurchaseApply.getCreateUserDeptId());
}
}
......@@ -34,4 +34,21 @@ ekp:
fdFlowId: '18267f206233f29cbd3c5ee425c9408a'
docStatus: '20'
LoginName: 'admin'
docSubject : '接口发起流程'
\ No newline at end of file
docSubject : '接口发起流程'
# spring security 配置
security:
oauth2:
resource:
loadBalanced: true
token-info-uri: http://yifu-auth/oauth/check_token
ignore: # 通用放行URL,服务个性化,请在对应配置文件覆盖
urls:
- /v3/api-docs
- /swagger-ui/**
- /tapprovalrecord/getAuditInfoByDomainIdAndAuditType
- /tinsuranceunpurchaseapply/getAuditPage
- /tinsuranceunpurchaseapply/getAuditCount
- /tinsuranceunpurchaseapply/commitOne
- /tinsuranceunpurchaseapply/audit
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TApprovalRecordMapper">
<resultMap id="tApprovalRecordMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord">
<id property="id" column="id"/>
<result property="flowId" column="flow_id"/>
<result property="domainId" column="domain_id"/>
<result property="nodeId" column="node_id"/>
<result property="approvalMan" column="approval_man"/>
<result property="approvalManName" column="approval_man_name"/>
<result property="approvalTime" column="approval_time"/>
<result property="approvalResult" column="approval_result"/>
<result property="approvalOpinion" column="approval_opinion"/>
<result property="deleteFlag" column="delete_flag"/>
<result property="preFlag" column="pre_flag"/>
<result property="submitMan" column="submit_man"/>
<result property="submitManName" column="submit_man_name"/>
<result property="reason" column="reason"/>
<result property="auditType" column="audit_type"/>
<result property="createTime" column="create_time"/>
<result property="nodeName" column="node_name"/>
<result property="entityName" column="entity_name"/>
<result property="submitCreateTime" column="submit_create_time"/>
<result property="backFlag" column="back_flag"/>
<result property="backNodeName" column="back_node_name"/>
<result property="backNodeId" column="back_node_id"/>
<result property="addSignNodeId" column="add_sign_node_id"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.flow_id,
a.domain_id,
a.node_id,
a.approval_man,
a.approval_man_name,
a.approval_time,
a.approval_result,
a.approval_opinion,
a.delete_flag,
a.pre_flag,
a.submit_man,
a.submit_man_name,
a.reason,
a.audit_type,
a.create_time,
a.node_name,
a.entity_name,
a.submit_create_time,
a.back_flag,
a.back_node_name,
a.back_node_id,
a.add_sign_node_id
</sql>
<sql id="tApprovalRecord_where">
<if test="tApprovalRecord != null">
<if test="tApprovalRecord.id != null and tApprovalRecord.id.trim() != ''">
AND a.id = #{tApprovalRecord.id}
</if>
<if test="tApprovalRecord.flowId != null and tApprovalRecord.flowId.trim() != ''">
AND a.flow_id = #{tApprovalRecord.flowId}
</if>
<if test="tApprovalRecord.domainId != null and tApprovalRecord.domainId.trim() != ''">
AND a.domain_id = #{tApprovalRecord.domainId}
</if>
<if test="tApprovalRecord.nodeId != null and tApprovalRecord.nodeId.trim() != ''">
AND a.node_id = #{tApprovalRecord.nodeId}
</if>
<if test="tApprovalRecord.approvalMan != null and tApprovalRecord.approvalMan.trim() != ''">
AND a.approval_man = #{tApprovalRecord.approvalMan}
</if>
<if test="tApprovalRecord.approvalManName != null and tApprovalRecord.approvalManName.trim() != ''">
AND a.approval_man_name = #{tApprovalRecord.approvalManName}
</if>
<if test="tApprovalRecord.approvalTime != null">
AND a.approval_time = #{tApprovalRecord.approvalTime}
</if>
<if test="tApprovalRecord.approvalResult != null and tApprovalRecord.approvalResult.trim() != ''">
AND a.approval_result = #{tApprovalRecord.approvalResult}
</if>
<if test="tApprovalRecord.approvalOpinion != null and tApprovalRecord.approvalOpinion.trim() != ''">
AND a.approval_opinion = #{tApprovalRecord.approvalOpinion}
</if>
<if test="tApprovalRecord.deleteFlag != null and tApprovalRecord.deleteFlag.trim() != ''">
AND a.delete_flag = #{tApprovalRecord.deleteFlag}
</if>
<if test="tApprovalRecord.preFlag != null and tApprovalRecord.preFlag.trim() != ''">
AND a.pre_flag = #{tApprovalRecord.preFlag}
</if>
<if test="tApprovalRecord.submitMan != null and tApprovalRecord.submitMan.trim() != ''">
AND a.submit_man = #{tApprovalRecord.submitMan}
</if>
<if test="tApprovalRecord.submitManName != null and tApprovalRecord.submitManName.trim() != ''">
AND a.submit_man_name = #{tApprovalRecord.submitManName}
</if>
<if test="tApprovalRecord.reason != null and tApprovalRecord.reason.trim() != ''">
AND a.reason = #{tApprovalRecord.reason}
</if>
<if test="tApprovalRecord.auditType != null and tApprovalRecord.auditType.trim() != ''">
AND a.audit_type = #{tApprovalRecord.auditType}
</if>
<if test="tApprovalRecord.createTime != null">
AND a.create_time = #{tApprovalRecord.createTime}
</if>
<if test="tApprovalRecord.nodeName != null and tApprovalRecord.nodeName.trim() != ''">
AND a.node_name = #{tApprovalRecord.nodeName}
</if>
<if test="tApprovalRecord.entityName != null and tApprovalRecord.entityName.trim() != ''">
AND a.entity_name = #{tApprovalRecord.entityName}
</if>
<if test="tApprovalRecord.submitCreateTime != null">
AND a.submit_create_time = #{tApprovalRecord.submitCreateTime}
</if>
<if test="tApprovalRecord.backFlag != null and tApprovalRecord.backFlag.trim() != ''">
AND a.back_flag = #{tApprovalRecord.backFlag}
</if>
<if test="tApprovalRecord.backNodeName != null and tApprovalRecord.backNodeName.trim() != ''">
AND a.back_node_name = #{tApprovalRecord.backNodeName}
</if>
<if test="tApprovalRecord.backNodeId != null and tApprovalRecord.backNodeId.trim() != ''">
AND a.back_node_id = #{tApprovalRecord.backNodeId}
</if>
<if test="tApprovalRecord.addSignNodeId != null and tApprovalRecord.addSignNodeId.trim() != ''">
AND a.add_sign_node_id = #{tApprovalRecord.addSignNodeId}
</if>
</if>
</sql>
<!--tApprovalRecord简单分页查询-->
<select id="getTApprovalRecordPage" resultMap="tApprovalRecordMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_approval_record a
<where>
1=1
<include refid="tApprovalRecord_where"/>
</where>
</select>
<!--查询审核记录数据-->
<select id="getApprovalRecordList" resultMap="tApprovalRecordMap">
SELECT
a.id,
a.flow_id,
a.domain_id,
a.node_id,
a.approval_man,
a.approval_man_name,
a.approval_time,
a.approval_result,
a.approval_opinion,
a.submit_man,
a.submit_man_name,
a.reason,
a.create_time,
a.node_name,
a.entity_name,
a.submit_create_time
FROM t_approval_record a
<where>
a.domain_id = #{domainId} AND a.audit_type = #{auditType}
AND a.delete_flag = '0'
order by a.create_time,a.id
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TAuditCopyInfoMapper">
<resultMap id="tAuditCopyInfoMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditCopyInfo">
<id property="id" column="id"/>
<result property="auditUserId" column="audit_user_id"/>
<result property="auditUser" column="audit_user"/>
<result property="domainId" column="domain_id"/>
<result property="createTime" column="create_time"/>
<result property="flowId" column="flow_id"/>
<result property="nodeId" column="node_id"/>
<result property="deleteFlag" column="delete_flag"/>
<result property="nodeName" column="node_name"/>
<result property="auditType" column="audit_type"/>
<result property="preFlag" column="pre_flag"/>
<result property="submitMan" column="submit_man"/>
<result property="submitManName" column="submit_man_name"/>
<result property="submitCreateTime" column="submit_create_time"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.audit_user_id,
a.audit_user,
a.domain_id,
a.create_time,
a.flow_id,
a.node_id,
a.delete_flag,
a.node_name,
a.audit_type,
a.pre_flag,
a.submit_man,
a.submit_man_name,
a.submit_create_time
</sql>
<sql id="tAuditCopyInfo_where">
<if test="tAuditCopyInfo != null">
<if test="tAuditCopyInfo.id != null and tAuditCopyInfo.id.trim() != ''">
AND a.id = #{tAuditCopyInfo.id}
</if>
<if test="tAuditCopyInfo.auditUserId != null and tAuditCopyInfo.auditUserId.trim() != ''">
AND a.audit_user_id = #{tAuditCopyInfo.auditUserId}
</if>
<if test="tAuditCopyInfo.auditUser != null and tAuditCopyInfo.auditUser.trim() != ''">
AND a.audit_user = #{tAuditCopyInfo.auditUser}
</if>
<if test="tAuditCopyInfo.domainId != null and tAuditCopyInfo.domainId.trim() != ''">
AND a.domain_id = #{tAuditCopyInfo.domainId}
</if>
<if test="tAuditCopyInfo.createTime != null">
AND a.create_time = #{tAuditCopyInfo.createTime}
</if>
<if test="tAuditCopyInfo.flowId != null and tAuditCopyInfo.flowId.trim() != ''">
AND a.flow_id = #{tAuditCopyInfo.flowId}
</if>
<if test="tAuditCopyInfo.nodeId != null and tAuditCopyInfo.nodeId.trim() != ''">
AND a.node_id = #{tAuditCopyInfo.nodeId}
</if>
<if test="tAuditCopyInfo.deleteFlag != null and tAuditCopyInfo.deleteFlag.trim() != ''">
AND a.delete_flag = #{tAuditCopyInfo.deleteFlag}
</if>
<if test="tAuditCopyInfo.nodeName != null and tAuditCopyInfo.nodeName.trim() != ''">
AND a.node_name = #{tAuditCopyInfo.nodeName}
</if>
<if test="tAuditCopyInfo.auditType != null and tAuditCopyInfo.auditType.trim() != ''">
AND a.audit_type = #{tAuditCopyInfo.auditType}
</if>
<if test="tAuditCopyInfo.preFlag != null and tAuditCopyInfo.preFlag.trim() != ''">
AND a.pre_flag = #{tAuditCopyInfo.preFlag}
</if>
<if test="tAuditCopyInfo.submitMan != null and tAuditCopyInfo.submitMan.trim() != ''">
AND a.submit_man = #{tAuditCopyInfo.submitMan}
</if>
<if test="tAuditCopyInfo.submitManName != null and tAuditCopyInfo.submitManName.trim() != ''">
AND a.submit_man_name = #{tAuditCopyInfo.submitManName}
</if>
<if test="tAuditCopyInfo.submitCreateTime != null">
AND a.submit_create_time = #{tAuditCopyInfo.submitCreateTime}
</if>
</if>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TAuditNodeProocessMapper">
<resultMap id="tAuditNodeProocessMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess">
<id property="id" column="id"/>
<result property="processId" column="process_id"/>
<result property="nodeId" column="node_id"/>
<result property="nodeType" column="node_type"/>
<result property="createTime" column="create_time"/>
<result property="domainId" column="domain_id"/>
<result property="mainType" column="main_type"/>
<result property="logoTitle" column="logo_title"/>
<result property="nodeName" column="node_name"/>
<result property="processName" column="process_name"/>
<result property="parentProcessId" column="parent_process_id"/>
<result property="deleteFlag" column="delete_flag"/>
<result property="type" column="type"/>
<result property="addSignParentNodeId" column="add_sign_parent_node_id"/>
<result property="addSignDepartmentId" column="add_sign_department_id"/>
<result property="domainName" column="domain_name"/>
<result property="addSignApprovalMan" column="add_sign_approval_man"/>
<result property="addSignApprovalManName" column="add_sign_approval_man_name"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.process_id,
a.node_id,
a.node_type,
a.create_time,
a.domain_id,
a.main_type,
a.logo_title,
a.node_name,
a.process_name,
a.parent_process_id,
a.delete_flag,
a.type,
a.add_sign_parent_node_id,
a.add_sign_department_id,
a.domain_name,
a.add_sign_approval_man,
a.add_sign_approval_man_name
</sql>
<sql id="tAuditNodeProocess_where">
<if test="tAuditNodeProocess != null">
<if test="tAuditNodeProocess.id != null and tAuditNodeProocess.id.trim() != ''">
AND a.id = #{tAuditNodeProocess.id}
</if>
<if test="tAuditNodeProocess.processId != null and tAuditNodeProocess.processId.trim() != ''">
AND a.process_id = #{tAuditNodeProocess.processId}
</if>
<if test="tAuditNodeProocess.nodeId != null and tAuditNodeProocess.nodeId.trim() != ''">
AND a.node_id = #{tAuditNodeProocess.nodeId}
</if>
<if test="tAuditNodeProocess.nodeType != null and tAuditNodeProocess.nodeType.trim() != ''">
AND a.node_type = #{tAuditNodeProocess.nodeType}
</if>
<if test="tAuditNodeProocess.createTime != null">
AND a.create_time = #{tAuditNodeProocess.createTime}
</if>
<if test="tAuditNodeProocess.domainId != null and tAuditNodeProocess.domainId.trim() != ''">
AND a.domain_id = #{tAuditNodeProocess.domainId}
</if>
<if test="tAuditNodeProocess.mainType != null and tAuditNodeProocess.mainType.trim() != ''">
AND a.main_type = #{tAuditNodeProocess.mainType}
</if>
<if test="tAuditNodeProocess.logoTitle != null and tAuditNodeProocess.logoTitle.trim() != ''">
AND a.logo_title = #{tAuditNodeProocess.logoTitle}
</if>
<if test="tAuditNodeProocess.nodeName != null and tAuditNodeProocess.nodeName.trim() != ''">
AND a.node_name = #{tAuditNodeProocess.nodeName}
</if>
<if test="tAuditNodeProocess.processName != null and tAuditNodeProocess.processName.trim() != ''">
AND a.process_name = #{tAuditNodeProocess.processName}
</if>
<if test="tAuditNodeProocess.parentProcessId != null and tAuditNodeProocess.parentProcessId.trim() != ''">
AND a.parent_process_id = #{tAuditNodeProocess.parentProcessId}
</if>
<if test="tAuditNodeProocess.deleteFlag != null and tAuditNodeProocess.deleteFlag.trim() != ''">
AND a.delete_flag = #{tAuditNodeProocess.deleteFlag}
</if>
<if test="tAuditNodeProocess.type != null and tAuditNodeProocess.type.trim() != ''">
AND a.type = #{tAuditNodeProocess.type}
</if>
<if test="tAuditNodeProocess.addSignParentNodeId != null and tAuditNodeProocess.addSignParentNodeId.trim() != ''">
AND a.add_sign_parent_node_id = #{tAuditNodeProocess.addSignParentNodeId}
</if>
<if test="tAuditNodeProocess.addSignDepartmentId != null and tAuditNodeProocess.addSignDepartmentId.trim() != ''">
AND a.add_sign_department_id = #{tAuditNodeProocess.addSignDepartmentId}
</if>
<if test="tAuditNodeProocess.domainName != null and tAuditNodeProocess.domainName.trim() != ''">
AND a.domain_name = #{tAuditNodeProocess.domainName}
</if>
<if test="tAuditNodeProocess.addSignApprovalMan != null and tAuditNodeProocess.addSignApprovalMan.trim() != ''">
AND a.add_sign_approval_man = #{tAuditNodeProocess.addSignApprovalMan}
</if>
<if test="tAuditNodeProocess.addSignApprovalManName != null and tAuditNodeProocess.addSignApprovalManName.trim() != ''">
AND a.add_sign_approval_man_name = #{tAuditNodeProocess.addSignApprovalManName}
</if>
</if>
</sql>
</mapper>
......@@ -84,7 +84,7 @@
<include refid="Base_Column_List"/>
FROM t_insurance_unpurchase_apply a
<where>
1=1 and a.DELETE_FLAG = '0'
a.DELETE_FLAG = '0'
<include refid="tInsuranceUnpurchaseApply_where"/>
</where>
</select>
......@@ -95,7 +95,7 @@
count(1)
FROM t_insurance_unpurchase_apply a
<where>
1=1 and a.DELETE_FLAG = '0'
a.DELETE_FLAG = '0'
<include refid="tInsuranceUnpurchaseApply_where"/>
</where>
</select>
......@@ -119,8 +119,74 @@
ELSE a.STATUS END as "STATUS"
FROM t_insurance_unpurchase_apply a
<where>
1=1 and a.DELETE_FLAG = '0'
a.DELETE_FLAG = '0'
<include refid="tInsuranceUnpurchaseApply_where"/>
</where>
</select>
</mapper>
\ No newline at end of file
<select id="getAuditPage" resultMap="tInsuranceUnpurchaseApplyMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurance_unpurchase_apply a
left join t_approval_record r on a.id=r.domain_id
<where>
a.DELETE_FLAG='0' and r.approval_man= #{userId} and r.audit_type='0' and r.approval_result = '2' and r.delete_flag='0'
<include refid="tInsuranceUnpurchaseApply_where"/>
</where>
order by r.CREATE_TIME asc
</select>
<select id="getHistoryHandlePage" resultMap="tInsuranceUnpurchaseApplyMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurance_unpurchase_apply a
left join (
select min(approval_time) approval_time,domain_id,approval_man from t_approval_record
where approval_result in('0','1') and audit_type = '0' and delete_flag='0'
group by domain_id,approval_man
) r on a.id=r.domain_id
<where>
a.DELETE_FLAG='0' and r.approval_man= #{userId}
<include refid="tInsuranceUnpurchaseApply_where"/>
</where>
order by r.approval_time desc
</select>
<select id="getAuditCount" resultType="integer">
SELECT count(1) FROM t_insurance_unpurchase_apply a
left join t_approval_record r on a.id=r.domain_id
<where>
a.DELETE_FLAG='0' and r.approval_man= #{userId} and r.audit_type='0' and r.approval_result = '2' and r.delete_flag='0'
</where>
</select>
<select id="getHistoryHandleCount" resultType="integer">
SELECT count(1) FROM t_insurance_unpurchase_apply a
left join (
select min(approval_time) approval_time,domain_id,approval_man from t_approval_record
where approval_result in('0','1') and audit_type = '0' and delete_flag='0'
group by domain_id,approval_man
) r on a.id=r.domain_id
<where>
a.DELETE_FLAG='0' and r.approval_man= #{userId}
</where>
</select>
<select id="getCopyPage" resultMap="tInsuranceUnpurchaseApplyMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurance_unpurchase_apply a
left join (
select min(create_time) create_time,domain_id,audit_user_id from t_audit_copy_info
where audit_type = '0' and delete_flag = '0'
group by domain_id,audit_user_id
) r on a.id=r.domain_id
<where>
a.DELETE_FLAG='0' and r.audit_user_id= #{userId}
<include refid="tInsuranceUnpurchaseApply_where"/>
</where>
order by r.create_time desc
</select>
</mapper>
# 忽略匹配下列规则的Git 提交 V2.1.0
### gradle ###
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
### STS ###
.settings/
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
bin/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
*.lock
rebel.xml
### NetBeans ###
nbproject/private/
build/
nbbuild/
nbdist/
.nb-gradle/
### maven ###
target/
*.war
*.ear
*.zip
*.tar
*.tar.gz
### logs ####
/logs/
*.log
### temp ignore ###
*.cache
*.diff
*.patch
*.tmp
*.java~
*.properties~
*.xml~
### system ignore ###
.DS_Store
Thumbs.db
Servers
.metadata
upload
gen_code
### node ###
node_modules
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>yifu</artifactId>
<groupId>com.yifu.cloud.plus.v1</groupId>
<version>1.0.0</version>
</parent>
<artifactId>yifu-process</artifactId>
<description>审批流程</description>
<packaging>pom</packaging>
<!--项目子模块-->
<modules>
<module>yifu-process-api</module>
<module>yifu-process-biz</module>
</modules>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>yifu</artifactId>
<groupId>com.yifu.cloud.plus.v1</groupId>
<version>1.0.0</version>
</parent>
<artifactId>yifu-process-api</artifactId>
<packaging>jar</packaging>
<description>审批流程服务 接口模块</description>
<dependencies>
<!-- core 工具类 -->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-core</artifactId>
</dependency>
<!--swagger 注解-->
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
<!--mybatis 依赖-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-mybatis</artifactId>
</dependency>
</dependencies>
</project>
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* 定时流程节点配置
*
* @author hgw
* @date 2020-07-16 17:48:52
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_delay_node_config")
@Schema(description = "定时流程节点配置")
public class TDelayNodeConfig extends Model<TDelayNodeConfig> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "定时方式(0延时指定的分钟后执行/1指定一个时间点执行)不能为空")
@Length(max = 1, message = "定时方式(0延时指定的分钟后执行/1指定一个时间点执行)不能超过1个字符")
@Schema(description = "定时方式(0延时指定的分钟后执行/1指定一个时间点执行)")
private String delayType;
@Schema(description = "分钟")
private Integer minutes;
@Schema(description = "时间")
private LocalDateTime time;
@NotBlank(message = "流程节点ID不能为空")
@Length(max = 255, message = "流程节点ID不能超过255个字符")
@Schema(description = "流程节点ID")
private String nodeId;
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 流程节点配置表(规则配置)
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_node_config")
@Schema(description = "流程节点配置表(规则配置)")
public class TNodeConfig extends Model<TNodeConfig> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "是否允许撤回(0是/1否)不能为空")
@Length(max = 1, message = "是否允许撤回(0是/1否)不能超过1个字符")
@Schema(description = "是否允许撤回(0是/1否)")
private String allowWithdraw;
@NotBlank(message = "是否允许流程回溯(0是/1否)不能为空")
@Length(max = 1, message = "是否允许流程回溯(0是/1否)不能超过1个字符")
@Schema(description = "是否允许流程回溯(0是/1否)")
private String allowBacktrack;
@NotBlank(message = "是否发起处理提醒(0是/1否;提醒会在站内和移动端提醒)不能为空")
@Length(max = 1, message = "是否发起处理提醒(0是/1否;提醒会在站内和移动端提醒)不能超过1个字符")
@Schema(description = "是否发起处理提醒(0是/1否;提醒会在站内和移动端提醒)")
private String allowDealRemind;
@NotBlank(message = "节点ID不能为空")
@Length(max = 255, message = "节点ID不能超过255个字符")
@Schema(description = "节点ID")
private String nodeId;
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 节点超时配置表
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_node_timeout_config")
@Schema(description = "节点超时配置表")
public class TNodeTimeoutConfig extends Model<TNodeTimeoutConfig> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "流程是否超时(0不超时/1指定时长/2脚本)不能为空")
@Length(max = 1, message = "流程是否超时(0不超时/1指定时长/2脚本)不能超过1个字符")
@Schema(description = "流程是否超时(0不超时/1指定时长/2脚本)")
private String timeOut;
@Schema(description = "天数(TIME_OUT为2时启用)")
private Integer day;
@Schema(description = "小时(TIME_OUT为2时启用)")
private Integer hour;
@Length(max = 1, message = "是否仅计算工作时间(TIME_OUT为2时启用,0是/1否)不能超过1个字符")
@Schema(description = "是否仅计算工作时间(TIME_OUT为2时启用,0是/1否)")
private String workHourFlag;
@NotBlank(message = "节点ID不能为空")
@Length(max = 255, message = "节点ID不能超过255个字符")
@Schema(description = "节点ID")
private String nodeId;
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* 主流程表
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_process")
@Schema(description = "主流程表")
public class TProcess extends Model<TProcess> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "流程名称不能为空")
@Length(max = 255, message = "流程名称不能超过255个字符")
@Schema(description = "流程名称")
private String name;
@Length(max = 255, message = "流程标识(系统自动生成MD5串)不能超过255个字符")
@Schema(description = "流程标识(系统自动生成MD5串)")
private String logoTitle;
@NotBlank(message = "流程创建人不能为空")
@Length(max = 255, message = "流程创建人不能超过255个字符")
@Schema(description = "流程创建人")
private String createUser;
@Schema(description = "流程创建时间")
private LocalDateTime createDate;
@Length(max = 255, message = "流程更新人不能超过255个字符")
@Schema(description = "流程更新人")
private String updateUser;
@Schema(description = "流程更新时间")
private LocalDateTime updateDate;
@Length(max = 255, message = "流程描述不能超过255个字符")
@Schema(description = "流程描述")
private String description;
@Length(max = 1, message = "删除表示 0未删除 1删除不能超过1个字符")
@Schema(description = "删除表示 0未删除 1删除")
private String deleteFlag;
@Length(max = 1, message = "是否通用不能超过1个字符")
@Schema(description = "是否通用0是1否")
private String commonUse;
@Length(max = 1, message = "是否在用不能超过1个字符")
@Schema(description = "是否在用 0在用 1历史")
private String processIsUse;
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 审批配置表
*
* @author wangan
* @date 2020-12-07 14:08:38
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_process_approval_conf")
@Schema(description = "审批配置表")
public class TProcessApprovalConf extends Model<TProcessApprovalConf> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "字段名称不能为空")
@Length(max = 32, message = "字段名称不能超过32个字符")
@Schema(description = "字段名称")
private String fieldName;
@NotBlank(message = "字段值不能为空")
@Length(max = 32, message = "字段值不能超过32个字符")
@Schema(description = "字段值")
private String fieldValue;
@NotBlank(message = "类名不能为空")
@Length(max = 32, message = "类名不能超过32个字符")
@Schema(description = "类名")
private String className;
@Length(max = 32, message = "主流程id不能超过32个字符")
@Schema(description = "主流程id")
private String processId;
@NotBlank(message = "父配置id不能为空")
@Length(max = 32, message = "父配置id不能超过32个字符")
@Schema(description = "父配置id")
private String parentId;
@NotBlank(message = "类型不能为空")
@Length(max = 1, message = "类型不能超过1个字符")
@Schema(description = "类型 1不购买商险申请")
private String type;
@Length(max = 1, message = "删除表示 0未删除 1删除不能超过1个字符")
@Schema(description = "删除表示 0未删除 1删除")
private String deleteFlag;
@Length(max = 100, message = "备注不能超过100个字符")
@Schema(description = "备注")
private String remark;
}
package com.yifu.cloud.plus.v1.yifu.process.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 远程服务调用(在节点为服务调用节点时使用)
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_service_transfer_config")
@Schema(description = "远程服务调用(在节点为服务调用节点时使用)")
public class TServiceTransferConfig extends Model<TServiceTransferConfig> {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@NotBlank(message = "服务协议(0jaxws/1jaxrs)不能为空")
@Length(max = 1, message = "服务协议(0jaxws/1jaxrs)不能超过1个字符")
@Schema(description = "服务协议(0jaxws/1jaxrs)")
private String serviceAgreement;
@NotBlank(message = "调用方式(0同步/1异步)不能为空")
@Length(max = 1, message = "调用方式(0同步/1异步)不能超过1个字符")
@Schema(description = "调用方式(0同步/1异步)")
private String transferType;
@NotBlank(message = "WSDL地址不能为空")
@Length(max = 255, message = "WSDL地址不能超过255个字符")
@Schema(description = "WSDL地址")
private String wsdlAddress;
@Length(max = 255, message = "调用方法不能超过255个字符")
@Schema(description = "调用方法")
private String transferFunc;
@NotBlank(message = "节点ID不能为空")
@Length(max = 255, message = "节点ID不能超过255个字符")
@Schema(description = "节点ID")
private String nodeId;
}
package com.yifu.cloud.plus.v1.yifu.process.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @program: yifu_cloud
* @description:
* @author: wangdayu
* @create: 2023-10-25 17:10
* @since:
*/
@Data
public class CheckNodeVo implements Serializable {
private String PrewNode;
private String NextNode;
private String ProcessId;
private String NodeRouteId;
private String Field;
private String LogoTitle;
}
package com.yifu.cloud.plus.v1.yifu.process.vo;
import com.yifu.cloud.plus.v1.yifu.process.entity.TProcess;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Set;
/**
* 主流程表
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class TProcessViewVo extends TProcess {
private static final long serialVersionUID = 1L;
@Schema(description = "类型 1不购买商险申请")
private String type;
@Schema(description = "部门ids")
private Set<String> departIds;
@Schema(description = "用章类型")
private Set<String> chapterUnits;
@Schema(description = "删除部门ids")
private Set<String> delDepartIds;
@Schema(description = "删除用章类型")
private Set<String> delChapterUnits;
@Schema(description = "类型(条件查询用)")
private String processType;
@Schema(description = "部门(条件查询用)")
private String departId;
@Schema(description = "流程ids")
private Set<String> processIds;
@Schema(description = "指定权限类型")
private Integer nodePermissionType;
@Schema(description = "指定权限处理节点")
private String role;
}
FROM moxm/java:1.8-full
RUN mkdir -p /yifu-process-biz
WORKDIR yifu-process-biz
ARG JAR_FILE=target/yifu-process-biz.jar
COPY ${JAR_FILE} app.jar
EXPOSE 25087
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
CMD sleep 60; java -jar app.jar $JAVA_OPTS
#!/usr/bin/env bash
mvn clean package -Pprd -Dmaven.test.skip=true docker:build -DpushImage
\ No newline at end of file
#!/usr/bin/env bash
mvn clean package -Ptest -Dmaven.test.skip=true docker:build -DpushImage
#!/usr/bin/env bash
mvn clean package -Dmaven.test.skip=true docker:build -DpushImage
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>yifu</artifactId>
<groupId>com.yifu.cloud.plus.v1</groupId>
<version>1.0.0</version>
</parent>
<artifactId>yifu-process-biz</artifactId>
<description>审批流程服务 业务模块</description>
<packaging>jar</packaging>
<dependencies>
<!-- seata 依赖 -->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-seata</artifactId>
</dependency>
<!--必备:undertow容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<!--upms api、model 模块-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-upms-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-process-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-process</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-core</artifactId>
</dependency>
<!--必备:日志处理-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-log</artifactId>
</dependency>
<!--mybatis-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<!--数据库-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--必备:安全模块-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-security</artifactId>
</dependency>
<!--必备:swagger-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<version>5.8.0</version>
<artifactId>hutool-all</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<serverId>docker-hub</serverId>
<!--指定生成的镜像名-->
<imageName>${my.hub.host}/${map.group.name}/${project.artifactId}:${project.version}</imageName>
<dockerDirectory>${project.basedir}/</dockerDirectory>
<!--指定远程 docker api地址-->
<!--<dockerHost>http://172.16.66.232:2375</dockerHost>-->
<!-- 这里是复制 jar 包到 docker 容器指定目录配置-->
<resources>
<resource>
<targetPath>/</targetPath>
<!--jar 包所在的路径 此处配置的 即对应 target 目录-->
<directory>${project.build.directory}</directory>
<!-- 需要包含的 jar包 ,这里对应的是 Dockerfile中添加的文件名 -->
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
<forceTags>true</forceTags>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/*.xlsx</exclude>
<exclude>**/*.xls</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*.xlsx</include>
<include>**/*.xls</include>
</includes>
</resource>
</resources>
</build>
</project>
package com.yifu.cloud.plus.v1.yifu.process;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.EnableYifuResourceServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
/**
* @author pig archetype
* <p>
* 项目启动类
*/
@EnableYifuResourceServer
@SpringBootApplication
public class YifuProcessApplication {
public static void main(String[] args) {
SpringApplication.run(YifuProcessApplication.class, args);
}
}
package com.yifu.cloud.plus.v1.yifu.process.config;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.config.MybatisPlusMetaObjectHandler;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.plugins.YifuPaginationInnerInterceptor;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.support.TransactionTemplate;
import javax.sql.DataSource;
/**
* @author chenyuxi
* @date 2025-01-10
* @since 1.7.5
*/
@Configuration
@MapperScan(basePackages = "com.yifu.cloud.plus.v1.yifu.process.mapper", sqlSessionTemplateRef = "processSqlSessionTemplate", sqlSessionFactoryRef = "processSqlSessionFactory")
public class ProcessDataSourceConfig {
@Bean(name = "processDataSource")
@ConfigurationProperties(prefix = "spring.datasource.process")
@Primary
public DataSource processDataSource() {
return DataSourceBuilder.create().build();
}
@Bean
public SqlSessionFactory processSqlSessionFactory(@Qualifier("processDataSource") DataSource dataSource) throws Exception {
MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
bean.setDataSource(dataSource);
//多数据源 myMetaObjectHandler不起作用问题解决
GlobalConfig globalConfig = new GlobalConfig();
globalConfig.setMetaObjectHandler(new MybatisPlusMetaObjectHandler());
globalConfig.setDbConfig(new GlobalConfig.DbConfig());
globalConfig.setBanner(false);
bean.setGlobalConfig(globalConfig);
//添加XML目录
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
try {
bean.setMapperLocations(resolver.getResources("classpath:mapper/*.xml"));
//分页插件配置,不配置分页插件无效,否则会出现total为0的情况
bean.setPlugins(processPlusInterceptor());
SqlSessionFactory sqlSessionFactory = bean.getObject();
sqlSessionFactory.getConfiguration().setMapUnderscoreToCamelCase(true);
return sqlSessionFactory;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
@Bean(name = "processTransactionManager")
@Primary
public DataSourceTransactionManager processTransactionManager(@Qualifier("processDataSource") DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
public SqlSessionTemplate processSqlSessionTemplate(@Qualifier("processSqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
@Bean
public TransactionTemplate processTransactionTemplate(@Qualifier("processTransactionManager") DataSourceTransactionManager dataSourceTransactionManager) {
return new TransactionTemplate(dataSourceTransactionManager);
}
@Bean
public MybatisPlusInterceptor processPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new YifuPaginationInnerInterceptor());
return interceptor;
}
}
package com.yifu.cloud.plus.v1.yifu.process.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.process.entity.TDelayNodeConfig;
import com.yifu.cloud.plus.v1.yifu.process.service.TDelayNodeConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
/**
* 定时流程节点配置
*
* @author hgw
* @date 2020-07-16 17:48:52
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tdelaynodeconfig")
@Tag(name = "定时流程节点配置")
public class TDelayNodeConfigController {
@Resource
private TDelayNodeConfigService tDelayNodeConfigService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tDelayNodeConfig 定时流程节点配置
* @return
*/
@Operation(summary = "简单分页查询", description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TDelayNodeConfig>> getTDelayNodeConfigPage(Page<TDelayNodeConfig> page, TDelayNodeConfig tDelayNodeConfig) {
return R.ok(tDelayNodeConfigService.getTDelayNodeConfigPage(page, tDelayNodeConfig));
}
/**
* 通过id查询单条记录
*
* @param id
* @return R
*/
@Operation(summary = "id查询")
@GetMapping("/{id}")
public R<TDelayNodeConfig> getById(@PathVariable("id") String id) {
return R.ok(tDelayNodeConfigService.getById(id));
}
/**
* 新增记录
*
* @param tDelayNodeConfig
* @return R
*/
@Operation(summary = "新增")
@PostMapping
public R<Boolean> save(@Valid @RequestBody TDelayNodeConfig tDelayNodeConfig) {
return R.ok(tDelayNodeConfigService.save(tDelayNodeConfig));
}
/**
* 修改记录
*
* @param tDelayNodeConfig
* @return R
*/
@Operation(summary = "新增")
@SysLog("修改定时流程节点配置")
@PutMapping
public R<Boolean> update(@RequestBody TDelayNodeConfig tDelayNodeConfig) {
return R.ok(tDelayNodeConfigService.updateById(tDelayNodeConfig));
}
/**
* 通过id删除一条记录
*
* @param id
* @return R
*/
@Operation(summary = "删除")
@SysLog("删除定时流程节点配置")
@DeleteMapping("/{id}")
public R<Boolean> removeById(@PathVariable String id) {
return new R<>(tDelayNodeConfigService.removeById(id));
}
}
package com.yifu.cloud.plus.v1.yifu.process.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodeConfig;
import com.yifu.cloud.plus.v1.yifu.process.service.TNodeConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
/**
* 流程节点配置表(规则配置)
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tnodeconfig")
@Tag(name = "流程节点配置表(规则配置)")
public class TNodeConfigController {
@Resource
private TNodeConfigService tNodeConfigService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tNodeConfig 流程节点配置表(规则配置)
* @return
*/
@Operation(summary = "简单分页查询")
@GetMapping("/page")
public R<IPage<TNodeConfig>> getTNodeConfigPage(Page<TNodeConfig> page, TNodeConfig tNodeConfig) {
return new R<>(tNodeConfigService.getTNodeConfigPage(page, tNodeConfig));
}
/**
* 通过id查询单条记录
*
* @param id
* @return R
*/
@Operation(summary = "id查询")
@GetMapping("/{id}")
public R<TNodeConfig> getById(@PathVariable("id") String id) {
return new R<>(tNodeConfigService.getById(id));
}
/**
* 新增记录
*
* @param tNodeConfig
* @return R
*/
@Operation(summary = "新增")
@PostMapping
public R<Boolean> save(@Valid @RequestBody TNodeConfig tNodeConfig) {
return new R<>(tNodeConfigService.save(tNodeConfig));
}
/**
* 修改记录
*
* @param tNodeConfig
* @return R
*/
@Operation(summary = "修改")
@SysLog("修改流程节点配置表(规则配置)")
@PutMapping
public R<Boolean> update(@RequestBody TNodeConfig tNodeConfig) {
return new R<>(tNodeConfigService.updateById(tNodeConfig));
}
/**
* 通过id删除一条记录
*
* @param id
* @return R
*/
@Operation(summary = "删除")
@SysLog("删除流程节点配置表(规则配置)")
@DeleteMapping("/{id}")
public R<Boolean> removeById(@PathVariable String id) {
return new R<>(tNodeConfigService.removeById(id));
}
}
package com.yifu.cloud.plus.v1.yifu.process.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.process.entity.TDelayNodeConfig;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
/**
* 定时流程节点配置
*
* @author hgw
* @date 2020-07-16 17:48:52
*/
@Mapper
public interface TDelayNodeConfigMapper extends BaseMapper<TDelayNodeConfig> {
/**
* 定时流程节点配置简单分页查询
*
* @param tDelayNodeConfig 定时流程节点配置
* @return
*/
IPage<TDelayNodeConfig> getTDelayNodeConfigPage(Page<TDelayNodeConfig> page
, @Param("tDelayNodeConfig") TDelayNodeConfig tDelayNodeConfig);
}
package com.yifu.cloud.plus.v1.yifu.process.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodeConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 流程节点配置表(规则配置)
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Mapper
public interface TNodeConfigMapper extends BaseMapper<TNodeConfig> {
/**
* 流程节点配置表(规则配置)简单分页查询
*
* @param tNodeConfig 流程节点配置表(规则配置)
* @return
*/
IPage<TNodeConfig> getTNodeConfigPage(Page<TNodeConfig> page, @Param("tNodeConfig") TNodeConfig tNodeConfig);
}
package com.yifu.cloud.plus.v1.yifu.process.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodeRouteCondition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 流程路由条件
*
* @author hgw
* @date 2020-07-16 15:44:02
*/
@Mapper
public interface TNodeRouteConditionMapper extends BaseMapper<TNodeRouteCondition> {
/**
* 流程路由条件简单分页查询
*
* @param tNodeRouteCondition 流程路由条件
* @return
*/
IPage<TNodeRouteCondition> getTNodeRouteConditionPage(Page<TNodeRouteCondition> page
, @Param("tNodeRouteCondition") TNodeRouteCondition tNodeRouteCondition);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment