diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java index 8bc8a3794..5d002d27f 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java @@ -18,6 +18,7 @@ import com.jsowell.pile.domain.ThirdPartySettingInfo; import com.jsowell.pile.dto.FastCreateStationDTO; import com.jsowell.pile.dto.LianLianPushStationInfoDTO; import com.jsowell.pile.dto.QueryStationDTO; +import com.jsowell.pile.dto.amap.EditAmapFlagDTO; import com.jsowell.pile.service.IPileStationInfoService; import com.jsowell.pile.service.IThirdPartyStationRelationService; import com.jsowell.pile.service.IThirdPartySettingInfoService; @@ -150,6 +151,17 @@ public class PileStationInfoController extends BaseController { return toAjax(pileStationInfoService.updatePileStationInfo(pileStationInfo)); } + /** + * 修改对接高德标识 + */ + @PreAuthorize("@ss.hasPermi('pile:station:edit')") + @Log(title = "修改对接高德标识", businessType = BusinessType.UPDATE) + @PostMapping("/editAmapFlag") + public AjaxResult editAmapFlag(@RequestBody EditAmapFlagDTO dto) { + logger.info("修改对接高德标识 param:{}", JSONObject.toJSONString(dto)); + return toAjax(pileStationInfoService.updateAmapFlag(dto.getStationId(), dto.getAmapFlag())); + } + /** * 删除充电站信息 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/amap/EditAmapFlagDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/amap/EditAmapFlagDTO.java new file mode 100644 index 000000000..6670a5f97 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/amap/EditAmapFlagDTO.java @@ -0,0 +1,16 @@ +package com.jsowell.pile.dto.amap; + +import lombok.Data; + +/** + * 修改高德标识DTO + * + * @author Lemon + * @Date 2023/8/3 19:20 + */ +@Data +public class EditAmapFlagDTO { + private String stationId; + private String amapFlag; + +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileStationInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileStationInfoMapper.java index 6f96be587..130eb7158 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileStationInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileStationInfoMapper.java @@ -79,4 +79,6 @@ public interface PileStationInfoMapper { List getStationInfoForLianLian(); List queryByStationDeptIds(@Param("stationDeptIds") List stationDeptIds); + + int updateAmapFlag(@Param("stationId") String stationId, @Param("amapFlag") String amapFlag); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileStationInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileStationInfoService.java index 77e3e7ab2..e712f2acb 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileStationInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileStationInfoService.java @@ -96,4 +96,6 @@ public interface IPileStationInfoService { List queryByStationDeptIds(List stationIds); String selectAdapayMemberId(String stationId); + + int updateAmapFlag(String stationId, String amapFlag); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java index 03770e7f0..8004e83eb 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java @@ -258,31 +258,34 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService { PileStationInfo queryStationInfo = selectPileStationInfoById(pileStationInfo.getId()); String oldMerchantId = String.valueOf(queryStationInfo.getMerchantId()); String newMerchantId = String.valueOf(pileStationInfo.getMerchantId()); + if (!StringUtils.equals("null", newMerchantId)) { - // 对比一下运营商有没有变化 - if (!StringUtils.equals(oldMerchantId, newMerchantId)) { - // 新旧运营商不一致,执行站点更换运营商逻辑 - stationUpdateMerchant(pileStationInfo, newMerchantId); - } else { - // 查询部门 - SysDept sysDept = sysDeptService.selectDeptById(Long.parseLong(pileStationInfo.getDeptId())); - // 同步组织中的名称,联系人,电话 - if (sysDept != null) { - sysDept.setDeptName(pileStationInfo.getStationName()); - sysDept.setLeader(pileStationInfo.getStationAdminName()); - sysDept.setPhone(pileStationInfo.getStationTel()); - sysDept.setUpdateTime(DateUtils.getNowDate()); - sysDeptService.updateDept(sysDept); + // 对比一下运营商有没有变化 + if (!StringUtils.equals(oldMerchantId, newMerchantId)) { + // 新旧运营商不一致,执行站点更换运营商逻辑 + stationUpdateMerchant(pileStationInfo, newMerchantId); + } else { + // 查询部门 + SysDept sysDept = sysDeptService.selectDeptById(Long.parseLong(pileStationInfo.getDeptId())); + // 同步组织中的名称,联系人,电话 + if (sysDept != null) { + sysDept.setDeptName(pileStationInfo.getStationName()); + sysDept.setLeader(pileStationInfo.getStationAdminName()); + sysDept.setPhone(pileStationInfo.getStationTel()); + sysDept.setUpdateTime(DateUtils.getNowDate()); + sysDeptService.updateDept(sysDept); + } } + + pileStationInfo.setUpdateBy(SecurityUtils.getUsername()); + pileStationInfo.setUpdateTime(DateUtils.getNowDate()); + int i = pileStationInfoMapper.updatePileStationInfo(pileStationInfo); + + // 再次清缓存 + redisCache.deleteObject(redisKey); + return i; } - - pileStationInfo.setUpdateBy(SecurityUtils.getUsername()); - pileStationInfo.setUpdateTime(DateUtils.getNowDate()); - int i = pileStationInfoMapper.updatePileStationInfo(pileStationInfo); - - // 再次清缓存 - redisCache.deleteObject(redisKey); - return i; + return 0; } /** @@ -461,5 +464,10 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService { return null; } + @Override + public int updateAmapFlag(String stationId, String amapFlag) { + return pileStationInfoMapper.updateAmapFlag(stationId, amapFlag); + } + } diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileStationInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileStationInfoMapper.xml index 005c63c2d..9b859cdf8 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileStationInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileStationInfoMapper.xml @@ -398,4 +398,13 @@ #{item,jdbcType=VARCHAR} + + + update + pile_station_info + set + amap_flag = #{amapFlag,jdbcType=VARCHAR} + where + id = #{stationId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/jsowell-ui/src/api/pile/station.js b/jsowell-ui/src/api/pile/station.js index 11fddf89e..0ff9151c2 100644 --- a/jsowell-ui/src/api/pile/station.js +++ b/jsowell-ui/src/api/pile/station.js @@ -56,6 +56,16 @@ export function updateStation(data) { }); } +// 修改对接高德标识 +export function updateAmapFlag(data) { + return request({ + url: "/pile/station/editAmapFlag", + method: "post", + data: data, + }); +} + + // 删除充电站信息 export function delStation(id) { return request({ @@ -127,3 +137,4 @@ export function pushStationInfo(data) { data: data, }) } + diff --git a/jsowell-ui/src/views/pile/station/index.vue b/jsowell-ui/src/views/pile/station/index.vue index 7307e3650..f18d87287 100644 --- a/jsowell-ui/src/views/pile/station/index.vue +++ b/jsowell-ui/src/views/pile/station/index.vue @@ -263,7 +263,7 @@ import { delStation, addStation, updateStation, - fastCreateStation, + fastCreateStation, updateAmapFlag, } from "@/api/pile/station"; import {getMerchantList} from "@/api/pile/merchant"; import {regionData, CodeToText} from "element-china-area-data"; @@ -374,8 +374,20 @@ export default { }); }, changeFlag(info) { + console.log("info", info) + const params = { + stationId: info.id, + amapFlag: info.amapFlag + } // console.log(info); - updateStation(info).then((response) => { + // updateStation(info).then((response) => { + // console.log("response", response) + // this.$modal.msgSuccess("修改成功"); + // this.open = false; + // this.getList(); + // }); + updateAmapFlag(params).then((response) => { + console.log("response", response) this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); @@ -566,7 +578,7 @@ export default { { ...this.queryParams, }, - `station_${new Date().getTime()}.xlsx` + `station_${new Date().getTime()}.xlsx` ); }, },