修正并充订单数据工具

This commit is contained in:
Guoqs
2024-11-15 10:59:42 +08:00
parent a345976137
commit 9533c234e6
2 changed files with 8 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
package com.jsowell.api.uniapp.customer;
import com.alibaba.fastjson2.JSON;
import com.google.common.collect.ImmutableMap;
import com.jsowell.adapay.dto.BalancePaymentRequestDTO;
import com.jsowell.adapay.service.AdapayService;
import com.jsowell.common.annotation.Anonymous;
@@ -628,8 +629,8 @@ public class TempController extends BaseController {
public RestApiResponse<?> correctCombinedChargingOrder(@RequestBody QueryOrderDTO dto) {
RestApiResponse<?> response;
try {
tempService.correctCombinedChargingOrder(dto);
response = new RestApiResponse<>();
List<String> list = tempService.correctCombinedChargingOrder(dto);
response = new RestApiResponse<>(ImmutableMap.of("correctOrderCodeList", list));
} catch (Exception e) {
logger.error("校验订单是否为并充订单error", e);
response = new RestApiResponse<>();

View File

@@ -629,7 +629,7 @@ public class TempService {
* @param dto
*/
@Transactional(rollbackFor = Exception.class)
public void correctCombinedChargingOrder(QueryOrderDTO dto) {
public List<String> correctCombinedChargingOrder(QueryOrderDTO dto) {
List<String> orderCodeList = dto.getOrderCodeList();
logger.info("修正并充订单数据工具,订单号:{}", JSON.toJSONString(orderCodeList));
// 查询临时表,不要重复修正
@@ -643,7 +643,7 @@ public class TempService {
}
if (CollectionUtils.isEmpty(orderCodeList)) {
logger.info("修正并充订单数据工具, 无需要修正的订单");
return;
return Lists.newArrayList();
}
BigDecimal multiple = new BigDecimal("2");
@@ -651,6 +651,7 @@ public class TempService {
List<OrderBasicInfo> orderBasicInfos = orderBasicInfoService.queryOrderList(orderCodeList);
for (OrderBasicInfo orderBasicInfo : orderBasicInfos) {
orderBasicInfo.setOrderAmount(orderBasicInfo.getOrderAmount().multiply(multiple));
orderBasicInfo.setVirtualAmount(orderBasicInfo.getVirtualAmount().multiply(multiple));
}
// 查询订单详情数据
List<OrderDetail> orderDetailList = orderBasicInfoService.getOrderDetailList(orderCodeList);
@@ -691,6 +692,8 @@ public class TempService {
Map<String, List<String>> redisMap = Maps.newHashMap();
redisMap.put(redisKey, orderCodeList);
redisCache.batchSetCacheList(redisMap, 300, TimeUnit.DAYS);
return orderCodeList;
}
}