mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-13 14:30:08 +08:00
update 更新数据接口
This commit is contained in:
@@ -72,4 +72,12 @@ public class JumpController extends BaseController {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新接口
|
||||||
|
*/
|
||||||
|
public RestApiResponse<?> updateOrderDetail() {
|
||||||
|
orderBasicInfoService.updateElecAmount();
|
||||||
|
return new RestApiResponse<>();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -699,8 +699,10 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
public void updateElecAmount() {
|
public void updateElecAmount() {
|
||||||
// 查询 elecAmount为空的订单数据
|
// 查询 elecAmount为空的订单数据
|
||||||
int pageNum = 1;
|
int pageNum = 1;
|
||||||
int pageSize = 10;
|
int pageSize = 500;
|
||||||
|
|
||||||
|
int total = 0;
|
||||||
|
int batch = 1;
|
||||||
while (true) {
|
while (true) {
|
||||||
// 分页处理
|
// 分页处理
|
||||||
PageHelper.startPage(pageNum, pageSize);
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
@@ -714,8 +716,12 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
List<OrderDetail> orderDetailList = calculateData(pageInfo.getList());
|
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
|
@Autowired
|
||||||
private MemberWalletInfoMapper memberWalletInfoMapper;
|
private MemberWalletInfoMapper memberWalletInfoMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
private IOrderBasicInfoService orderBasicInfoService;
|
private IOrderBasicInfoService orderBasicInfoService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -160,7 +161,11 @@ public class TransactionService {
|
|||||||
orderBasicInfoMapper.updateOrderDetail(dto.getOrderDetail());
|
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