|
@ -3,15 +3,13 @@ package com.example.demo.serviceImpl; |
|
|
import com.example.demo.domain.entity.Audit; |
|
|
import com.example.demo.domain.entity.Audit; |
|
|
import com.example.demo.domain.entity.Detail; |
|
|
import com.example.demo.domain.entity.Detail; |
|
|
import com.example.demo.domain.entity.Recharge; |
|
|
import com.example.demo.domain.entity.Recharge; |
|
|
import com.example.demo.domain.entity.User; |
|
|
|
|
|
import com.example.demo.domain.vo.RechargeA; |
|
|
import com.example.demo.domain.vo.RechargeA; |
|
|
import com.example.demo.domain.vo.RechargeVo; |
|
|
import com.example.demo.domain.vo.RechargeVo; |
|
|
import com.example.demo.domain.vo.RefundA; |
|
|
|
|
|
import com.example.demo.domain.vo.Result; |
|
|
import com.example.demo.domain.vo.Result; |
|
|
import com.example.demo.mapper.AuditMapper; |
|
|
|
|
|
import com.example.demo.mapper.DetailMapper; |
|
|
|
|
|
import com.example.demo.mapper.RechargeMapper; |
|
|
|
|
|
import com.example.demo.mapper.UserMapper; |
|
|
|
|
|
|
|
|
import com.example.demo.mapper.db1.AuditMapper; |
|
|
|
|
|
import com.example.demo.mapper.db1.DetailMapper; |
|
|
|
|
|
import com.example.demo.mapper.db1.RechargeMapper; |
|
|
|
|
|
import com.example.demo.mapper.db1.UserMapper; |
|
|
import com.example.demo.sevice.RechargeService; |
|
|
import com.example.demo.sevice.RechargeService; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.github.pagehelper.PageInfo; |
|
@ -19,18 +17,14 @@ import lombok.RequiredArgsConstructor; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.cache.annotation.CacheConfig; |
|
|
import org.springframework.cache.annotation.CacheConfig; |
|
|
import org.springframework.cache.annotation.CacheEvict; |
|
|
import org.springframework.cache.annotation.CacheEvict; |
|
|
import org.springframework.cache.annotation.CachePut; |
|
|
|
|
|
import org.springframework.cache.annotation.Cacheable; |
|
|
import org.springframework.cache.annotation.Cacheable; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.time.LocalDate; |
|
|
|
|
|
import java.time.Month; |
|
|
|
|
|
import java.util.Arrays; |
|
|
import java.util.Arrays; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.UUID; |
|
|
import java.util.UUID; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
@Transactional |
|
|
@Service |
|
|
@Service |
|
@ -185,14 +179,14 @@ public class RechargeServiceImpl implements RechargeService { |
|
|
List<String> fullStatuses = Arrays.asList("待审核", "已通过", "已驳回"); |
|
|
List<String> fullStatuses = Arrays.asList("待审核", "已通过", "已驳回"); |
|
|
|
|
|
|
|
|
// 遍历分类列表,检查哪些分类在查询结果中缺失,并为其补充默认值 |
|
|
// 遍历分类列表,检查哪些分类在查询结果中缺失,并为其补充默认值 |
|
|
for (String flag : fullStatuses) { |
|
|
|
|
|
|
|
|
for (String auditStatus : fullStatuses) { |
|
|
boolean categoryExists = result.stream() |
|
|
boolean categoryExists = result.stream() |
|
|
.anyMatch(recharge -> flag.equals(recharge.getFlag())); |
|
|
|
|
|
|
|
|
.anyMatch(recharge -> auditStatus.equals(recharge.getAuditStatus())); |
|
|
|
|
|
|
|
|
if (!categoryExists) { |
|
|
if (!categoryExists) { |
|
|
// 如果分类缺失,补充默认值 |
|
|
// 如果分类缺失,补充默认值 |
|
|
RechargeA defaultRecharge = new RechargeA(); |
|
|
RechargeA defaultRecharge = new RechargeA(); |
|
|
defaultRecharge.setFlag(flag); |
|
|
|
|
|
|
|
|
defaultRecharge.setAuditStatus(auditStatus); |
|
|
// defaultRecharge.setAmount(BigDecimal.ZERO); // 默认值为 0 |
|
|
// defaultRecharge.setAmount(BigDecimal.ZERO); // 默认值为 0 |
|
|
result.add(defaultRecharge); |
|
|
result.add(defaultRecharge); |
|
|
} |
|
|
} |
|
|