update 新电途推送站点信息接口

This commit is contained in:
Lemon
2024-01-17 17:13:55 +08:00
parent c203650a3c
commit 8e4c7bd5c7
2 changed files with 22 additions and 3 deletions

View File

@@ -3,9 +3,12 @@ package com.jsowell.thirdparty.xindiantu.service.impl;
import com.jsowell.common.enums.thirdparty.ThirdPartyOperatorIdEnum;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.PileStationInfo;
import com.jsowell.pile.domain.ThirdPartyStationRelation;
import com.jsowell.pile.dto.*;
import com.jsowell.pile.service.PileStationInfoService;
import com.jsowell.pile.service.ThirdPartyStationRelationService;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
import com.jsowell.thirdparty.xindiantu.service.XDTService;
import com.jsowell.thirdparty.zhongdianlian.dto.ZDLGetTokenDTO;
@@ -33,6 +36,12 @@ public class XDTServiceImpl implements XDTService {
@Autowired
private ThirdPartyStationRelationService relationService;
@Autowired
private PileStationInfoService pileStationInfoService;
@Autowired
private ThirdPartyStationRelationService thirdPartyStationRelationService;
/**
* 获取令牌
* @param dto
@@ -191,6 +200,17 @@ public class XDTServiceImpl implements XDTService {
@Override
public String pushStationInfo(PushStationInfoDTO dto) {
return zdlService.pushStationInfo(dto);
// 通过站点id查询相关配置信息
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
relation.setStationId(dto.getStationId());
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
if (relationInfo == null) {
// 新增
relation.setThirdPartyType(dto.getThirdPartyType());
thirdPartyStationRelationService.insertThirdPartyStationRelation(relation);
return "OK";
}
return "Error";
}
}