update 查询memberFlag字段

This commit is contained in:
Guoqs
2025-06-25 16:44:11 +08:00
parent fd527e0467
commit c0240fdf23
2 changed files with 39 additions and 38 deletions

View File

@@ -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<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(), 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<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(), billingTemplateVO.getMemberFlag());
// return true;
// }
/**
* 下发计费模板