| | |
| | | import com.lunhan.water.repository.po.*; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | private UserCapitalChangeMapperImpl capitalChangeDao; |
| | | @Autowired |
| | | private TradeRecordMapperImpl tradeRecordDao; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ExecutedResult<Map<String, Object>> weiXinPay(LoginUserDTO loginUser, ReqCreatePay request) { |
| | | //判断token是否存在,如果不存在,说明重复提交订单 |
| | | String redisToken = redisTemplate.opsForValue().get(request.getPayToken()).toString(); |
| | | if (StringUtil.isNullOrEmpty(redisToken)) { |
| | | throw new RuntimeException("请勿重复提交充值订单!"); |
| | | } |
| | | //删除token |
| | | redisTemplate.delete(request.getPayToken()); |
| | | |
| | | EBusinessType type = EBusinessType.getByValue(request.getBusinessType()); |
| | | if (Objects.isNull(type)) { |
| | | return ExecutedResult.failed("业务不支持." + request.getBusinessType()); |