新增 中电联推送站点信息数据接口

This commit is contained in:
Lemon
2023-09-14 10:13:50 +08:00
parent 11246b0496
commit 9dd3835ad5
10 changed files with 125 additions and 21 deletions

View File

@@ -47,7 +47,7 @@ public class LianLianController extends BaseController {
* @return
*/
@PostMapping("/pushStationInfo")
public RestApiResponse<?> pushStationInfo(@RequestBody LianLianPushStationInfoDTO dto) {
public RestApiResponse<?> pushStationInfo(@RequestBody PushStationInfoDTO dto) {
logger.info("推送联联平台充电站信息 params:{}", JSONObject.toJSONString(dto));
RestApiResponse<?> response = null;
try {

View File

@@ -18,7 +18,7 @@ import com.jsowell.pile.domain.ThirdPartyStationRelation;
import com.jsowell.pile.domain.ThirdPartySettingInfo;
import com.jsowell.pile.domain.ThirdpartyParkingConfig;
import com.jsowell.pile.dto.FastCreateStationDTO;
import com.jsowell.pile.dto.LianLianPushStationInfoDTO;
import com.jsowell.pile.dto.PushStationInfoDTO;
import com.jsowell.pile.dto.QueryStationDTO;
import com.jsowell.pile.dto.amap.EditAmapFlagDTO;
import com.jsowell.pile.dto.lutongyunting.BindParkingPlatformDTO;
@@ -29,6 +29,7 @@ import com.jsowell.pile.service.IThirdPartySettingInfoService;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.service.PileService;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -57,6 +58,9 @@ public class PileStationInfoController extends BaseController {
@Autowired
private LianLianService lianLianService;
@Autowired
private ZDLService zdlService;
@Autowired
private IThirdPartyStationRelationService thirdPartyStationRelationService;
@@ -258,24 +262,27 @@ public class PileStationInfoController extends BaseController {
* @return
*/
@PostMapping("/pushStationInfo")
public RestApiResponse<?> pushStationInfo(@RequestBody LianLianPushStationInfoDTO dto) {
logger.info("推送联联平台充电站信息 params:{}", JSONObject.toJSONString(dto));
public RestApiResponse<?> pushStationInfo(@RequestBody PushStationInfoDTO dto) {
logger.info("推送第三方平台充电站信息 params:{}", JSONObject.toJSONString(dto));
RestApiResponse<?> response = null;
try {
if (StringUtils.isBlank(String.valueOf(dto.getStationId()))) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
String result = "";
// 推送联联
if (StringUtils.equals("1", dto.getThirdPartyType())) {
String result = lianLianService.pushStationInfo(dto);
response = new RestApiResponse<>(result);
result = lianLianService.pushStationInfo(dto);
} else if (StringUtils.equals("2", dto.getThirdPartyType())) {
// 中电联
result = zdlService.pushStationInfo(dto);
}
response = new RestApiResponse<>(result);
}catch (BusinessException e) {
logger.error("推送联联平台充电站信息 error",e);
logger.error("推送第三方平台充电站信息 error",e);
response = new RestApiResponse<>(e.getCode(), e.getMessage());
}catch (Exception e) {
logger.error("推送联联平台充电站信息 error", e);
logger.error("推送第三方平台充电站信息 error", e);
response = new RestApiResponse<>("推送失败,请联系管理员");
// 删除对应配置信息
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
@@ -283,7 +290,7 @@ public class PileStationInfoController extends BaseController {
relation.setDelFlag(DelFlagEnum.DELETE.getValue());
thirdPartyStationRelationService.updateThirdPartyStationRelation(relation);
}
logger.info("推送联联平台充电站信息 result:{}", response);
logger.info("推送第三方平台充电站信息 result:{}", response);
return response;
}