mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 后管向高德发送上线/下线消息接口
This commit is contained in:
@@ -83,9 +83,10 @@ public class AMapController extends BaseController {
|
||||
return result;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
logger.error("高德拉取商家静态详细信息 error", e);
|
||||
result = result.failedResponse();
|
||||
}
|
||||
return null;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.web.controller.pile;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.annotation.Log;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.core.domain.AjaxResult;
|
||||
@@ -28,6 +29,7 @@ import com.jsowell.pile.service.ThirdPartyStationRelationService;
|
||||
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
|
||||
import com.jsowell.pile.vo.web.PileStationVO;
|
||||
import com.jsowell.service.PileService;
|
||||
import com.jsowell.thirdparty.amap.service.AMapService;
|
||||
import com.jsowell.thirdparty.common.CommonService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -58,7 +60,8 @@ public class PileStationInfoController extends BaseController {
|
||||
@Autowired
|
||||
private CommonService commonService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private AMapService aMapService;
|
||||
|
||||
@Autowired
|
||||
private ThirdPartyStationRelationService thirdPartyStationRelationService;
|
||||
@@ -184,6 +187,27 @@ public class PileStationInfoController extends BaseController {
|
||||
return toAjax(pileStationInfoService.updateAmapFlag(dto.getStationId(), dto.getAmapFlag()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 高德地图商家推送静态信息状态
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:station:edit')")
|
||||
@PostMapping("/pushAMapStationStatus")
|
||||
public RestApiResponse<?> pushAMapStationStatus(EditAmapFlagDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
String result = aMapService.pushStationInfo(Lists.newArrayList(dto.getStationId()), dto.getAmapFlag());
|
||||
response = new RestApiResponse<>(result);
|
||||
} catch (Exception e) {
|
||||
logger.error("高德地图商家推送静态信息状态 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("高德地图商家推送静态信息状态 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除充电站信息
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,10 @@ import lombok.Data;
|
||||
@Data
|
||||
public class EditAmapFlagDTO {
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 是否对接高德地图(0-否;1-是)
|
||||
*/
|
||||
private String amapFlag;
|
||||
|
||||
}
|
||||
|
||||
@@ -73,6 +73,15 @@ export function updateAmapFlag(data) {
|
||||
});
|
||||
}
|
||||
|
||||
// 高德地图商家推送静态信息状态
|
||||
export function pushAMapStationStatus(data) {
|
||||
return request({
|
||||
url: "/pile/station/pushAMapStationStatus",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 删除充电站信息
|
||||
export function delStation(id) {
|
||||
|
||||
@@ -293,7 +293,7 @@ import {
|
||||
delStation,
|
||||
addStation,
|
||||
updateStation,
|
||||
fastCreateStation, updateAmapFlag,
|
||||
fastCreateStation, updateAmapFlag, pushAMapStationStatus,
|
||||
} from "@/api/pile/station";
|
||||
import {getMerchantList} from "@/api/pile/merchant";
|
||||
import {regionData, CodeToText} from "element-china-area-data";
|
||||
@@ -434,12 +434,19 @@ export default {
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
// 修改数据库标识
|
||||
updateAmapFlag(params).then((response) => {
|
||||
console.log("response", response)
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
|
||||
// 向高德发送上线/下线消息
|
||||
pushAMapStationStatus(params).then((response) => {
|
||||
console.log("response", response)
|
||||
});
|
||||
|
||||
},
|
||||
getCodeToText(codeStr, codeArray) {
|
||||
if (null === codeStr && null === codeArray) {
|
||||
|
||||
Reference in New Issue
Block a user