Commit b08b7e21 by 林永健

修复bug

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