计费模板保存并发布

This commit is contained in:
Guoqs
2024-11-04 15:13:40 +08:00
parent ecb62f73e5
commit 7cd98ba314
6 changed files with 33 additions and 17 deletions

View File

@@ -264,7 +264,7 @@ public class PileRemoteService {
* 下发充电桩计费模型
*/
public void publishPileBillingTemplate(String pileSn, BillingTemplateVO billingTemplateVO) {
log.info("下发充电桩计费模型, pileSn:{}, threadName:{}", pileSn, Thread.currentThread().getName());
PublishPileBillingTemplateCommand command = PublishPileBillingTemplateCommand.builder()
.billingTemplateVO(billingTemplateVO)
.pileSn(pileSn)
@@ -294,10 +294,11 @@ public class PileRemoteService {
if (StringUtils.equals(billingTemplateVO.getDeviceType(), Constants.ONE)) {
List<PileDetailVO> pileList = pileBasicInfoService.selectPileListByStationIds(Lists.newArrayList(Long.valueOf(dto.getStationId())));
if (CollectionUtils.isNotEmpty(pileList)) {
for (PileDetailVO pileInfoVO : pileList) {
// 下发计费模板
publishPileBillingTemplate(pileInfoVO.getPileSn(), billingTemplateVO);
}
// for (PileDetailVO pileInfoVO : pileList) {
// // 下发计费模板
// publishPileBillingTemplate(pileInfoVO.getPileSn(), billingTemplateVO);
// }
pileList.parallelStream().forEach(pileInfoVO -> publishPileBillingTemplate(pileInfoVO.getPileSn(), billingTemplateVO));
}
}