feat:充值/扣款申请代码生成

This commit is contained in:
dzc committed 2024-12-31 14:38:27 +08:00
1 parent 4f2010ac34
commit c717985e1d
16 files changed
+512 -1

No files matched your search

+38 -1
View File
@@ -109,7 +109,7 @@ CREATE TABLE wallet_transaction
(
id bigint NOT NULL COMMENT '编号',
wallet_id bigint NOT NULL COMMENT '会员钱包 id',
biz_type tinyint NOT NULL COMMENT '关联类型',
biz_type tinytext NOT NULL COMMENT '关联类型',
biz_id varchar(64) NOT NULL COMMENT '关联业务编号',
title varchar(128) NOT NULL COMMENT '流水标题',
price int NOT NULL COMMENT '交易金额, 单位分',
@@ -144,3 +144,40 @@ CREATE TABLE `sys_user_face`
COLLATE = utf8mb4_general_ci COMMENT ='人脸样本表';
CREATE INDEX idx_dept_id ON sys_user_face (user_id);
CREATE TABLE wallet_recharge_apply
(
id bigint NOT NULL COMMENT '主键ID',
user_id bigint NOT NULL COMMENT '申请人ID',
biz_type tinytext DEFAULT NULL COMMENT '充值类型',
wallet_type_id bigint DEFAULT NULL COMMENT '饭卡类型id',
dept_id bigint NOT NULL COMMENT '部门ID',
import_time timestamp DEFAULT NULL COMMENT '导入时间(手动选择)',
remark varchar(256) DEFAULT '' 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 '修改人',
update_time datetime DEFAULT NULL COMMENT '修改时间',
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT ='充值申请表';
CREATE INDEX idx_dept_id ON wallet_recharge_apply (user_id);
CREATE TABLE wallet_recharge_import
(
id bigint NOT NULL COMMENT '编号',
user_id bigint NOT NULL COMMENT '用户id',
apply_id bigint NOT NULL COMMENT '申请id',
before_price int NOT NULL COMMENT '导入前的金额',
price int 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 '修改人',
update_time datetime DEFAULT NULL COMMENT '修改时间',
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
PRIMARY KEY (id)
) COMMENT ='充值导入表';
CREATE INDEX idx_dept_id ON wallet_recharge_import (user_id);
@@ -0,0 +1,9 @@
package com.bsd.pjcloud.wallet.api.dto;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
import lombok.Data;
@Data
public class WalletRechargeApplyDto extends WalletRechargeApplyEntity {
}
@@ -0,0 +1,9 @@
package com.bsd.pjcloud.wallet.api.dto;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
import lombok.Data;
@Data
public class WalletRechargeImportDto extends WalletRechargeImportEntity {
}
@@ -0,0 +1,109 @@
package com.bsd.pjcloud.wallet.api.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
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;
/**
* 充值/扣款申请
*
* @author pjcloud
* @date 2024-12-31 14:23:57
*/
@Data
@TenantTable
@TableName("wallet_recharge_apply")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "充值/扣款申请")
public class WalletRechargeApplyEntity extends Model<WalletRechargeApplyEntity> {
/**
* 主键ID
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键ID")
private Long id;
/**
* 申请人ID
*/
@Schema(description = "申请人ID")
private Long userId;
/**
* 充值类型
*/
@Schema(description = "充值类型")
private String bizType;
/**
* 饭卡类型id
*/
@Schema(description = "饭卡类型id")
private Long walletTypeId;
/**
* 部门ID
*/
@Schema(description = "部门ID")
private Long deptId;
/**
* 导入时间(手动选择)
*/
@Schema(description = "导入时间(手动选择)")
private LocalDateTime importTime;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
/**
* 创建人
*/
@TableField(fill = FieldFill.INSERT)
@Schema(description = "创建人")
private String createBy;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
@Schema(description = "创建时间")
private LocalDateTime createTime;
/**
* 修改人
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
@Schema(description = "修改人")
private String updateBy;
/**
* 修改时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
@Schema(description = "修改时间")
private LocalDateTime updateTime;
/**
* 删除标记
*/
@TableLogic
@TableField(fill = FieldFill.INSERT)
@Schema(description = "删除标记")
private String delFlag;
/**
* 租户ID
*/
@Schema(description = "租户ID")
private Long tenantId;
}
@@ -0,0 +1,97 @@
package com.bsd.pjcloud.wallet.api.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
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;
/**
* 充值导入表
*
* @author dzc
* @date 2024-12-31 14:24:39
*/
@Data
@TenantTable
@TableName("wallet_recharge_import")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "充值导入表")
public class WalletRechargeImportEntity extends Model<WalletRechargeImportEntity> {
/**
* 编号
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "编号")
private Long id;
/**
* 用户id
*/
@Schema(description = "用户id")
private Long userId;
/**
* 申请id
*/
@Schema(description = "申请id")
private Long applyId;
/**
* 导入前的金额
*/
@Schema(description = "导入前的金额")
private Integer beforePrice;
/**
* 交易金额, 单位分
*/
@Schema(description = "交易金额, 单位分")
private Integer price;
/**
* 创建人
*/
@TableField(fill = FieldFill.INSERT)
@Schema(description = "创建人")
private String createBy;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
@Schema(description = "创建时间")
private LocalDateTime createTime;
/**
* 修改人
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
@Schema(description = "修改人")
private String updateBy;
/**
* 修改时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
@Schema(description = "修改时间")
private LocalDateTime updateTime;
/**
* 删除标记
*/
@TableLogic
@TableField(fill = FieldFill.INSERT)
@Schema(description = "删除标记")
private String delFlag;
/**
* 租户ID
*/
@Schema(description = "租户ID")
private Long tenantId;
}
@@ -0,0 +1,9 @@
package com.bsd.pjcloud.wallet.api.vo;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
import lombok.Data;
@Data
public class WalletRechargeApplyVo extends WalletRechargeApplyEntity {
}
@@ -0,0 +1,9 @@
package com.bsd.pjcloud.wallet.api.vo;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
import lombok.Data;
@Data
public class WalletRechargeImportVo extends WalletRechargeImportEntity {
}
@@ -0,0 +1,124 @@
package com.bsd.pjcloud.wallet.controller;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.log.annotation.SysLog;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
import com.bsd.pjcloud.wallet.service.WalletRechargeApplyService;
import org.springframework.security.access.prepost.PreAuthorize;
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.http.HttpHeaders;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 充值/扣款申请
*
* @author pjcloud
* @date 2024-12-31 14:23:57
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/wallet-recharge-apply")
@Tag(description = "wallet-recharge-apply", name = "充值/扣款申请管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class WalletRechargeApplyController {
private final WalletRechargeApplyService walletRechargeApplyService;
/**
* 分页查询
*
* @param page 分页对象
* @param walletRechargeApply 充值/扣款申请
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_view')")
public R getWalletRechargeApplyPage(@ParameterObject Page page, @ParameterObject WalletRechargeApplyEntity walletRechargeApply) {
LambdaQueryWrapper<WalletRechargeApplyEntity> wrapper = Wrappers.lambdaQuery();
return R.ok(walletRechargeApplyService.page(page, wrapper));
}
/**
* 通过id查询充值/扣款申请
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_view')")
public R getById(@PathVariable("id") Long id) {
return R.ok(walletRechargeApplyService.getById(id));
}
/**
* 新增充值/扣款申请
*
* @param walletRechargeApply 充值/扣款申请
* @return R
*/
@Operation(summary = "新增充值/扣款申请", description = "新增充值/扣款申请")
@SysLog("新增充值/扣款申请")
@PostMapping
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_add')")
public R save(@RequestBody WalletRechargeApplyEntity walletRechargeApply) {
return R.ok(walletRechargeApplyService.save(walletRechargeApply));
}
/**
* 修改充值/扣款申请
*
* @param walletRechargeApply 充值/扣款申请
* @return R
*/
@Operation(summary = "修改充值/扣款申请", description = "修改充值/扣款申请")
@SysLog("修改充值/扣款申请")
@PutMapping
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_edit')")
public R updateById(@RequestBody WalletRechargeApplyEntity walletRechargeApply) {
return R.ok(walletRechargeApplyService.updateById(walletRechargeApply));
}
/**
* 通过id删除充值/扣款申请
*
* @param ids id列表
* @return R
*/
@Operation(summary = "通过id删除充值/扣款申请", description = "通过id删除充值/扣款申请")
@SysLog("通过id删除充值/扣款申请")
@DeleteMapping
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_del')")
public R removeById(@RequestBody Long[] ids) {
return R.ok(walletRechargeApplyService.removeBatchByIds(CollUtil.toList(ids)));
}
/**
* 导出excel 表格
*
* @param walletRechargeApply 查询条件
* @param ids 导出指定ID
* @return excel 文件流
*/
@ResponseExcel
@GetMapping("/export")
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_export')")
public List<WalletRechargeApplyEntity> export(WalletRechargeApplyEntity walletRechargeApply, Long[] ids) {
return walletRechargeApplyService.list(Wrappers.lambdaQuery(walletRechargeApply).in(ArrayUtil.isNotEmpty(ids), WalletRechargeApplyEntity::getId, ids));
}
}
@@ -0,0 +1,11 @@
package com.bsd.pjcloud.wallet.mapper;
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface WalletRechargeApplyMapper extends PjcloudBaseMapper<WalletRechargeApplyEntity> {
}
@@ -0,0 +1,11 @@
package com.bsd.pjcloud.wallet.mapper;
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface WalletRechargeImportMapper extends PjcloudBaseMapper<WalletRechargeImportEntity> {
}
@@ -0,0 +1,8 @@
package com.bsd.pjcloud.wallet.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
public interface WalletRechargeApplyService extends IService<WalletRechargeApplyEntity> {
}
@@ -0,0 +1,8 @@
package com.bsd.pjcloud.wallet.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
public interface WalletRechargeImportService extends IService<WalletRechargeImportEntity> {
}
@@ -0,0 +1,16 @@
package com.bsd.pjcloud.wallet.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
import com.bsd.pjcloud.wallet.mapper.WalletRechargeApplyMapper;
import com.bsd.pjcloud.wallet.service.WalletRechargeApplyService;
import org.springframework.stereotype.Service;
/**
* 充值/扣款申请
*
* @author pjcloud
* @date 2024-12-31 14:23:57
*/
@Service
public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeApplyMapper, WalletRechargeApplyEntity> implements WalletRechargeApplyService {
}
@@ -0,0 +1,15 @@
package com.bsd.pjcloud.wallet.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
import com.bsd.pjcloud.wallet.mapper.WalletRechargeImportMapper;
import org.springframework.stereotype.Service;
/**
* 充值导入表
*
* @author dzc
* @date 2024-12-31 14:24:39
*/
@Service
public class WalletRechargeImportServiceImpl extends ServiceImpl<WalletRechargeImportMapper, WalletRechargeImportEntity> implements WalletRechargeImportService {
}
@@ -0,0 +1,21 @@
<?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.bsd.pjcloud.wallet.mapper.WalletRechargeApplyMapper">
<resultMap id="walletRechargeApplyMap" type="com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity">
<id property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="bizType" column="biz_type"/>
<result property="walletTypeId" column="wallet_type_id"/>
<result property="deptId" column="dept_id"/>
<result property="importTime" column="import_time"/>
<result property="remark" column="remark"/>
<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>
</mapper>
@@ -0,0 +1,18 @@
<?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.bsd.pjcloud.wallet.mapper.WalletRechargeImportMapper">
<resultMap id="walletRechargeImportMap" type="com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity">
<id property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="applyId" column="apply_id"/>
<result property="beforePrice" column="before_price"/>
<result property="price" column="price"/>
<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>
</mapper>