update 后管向高德发送上线/下线消息接口

This commit is contained in:
Lemon
2024-07-02 13:31:24 +08:00
parent d2d7e495ab
commit 9ee5257450
5 changed files with 49 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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;
}
/**
* 删除充电站信息
*/

View File

@@ -11,6 +11,10 @@ import lombok.Data;
@Data
public class EditAmapFlagDTO {
private String stationId;
/**
* 是否对接高德地图0-否1-是)
*/
private String amapFlag;
}

View File

@@ -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) {

View File

@@ -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) {