update 修改站点计费模板状态并下发最新模板, 区分普通计费模板和会员计费模板

This commit is contained in:
Guoqs
2025-01-14 13:14:00 +08:00
parent 837758e431
commit 957f08aadc
5 changed files with 7 additions and 5 deletions

View File

@@ -171,7 +171,7 @@ public interface PileBillingTemplateMapper {
* @param status
* @param deviceType
*/
void updateStatusByStationId(@Param("stationId") String stationId, @Param("status") String status, @Param("deviceType")String deviceType);
void updateStatusByStationId(@Param("stationId") String stationId, @Param("status") String status, @Param("deviceType")String deviceType, @Param("memberFlag") String memberFlag);
void updateStatusByTemplateId(@Param("templateId") String templateId, @Param("status") String status);

View File

@@ -187,9 +187,10 @@ public interface PileBillingTemplateService {
* @param stationId 充电站id
* @param templateId 模板id
* @param deviceType 设备类型
* @param memberFlag 会员模板标识
* @return
*/
int changeStationTemplate(String stationId, String templateId, String deviceType);
int changeStationTemplate(String stationId, String templateId, String deviceType, String memberFlag);
/**
* 创建优惠计费模板

View File

@@ -305,7 +305,7 @@ public class PileRemoteService {
}
}
// 修改计费模板状态
pileBillingTemplateService.changeStationTemplate(dto.getStationId(), dto.getTemplateId(), billingTemplateVO.getDeviceType());
pileBillingTemplateService.changeStationTemplate(dto.getStationId(), dto.getTemplateId(), billingTemplateVO.getDeviceType(), billingTemplateVO.getMemberFlag());
return true;
}

View File

@@ -448,9 +448,9 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
*/
@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public int changeStationTemplate(String stationId, String templateId, String deviceType) {
public int changeStationTemplate(String stationId, String templateId, String deviceType, String memberFlag) {
// 根据stationId把站点下所有的计费模板设置为 未启用, 区分deviceType
pileBillingTemplateMapper.updateStatusByStationId(stationId, Constants.ZERO, deviceType);
pileBillingTemplateMapper.updateStatusByStationId(stationId, Constants.ZERO, deviceType, memberFlag);
// 根据templateId 修改状态为启用
pileBillingTemplateMapper.updateStatusByTemplateId(templateId, Constants.ONE);
// 清缓存

View File

@@ -609,6 +609,7 @@
update pile_billing_template
set status = #{status,jdbcType=VARCHAR}
where station_id = #{stationId,jdbcType=VARCHAR}
and member_flag = #{memberFlag,jdbcType=VARCHAR}
and type = #{deviceType,jdbcType=VARCHAR}
</update>