From 177dbd9091cf79b1e0ef2296e9b6fec4b1eba3d4 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Fri, 4 Aug 2023 14:32:01 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=88=9B=E5=BB=BA=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E5=95=86=E6=96=B0=E5=A2=9E=E9=80=89=E6=8B=A9=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/pile/dto/CreateMerchantDTO.java | 10 +++ .../impl/PileMerchantInfoServiceImpl.java | 14 ++-- jsowell-ui/src/api/pile/merchant.js | 9 +++ jsowell-ui/src/views/pile/merchant/index.vue | 72 ++++++++++++------- 4 files changed, 75 insertions(+), 30 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/CreateMerchantDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/CreateMerchantDTO.java index a9548ca72..089f8e7e2 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/CreateMerchantDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/CreateMerchantDTO.java @@ -16,6 +16,16 @@ public class CreateMerchantDTO { */ private String merchantName; + /** + * 运营商等级 + */ + private String merchantLevel; + + /** + * 父级id + */ + private String parentId; + /** * 地址 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java index d92ac4477..a14f5e341 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java @@ -121,10 +121,16 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService { // dto.setId(deptId); dto.setDeptId(String.valueOf(deptId)); dto.setStatus(Constants.ONE); - // String appId = StringUtils.isBlank(dto.getAppId()) - // ? appid - // : dto.getAppId(); - dto.setAppId(dto.getAppId()); + + // 一级运营商取前端传来的appid,二级运营商取父级的appid + String appId; + if (StringUtils.equals(dto.getMerchantLevel(), Constants.TWO)) { + PileMerchantInfo firstLevelMerchant = selectPileMerchantInfoById(Long.parseLong(dto.getParentId())); + appId = firstLevelMerchant.getAppId(); + } else { + appId = dto.getAppId(); + } + dto.setAppId(appId); PileMerchantInfo pileMerchantInfo = new PileMerchantInfo(); BeanUtils.copyProperties(dto, pileMerchantInfo); diff --git a/jsowell-ui/src/api/pile/merchant.js b/jsowell-ui/src/api/pile/merchant.js index 37ef44884..00a21727c 100644 --- a/jsowell-ui/src/api/pile/merchant.js +++ b/jsowell-ui/src/api/pile/merchant.js @@ -9,6 +9,15 @@ export function listMerchant(query) { }) } +// 查询充电桩运营商信息列表 +export function queryFirstLevelMerchant(query) { + return request({ + url: '/pile/merchant/queryFirstLevelMerchant', + method: 'get', + params: query + }) +} + // 查询充电桩运营商信息详细 export function getMerchant(id) { return request({ diff --git a/jsowell-ui/src/views/pile/merchant/index.vue b/jsowell-ui/src/views/pile/merchant/index.vue index 4fef60e49..660cf3d71 100644 --- a/jsowell-ui/src/views/pile/merchant/index.vue +++ b/jsowell-ui/src/views/pile/merchant/index.vue @@ -193,6 +193,7 @@ @@ -205,24 +206,20 @@ - - - - @@ -234,27 +231,31 @@ - - - - - - - - - - + + + + + + + + + + + + + + + @@ -269,11 +270,11 @@ - + + + + + + + { + this.firstLevelMerchant = response.rows; + }); + }, // 取消按钮 cancel() { this.open = false;