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;