Browse Source

#水电站bug解决

zhongwei
yang_shj 1 year ago
parent
commit
cc674a3522
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/ChargeVo.java
  2. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/ChargeVo.java

@ -27,4 +27,7 @@ public class ChargeVo {
@ApiModelProperty(value = "充电总度数") @ApiModelProperty(value = "充电总度数")
private String totalChargeDegrees; private String totalChargeDegrees;
@ApiModelProperty(value = "充电桩数量")
private Integer count;
} }

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java

@ -367,8 +367,14 @@ public class HomePageServiceImpl implements IHomePageService {
stationCountVo.setStationTypeName(DictCache.getValue("stationType", item)); stationCountVo.setStationTypeName(DictCache.getValue("stationType", item));
stationCountVo.setCount(0); stationCountVo.setCount(0);
if(HomePageConstant.CHARGE.equals(item) && HomePageConstant.HYDROPOWER_SERVETYPE.equals(serveType)){ if(HomePageConstant.CHARGE.equals(item) && HomePageConstant.HYDROPOWER_SERVETYPE.equals(serveType)){
String chargeCount = (String) redisTemplate.opsForValue().get(CHARGE_SUM); ChargeVo charge = (ChargeVo) redisTemplate.opsForValue().get(CHARGE_SUM);
stationCountVo.setCount(Integer.valueOf(chargeCount)); if(StringUtil.isEmpty(charge)){
ChargeVo chargeVo = new ChargeVo();
this.getCharge(chargeVo);
stationCountVo.setCount(chargeVo.getCount());
}else{
stationCountVo.setCount(charge.getCount());
}
list.add(stationCountVo); list.add(stationCountVo);
return; return;
} }
@ -1010,7 +1016,7 @@ public class HomePageServiceImpl implements IHomePageService {
chargeVo.setChargeDegrees(data.get("todayDegree").toString()); chargeVo.setChargeDegrees(data.get("todayDegree").toString());
chargeVo.setIncome(data.get("income").toString()); chargeVo.setIncome(data.get("income").toString());
chargeVo.setTotalChargeDegrees(data.get("kilowatt").toString()); chargeVo.setTotalChargeDegrees(data.get("kilowatt").toString());
redisTemplate.opsForValue().set(CHARGE_SUM,data.get("stationNum").toString()); redisTemplate.opsForValue().set(CHARGE_SUM,chargeVo);
} catch (Exception ex) { } catch (Exception ex) {
chargeVo.setOrder("0"); chargeVo.setOrder("0");
chargeVo.setChargeDegrees("0"); chargeVo.setChargeDegrees("0");

Loading…
Cancel
Save