mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-28 06:55:09 +08:00
删除充电桩计费模板 缓存
This commit is contained in:
@@ -35,6 +35,7 @@ import java.net.UnknownHostException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class PileRemoteService {
|
||||
@@ -289,16 +290,20 @@ public class PileRemoteService {
|
||||
pileBillingTemplate.setId(Long.valueOf(billingTemplateVO.getTemplateId()));
|
||||
pileBillingTemplate.setPublishTime(new Date());
|
||||
pileBillingTemplateService.updatePileBillingTemplate(pileBillingTemplate);
|
||||
|
||||
// 获取到站点下所有的桩, 下发计费模板, 电单车不支持
|
||||
if (StringUtils.equals(billingTemplateVO.getDeviceType(), Constants.ONE)) {
|
||||
List<PileDetailVO> pileList = pileBasicInfoService.selectPileListByStationIds(Lists.newArrayList(Long.valueOf(dto.getStationId())));
|
||||
if (CollectionUtils.isNotEmpty(pileList)) {
|
||||
// 获取到站点下所有的桩
|
||||
List<PileDetailVO> pileList = pileBasicInfoService.selectPileListByStationIds(Lists.newArrayList(Long.valueOf(dto.getStationId())));
|
||||
if (CollectionUtils.isNotEmpty(pileList)) {
|
||||
// 删除缓存
|
||||
List<String> collect = pileList.parallelStream()
|
||||
.map(vo -> CacheConstants.BILLING_TEMPLATE_BY_PILE_SN + vo.getPileSn())
|
||||
.collect(Collectors.toList());
|
||||
redisCache.deleteObject(collect);
|
||||
// 下发计费模板, 电单车不支持
|
||||
if (StringUtils.equals(billingTemplateVO.getDeviceType(), Constants.ONE)) {
|
||||
// 下发指令
|
||||
pileList.parallelStream().forEach(pileInfoVO -> publishPileBillingTemplate(pileInfoVO.getPileSn(), billingTemplateVO));
|
||||
}
|
||||
}
|
||||
|
||||
// 修改计费模板状态
|
||||
pileBillingTemplateService.changeStationTemplate(dto.getStationId(), dto.getTemplateId(), billingTemplateVO.getDeviceType());
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user