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 * @param dto
* @return * @return
*/ */
public boolean publishBillingTemplateOld(PublishBillingTemplateDTO dto) { // public boolean publishBillingTemplateOld(PublishBillingTemplateDTO dto) {
// 获取计费模板信息 // // 获取计费模板信息
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateByTemplateId(dto.getTemplateId()); // BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateByTemplateId(dto.getTemplateId());
if (billingTemplateVO == null) { // if (billingTemplateVO == null) {
log.warn("获取计费模板信息, 通过模板id:{}查询计费模板为null", dto.getTemplateId()); // log.warn("获取计费模板信息, 通过模板id:{}查询计费模板为null", dto.getTemplateId());
return false; // return false;
} // }
// 会员优惠计费模板不发布 // // 会员优惠计费模板不发布
if (Constants.ONE.equals(billingTemplateVO.getMemberFlag())) { // if (Constants.ONE.equals(billingTemplateVO.getMemberFlag())) {
return false; // return false;
} // }
// 电单车计费模板不发布 // // 电单车计费模板不发布
if (Constants.TWO.equals(billingTemplateVO.getDeviceType())) { // if (Constants.TWO.equals(billingTemplateVO.getDeviceType())) {
return false; // return false;
} // }
// 更新计费模板的发布时间 // // 更新计费模板的发布时间
PileBillingTemplate pileBillingTemplate = new PileBillingTemplate(); // PileBillingTemplate pileBillingTemplate = new PileBillingTemplate();
pileBillingTemplate.setId(Long.valueOf(billingTemplateVO.getTemplateId())); // pileBillingTemplate.setId(Long.valueOf(billingTemplateVO.getTemplateId()));
pileBillingTemplate.setPublishTime(new Date()); // pileBillingTemplate.setPublishTime(new Date());
pileBillingTemplateService.updatePileBillingTemplate(pileBillingTemplate); // pileBillingTemplateService.updatePileBillingTemplate(pileBillingTemplate);
// 获取到站点下所有的桩 // // 获取到站点下所有的桩
List<PileDetailVO> pileList = pileBasicInfoService.selectPileListByStationIds(Lists.newArrayList(Long.valueOf(dto.getStationId()))); // List<PileDetailVO> pileList = pileBasicInfoService.selectPileListByStationIds(Lists.newArrayList(Long.valueOf(dto.getStationId())));
if (CollectionUtils.isNotEmpty(pileList)) { // if (CollectionUtils.isNotEmpty(pileList)) {
// 删除缓存 // // 删除缓存
List<String> collect = pileList.parallelStream() // List<String> collect = pileList.parallelStream()
.map(vo -> CacheConstants.BILLING_TEMPLATE_BY_PILE_SN + vo.getPileSn()) // .map(vo -> CacheConstants.BILLING_TEMPLATE_BY_PILE_SN + vo.getPileSn())
.collect(Collectors.toList()); // .collect(Collectors.toList());
redisCache.deleteObject(collect); // redisCache.deleteObject(collect);
// 下发计费模板, 电单车不支持 // // 下发计费模板, 电单车不支持
if (StringUtils.equals(billingTemplateVO.getDeviceType(), Constants.ONE)) { // if (StringUtils.equals(billingTemplateVO.getDeviceType(), Constants.ONE)) {
// 下发指令 // // 下发指令
pileList.parallelStream().forEach(pileInfoVO -> publishPileBillingTemplate(pileInfoVO.getPileSn(), billingTemplateVO)); // pileList.parallelStream().forEach(pileInfoVO -> publishPileBillingTemplate(pileInfoVO.getPileSn(), billingTemplateVO));
} // }
} // }
// 修改计费模板状态 // // 修改计费模板状态
pileBillingTemplateService.changeStationTemplate(dto.getStationId(), dto.getTemplateId(), billingTemplateVO.getDeviceType(), billingTemplateVO.getMemberFlag()); // pileBillingTemplateService.changeStationTemplate(dto.getStationId(), dto.getTemplateId(), billingTemplateVO.getDeviceType(), billingTemplateVO.getMemberFlag());
return true; // return true;
} // }
/** /**
* 下发计费模板 * 下发计费模板

View File

@@ -427,6 +427,7 @@
t2.template_code AS templateCode, t2.template_code AS templateCode,
t2.`name` AS templateName, t2.`name` AS templateName,
t2.type as deviceType, t2.type as deviceType,
t2.member_flag as memberFlag,
t3.electricity_price AS sharpElectricityPrice, t3.electricity_price AS sharpElectricityPrice,
t3.service_price AS sharpServicePrice, t3.service_price AS sharpServicePrice,
t3.apply_time AS sharpApplyDate, t3.apply_time AS sharpApplyDate,