feat:充值显示总金额

This commit is contained in:
dzc committed 2025-06-26 10:28:05 +08:00
1 parent 203047f713
commit f1e7de9616
6 files changed
+103 -47

No files matched your search

@@ -40,4 +40,9 @@ public class WalletRechargeApplyVo extends WalletRechargeApplyEntity implements
*/
private Boolean isCheckUser = false;
/**
* 总金额
*/
private Integer totalPrice;
}
@@ -6,6 +6,7 @@ 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.data.datascope.DataScope;
import com.bsd.pjcloud.common.excel.annotation.RequestExcel;
import com.bsd.pjcloud.common.log.annotation.SysLog;
import com.bsd.pjcloud.common.security.annotation.Inner;
@@ -93,7 +94,8 @@ public class WalletRechargeApplyController {
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_view')")
public R getWalletRechargeApplyPage(@ParameterObject Page page, @ParameterObject WalletRechargeApplyDto dto) {
dto.setIsFindCheckUser(true);
return R.ok(walletRechargeApplyService.scopePageList(page, dto));
DataScope dataScope = new DataScope();
return R.ok(walletRechargeApplyService.scopePageList(page, dto, dataScope));
}
@Operation(summary = "通过id查询", description = "通过id查询")
@@ -16,37 +16,17 @@ import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface WalletRechargeApplyMapper extends PjcloudBaseMapper<WalletRechargeApplyEntity> {
default Page<WalletRechargeApplyVo> pageJoin(Page page, WalletRechargeApplyDto dto) {
MPJLambdaWrapper<WalletRechargeApplyEntity> wrapper = new MPJLambdaWrapper<WalletRechargeApplyEntity>()
.selectAll(WalletRechargeApplyEntity.class)
.selectAs(WalletTypeEntity::getName, WalletRechargeApplyVo::getWalletTypeName)
.selectAs(WalletTypeEntity::getUniqueCode, WalletRechargeApplyVo::getWalletTypeUniqueCode)
.leftJoin(WalletTypeEntity.class, WalletTypeEntity::getId, WalletRechargeApplyEntity::getWalletTypeId)
.eqIfExists(WalletRechargeApplyEntity::getWalletTypeId, dto.getWalletTypeId())
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletManageEntity::getUserId, dto.getUserIds())
.in(ObjectUtil.isNotEmpty(dto.getWalletTypeIds()), WalletManageEntity::getWalletTypeId, dto.getWalletTypeIds())
.between(
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
WalletRechargeApplyEntity::getCreateTime,
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[0] : null,
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
)
.between(
ObjectUtil.isNotEmpty(dto.getProcessTimeList()),
WalletRechargeApplyEntity::getProcessTime,
ObjectUtil.isNotEmpty(dto.getProcessTimeList()) ? dto.getProcessTimeList()[0] : null,
ObjectUtil.isNotEmpty(dto.getProcessTimeList()) ? dto.getProcessTimeList()[1] : null
)
.orderByDesc(WalletRechargeApplyEntity::getCreateTime)
.orderByDesc(WalletRechargeApplyEntity::getId);
return selectJoinPage(page, WalletRechargeApplyVo.class, wrapper);
}
Page<WalletRechargeApplyVo> scopePageList(Page page, @Param("dto") WalletRechargeApplyDto dto, DataScope dataScope);
Page<WalletRechargeApplyVo> pageJoin(Page page, @Param("dto") WalletRechargeApplyDto dto, DataScope dataScope);
default Page<WalletRechargeApplyVo> scopePageList(Page page, WalletRechargeApplyDto dto) {
LambdaQueryWrapper<WalletRechargeApplyEntity> wrapper = new LambdaQueryWrapper<WalletRechargeApplyEntity>()
@@ -3,6 +3,7 @@ package com.bsd.pjcloud.wallet.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeImportDto;
@@ -32,9 +33,9 @@ public interface WalletRechargeApplyService extends IService<WalletRechargeApply
*/
void delByIds(ArrayList<Long> list);
Page<WalletRechargeApplyVo> pageJoin(Page page, WalletRechargeApplyDto dto);
Page<WalletRechargeApplyVo> pageJoin(Page page, WalletRechargeApplyDto dto, DataScope dataScope);
Page<WalletRechargeApplyVo> scopePageList(Page page, WalletRechargeApplyDto dto);
Page<WalletRechargeApplyVo> scopePageList(Page page, WalletRechargeApplyDto dto, DataScope dataScope);
/**
* 提交申请
@@ -21,6 +21,7 @@ import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
import com.bsd.pjcloud.common.core.util.BeanUtils;
import com.bsd.pjcloud.common.core.util.CollectionUtils;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.common.data.tenant.TenantContextHolder;
import com.bsd.pjcloud.common.excel.vo.ErrorMessage;
import com.bsd.pjcloud.common.security.service.PjcloudUser;
@@ -204,8 +205,8 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
}
@Override
public Page<WalletRechargeApplyVo> pageJoin(Page page, WalletRechargeApplyDto dto) {
Page<WalletRechargeApplyVo> list = baseMapper.pageJoin(page, dto);
public Page<WalletRechargeApplyVo> pageJoin(Page page, WalletRechargeApplyDto dto, DataScope dataScope) {
Page<WalletRechargeApplyVo> list = baseMapper.pageJoin(page, dto, dataScope);
if (ObjectUtil.isNotEmpty(list.getRecords())) {
// 用户
List<Long> userIds = list.getRecords().stream().map(WalletRechargeApplyVo::getUserId).distinct().toList();
@@ -229,8 +230,8 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
@Override
public Page<WalletRechargeApplyVo> scopePageList(Page page, WalletRechargeApplyDto dto) {
Page<WalletRechargeApplyVo> list = baseMapper.scopePageList(page, dto);
public Page<WalletRechargeApplyVo> scopePageList(Page page, WalletRechargeApplyDto dto, DataScope dataScope) {
Page<WalletRechargeApplyVo> list = baseMapper.scopePageList(page, dto, dataScope);
disposeList(list.getRecords(), dto);
return list;
}
@@ -3,19 +3,86 @@
<mapper namespace="com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeApplyMapper">
<resultMap id="walletRechargeApplyMap" type="com.bsd.pjcloud.wallet.api.entity.recharge.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>
<sql id="selectA">
select a.id,
a.user_id,
a.invoice_id,
a.process_id,
a.process_status,
a.process_time,
a.biz_type,
a.wallet_type_id,
a.dept_id,
a.import_time,
a.remark,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.tenant_id,
a.apply_time,
a.is_authorization,
</sql>
<sql id="whereA">
a.del_flag = '0'
<if test="dto.userId != null">
and a.user_id = #{dto.userId}
</if>
<if test="dto.bizType != null">
and a.biz_type = #{dto.bizType}
</if>
<if test="dto.userIds != null and dto.userIds.size() != 0">
and a.user_id in
<foreach collection="dto.userIds" item="v" open="(" close=")" separator=",">
#{v}
</foreach>
</if>
<if test="dto.walletTypeIds != null and dto.walletTypeIds.size() != 0">
and a.wallet_type_id in
<foreach collection="dto.walletTypeIds" item="v" open="(" close=")" separator=",">
#{v}
</foreach>
</if>
<if test="dto.createTimeList != null and dto.createTimeList.length == 2">
and a.create_time between #{dto.createTimeList[0]} and #{dto.createTimeList[1]}
</if>
<if test="dto.processTimeList != null and dto.processTimeList.length == 2">
and a.create_time between #{dto.processTimeList[0]} and #{dto.processTimeList[1]}
</if>
</sql>
<sql id="selectPageA">
<include refid="selectA"/>
t.name as walletTypeName,
t.unique_code as walletTypeUniqueCode,
t.icon as walletTypeIcon,
t.is_rule as isRule,
(select sum(i.price)
from wallet_recharge_import i
where i.del_flag = '0'
and i.apply_id = a.id) as totalPrice
from wallet_recharge_apply a
left join wallet_type t on a.wallet_type_id = t.id and t.del_flag = '0'
<where>
<include refid="whereA"/>
</where>
group by a.id
<if test="dto.processStatus != null and dto.processStatus == 2">
order by a.process_time desc , a.id desc
</if>
<if test="dto.processStatus != null and dto.processStatus != 2">
order by a.apply_time desc , a.create_time desc
</if>
</sql>
<select id="scopePageList" resultType="com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo">
<include refid="selectPageA" />
</select>
<select id="pageJoin" resultType="com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo">
<include refid="selectPageA"/>
</select>
</mapper>