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