feat:使用启用钱包规则
This commit is contained in:
1 parent
c481a2d261
commit
b5a41f85b0
6 files changed
+123
-101
No files matched your search
@@ -132,7 +132,7 @@ CREATE TABLE mch_rule_price_config
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT = '商家商品价格配置表';
|
||||
-- ----------------------------
|
||||
-- Table structure for wallet_rule_mch_config
|
||||
-- Table structure for mch_rule_join
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS mch_rule_join;
|
||||
CREATE TABLE mch_rule_join
|
||||
@@ -159,10 +159,11 @@ CREATE TABLE mch_rule_join
|
||||
DROP TABLE IF EXISTS wallet_type;
|
||||
CREATE TABLE wallet_type
|
||||
(
|
||||
id bigint NOT NULL COMMENT '主键',
|
||||
name varchar(64) NOT NULL COMMENT '钱包名',
|
||||
icon varchar(256) NOT NULL COMMENT '钱包图标',
|
||||
id bigint NOT NULL COMMENT '主键',
|
||||
name varchar(64) NOT NULL COMMENT '钱包名',
|
||||
icon varchar(256) NOT NULL COMMENT '钱包图标',
|
||||
unique_code varchar(16) COMMENT '饭卡code',
|
||||
is_rule char(1) DEFAULT '0' NOT NULL COMMENT '是否启用钱包转账规则',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
@@ -182,6 +183,7 @@ CREATE TABLE wallet_rule_join
|
||||
id BIGINT(19) not null comment '主键',
|
||||
source_wallet_type_id BIGINT(19) not null comment '源钱包类型id',
|
||||
target_wallet_type_id BIGINT(19) not null comment '目标钱包类型id',
|
||||
target_dept_id BIGINT(19) not null comment '目标部门id',
|
||||
balance_multiple int DEFAULT 0 NOT NULL COMMENT '钱包转换百分比',
|
||||
status VARCHAR(64) default '0' not null comment '是否启用',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
|
||||
+52
-45
@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -22,70 +23,76 @@ import java.time.LocalDateTime;
|
||||
public class WalletTypeEntity extends Model<WalletTypeEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="主键")
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 钱包名
|
||||
*/
|
||||
@Schema(description="钱包名")
|
||||
/**
|
||||
* 钱包名
|
||||
*/
|
||||
@Schema(description = "钱包名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 钱包图标
|
||||
*/
|
||||
@Schema(description="钱包图标")
|
||||
/**
|
||||
* 钱包图标
|
||||
*/
|
||||
@Schema(description = "钱包图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 饭卡code
|
||||
*/
|
||||
@Schema(description="饭卡code")
|
||||
/**
|
||||
* 饭卡code
|
||||
*/
|
||||
@Schema(description = "饭卡code")
|
||||
private String uniqueCode;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
/**
|
||||
* 是否启用钱包转账规则
|
||||
*/
|
||||
@Schema(description = "是否启用钱包转账规则")
|
||||
private String isRule;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改人")
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改时间")
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除标记")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description="租户ID")
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+56
-49
@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -19,76 +20,82 @@ import java.time.LocalDateTime;
|
||||
public class WalletRuleJoinEntity extends Model<WalletRuleJoinEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="主键")
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 源钱包类型id
|
||||
*/
|
||||
@Schema(description="源钱包类型id")
|
||||
/**
|
||||
* 源钱包类型id
|
||||
*/
|
||||
@Schema(description = "源钱包类型id")
|
||||
private Long sourceWalletTypeId;
|
||||
|
||||
/**
|
||||
* 目标钱包类型id
|
||||
*/
|
||||
@Schema(description="目标钱包类型id")
|
||||
/**
|
||||
* 目标钱包类型id
|
||||
*/
|
||||
@Schema(description = "目标钱包类型id")
|
||||
private Long targetWalletTypeId;
|
||||
|
||||
/**
|
||||
* 钱包转换百分比
|
||||
*/
|
||||
@Schema(description="钱包转换百分比")
|
||||
/**
|
||||
* 目标部门id
|
||||
*/
|
||||
@Schema(description = "目标部门id")
|
||||
private Long targetDeptId;
|
||||
|
||||
/**
|
||||
* 钱包转换百分比
|
||||
*/
|
||||
@Schema(description = "钱包转换百分比")
|
||||
private Integer balanceMultiple;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@Schema(description="是否启用")
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@Schema(description = "是否启用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改人")
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改时间")
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除标记")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description="租户ID")
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+1
@@ -100,6 +100,7 @@ public class WalletRuleJoinServiceImpl extends ServiceImpl<WalletRuleJoinMapper,
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<WalletRuleJoinEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getSourceWalletTypeId()), WalletRuleJoinEntity::getSourceWalletTypeId, dto.getSourceWalletTypeId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getTargetWalletTypeId()), WalletRuleJoinEntity::getTargetWalletTypeId, dto.getTargetWalletTypeId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getTargetDeptId()), WalletRuleJoinEntity::getTargetDeptId, dto.getTargetDeptId())
|
||||
.ne(ObjectUtil.isNotEmpty(dto.getId()), WalletRuleJoinEntity::getId, dto.getId())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(dto.getId())) {
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.wallet.mapper.WalletTypeMapper">
|
||||
|
||||
<resultMap id="walletTypeMap" type="com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity">
|
||||
<resultMap id="walletTypeMap" type="com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="icon" column="icon"/>
|
||||
<result property="uniqueCode" column="unique_code"/>
|
||||
<result property="isRule" column="is_rule"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+5
@@ -6,6 +6,7 @@
|
||||
<id property="id" column="id"/>
|
||||
<result property="sourceWalletTypeId" column="source_wallet_type_id"/>
|
||||
<result property="targetWalletTypeId" column="target_wallet_type_id"/>
|
||||
<result property="targetDeptId" column="target_dept_id"/>
|
||||
<result property="balanceMultiple" column="balance_multiple"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
@@ -20,6 +21,7 @@
|
||||
select a.id,
|
||||
a.source_wallet_type_id,
|
||||
a.target_wallet_type_id,
|
||||
a.target_dept_id,
|
||||
a.balance_multiple,
|
||||
a.status,
|
||||
a.create_by,
|
||||
@@ -38,6 +40,9 @@
|
||||
<if test="dto.targetWalletTypeId != null">
|
||||
and a.target_wallet_type_id = #{dto.targetWalletTypeId}
|
||||
</if>
|
||||
<if test="dto.targetDeptId != null">
|
||||
and a.target_dept_id = #{dto.targetDeptId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="scopeJoinPage" resultType="com.bsd.pjcloud.wallet.api.vo.rule.WalletRuleJoinVo">
|
||||
|
||||
Reference in new issue
Block a user