From 6ba1a0381e2192ec549efd3d0230ee427c8ad7c0 Mon Sep 17 00:00:00 2001
From: zxc <1272811460@qq.com>
Date: Tue, 19 Oct 2021 10:35:27 +0800
Subject: [PATCH 01/12] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=91=98=E4=BE=8B?=
=?UTF-8?q?=E8=A1=8C=E5=B7=A5=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/dto/GridUserWorkDTO.java | 148 ++++++++++++++++++
.../controller/GridUserWorkController.java | 22 +++
.../java/com/epmet/dao/GridUserWorkDao.java | 33 ++++
.../com/epmet/entity/GridUserWorkEntity.java | 118 ++++++++++++++
.../epmet/service/GridUserWorkService.java | 78 +++++++++
.../service/impl/GridUserWorkServiceImpl.java | 82 ++++++++++
.../main/resources/mapper/GridUserWorkDao.xml | 7 +
7 files changed, 488 insertions(+)
create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridUserWorkDao.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java
create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java
new file mode 100644
index 0000000000..8cb632f6bc
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java
@@ -0,0 +1,148 @@
+/**
+ * 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-10-19
+ */
+@Data
+public class GridUserWorkDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 网格ID
+ */
+ private String gridId;
+
+ /**
+ * 网格名称
+ */
+ private String gridName;
+
+ /**
+ * 组织名称
+ */
+ private String orgId;
+
+ /**
+ * 组织名称 xx社区-xx网格
+ */
+ private String orgName;
+
+ /**
+ * PIDS
+ */
+ private String pids;
+
+ /**
+ * 网格编码
+ */
+ private String gridCode;
+
+ /**
+ * 例行工作类型
+01:重点巡查
+0101:出租房巡查
+0102:新增流动人口
+0103:重点场所巡查
+0104:宗教活动
+0199:其他
+02:特殊人群
+0201:刑满释放人员
+0202:社区矫正
+0203:吸毒人员
+0204:信访人员
+ */
+ private String workType;
+
+ /**
+ * 例行工作类型名字
+ */
+ private String workTypeName;
+
+ /**
+ * 发生日期 格式为“YYYY-MM-DD”
+ */
+ private Date happenTime;
+
+ /**
+ * 基础信息主键
+出租房巡查、重点场所巡查、刑满释放人员、社区矫正、吸毒人员、信访人员重点青少年和精神障碍者必填
+ */
+ private String baseInfoId;
+
+ /**
+ * 有无变动(异常)Y:是、N:否
+ */
+ private String workResult;
+
+ /**
+ * 备注说明
+ */
+ private String workContent;
+
+ /**
+ *
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private String revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java
new file mode 100644
index 0000000000..33eb35bb46
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java
@@ -0,0 +1,22 @@
+package com.epmet.controller;
+
+import com.epmet.service.GridUserWorkService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 网格员例行工作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-10-19
+ */
+@RestController
+@RequestMapping("griduserwork")
+public class GridUserWorkController {
+
+ @Autowired
+ private GridUserWorkService gridUserWorkService;
+
+
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridUserWorkDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridUserWorkDao.java
new file mode 100644
index 0000000000..468a6ab5b5
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridUserWorkDao.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.GridUserWorkEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 网格员例行工作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-10-19
+ */
+@Mapper
+public interface GridUserWorkDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
new file mode 100644
index 0000000000..81b54fbf02
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
@@ -0,0 +1,118 @@
+/**
+ * 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-10-19
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("grid_user_work")
+public class GridUserWorkEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 网格ID
+ */
+ private String gridId;
+
+ /**
+ * 网格名称
+ */
+ private String gridName;
+
+ /**
+ * 组织名称
+ */
+ private String orgId;
+
+ /**
+ * 组织名称 xx社区-xx网格
+ */
+ private String orgName;
+
+ /**
+ * PIDS
+ */
+ private String pids;
+
+ /**
+ * 网格编码
+ */
+ private String gridCode;
+
+ /**
+ * 例行工作类型
+01:重点巡查
+0101:出租房巡查
+0102:新增流动人口
+0103:重点场所巡查
+0104:宗教活动
+0199:其他
+02:特殊人群
+0201:刑满释放人员
+0202:社区矫正
+0203:吸毒人员
+0204:信访人员
+ */
+ private String workType;
+
+ /**
+ * 例行工作类型名字
+ */
+ private String workTypeName;
+
+ /**
+ * 发生日期 格式为“YYYY-MM-DD”
+ */
+ private Date happenTime;
+
+ /**
+ * 基础信息主键
+出租房巡查、重点场所巡查、刑满释放人员、社区矫正、吸毒人员、信访人员重点青少年和精神障碍者必填
+ */
+ private String baseInfoId;
+
+ /**
+ * 有无变动(异常)Y:是、N:否
+ */
+ private String workResult;
+
+ /**
+ * 备注说明
+ */
+ private String workContent;
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java
new file mode 100644
index 0000000000..c5dc23b976
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java
@@ -0,0 +1,78 @@
+package com.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.GridUserWorkDTO;
+import com.epmet.entity.GridUserWorkEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 网格员例行工作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-10-19
+ */
+public interface GridUserWorkService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2021-10-19
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2021-10-19
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return GridUserWorkDTO
+ * @author generator
+ * @date 2021-10-19
+ */
+ GridUserWorkDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2021-10-19
+ */
+ void save(GridUserWorkDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2021-10-19
+ */
+ void update(GridUserWorkDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2021-10-19
+ */
+ void delete(String[] ids);
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java
new file mode 100644
index 0000000000..bcaf16f379
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java
@@ -0,0 +1,82 @@
+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.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dao.GridUserWorkDao;
+import com.epmet.dto.GridUserWorkDTO;
+import com.epmet.entity.GridUserWorkEntity;
+import com.epmet.service.GridUserWorkService;
+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-10-19
+ */
+@Service
+public class GridUserWorkServiceImpl extends BaseServiceImpl implements GridUserWorkService {
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, GridUserWorkDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, GridUserWorkDTO.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 GridUserWorkDTO get(String id) {
+ GridUserWorkEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, GridUserWorkDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(GridUserWorkDTO dto) {
+ GridUserWorkEntity entity = ConvertUtils.sourceToTarget(dto, GridUserWorkEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(GridUserWorkDTO dto) {
+ GridUserWorkEntity entity = ConvertUtils.sourceToTarget(dto, GridUserWorkEntity.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-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml
new file mode 100644
index 0000000000..70467112b6
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
From a905e8c82632cc14c7bf8c68307ad39b362a11e3 Mon Sep 17 00:00:00 2001
From: zxc <1272811460@qq.com>
Date: Tue, 19 Oct 2021 15:33:19 +0800
Subject: [PATCH 02/12] =?UTF-8?q?=E4=BE=8B=E8=A1=8C=E5=B7=A5=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/dto/GridUserWorkDTO.java | 6 +--
.../epmet/dto/form/GridUserWorkFormDTO.java | 49 +++++++++++++++++++
.../controller/GridUserWorkController.java | 18 ++++++-
.../com/epmet/entity/GridUserWorkEntity.java | 6 +--
.../epmet/service/GridUserWorkService.java | 9 ++++
.../service/impl/GridUserWorkServiceImpl.java | 37 ++++++++++++++
6 files changed, 118 insertions(+), 7 deletions(-)
create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java
index 8cb632f6bc..78701ffd9a 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java
@@ -54,12 +54,12 @@ public class GridUserWorkDTO implements Serializable {
private String gridName;
/**
- * 组织名称
+ * 组织ID
*/
- private String orgId;
+ private String parentOrgId;
/**
- * 组织名称 xx社区-xx网格
+ * 组织名称
*/
private String orgName;
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java
new file mode 100644
index 0000000000..5841f761f4
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java
@@ -0,0 +1,49 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Author zxc
+ * @DateTime 2021/10/19 10:41 上午
+ * @DESC
+ */
+@Data
+public class GridUserWorkFormDTO implements Serializable {
+
+ private static final long serialVersionUID = -2328321123796674558L;
+
+ public interface GridUserWorkForm{}
+
+ @NotBlank(message = "网格ID不能为空",groups = GridUserWorkForm.class)
+ private String gridId;
+
+ @NotBlank(message = "例行工作类型不能为空",groups = GridUserWorkForm.class)
+ private String workType;
+
+ @NotBlank(message = "例行工作类型名字不能为空",groups = GridUserWorkForm.class)
+ private String workTypeName;
+
+ /**
+ * Y:是、N:否
+ */
+ @NotBlank(message = "有无变动(异常)不能为空",groups = GridUserWorkForm.class)
+ private String workResult;
+
+ @NotNull(message = "发生时间不能为空",groups = GridUserWorkForm.class)
+ private Date happenTime;
+
+ /**
+ * 备注说明
+ */
+ private String workContent;
+
+ /**
+ * 基础信息ID【相关信息】
+ */
+ private String baseInfoId;
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java
index 33eb35bb46..2f32331d0f 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java
@@ -1,5 +1,9 @@
package com.epmet.controller;
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.dto.form.GridUserWorkFormDTO;
import com.epmet.service.GridUserWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -17,6 +21,18 @@ public class GridUserWorkController {
@Autowired
private GridUserWorkService gridUserWorkService;
-
+ /**
+ * @Description 网格员例行工作
+ * @param formDTO
+ * @author zxc
+ * @date 2021/10/19 1:35 下午
+ */
+ @NoRepeatSubmit
+ @PostMapping("griduserwork")
+ public Result gridUserWork(@RequestBody GridUserWorkFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO, GridUserWorkFormDTO.GridUserWorkForm.class);
+ gridUserWorkService.gridUserWork(formDTO);
+ return new Result();
+ }
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
index 81b54fbf02..25469ff30d 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
@@ -54,12 +54,12 @@ public class GridUserWorkEntity extends BaseEpmetEntity {
private String gridName;
/**
- * 组织名称
+ * 组织ID
*/
- private String orgId;
+ private String parentOrgId;
/**
- * 组织名称 xx社区-xx网格
+ * 组织名称
*/
private String orgName;
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java
index c5dc23b976..8ce3cc5a10 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java
@@ -3,6 +3,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.GridUserWorkDTO;
+import com.epmet.dto.form.GridUserWorkFormDTO;
import com.epmet.entity.GridUserWorkEntity;
import java.util.List;
@@ -75,4 +76,12 @@ public interface GridUserWorkService extends BaseService {
* @date 2021-10-19
*/
void delete(String[] ids);
+
+ /**
+ * @Description 网格员例行工作
+ * @param formDTO
+ * @author zxc
+ * @date 2021/10/19 1:35 下午
+ */
+ void gridUserWork(GridUserWorkFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java
index bcaf16f379..0a4df06acc 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java
@@ -3,14 +3,21 @@ 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.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.GridUserWorkDao;
+import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.GridUserWorkDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
+import com.epmet.dto.form.GridUserWorkFormDTO;
import com.epmet.entity.GridUserWorkEntity;
+import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.GridUserWorkService;
import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -27,6 +34,9 @@ import java.util.Map;
@Service
public class GridUserWorkServiceImpl extends BaseServiceImpl implements GridUserWorkService {
+ @Autowired
+ private GovOrgOpenFeignClient govOrgOpenFeignClient;
+
@Override
public PageData page(Map params) {
IPage page = baseDao.selectPage(
@@ -79,4 +89,31 @@ public class GridUserWorkServiceImpl extends BaseServiceImpl gridBaseInfoData = govOrgOpenFeignClient.getGridBaseInfoByGridId(gridFormDTO);
+ if (!gridBaseInfoData.success()){
+ throw new RenException("查询网格基本信息失败......");
+ }
+ CustomerGridDTO gridBaseInfo = gridBaseInfoData.getData();
+ entity.setGridName(gridBaseInfo.getGridName());
+ // 暂时为 哈哈,后期缓存加上 gridCode在修改
+ entity.setGridCode("哈哈");
+ entity.setCustomerId(gridBaseInfo.getCustomerId());
+ entity.setParentOrgId(gridBaseInfo.getPid());
+ entity.setOrgName(gridBaseInfo.getAgencyName());
+ entity.setPids(gridBaseInfo.getPids());
+ baseDao.insert(entity);
+ }
+
}
\ No newline at end of file
From cc103a434cf7c365987da0bf8b5173dc3abefcc1 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Tue, 21 Dec 2021 13:08:40 +0800
Subject: [PATCH 03/12] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=AD=97=E5=85=B8?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E7=88=B6=E7=BA=A7=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/java/com/epmet/dto/SysDictDataDTO.java | 2 ++
.../src/main/java/com/epmet/entity/SysDictDataEntity.java | 4 ++++
.../com/epmet/commons/tools/dto/result/DictListResultDTO.java | 1 +
3 files changed, 7 insertions(+)
diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictDataDTO.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictDataDTO.java
index 344ef25601..6fe61bc0b1 100644
--- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictDataDTO.java
+++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictDataDTO.java
@@ -42,6 +42,8 @@ public class SysDictDataDTO implements Serializable {
private String dictValue;
+ private String dictPValue;
+
private String remark;
@Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class)
diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictDataEntity.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictDataEntity.java
index 16a7b5cad8..588a8debb2 100644
--- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictDataEntity.java
+++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictDataEntity.java
@@ -39,6 +39,10 @@ public class SysDictDataEntity extends BaseEntity {
* 字典值
*/
private String dictValue;
+ /**
+ * 父级字典值 顶级:0
+ */
+ private String dictPValue;
/**
* 备注
*/
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
index fe89cf0d24..cc85c39027 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
@@ -14,4 +14,5 @@ public class DictListResultDTO implements Serializable {
private static final long serialVersionUID = 8618231166600518980L;
private String label;
private String value;
+ private List children;
}
From 96e9a3cc374a7b31b100fda7349b1faac9072df1 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Tue, 21 Dec 2021 15:03:06 +0800
Subject: [PATCH 04/12] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=AD=97=E5=85=B8?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E8=8E=B7=E5=8F=96=E6=A0=91=E5=BD=A2?=
=?UTF-8?q?=E7=BB=93=E6=9E=84=E7=9A=84=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../epmet/controller/SysDictDataController.java | 10 ++++++++++
.../main/java/com/epmet/dao/SysDictDataDao.java | 3 +++
.../com/epmet/service/SysDictDataService.java | 3 +++
.../service/impl/SysDictDataServiceImpl.java | 8 ++++++++
.../main/resources/mapper/SysDictDataDao.xml | 14 ++++++++++++++
.../tools/dto/result/DictTreeResultDTO.java | 17 +++++++++++++++++
6 files changed, 55 insertions(+)
create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java
index aff54e6e09..3c3ac4d344 100644
--- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java
+++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java
@@ -10,6 +10,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
+import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
@@ -150,6 +151,15 @@ public class SysDictDataController {
return new Result>().ok(sysDictDataService.dictList(formDTO.getDictType()));
}
+ /**
+ * @Description 字典数据查询通用接口
+ * @Author sun
+ */
+ @PostMapping("dictTree/{dictType}")
+ public Result> dictListTree(@PathVariable("dictType") String dictType) {
+ return new Result>().ok(sysDictDataService.dictListTree(dictType));
+ }
+
/**
* 字典数据查询通用接口
* @Param dictType
diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java
index 59ee893a89..7ba543b6af 100644
--- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java
+++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java
@@ -10,6 +10,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
+import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.entity.DictData;
import com.epmet.entity.SysDictDataEntity;
import org.apache.ibatis.annotations.Mapper;
@@ -30,4 +31,6 @@ public interface SysDictDataDao extends BaseDao {
List getDictDataList();
List selectDictList(String dictType);
+
+ List selectDictData(String dictType);
}
diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java
index 9109cfdc86..b49e51fbdc 100644
--- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java
+++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java
@@ -10,6 +10,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
+import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.SysDictDataDTO;
@@ -87,4 +88,6 @@ public interface SysDictDataService extends BaseService {
Map dictMap(String dictType);
+
+ List dictListTree(String dictType);
}
diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java
index d3c61d6c16..bd042379dd 100644
--- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java
+++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java
@@ -13,9 +13,11 @@ 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.dto.result.DictListResultDTO;
+import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.TreeUtils;
import com.epmet.dao.SysDictDataDao;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.entity.SysDictDataEntity;
@@ -217,4 +219,10 @@ public class SysDictDataServiceImpl extends BaseServiceImpl dictListTree(String dictType) {
+ List resultDTOList = baseDao.selectDictData(dictType);
+ return TreeUtils.buildTree(resultDTOList);
+ }
+
}
diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
index 3760e0895a..43f0285788 100644
--- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
+++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
@@ -19,5 +19,19 @@
ORDER BY
a.sort ASC
+
+ SELECT
+ a.dict_value id,
+ a.dict_p_value pid,
+ a.dict_label label,
+ a.dict_value `value`
+ FROM
+ sys_dict_data a
+ INNER JOIN sys_dict_type b ON a.dict_type_id = b.id
+ WHERE
+ b.dict_type = #{dictType}
+ ORDER BY
+ a.sort asc
+
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
new file mode 100644
index 0000000000..034cecee47
--- /dev/null
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
@@ -0,0 +1,17 @@
+package com.epmet.commons.tools.dto.result;
+
+import com.epmet.commons.tools.utils.TreeStringNode;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Description 字典数据查询-接口返参
+ * @Author sun
+ */
+@Data
+public class DictTreeResultDTO extends TreeStringNode implements Serializable {
+ private static final long serialVersionUID = 3772355047088964759L;
+ private String label;
+ private String value;
+}
From 0eb3a67001988dbc328665be7c8cea2500045d27 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Tue, 21 Dec 2021 17:15:05 +0800
Subject: [PATCH 05/12] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=AD=97=E5=85=B8?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E8=8E=B7=E5=8F=96=E6=A0=91=E5=BD=A2?=
=?UTF-8?q?=E7=BB=93=E6=9E=84=E7=9A=84=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/resources/mapper/SysDictDataDao.xml | 3 +--
.../commons/tools/dto/result/DictTreeResultDTO.java | 9 +++++++--
.../com/epmet/commons/tools/utils/TreeStringNode.java | 1 +
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
index 43f0285788..ff1273d4ae 100644
--- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
+++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
@@ -23,8 +23,7 @@
SELECT
a.dict_value id,
a.dict_p_value pid,
- a.dict_label label,
- a.dict_value `value`
+ a.dict_label name
FROM
sys_dict_data a
INNER JOIN sys_dict_type b ON a.dict_type_id = b.id
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
index 034cecee47..7314d941a8 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
@@ -1,6 +1,7 @@
package com.epmet.commons.tools.dto.result;
import com.epmet.commons.tools.utils.TreeStringNode;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@@ -12,6 +13,10 @@ import java.io.Serializable;
@Data
public class DictTreeResultDTO extends TreeStringNode implements Serializable {
private static final long serialVersionUID = 3772355047088964759L;
- private String label;
- private String value;
+ /**
+ * 上级ID
+ */
+ @JsonIgnore
+ private String pid;
+ private String name;
}
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeStringNode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeStringNode.java
index 53713e032c..6d87e3bd2c 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeStringNode.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeStringNode.java
@@ -8,6 +8,7 @@
package com.epmet.commons.tools.utils;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
From 416640b36d1292efc7ffaab257bbc8b34467fcf3 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Wed, 22 Dec 2021 09:32:05 +0800
Subject: [PATCH 06/12] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=AD=97=E5=85=B8?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E8=BF=94=E5=9B=9EpValue?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/resources/mapper/SysDictDataDao.xml | 3 ++-
.../com/epmet/commons/tools/dto/result/DictListResultDTO.java | 3 +++
.../main/java/com/epmet/commons/tools/enums/DictTypeEnum.java | 1 +
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
index ff1273d4ae..f735716edd 100644
--- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
+++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
@@ -10,7 +10,8 @@
SELECT
a.dict_label label,
- a.dict_value `value`
+ a.dict_value `value`,
+ a.dict_p_value pValue
FROM
sys_dict_data a
INNER JOIN sys_dict_type b ON a.dict_type_id = b.id
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
index cc85c39027..bc9b02c1da 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
@@ -1,5 +1,6 @@
package com.epmet.commons.tools.dto.result;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@@ -14,5 +15,7 @@ public class DictListResultDTO implements Serializable {
private static final long serialVersionUID = 8618231166600518980L;
private String label;
private String value;
+ @JsonIgnore
+ private String pValue;
private List children;
}
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
index e1fa6b1456..39f80d7910 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
@@ -20,6 +20,7 @@ public enum DictTypeEnum {
USER_DEMAND_REPORT_TYPE("user_demand_report_type","居民需求上报类型",9),
USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10),
AGE_GROUP("age_group", "年龄范围", 11),
+ PATROL_WORK_TYPE("patrol_work_type", "例行工作分类", 13),
;
private final String code;
From b3307783b98e5128a08ef46a965b3e7f676b7f82 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Wed, 22 Dec 2021 09:32:50 +0800
Subject: [PATCH 07/12] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=8B=E8=A1=8C?=
=?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=9A=82=E5=AD=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...WorkDTO.java => PatrolRoutineWorkDTO.java} | 78 ++++-------
.../epmet/dto/PatrolRoutineWorkTypeDTO.java | 91 ++++++++++++
.../epmet/dto/form/GridUserWorkFormDTO.java | 53 ++++---
....java => PatrolRoutineWorkController.java} | 20 +--
...WorkDao.java => PatrolRoutineWorkDao.java} | 8 +-
.../epmet/dao/PatrolRoutineWorkTypeDao.java | 33 +++++
.../com/epmet/entity/GridUserWorkEntity.java | 70 +++-------
.../epmet/entity/PatrolRoutineWorkEntity.java | 88 ++++++++++++
.../entity/PatrolRoutineWorkTypeEntity.java | 61 ++++++++
.../epmet/service/GridUserWorkService.java | 87 ------------
.../service/PatrolRoutineWorkService.java | 38 +++++
.../service/PatrolRoutineWorkTypeService.java | 31 ++++
.../service/impl/GridUserWorkServiceImpl.java | 119 ----------------
.../impl/PatrolRoutineWorkServiceImpl.java | 132 ++++++++++++++++++
.../PatrolRoutineWorkTypeServiceImpl.java | 36 +++++
.../main/resources/mapper/GridUserWorkDao.xml | 7 -
.../resources/mapper/PatrolRoutineWorkDao.xml | 27 ++++
.../mapper/PatrolRoutineWorkTypeDao.xml | 21 +++
18 files changed, 653 insertions(+), 347 deletions(-)
rename epmet-user/epmet-user-client/src/main/java/com/epmet/dto/{GridUserWorkDTO.java => PatrolRoutineWorkDTO.java} (58%)
create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkTypeDTO.java
rename epmet-user/epmet-user-server/src/main/java/com/epmet/controller/{GridUserWorkController.java => PatrolRoutineWorkController.java} (67%)
rename epmet-user/epmet-user-server/src/main/java/com/epmet/dao/{GridUserWorkDao.java => PatrolRoutineWorkDao.java} (83%)
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkTypeDao.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkEntity.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkTypeEntity.java
delete mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkTypeService.java
delete mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkTypeServiceImpl.java
delete mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml
create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkDao.xml
create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkTypeDao.xml
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkDTO.java
similarity index 58%
rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java
rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkDTO.java
index 78701ffd9a..d0c66c1a07 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkDTO.java
@@ -17,113 +17,87 @@
package com.epmet.dto;
+import lombok.Data;
+
import java.io.Serializable;
import java.util.Date;
-import lombok.Data;
/**
- * 网格员例行工作
+ * 巡查例行工作
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2021-10-19
+ * @since v1.0.0 2021-12-21
*/
@Data
-public class GridUserWorkDTO implements Serializable {
+public class PatrolRoutineWorkDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
- * 主键
+ * 唯一标识
*/
private String id;
/**
- * 客户ID
+ * 客户Id customer.id
*/
private String customerId;
/**
- * 网格ID
+ * 网格表Id(CUSTOMER_GRID.id)【居民党员角色值为all,热心居民角色对应的网格Id】
*/
private String gridId;
/**
- * 网格名称
- */
- private String gridName;
-
- /**
- * 组织ID
- */
- private String parentOrgId;
-
- /**
- * 组织名称
- */
- private String orgName;
-
- /**
- * PIDS
+ * 网格所有上级id
*/
private String pids;
/**
- * 网格编码
+ * 用户Id user.id
*/
- private String gridCode;
+ private String userId;
/**
- * 例行工作类型
-01:重点巡查
-0101:出租房巡查
-0102:新增流动人口
-0103:重点场所巡查
-0104:宗教活动
-0199:其他
-02:特殊人群
-0201:刑满释放人员
-0202:社区矫正
-0203:吸毒人员
-0204:信访人员
+ * 事项名称
*/
- private String workType;
+ private String title;
/**
- * 例行工作类型名字
+ * 工作日期 格式为“YYYY-MM-DD”
*/
- private String workTypeName;
+ private String happenTime;
/**
- * 发生日期 格式为“YYYY-MM-DD”
+ * 有无变动(异常)1:是、0:否
*/
- private Date happenTime;
+ private Integer isNormal;
/**
- * 基础信息主键
-出租房巡查、重点场所巡查、刑满释放人员、社区矫正、吸毒人员、信访人员重点青少年和精神障碍者必填
+ * 工作内容
*/
- private String baseInfoId;
+ private String workContent;
/**
- * 有无变动(异常)Y:是、N:否
+ * 经度
*/
- private String workResult;
+ private String longitude;
/**
- * 备注说明
+ * 纬度
*/
- private String workContent;
+ private String latitude;
/**
- *
+ * 删除标识:0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
- private String revision;
+ private Integer revision;
/**
* 创建人
@@ -145,4 +119,4 @@ public class GridUserWorkDTO implements Serializable {
*/
private Date updatedTime;
-}
\ No newline at end of file
+}
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkTypeDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkTypeDTO.java
new file mode 100644
index 0000000000..505384ec36
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkTypeDTO.java
@@ -0,0 +1,91 @@
+/**
+ * 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-12-21
+ */
+@Data
+public class PatrolRoutineWorkTypeDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 唯一标识
+ */
+ private String id;
+
+ /**
+ * 客户Id customer.id
+ */
+ private String customerId;
+
+ /**
+ * 例行工作Id
+ */
+ private String routineWorkId;
+
+ /**
+ * 例行工作字典项值;type:patrol_work_type
+ */
+ private String workTypeCode;
+
+ /**
+ * 所有上级类别code组合
+ */
+ private String allPCode;
+
+ /**
+ * 删除标识:0.未删除 1.已删除
+ */
+ private Integer 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-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java
index 5841f761f4..f9b029d423 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java
@@ -1,11 +1,14 @@
package com.epmet.dto.form;
+import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
+import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
-import java.util.Date;
+import java.util.List;
/**
* @Author zxc
@@ -15,35 +18,47 @@ import java.util.Date;
@Data
public class GridUserWorkFormDTO implements Serializable {
- private static final long serialVersionUID = -2328321123796674558L;
- public interface GridUserWorkForm{}
+ private static final long serialVersionUID = 3411355616849866888L;
- @NotBlank(message = "网格ID不能为空",groups = GridUserWorkForm.class)
+ public interface AddOrUpdateForm {}
+
+ private String customerId;
+
+ @NotBlank(message = "网格ID不能为空",groups = AddOrUpdateForm.class)
private String gridId;
- @NotBlank(message = "例行工作类型不能为空",groups = GridUserWorkForm.class)
- private String workType;
+ @NotBlank(message = "事项名称不能为空",groups = AddOrUpdateForm.class)
+ private String title;
- @NotBlank(message = "例行工作类型名字不能为空",groups = GridUserWorkForm.class)
- private String workTypeName;
+ @NotEmpty(message = "例行工作类型不能为空",groups = AddOrUpdateForm.class)
+ private List workTypeList;
- /**
- * Y:是、N:否
- */
- @NotBlank(message = "有无变动(异常)不能为空",groups = GridUserWorkForm.class)
- private String workResult;
+ @Range(min = 0,max = 1, message = "有无变动(异常)不能为空",groups = AddOrUpdateForm.class)
+ private Integer isNormal;
- @NotNull(message = "发生时间不能为空",groups = GridUserWorkForm.class)
- private Date happenTime;
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ @NotNull(message = "发生时间不能为空",groups = AddOrUpdateForm.class)
+ private String happenTime;
- /**
- * 备注说明
- */
+ @NotBlank(message = "工作简介不能为空",groups = AddOrUpdateForm.class)
private String workContent;
+ @NotBlank(message = "工作地点不能为空",groups = AddOrUpdateForm.class)
+ private String address;
/**
- * 基础信息ID【相关信息】
+ * 基础信息ID【相关信息】暂时没有
*/
private String baseInfoId;
+ /**
+ * 经度
+ */
+ private String longitude;
+ /**
+ * 纬度
+ */
+ private String latitude;
+
+
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
similarity index 67%
rename from epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java
rename to epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
index 2f32331d0f..fada3dca9a 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
@@ -4,7 +4,7 @@ import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.GridUserWorkFormDTO;
-import com.epmet.service.GridUserWorkService;
+import com.epmet.service.PatrolRoutineWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -15,11 +15,11 @@ import org.springframework.web.bind.annotation.*;
* @since v1.0.0 2021-10-19
*/
@RestController
-@RequestMapping("griduserwork")
-public class GridUserWorkController {
-
+@RequestMapping("patrolroutinework")
+public class PatrolRoutineWorkController {
+
@Autowired
- private GridUserWorkService gridUserWorkService;
+ private PatrolRoutineWorkService gridUserWorkService;
/**
* @Description 网格员例行工作
@@ -28,11 +28,11 @@ public class GridUserWorkController {
* @date 2021/10/19 1:35 下午
*/
@NoRepeatSubmit
- @PostMapping("griduserwork")
- public Result gridUserWork(@RequestBody GridUserWorkFormDTO formDTO){
- ValidatorUtils.validateEntity(formDTO, GridUserWorkFormDTO.GridUserWorkForm.class);
+ @PostMapping("add")
+ public Result gridUserWork( @RequestBody GridUserWorkFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO, GridUserWorkFormDTO.AddOrUpdateForm.class);
gridUserWorkService.gridUserWork(formDTO);
- return new Result();
+ return new Result().ok(true);
}
-}
\ No newline at end of file
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridUserWorkDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkDao.java
similarity index 83%
rename from epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridUserWorkDao.java
rename to epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkDao.java
index 468a6ab5b5..02ba968895 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridUserWorkDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkDao.java
@@ -18,16 +18,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
-import com.epmet.entity.GridUserWorkEntity;
+import com.epmet.entity.PatrolRoutineWorkEntity;
import org.apache.ibatis.annotations.Mapper;
/**
- * 网格员例行工作
+ * 巡查例行工作
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2021-10-19
+ * @since v1.0.0 2021-12-21
*/
@Mapper
-public interface GridUserWorkDao extends BaseDao {
+public interface PatrolRoutineWorkDao extends BaseDao {
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkTypeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkTypeDao.java
new file mode 100644
index 0000000000..924c91eaeb
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkTypeDao.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.PatrolRoutineWorkTypeEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 巡查例行工作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-12-21
+ */
+@Mapper
+public interface PatrolRoutineWorkTypeDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
index 25469ff30d..0167079052 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
@@ -33,7 +33,7 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper=false)
-@TableName("grid_user_work")
+@TableName("patrol_routine_work")
public class GridUserWorkEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
@@ -49,50 +49,19 @@ public class GridUserWorkEntity extends BaseEpmetEntity {
private String gridId;
/**
- * 网格名称
- */
- private String gridName;
-
- /**
- * 组织ID
- */
- private String parentOrgId;
-
- /**
- * 组织名称
- */
- private String orgName;
-
- /**
- * PIDS
+ * gridId的PID
*/
private String pids;
- /**
- * 网格编码
- */
- private String gridCode;
-
- /**
- * 例行工作类型
-01:重点巡查
-0101:出租房巡查
-0102:新增流动人口
-0103:重点场所巡查
-0104:宗教活动
-0199:其他
-02:特殊人群
-0201:刑满释放人员
-0202:社区矫正
-0203:吸毒人员
-0204:信访人员
- */
- private String workType;
+ /**
+ * 用户Id user.id 谁创建的
+ */
+ private String userId;
- /**
- * 例行工作类型名字
- */
- private String workTypeName;
+ /**
+ * 事项名称
+ */
+ private String title;
/**
* 发生日期 格式为“YYYY-MM-DD”
@@ -100,19 +69,22 @@ public class GridUserWorkEntity extends BaseEpmetEntity {
private Date happenTime;
/**
- * 基础信息主键
-出租房巡查、重点场所巡查、刑满释放人员、社区矫正、吸毒人员、信访人员重点青少年和精神障碍者必填
+ * 有无变动(异常)1:是、0:否
*/
- private String baseInfoId;
-
- /**
- * 有无变动(异常)Y:是、N:否
- */
- private String workResult;
+ private Integer isNormal;
/**
* 备注说明
*/
private String workContent;
+ /**
+ * 经度
+ */
+ private String longitude;
+ /**
+ * 纬度
+ */
+ private String latitude;
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkEntity.java
new file mode 100644
index 0000000000..94bde0e1ba
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkEntity.java
@@ -0,0 +1,88 @@
+/**
+ * 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;
+
+/**
+ * 巡查例行工作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-12-21
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("patrol_routine_work")
+public class PatrolRoutineWorkEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id customer.id
+ */
+ private String customerId;
+
+ /**
+ * 网格表Id(CUSTOMER_GRID.id)【居民党员角色值为all,热心居民角色对应的网格Id】
+ */
+ private String gridId;
+
+ /**
+ * 网格所有上级id
+ */
+ private String pids;
+
+ /**
+ * 用户Id user.id
+ */
+ private String userId;
+
+ /**
+ * 事项名称
+ */
+ private String title;
+
+ /**
+ * 工作日期 格式为“YYYY-MM-DD”
+ */
+ private String happenTime;
+
+ /**
+ * 有无变动(异常)1:是、0:否
+ */
+ private Integer isNormal;
+
+ /**
+ * 工作内容
+ */
+ private String workContent;
+
+ /**
+ * 经度
+ */
+ private String longitude;
+
+ /**
+ * 纬度
+ */
+ private String latitude;
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkTypeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkTypeEntity.java
new file mode 100644
index 0000000000..bf18e08bee
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkTypeEntity.java
@@ -0,0 +1,61 @@
+/**
+ * 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-12-21
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("patrol_routine_work_type")
+public class PatrolRoutineWorkTypeEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id customer.id
+ */
+ private String customerId;
+
+ /**
+ * 例行工作Id
+ */
+ private String routineWorkId;
+
+ /**
+ * 例行工作字典项值;type:patrol_work_type
+ */
+ private String workTypeCode;
+
+ /**
+ * 所有上级类别code组合
+ */
+ private String allPCode;
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java
deleted file mode 100644
index 8ce3cc5a10..0000000000
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.epmet.service;
-
-import com.epmet.commons.mybatis.service.BaseService;
-import com.epmet.commons.tools.page.PageData;
-import com.epmet.dto.GridUserWorkDTO;
-import com.epmet.dto.form.GridUserWorkFormDTO;
-import com.epmet.entity.GridUserWorkEntity;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 网格员例行工作
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2021-10-19
- */
-public interface GridUserWorkService extends BaseService {
-
- /**
- * 默认分页
- *
- * @param params
- * @return PageData
- * @author generator
- * @date 2021-10-19
- */
- PageData page(Map params);
-
- /**
- * 默认查询
- *
- * @param params
- * @return java.util.List
- * @author generator
- * @date 2021-10-19
- */
- List list(Map params);
-
- /**
- * 单条查询
- *
- * @param id
- * @return GridUserWorkDTO
- * @author generator
- * @date 2021-10-19
- */
- GridUserWorkDTO get(String id);
-
- /**
- * 默认保存
- *
- * @param dto
- * @return void
- * @author generator
- * @date 2021-10-19
- */
- void save(GridUserWorkDTO dto);
-
- /**
- * 默认更新
- *
- * @param dto
- * @return void
- * @author generator
- * @date 2021-10-19
- */
- void update(GridUserWorkDTO dto);
-
- /**
- * 批量删除
- *
- * @param ids
- * @return void
- * @author generator
- * @date 2021-10-19
- */
- void delete(String[] ids);
-
- /**
- * @Description 网格员例行工作
- * @param formDTO
- * @author zxc
- * @date 2021/10/19 1:35 下午
- */
- void gridUserWork(GridUserWorkFormDTO formDTO);
-}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java
new file mode 100644
index 0000000000..f463510d5f
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java
@@ -0,0 +1,38 @@
+/**
+ * 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.PatrolRoutineWorkDTO;
+import com.epmet.dto.form.GridUserWorkFormDTO;
+import com.epmet.entity.PatrolRoutineWorkEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 巡查例行工作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-12-21
+ */
+public interface PatrolRoutineWorkService extends BaseService {
+
+ void gridUserWork(GridUserWorkFormDTO formDTO);
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkTypeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkTypeService.java
new file mode 100644
index 0000000000..f15123239f
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkTypeService.java
@@ -0,0 +1,31 @@
+/**
+ * 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.entity.PatrolRoutineWorkTypeEntity;
+
+/**
+ * 巡查例行工作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-12-21
+ */
+public interface PatrolRoutineWorkTypeService extends BaseService {
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java
deleted file mode 100644
index 0a4df06acc..0000000000
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-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.exception.RenException;
-import com.epmet.commons.tools.page.PageData;
-import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
-import com.epmet.commons.tools.utils.Result;
-import com.epmet.dao.GridUserWorkDao;
-import com.epmet.dto.CustomerGridDTO;
-import com.epmet.dto.GridUserWorkDTO;
-import com.epmet.dto.form.CustomerGridFormDTO;
-import com.epmet.dto.form.GridUserWorkFormDTO;
-import com.epmet.entity.GridUserWorkEntity;
-import com.epmet.feign.GovOrgOpenFeignClient;
-import com.epmet.service.GridUserWorkService;
-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.Arrays;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 网格员例行工作
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2021-10-19
- */
-@Service
-public class GridUserWorkServiceImpl extends BaseServiceImpl implements GridUserWorkService {
-
- @Autowired
- private GovOrgOpenFeignClient govOrgOpenFeignClient;
-
- @Override
- public PageData page(Map params) {
- IPage page = baseDao.selectPage(
- getPage(params, FieldConstant.CREATED_TIME, false),
- getWrapper(params)
- );
- return getPageData(page, GridUserWorkDTO.class);
- }
-
- @Override
- public List list(Map params) {
- List entityList = baseDao.selectList(getWrapper(params));
-
- return ConvertUtils.sourceToTarget(entityList, GridUserWorkDTO.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 GridUserWorkDTO get(String id) {
- GridUserWorkEntity entity = baseDao.selectById(id);
- return ConvertUtils.sourceToTarget(entity, GridUserWorkDTO.class);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void save(GridUserWorkDTO dto) {
- GridUserWorkEntity entity = ConvertUtils.sourceToTarget(dto, GridUserWorkEntity.class);
- insert(entity);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void update(GridUserWorkDTO dto) {
- GridUserWorkEntity entity = ConvertUtils.sourceToTarget(dto, GridUserWorkEntity.class);
- updateById(entity);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void delete(String[] ids) {
- // 逻辑删除(@TableLogic 注解)
- baseDao.deleteBatchIds(Arrays.asList(ids));
- }
-
- /**
- * @Description 网格员例行工作
- * @param formDTO
- * @author zxc
- * @date 2021/10/19 1:35 下午
- */
- @Transactional(rollbackFor = Exception.class)
- @Override
- public void gridUserWork(GridUserWorkFormDTO formDTO) {
- GridUserWorkEntity entity = ConvertUtils.sourceToTarget(formDTO, GridUserWorkEntity.class);
- CustomerGridFormDTO gridFormDTO = new CustomerGridFormDTO();
- gridFormDTO.setGridId(formDTO.getGridId());
- Result gridBaseInfoData = govOrgOpenFeignClient.getGridBaseInfoByGridId(gridFormDTO);
- if (!gridBaseInfoData.success()){
- throw new RenException("查询网格基本信息失败......");
- }
- CustomerGridDTO gridBaseInfo = gridBaseInfoData.getData();
- entity.setGridName(gridBaseInfo.getGridName());
- // 暂时为 哈哈,后期缓存加上 gridCode在修改
- entity.setGridCode("哈哈");
- entity.setCustomerId(gridBaseInfo.getCustomerId());
- entity.setParentOrgId(gridBaseInfo.getPid());
- entity.setOrgName(gridBaseInfo.getAgencyName());
- entity.setPids(gridBaseInfo.getPids());
- baseDao.insert(entity);
- }
-
-}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java
new file mode 100644
index 0000000000..9a4b73bb26
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java
@@ -0,0 +1,132 @@
+/**
+ * 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.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.constant.StrConstant;
+import com.epmet.commons.tools.dto.form.DictListFormDTO;
+import com.epmet.commons.tools.dto.result.DictListResultDTO;
+import com.epmet.commons.tools.enums.DictTypeEnum;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.EpmetException;
+import com.epmet.commons.tools.security.user.LoginUserUtil;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dao.PatrolRoutineWorkDao;
+import com.epmet.dto.CustomerGridDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
+import com.epmet.dto.form.GridUserWorkFormDTO;
+import com.epmet.entity.PatrolRoutineWorkEntity;
+import com.epmet.entity.PatrolRoutineWorkTypeEntity;
+import com.epmet.feign.EpmetAdminOpenFeignClient;
+import com.epmet.feign.GovOrgOpenFeignClient;
+import com.epmet.service.PatrolRoutineWorkService;
+import com.epmet.service.PatrolRoutineWorkTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 巡查例行工作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-12-21
+ */
+@Service
+public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl implements PatrolRoutineWorkService {
+ @Autowired
+ private GovOrgOpenFeignClient govOrgOpenFeignClient;
+ @Autowired
+ private EpmetAdminOpenFeignClient adminOpenFeignClient;
+ @Autowired
+ private LoginUserUtil loginUserUtil;
+ @Autowired
+ PatrolRoutineWorkTypeService patrolRoutineWorkTypeService;
+
+ /**
+ * @Description 网格员例行工作
+ * @param formDTO
+ * @author zxc
+ * @date 2021/10/19 1:35 下午
+ */
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public void gridUserWork(GridUserWorkFormDTO formDTO) {
+ PatrolRoutineWorkEntity entity = ConvertUtils.sourceToTarget(formDTO, PatrolRoutineWorkEntity.class);
+
+ CustomerGridFormDTO gridFormDTO = new CustomerGridFormDTO();
+ gridFormDTO.setGridId(formDTO.getGridId());
+ Result gridBaseInfoData = govOrgOpenFeignClient.getGridBaseInfoByGridId(gridFormDTO);
+ if (!gridBaseInfoData.success()){
+ throw new EpmetException("查询网格基本信息失败......");
+ }
+ CustomerGridDTO gridBaseInfo = gridBaseInfoData.getData();
+ entity.setPids(gridBaseInfo.getPids());
+ //entity.setUserId(loginUserUtil.getLoginUserId());
+ //entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
+
+ entity.setUserId("loginUserUtil.getLoginUserId()");
+ entity.setCustomerId("loginUserUtil.getLoginUserCustomerId()");
+ baseDao.insert(entity);
+
+ DictListFormDTO param = new DictListFormDTO();
+ param.setDictType(DictTypeEnum.PATROL_WORK_TYPE.getCode());
+ Result> mapResult = adminOpenFeignClient.dictList(param);
+ if (mapResult == null || !mapResult.success() || CollectionUtils.isEmpty(mapResult.getData())){
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"例行工作类型字典获取失败!");
+ }
+ Map> dictMap = mapResult.getData().stream().collect(Collectors.groupingBy(DictListResultDTO::getPValue));
+
+ Map allPCodeMap = new HashMap<>();
+ dictMap.forEach((pCode,list)->{
+ if (NumConstant.ZERO_STR.equals(pCode)){
+ return;
+ }
+ list.forEach(dict->{
+ String code = dict.getValue();
+ StringBuilder stringBuilder = allPCodeMap.get(code);
+ if (stringBuilder == null){
+ stringBuilder = new StringBuilder();
+ allPCodeMap.put(code, stringBuilder);
+ }
+ stringBuilder.insert(dict.getPValue().length()/2,code).append(StrConstant.COLON);
+ });
+
+ });
+ List workTypeList = new ArrayList<>();
+ formDTO.getWorkTypeList().forEach(code->{
+ PatrolRoutineWorkTypeEntity typeEntity = new PatrolRoutineWorkTypeEntity();
+ typeEntity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
+ typeEntity.setRoutineWorkId(entity.getId());
+ typeEntity.setWorkTypeCode(code);
+ typeEntity.setAllPCode(allPCodeMap.get(code).toString());
+ workTypeList.add(typeEntity);
+ });
+ patrolRoutineWorkTypeService.insertBatch(workTypeList);
+
+ }
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkTypeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkTypeServiceImpl.java
new file mode 100644
index 0000000000..185d69ac4d
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkTypeServiceImpl.java
@@ -0,0 +1,36 @@
+/**
+ * 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.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.dao.PatrolRoutineWorkTypeDao;
+import com.epmet.entity.PatrolRoutineWorkTypeEntity;
+import com.epmet.service.PatrolRoutineWorkTypeService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 巡查例行工作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-12-21
+ */
+@Service
+public class PatrolRoutineWorkTypeServiceImpl extends BaseServiceImpl implements PatrolRoutineWorkTypeService {
+
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml
deleted file mode 100644
index 70467112b6..0000000000
--- a/epmet-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkDao.xml
new file mode 100644
index 0000000000..15dfb4836c
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkDao.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkTypeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkTypeDao.xml
new file mode 100644
index 0000000000..cec9ea0941
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkTypeDao.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From a6bf321d3537f79b2b11f47508cce94434635528 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Wed, 22 Dec 2021 09:40:08 +0800
Subject: [PATCH 08/12] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=BF=98=E4=B8=8D?=
=?UTF-8?q?=E8=A1=8C=20=E9=82=A3=E5=B0=B1=E8=BF=94=E5=9B=9E=E5=90=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/epmet/commons/tools/dto/result/DictListResultDTO.java | 2 --
1 file changed, 2 deletions(-)
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
index bc9b02c1da..6a49a6bf68 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
@@ -1,6 +1,5 @@
package com.epmet.commons.tools.dto.result;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@@ -15,7 +14,6 @@ public class DictListResultDTO implements Serializable {
private static final long serialVersionUID = 8618231166600518980L;
private String label;
private String value;
- @JsonIgnore
private String pValue;
private List children;
}
From 2f916a7fee775ad452ca97c59db696c4fb5e2a45 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Wed, 22 Dec 2021 10:20:25 +0800
Subject: [PATCH 09/12] =?UTF-8?q?=E5=A4=9A=E4=B8=80=E4=B8=AA=E5=B1=9E?=
=?UTF-8?q?=E6=80=A7=20=E6=80=95=E5=95=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/epmet/feign/EpmetAdminOpenFeignClient.java | 11 +++++++++++
.../fallback/EpmetAdminOpenFeignClientFallback.java | 6 ++++++
.../commons/tools/dto/result/DictTreeResultDTO.java | 2 --
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
index 6d7e1124dd..9068180318 100644
--- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
+++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
@@ -3,6 +3,7 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
+import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.CorsConfigResultDTO;
@@ -88,6 +89,16 @@ public interface EpmetAdminOpenFeignClient {
@PostMapping("/sys/dict/data/dictmap/{dictType}")
Result> dictMap(@PathVariable("dictType") String dictType);
+ /**
+ * 字典数据查询通用接口
+ * @Param dictType
+ * @Return {@link Result< Map < String, String>>}
+ * @Author zhaoqifeng
+ * @Date 2021/11/19 17:36
+ */
+ @PostMapping("/sys/dict/data/dictTree/{dictType}")
+ Result> dictTree(@PathVariable("dictType") String dictType);
+
@PostMapping("/sys/dict/data/dictlist")
Result> dictList(@RequestBody DictListFormDTO formDTO);
}
diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
index 6c16e8f3ae..110ba490e3 100644
--- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
+++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
@@ -3,6 +3,7 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
+import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
@@ -49,6 +50,11 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictMap", dictType);
}
+ @Override
+ public Result> dictTree(String dictType) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictTree", dictType);
+ }
+
@Override
public Result> dictList(DictListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictList", formDTO);
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
index 7314d941a8..c8aef8f93f 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
@@ -1,7 +1,6 @@
package com.epmet.commons.tools.dto.result;
import com.epmet.commons.tools.utils.TreeStringNode;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@@ -16,7 +15,6 @@ public class DictTreeResultDTO extends TreeStringNode impleme
/**
* 上级ID
*/
- @JsonIgnore
private String pid;
private String name;
}
From 97d6b702893974d2b25165e9f7a7dec01f1ae59e Mon Sep 17 00:00:00 2001
From: jianjun
Date: Wed, 22 Dec 2021 12:56:40 +0800
Subject: [PATCH 10/12] =?UTF-8?q?=E4=BE=8B=E8=A1=8C=E5=B7=A5=E4=BD=9C?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/epmet/dto/PatrolRoutineWorkDTO.java | 122 ------------------
.../epmet/dto/PatrolRoutineWorkTypeDTO.java | 91 -------------
...DTO.java => PatrolRoutineWorkFormDTO.java} | 22 ++--
.../PatrolRoutineWorkController.java | 12 +-
.../service/PatrolRoutineWorkService.java | 13 +-
.../impl/PatrolRoutineWorkServiceImpl.java | 100 +++++++++-----
6 files changed, 89 insertions(+), 271 deletions(-)
delete mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkDTO.java
delete mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkTypeDTO.java
rename epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/{GridUserWorkFormDTO.java => PatrolRoutineWorkFormDTO.java} (56%)
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkDTO.java
deleted file mode 100644
index d0c66c1a07..0000000000
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkDTO.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * 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 lombok.Data;
-
-import java.io.Serializable;
-import java.util.Date;
-
-
-/**
- * 巡查例行工作
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2021-12-21
- */
-@Data
-public class PatrolRoutineWorkDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 唯一标识
- */
- private String id;
-
- /**
- * 客户Id customer.id
- */
- private String customerId;
-
- /**
- * 网格表Id(CUSTOMER_GRID.id)【居民党员角色值为all,热心居民角色对应的网格Id】
- */
- private String gridId;
-
- /**
- * 网格所有上级id
- */
- private String pids;
-
- /**
- * 用户Id user.id
- */
- private String userId;
-
- /**
- * 事项名称
- */
- private String title;
-
- /**
- * 工作日期 格式为“YYYY-MM-DD”
- */
- private String happenTime;
-
- /**
- * 有无变动(异常)1:是、0:否
- */
- private Integer isNormal;
-
- /**
- * 工作内容
- */
- private String workContent;
-
- /**
- * 经度
- */
- private String longitude;
-
- /**
- * 纬度
- */
- private String latitude;
-
- /**
- * 删除标识:0.未删除 1.已删除
- */
- private Integer delFlag;
-
- /**
- * 乐观锁
- */
- private Integer revision;
-
- /**
- * 创建人
- */
- private String createdBy;
-
- /**
- * 创建时间
- */
- private Date createdTime;
-
- /**
- * 更新人
- */
- private String updatedBy;
-
- /**
- * 更新时间
- */
- private Date updatedTime;
-
-}
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkTypeDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkTypeDTO.java
deleted file mode 100644
index 505384ec36..0000000000
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PatrolRoutineWorkTypeDTO.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * 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-12-21
- */
-@Data
-public class PatrolRoutineWorkTypeDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 唯一标识
- */
- private String id;
-
- /**
- * 客户Id customer.id
- */
- private String customerId;
-
- /**
- * 例行工作Id
- */
- private String routineWorkId;
-
- /**
- * 例行工作字典项值;type:patrol_work_type
- */
- private String workTypeCode;
-
- /**
- * 所有上级类别code组合
- */
- private String allPCode;
-
- /**
- * 删除标识:0.未删除 1.已删除
- */
- private Integer 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-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolRoutineWorkFormDTO.java
similarity index 56%
rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java
rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolRoutineWorkFormDTO.java
index f9b029d423..520e04d105 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridUserWorkFormDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolRoutineWorkFormDTO.java
@@ -16,36 +16,39 @@ import java.util.List;
* @DESC
*/
@Data
-public class GridUserWorkFormDTO implements Serializable {
+public class PatrolRoutineWorkFormDTO implements Serializable {
private static final long serialVersionUID = 3411355616849866888L;
- public interface AddOrUpdateForm {}
+ public interface AddOrUpdateForm {
+ }
private String customerId;
- @NotBlank(message = "网格ID不能为空",groups = AddOrUpdateForm.class)
+ @NotBlank(message = "网格ID不能为空", groups = AddOrUpdateForm.class)
private String gridId;
- @NotBlank(message = "事项名称不能为空",groups = AddOrUpdateForm.class)
+ @NotBlank(message = "事项名称不能为空", groups = AddOrUpdateForm.class)
private String title;
- @NotEmpty(message = "例行工作类型不能为空",groups = AddOrUpdateForm.class)
+ @NotEmpty(message = "例行工作类型不能为空", groups = AddOrUpdateForm.class)
private List workTypeList;
- @Range(min = 0,max = 1, message = "有无变动(异常)不能为空",groups = AddOrUpdateForm.class)
+ @Range(min = 0, max = 1, message = "有无变动(异常)格式错误", groups = AddOrUpdateForm.class)
+ @NotNull(message = "有无变动(异常)不能为空", groups = AddOrUpdateForm.class)
private Integer isNormal;
@JsonFormat(pattern = "yyyy-MM-dd")
- @NotNull(message = "发生时间不能为空",groups = AddOrUpdateForm.class)
+ @NotNull(message = "发生时间不能为空", groups = AddOrUpdateForm.class)
private String happenTime;
- @NotBlank(message = "工作简介不能为空",groups = AddOrUpdateForm.class)
+ @NotBlank(message = "工作简介不能为空", groups = AddOrUpdateForm.class)
private String workContent;
- @NotBlank(message = "工作地点不能为空",groups = AddOrUpdateForm.class)
+ @NotBlank(message = "工作地点不能为空", groups = AddOrUpdateForm.class)
private String address;
+
/**
* 基础信息ID【相关信息】暂时没有
*/
@@ -60,5 +63,4 @@ public class GridUserWorkFormDTO implements Serializable {
private String latitude;
-
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
index fada3dca9a..aa970dee00 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
@@ -3,13 +3,13 @@ package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
-import com.epmet.dto.form.GridUserWorkFormDTO;
+import com.epmet.dto.form.PatrolRoutineWorkFormDTO;
import com.epmet.service.PatrolRoutineWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
- * 网格员例行工作
+ * 例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-19
@@ -22,16 +22,16 @@ public class PatrolRoutineWorkController {
private PatrolRoutineWorkService gridUserWorkService;
/**
- * @Description 网格员例行工作
+ * @Description 添加例行工作
* @param formDTO
* @author zxc
* @date 2021/10/19 1:35 下午
*/
@NoRepeatSubmit
@PostMapping("add")
- public Result gridUserWork( @RequestBody GridUserWorkFormDTO formDTO){
- ValidatorUtils.validateEntity(formDTO, GridUserWorkFormDTO.AddOrUpdateForm.class);
- gridUserWorkService.gridUserWork(formDTO);
+ public Result gridUserWork( @RequestBody PatrolRoutineWorkFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO, PatrolRoutineWorkFormDTO.AddOrUpdateForm.class);
+ gridUserWorkService.add(formDTO);
return new Result().ok(true);
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java
index f463510d5f..f30a19f244 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java
@@ -18,14 +18,9 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
-import com.epmet.commons.tools.page.PageData;
-import com.epmet.dto.PatrolRoutineWorkDTO;
-import com.epmet.dto.form.GridUserWorkFormDTO;
+import com.epmet.dto.form.PatrolRoutineWorkFormDTO;
import com.epmet.entity.PatrolRoutineWorkEntity;
-import java.util.List;
-import java.util.Map;
-
/**
* 巡查例行工作
*
@@ -34,5 +29,9 @@ import java.util.Map;
*/
public interface PatrolRoutineWorkService extends BaseService {
- void gridUserWork(GridUserWorkFormDTO formDTO);
+ /**
+ * desc:添加例行工作
+ * @param formDTO
+ */
+ void add(PatrolRoutineWorkFormDTO formDTO);
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java
index 9a4b73bb26..91e2c520df 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java
@@ -17,11 +17,11 @@
package com.epmet.service.impl;
+import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
-import com.epmet.commons.tools.dto.form.DictListFormDTO;
-import com.epmet.commons.tools.dto.result.DictListResultDTO;
+import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
@@ -31,13 +31,14 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.PatrolRoutineWorkDao;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
-import com.epmet.dto.form.GridUserWorkFormDTO;
+import com.epmet.dto.form.PatrolRoutineWorkFormDTO;
import com.epmet.entity.PatrolRoutineWorkEntity;
import com.epmet.entity.PatrolRoutineWorkTypeEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.PatrolRoutineWorkService;
import com.epmet.service.PatrolRoutineWorkTypeService;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -47,7 +48,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.stream.Collectors;
/**
* 巡查例行工作
@@ -55,6 +55,7 @@ import java.util.stream.Collectors;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-21
*/
+@Slf4j
@Service
public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl implements PatrolRoutineWorkService {
@Autowired
@@ -62,71 +63,100 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl gridBaseInfoData = govOrgOpenFeignClient.getGridBaseInfoByGridId(gridFormDTO);
- if (!gridBaseInfoData.success()){
+ if (!gridBaseInfoData.success()) {
throw new EpmetException("查询网格基本信息失败......");
}
CustomerGridDTO gridBaseInfo = gridBaseInfoData.getData();
entity.setPids(gridBaseInfo.getPids());
- //entity.setUserId(loginUserUtil.getLoginUserId());
- //entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
+ entity.setUserId(loginUserUtil.getLoginUserId());
+ entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
- entity.setUserId("loginUserUtil.getLoginUserId()");
- entity.setCustomerId("loginUserUtil.getLoginUserCustomerId()");
+ //entity.setUserId("loginUserUtil.getLoginUserId()");
+ //entity.setCustomerId("loginUserUtil.getLoginUserCustomerId()");
baseDao.insert(entity);
- DictListFormDTO param = new DictListFormDTO();
- param.setDictType(DictTypeEnum.PATROL_WORK_TYPE.getCode());
- Result> mapResult = adminOpenFeignClient.dictList(param);
- if (mapResult == null || !mapResult.success() || CollectionUtils.isEmpty(mapResult.getData())){
- throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"例行工作类型字典获取失败!");
+ Result> mapResult = adminOpenFeignClient.dictTree(DictTypeEnum.PATROL_WORK_TYPE.getCode());
+ if (mapResult == null || !mapResult.success() || CollectionUtils.isEmpty(mapResult.getData())) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "例行工作类型字典获取失败!");
}
- Map> dictMap = mapResult.getData().stream().collect(Collectors.groupingBy(DictListResultDTO::getPValue));
+ List dictTree = mapResult.getData();
- Map allPCodeMap = new HashMap<>();
- dictMap.forEach((pCode,list)->{
- if (NumConstant.ZERO_STR.equals(pCode)){
- return;
- }
- list.forEach(dict->{
- String code = dict.getValue();
- StringBuilder stringBuilder = allPCodeMap.get(code);
- if (stringBuilder == null){
- stringBuilder = new StringBuilder();
- allPCodeMap.put(code, stringBuilder);
- }
- stringBuilder.insert(dict.getPValue().length()/2,code).append(StrConstant.COLON);
- });
+ Map pidsMap = new HashMap<>();
+
+ dictTree.forEach(dto -> buildAllParentIdPath(pidsMap, dto));
- });
List workTypeList = new ArrayList<>();
- formDTO.getWorkTypeList().forEach(code->{
+ formDTO.getWorkTypeList().forEach(code -> {
PatrolRoutineWorkTypeEntity typeEntity = new PatrolRoutineWorkTypeEntity();
typeEntity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
typeEntity.setRoutineWorkId(entity.getId());
typeEntity.setWorkTypeCode(code);
- typeEntity.setAllPCode(allPCodeMap.get(code).toString());
+ StringBuilder pids = pidsMap.get(code);
+ typeEntity.setAllPCode(pids.length() == 0 ? NumConstant.ZERO_STR : pids.toString());
workTypeList.add(typeEntity);
});
patrolRoutineWorkTypeService.insertBatch(workTypeList);
}
+ /**
+ * desc:递归遍历树形结构 构建pids 根节点pids 为空字符串
+ *
+ * @param result 构建的结果
+ * @param crurent
+ */
+ private static void buildAllParentIdPath(Map result, DictTreeResultDTO crurent) {
+ String id = crurent.getId();
+ String pid = crurent.getPid();
+
+ StringBuilder pidsPath = new StringBuilder();
+ StringBuilder pidSb = result.get(pid);
+ if (pidSb == null) {
+ pidSb = new StringBuilder();
+ } else if (pidSb.indexOf(pid) == -1) {
+ if (pidSb.length() > 0) {
+ pidSb.append(StrConstant.COLON);
+ }
+ pidSb.append(pid);
+ }
+ pidsPath.append(pidSb);
+ result.put(id, pidsPath);
+
+ log.debug("id:" + id + " pids:" + pidsPath.toString());
+
+ List children = crurent.getChildren();
+ if (children != null) {
+ crurent.getChildren().forEach(item -> buildAllParentIdPath(result, item));
+ }
+ }
+
+ public static void main(String[] args) {
+ String str = "[{\"id\":\"01\",\"pid\":\"0\",\"children\":[{\"id\":\"0101\",\"pid\":\"01\",\"children\":[{\"id\":\"010101\",\"pid\":\"0101\",\"children\":[],\"name\":\"出租房屋巡查\"}],\"name\":\"出租房屋巡查\"},{\"id\":\"0102\",\"pid\":\"01\",\"children\":[],\"name\":\"重点场所巡查\"},{\"id\":\"0103\",\"pid\":\"01\",\"children\":[],\"name\":\"宗教活动\"},{\"id\":\"0199\",\"pid\":\"01\",\"children\":[],\"name\":\"其他\"}],\"name\":\"重点巡查\"},{\"id\":\"02\",\"pid\":\"0\",\"children\":[{\"id\":\"0201\",\"pid\":\"02\",\"children\":[],\"name\":\"刑满释放人员\"},{\"id\":\"0202\",\"pid\":\"02\",\"children\":[],\"name\":\"社区矫正\"},{\"id\":\"0203\",\"pid\":\"02\",\"children\":[],\"name\":\"吸毒人员\"},{\"id\":\"0204\",\"pid\":\"02\",\"children\":[],\"name\":\"信访人员\"},{\"id\":\"0205\",\"pid\":\"02\",\"children\":[],\"name\":\"重点青少年\"},{\"id\":\"0206\",\"pid\":\"02\",\"children\":[],\"name\":\"精神障碍者\"}],\"name\":\"特殊人群\"},{\"id\":\"09\",\"pid\":\"0\",\"children\":[{\"id\":\"0901\",\"pid\":\"09\",\"children\":[],\"name\":\"公共服务\"},{\"id\":\"0902\",\"pid\":\"09\",\"children\":[],\"name\":\"权益保障\"},{\"id\":\"0903\",\"pid\":\"09\",\"children\":[],\"name\":\"政策宣传\"},{\"id\":\"0904\",\"pid\":\"09\",\"children\":[],\"name\":\"便利服务\"},{\"id\":\"0999\",\"pid\":\"09\",\"children\":[],\"name\":\"其他\"}],\"name\":\"为民服务\"}]";
+ List dtos = JSON.parseArray(str, DictTreeResultDTO.class);
+ Map result = new HashMap<>();
+ dtos.forEach(dto -> {
+ buildAllParentIdPath(result, dto);
+ });
+ System.out.println(result.get("010101"));
+ System.out.println(JSON.toJSONString(result));
+ }
+
}
From 34ca3d902afb3d087683548ad4e2c6e5663a4981 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Wed, 22 Dec 2021 13:02:50 +0800
Subject: [PATCH 11/12] =?UTF-8?q?=E4=BE=8B=E8=A1=8C=E5=B7=A5=E4=BD=9C=20fl?=
=?UTF-8?q?yway=20=E8=84=9A=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../migration/V0.0.8__add_dict_data_pid.sql | 27 ++++++++++++++
.../migration/V0.0.20__user_routine_work.sql | 35 +++++++++++++++++++
2 files changed, 62 insertions(+)
create mode 100644 epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.8__add_dict_data_pid.sql
create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.20__user_routine_work.sql
diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.8__add_dict_data_pid.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.8__add_dict_data_pid.sql
new file mode 100644
index 0000000000..864cc905d1
--- /dev/null
+++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.8__add_dict_data_pid.sql
@@ -0,0 +1,27 @@
+-- 添加pid (dict_p_value) 让字典支持 树形结构
+ALTER TABLE `epmet_admin`.`sys_dict_data`
+ ADD COLUMN `dict_p_value` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '父级value项;默认为0' AFTER `dict_value`;
+ALTER TABLE `epmet_admin`.`sys_dict_data`
+ MODIFY COLUMN `dict_value` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典值' AFTER `dict_label`;
+
+
+INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473150812296318978, 'patrol_work_type', '例行工作分类', '网格员巡查-例行工作事项分类', 13, 1067246875800000001, '2021-12-21 12:40:45', 12, '2021-12-21 17:37:12');
+
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473151790785499137, 1473150812296318978, '重点巡查', '01', '0', '', 1, NULL, NULL, 1, '2021-12-21 14:17:14');
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473175635001085953, 1473150812296318978, '出租房屋巡查', '0101', '01', '', 1, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473175848537296897, 1473150812296318978, '重点场所巡查', '0102', '01', '', 2, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473175904669667329, 1473150812296318978, '宗教活动', '0103', '01', '', 3, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473175977868660738, 1473150812296318978, '其他', '0199', '01', '', 99, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473151862784921602, 1473150812296318978, '特殊人群', '02', '0', '', 2, NULL, NULL, 1, '2021-12-21 14:17:24');
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176029219524610, 1473150812296318978, '刑满释放人员', '0201', '02', '', 1, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176085809074178, 1473150812296318978, '社区矫正', '0202', '02', '', 2, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176129127845889, 1473150812296318978, '吸毒人员', '0203', '02', '', 3, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176201798356994, 1473150812296318978, '信访人员', '0204', '02', '', 4, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176249558896642, 1473150812296318978, '重点青少年', '0205', '02', '', 5, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176305758375937, 1473150812296318978, '精神障碍者', '0206', '02', '', 6, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473151924881592321, 1473150812296318978, '为民服务', '09', '0', '', 3, NULL, NULL, 1, '2021-12-21 14:20:06');
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176393352220673, 1473150812296318978, '公共服务', '0901', '09', '', 1, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176479897489410, 1473150812296318978, '权益保障', '0902', '09', '', 2, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176534641545218, 1473150812296318978, '政策宣传', '0903', '09', '', 3, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176583006064641, 1473150812296318978, '便利服务', '0904', '09', '', 4, NULL, NULL, NULL, NULL);
+INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176670985785345, 1473150812296318978, '其他', '0999', '09', '', 99, NULL, NULL, NULL, NULL);
diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.20__user_routine_work.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.20__user_routine_work.sql
new file mode 100644
index 0000000000..662780f87e
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.20__user_routine_work.sql
@@ -0,0 +1,35 @@
+CREATE TABLE `patrol_routine_work` (
+ `ID` varchar(64) NOT NULL COMMENT '唯一标识',
+ `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id',
+ `GRID_ID` varchar(64) NOT NULL COMMENT '网格表Id(CUSTOMER_GRID.id)【居民党员角色值为all,热心居民角色对应的网格Id】',
+ `PIDS` varchar(512) NOT NULL COMMENT '网格所有上级id',
+ `USER_ID` varchar(64) NOT NULL COMMENT '用户Id user.id',
+ `TITLE` varchar(128) NOT NULL COMMENT '事项名称',
+ `HAPPEN_TIME` varchar(32) NOT NULL COMMENT '工作日期 格式为“YYYY-MM-DD”',
+ `IS_NORMAL` tinyint(1) NOT NULL COMMENT '有无变动(异常)1:是、0:否',
+ `WORK_CONTENT` varchar(1024) NOT NULL COMMENT '工作内容',
+ `LONGITUDE` varchar(32) DEFAULT '' COMMENT '经度',
+ `LATITUDE` varchar(32) DEFAULT '' COMMENT '纬度',
+ `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
+ `REVISION` int(11) NOT NULL COMMENT '乐观锁',
+ `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
+ `CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
+ `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
+ `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='巡查例行工作';
+CREATE TABLE `patrol_routine_work_type` (
+ `ID` varchar(64) NOT NULL COMMENT '唯一标识',
+ `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id',
+ `ROUTINE_WORK_ID` varchar(64) NOT NULL COMMENT '例行工作Id',
+ `WORK_TYPE_CODE` varchar(32) NOT NULL COMMENT '例行工作字典项值;type:patrol_work_type',
+ `ALL_P_CODE` varchar(256) NOT NULL COMMENT '所有上级类别code组合',
+ `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
+ `REVISION` int(11) NOT NULL COMMENT '乐观锁',
+ `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
+ `CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
+ `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
+ `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
+ PRIMARY KEY (`ID`) USING BTREE,
+ KEY `idx_work_id` (`ROUTINE_WORK_ID`) USING BTREE COMMENT '主表id'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='巡查例行工作分类';
From fe4ef7800150f1e807102e9ac897f1b1b5fee4b0 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Wed, 22 Dec 2021 13:05:50 +0800
Subject: [PATCH 12/12] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=8E=9F=E6=9C=89?=
=?UTF-8?q?=E7=9A=84=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/resources/mapper/SysDictDataDao.xml | 3 +--
.../com/epmet/commons/tools/dto/result/DictListResultDTO.java | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
index f735716edd..ff1273d4ae 100644
--- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
+++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
@@ -10,8 +10,7 @@
SELECT
a.dict_label label,
- a.dict_value `value`,
- a.dict_p_value pValue
+ a.dict_value `value`
FROM
sys_dict_data a
INNER JOIN sys_dict_type b ON a.dict_type_id = b.id
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
index 6a49a6bf68..cc85c39027 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
@@ -14,6 +14,5 @@ public class DictListResultDTO implements Serializable {
private static final long serialVersionUID = 8618231166600518980L;
private String label;
private String value;
- private String pValue;
private List children;
}