充值记录
This commit is contained in:
@@ -0,0 +1,87 @@
|
|||||||
|
package com.starry.admin.modules.system.controller;
|
||||||
|
|
||||||
|
import com.starry.admin.modules.system.module.entity.SysTenantRechargeInfoEntity;
|
||||||
|
import com.starry.admin.modules.system.module.vo.SysTenantRechargeInfoAddVo;
|
||||||
|
import com.starry.admin.modules.system.module.vo.SysTenantRechargeInfoQueryVo;
|
||||||
|
import com.starry.admin.modules.system.service.ISysTenantRechargeInfoService;
|
||||||
|
import com.starry.common.annotation.Log;
|
||||||
|
import com.starry.common.enums.BusinessType;
|
||||||
|
import com.starry.common.result.R;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户充值信息Controller
|
||||||
|
*
|
||||||
|
* @author admin
|
||||||
|
* @since 2024-09-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/platform/recharge")
|
||||||
|
public class SysTenantRechargeInfoController {
|
||||||
|
@Resource
|
||||||
|
private ISysTenantRechargeInfoService sysTenantRechargeInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户充值信息列表
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@customSs.hasPermission('play:info:list')")
|
||||||
|
@PostMapping("/listByPage")
|
||||||
|
public R list(@Validated @RequestBody SysTenantRechargeInfoQueryVo vo) {
|
||||||
|
return R.ok(sysTenantRechargeInfoService.selectByPage(vo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取租户充值信息详细信息
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@customSs.hasPermission('play:info:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public R getInfo(@PathVariable("id") String id) {
|
||||||
|
return R.ok(sysTenantRechargeInfoService.selectSysTenantRechargeInfoById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增租户充值信息
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@customSs.hasPermission('play:info:create')")
|
||||||
|
@Log(title = "租户充值信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/create")
|
||||||
|
public R create(@Validated @RequestBody SysTenantRechargeInfoAddVo addVo) {
|
||||||
|
SysTenantRechargeInfoEntity entity = new SysTenantRechargeInfoEntity();
|
||||||
|
BeanUtils.copyProperties(addVo, entity);
|
||||||
|
boolean success = sysTenantRechargeInfoService.create(entity);
|
||||||
|
if (success) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改租户充值信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@customSs.hasPermission('play:info:edit')")
|
||||||
|
@Log(title = "租户充值信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping(value = "/update/{id}")
|
||||||
|
public R update(@PathVariable String id, @RequestBody SysTenantRechargeInfoEntity sysTenantRechargeInfo) {
|
||||||
|
sysTenantRechargeInfo.setId(id);
|
||||||
|
boolean success = sysTenantRechargeInfoService.update(sysTenantRechargeInfo);
|
||||||
|
if (success) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除租户充值信息
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@customSs.hasPermission('play:info:remove')")
|
||||||
|
@Log(title = "租户充值信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R remove(@PathVariable String[] ids) {
|
||||||
|
return R.ok(sysTenantRechargeInfoService.deleteSysTenantRechargeInfoByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.starry.admin.modules.system.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.starry.admin.modules.system.module.entity.SysTenantRechargeInfoEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户充值信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author admin
|
||||||
|
* @since 2024-09-05
|
||||||
|
*/
|
||||||
|
public interface SysTenantRechargeInfoMapper extends MPJBaseMapper<SysTenantRechargeInfoEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.starry.admin.modules.system.module.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.starry.common.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户充值信息对象 sys_tenant_recharge_info
|
||||||
|
*
|
||||||
|
* @author admin
|
||||||
|
* @since 2024-09-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("sys_tenant_recharge_info")
|
||||||
|
public class SysTenantRechargeInfoEntity extends BaseEntity<SysTenantRechargeInfoEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UUID
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户ID
|
||||||
|
*/
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值金额
|
||||||
|
*/
|
||||||
|
private String rechargeAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值用户
|
||||||
|
*/
|
||||||
|
private String rechargeUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime rechargeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式,1:微信支付,2:支付宝支付;3:银行卡支付
|
||||||
|
*/
|
||||||
|
private String payMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付账号
|
||||||
|
*/
|
||||||
|
private String payAccount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.starry.admin.modules.system.module.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author admin
|
||||||
|
* @since 2024/9/5 下午3:44
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class SysTenantRechargeInfoAddVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值金额
|
||||||
|
*/
|
||||||
|
private String rechargeAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值用户
|
||||||
|
*/
|
||||||
|
private String rechargeUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime rechargeTime = LocalDateTime.now();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式,1:微信支付,2:支付宝支付;3:银行卡支付
|
||||||
|
*/
|
||||||
|
private String payMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付账号
|
||||||
|
*/
|
||||||
|
private String payAccount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.starry.admin.modules.system.module.vo;
|
||||||
|
|
||||||
|
import com.starry.common.domain.BasePageEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author admin
|
||||||
|
* @since 2024/9/5 下午3:44
|
||||||
|
**/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class SysTenantRechargeInfoQueryVo extends BasePageEntity {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.starry.admin.modules.system.module.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author admin
|
||||||
|
* @since 2024/9/5 下午3:44
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class SysTenantRechargeInfoReturnVo {
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值金额
|
||||||
|
*/
|
||||||
|
private String rechargeAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值用户
|
||||||
|
*/
|
||||||
|
private String rechargeUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值用户
|
||||||
|
*/
|
||||||
|
private String rechargeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime rechargeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式,1:微信支付,2:支付宝支付;3:银行卡支付
|
||||||
|
*/
|
||||||
|
private String payMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付账号
|
||||||
|
*/
|
||||||
|
private String payAccount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.starry.admin.modules.system.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.starry.admin.modules.system.module.entity.SysTenantRechargeInfoEntity;
|
||||||
|
import com.starry.admin.modules.system.module.vo.SysTenantRechargeInfoQueryVo;
|
||||||
|
import com.starry.admin.modules.system.module.vo.SysTenantRechargeInfoReturnVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户充值信息Service接口
|
||||||
|
*
|
||||||
|
* @author admin
|
||||||
|
* @since 2024-09-05
|
||||||
|
*/
|
||||||
|
public interface ISysTenantRechargeInfoService extends IService<SysTenantRechargeInfoEntity> {
|
||||||
|
/**
|
||||||
|
* 查询租户充值信息
|
||||||
|
*
|
||||||
|
* @param id 租户充值信息主键
|
||||||
|
* @return 租户充值信息
|
||||||
|
*/
|
||||||
|
SysTenantRechargeInfoEntity selectSysTenantRechargeInfoById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户充值信息列表
|
||||||
|
*
|
||||||
|
* @param queryVo 租户充值信息分页查询对象
|
||||||
|
* @return 租户充值信息集合
|
||||||
|
*/
|
||||||
|
IPage<SysTenantRechargeInfoReturnVo> selectByPage(SysTenantRechargeInfoQueryVo queryVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增租户充值信息
|
||||||
|
*
|
||||||
|
* @param sysTenantRechargeInfo 租户充值信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
boolean create(SysTenantRechargeInfoEntity sysTenantRechargeInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改租户充值信息
|
||||||
|
*
|
||||||
|
* @param sysTenantRechargeInfo 租户充值信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
boolean update(SysTenantRechargeInfoEntity sysTenantRechargeInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除租户充值信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的租户充值信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteSysTenantRechargeInfoByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除租户充值信息信息
|
||||||
|
*
|
||||||
|
* @param id 租户充值信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteSysTenantRechargeInfoById(String id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.starry.admin.modules.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.starry.admin.modules.system.entity.SysTenantEntity;
|
||||||
|
import com.starry.admin.modules.system.mapper.SysTenantRechargeInfoMapper;
|
||||||
|
import com.starry.admin.modules.system.module.entity.SysTenantRechargeInfoEntity;
|
||||||
|
import com.starry.admin.modules.system.module.vo.SysTenantRechargeInfoQueryVo;
|
||||||
|
import com.starry.admin.modules.system.module.vo.SysTenantRechargeInfoReturnVo;
|
||||||
|
import com.starry.admin.modules.system.service.ISysTenantRechargeInfoService;
|
||||||
|
import com.starry.common.utils.IdUtils;
|
||||||
|
import com.starry.common.utils.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户充值信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author admin
|
||||||
|
* @since 2024-09-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysTenantRechargeInfoServiceImpl extends ServiceImpl<SysTenantRechargeInfoMapper, SysTenantRechargeInfoEntity> implements ISysTenantRechargeInfoService {
|
||||||
|
@Resource
|
||||||
|
private SysTenantRechargeInfoMapper sysTenantRechargeInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户充值信息
|
||||||
|
*
|
||||||
|
* @param id 租户充值信息主键
|
||||||
|
* @return 租户充值信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysTenantRechargeInfoEntity selectSysTenantRechargeInfoById(String id) {
|
||||||
|
return this.baseMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户充值信息列表
|
||||||
|
*
|
||||||
|
* @param queryVo 租户充值信息
|
||||||
|
* @return 租户充值信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<SysTenantRechargeInfoReturnVo> selectByPage(SysTenantRechargeInfoQueryVo queryVo) {
|
||||||
|
MPJLambdaWrapper<SysTenantRechargeInfoEntity> lambdaQueryWrapper = new MPJLambdaWrapper<>();
|
||||||
|
lambdaQueryWrapper.selectAll(SysTenantRechargeInfoEntity.class);
|
||||||
|
lambdaQueryWrapper.selectAs(SysTenantEntity::getTenantName, "rechargeName");
|
||||||
|
lambdaQueryWrapper.leftJoin(SysTenantEntity.class, SysTenantEntity::getTenantId, SysTenantRechargeInfoEntity::getRechargeUser);
|
||||||
|
return this.baseMapper.selectJoinPage(new Page<>(queryVo.getPageNum(), queryVo.getPageSize()), SysTenantRechargeInfoReturnVo.class, lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增租户充值信息
|
||||||
|
*
|
||||||
|
* @param sysTenantRechargeInfo 租户充值信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean create(SysTenantRechargeInfoEntity sysTenantRechargeInfo) {
|
||||||
|
if (StrUtil.isBlankIfStr(sysTenantRechargeInfo.getId())) {
|
||||||
|
sysTenantRechargeInfo.setId(IdUtils.getUuid());
|
||||||
|
}
|
||||||
|
return save(sysTenantRechargeInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改租户充值信息
|
||||||
|
*
|
||||||
|
* @param sysTenantRechargeInfo 租户充值信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean update(SysTenantRechargeInfoEntity sysTenantRechargeInfo) {
|
||||||
|
return updateById(sysTenantRechargeInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除租户充值信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的租户充值信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSysTenantRechargeInfoByIds(String[] ids) {
|
||||||
|
return sysTenantRechargeInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除租户充值信息信息
|
||||||
|
*
|
||||||
|
* @param id 租户充值信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSysTenantRechargeInfoById(String id) {
|
||||||
|
return sysTenantRechargeInfoMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user