Commit b08b7e21 by 林永健

修复bug

1 parent 9ea9c216
...@@ -35,9 +35,7 @@ public class HeartBeatQueen { ...@@ -35,9 +35,7 @@ public class HeartBeatQueen {
throw new RuntimeException("data is empty or parse fail, raw data is: " + JSON.toJSONString(jsonDataStr)); throw new RuntimeException("data is empty or parse fail, raw data is: " + JSON.toJSONString(jsonDataStr));
} }
// Date receiveTime = message.getMessageProperties().getTimestamp();
gunService.handleHeartbeat(data); gunService.handleHeartbeat(data);
log.debug("接收到心跳包, message: {}", data); log.debug("接收到心跳包, message: {}", data);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -35,6 +35,7 @@ public class LoginQueen { ...@@ -35,6 +35,7 @@ public class LoginQueen {
throw new RuntimeException("data is empty or parse fail, raw data is: " + JSON.toJSONString(jsonDataStr)); throw new RuntimeException("data is empty or parse fail, raw data is: " + JSON.toJSONString(jsonDataStr));
} }
// Date receiveTime = message.getMessageProperties().getTimestamp(); // Date receiveTime = message.getMessageProperties().getTimestamp();
pileService.handleLogin(data); pileService.handleLogin(data);
log.debug("登录认证处理成功, message: {}", data); log.debug("登录认证处理成功, message: {}", data);
......
...@@ -9,6 +9,7 @@ import cn.com.glsx.evbusiness.modules.model.request.ChargingGunSearch; ...@@ -9,6 +9,7 @@ import cn.com.glsx.evbusiness.modules.model.request.ChargingGunSearch;
import cn.com.glsx.evbusiness.modules.model.response.ChargingGunResponse; import cn.com.glsx.evbusiness.modules.model.response.ChargingGunResponse;
import cn.com.glsx.evbusiness.modules.model.response.ChargingPileResponse; import cn.com.glsx.evbusiness.modules.model.response.ChargingPileResponse;
import cn.com.glsx.evbusiness.utils.CopyUtils; import cn.com.glsx.evbusiness.utils.CopyUtils;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -105,6 +106,9 @@ public class ChargingGunService { ...@@ -105,6 +106,9 @@ public class ChargingGunService {
} }
public void saveOrUpdate(ChargingGun entity) { public void saveOrUpdate(ChargingGun entity) {
if (!StringUtils.hasLength(entity.getGunNumber()) || !StringUtils.hasLength(entity.getPileId())){
throw new RuntimeException("参数异常, data: " + JSON.toJSONString(entity));
}
// 来自设备端同步的设备,并无业务属性name,需要构建 // 来自设备端同步的设备,并无业务属性name,需要构建
entity.setName(StringUtils.hasLength(entity.getName()) ? entity.getName() : entity.getPileId() + entity.getGunNumber()); entity.setName(StringUtils.hasLength(entity.getName()) ? entity.getName() : entity.getPileId() + entity.getGunNumber());
if (Objects.isNull(entity.getId())) { if (Objects.isNull(entity.getId())) {
......
...@@ -6,6 +6,7 @@ import cn.com.glsx.evbusiness.modules.mapper.ChargingPileMapper; ...@@ -6,6 +6,7 @@ import cn.com.glsx.evbusiness.modules.mapper.ChargingPileMapper;
import cn.com.glsx.evbusiness.modules.model.ocpp16.LoginUploadData; import cn.com.glsx.evbusiness.modules.model.ocpp16.LoginUploadData;
import cn.com.glsx.evbusiness.modules.model.response.ChargingPileResponse; import cn.com.glsx.evbusiness.modules.model.response.ChargingPileResponse;
import cn.com.glsx.evbusiness.utils.CopyUtils; import cn.com.glsx.evbusiness.utils.CopyUtils;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -45,6 +46,9 @@ public class ChargingPileService { ...@@ -45,6 +46,9 @@ public class ChargingPileService {
} }
public void saveOrUpdate(ChargingPile entity) { public void saveOrUpdate(ChargingPile entity) {
if (!StringUtils.hasLength(entity.getPileId())){
throw new RuntimeException("参数异常, data: " + JSON.toJSONString(entity));
}
// 来自设备端同步的设备,并无业务属性name,需要构建 // 来自设备端同步的设备,并无业务属性name,需要构建
entity.setName(StringUtils.hasLength(entity.getName()) ? entity.getName() : entity.getPileId()); entity.setName(StringUtils.hasLength(entity.getName()) ? entity.getName() : entity.getPileId());
if (Objects.isNull(entity.getId())) { if (Objects.isNull(entity.getId())) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!