This commit is contained in:
Lemon
2023-06-06 11:24:08 +08:00
parent 71094cd0f0
commit 5dba9bce64
3 changed files with 35 additions and 16 deletions

View File

@@ -9,9 +9,12 @@ import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.YKCUtils; import com.jsowell.common.util.YKCUtils;
import com.jsowell.netty.factory.YKCOperateFactory; import com.jsowell.netty.factory.YKCOperateFactory;
import com.jsowell.pile.domain.OrderBasicInfo; import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.domain.StationSettingRelation;
import com.jsowell.pile.domain.ThirdPartySettingInfo; import com.jsowell.pile.domain.ThirdPartySettingInfo;
import com.jsowell.pile.service.IOrderBasicInfoService; import com.jsowell.pile.service.IOrderBasicInfoService;
import com.jsowell.pile.service.IStationSettingRelationService;
import com.jsowell.pile.service.IThirdPartySettingInfoService; import com.jsowell.pile.service.IThirdPartySettingInfoService;
import com.jsowell.pile.vo.base.StationSettingRelationVO;
import com.jsowell.thirdparty.lianlian.service.LianLianService; import com.jsowell.thirdparty.lianlian.service.LianLianService;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -42,6 +45,9 @@ public class ChargeEndHandler extends AbstractHandler{
@Autowired @Autowired
private LianLianService lianLianService; private LianLianService lianLianService;
@Autowired
private IStationSettingRelationService stationSettingRelationService;
@Override @Override
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
YKCOperateFactory.register(type, this); YKCOperateFactory.register(type, this);
@@ -127,8 +133,12 @@ public class ChargeEndHandler extends AbstractHandler{
try { try {
// 查询该站点是否已对接互联互通平台,如果对接则发送充电结束 // 查询该站点是否已对接互联互通平台,如果对接则发送充电结束
ThirdPartySettingInfo info = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId())); // 通过站点id查询相关配置信息
if (Objects.nonNull(info)) { StationSettingRelation relation = new StationSettingRelation();
relation.setStationId(Long.parseLong(orderInfo.getStationId()));
StationSettingRelationVO relationInfo = stationSettingRelationService.selectRelationInfo(relation);
// ThirdPartySettingInfo info = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId()));
if (Objects.nonNull(relationInfo)) {
// 推送停止充电结果 // 推送停止充电结果
lianLianService.pushStopChargeResult(orderInfo.getOrderCode()); lianLianService.pushStopChargeResult(orderInfo.getOrderCode());
} }

View File

@@ -19,11 +19,10 @@ import com.jsowell.common.util.id.IdUtils;
import com.jsowell.netty.factory.YKCOperateFactory; import com.jsowell.netty.factory.YKCOperateFactory;
import com.jsowell.pile.domain.OrderBasicInfo; import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.domain.PileAuthCard; import com.jsowell.pile.domain.PileAuthCard;
import com.jsowell.pile.domain.StationSettingRelation;
import com.jsowell.pile.domain.ThirdPartySettingInfo; import com.jsowell.pile.domain.ThirdPartySettingInfo;
import com.jsowell.pile.service.IOrderBasicInfoService; import com.jsowell.pile.service.*;
import com.jsowell.pile.service.IPileAuthCardService; import com.jsowell.pile.vo.base.StationSettingRelationVO;
import com.jsowell.pile.service.IPileMsgRecordService;
import com.jsowell.pile.service.IThirdPartySettingInfoService;
import com.jsowell.thirdparty.lianlian.service.LianLianService; import com.jsowell.thirdparty.lianlian.service.LianLianService;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -72,6 +71,9 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
@Autowired @Autowired
private LianLianService lianLianService; private LianLianService lianLianService;
@Autowired
private IStationSettingRelationService stationSettingRelationService;
public static void main(String[] args) { public static void main(String[] args) {
// 获取消息体 // 获取消息体
String msg = "000000000000000000000000000000008823000000030601a08c2e0d0404170000380d0404170000000000000000000000000000000000000000000000000000000000000000400d0300ee250000ee250000c84b000000000000000000000000000000000000e0bb040000cee1040000ee250000ee250000c84b00000000000000000000000000000000000000010000380d04041745a511101970000000"; String msg = "000000000000000000000000000000008823000000030601a08c2e0d0404170000380d0404170000000000000000000000000000000000000000000000000000000000000000400d0300ee250000ee250000c84b000000000000000000000000000000000000e0bb040000cee1040000ee250000ee250000c84b00000000000000000000000000000000000000010000380d04041745a511101970000000";
@@ -620,9 +622,11 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
try { try {
// 联联平台 推送订单信息 notification_orderInfo // 联联平台 推送订单信息 notification_orderInfo
// 查询该站点是否推送联联平台 // 查询该站点是否推送联联平台
String stationId = orderBasicInfo.getStationId(); StationSettingRelation relation = new StationSettingRelation();
ThirdPartySettingInfo infoByStationId = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(stationId)); relation.setStationId(Long.parseLong(orderBasicInfo.getStationId()));
if (Objects.nonNull(infoByStationId)) { StationSettingRelationVO relationInfo = stationSettingRelationService.selectRelationInfo(relation);
// ThirdPartySettingInfo infoByStationId = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(stationId));
if (Objects.nonNull(relationInfo)) {
// 推送订单信息 // 推送订单信息
lianLianService.pushOrderInfo(orderBasicInfo.getOrderCode()); lianLianService.pushOrderInfo(orderBasicInfo.getOrderCode());
// 推送充电订单信息 // 推送充电订单信息

View File

@@ -13,11 +13,10 @@ import com.jsowell.common.util.YKCUtils;
import com.jsowell.netty.factory.YKCOperateFactory; import com.jsowell.netty.factory.YKCOperateFactory;
import com.jsowell.pile.domain.OrderBasicInfo; import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.domain.PileBasicInfo;
import com.jsowell.pile.domain.StationSettingRelation;
import com.jsowell.pile.domain.ThirdPartySettingInfo; import com.jsowell.pile.domain.ThirdPartySettingInfo;
import com.jsowell.pile.service.IOrderBasicInfoService; import com.jsowell.pile.service.*;
import com.jsowell.pile.service.IPileBasicInfoService; import com.jsowell.pile.vo.base.StationSettingRelationVO;
import com.jsowell.pile.service.IPileConnectorInfoService;
import com.jsowell.pile.service.IThirdPartySettingInfoService;
import com.jsowell.thirdparty.lianlian.service.LianLianService; import com.jsowell.thirdparty.lianlian.service.LianLianService;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -61,6 +60,9 @@ public class UploadRealTimeMonitorHandler extends AbstractHandler {
@Autowired @Autowired
private LianLianService lianLianService; private LianLianService lianLianService;
@Autowired
private IStationSettingRelationService stationSettingRelationService;
@Override @Override
public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, Channel channel) { public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, Channel channel) {
log.info("[===获取桩上传的实时监测数据===] param:{}, channel:{}", JSONObject.toJSONString(ykcDataProtocol), channel.toString()); log.info("[===获取桩上传的实时监测数据===] param:{}, channel:{}", JSONObject.toJSONString(ykcDataProtocol), channel.toString());
@@ -288,9 +290,12 @@ public class UploadRealTimeMonitorHandler extends AbstractHandler {
return null; return null;
} }
// 状态不一样,传给联联 // 状态不一样,传给联联
PileBasicInfo pileBasicInfo = pileBasicInfoService.selectPileBasicInfoBySN(pileSn); // 查询该站点是否推送联联平台
ThirdPartySettingInfo thirdPartySettingInfo = thirdPartySettingInfoService.getInfoByStationId(pileBasicInfo.getStationId()); StationSettingRelation relation = new StationSettingRelation();
if (Objects.nonNull(thirdPartySettingInfo)) { relation.setStationId(Long.parseLong(orderInfo.getStationId()));
StationSettingRelationVO relationInfo = stationSettingRelationService.selectRelationInfo(relation);
// ThirdPartySettingInfo thirdPartySettingInfo = thirdPartySettingInfoService.getInfoByStationId(pileBasicInfo.getStationId());
if (Objects.nonNull(relationInfo)) {
String pileConnectorCode = pileSn + connectorCode; String pileConnectorCode = pileSn + connectorCode;
// 设备状态变化推送 notification_stationStatus // 设备状态变化推送 notification_stationStatus
lianLianService.pushConnectorStatus(pileConnectorCode, connectorStatus); lianLianService.pushConnectorStatus(pileConnectorCode, connectorStatus);