修改场站、桩、终端费率模型id

This commit is contained in:
yuyang 2021-09-29 18:34:51 +08:00
parent 976ffc7f1f
commit 791326a721
4 changed files with 32 additions and 14 deletions

View File

@ -234,4 +234,16 @@ public interface XhpcChargingStationMapper {
*/
List<Map<String, Object>> getXhpcRateTimeNumber(@Param("chargingStationId") Long chargingStationId);
/**
* 修改桩的计费模型id
* @param chargingStationId
*/
void updateXhpcChargingPile(@Param("chargingStationId") Long chargingStationId,@Param("rateModelId") Long rateModelId);
/**
* 修改终端的计费模型id
* @param chargingStationId
*/
void updateXhpcTerminal(@Param("chargingStationId") Long chargingStationId,@Param("rateModelId") Long rateModelId);
}

View File

@ -482,8 +482,9 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
cacheRateModel.setTfPricesSeq(tfPricesSeq);
R r = powerPileService.setStationRateModel(chargingStationId, rateModelId, cacheRateModel);
System.out.println(r.getCode());
System.out.println(r.getMsg());
//修改桩和终端的模板id
xhpcChargingStationMapper.updateXhpcChargingPile(chargingStationId,rateModelId);
xhpcChargingStationMapper.updateXhpcTerminal(chargingStationId,rateModelId);
return AjaxResult.success();
}
@ -901,9 +902,9 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
}
cacheRateModel.setTfPricesSeq(tfPricesSeq);
R r = powerPileService.setStationRateModel(chargingStationId, rateModelId, cacheRateModel);
System.out.println(r.getCode());
System.out.println(r.getMsg());
//修改桩和终端的模板id
xhpcChargingStationMapper.updateXhpcChargingPile(chargingStationId,rateModelId);
xhpcChargingStationMapper.updateXhpcTerminal(chargingStationId,rateModelId);
return AjaxResult.success();
}

View File

@ -852,4 +852,12 @@
where charging_station_id = #{chargingStationId}
order by sort
</select>
<update id="updateXhpcChargingPile">
update xhpc_charging_pile set rate_model_id=#{rateModelId} WHERE charging_station_id=#{chargingStationId}
</update>
<update id="updateXhpcTerminal">
update xhpc_terminal set rate_model_id=#{rateModelId} WHERE charging_station_id=#{chargingStationId}
</update>
</mapper>

View File

@ -116,16 +116,13 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
if (StringUtils.isEmpty(phone)) {
return R.fail(HttpStatus.NOT_NULL, "请重新获取手机号");
}
if("2".equals(type)){
if (StringUtils.isEmpty(code)) {
return R.fail(HttpStatus.NOT_NULL, "验证码不能为空");
}
String captcha = redisService.getCacheObject("pvToken:" + phone);
if (!code.equalsIgnoreCase(captcha)) {
R.fail(HttpStatus.ERROR_STATUS, "验证码错误");
}
if (StringUtils.isEmpty(code)) {
return R.fail(HttpStatus.NOT_NULL, "验证码不能为空");
}
String captcha = redisService.getCacheObject("pvToken:" + phone);
if (!code.equalsIgnoreCase(captcha)) {
R.fail(HttpStatus.ERROR_STATUS, "验证码错误");
}
XhpcAppUser info = xhpcAppUserMapper.getAppUserByPhone(phone);
if (StringUtils.isNotNull(info)) {
return R.fail(HttpStatus.ALREADY_EXISTING, "账号已存在");