diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileRemoteService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileRemoteService.java index ca775d478..9134bfe7d 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileRemoteService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileRemoteService.java @@ -278,44 +278,44 @@ public class PileRemoteService { * @param dto * @return */ - public boolean publishBillingTemplateOld(PublishBillingTemplateDTO dto) { - // 获取计费模板信息 - BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateByTemplateId(dto.getTemplateId()); - if (billingTemplateVO == null) { - log.warn("获取计费模板信息, 通过模板id:{}查询计费模板为null", dto.getTemplateId()); - return false; - } - // 会员优惠计费模板不发布 - if (Constants.ONE.equals(billingTemplateVO.getMemberFlag())) { - return false; - } - // 电单车计费模板不发布 - if (Constants.TWO.equals(billingTemplateVO.getDeviceType())) { - return false; - } - // 更新计费模板的发布时间 - PileBillingTemplate pileBillingTemplate = new PileBillingTemplate(); - pileBillingTemplate.setId(Long.valueOf(billingTemplateVO.getTemplateId())); - pileBillingTemplate.setPublishTime(new Date()); - pileBillingTemplateService.updatePileBillingTemplate(pileBillingTemplate); - // 获取到站点下所有的桩 - List pileList = pileBasicInfoService.selectPileListByStationIds(Lists.newArrayList(Long.valueOf(dto.getStationId()))); - if (CollectionUtils.isNotEmpty(pileList)) { - // 删除缓存 - List 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(), billingTemplateVO.getMemberFlag()); - return true; - } + // public boolean publishBillingTemplateOld(PublishBillingTemplateDTO dto) { + // // 获取计费模板信息 + // BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateByTemplateId(dto.getTemplateId()); + // if (billingTemplateVO == null) { + // log.warn("获取计费模板信息, 通过模板id:{}查询计费模板为null", dto.getTemplateId()); + // return false; + // } + // // 会员优惠计费模板不发布 + // if (Constants.ONE.equals(billingTemplateVO.getMemberFlag())) { + // return false; + // } + // // 电单车计费模板不发布 + // if (Constants.TWO.equals(billingTemplateVO.getDeviceType())) { + // return false; + // } + // // 更新计费模板的发布时间 + // PileBillingTemplate pileBillingTemplate = new PileBillingTemplate(); + // pileBillingTemplate.setId(Long.valueOf(billingTemplateVO.getTemplateId())); + // pileBillingTemplate.setPublishTime(new Date()); + // pileBillingTemplateService.updatePileBillingTemplate(pileBillingTemplate); + // // 获取到站点下所有的桩 + // List pileList = pileBasicInfoService.selectPileListByStationIds(Lists.newArrayList(Long.valueOf(dto.getStationId()))); + // if (CollectionUtils.isNotEmpty(pileList)) { + // // 删除缓存 + // List 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(), billingTemplateVO.getMemberFlag()); + // return true; + // } /** * 下发计费模板 diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml index 244a9807c..8a67fa5e8 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml @@ -427,6 +427,7 @@ t2.template_code AS templateCode, t2.`name` AS templateName, t2.type as deviceType, + t2.member_flag as memberFlag, t3.electricity_price AS sharpElectricityPrice, t3.service_price AS sharpServicePrice, t3.apply_time AS sharpApplyDate,