|
|
@ -2,18 +2,22 @@ package com.example.demo.serviceImpl; |
|
|
|
|
|
|
|
|
|
|
|
import com.example.demo.domain.entity.Detail; |
|
|
|
import com.example.demo.domain.entity.User; |
|
|
|
import com.example.demo.domain.vo.RefundA; |
|
|
|
import com.example.demo.mapper.RefundMapper; |
|
|
|
import com.example.demo.mapper.UserMapper; |
|
|
|
import com.example.demo.sevice.RefundService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.cache.annotation.CacheConfig; |
|
|
|
import org.springframework.cache.annotation.CacheEvict; |
|
|
|
import org.springframework.cache.annotation.Cacheable; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.Arrays; |
|
|
@ -27,10 +31,16 @@ import java.util.UUID; |
|
|
|
@CacheConfig(cacheNames = "refund") |
|
|
|
public class RefundServiceImpl implements RefundService { |
|
|
|
private final RefundMapper refundMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserMapper userMapper; |
|
|
|
@CacheEvict(value = {"refund", "audit"}, allEntries = true) |
|
|
|
@Override |
|
|
|
public int add(Detail detail) { |
|
|
|
public int add(Detail detail) throws Exception { |
|
|
|
|
|
|
|
User sUser = userMapper.select(detail.getJwcode()); |
|
|
|
if(ObjectUtils.isEmpty(sUser)){ |
|
|
|
throw new Exception("无此精网号"); |
|
|
|
} |
|
|
|
// 生成UUID作为订单编号 |
|
|
|
String uuid = UUID.randomUUID().toString().replaceAll("-", ""); // 去掉UUID中的'-' |
|
|
|
detail.setOrderCode(uuid); |
|
|
|