|
|
@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.io.Console; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
@ -95,6 +96,7 @@ public class RefundServiceImpl implements RefundService { |
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
public Result add(RefundUser refundUser) { |
|
|
|
System.out.println("11111111111111111111"); |
|
|
|
if (refundUser.getTaskGold() == null || refundUser.getFreeGold() == null || refundUser.getPermanentGold() == null) { |
|
|
|
return Result.error("金币不能为空"); |
|
|
|
} |
|
|
@ -150,6 +152,14 @@ public class RefundServiceImpl implements RefundService { |
|
|
|
List<ConsumeUser> list = consumeMapper.selectOrderCodeByJwcode(userGoldRecord.getJwcode().toString(), orderCode); |
|
|
|
if (list == null || list.isEmpty()) { |
|
|
|
return Result.error("该用户没有该订单号"); |
|
|
|
}else if(list.size()==1){ |
|
|
|
ConsumeUser consumeUser = list.getFirst(); |
|
|
|
if(consumeUser.getIsRefund().equals(1)) |
|
|
|
{ |
|
|
|
return Result.error("该订单已被退款"); |
|
|
|
} |
|
|
|
}else { |
|
|
|
return Result.error("消费订单重复"); |
|
|
|
} |
|
|
|
refundMapper.add(userGoldRecord); |
|
|
|
consumeMapper.updateIsRefund(orderCode); |
|
|
|