Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
326222615a
13 files changed
+199
-4
No files matched your search
+1
-1
@@ -501,7 +501,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
// 判断商户合作状态
|
||||
if (ObjectUtil.equals(mch.getTypes(), MerchantTypeEnum.SUPERMARKET.getType()) && ObjectUtil.equals(mch.getSupType(), WalletMchSupType.MCH.getCode())) {
|
||||
if (ObjectUtil.equals(mch.getCooperationStatus(), YesNoEnum.NO.getCode())) {
|
||||
throw new RuntimeException("改商家未合作");
|
||||
throw new RuntimeException("该商家未合作");
|
||||
}
|
||||
}
|
||||
// 查询用户
|
||||
|
||||
+13
@@ -165,7 +165,20 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
refundDto.setRefundStatusCodes(List.of(HardSaleStatusEnum.COMPLETE.getStatus()));
|
||||
DataScope refundDataScope = DataScope.of();
|
||||
refundDataScope.setScopeDeptName("merchant_dept_id");
|
||||
|
||||
List<HardOrderCsVo> refundList = hardOrderMapper.listRefundCs(refundDto, refundDataScope);
|
||||
// 有退款没有流水的情况
|
||||
if (ObjectUtil.isAllNotEmpty(totalList, refundList)) {
|
||||
List<Long> totalIds = totalList.stream().map(HardOrderCsVo::getMerchantId).toList();
|
||||
for (HardOrderCsVo refund : refundList) {
|
||||
if (!totalIds.contains(refund.getMerchantId())) {
|
||||
HardOrderCsVo entity = BeanUtils.toBean(refund, HardOrderCsVo.class);
|
||||
entity.setTotalPayPrice(BigDecimal.ZERO);
|
||||
entity.setTotalPayCount(BigDecimal.ZERO);
|
||||
totalList.add(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (HardOrderCsVo v : totalList) {
|
||||
// 退款
|
||||
if (ObjectUtil.isNotEmpty(refundList)) {
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletQbTotalVo {
|
||||
|
||||
/**
|
||||
* 总余额
|
||||
*/
|
||||
private Long total = 0L;
|
||||
|
||||
/**
|
||||
* 饭卡钱包余额
|
||||
*/
|
||||
private Long eatTotal = 0L;
|
||||
|
||||
/**
|
||||
* 消费钱包余额
|
||||
*/
|
||||
private Long payTotal = 0L;
|
||||
|
||||
}
|
||||
+7
@@ -18,6 +18,7 @@ import com.bsd.pjcloud.wallet.api.dto.WalletManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletTopupActionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletQbTotalVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletManageMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletCodeUseService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletManageService;
|
||||
@@ -201,6 +202,12 @@ public class WalletManageController {
|
||||
return R.ok(walletManageService.scopePageList(page, dto, DataScope.of()));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@PostMapping("/qb-total")
|
||||
public R<WalletQbTotalVo> qbTotal(@RequestBody WalletManageBalanceDto dto) {
|
||||
return R.ok(walletManageService.qbTotal(dto, DataScope.of()));
|
||||
}
|
||||
|
||||
@Operation(summary = "钱包记录分页", description = "钱包记录分页")
|
||||
@PostMapping("/page-join-qb")
|
||||
public R<Page<WalletManageVo>> pageJoinQb(@ParameterObject Page page, @RequestBody WalletManageBalanceDto dto) {
|
||||
|
||||
+9
-1
@@ -17,6 +17,8 @@ import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeImportDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeSaveTopupDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.excel.WalletRechargeExcelDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyCompareAceVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeImportVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.excel.WalletRechargeByApplyExcelVo;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargeApplyService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargeApplyComposeService;
|
||||
@@ -61,10 +63,16 @@ public class WalletRechargeApplyController {
|
||||
|
||||
@GetMapping("/compare-page-join")
|
||||
@Operation(summary = "批量充值/扣款记录")
|
||||
public R comparePageJoin(@ParameterObject Page page, @ParameterObject WalletRechargeApplyDto dto) {
|
||||
public R<WalletRechargeApplyCompareAceVo> comparePageJoin(@ParameterObject Page page, @ParameterObject WalletRechargeApplyDto dto) {
|
||||
return R.ok(walletTransactionComposeService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
@GetMapping("/compare-invoice-page-join")
|
||||
@Operation(summary = "批量充值/扣款记录发票查询")
|
||||
public R<Page<WalletRechargeImportVo>> compareInvoicePageJoin(@ParameterObject Page page, @ParameterObject WalletRechargeApplyDto dto) {
|
||||
return R.ok(walletTransactionComposeService.compareInvoicePageJoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "提交申请", description = "提交申请")
|
||||
@SysLog("提交申请")
|
||||
@GetMapping("/apply")
|
||||
|
||||
+2
@@ -167,4 +167,6 @@ public interface WalletManageMapper extends PjcloudBaseMapper<WalletManageEntity
|
||||
Page<WalletManageVo> activeBalancePage(Page page, @Param("dto") WalletTopupActionDto dto, @Param("unactiveDayNumberStr") String unactiveDayNumberStr);
|
||||
|
||||
List<WalletManageVo> activeBalanceList(@Param("dto") WalletTopupActionDto dto, @Param("unactiveDayNumberStr") String unactiveDayNumberStr);
|
||||
|
||||
Long selectTotalBalance(@Param("dto") WalletManageBalanceDto dto);
|
||||
}
|
||||
+1
@@ -25,6 +25,7 @@ public interface WalletRechargeImportMapper extends PjcloudBaseMapper<WalletRech
|
||||
MPJLambdaWrapper<WalletRechargeImportEntity> wrapper = new MPJLambdaWrapper<WalletRechargeImportEntity>()
|
||||
.eqIfExists(WalletRechargeImportEntity::getId, dto.getId())
|
||||
.eqIfExists(WalletRechargeImportEntity::getApplyId, dto.getApplyId())
|
||||
.eqIfExists(WalletRechargeImportEntity::getInvoiceId, dto.getInvoiceId())
|
||||
.orderByDesc(WalletRechargeImportEntity::getCreateTime)
|
||||
.orderByDesc(WalletRechargeImportEntity::getUserId);
|
||||
return selectJoinPage(page, WalletRechargeImportVo.class, wrapper);
|
||||
|
||||
+3
@@ -9,6 +9,7 @@ import com.bsd.pjcloud.wallet.api.dto.WalletManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletTopupActionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletQbTotalVo;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
@@ -68,6 +69,8 @@ public interface WalletManageService extends IService<WalletManageEntity> {
|
||||
|
||||
Page<WalletManageVo> scopeQbPage(Page page, WalletManageBalanceDto dto, DataScope dataScope);
|
||||
|
||||
WalletQbTotalVo qbTotal(WalletManageBalanceDto dto, DataScope dataScope);
|
||||
|
||||
/**
|
||||
* 不活跃用户钱包
|
||||
*/
|
||||
|
||||
+6
@@ -4,8 +4,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeSaveTopupDto;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyCompareAceVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeImportVo;
|
||||
|
||||
public interface WalletRechargeApplyComposeService {
|
||||
|
||||
WalletRechargeApplyCompareAceVo pageJoin(Page page, WalletRechargeApplyDto dto);
|
||||
|
||||
/**
|
||||
* 批量充值/扣款记录发票查询
|
||||
*/
|
||||
Page<WalletRechargeImportVo> compareInvoicePageJoin(Page page, WalletRechargeApplyDto dto);
|
||||
}
|
||||
+27
-1
@@ -40,6 +40,7 @@ import com.bsd.pjcloud.wallet.api.utils.WalletDataUtil;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageBalanceVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletQbTotalVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletManageMapper;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletTransactionMapper;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletTypeMapper;
|
||||
@@ -51,7 +52,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -59,6 +59,8 @@ import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* 钱包管理
|
||||
@@ -306,6 +308,30 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
return walletPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WalletQbTotalVo qbTotal(WalletManageBalanceDto dto, DataScope dataScope) {
|
||||
WalletQbTotalVo result = new WalletQbTotalVo();
|
||||
// 查询钱包类表
|
||||
List<WalletTypeEntity> walletTypeList = walletTypeService.list();
|
||||
// 查询所有钱包类型的流水记录
|
||||
for (WalletTypeEntity i : walletTypeList) {
|
||||
WalletManageBalanceDto walletBalanceDto = BeanUtils.toBean(dto, WalletManageBalanceDto.class);
|
||||
walletBalanceDto.setWalletTypeId(i.getId());
|
||||
|
||||
Long total = baseMapper.selectTotalBalance(walletBalanceDto);
|
||||
if (ObjectUtil.isEmpty(total)) total = 0L;
|
||||
|
||||
if (ObjectUtil.equals(i.getUniqueCode(), WalletTypeEnum.EAT.getCode())) {
|
||||
result.setEatTotal(total);
|
||||
}
|
||||
if (ObjectUtil.equals(i.getUniqueCode(), WalletTypeEnum.PAY.getCode())) {
|
||||
result.setPayTotal(total);
|
||||
}
|
||||
}
|
||||
result.setTotal(result.getEatTotal() + result.getPayTotal());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 不活跃用户钱包
|
||||
*/
|
||||
|
||||
+32
@@ -3,6 +3,7 @@ package com.bsd.pjcloud.wallet.service.impl.recharge;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
@@ -164,6 +165,37 @@ public class WalletRechargeApplyComposeServiceImpl implements WalletRechargeAppl
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Page<WalletRechargeImportVo> compareInvoicePageJoin(Page page, WalletRechargeApplyDto dto) {
|
||||
WalletRechargeImportDto importDto = new WalletRechargeImportDto();
|
||||
WalletRechargeApplyEntity applyEntity = null;
|
||||
|
||||
if (ObjectUtil.isNotEmpty(dto.getInvoiceId())) {
|
||||
importDto.setInvoiceId(dto.getInvoiceId());
|
||||
} else if (ObjectUtil.isNotEmpty(dto.getId())) {
|
||||
importDto.setApplyId(dto.getId());
|
||||
applyEntity = rechargeApplyService.getById(dto.getId());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
Page<WalletRechargeImportVo> list = rechargeImportService.pageJoin(page, importDto);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
for (WalletRechargeImportVo v : list.getRecords()) {
|
||||
if (ObjectUtil.isNotEmpty(dto.getInvoiceId())) {
|
||||
v.setBizType(WalletBizRechargeEnum.ADD.getCode());
|
||||
} else if (ObjectUtil.isNotEmpty(dto.getId())) {
|
||||
if (ObjectUtil.isNotEmpty(applyEntity)) {
|
||||
v.setBizType(dto.getBizType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private void getItem(WalletRechargeImportVo user,
|
||||
List<WalletRechargeApplySelectCompareVo> monthList,
|
||||
List<WalletRechargeApplySelectCompareVo> prenMonthList,
|
||||
|
||||
-1
@@ -103,7 +103,6 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
|
||||
.set(WalletRechargeInvoiceEntity::getProcessStatus, null)
|
||||
.set(WalletRechargeInvoiceEntity::getProcessTime, null)
|
||||
.set(WalletRechargeInvoiceEntity::getStampPicUrl, null)
|
||||
.set(WalletRechargeInvoiceEntity::getStatus, WalletRechargeInvoiceStatusEnum.FINANCE_CANCELLATION.getCode())
|
||||
.eq(WalletRechargeInvoiceEntity::getId, id)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -192,4 +192,79 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTotalBalance" resultType="java.lang.Long">
|
||||
SELECT
|
||||
SUM(a.balance)
|
||||
FROM wallet_transaction a
|
||||
LEFT JOIN wallet_manage m on a.wallet_id = m.id
|
||||
<where>
|
||||
a.del_flag = 0
|
||||
<if test="dto.walletRecordMonth != null">
|
||||
AND a.create_time = (
|
||||
SELECT MAX(sub.create_time)
|
||||
FROM wallet_transaction sub
|
||||
LEFT JOIN wallet_manage wallet on wallet.id = sub.wallet_id
|
||||
WHERE sub.user_id = a.user_id
|
||||
AND DATE_FORMAT(sub.create_time, '%Y-%m') <= #{dto.walletRecordMonth}
|
||||
<if test="dto.userId != null">
|
||||
AND sub.user_id = #{dto.userId}
|
||||
</if>
|
||||
<if test="dto.userIds != null and dto.userIds.size() != 0">
|
||||
and sub.user_id in
|
||||
<foreach collection="dto.userIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dto.deptIds != null and dto.deptIds.size() != 0">
|
||||
<choose>
|
||||
<when test="dto.isInclude != null and dto.isInclude == true">
|
||||
and wallet.dept_id IN
|
||||
</when>
|
||||
<when test="dto.isInclude != null and dto.isInclude == false">
|
||||
and wallet.dept_id NOT IN
|
||||
</when>
|
||||
<otherwise>
|
||||
and wallet.dept_id IN
|
||||
</otherwise>
|
||||
</choose>
|
||||
<foreach collection="dto.deptIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dto.walletTypeId != null">
|
||||
AND wallet.wallet_type_id = #{dto.walletTypeId}
|
||||
</if>
|
||||
)
|
||||
</if>
|
||||
<if test="dto.userId != null">
|
||||
AND a.user_id = #{dto.userId}
|
||||
</if>
|
||||
<if test="dto.walletTypeId != null">
|
||||
AND m.wallet_type_id = #{dto.walletTypeId}
|
||||
</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.deptIds != null and dto.deptIds.size() != 0">
|
||||
<choose>
|
||||
<when test="dto.isInclude != null and dto.isInclude == true">
|
||||
and m.dept_id IN
|
||||
</when>
|
||||
<when test="dto.isInclude != null and dto.isInclude == false">
|
||||
and m.dept_id NOT IN
|
||||
</when>
|
||||
<otherwise>
|
||||
and m.dept_id IN
|
||||
</otherwise>
|
||||
</choose>
|
||||
<foreach collection="dto.deptIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user