租户账户修改

This commit is contained in:
曹佳豪 2025-08-06 09:55:15 +08:00
parent 668787f053
commit f76af44a0a
10 changed files with 85 additions and 21 deletions

View File

@ -56,7 +56,7 @@ spring:
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://82.156.121.2:23306/wzj?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true url: jdbc:mysql://82.156.121.2:13306/wzj?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: wzj username: wzj
password: A085F27A43B0 password: A085F27A43B0
# # 从库数据源 # # 从库数据源

View File

@ -52,7 +52,7 @@ spring:
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://82.156.121.2:23306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true url: jdbc:mysql://82.156.121.2:13306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: wzj username: wzj
password: A085F27A43B0 password: A085F27A43B0
# # 从库数据源 # # 从库数据源
@ -103,7 +103,7 @@ spring.data:
# 地址 # 地址
host: localhost host: localhost
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 26379
# 数据库索引 # 数据库索引
database: 0 database: 0
# redis 密码必须配置 # redis 密码必须配置

View File

@ -35,10 +35,9 @@ public class SysTenantAccountController {
@Operation(summary = "查询租户账户列表") @Operation(summary = "查询租户账户列表")
@PostMapping("/list") @PostMapping("/list")
public R<IPage<SysTenantAccountVo>> fansList(@RequestBody SysTenantAccountBo bo, @RequestBody Page<SysTenantAccount> page) { public R<IPage<SysTenantAccountVo>> fansList(@RequestBody SysTenantAccountBo bo, Page<SysTenantAccount> page) {
LambdaQueryWrapper<SysTenantAccount> fansQuery = new LambdaQueryWrapper<>(); IPage<SysTenantAccountVo> result = service.selectTenantAccountPage(page, bo);
Page<SysTenantAccount> fans = service.page(page, fansQuery); return R.ok(result);
return R.ok(convert.toVO(fans));
} }
@Operation(summary = "导出租户账户列表") @Operation(summary = "导出租户账户列表")

View File

@ -19,20 +19,16 @@ public class SysTenantAccountBo extends BaseAudit {
private Long tenantId; private Long tenantId;
@Schema(description = "积分余额") @Schema(description = "积分余额")
private BigDecimal integralBalance; private BigDecimal integralBalance;
@Schema(description = "累计积分余额")
private BigDecimal totalIntegralBalance;
@Schema(description = "现金余额")
private BigDecimal moneyBalance;
@Schema(description = "钱包余额") @Schema(description = "钱包余额")
private BigDecimal wallet; private BigDecimal wallet;
@Schema(description = "累计收益") @Schema(description = "营收")
private BigDecimal revenue; private BigDecimal revenue;
@Schema(description = "创建人")
private Long createBy;
@Schema(description = "更新人")
private Long updateBy; private Long updateBy;
@Schema(description = "账户类型 1商家 2代理 3平台") @Schema(description = "账户类型 1商家 2代理 3平台")
private Integer type; private Integer type;
private String storeName;
public LambdaQueryWrapper<SysTenantAccount> toWrapper() { public LambdaQueryWrapper<SysTenantAccount> toWrapper() {
LambdaQueryWrapper<SysTenantAccount> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysTenantAccount> wrapper = new LambdaQueryWrapper<>();

View File

@ -14,14 +14,14 @@ public class SysTenantAccountVo {
private Long tenantId; private Long tenantId;
@Schema(description = "积分余额") @Schema(description = "积分余额")
private BigDecimal integralBalance; private BigDecimal integralBalance;
@Schema(description = "累计积分余额") // @Schema(description = "累计积分余额")
private BigDecimal totalIntegralBalance; // private BigDecimal totalIntegralBalance;
@Schema(description = "更新时间") @Schema(description = "更新时间")
private Date updateTime; private Date updateTime;
@Schema(description = "创建时间") @Schema(description = "创建时间")
private Date createTime; private Date createTime;
@Schema(description = "现金余额") // @Schema(description = "现金余额")
private BigDecimal moneyBalance; // private BigDecimal moneyBalance;
@Schema(description = "钱包余额") @Schema(description = "钱包余额")
private BigDecimal wallet; private BigDecimal wallet;
@Schema(description = "累计收益") @Schema(description = "累计收益")
@ -32,4 +32,8 @@ public class SysTenantAccountVo {
private Long updateBy; private Long updateBy;
@Schema(description = "账户类型 1商家 2代理 3平台") @Schema(description = "账户类型 1商家 2代理 3平台")
private Integer type; private Integer type;
@Schema(description = "店铺名称")
private String storeName;
@Schema(description = "店铺名称")
private String companyName;
} }

View File

@ -1,13 +1,22 @@
package org.dromara.system.mapper; package org.dromara.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.system.domain.CommissionSection; import org.dromara.system.domain.CommissionSection;
import org.dromara.system.domain.SysTenantAccount; import org.dromara.system.domain.SysTenantAccount;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.dromara.system.domain.bo.SysTenantAccountBo;
import org.dromara.system.domain.vo.CommissionSectionVo; import org.dromara.system.domain.vo.CommissionSectionVo;
import org.dromara.system.domain.vo.SysTenantAccountVo; import org.dromara.system.domain.vo.SysTenantAccountVo;
@Mapper @Mapper
public interface SysTenantAccountMapper extends BaseMapperPlus<SysTenantAccount, SysTenantAccountVo> { public interface SysTenantAccountMapper extends BaseMapperPlus<SysTenantAccount, SysTenantAccountVo> {
/**
* 分页查询租户账户列表关联租户表获取店铺名称
*/
IPage<SysTenantAccountVo> selectTenantAccountPage(Page<SysTenantAccount> page, @Param("bo") SysTenantAccountBo bo);
} }

View File

@ -6,11 +6,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
import org.dromara.system.domain.CommissionSection; import org.dromara.system.domain.CommissionSection;
import org.dromara.system.domain.SysTenantAccount; import org.dromara.system.domain.SysTenantAccount;
import org.dromara.system.domain.bo.SysTenantAccountBo; import org.dromara.system.domain.bo.SysTenantAccountBo;
import org.dromara.system.domain.vo.SysTenantAccountVo;
import java.util.List; import java.util.List;
public interface ISysTenantAccountService extends IService<SysTenantAccount> { public interface ISysTenantAccountService extends IService<SysTenantAccount> {
IPage<SysTenantAccount> pageWithTenant(Page<SysTenantAccount> page, SysTenantAccountBo bo); IPage<SysTenantAccount> pageWithTenant(Page<SysTenantAccount> page, SysTenantAccountBo bo);
IPage<SysTenantAccountVo> selectTenantAccountPage(Page<SysTenantAccount> page, SysTenantAccountBo bo);
List<SysTenantAccount> list(SysTenantAccountBo bo); List<SysTenantAccount> list(SysTenantAccountBo bo);
SysTenantAccount getById(Long id); SysTenantAccount getById(Long id);
boolean save(SysTenantAccount po); boolean save(SysTenantAccount po);

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.dromara.system.domain.SysTenantAccount; import org.dromara.system.domain.SysTenantAccount;
import org.dromara.system.domain.bo.SysTenantAccountBo; import org.dromara.system.domain.bo.SysTenantAccountBo;
import org.dromara.system.domain.vo.SysTenantAccountVo;
import org.dromara.system.mapper.SysTenantAccountMapper; import org.dromara.system.mapper.SysTenantAccountMapper;
import org.dromara.system.service.ISysTenantAccountService; import org.dromara.system.service.ISysTenantAccountService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -24,6 +25,11 @@ public class SysTenantAccountServiceImpl extends ServiceImpl<SysTenantAccountMa
return mapper.selectPage(page, wrapper); return mapper.selectPage(page, wrapper);
} }
@Override
public IPage<SysTenantAccountVo> selectTenantAccountPage(Page<SysTenantAccount> page, SysTenantAccountBo bo) {
return mapper.selectTenantAccountPage(page, bo);
}
@Override @Override
public List<SysTenantAccount> list(SysTenantAccountBo bo) { public List<SysTenantAccount> list(SysTenantAccountBo bo) {
LambdaQueryWrapper<SysTenantAccount> wrapper = buildWrapper(bo); LambdaQueryWrapper<SysTenantAccount> wrapper = buildWrapper(bo);

View File

@ -0,0 +1,48 @@
<?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="org.dromara.system.mapper.SysTenantAccountMapper">
<resultMap type="org.dromara.system.domain.vo.SysTenantAccountVo" id="SysTenantAccountResult">
<result property="id" column="id"/>
<result property="tenantId" column="tenant_id"/>
<result property="integralBalance" column="integral_balance"/>
<result property="totalIntegralBalance" column="total_integral_balance"/>
<result property="moneyBalance" column="money_balance"/>
<result property="wallet" column="wallet"/>
<result property="revenue" column="revenue"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="type" column="type"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="storeName" column="store_name"/>
</resultMap>
<select id="selectTenantAccountPage" resultMap="SysTenantAccountResult">
SELECT
ta.id,
ta.tenant_id,
ta.integral_balance,
ta.wallet,
ta.revenue,
ta.create_by,
ta.update_by,
ta.type,
ta.create_time,
t.store_name,
t.company_name
FROM sys_tenant_account ta
LEFT JOIN sys_tenant t ON ta.tenant_id = t.tenant_id
<where>
<if test="bo.storeName != null and bo.storeName != ''">
AND t.store_name LIKE CONCAT('%', #{bo.storeName}, '%')
</if>
<if test="bo.type != null">
AND ta.type = #{bo.type}
</if>
</where>
</select>
</mapper>

View File

@ -29,7 +29,7 @@ public class DivideController {
@Tag(name = "查询列表") @Tag(name = "查询列表")
@PostMapping("/list") @PostMapping("/list")
public R<IPage<DivideVO>> list(@RequestBody DivideBO bo, @RequestBody Page page) { public R<IPage<DivideVO>> slist(@RequestBody DivideBO bo, @RequestBody Page page) {
Page<Divide> pages = service.page(page, bo.toWrapper()); Page<Divide> pages = service.page(page, bo.toWrapper());
return R.ok(convert.toVO(pages)); return R.ok(convert.toVO(pages));
} }