mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
add 推送联联平台相关方法
This commit is contained in:
@@ -9,7 +9,10 @@ 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.ThirdPartySettingInfo;
|
||||
import com.jsowell.pile.service.IOrderBasicInfoService;
|
||||
import com.jsowell.pile.service.IThirdPartySettingInfoService;
|
||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -33,6 +36,12 @@ public class ChargeEndHandler extends AbstractHandler{
|
||||
@Autowired
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
private IThirdPartySettingInfoService thirdPartySettingInfoService;
|
||||
|
||||
@Autowired
|
||||
private LianLianService lianLianService;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
YKCOperateFactory.register(type, this);
|
||||
@@ -115,6 +124,18 @@ public class ChargeEndHandler extends AbstractHandler{
|
||||
orderInfo.setChargeEndTime(new Date()); // 结束充电时间
|
||||
}
|
||||
orderBasicInfoService.updateOrderBasicInfo(orderInfo);
|
||||
|
||||
try {
|
||||
// 查询该站点是否已对接互联互通平台,如果对接则发送充电结束
|
||||
ThirdPartySettingInfo info = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId()));
|
||||
if (Objects.nonNull(info)) {
|
||||
// 推送停止充电结果
|
||||
lianLianService.pushStopChargeResult(orderInfo.getOrderCode());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("联联平台推送停止充电结果异常", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user