mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 更新数据接口
This commit is contained in:
@@ -72,4 +72,12 @@ public class JumpController extends BaseController {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新接口
|
||||
*/
|
||||
public RestApiResponse<?> updateOrderDetail() {
|
||||
orderBasicInfoService.updateElecAmount();
|
||||
return new RestApiResponse<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -699,8 +699,10 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
public void updateElecAmount() {
|
||||
// 查询 elecAmount为空的订单数据
|
||||
int pageNum = 1;
|
||||
int pageSize = 10;
|
||||
int pageSize = 500;
|
||||
|
||||
int total = 0;
|
||||
int batch = 1;
|
||||
while (true) {
|
||||
// 分页处理
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
@@ -714,8 +716,12 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
List<OrderDetail> orderDetailList = calculateData(pageInfo.getList());
|
||||
|
||||
// 更新数据库
|
||||
orderBasicInfoMapper.batchUpdateOrderDetail(orderDetailList);
|
||||
int i = orderBasicInfoMapper.batchUpdateOrderDetail(orderDetailList);
|
||||
total += i;
|
||||
logger.info("updateElecAmount==第{}批次更新完成", batch);
|
||||
batch += 1;
|
||||
}
|
||||
logger.info("updateElecAmount==共更新{}条数据", total);
|
||||
}
|
||||
|
||||
// 计算数据
|
||||
|
||||
@@ -50,6 +50,7 @@ public class TransactionService {
|
||||
@Autowired
|
||||
private MemberWalletInfoMapper memberWalletInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
@@ -160,7 +161,11 @@ public class TransactionService {
|
||||
orderBasicInfoMapper.updateOrderDetail(dto.getOrderDetail());
|
||||
}
|
||||
// 清缓存
|
||||
orderBasicInfoService.cleanCacheByOrderCode(orderCode, transactionCode);
|
||||
try {
|
||||
orderBasicInfoService.cleanCacheByOrderCode(orderCode, transactionCode);
|
||||
} catch (Exception e) {
|
||||
log.error("清缓存异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user