From 99427337ce8a4d7ed286d7a4cb263730b89b0779 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Thu, 15 Jul 2021 14:16:54 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=93=E9=A2=98=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E5=87=BA=E7=A4=BA=E6=8F=90=E4=BA=A4=EF=BC=8Csql=E8=84=9A?=
=?UTF-8?q?=E6=9C=AC=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/dto/SpecialSubjectDTO.java | 105 ++++++++++++++++++
.../controller/SpecialSubjectController.java | 39 +++++++
.../java/com/epmet/dao/SpecialSubjectDao.java | 33 ++++++
.../epmet/entity/SpecialSubjectEntity.java | 75 +++++++++++++
.../epmet/service/SpecialSubjectService.java | 95 ++++++++++++++++
.../impl/SpecialSubjectServiceImpl.java | 99 +++++++++++++++++
.../V0.0.4__create_specialsubject.sql | 16 +++
.../resources/mapper/SpecialSubjectDao.xml | 8 ++
8 files changed, 470 insertions(+)
create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/SpecialSubjectDTO.java
create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java
create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/SpecialSubjectDao.java
create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/SpecialSubjectEntity.java
create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/SpecialSubjectService.java
create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java
create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.4__create_specialsubject.sql
create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/SpecialSubjectDao.xml
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/SpecialSubjectDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/SpecialSubjectDTO.java
new file mode 100644
index 0000000000..a20c1d77ff
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/SpecialSubjectDTO.java
@@ -0,0 +1,105 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 专题表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-07-15
+ */
+@Data
+public class SpecialSubjectDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键(专题id)
+ */
+ private String id;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 标签id
+ */
+ private String tagId;
+
+ /**
+ * 新增此专题的用户id
+ */
+ private String addUserId;
+
+ /**
+ * 新增此专题时用户所在的组织id或者网格id
+ */
+ private String addOrgId;
+
+ /**
+ * 网格:grid;社区级:community,
+乡(镇、街道)级:street,
+区县级: district,
+市级: city
+省级:province
+ */
+ private String orgLevel;
+
+ /**
+ * 新增此专题用户所属的组织id
+ */
+ private String addUserAgencyId;
+
+ /**
+ * 删除标识 0未删除;1已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java
new file mode 100644
index 0000000000..37d780ce55
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java
@@ -0,0 +1,39 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.controller;
+
+import com.epmet.service.SpecialSubjectService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 专题表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-07-15
+ */
+@RestController
+@RequestMapping("specialsubject")
+public class SpecialSubjectController {
+
+ @Autowired
+ private SpecialSubjectService specialSubjectService;
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/SpecialSubjectDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/SpecialSubjectDao.java
new file mode 100644
index 0000000000..a4737a5ffc
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/SpecialSubjectDao.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.SpecialSubjectEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 专题表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-07-15
+ */
+@Mapper
+public interface SpecialSubjectDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/SpecialSubjectEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/SpecialSubjectEntity.java
new file mode 100644
index 0000000000..fd35ce2950
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/SpecialSubjectEntity.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 专题表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-07-15
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("special_subject")
+public class SpecialSubjectEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 标签id
+ */
+ private String tagId;
+
+ /**
+ * 新增此专题的用户id
+ */
+ private String addUserId;
+
+ /**
+ * 新增此专题时用户所在的组织id或者网格id
+ */
+ private String addOrgId;
+
+ /**
+ * 网格:grid;社区级:community,
+乡(镇、街道)级:street,
+区县级: district,
+市级: city
+省级:province
+ */
+ private String orgLevel;
+
+ /**
+ * 新增此专题用户所属的组织id
+ */
+ private String addUserAgencyId;
+
+}
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/SpecialSubjectService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/SpecialSubjectService.java
new file mode 100644
index 0000000000..451910e743
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/SpecialSubjectService.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.SpecialSubjectDTO;
+import com.epmet.entity.SpecialSubjectEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 专题表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-07-15
+ */
+public interface SpecialSubjectService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2021-07-15
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2021-07-15
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return SpecialSubjectDTO
+ * @author generator
+ * @date 2021-07-15
+ */
+ SpecialSubjectDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2021-07-15
+ */
+ void save(SpecialSubjectDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2021-07-15
+ */
+ void update(SpecialSubjectDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2021-07-15
+ */
+ void delete(String[] ids);
+}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java
new file mode 100644
index 0000000000..9bc8edba52
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java
@@ -0,0 +1,99 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.dao.SpecialSubjectDao;
+import com.epmet.dto.SpecialSubjectDTO;
+import com.epmet.entity.SpecialSubjectEntity;
+import com.epmet.service.SpecialSubjectService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 专题表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-07-15
+ */
+@Service
+public class SpecialSubjectServiceImpl extends BaseServiceImpl implements SpecialSubjectService {
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, SpecialSubjectDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, SpecialSubjectDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public SpecialSubjectDTO get(String id) {
+ SpecialSubjectEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, SpecialSubjectDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(SpecialSubjectDTO dto) {
+ SpecialSubjectEntity entity = ConvertUtils.sourceToTarget(dto, SpecialSubjectEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(SpecialSubjectDTO dto) {
+ SpecialSubjectEntity entity = ConvertUtils.sourceToTarget(dto, SpecialSubjectEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.4__create_specialsubject.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.4__create_specialsubject.sql
new file mode 100644
index 0000000000..388674a0dc
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.4__create_specialsubject.sql
@@ -0,0 +1,16 @@
+CREATE TABLE `special_subject` (
+ `ID` varchar(64) NOT NULL COMMENT '主键(专题id)',
+ `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
+ `TAG_ID` varchar(64) NOT NULL COMMENT '标签id',
+ `ADD_USER_ID` varchar(64) NOT NULL COMMENT '新增此专题的用户id',
+ `ADD_ORG_ID` varchar(64) NOT NULL COMMENT '新增此专题时用户所在的组织id或者网格id',
+ `ORG_LEVEL` varchar(10) NOT NULL COMMENT '网格:grid;社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province',
+ `ADD_USER_AGENCY_ID` varchar(64) NOT NULL COMMENT '新增此专题用户所属的组织id',
+ `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
+ `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
+ `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
+ `CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
+ `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
+ `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
+ PRIMARY KEY (`ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='专题表';
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/SpecialSubjectDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/SpecialSubjectDao.xml
new file mode 100644
index 0000000000..d671b8b4eb
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/SpecialSubjectDao.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
From 157007fa5c98929ae1b7c83b6987a96defbdcc0d Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Fri, 16 Jul 2021 09:05:37 +0800
Subject: [PATCH 2/3] commit
---
.../tools/exception/EpmetErrorCode.java | 4 +-
.../java/com/epmet/dto/SpecialSubjectDTO.java | 5 +-
.../dto/form/AddSpecialSubjectFormDTO.java | 54 +++++++++
.../dto/form/DelSpecialSubjectFormDTO.java | 39 ++++++
.../dto/form/QuerySpecialSubFormDTO.java | 32 +++++
.../result/AddSpecialSubjectResultDTO.java | 23 ++++
.../result/WorkSpecialSubjectResultDTO.java | 35 ++++++
.../controller/SpecialSubjectController.java | 57 ++++++++-
.../java/com/epmet/dao/SpecialSubjectDao.java | 11 +-
.../epmet/service/SpecialSubjectService.java | 35 ++++++
.../impl/SpecialSubjectServiceImpl.java | 114 ++++++++++++++++++
.../resources/mapper/SpecialSubjectDao.xml | 34 +++++-
12 files changed, 438 insertions(+), 5 deletions(-)
create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddSpecialSubjectFormDTO.java
create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DelSpecialSubjectFormDTO.java
create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/QuerySpecialSubFormDTO.java
create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/AddSpecialSubjectResultDTO.java
create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/WorkSpecialSubjectResultDTO.java
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
index 43c5468cc3..3a213b5191 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
@@ -138,7 +138,9 @@ public enum EpmetErrorCode {
REPEATED_SUBMIT_ERROR(8804, "请勿重复提交"),
CUSTOMER_VALIDATE_ERROR(8805, "内部数据校验异常"),
CATEGORY_IS_NULL(8806, "请设置分类"),
-
+ EXISTED_SPECIAL_PROJECT(8807, "已经添加过此专题"),
+ CAN_NOT_DEL_SPECIAL_PROJECT(8808, "您没有权限删除此专题"),
+ TAG_NOT_EXIST(8809,"标签不存在"),
//公众号 865..开头的码
PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"),
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/SpecialSubjectDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/SpecialSubjectDTO.java
index a20c1d77ff..96cb4a1bdf 100644
--- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/SpecialSubjectDTO.java
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/SpecialSubjectDTO.java
@@ -17,9 +17,10 @@
package com.epmet.dto;
+import lombok.Data;
+
import java.io.Serializable;
import java.util.Date;
-import lombok.Data;
/**
@@ -102,4 +103,6 @@ public class SpecialSubjectDTO implements Serializable {
*/
private Date updatedTime;
+ // 扩展属性
+ private String tagName;
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddSpecialSubjectFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddSpecialSubjectFormDTO.java
new file mode 100644
index 0000000000..ba663245db
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddSpecialSubjectFormDTO.java
@@ -0,0 +1,54 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * 【专题管理】添加专题
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2021/7/15 14:24
+ */
+@Data
+public class AddSpecialSubjectFormDTO implements Serializable {
+ private static final long serialVersionUID = -4469613386814496224L;
+
+ public interface AddUserInternalGroup {
+ }
+
+ /**
+ * 当前所在网格或者组织id
+ */
+ @NotBlank(message = "orgId不能为空", groups = AddUserInternalGroup.class)
+ private String orgId;
+
+ /**
+ * 网格:grid;社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province
+ */
+ @NotBlank(message = "orgLevel不能为空", groups = AddUserInternalGroup.class)
+ private String orgLevel;
+
+ /**
+ * 所选的标签id
+ */
+ @NotBlank(message = "tagId不能为空", groups = AddUserInternalGroup.class)
+ private String tagId;
+
+ // 以下属性从token中获取
+ /**
+ * 从TokenDto中获取当前用户id
+ */
+ @NotBlank(message = "从token中获取userId为空", groups = AddUserInternalGroup.class)
+ private String addUserId;
+
+ /**
+ * 从TokenDto中获取当前用户所属的agencyId
+ */
+ @NotBlank(message = "从token中获取用户所属组织id为空", groups = AddUserInternalGroup.class)
+ private String addUserAgencyId;
+
+ @NotBlank(message = "从token中获取客户id为空", groups = AddUserInternalGroup.class)
+ private String customerId;
+}
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DelSpecialSubjectFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DelSpecialSubjectFormDTO.java
new file mode 100644
index 0000000000..4c3d964bc0
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DelSpecialSubjectFormDTO.java
@@ -0,0 +1,39 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * 【专题管理】删除专题
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2021/7/15 20:50
+ */
+@Data
+public class DelSpecialSubjectFormDTO implements Serializable {
+ private static final long serialVersionUID = -2305529822756834522L;
+
+ public interface AddUserInternalGroup {
+ }
+
+ /**
+ * 专题id
+ */
+ @NotBlank(message = "specialSubjectId不能为空", groups = AddUserInternalGroup.class)
+ private String specialSubjectId;
+
+ /**
+ * 当前所在网格或者组织id
+ */
+ @NotBlank(message = "orgId不能为空", groups = AddUserInternalGroup.class)
+ private String orgId;
+
+
+ /**
+ * 从TokenDto中获取当前用户id
+ */
+ @NotBlank(message = "从token中获取userId为空", groups = AddSpecialSubjectFormDTO.AddUserInternalGroup.class)
+ private String userId;
+}
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/QuerySpecialSubFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/QuerySpecialSubFormDTO.java
new file mode 100644
index 0000000000..02ec4d2e6f
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/QuerySpecialSubFormDTO.java
@@ -0,0 +1,32 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * 【专题管理】已有专题列表
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2021/7/15 21:09
+ */
+@Data
+public class QuerySpecialSubFormDTO implements Serializable {
+ private static final long serialVersionUID = -436139256753489157L;
+
+ public interface AddUserInternalGroup {
+ }
+
+ /**
+ * 当前所在网格或者组织id
+ */
+ @NotBlank(message = "orgId不能为空", groups = AddUserInternalGroup.class)
+ private String orgId;
+
+ /**
+ * orgId的所有上级id
+ */
+ @NotBlank(message = "pids不能为空", groups = AddUserInternalGroup.class)
+ private String pids;
+}
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/AddSpecialSubjectResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/AddSpecialSubjectResultDTO.java
new file mode 100644
index 0000000000..6e31d7fa46
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/AddSpecialSubjectResultDTO.java
@@ -0,0 +1,23 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 【专题管理】添加专题
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2021/7/15 17:46
+ */
+@Data
+public class AddSpecialSubjectResultDTO implements Serializable {
+ /**
+ * 刚添加成功的专题id
+ * */
+ private String specialSubjectId;
+
+ public AddSpecialSubjectResultDTO(String id) {
+ this.specialSubjectId=id;
+ }
+}
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/WorkSpecialSubjectResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/WorkSpecialSubjectResultDTO.java
new file mode 100644
index 0000000000..451a44c296
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/WorkSpecialSubjectResultDTO.java
@@ -0,0 +1,35 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 【专题管理】已有专题列表
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2021/7/15 21:14
+ */
+@Data
+public class WorkSpecialSubjectResultDTO implements Serializable {
+ private static final long serialVersionUID = 8147664815754574860L;
+ /**
+ * 标签id
+ */
+ private String tagId;
+
+ /**
+ * 标签名称
+ */
+ private String tagName;
+
+ /**
+ * true代表可以删除。false不可删除,隐藏减号
+ */
+ private Boolean canDel;
+
+ /**
+ * 专题id
+ */
+ private String specialSubjectId;
+}
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java
index 37d780ce55..018c88bc33 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java
@@ -17,11 +17,24 @@
package com.epmet.controller;
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.security.dto.GovTokenDto;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.dto.form.AddSpecialSubjectFormDTO;
+import com.epmet.dto.form.DelSpecialSubjectFormDTO;
+import com.epmet.dto.form.QuerySpecialSubFormDTO;
+import com.epmet.dto.result.AddSpecialSubjectResultDTO;
+import com.epmet.dto.result.WorkSpecialSubjectResultDTO;
import com.epmet.service.SpecialSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import java.util.List;
+
/**
* 专题表
@@ -32,8 +45,50 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("specialsubject")
public class SpecialSubjectController {
-
+
@Autowired
private SpecialSubjectService specialSubjectService;
+ /**
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author yinzuomei
+ * @description 添加专题
+ * @Date 2021/7/15 15:31
+ **/
+ @PostMapping("add")
+ public Result addSpecialSubject(@LoginUser GovTokenDto tokenDto, @RequestBody AddSpecialSubjectFormDTO formDTO) {
+ formDTO.setAddUserId(tokenDto.getUserId());
+ formDTO.setAddUserAgencyId(tokenDto.getAgencyId());
+ ValidatorUtils.validateEntity(formDTO, AddSpecialSubjectFormDTO.AddUserInternalGroup.class);
+ return new Result().ok(specialSubjectService.addSpecialSubject(formDTO));
+ }
+
+ /**
+ * @return com.epmet.commons.tools.utils.Result
+ * @param
+ * @author yinzuomei
+ * @description 【专题管理】删除专题
+ * @Date 2021/7/15 20:49
+ **/
+ @PostMapping("del")
+ public Result delSpecialSubject(@RequestBody DelSpecialSubjectFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO);
+ specialSubjectService.delSpecialSubject(formDTO);
+ return new Result();
+ }
+
+
+ /**
+ * @return com.epmet.commons.tools.utils.Result>
+ * @param formDTO
+ * @author yinzuomei
+ * @description 【专题管理】已有专题列表
+ * @Date 2021/7/15 21:17
+ **/
+ @PostMapping("existedlist")
+ public Result> queryExistedList(@RequestBody QuerySpecialSubFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, QuerySpecialSubFormDTO.AddUserInternalGroup.class);
+ return new Result>().ok(specialSubjectService.queryExistedList(formDTO));
+ }
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/SpecialSubjectDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/SpecialSubjectDao.java
index a4737a5ffc..a759dd78fd 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/SpecialSubjectDao.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/SpecialSubjectDao.java
@@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.SpecialSubjectDTO;
import com.epmet.entity.SpecialSubjectEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
/**
* 专题表
@@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface SpecialSubjectDao extends BaseDao {
-
+
+ SpecialSubjectEntity selectByOrgIdAndTagId(@Param("orgId") String orgId, @Param("tagId") String tagId);
+
+ int delSpecialSubject(@Param("id") String id, @Param("userId") String userId);
+
+ List queryExistedList(@Param("orgId") String orgId,@Param("notList")List notList);
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/SpecialSubjectService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/SpecialSubjectService.java
index 451910e743..3d64580035 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/SpecialSubjectService.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/SpecialSubjectService.java
@@ -20,6 +20,11 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.SpecialSubjectDTO;
+import com.epmet.dto.form.AddSpecialSubjectFormDTO;
+import com.epmet.dto.form.DelSpecialSubjectFormDTO;
+import com.epmet.dto.form.QuerySpecialSubFormDTO;
+import com.epmet.dto.result.AddSpecialSubjectResultDTO;
+import com.epmet.dto.result.WorkSpecialSubjectResultDTO;
import com.epmet.entity.SpecialSubjectEntity;
import java.util.List;
@@ -92,4 +97,34 @@ public interface SpecialSubjectService extends BaseService
* @date 2021-07-15
*/
void delete(String[] ids);
+
+ /**
+ * 添加专题
+ *
+ * @param formDTO
+ * @return void
+ * @author yinzuomei
+ * @date 2021-07-15
+ */
+ AddSpecialSubjectResultDTO addSpecialSubject(AddSpecialSubjectFormDTO formDTO);
+
+ /**
+ * 【专题管理】删除专题
+ *
+ * @param formDTO
+ * @return void
+ * @author yinzuomei
+ * @date 2021-07-15
+ */
+ void delSpecialSubject(DelSpecialSubjectFormDTO formDTO);
+
+ /**
+ * 【专题管理】已有专题列表
+ *
+ * @param formDTO
+ * @return void
+ * @author yinzuomei
+ * @date 2021-07-15
+ */
+ List queryExistedList(QuerySpecialSubFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java
index 9bc8edba52..09b7230c6a 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java
@@ -21,19 +21,35 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.constant.StrConstant;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.SpecialSubjectDao;
import com.epmet.dto.SpecialSubjectDTO;
+import com.epmet.dto.TagCustomerDTO;
+import com.epmet.dto.form.AddSpecialSubjectFormDTO;
+import com.epmet.dto.form.DelSpecialSubjectFormDTO;
+import com.epmet.dto.form.QuerySpecialSubFormDTO;
+import com.epmet.dto.result.AddSpecialSubjectResultDTO;
+import com.epmet.dto.result.WorkSpecialSubjectResultDTO;
import com.epmet.entity.SpecialSubjectEntity;
import com.epmet.service.SpecialSubjectService;
+import com.epmet.service.TagCustomerService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
/**
* 专题表
@@ -41,8 +57,11 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-07-15
*/
+@Slf4j
@Service
public class SpecialSubjectServiceImpl extends BaseServiceImpl implements SpecialSubjectService {
+ @Autowired
+ private TagCustomerService tagCustomerService;
@Override
public PageData page(Map params) {
@@ -96,4 +115,99 @@ public class SpecialSubjectServiceImpl extends BaseServiceImpl queryExistedList(QuerySpecialSubFormDTO formDTO) {
+ List resultDTOList = new ArrayList<>();
+ List notList = new ArrayList<>();
+ //当前组织或者网格自己建立的
+ List currentOrgList = new ArrayList<>();
+ List currentOrgCreatedList = baseDao.queryExistedList(formDTO.getOrgId(), notList);
+ currentOrgCreatedList.forEach(dto -> {
+ WorkSpecialSubjectResultDTO result = new WorkSpecialSubjectResultDTO();
+ result.setSpecialSubjectId(dto.getId());
+ result.setTagId(dto.getTagId());
+ result.setTagName(dto.getTagName());
+ result.setCanDel(true);
+ currentOrgList.add(result);
+ });
+ if (CollectionUtils.isNotEmpty(currentOrgList)) {
+ notList = currentOrgList.stream().map(WorkSpecialSubjectResultDTO::getSpecialSubjectId).distinct().collect(Collectors.toList());
+ }
+ if (!NumConstant.ZERO_STR.equals(formDTO.getPids())) {
+ //存在上级组织...,从上往下查
+ List pidList = Arrays.asList(formDTO.getPids().split(StrConstant.COLON));
+ for (String pid : pidList) {
+ //优先展示自己的,所以要排除掉 领导们给我建立的专题
+ List list = baseDao.queryExistedList(pid, notList);
+ list.forEach(dto -> {
+ WorkSpecialSubjectResultDTO result = new WorkSpecialSubjectResultDTO();
+ result.setSpecialSubjectId(dto.getId());
+ result.setTagId(dto.getTagId());
+ result.setTagName(dto.getTagName());
+ result.setCanDel(false);
+ resultDTOList.add(result);
+ });
+ }
+ }
+ //自己建立的在最后面
+ if (CollectionUtils.isNotEmpty(currentOrgList)) {
+ resultDTOList.addAll(currentOrgList);
+ }
+ return resultDTOList;
+ }
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/SpecialSubjectDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/SpecialSubjectDao.xml
index d671b8b4eb..c40828ae10 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/SpecialSubjectDao.xml
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/SpecialSubjectDao.xml
@@ -2,7 +2,39 @@
+
+ SELECT
+ *
+ FROM
+ special_subject ss
+ WHERE
+ ss.DEL_FLAG = '0'
+ AND ss.ADD_ORG_ID = #{orgId}
+ AND ss.TAG_ID = #{tagId}
+
+
+ update special_subject set del_flag='1',UPDATED_BY=#{userId},UPDATED_TIME=Now()
+ where id=#{id}
+
-
+
+ SELECT
+ ss.*,
+ tc.TAG_NAME AS tagName
+ FROM
+ special_subject ss
+ INNER JOIN tag_customer tc ON ( ss.CUSTOMER_ID = tc.CUSTOMER_ID AND ss.TAG_ID = tc.id )
+ WHERE
+ ss.DEL_FLAG = '0'
+ AND tc.DEL_FLAG = '0'
+ AND ss.ADD_ORG_ID = #{orgId}
+
+ and ss.id not in
+
+ #{id}
+
+
+ order by ss.CREATED_TIME desc
+
\ No newline at end of file
From 61a87b08f761a44ec4aff66177c92b27225722be Mon Sep 17 00:00:00 2001
From: zxc <1272811460@qq.com>
Date: Fri, 16 Jul 2021 09:59:38 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E6=A0=B9=E6=8D=AEgridId=E6=9F=A5=E8=AF=A2p?=
=?UTF-8?q?ids?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/epmet/feign/GovOrgOpenFeignClient.java | 9 +++++++++
.../fallback/GovOrgOpenFeignClientFallback.java | 5 +++++
.../epmet/controller/CustomerGridController.java | 11 +++++++++++
.../main/java/com/epmet/dao/CustomerGridDao.java | 8 ++++++++
.../com/epmet/service/CustomerGridService.java | 8 ++++++++
.../service/impl/CustomerGridServiceImpl.java | 14 ++++++++++++++
.../src/main/resources/mapper/CustomerGridDao.xml | 5 +++++
7 files changed, 60 insertions(+)
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
index 1b99ac96f3..a79519837b 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
@@ -352,4 +352,13 @@ public interface GovOrgOpenFeignClient {
**/
@GetMapping(value = "/gov/org/customeragency/getareacodeswitch/{customerId}")
Result getAreaCodeSwitch(@PathVariable("customerId")String customerId);
+
+ /**
+ * @Description 根据网格ID查询pids
+ * @Param gridId
+ * @author zxc
+ * @date 2021/7/16 9:52 上午
+ */
+ @PostMapping(value = "/gov/org/customergrid/pidsbygrid")
+ Result selectPidsByGridId(@RequestParam("gridId") String gridId);
}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
index 0d13438885..f767c0ec69 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
@@ -209,4 +209,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result getAreaCodeSwitch(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAreaCodeSwitch", customerId);
}
+
+ @Override
+ public Result selectPidsByGridId(String gridId) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId);
+ }
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
index eec27314ba..bb06477812 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
@@ -241,4 +241,15 @@ public class CustomerGridController {
List resultDTOS = customerGridService.listGridIdsInCommunity(gridId);
return new Result>().ok(resultDTOS);
}
+
+ /**
+ * @Description 根据网格ID查询pids
+ * @Param gridId
+ * @author zxc
+ * @date 2021/7/16 9:52 上午
+ */
+ @PostMapping("pidsbygrid")
+ public Result selectPidsByGridId(@RequestParam("gridId") String gridId){
+ return new Result().ok(customerGridService.selectPidsByGridId(gridId));
+ }
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
index 4277be98c6..ec16bf0dcd 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
@@ -268,4 +268,12 @@ public interface CustomerGridDao extends BaseDao {
* @date 2021/4/19 11:56 上午
*/
CustomerGridDTO getGridBaseInfoById(@Param("gridId") String gridId);
+
+ /**
+ * @Description 根据网格ID查询pids
+ * @Param gridId
+ * @author zxc
+ * @date 2021/7/16 9:52 上午
+ */
+ String selectPidsByGridId(@Param("gridId")String gridId);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
index 4799c38890..b892fa84f8 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
@@ -287,4 +287,12 @@ public interface CustomerGridService extends BaseService {
* @date 2021/4/19 11:53 上午
*/
Result getBaseInfo(CustomerGridFormDTO customerGridFormDTO);
+
+ /**
+ * @Description 根据网格ID查询pids
+ * @Param gridId
+ * @author zxc
+ * @date 2021/7/16 9:52 上午
+ */
+ String selectPidsByGridId(String gridId);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
index c0a987206b..007aabd4b9 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
@@ -707,4 +707,18 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getBaseInfo(CustomerGridFormDTO customerGridFormDTO) {
return new Result().ok(ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class));
}
+
+ /**
+ * @Description 根据网格ID查询pids
+ * @Param gridId
+ * @author zxc
+ * @date 2021/7/16 9:52 上午
+ */
+ @Override
+ public String selectPidsByGridId(String gridId) {
+ if (StringUtils.isNotBlank(gridId)){
+ return baseDao.selectPidsByGridId(gridId);
+ }
+ return "";
+ }
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
index 2036e76fa6..2738538cbf 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
@@ -576,4 +576,9 @@
cg.ID = #{gridId}
AND cg.DEL_FLAG = '0'
+
+
+
+ SELECT PIDS FROM customer_grid WHERE DEL_FLAG = '0' AND ID = #{gridId}
+