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/56] =?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/56] =?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/56] =?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/56] =?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/56] =?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/56] =?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/56] =?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/56] =?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/56] =?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/56] =?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/56] =?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/56] =?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;
}
From 5efb0bf3e1ad204f785e0d75c1d095532a1ea4c3 Mon Sep 17 00:00:00 2001
From: wangxianzhang
Date: Thu, 23 Dec 2021 14:16:52 +0800
Subject: [PATCH 13/56] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../data-report-server/deploy/docker-compose-prod.yml | 2 +-
epmet-module/data-report/data-report-server/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml
index 0f4b2974ec..b883c42d9f 100644
--- a/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml
+++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml
@@ -2,7 +2,7 @@ version: "3.7"
services:
data-report-server:
container_name: data-report-server-prod
- image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.195
+ image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.196
ports:
- "8108:8108"
network_mode: host # 使用现有网络
diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml
index 84e5f4d96f..6651fb7c7a 100644
--- a/epmet-module/data-report/data-report-server/pom.xml
+++ b/epmet-module/data-report/data-report-server/pom.xml
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- 0.3.195
+ 0.3.196
data-report-server
From d8b72c3758d84ffc6d91bc96968774c37372fa24 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Thu, 23 Dec 2021 18:18:14 +0800
Subject: [PATCH 14/56] =?UTF-8?q?=E6=8A=8A=E5=AD=97=E5=85=B8=E8=A1=A8?=
=?UTF-8?q?=E7=9A=84=E4=B8=A4=E4=B8=AA=E8=A1=A8=E6=94=B9=E6=88=90=E6=88=91?=
=?UTF-8?q?=E4=BB=AC=E8=BF=99=E7=A7=8D=E7=BB=93=E6=9E=84=E7=9A=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/dto/SysDictDataDTO.java | 4 ++--
.../java/com/epmet/dto/SysDictTypeDTO.java | 4 ++--
.../com/epmet/entity/SysDictDataEntity.java | 22 +++++-------------
.../com/epmet/entity/SysDictTypeEntity.java | 23 ++++++-------------
4 files changed, 17 insertions(+), 36 deletions(-)
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 6fe61bc0b1..ae7d66cb9f 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
@@ -50,8 +50,8 @@ public class SysDictDataDTO implements Serializable {
private Integer sort;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
- private Date createDate;
+ private Date createdDate;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
- private Date updateDate;
+ private Date updatedDate;
}
diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictTypeDTO.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictTypeDTO.java
index 503078e1b5..fba0441161 100644
--- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictTypeDTO.java
+++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictTypeDTO.java
@@ -47,8 +47,8 @@ public class SysDictTypeDTO implements Serializable {
private Integer sort;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
- private Date createDate;
+ private Date createdDate;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
- private Date updateDate;
+ private Date updatedDate;
}
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 588a8debb2..b02d4fb4f3 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
@@ -8,15 +8,13 @@
package com.epmet.entity;
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
-import com.epmet.commons.mybatis.entity.BaseEntity;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
-import java.util.Date;
-
/**
* 数据字典
*
@@ -25,8 +23,10 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("sys_dict_data")
-public class SysDictDataEntity extends BaseEntity {
+public class SysDictDataEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
+ @TableId(type = IdType.ID_WORKER_STR)
+ private String id;
/**
* 字典类型ID
*/
@@ -51,14 +51,4 @@ public class SysDictDataEntity extends BaseEntity {
* 排序
*/
private Integer sort;
- /**
- * 更新者
- */
- @TableField(fill = FieldFill.INSERT_UPDATE)
- private Long updater;
- /**
- * 更新时间
- */
- @TableField(fill = FieldFill.INSERT_UPDATE)
- private Date updateDate;
}
diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictTypeEntity.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictTypeEntity.java
index d3e2f68a87..8640c2a7bf 100644
--- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictTypeEntity.java
+++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictTypeEntity.java
@@ -8,15 +8,13 @@
package com.epmet.entity;
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
-import com.epmet.commons.mybatis.entity.BaseEntity;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
-import java.util.Date;
-
/**
* 字典类型
*
@@ -25,8 +23,11 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("sys_dict_type")
-public class SysDictTypeEntity extends BaseEntity {
+public class SysDictTypeEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
+
+ @TableId(type = IdType.ID_WORKER_STR)
+ private String id;
/**
* 字典类型
*/
@@ -43,14 +44,4 @@ public class SysDictTypeEntity extends BaseEntity {
* 排序
*/
private Integer sort;
- /**
- * 更新者
- */
- @TableField(fill = FieldFill.INSERT_UPDATE)
- private Long updater;
- /**
- * 更新时间
- */
- @TableField(fill = FieldFill.INSERT_UPDATE)
- private Date updateDate;
}
From 4b8a6d36f16f82a1793e7645cdc9ac801634b2a8 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Thu, 23 Dec 2021 18:29:55 +0800
Subject: [PATCH 15/56] =?UTF-8?q?=E6=8A=8A=E5=AD=97=E5=85=B8=E8=A1=A8?=
=?UTF-8?q?=E7=9A=84=E4=B8=A4=E4=B8=AA=E8=A1=A8=E6=94=B9=E6=88=90=E6=88=91?=
=?UTF-8?q?=E4=BB=AC=E8=BF=99=E7=A7=8D=E7=BB=93=E6=9E=84=E7=9A=842?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/java/com/epmet/dto/SysDictDataDTO.java | 6 +++---
.../src/main/java/com/epmet/dto/SysDictTypeDTO.java | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
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 ae7d66cb9f..3664870194 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
@@ -32,7 +32,7 @@ public class SysDictDataDTO implements Serializable {
@Null(message="{id.null}", groups = AddGroup.class)
@NotNull(message="{id.require}", groups = UpdateGroup.class)
- private Long id;
+ private String id;
@NotNull(message="{sysdict.type.require}", groups = DefaultGroup.class)
private Long dictTypeId;
@@ -50,8 +50,8 @@ public class SysDictDataDTO implements Serializable {
private Integer sort;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
- private Date createdDate;
+ private Date createdTime;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
- private Date updatedDate;
+ private Date updatedTime;
}
diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictTypeDTO.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictTypeDTO.java
index fba0441161..4fd3c654f4 100644
--- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictTypeDTO.java
+++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictTypeDTO.java
@@ -33,7 +33,7 @@ public class SysDictTypeDTO implements Serializable {
@Null(message="{id.null}", groups = AddGroup.class)
@NotNull(message="{id.require}", groups = UpdateGroup.class)
- private Long id;
+ private String id;
@NotBlank(message="{sysdict.type.require}", groups = DefaultGroup.class)
private String dictType;
@@ -47,8 +47,8 @@ public class SysDictTypeDTO implements Serializable {
private Integer sort;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
- private Date createdDate;
+ private Date createdTime;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
- private Date updatedDate;
+ private Date updatedTime;
}
From 642cdfd4aea312a38ccad6d6214b13093ff8abf7 Mon Sep 17 00:00:00 2001
From: sunyuchao
Date: Fri, 24 Dec 2021 10:34:29 +0800
Subject: [PATCH 16/56] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/service/impl/ResiEventReplyServiceImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java
index 1521c76bc6..7a0b19a9fc 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java
@@ -293,7 +293,7 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl
Date: Fri, 24 Dec 2021 10:35:52 +0800
Subject: [PATCH 17/56] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=96=B9=E5=8D=95?=
=?UTF-8?q?=E4=BD=8D=E5=90=8D=E7=A7=B0=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../service/impl/IcCommunitySelfOrganizationServiceImpl.java | 5 ++++-
.../java/com/epmet/service/impl/IcPartyUnitServiceImpl.java | 5 ++++-
.../java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java | 5 ++++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
index 5a5cd89fe0..c73d8dff56 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
@@ -401,7 +401,10 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl queryListById(List communityOrgIds) {
- return baseDao.selectBatchIds(communityOrgIds);
+ if(CollectionUtils.isNotEmpty(communityOrgIds)){
+ return baseDao.selectBatchIds(communityOrgIds);
+ }
+ return Collections.EMPTY_LIST;
}
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
index 7f18773e78..4141ceb9b6 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
@@ -454,7 +454,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl queryListById(List partyUnitIds) {
- return baseDao.selectBatchIds(partyUnitIds);
+ if(CollectionUtils.isNotEmpty(partyUnitIds)){
+ return baseDao.selectBatchIds(partyUnitIds);
+ }
+ return Collections.EMPTY_LIST;
}
private String getServiceMatter(Map map, String matter) {
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
index 5827a15107..52193bb4df 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
@@ -270,7 +270,10 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl queryListById(List socialOrgIds) {
- return baseDao.selectBatchIds(socialOrgIds);
+ if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(socialOrgIds)){
+ return baseDao.selectBatchIds(socialOrgIds);
+ }
+ return Collections.EMPTY_LIST;
}
}
\ No newline at end of file
From 63b99bc7c02c19280abc4ad636c54973def20fed Mon Sep 17 00:00:00 2001
From: zxc <1272811460@qq.com>
Date: Fri, 24 Dec 2021 10:42:48 +0800
Subject: [PATCH 18/56] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=AB=AF?=
=?UTF-8?q?=E9=A2=84=E7=BA=A6=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../form/AppointmentRecordMiniFormDTO.java | 22 +++++++++++++++++++
.../result/AppointmentRecordResultDTO.java | 3 +++
.../IcPartyServiceCenterController.java | 12 ++++++++++
.../dao/IcMatterAppointmentRecordDao.java | 9 ++++++++
.../service/IcPartyServiceCenterService.java | 8 +++++++
.../impl/IcPartyServiceCenterServiceImpl.java | 15 +++++++++++++
.../mapper/IcMatterAppointmentRecordDao.xml | 18 +++++++++++++++
7 files changed, 87 insertions(+)
create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordMiniFormDTO.java
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordMiniFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordMiniFormDTO.java
new file mode 100644
index 0000000000..b3a14cf11b
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordMiniFormDTO.java
@@ -0,0 +1,22 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @DateTime 2021/12/24 10:38 上午
+ * @DESC
+ */
+@Data
+public class AppointmentRecordMiniFormDTO implements Serializable {
+
+ private static final long serialVersionUID = -2963684994195809536L;
+
+ public interface AppointmentRecordMiniForm{}
+
+ @NotBlank(message = "gridId不能为空",groups = AppointmentRecordMiniForm.class)
+ private String gridId;
+}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java
index 84813a4f47..4858babc52 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java
@@ -47,6 +47,8 @@ public class AppointmentRecordResultDTO implements Serializable {
*/
private List appointmentTime;
+ private String appointmentDate;
+
@JsonIgnore
private String timeId;
@@ -58,5 +60,6 @@ public class AppointmentRecordResultDTO implements Serializable {
this.remark = "";
this.appointmentTime = new ArrayList<>();
this.recordId = "";
+ this.appointmentDate = "";
}
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
index 1fb82337a5..f6071938ce 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
@@ -217,5 +217,17 @@ public class IcPartyServiceCenterController {
return new Result>().ok(icPartyServiceCenterService.getAllMatters(formDTO));
}
+ /**
+ * @Description 小程序端预约记录
+ * @param formDTO
+ * @author zxc
+ * @date 2021/12/24 10:18 上午
+ */
+ @PostMapping("appointmentrecordmini")
+ public Result> appointmentRecordMini(@RequestBody AppointmentRecordMiniFormDTO formDTO,@LoginUser TokenDto tokenDto){
+ ValidatorUtils.validateEntity(formDTO,AppointmentRecordMiniFormDTO.AppointmentRecordMiniForm.class);
+ return new Result>().ok(icPartyServiceCenterService.appointmentRecordMini(formDTO,tokenDto));
+ }
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java
index 0b118216bb..d501c97389 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java
@@ -44,6 +44,15 @@ public interface IcMatterAppointmentRecordDao extends BaseDao appointmentRecord(@Param("matterId")String matterId,@Param("date")String date);
+ /**
+ * @Description 小程序端预约列表
+ * @param orgId
+ * @param userId
+ * @author zxc
+ * @date 2021/12/24 10:25 上午
+ */
+ List appointmentRecordMini(@Param("orgId")String orgId,@Param("userId")String userId);
+
/**
* @Description 查询事项是不是存在预约记录
* @param matterIds
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
index 1c0e805806..3a4cbcec4c 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
@@ -175,4 +175,12 @@ public interface IcPartyServiceCenterService extends BaseService getAllMatters(AllMattersFormDTO formDTO);
+ /**
+ * @Description 小程序端预约记录
+ * @param tokenDto
+ * @author zxc
+ * @date 2021/12/24 10:18 上午
+ */
+ List appointmentRecordMini(AppointmentRecordMiniFormDTO formDTO,TokenDto tokenDto);
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
index c9410e55f9..bba2cb0455 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
@@ -464,6 +464,21 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl();
}
+ /**
+ * @Description 小程序端预约记录
+ * @param tokenDto
+ * @author zxc
+ * @date 2021/12/24 10:18 上午
+ */
+ @Override
+ public List appointmentRecordMini(AppointmentRecordMiniFormDTO formDTO,TokenDto tokenDto) {
+ List result = matterAppointmentRecordDao.appointmentRecordMini(formDTO.getGridId(), tokenDto.getUserId());
+ if (CollectionUtils.isNotEmpty(result)){
+ return result;
+ }
+ return new ArrayList<>();
+ }
+
public List getTimeList(String start,String end,Integer interval){
List result = new ArrayList<>();
List intervalTimeList = getIntervalTimeList(start, end, interval);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml
index 3b5f960894..3709847fd8 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml
@@ -45,4 +45,22 @@
GROUP BY matterId
+
+
+
+ SELECT
+ ar.APPOINTMENT_NAME,
+ ar.APPOINTMENT_PHONE,
+ ar.REMARK,
+ ar.TIME_ID,
+ cm.MATTER_NAME,
+ ar.ID AS recordId,
+ ar.APPOINTMENT_DATE
+ FROM ic_matter_appointment_record ar
+ LEFT JOIN ic_party_service_center_matter cm ON (cm.ID = ar.MATTER_ID AND cm.DEL_FLAG = 0)
+ WHERE ar.DEL_FLAG = 0
+ AND ar.ORG_ID = #{orgId}
+ AND ar.CREATED_BY = #{userId}
+ AND ar.`STATUS` = 'appointing'
+
\ No newline at end of file
From e1b100367818e21d33676109729dc44d1e0851e0 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Fri, 24 Dec 2021 10:47:16 +0800
Subject: [PATCH 19/56] =?UTF-8?q?=E6=9C=80=E8=BF=91=E9=A2=84=E7=BA=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/epmet/service/impl/IcUserDemandRecServiceImpl.java | 4 +++-
.../src/main/resources/mapper/IcResiDemandDictDao.xml | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index 3b46ccb3a8..3ef872f211 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -1073,7 +1073,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImplo.toString()).collect(Collectors.toList());
+ return baseDao.selectObjs(queryWrapper).stream().map(o->o.toString()).collect(Collectors.toList());
}
/**
@@ -1250,6 +1250,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl
select
- ID,
+ ID as categoryId,
CATEGORY_CODE,
PARENT_CODE,
CATEGORY_NAME,
From 8d7a3cf2c4c454a084580e6de38613269c55dbc5 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Fri, 24 Dec 2021 11:12:19 +0800
Subject: [PATCH 20/56] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=9C=80=E6=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/ResiDemandController.java | 10 +-
.../impl/IcUserDemandRecServiceImpl.java | 122 +++++++++---------
2 files changed, 69 insertions(+), 63 deletions(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index 39d205bdca..44d27e5793 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -156,14 +156,16 @@ public class ResiDemandController {
/**
* 居民端-我的需求(待处理,处理中,已完成,已取消)
- * @param tokenDto
+ * @param tokenDto @LoginUser TokenDto tokenDto,
* @param formDTO
* @return
*/
@PostMapping("mydemand")
- public Result> queryMyDemand(@LoginUser TokenDto tokenDto, @RequestBody ResiClientMyDemandFormDTO formDTO){
- formDTO.setUserId(tokenDto.getUserId());
- formDTO.setCustomerId(tokenDto.getCustomerId());
+ public Result> queryMyDemand( @RequestBody ResiClientMyDemandFormDTO formDTO){
+ // formDTO.setUserId(tokenDto.getUserId());
+ // formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId("cebe59b05d02715141762211bf57734f");
+ formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class,ResiClientMyDemandFormDTO.AddUserInternalGroup.class);
return new Result>().ok(icUserDemandRecService.queryMyDemandForResiClient(formDTO));
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index 3ef872f211..8c3ade3df5 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -266,7 +266,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userInfoMap=new HashMap<>();
- Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
+ Set userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
if(CollectionUtils.isNotEmpty(userIdList)){
Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
@@ -734,7 +734,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userInfoMap=new HashMap<>();
- Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
+ Set userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
if(CollectionUtils.isNotEmpty(userIdList)){
Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
@@ -1091,48 +1091,50 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl list=result.getList();
if (CollectionUtils.isNotEmpty(list)) {
//1、服务方(社会组织、社区自组织、区域化党建单位)单位名称,负责人姓名,负责人手机号
- List partyUnitIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.PARTY_UNIT)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
+ List partyUnitIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.PARTY_UNIT)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map partyUnitMap =getPartyUnitMap(partyUnitIds);
- List socialOrgIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.SOCIAL_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
+ List socialOrgIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.SOCIAL_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map socialOrgMap=getSocialOrgMap(socialOrgIds);
- List communityOrgIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.COMMUNITY_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
+ List communityOrgIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.COMMUNITY_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map communityOrgMap=getCommunityOrgMap(communityOrgIds);
//2、志愿者姓名、手机号
- Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet());
+ Set userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet());
Map userInfoMap=getVolunteerMap(userIdList);
for (ResiClientMyDemandResDTO resDto : list) {
//3、查询分类名称
IcResiDemandDictEntity demandDict = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode());
resDto.setCategoryName(null != demandDict ? demandDict.getCategoryName() : StrConstant.EPMETY_STR);
- switch (resDto.getServiceType())
- {
- case UserDemandConstant.PARTY_UNIT:
- resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
- resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
- resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
- break;
- case UserDemandConstant.SOCIAL_ORG:
- resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
- resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
- resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
- break;
- case UserDemandConstant.COMMUNITY_ORG:
- resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
- resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
- resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
- break;
- case UserDemandConstant.VOLUNTEER:
- resDto.setServiceUnitName(StrConstant.EPMETY_STR);
- resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
- resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
- break;
- default:
- log.warn("serviceType 错误");
- break;
+ if(StringUtils.isNotBlank(resDto.getServiceType())){
+ switch (resDto.getServiceType())
+ {
+ case UserDemandConstant.PARTY_UNIT:
+ resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
+ resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
+ resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
+ break;
+ case UserDemandConstant.SOCIAL_ORG:
+ resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
+ resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
+ resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
+ break;
+ case UserDemandConstant.COMMUNITY_ORG:
+ resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
+ resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
+ resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
+ break;
+ case UserDemandConstant.VOLUNTEER:
+ resDto.setServiceUnitName(StrConstant.EPMETY_STR);
+ resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
+ resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
+ break;
+ default:
+ log.warn("serviceType 错误");
+ break;
+ }
}
}
}
@@ -1208,34 +1210,36 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId()));
- resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
- resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
- resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
- break;
- case UserDemandConstant.SOCIAL_ORG:
- Map socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId()));
- resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
- resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
- resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
- break;
- case UserDemandConstant.COMMUNITY_ORG:
- Map communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId()));
- resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
- resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
- resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
- break;
- case UserDemandConstant.VOLUNTEER:
- Map userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId())));
- resDto.setServiceUnitName(StrConstant.EPMETY_STR);
- resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
- resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
- break;
- default:
- log.warn("serviceType 错误");
- break;
+ if(StringUtils.isNotBlank(resDto.getServiceType())){
+ switch (resDto.getServiceType()) {
+ case UserDemandConstant.PARTY_UNIT:
+ Map partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId()));
+ resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
+ resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
+ resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
+ break;
+ case UserDemandConstant.SOCIAL_ORG:
+ Map socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId()));
+ resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
+ resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
+ resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
+ break;
+ case UserDemandConstant.COMMUNITY_ORG:
+ Map communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId()));
+ resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
+ resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
+ resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
+ break;
+ case UserDemandConstant.VOLUNTEER:
+ Map userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId())));
+ resDto.setServiceUnitName(StrConstant.EPMETY_STR);
+ resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
+ resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
+ break;
+ default:
+ log.warn("serviceType 错误");
+ break;
+ }
}
return resDto;
}
From c9f6bbb68001447bc21f92c6777979e9139fbf01 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Fri, 24 Dec 2021 11:13:54 +0800
Subject: [PATCH 21/56] test
---
.../com/epmet/controller/ResiDemandController.java | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index 44d27e5793..be5daf5e3e 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -156,16 +156,14 @@ public class ResiDemandController {
/**
* 居民端-我的需求(待处理,处理中,已完成,已取消)
- * @param tokenDto @LoginUser TokenDto tokenDto,
+ * @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("mydemand")
- public Result> queryMyDemand( @RequestBody ResiClientMyDemandFormDTO formDTO){
- // formDTO.setUserId(tokenDto.getUserId());
- // formDTO.setCustomerId(tokenDto.getCustomerId());
- formDTO.setUserId("cebe59b05d02715141762211bf57734f");
- formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
+ public Result> queryMyDemand(@LoginUser TokenDto tokenDto,@RequestBody ResiClientMyDemandFormDTO formDTO){
+ formDTO.setUserId(tokenDto.getUserId());
+ formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class,ResiClientMyDemandFormDTO.AddUserInternalGroup.class);
return new Result>().ok(icUserDemandRecService.queryMyDemandForResiClient(formDTO));
}
From 781c85a44565530c3938f77be596aa73c8c33440 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Fri, 24 Dec 2021 13:30:31 +0800
Subject: [PATCH 22/56] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E5=8F=91?=
=?UTF-8?q?=E5=B8=83=E9=9C=80=E6=B1=82=E5=86=85=E5=AE=B9+=E6=9C=8D?=
=?UTF-8?q?=E5=8A=A1=E8=AF=84=E4=BB=B7=E8=BE=93=E5=85=A5=E7=9A=84=E5=AE=8C?=
=?UTF-8?q?=E6=88=90=E6=83=85=E5=86=B5=E8=B5=B0=E5=86=85=E5=AE=B9=E5=AE=A1?=
=?UTF-8?q?=E6=A0=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../form/demand/EvaluateDemandFormDTO.java | 3 ++
.../controller/ResiDemandController.java | 1 +
.../impl/IcUserDemandRecServiceImpl.java | 49 ++++++++++++++++---
3 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java
index 1a0a5d28f2..119061edee 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java
@@ -41,4 +41,7 @@ public class EvaluateDemandFormDTO implements Serializable {
private String userId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
+ // 政府端:gov、居民端:resi、运营端:oper
+ @NotBlank(message = "app不能为空", groups = AddUserInternalGroup.class)
+ private String app;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index be5daf5e3e..48ff8d7585 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -117,6 +117,7 @@ public class ResiDemandController {
public Result evaluate(@LoginUser TokenDto tokenDto, @RequestBody EvaluateDemandFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setApp(tokenDto.getApp());
ValidatorUtils.validateEntity(formDTO, EvaluateDemandFormDTO.ShowGroup.class, EvaluateDemandFormDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO);
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index 8c3ade3df5..7191081678 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -27,10 +27,15 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
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.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
+import com.epmet.commons.tools.scan.param.TextScanParamDTO;
+import com.epmet.commons.tools.scan.param.TextTaskDTO;
+import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserDemandConstant;
import com.epmet.constant.UserMessageTypeConstant;
@@ -56,6 +61,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -96,6 +102,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
+ if (!textSyncScanResult.success()) {
+ throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
+ } else {
+ if (!textSyncScanResult.getData().isAllPass()) {
+ throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg());
+ }
+ }
+ }
/**
* 我的需求被抢单->您提出的需求将由青岛亿联科技有限公司为您解决,请查看。
From 9850c101523a1e96f96a97bc74326b69d1fa5782 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Fri, 24 Dec 2021 13:35:13 +0800
Subject: [PATCH 23/56] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=9C=80=E6=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/resources/mapper/IcUserDemandRecDao.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
index 93b1423a58..9b0b0949c6 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
@@ -476,7 +476,7 @@
WHERE
r.DEL_FLAG = '0'
AND r.GRID_ID = #{gridId}
- AND R.DEMAND_USER_ID !=#{demandUserId}
+ AND R.DEMAND_USER_ID =#{demandUserId}
AND r.`STATUS` = 'pending'
From ca4510ee16ad66a20c2ef839345c8c49f248de51 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Fri, 24 Dec 2021 14:01:30 +0800
Subject: [PATCH 24/56] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=9C=80=E6=B1=82?=
=?UTF-8?q?=E8=AF=A6=E6=83=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../epmet/dto/result/demand/DemandDetailResDTO.java | 11 +++++++++++
.../epmet/dto/result/demand/DemandRecResultDTO.java | 8 ++++++++
.../src/main/resources/mapper/IcUserDemandRecDao.xml | 6 +++++-
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java
index 2a829c2bb4..cad6a2c4dd 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java
@@ -56,6 +56,17 @@ public class DemandDetailResDTO implements Serializable {
*/
private String serviceAddress;
+ // 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择
+ private String serviceLocation;
+ // 门牌号详细地址
+ private String locationDetail;
+ // 经度,需求人是ic的居民时,取所住楼栋的中心点位
+ private String longitude;
+ // 纬度,需求人是ic的居民时,取所住楼栋的中心点位
+ private String latitude;
+
+
+
/**
* 实际服务开始时间
*/
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
index 6a6c5145f1..c235915430 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
@@ -131,4 +131,12 @@ public class DemandRecResultDTO implements Serializable {
* 服务地点
*/
private String serviceAddress;
+ // 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择
+ private String serviceLocation;
+ // 门牌号详细地址
+ private String locationDetail;
+ // 经度,需求人是ic的居民时,取所住楼栋的中心点位
+ private String longitude;
+ // 纬度,需求人是ic的居民时,取所住楼栋的中心点位
+ private String latitude;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
index 9b0b0949c6..7123e44860 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
@@ -207,7 +207,11 @@
END
) as epmetUserId,
r.AWARD_POINT as awardPoint,
- concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress
+ concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress,
+ r.SERVICE_LOCATION,
+ r.LOCATION_DETAIL,
+ r.LONGITUDE,
+ r.LATITUDE
FROM
ic_user_demand_rec r
left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' )
From 759c42050e4e5dfa641359f87dc522363019ee2b Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Fri, 24 Dec 2021 15:28:20 +0800
Subject: [PATCH 25/56] /heart/userdemand/pagelist-analysis
---
.../src/main/resources/mapper/IcUserDemandRecDao.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
index 7123e44860..6b8e7cf980 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
@@ -257,7 +257,7 @@
) as serviceName,
s.SERVICE_START_TIME as serviceStartTime,
s.SERVICE_END_TIME as serviceEndTime,
- IFNULL(s.remark,'') as finishDesc,
+ IFNULL(sa.remark,'') as finishDesc,
'' AS serviceShowName,
s.id as serviceId,
(
From 87c2ed4945c64bb2c1a44692a1c9012ab9f3c98a Mon Sep 17 00:00:00 2001
From: wangxianzhang
Date: Fri, 24 Dec 2021 16:18:03 +0800
Subject: [PATCH 26/56] =?UTF-8?q?=E8=A7=A3=E9=99=A4=E5=AF=B9=E6=98=93?=
=?UTF-8?q?=E8=81=94=E4=BA=91=E7=9A=84=E4=BE=9D=E8=B5=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../constants/ConsomerGroupConstants.java | 11 +-
.../rocketmq/constants/TopicConstants.java | 10 +
.../service/impl/ActLiveRecServiceImpl.java | 22 +-
.../impl/VolunteerInfoServiceImpl.java | 18 +-
.../service/impl/WorkActServiceImpl.java | 46 ++--
.../com/epmet/constant/SystemMessageType.java | 45 ++++
.../com/epmet/dto/form/SystemMsgFormDTO.java | 4 +-
.../impl/SystemMessageServiceImpl.java | 15 ++
.../epmet-point/epmet-point-server/pom.xml | 16 ++
.../epmet/mq/RocketMQConsumerRegister.java | 27 ++
.../com/epmet/mq/listener/PointListener.java | 236 ++++++++++++++++++
.../src/main/resources/bootstrap.yml | 4 +
.../GroupMemeberOperationServiceImpl.java | 31 ++-
.../impl/ResiGroupMemberServiceImpl.java | 23 +-
.../impl/ResiTopicCommentServiceImpl.java | 27 +-
.../service/impl/ResiTopicServiceImpl.java | 97 ++++---
.../service/impl/TopicDraftServiceImpl.java | 18 +-
17 files changed, 566 insertions(+), 84 deletions(-)
create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java
diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
index 400eca1d51..67bfc91273 100644
--- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
+++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
@@ -41,10 +41,19 @@ public interface ConsomerGroupConstants {
*/
String PROJECT_OPERATION_LOG_GROUP = "project_operation_log_group";
/**
- * 积分操作消费组
+ * 积分操作日志消费组
*/
String POINT_OPERATION_LOG_GROUP = "point_operation_log_group";
+ /**
+ * 爱心互助积分操作消费组
+ */
+ String EPMET_HEART_POINT_OPERATION_GROUP = "epmet_heart_point_operation_group";
+ /**
+ * 楼院小组积分操作消费组
+ */
+ String RESI_GROUP_POINT_OPERATION_GROUP = "resi_group_point_operation_group";
+
/**
* 开放的对接数据(中间库) 组织变更事件监听器分组
*/
diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
index e11400fef3..bf0c23abab 100644
--- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
+++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
@@ -58,4 +58,14 @@ public interface TopicConstants {
* 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度
*/
String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
+
+ /**
+ * 爱心互助
+ */
+ String EPMET_HEART = "epmet_heart";
+
+ /**
+ * 楼院小组
+ */
+ String RESI_GROUP = "resi_group";
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java
index c745c98192..3c7d9a6647 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java
@@ -36,16 +36,19 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.utils.SendMqMsgUtils;
+import com.epmet.constant.SystemMessageType;
import com.epmet.dao.ActLivePicDao;
import com.epmet.dao.ActLiveRecDao;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.ActLivePicDTO;
import com.epmet.dto.ActLiveRecDTO;
+import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.resi.ResiActLiveRecResultDTO;
import com.epmet.entity.ActLivePicEntity;
import com.epmet.entity.ActLiveRecEntity;
+import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.ActLiveRecRedis;
import com.epmet.service.ActInfoService;
@@ -80,6 +83,9 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl actPointEventMsgList=new ArrayList<>();
BasePointEventMsg actPointEventMsg=new BasePointEventMsg();
actPointEventMsg.setCustomerId(formDTO.getCustomerId());
@@ -242,8 +248,14 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl actPointEventMsgList=new ArrayList<>();
BasePointEventMsg actPointEventMsg=new BasePointEventMsg();
actPointEventMsg.setCustomerId(formDTO.getCustomerId());
@@ -143,8 +145,14 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl basePointEventMsgArrayList=new ArrayList<>();
for(ActUserRelationEntity actUserRelationEntity:actUserRelationEntityList){
BasePointEventMsg basePointEventMsg=new BasePointEventMsg();
@@ -937,15 +935,22 @@ public class WorkActServiceImpl implements WorkActService {
basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId());
basePointEventMsgArrayList.add(basePointEventMsg);
}
- mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
- Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
+ //mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
+ //Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
+
+ SystemMsgFormDTO systemMsgFormDTO = new SystemMsgFormDTO();
+ systemMsgFormDTO.setMessageType(SystemMessageType.ACTIVE_SEND_POINT);
+ systemMsgFormDTO.setContent(basePointEventMsgArrayList);
+
+ Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(systemMsgFormDTO);
+
ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity();
actGrantPointLogEntity.setActId(actInfoDTO.getId());
actGrantPointLogEntity.setCustomerId(actInfoDTO.getCustomerId());
actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId());
actGrantPointLogEntity.setRemark(remark);
actGrantPointLogEntity.setReward(actInfoDTO.getReward());
- actGrantPointLogEntity.setSendMsg(JSON.toJSONString(mqBaseMsgDTO));
+ actGrantPointLogEntity.setSendMsg(JSON.toJSONString(systemMsgFormDTO));
actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result));
actGrantPointLogDao.insert(actGrantPointLogEntity);
if(!result.success()){
@@ -958,11 +963,11 @@ public class WorkActServiceImpl implements WorkActService {
//查询当前用户所属组织信息
Result userResult = govOrgOpenFeignClient.getAgencyByStaff(loginUserUtil.getLoginUserId());
String opAgencyId = userResult.getData().getId();
- MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
+ //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
//mq的事件类型
- mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass());
+ //mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass());
//事件code
- mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag());
+ //mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag());
List basePointEventMsgArrayList = new ArrayList<>();
BasePointEventMsg basePointEventMsg = new BasePointEventMsg();
basePointEventMsg.setOpAgencyId(opAgencyId);
@@ -976,9 +981,16 @@ public class WorkActServiceImpl implements WorkActService {
basePointEventMsg.setSourceId(formDTO.getSourceId());
basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId());
basePointEventMsgArrayList.add(basePointEventMsg);
- mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
- logger.info("发送消息入参:"+JSON.toJSON(mqBaseMsgDTO));
- Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
+ //mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
+ //logger.info("发送消息入参:"+JSON.toJSON(mqBaseMsgDTO));
+ //Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
+
+ SystemMsgFormDTO msgForm = new SystemMsgFormDTO();
+ msgForm.setMessageType(SystemMessageType.ACTIVE_SEND_POINT);
+ msgForm.setContent(basePointEventMsgArrayList);
+
+ Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgForm);
+
logger.info("发送消息返参:"+JSON.toJSON(result));
ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity();
actGrantPointLogEntity.setActId(formDTO.getSourceId());
@@ -986,7 +998,7 @@ public class WorkActServiceImpl implements WorkActService {
actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId());
actGrantPointLogEntity.setRemark(formDTO.getRemark());
actGrantPointLogEntity.setReward(formDTO.getReward());
- actGrantPointLogEntity.setSendMsg(JSON.toJSONString(mqBaseMsgDTO));
+ actGrantPointLogEntity.setSendMsg(JSON.toJSONString(msgForm));
actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result));
actGrantPointLogDao.insert(actGrantPointLogEntity);
if (!result.success()) {
diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
index 284be1cb95..4418c1ebde 100644
--- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
+++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
@@ -104,4 +104,49 @@ public interface SystemMessageType {
* 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度
*/
String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
+
+ /**
+ * 活动发放积分
+ */
+ String ACTIVE_SEND_POINT = "active_send_point";
+ /**
+ * 认证志愿者
+ */
+ String REGISTER_VOLUNTEER = "register_volunteer";
+ /**
+ * 添加活动实况
+ */
+ String ACTIVE_INSERT_LIVE = "active_insert_live";
+ /**
+ * 拉新用户入组
+ */
+ String INVITE_NEW_INTO_GROUP = "invite_new_into_group";
+ /**
+ * 邀请已注册的用户入组
+ */
+ String INVITE_RESI_INTO_GROUP = "invite_resi_into_group";
+ /**
+ * 发布话题
+ */
+ String PUBLISH_ONE_TOPIC = "publish_one_topic";
+ /**
+ * 对小组内话题进行15字以上评论
+ */
+ String PARTICIPATE_ONE_TOPIC = "participate_one_topic";
+ /**
+ * 话题被转为议题(小组中发布的话题被组长转为议题)
+ */
+ String TOPIC_TO_ISSUE = "topic_to_issue";
+ /**
+ * 转话题为议题(将自建小组中话题转为议题)
+ */
+ String SHIFT_TOPIC_TO_ISSUE = "shift_topic_to_issue";
+ /**
+ * 话题被转为项目
+ */
+ String TOPIC_TO_PROJECT = "topic_to_project";
+ /**
+ * 组长解决组内话题
+ */
+ String LEADER_RESOLVE_TOPIC = "leader_resolve_topic";
}
diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java
index c0fb1400e9..24dbd8694f 100644
--- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java
+++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java
@@ -19,6 +19,6 @@ public class SystemMsgFormDTO {
@NotNull(message = "消息内容不能为空", groups = { SendMsgByMQ.class })
private Object content;
- @NotNull(message = "pendingMsgLabel不能为空", groups = { AckMsgByMQ.class })
- private String pendingMsgLabel;
+ //@NotNull(message = "pendingMsgLabel不能为空", groups = { AckMsgByMQ.class })
+ //private String pendingMsgLabel;
}
diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
index 92703db76e..83b6c23e7e 100644
--- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
+++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
@@ -195,6 +195,21 @@ public class SystemMessageServiceImpl implements SystemMessageService {
case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION:
topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION;
break;
+ case SystemMessageType.INVITE_NEW_INTO_GROUP:
+ case SystemMessageType.INVITE_RESI_INTO_GROUP:
+ case SystemMessageType.PUBLISH_ONE_TOPIC:
+ case SystemMessageType.PARTICIPATE_ONE_TOPIC:
+ case SystemMessageType.TOPIC_TO_ISSUE:
+ case SystemMessageType.SHIFT_TOPIC_TO_ISSUE:
+ case SystemMessageType.TOPIC_TO_PROJECT:
+ case SystemMessageType.LEADER_RESOLVE_TOPIC:
+ topic = TopicConstants.RESI_GROUP;
+ break;
+ case SystemMessageType.ACTIVE_SEND_POINT:
+ case SystemMessageType.REGISTER_VOLUNTEER:
+ case SystemMessageType.ACTIVE_INSERT_LIVE:
+ topic = TopicConstants.EPMET_HEART;
+ break;
}
return topic;
}
diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml
index 89c84eb878..c0224fd49d 100644
--- a/epmet-module/epmet-point/epmet-point-server/pom.xml
+++ b/epmet-module/epmet-point/epmet-point-server/pom.xml
@@ -167,6 +167,10 @@
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
+
+
+ true
+ 192.168.1.140:9876;192.168.1.141:9876
@@ -210,6 +214,10 @@
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
+
+
+ true
+ 192.168.1.140:9876;192.168.1.141:9876
@@ -253,6 +261,10 @@
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
+
+
+ true
+ 192.168.10.161:9876
@@ -296,6 +308,10 @@
https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c
SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1
+
+
+ true
+ 192.168.11.187:9876;192.168.11.184:9876
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
new file mode 100644
index 0000000000..28b4ea9087
--- /dev/null
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
@@ -0,0 +1,27 @@
+package com.epmet.mq;
+
+import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants;
+import com.epmet.commons.rocketmq.constants.TopicConstants;
+import com.epmet.commons.rocketmq.register.MQAbstractRegister;
+import com.epmet.commons.rocketmq.register.MQConsumerProperties;
+import com.epmet.mq.listener.PointListener;
+import com.epmet.service.UserPointActionLogService;
+import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RocketMQConsumerRegister extends MQAbstractRegister {
+
+ @Autowired
+ private UserPointActionLogService userPointActionLogService;
+
+ @Override
+ public void registerAllListeners(String env, MQConsumerProperties consumerProperties) {
+ // 客户初始化监听器注册
+ register(consumerProperties, ConsomerGroupConstants.RESI_GROUP_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.RESI_GROUP, "*", new PointListener(userPointActionLogService));
+ register(consumerProperties, ConsomerGroupConstants.EPMET_HEART_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.EPMET_HEART, "*", new PointListener(userPointActionLogService));
+
+ // ...其他监听器类似
+ }
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java
new file mode 100644
index 0000000000..d6bc028d24
--- /dev/null
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java
@@ -0,0 +1,236 @@
+package com.epmet.mq.listener;
+
+import com.alibaba.fastjson.JSON;
+import com.epmet.commons.rocketmq.constants.MQUserPropertys;
+import com.epmet.commons.rocketmq.messages.LoginMQMsg;
+import com.epmet.commons.tools.distributedlock.DistributedLock;
+import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
+import com.epmet.commons.tools.enums.EventEnum;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.ExceptionUtils;
+import com.epmet.commons.tools.exception.RenException;
+import com.epmet.commons.tools.redis.RedisKeys;
+import com.epmet.commons.tools.redis.RedisUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.utils.SpringContextUtils;
+import com.epmet.constant.SystemMessageType;
+import com.epmet.service.UserPointActionLogService;
+import dto.form.SendPointFormDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
+import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
+import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
+import org.apache.rocketmq.common.message.MessageExt;
+import org.redisson.api.RLock;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author wxz
+ * @Description 登录操作日志监听器
+
+ * @return
+ * @date 2021.06.07 16:12
+ */
+@Slf4j
+public class PointListener implements MessageListenerConcurrently {
+
+ private RedisUtils redisUtils;
+
+ private UserPointActionLogService userPointActionLogService;
+
+ public PointListener(UserPointActionLogService userPointActionLogService) {
+ this.userPointActionLogService = userPointActionLogService;
+ }
+
+ @Override
+ public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) {
+
+ if (redisUtils == null) {
+ redisUtils = SpringContextUtils.getBean(RedisUtils.class);
+ }
+
+ try {
+ msgs.forEach(msg -> consumeMessage(msg));
+ } catch (Exception e) {
+ log.error(ExceptionUtils.getErrorStackTrace(e));
+ return ConsumeConcurrentlyStatus.RECONSUME_LATER;
+ }
+ return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
+ }
+
+ private void consumeMessage(MessageExt messageExt) {
+ String tags = messageExt.getTags();
+ String msg = new String(messageExt.getBody());
+ String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL);
+ log.info("【积分操作监听器】-收到消息内容:{}", msg);
+
+ DistributedLock distributedLock = null;
+ RLock lock = null;
+ try {
+ distributedLock = SpringContextUtils.getBean(DistributedLock.class);
+ lock = distributedLock.getLock("lock:point_operation", 30L, 30L, TimeUnit.SECONDS);
+
+ switch (tags) {
+ case SystemMessageType.PARTICIPATE_ONE_TOPIC:
+ resiGroupPointOpe(msg);
+ break;
+ case SystemMessageType.ACTIVE_SEND_POINT:
+ // 爱心活动积分发放
+ activeSendPoint(msg);
+ break;
+ case SystemMessageType.ACTIVE_INSERT_LIVE:
+ // 添加活动实况
+ activeInsertLive(msg);
+ break;
+ case SystemMessageType.REGISTER_VOLUNTEER:
+ // 注册志愿者
+ registerVolunteer(msg);
+ break;
+ case SystemMessageType.TOPIC_TO_ISSUE:
+ // 话题被组长转为议题
+ topicToIssue(msg);
+ break;
+ case SystemMessageType.TOPIC_TO_PROJECT:
+ // 话题转为项目
+ topicToProject(msg);
+ break;
+ case SystemMessageType.INVITE_RESI_INTO_GROUP:
+ inviteResiIntoGroup(msg);
+ break;
+ case SystemMessageType.INVITE_NEW_INTO_GROUP:
+ inviteNewIntoGroup(msg);
+ break;
+ case SystemMessageType.SHIFT_TOPIC_TO_ISSUE:
+ shiftTopicToIssue(msg);
+ break;
+ case SystemMessageType.PUBLISH_ONE_TOPIC:
+ publicOneTopic(msg);
+ break;
+ case SystemMessageType.LEADER_RESOLVE_TOPIC:
+ leaderResolveTopic(msg);
+ break;
+ }
+
+ } catch (RenException e) {
+ // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
+ log.error("【积分操作监听器】消费消息失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
+ } catch (Exception e) {
+ // 不是我们自己抛出的异常,可以让MQ重试
+ log.error("【积分操作监听器】消费消息失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
+ throw e;
+ } finally {
+ distributedLock.unLock(lock);
+ }
+
+ if (StringUtils.isNotBlank(pendingMsgLabel)) {
+ try {
+ removePendingMqMsgCache(pendingMsgLabel);
+ } catch (Exception e) {
+ log.error("【登录操作事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
+ }
+ }
+ }
+
+ private void leaderResolveTopic(String msg) {
+ List formList = JSON.parseArray(msg, BasePointEventMsg.class);
+
+ formList.forEach(obj -> {
+ userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
+ });
+ }
+
+ private void publicOneTopic(String msg) {
+ List formList = JSON.parseArray(msg, BasePointEventMsg.class);
+
+ formList.forEach(obj -> {
+ userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
+ });
+ }
+
+ private void shiftTopicToIssue(String msg) {
+ List formList = JSON.parseArray(msg, BasePointEventMsg.class);
+
+ formList.forEach(obj -> {
+ userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
+ });
+ }
+
+ private void inviteNewIntoGroup(String msg) {
+ List formList = JSON.parseArray(msg, BasePointEventMsg.class);
+
+ formList.forEach(obj -> {
+ userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
+ });
+ }
+
+ private void inviteResiIntoGroup(String msg) {
+ List formList = JSON.parseArray(msg, BasePointEventMsg.class);
+
+ formList.forEach(obj -> {
+ userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
+ });
+ }
+
+ private void topicToProject(String msg) {
+ List formList = JSON.parseArray(msg, BasePointEventMsg.class);
+
+ formList.forEach(obj -> {
+ userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
+ });
+ }
+
+ private void topicToIssue(String msg) {
+ List formList = JSON.parseArray(msg, BasePointEventMsg.class);
+
+ formList.forEach(obj -> {
+ userPointActionLogService.grantPointByEvent(obj.getEventTag(), obj);
+ });
+ }
+
+ private void registerVolunteer(String msg) {
+ List formList = JSON.parseArray(msg, BasePointEventMsg.class);
+ formList.forEach(obj -> {
+ userPointActionLogService.grantPointByEvent(EventEnum.REGISTER_VOLUNTEER.getEventTag(),obj);
+ });
+ }
+
+ private void activeInsertLive(String msg) {
+ List formList = JSON.parseArray(msg, BasePointEventMsg.class);
+ formList.forEach(obj -> {
+ userPointActionLogService.grantPointByEvent(EventEnum.ACTIVE_INSERT_LIVE.getEventTag(), obj);
+ });
+ }
+
+ private void activeSendPoint(String msg) {
+ List formDTO = JSON.parseArray(msg, SendPointFormDTO.class);
+ userPointActionLogService.grantPoint(formDTO);
+ }
+
+ private void resiGroupPointOpe(String msg) {
+ List formList = JSON.parseArray(msg, BasePointEventMsg.class);
+
+ formList.forEach(obj -> {
+ userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
+ });
+ }
+
+
+ /**
+ * @description
+ *
+ * @param pendingMsgLabel
+ * @return
+ * @author wxz
+ * @date 2021.10.14 16:32:32
+ */
+ private void removePendingMqMsgCache(String pendingMsgLabel) {
+ String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel);
+ redisUtils.delete(key);
+ //logger.info("【登录操作事件监听器】删除pendingMsgLabel成功:{}", pendingMsgLabel);
+ }
+}
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml
index af068df15d..4d5434a25f 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml
@@ -141,3 +141,7 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
+
+rocketmq:
+ enable: @rocketmq.enable@
+ name-server: @rocketmq.nameserver@
\ No newline at end of file
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupMemeberOperationServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupMemeberOperationServiceImpl.java
index de5c0b5207..648c64fca0 100644
--- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupMemeberOperationServiceImpl.java
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupMemeberOperationServiceImpl.java
@@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSON;
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.rocketmq.constants.TopicConstants;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.MqConstant;
@@ -34,12 +35,15 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SendMqMsgUtils;
+import com.epmet.constant.SystemMessageType;
import com.epmet.dto.IssueShareLinkRecordDTO;
import com.epmet.dto.IssueShareLinkVisitRecordDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
+import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.result.CommonDataFilterResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
+import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.modules.feign.GovOrgFeignClient;
@@ -120,6 +124,8 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl page(Map params) {
@@ -352,10 +358,13 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg();
pointEventMsg.setCustomerId(resiGroupDTO.getCustomerId());
@@ -368,8 +377,8 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg();
pointEventMsg.setCustomerId(groupCache.getCustomerId());
@@ -689,7 +693,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl userParam = new LinkedList<>();
@@ -707,8 +711,15 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl NumConstant.FIFTEEN){
+ String eventClass = EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass();
+ String eventTag = EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag();
+
//mq的事件类型
- MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
- mqBaseMsgDTO.setEventClass(EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass());
+ //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
+ //mqBaseMsgDTO.setEventClass(EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass());
//事件code
- mqBaseMsgDTO.setEventTag(EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag());
+ //mqBaseMsgDTO.setEventTag(EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag());
List pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg();
String customerId = resiTopicdDao.selectCustomerIdByTopicId(resiCommentFormDTO.getTopicId());
@@ -297,8 +304,8 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg();
ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(resiTopicPublishFormDTO.getGroupId());
@@ -449,13 +455,19 @@ public class ResiTopicServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg();
@@ -840,8 +852,15 @@ public class ResiTopicServiceImpl extends BaseServiceImpl result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
+
+ SystemMsgFormDTO msgFormDTO = new SystemMsgFormDTO();
+ msgFormDTO.setContent(pointEventMsgList);
+ msgFormDTO.setMessageType(SystemMessageType.LEADER_RESOLVE_TOPIC);
+ Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgFormDTO);
+
+ if (!result.success()) {
log.error("组长解决话题事件发送失败,参数:{}", JSON.toJSONString(closeFormDTO));
}
}
@@ -1931,15 +1950,22 @@ public class ResiTopicServiceImpl extends BaseServiceImpl {
- MqBaseMsgDTO msgDTO = new MqBaseMsgDTO();
- msgDTO.setEventClass("resi_group");
+ //MqBaseMsgDTO msgDTO = new MqBaseMsgDTO();
+ //msgDTO.setEventClass("resi_group");
//事件code 因为楼院小组的事件回调统一入口,外层的EventTag不能够判断具体的事件
//因为可能会一次发送多个事件集合,需要对集合里的对象逐个判断
- msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag());
+ //msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag());
List msgList = new ArrayList<>();
msgList.add(item);
- msgDTO.setMsg(JSON.toJSONString(msgList));
- if(!SendMqMsgUtils.sendMsg(msgDTO).success()){
+ //msgDTO.setMsg(JSON.toJSONString(msgList));
+
+ SystemMsgFormDTO msgForm = new SystemMsgFormDTO();
+ msgForm.setMessageType(SystemMessageType.SHIFT_TOPIC_TO_ISSUE);
+ msgForm.setContent(msgList);
+ Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgForm);
+
+ //Result sendMsgResult = SendMqMsgUtils.sendMsg(msgDTO);
+ if(!sendMsgResult.success()){
log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(topicTurnIssueFromDTO));
}
});
@@ -2104,15 +2130,22 @@ public class ResiTopicServiceImpl extends BaseServiceImpl {
- MqBaseMsgDTO msgDTO = new MqBaseMsgDTO();
- msgDTO.setEventClass("resi_group");
+ //MqBaseMsgDTO msgDTO = new MqBaseMsgDTO();
+ //msgDTO.setEventClass("resi_group");
//事件code 因为楼院小组的事件回调统一入口,外层的EventTag不能够判断具体的事件
//因为可能会一次发送多个事件集合,需要对集合里的对象逐个判断
- msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag());
+ //msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag());
List msgList = new ArrayList<>();
msgList.add(item);
- msgDTO.setMsg(JSON.toJSONString(msgList));
- if(!SendMqMsgUtils.sendMsg(msgDTO).success()){
+ //msgDTO.setMsg(JSON.toJSONString(msgList));
+
+ SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
+ sendMsgForm.setContent(msgList);
+ sendMsgForm.setMessageType(SystemMessageType.SHIFT_TOPIC_TO_ISSUE);
+ Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
+
+ //Result sendMsgResult = SendMqMsgUtils.sendMsg(msgDTO);
+ if(!sendMsgResult.success()){
log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param));
}
});
@@ -2462,10 +2495,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>();
//话题被转为项目 话题作者
@@ -2493,8 +2526,16 @@ public class ResiTopicServiceImpl extends BaseServiceImpl content.length() ? "\"" : "…\"")
).append("被转为项目").toString());
pointEventMsgList.add(pointEventMsg);
- mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList));
- if(!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()){
+ //mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList));
+
+ //Result sendMsgResult = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
+
+ SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
+ sendMsgForm.setContent(pointEventMsgList);
+ sendMsgForm.setMessageType(SystemMessageType.TOPIC_TO_PROJECT);
+ Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
+
+ if(!sendMsgResult.success()){
log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param));
}
}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java
index 9a60f060b2..0d681d7368 100644
--- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java
@@ -38,7 +38,9 @@ import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.scan.result.VoiceResultDTO;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.*;
+import com.epmet.constant.SystemMessageType;
import com.epmet.dto.form.CommonGridIdFormDTO;
+import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.UserInfoResultDTO;
import com.epmet.dto.result.CommonDataFilterResultDTO;
@@ -1004,11 +1006,11 @@ public class TopicDraftServiceImpl extends BaseServiceImpl actPointEventMsgList=new ArrayList<>();
BasePointEventMsg actPointEventMsg=new BasePointEventMsg();
actPointEventMsg.setCustomerId(customerId);
@@ -1026,8 +1028,14 @@ public class TopicDraftServiceImpl extends BaseServiceImpl
Date: Fri, 24 Dec 2021 16:44:49 +0800
Subject: [PATCH 27/56] user-demand-rel
---
.../dto/form/demand/UserDemandRelFormDTO.java | 23 +++++++++++++++++++
.../result/demand/UserDemandRelResDTO.java | 18 +++++++++++++++
.../epmet/constant/UserDemandConstant.java | 3 +++
.../controller/ResiDemandController.java | 14 +++++++++++
.../epmet/service/IcUserDemandRecService.java | 8 +++++++
.../impl/IcUserDemandRecServiceImpl.java | 21 +++++++++++++++++
6 files changed, 87 insertions(+)
create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandRelFormDTO.java
create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/UserDemandRelResDTO.java
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandRelFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandRelFormDTO.java
new file mode 100644
index 0000000000..82182b2440
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandRelFormDTO.java
@@ -0,0 +1,23 @@
+package com.epmet.dto.form.demand;
+
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * 当前用户与需求消息的关系
+ */
+@Data
+public class UserDemandRelFormDTO implements Serializable {
+ private static final long serialVersionUID = 948510931204329428L;
+
+ public interface AddInternalGroup {
+ }
+ @NotBlank(message = "需求id不能为空",groups = AddInternalGroup.class)
+ private String demandRecId;
+
+ @NotBlank(message = "userId不能为空",groups = AddInternalGroup.class)
+ private String userId;
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/UserDemandRelResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/UserDemandRelResDTO.java
new file mode 100644
index 0000000000..9c7808dd81
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/UserDemandRelResDTO.java
@@ -0,0 +1,18 @@
+package com.epmet.dto.result.demand;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 当前用户与需求消息的关系
+ */
+@AllArgsConstructor
+@Data
+public class UserDemandRelResDTO implements Serializable {
+ private static final long serialVersionUID = -9007483306143283653L;
+ // 需求发布人:publisher ;服务人:server
+ private String identity;
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
index 39692daa96..9b4cf5ee00 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
@@ -73,4 +73,7 @@ public interface UserDemandConstant {
*/
String DEMAND_EVALUATED=" 您收到来自%s的评价,请查看。";
String DEMAND_CANCELED=" %s的需求已取消,请查看。";
+
+ String DEMAND_PUBLISHER="publisher";
+ String DEMAND_SERVER="server";
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index 48ff8d7585..329d03d55e 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -202,4 +202,18 @@ public class ResiDemandController {
return new Result().ok(icUserDemandRecService.saveOrUpdateDemand(formDTO));
}
+ /**
+ * 当前用户与需求消息的关系
+ * 需求发布人:publisher ;服务人:server
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return
+ */
+ @PostMapping("user-demand-rel")
+ public Result queryUserDemandRel(@LoginUser TokenDto tokenDto, @RequestBody UserDemandRelFormDTO formDTO) {
+ formDTO.setUserId(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(formDTO, UserDemandRelFormDTO.AddInternalGroup.class);
+ return new Result().ok(icUserDemandRecService.queryUserDemandRel(formDTO));
+ }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
index b2801abd64..e912a301db 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
@@ -204,4 +204,12 @@ public interface IcUserDemandRecService extends BaseService
Date: Fri, 24 Dec 2021 17:22:08 +0800
Subject: [PATCH 28/56] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/epmet/dto/IcPartyActivityDTO.java | 5 +
.../java/com/epmet/dto/LatestActInfoDTO.java | 20 ++
.../com/epmet/dto/form/work/ActIdFormDTO.java | 1 +
.../dto/form/work/ActPreviewFormDTO.java | 1 +
.../dto/form/work/DraftActInfoFormDTO.java | 20 ++
.../dto/form/work/PublishActInfoFormDTO.java | 25 ++
.../epmet/dto/form/work/RePublishFormDTO.java | 25 ++
.../dto/result/work/ActPreviewResultDTO.java | 21 ++
.../work/CanceledActDetailResultDTO.java | 21 ++
.../work/FinishedActDetailResultDTO.java | 21 ++
.../work/InProgressActDetailResultDTO.java | 21 ++
.../work/LatestDraftActInfoResultDTO.java | 20 ++
.../result/work/ReEditActInfoResultDTO.java | 21 ++
.../java/com/epmet/constant/ActConstant.java | 8 +
.../epmet/controller/WorkActController.java | 52 +++-
.../java/com/epmet/entity/ActInfoEntity.java | 21 +-
.../epmet/entity/IcPartyActivityEntity.java | 5 +
.../com/epmet/entity/LatestActInfoEntity.java | 20 ++
.../epmet/service/IcPartyActivityService.java | 18 ++
.../com/epmet/service/WorkActService.java | 10 +-
.../impl/IcPartyActivityServiceImpl.java | 34 +++
.../service/impl/WorkActDraftServiceImpl.java | 39 ++-
.../service/impl/WorkActServiceImpl.java | 277 ++++++++++++++++--
.../src/main/resources/mapper/ActInfoDao.xml | 18 +-
.../resources/mapper/LatestActInfoDao.xml | 6 +-
25 files changed, 681 insertions(+), 49 deletions(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
index a8c770f8e9..81edd97c20 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
@@ -58,6 +58,11 @@ public class IcPartyActivityDTO implements Serializable {
*/
private String pids;
+ /**
+ * act_info表ID
+ */
+ private String actId;
+
/**
* 单位ID
*/
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java
index 0d0824fdfd..e73c466837 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java
@@ -179,6 +179,26 @@ public class LatestActInfoDTO implements Serializable {
*/
private Boolean auditSwitch;
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType;
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
+
/**
* 乐观锁
*/
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java
index 632b567c11..4ba08831e9 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java
@@ -21,4 +21,5 @@ public class ActIdFormDTO implements Serializable {
*/
@NotBlank(message = "活动id不能为空", groups = { ActIdFormDTO.AddUserInternalGroup.class })
private String actId;
+ private String customerId;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java
index 57166c22f1..78bd1a6cd5 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java
@@ -23,4 +23,5 @@ public class ActPreviewFormDTO implements Serializable {
*/
@NotBlank(message = "活动草稿id不能为空", groups = {UserInternalGroup.class})
private String actDraftId;
+ private String customerId;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java
index 1d128594ff..f00ebe792f 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java
@@ -161,4 +161,24 @@ public class DraftActInfoFormDTO implements Serializable {
*/
private String sponsorTel;
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType = "heart";
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
+
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java
index fae068b230..ef1f3c3e19 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java
@@ -25,6 +25,8 @@ public class PublishActInfoFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
+ public interface AddPartyActivityGroup {
+ }
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@@ -189,4 +191,27 @@ public class PublishActInfoFormDTO implements Serializable {
*/
@NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class})
private String sponsorTel;
+
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType = "heart";
+
+ /**
+ * 联建单位
+ */
+ @NotBlank(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class})
+ private String unitId;
+
+ /**
+ * 活动目标
+ */
+ @NotBlank(message = "活动目标不能为空", groups = {AddPartyActivityGroup.class})
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ @NotBlank(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
+ private String serviceMatter;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
index dfd1aeed99..b093e9dcba 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
@@ -24,6 +24,8 @@ public class RePublishFormDTO implements Serializable {
private static final long serialVersionUID = -959956652123514886L;
public interface AddUserInternalGroup {
}
+ public interface AddPartyActivityGroup {
+ }
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@@ -195,4 +197,27 @@ public class RePublishFormDTO implements Serializable {
*/
@NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class})
private String sponsorTel;
+
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType = "heart";
+
+ /**
+ * 联建单位
+ */
+ @NotBlank(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class})
+ private String unitId;
+
+ /**
+ * 活动目标
+ */
+ @NotBlank(message = "活动目标不能为空", groups = {AddPartyActivityGroup.class})
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ @NotBlank(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
+ private String serviceMatter;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java
index eb6f07693c..5e3df9d139 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java
@@ -89,4 +89,25 @@ public class ActPreviewResultDTO implements Serializable {
* 活动详情
*/
private List actContent;
+
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType;
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+ private String unitName;
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
+ private String serviceMatterName;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java
index 3a19c7d4d4..3da7fade52 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java
@@ -147,4 +147,25 @@ public class CanceledActDetailResultDTO implements Serializable {
* 活动签到打卡半径(单位:米)
*/
private Integer signInRadius;
+
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType;
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+ private String unitName;
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
+ private String serviceMatterName;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java
index e96026f842..3e4bfbdc9a 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java
@@ -136,4 +136,25 @@ public class FinishedActDetailResultDTO implements Serializable {
* 活动签到打卡半径(单位:米)
*/
private Integer signInRadius;
+
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType;
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+ private String unitName;
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
+ private String serviceMatterName;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java
index cd2518f840..8dc4ad2fb2 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java
@@ -131,4 +131,25 @@ public class InProgressActDetailResultDTO implements Serializable {
* 活动签到打卡半径(单位:米)
*/
private Integer signInRadius;
+
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType;
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+ private String unitName;
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
+ private String serviceMatterName;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java
index 7906c364d5..c4a250df92 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java
@@ -166,4 +166,24 @@ public class LatestDraftActInfoResultDTO implements Serializable {
* 活动内容-
*/
private List actContent;
+
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType = "heart";
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java
index 80f668afae..a360fd53c3 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java
@@ -148,4 +148,25 @@ public class ReEditActInfoResultDTO implements Serializable {
* 活动详情
*/
private List actContent;
+
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType;
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+ private String unitName;
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
+ private String serviceMatterName;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java
index c5387c8ce4..9855cee625 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java
@@ -161,4 +161,12 @@ public interface ActConstant {
String HANDLED="handled";
String RESET="reset";
+ /**
+ * 活动类型-爱心互助
+ */
+ String HEART = "heart";
+ /**
+ * 活动类型-联建活动
+ */
+ String PARTY = "party";
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
index fb0a64e4dc..1383924f57 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
@@ -1,7 +1,10 @@
package com.epmet.controller;
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.constant.ActConstant;
import com.epmet.dto.form.work.*;
import com.epmet.dto.result.work.*;
import com.epmet.service.WorkActService;
@@ -69,6 +72,23 @@ public class WorkActController {
return new Result().ok(workActService.publishAct(formDTO));
}
+ @PostMapping("publishV2")
+ public Result publishActV2(@RequestBody PublishActInfoFormDTO formDTO) {
+ if (ActConstant.HEART.equals(formDTO.getActType())) {
+ ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class);
+ } else {
+ ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class,
+ PublishActInfoFormDTO.AddUserInternalGroup.class, PublishActInfoFormDTO.AddPartyActivityGroup.class);
+ }
+ for (PublishActContentFormDTO actContentFormDTO : formDTO.getActContent()) {
+ ValidatorUtils.validateEntity(actContentFormDTO,
+ PublishActContentFormDTO.UserShowGroup.class,
+ PublishActContentFormDTO.UserInternalGroup.class
+ );
+ }
+ return new Result().ok(workActService.publishActV2(formDTO));
+ }
+
/**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO
@@ -130,9 +150,9 @@ public class WorkActController {
* @Date 2020/7/26 18:00
**/
@PostMapping("canceleddetail")
- public Result canceledDetail(@RequestBody ActIdFormDTO actIdFormDTO) {
+ public Result canceledDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO actIdFormDTO) {
ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class);
- return new Result().ok(workActService.canceledDetail(actIdFormDTO.getActId()));
+ return new Result().ok(workActService.canceledDetail(tokenDto.getCustomerId(), actIdFormDTO.getActId()));
}
/**
@@ -158,8 +178,9 @@ public class WorkActController {
* @Date 2020/7/26 21:01
**/
@PostMapping("finisheddetail")
- public Result finishedDeatil(@RequestBody ActIdFormDTO formDTO) {
+ public Result finishedDeatil(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class);
+ formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result().ok(workActService.finishedDeatil(formDTO));
}
@@ -171,9 +192,10 @@ public class WorkActController {
* @Date 2020/7/26 21:33
**/
@PostMapping("inprogressdetail")
- public Result inProgressDetail(@RequestBody ActIdFormDTO formDTO) {
+ public Result inProgressDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class);
- return new Result().ok(workActService.inProgressDetail(formDTO.getActId()));
+
+ return new Result().ok(workActService.inProgressDetail(tokenDto.getCustomerId(), formDTO.getActId()));
}
/**
@@ -229,9 +251,9 @@ public class WorkActController {
* @Date 2020/7/27 13:36
**/
@PostMapping("getactinfo")
- public Result getActInfo(@RequestBody ActIdFormDTO formDTO){
+ public Result getActInfo(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class);
- return new Result().ok(workActService.getActInfo(formDTO.getActId()));
+ return new Result().ok(workActService.getActInfo(tokenDto.getCustomerId(), formDTO.getActId()));
}
/**
@@ -253,5 +275,21 @@ public class WorkActController {
return new Result().ok(workActService.rePublish(rePublishFormDTO));
}
+ @PostMapping("republishV2")
+ public Result rePublishV2(@RequestBody RePublishFormDTO rePublishFormDTO) {
+ if (ActConstant.HEART.equals(rePublishFormDTO.getActType())) {
+ ValidatorUtils.validateEntity(rePublishFormDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class);
+ } else {
+ ValidatorUtils.validateEntity(rePublishFormDTO, RePublishFormDTO.AddUserShowGroup.class, RePublishFormDTO.AddUserInternalGroup.class);
+ }
+ for (PublishActContentFormDTO actContentFormDTO : rePublishFormDTO.getActContent()) {
+ ValidatorUtils.validateEntity(actContentFormDTO,
+ PublishActContentFormDTO.UserShowGroup.class,
+ PublishActContentFormDTO.UserInternalGroup.class
+ );
+ }
+ return new Result().ok(workActService.rePublishV2(rePublishFormDTO));
+ }
+
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java
index e227b29ed5..191e639b24 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java
@@ -18,7 +18,6 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
-
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -217,4 +216,24 @@ public class ActInfoEntity extends BaseEpmetEntity {
*/
private Boolean summaryFlag;
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType;
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
+
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java
index 529bb4f34a..4919fdd133 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java
@@ -53,6 +53,11 @@ public class IcPartyActivityEntity extends BaseEpmetEntity {
*/
private String pids;
+ /**
+ * act_info表ID
+ */
+ private String actId;
+
/**
* 单位ID
*/
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java
index 706cf0668b..491ed210f8 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java
@@ -182,4 +182,24 @@ public class LatestActInfoEntity extends BaseEpmetEntity {
* 数据库新增ACT_INFO_ID字段,act_info.id
*/
private String actInfoId;
+
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType;
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
index c3931bbd0b..c36db9b2d6 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
@@ -117,4 +117,22 @@ public interface IcPartyActivityService extends BaseService getActivityList(TokenDto tokenDto, PartyActivityFormDTO formDTO);
+
+ /**
+ * 根据爱心活动ID获取联建活动
+ * @Param actId
+ * @Return {@link IcPartyActivityDTO}
+ * @Author zhaoqifeng
+ * @Date 2021/12/23 16:13
+ */
+ IcPartyActivityDTO getActivityByActId(String actId);
+
+ /**
+ * 根据爱心活动ID删除联建活动
+ * @Param actId
+ * @Return {@link IcPartyActivityDTO}
+ * @Author zhaoqifeng
+ * @Date 2021/12/23 16:13
+ */
+ void deleteByActId(String actId);
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
index bc72cc7d67..d470f3571f 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
@@ -38,7 +38,7 @@ public interface WorkActService {
* @Date 2020/7/21 18:33
**/
PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO);
-
+ PublishActResultDTO publishActV2(PublishActInfoFormDTO formDTO);
/**
* @return com.epmet.dto.result.work.InProgressActResultDTO
* @param formDTO
@@ -82,7 +82,7 @@ public interface WorkActService {
* @description 已取消-活动详情
* @Date 2020/7/26 18:00
**/
- CanceledActDetailResultDTO canceledDetail(String actId);
+ CanceledActDetailResultDTO canceledDetail(String customerId, String actId);
/**
* @return void
@@ -109,7 +109,7 @@ public interface WorkActService {
* @description 进行中-活动详情
* @Date 2020/7/26 21:34
**/
- InProgressActDetailResultDTO inProgressDetail(String actId);
+ InProgressActDetailResultDTO inProgressDetail(String customerId, String actId);
/**
* @return void
@@ -136,7 +136,7 @@ public interface WorkActService {
* @description 重新编辑-获取活动详情
* @Date 2020/7/27 13:36
**/
- ReEditActInfoResultDTO getActInfo(String actId);
+ ReEditActInfoResultDTO getActInfo(String customerId, String actId);
/**
* @return com.epmet.dto.result.work.PublishActResultDTO
@@ -146,6 +146,6 @@ public interface WorkActService {
* @Date 2020/7/27 13:55
**/
PublishActResultDTO rePublish(RePublishFormDTO rePublishFormDTO);
-
+ PublishActResultDTO rePublishV2(RePublishFormDTO rePublishFormDTO);
void testGrantPoint(TestGrantFormDTO formDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
index 4057d1ba41..045b9564cc 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
@@ -382,6 +382,40 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl(dtoList, pageInfo.getTotal());
}
+ /**
+ * 根据爱心活动ID获取联建活动
+ *
+ * @param actId
+ * @Param actId
+ * @Return {@link IcPartyActivityDTO}
+ * @Author zhaoqifeng
+ * @Date 2021/12/23 16:13
+ */
+ @Override
+ public IcPartyActivityDTO getActivityByActId(String actId) {
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(IcPartyActivityEntity::getActId, actId);
+ IcPartyActivityEntity entity = baseDao.selectOne(wrapper);
+ return ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class);
+ }
+
+ /**
+ * 根据爱心活动ID删除联建活动
+ *
+ * @param actId
+ * @Param actId
+ * @Return {@link IcPartyActivityDTO}
+ * @Author zhaoqifeng
+ * @Date 2021/12/23 16:13
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void deleteByActId(String actId) {
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(IcPartyActivityEntity::getActId, actId);
+ baseDao.delete(wrapper);
+ }
+
/**
* 近30天开始时间和结束时间 (精确到秒)
* @Param formDTO
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
index 930d220fc7..6e2a67aa17 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
@@ -3,15 +3,16 @@ package com.epmet.service.impl;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.DateUtils;
+import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.LatestActContentDTO;
import com.epmet.dto.LatestActInfoDTO;
+import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.form.work.ActPreviewFormDTO;
import com.epmet.dto.form.work.DraftActContentFormDTO;
import com.epmet.dto.form.work.DraftActInfoFormDTO;
+import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.work.*;
-import com.epmet.service.LatestActContentService;
-import com.epmet.service.LatestActInfoService;
-import com.epmet.service.WorkActDraftService;
+import com.epmet.service.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -19,9 +20,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
/**
* 工作端活动草稿
@@ -38,6 +42,15 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
private LatestActInfoService latestActInfoService;
@Autowired
private LatestActContentService latestActContentService;
+ @Resource
+ private IcResiDemandDictService icResiDemandDictService;
+ @Resource
+ private IcPartyUnitService icPartyUnitService;
+
+ /**
+ * 服务事项code
+ */
+ private static final String SERVICE_MATTER_CODE = "1010";
/**
* @return com.epmet.dto.form.work.PublishActInitResultDTO
@@ -126,6 +139,20 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
if (null != actContent && actContent.size() > 0) {
actPreviewResultDTO.setActContent(actContent);
}
+
+ if (StringUtils.isNotBlank(actPreviewResultDTO.getServiceMatter())) {
+ //获取服务事项
+ SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
+ codeFormDTO.setCustomerId(formDTO.getCustomerId());
+ codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
+ Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
+ actPreviewResultDTO.setServiceMatterName(categoryMap.get(actPreviewResultDTO.getServiceMatter()));
+ }
+ if (StringUtils.isNotBlank(actPreviewResultDTO.getUnitId())) {
+ //获取单位名称
+ IcPartyUnitDTO unitDTO = icPartyUnitService.get(actPreviewResultDTO.getUnitId());
+ actPreviewResultDTO.setUnitName(unitDTO.getUnitName());
+ }
}
return actPreviewResultDTO;
}
@@ -258,6 +285,12 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
latestActInfoDTO.setVolunteerLimit(formDTO.getVolunteerLimit());
//审核开关:1报名人员需要人工审核0不需要
latestActInfoDTO.setAuditSwitch(formDTO.getAuditSwitch());
+
+ latestActInfoDTO.setActType(formDTO.getActType());
+ latestActInfoDTO.setUnitId(formDTO.getUnitId());
+ latestActInfoDTO.setTarget(formDTO.getTarget());
+ latestActInfoDTO.setServiceMatter(formDTO.getServiceMatter());
+
return latestActInfoDTO;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
index c1fcd18a57..244dd6f2cc 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
@@ -24,8 +24,10 @@ import com.epmet.dto.*;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
+import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.form.work.*;
import com.epmet.dto.result.ActSponsorResultDTO;
+import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.work.*;
import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
@@ -39,12 +41,10 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
/**
* 描述一下
@@ -54,7 +54,7 @@ import java.util.UUID;
*/
@Service
public class WorkActServiceImpl implements WorkActService {
- private Logger logger = LogManager.getLogger(WorkActServiceImpl.class);
+ private final Logger logger = LogManager.getLogger(WorkActServiceImpl.class);
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
@@ -95,9 +95,19 @@ public class WorkActServiceImpl implements WorkActService {
private UserKindnessTimeLogDao userKindnessTimeLogDao;
@Autowired
private LatestActInfoDao latestActInfoDao;
+ @Resource
+ private IcPartyActivityService icPartyActivityService;
+ @Resource
+ private IcResiDemandDictService icResiDemandDictService;
+ @Resource
+ private IcPartyUnitService icPartyUnitService;
+
+ /**
+ * 服务事项code
+ */
+ private static final String SERVICE_MATTER_CODE = "1010";
/**
- * @return void
* @author yinzuomei
* @description 发布活动-删除历史活动草稿
* @Date 2020/7/20 18:15
@@ -182,9 +192,55 @@ public class WorkActServiceImpl implements WorkActService {
return publishActResultDTO;
}
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public PublishActResultDTO publishActV2(PublishActInfoFormDTO formDTO) {
+ //构造属性保存活动属性,活动内容
+ ActInfoEntity actInfoEntity=this.constructActInfo(formDTO);
+ //校验参数
+
+ //校验 活动报名截止时间应该大于当前时间
+ if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){
+ throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg());
+ }
+ this.checkPublishFormDTO(actInfoEntity);
+ PublishActResultDTO publishActResultDTO=new PublishActResultDTO();
+ //内容审核(活动标题、招募要求、活动内容图文)
+ this.auditAct(formDTO);
+ logger.info("发布活动,审核成功");
+
+ actInfoDao.insert(actInfoEntity);
+ //如果用户之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系
+ if(StringUtils.isNotBlank(formDTO.getActDraftId())){
+ logger.info("更新latest_act_info表的act_info_id字段");
+ latestActInfoDao.updateActInfoId(formDTO.getActDraftId(),actInfoEntity.getId());
+ }
+ List actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId());
+ for(ActContentEntity actContentEntity:actContentEntityList){
+ actContentDao.insert(actContentEntity);
+ }
+ //插入一条操作日志
+ ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity();
+ actOperationRecEntity.setActId(actInfoEntity.getId());
+ actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_PUBLISH);
+ actOperationRecEntity.setNoticeUser(false);
+ actOperationRecEntity.setRemark(StrConstant.EPMETY_STR);
+ actOperationRecDao.insert(actOperationRecEntity);
+
+ //删除所有的草稿
+ this.deleteDraft();
+ publishActResultDTO.setActId(actInfoEntity.getId());
+
+ //添加信息到ic_party_activity
+ if (ActConstant.PARTY.equals(formDTO.getActType())) {
+ IcPartyActivityEntity activity = getPartyActivityEntity(formDTO, actInfoEntity);
+ icPartyActivityService.insert(activity);
+ }
+
+ return publishActResultDTO;
+ }
/**
- * @return void
* @param actInfoEntity
* @author yinzuomei
* @description 第一次发布
@@ -207,23 +263,6 @@ public class WorkActServiceImpl implements WorkActService {
}
}
- public static void main(String[] args) {
- SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-
- try {
- Date yesterDate=format.parse("2020-07-26 13:00:00");
- Date today=format.parse("2020-07-27 13:00:00");
- Date tommorrow=format.parse("2020-07-28 13:00:00");
- Date today1=format.parse("2020-07-27 13:00:00");
- System.out.println(yesterDate.compareTo(today));
- System.out.println(tommorrow.compareTo(today));
- System.out.println(today.compareTo(today1));
- } catch (ParseException e) {
- e.printStackTrace();
- }
-
- }
-
/**
* @return void
* @param formDTO
@@ -718,7 +757,10 @@ public class WorkActServiceImpl implements WorkActService {
if (wxmpMsg.success()) {
logger.info("给审核通过的用户推送微信订阅消息成功");
}
+
}
+ //取消活动,删除ic_party_activity对应的活动
+ icPartyActivityService.deleteByActId(formDTO.getActId());
}
@@ -730,7 +772,7 @@ public class WorkActServiceImpl implements WorkActService {
* @Date 2020/7/26 18:00
**/
@Override
- public CanceledActDetailResultDTO canceledDetail(String actId) {
+ public CanceledActDetailResultDTO canceledDetail(String customerId, String actId) {
CanceledActDetailResultDTO canceledActDetailResultDTO=actInfoDao.selectCanceledActInfo(actId);
if(null!=canceledActDetailResultDTO){
canceledActDetailResultDTO.setActContent(actContentDao.selectByActId(actId));
@@ -739,6 +781,20 @@ public class WorkActServiceImpl implements WorkActService {
}else{
canceledActDetailResultDTO.setIsMyPublish(false);
}
+
+ if (StringUtils.isNotBlank(canceledActDetailResultDTO.getServiceMatter())) {
+ //获取服务事项
+ SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
+ codeFormDTO.setCustomerId(customerId);
+ codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
+ Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
+ canceledActDetailResultDTO.setServiceMatterName(categoryMap.get(canceledActDetailResultDTO.getServiceMatter()));
+ }
+ if (StringUtils.isNotBlank(canceledActDetailResultDTO.getUnitId())) {
+ //获取单位名称
+ IcPartyUnitDTO unitDTO = icPartyUnitService.get(canceledActDetailResultDTO.getUnitId());
+ canceledActDetailResultDTO.setUnitName(unitDTO.getUnitName());
+ }
}
return canceledActDetailResultDTO;
}
@@ -783,6 +839,20 @@ public class WorkActServiceImpl implements WorkActService {
}else{
resultDTO.setIsMyPublish(false);
}
+
+ if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
+ //获取服务事项
+ SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
+ codeFormDTO.setCustomerId(customerId);
+ codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
+ Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
+ resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
+ }
+ if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
+ //获取单位名称
+ IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId());
+ resultDTO.setUnitName(unitDTO.getUnitName());
+ }
}
return resultDTO;
}
@@ -795,7 +865,7 @@ public class WorkActServiceImpl implements WorkActService {
* @Date 2020/7/26 21:34
**/
@Override
- public InProgressActDetailResultDTO inProgressDetail(String actId) {
+ public InProgressActDetailResultDTO inProgressDetail(String customerId, String actId) {
InProgressActDetailResultDTO resultDTO = actInfoDao.selectInProgressDetail(actId);
if (null != resultDTO) {
Date nowDate=new Date();
@@ -851,6 +921,19 @@ public class WorkActServiceImpl implements WorkActService {
}else{
resultDTO.setIsMyPublish(false);
}
+ if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
+ //获取服务事项
+ SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
+ codeFormDTO.setCustomerId(formDTO.getCustomerId());
+ codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
+ Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
+ resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
+ }
+ if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
+ //获取单位名称
+ IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId());
+ resultDTO.setUnitName(unitDTO.getUnitName());
+ }
}
return resultDTO;
}
@@ -1096,6 +1179,15 @@ public class WorkActServiceImpl implements WorkActService {
//拒绝发放积分总人数
actStatisticalDTO.setDenyRewardUserNum(actUserRelationDao.selectCountByReward(actId,ActConstant.ACT_USER_STATUS_DENY));
actStatisticalService.save(actStatisticalDTO);
+
+ //保存服务人数
+ IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(actId);
+ if (null != dto) {
+ IcPartyActivityEntity actInfoEntity = new IcPartyActivityEntity();
+ actInfoEntity.setId(dto.getId());
+ actInfoEntity.setPeopleCount(actStatisticalDTO.getSignedInUserNum());
+ icPartyActivityService.updateById(actInfoEntity);
+ }
}
/**
@@ -1189,6 +1281,15 @@ public class WorkActServiceImpl implements WorkActService {
//更新act_info表的SUMMARY_FLAG=true
actInfoDTO.setSummaryFlag(true);
actInfoService.update(actInfoDTO);
+
+ //保存活动结果
+ IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(formDTO.getActId());
+ if (null != dto) {
+ IcPartyActivityEntity actInfoEntity = new IcPartyActivityEntity();
+ actInfoEntity.setId(dto.getId());
+ actInfoEntity.setResult(getContent(formDTO.getActSummary()));
+ icPartyActivityService.updateById(actInfoEntity);
+ }
}
/**
@@ -1199,7 +1300,7 @@ public class WorkActServiceImpl implements WorkActService {
* @Date 2020/7/27 13:36
**/
@Override
- public ReEditActInfoResultDTO getActInfo(String actId) {
+ public ReEditActInfoResultDTO getActInfo(String customerId, String actId) {
ActInfoDTO actInfoDTO=actInfoService.get(actId);
if(null==actInfoDTO){
logger.error("act_info is null");
@@ -1215,6 +1316,21 @@ public class WorkActServiceImpl implements WorkActService {
resultDTO.setActId(actId);
List actContent=actContentDao.selectByActId(actId);
resultDTO.setActContent(actContent);
+
+ if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
+ //获取服务事项
+ SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
+ codeFormDTO.setCustomerId(customerId);
+ codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
+ Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
+ resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
+ }
+ if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
+ //获取单位名称
+ IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId());
+ resultDTO.setUnitName(unitDTO.getUnitName());
+ }
+
return resultDTO;
}
@@ -1276,5 +1392,108 @@ public class WorkActServiceImpl implements WorkActService {
return publishActResultDTO;
}
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public PublishActResultDTO rePublishV2(RePublishFormDTO rePublishFormDTO) {
+ ActInfoDTO originalActInfo=actInfoService.get(rePublishFormDTO.getActId());
+ if(null==originalActInfo){
+ logger.error("act_info is null");
+ throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
+ }
+ if(!originalActInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){
+ throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode());
+ }
+ if(!ActConstant.ACT_STATUS_PUBLISHED.equals(originalActInfo.getActStatus())){
+ throw new RenException("只有进行中的活动才可以编辑");
+ }
+ //构造属性保存活动属性,活动内容
+ ActInfoEntity newActInfoEntity=this.constructRePublishActInfo(rePublishFormDTO);
+ //校验参数
+ this.checkPublishFormDTO(newActInfoEntity);
+ PublishActResultDTO publishActResultDTO=new PublishActResultDTO();
+ //内容审核(活动标题、招募要求、活动内容图文)
+ this.auditRePublishAct(rePublishFormDTO);
+ logger.info("重新发布活动,审核成功");
+
+ newActInfoEntity.setId(rePublishFormDTO.getActId());
+ actInfoDao.updateById(newActInfoEntity);
+ //删除原来的
+ actContentDao.updateDelFlagByActId(rePublishFormDTO.getActId());
+ //插入编辑后的活动详情
+ List actContentEntityList=this.constructActContent(rePublishFormDTO.getActContent(),rePublishFormDTO.getActId());
+ for(ActContentEntity actContentEntity:actContentEntityList){
+ actContentDao.insert(actContentEntity);
+ }
+ //插入一条操作日志
+ ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity();
+ actOperationRecEntity.setActId(rePublishFormDTO.getActId());
+ actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_UPDATE);
+ actOperationRecEntity.setNoticeUser(rePublishFormDTO.getNoticePassedPeople());
+ actOperationRecEntity.setRemark(StrConstant.EPMETY_STR);
+ actOperationRecDao.insert(actOperationRecEntity);
+
+ //删除所有的草稿
+ this.deleteDraft();
+ publishActResultDTO.setActId(rePublishFormDTO.getActId());
+ //发送消息通知-暂时不做了,前端默认串的是不通知
+ //如果用户在重新发布之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系
+ if(StringUtils.isNotBlank(rePublishFormDTO.getActDraftId())){
+ latestActInfoDao.updateActInfoId(rePublishFormDTO.getActDraftId(),newActInfoEntity.getId());
+ }
+
+ //添加信息到ic_party_activity
+ if (ActConstant.PARTY.equals(rePublishFormDTO.getActType())) {
+ IcPartyActivityDTO activityDTO = icPartyActivityService.getActivityByActId(newActInfoEntity.getId());
+ if (null != activityDTO) {
+ IcPartyActivityEntity activity = getPartyActivityEntity(ConvertUtils.sourceToTarget(rePublishFormDTO, PublishActInfoFormDTO.class), newActInfoEntity);
+ activity.setId(activityDTO.getId());
+ icPartyActivityService.updateById(activity);
+ }
+ }
+
+ return publishActResultDTO;
+ }
+
+ /**
+ * 构建联建活动对象
+ * @Param formDTO
+ * @Return {@link IcPartyActivityEntity}
+ * @Author zhaoqifeng
+ * @Date 2021/12/23 14:32
+ */
+ private IcPartyActivityEntity getPartyActivityEntity(PublishActInfoFormDTO formDTO, ActInfoEntity actInfoEntity) {
+ IcPartyActivityEntity entity = new IcPartyActivityEntity();
+ entity.setCustomerId(actInfoEntity.getCustomerId());
+ entity.setAgencyId(actInfoEntity.getSponsorId());
+ Result result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId());
+ if(result.success()&&null!=result.getData()){
+ entity.setPids(result.getData().getPids());
+ }else{
+ logger.warn("根据agencyId查询组织信息失败,agencyId={}",formDTO.getSponsorId());
+ }
+ entity.setActId(actInfoEntity.getId());
+ entity.setUnitId(actInfoEntity.getUnitId());
+ entity.setServiceMatter(actInfoEntity.getServiceMatter());
+ entity.setTitle(actInfoEntity.getTitle());
+ entity.setTarget(actInfoEntity.getTarget());
+ entity.setContent(getContent(formDTO.getActContent()));
+ entity.setPeopleCount(NumConstant.ZERO);
+ entity.setActivityTime(actInfoEntity.getActStartTime());
+ entity.setAddress(actInfoEntity.getActAddress());
+ entity.setLongitude(actInfoEntity.getActLongitude().toPlainString());
+ entity.setLatitude(actInfoEntity.getActLatitude().toPlainString());
+ return entity;
+ }
+ private String getContent(List actContent) {
+ AtomicReference content = new AtomicReference<>("");
+ actContent.forEach(i -> {
+ if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(i.getContentType())) {
+ content.set(content.get().concat("").concat(i.getContent()).concat("
"));
+ } else {
+ content.set(content.get().concat("").concat(" ").concat("
"));
+ }
+ });
+ return content.get();
+ }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
index 4ce15b04c7..796fe5cd93 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
@@ -645,7 +645,11 @@
ai.SIGN_IN_START_TIME as signInStartTime,
ai.SIGN_IN_END_TIME as signInEndTime,
ai.SIGN_IN_ADDRESS as signInAddress,
- ai.SIGN_IN_RADIUS as signInRadius
+ ai.SIGN_IN_RADIUS as signInRadius,
+ ai.ACT_TYPE,
+ ai.UNIT_ID,
+ ai.SERVICE_MATTER,
+ ai.TARGET
FROM
act_info ai
WHERE
@@ -678,7 +682,11 @@
ai.SIGN_IN_START_TIME as signInStartTime,
ai.SIGN_IN_END_TIME as signInEndTime,
ai.SIGN_IN_ADDRESS as signInAddress,
- ai.SIGN_IN_RADIUS as signInRadius
+ ai.SIGN_IN_RADIUS as signInRadius,
+ ai.ACT_TYPE,
+ ai.UNIT_ID,
+ ai.SERVICE_MATTER,
+ ai.TARGET
FROM
act_info ai
WHERE
@@ -717,7 +725,11 @@
ai.SIGN_IN_START_TIME as signInStartTime,
ai.SIGN_IN_END_TIME as signInEndTime,
ai.SIGN_IN_ADDRESS as signInAddress,
- ai.SIGN_IN_RADIUS as signInRadius
+ ai.SIGN_IN_RADIUS as signInRadius,
+ ai.ACT_TYPE,
+ ai.UNIT_ID,
+ ai.SERVICE_MATTER,
+ ai.TARGET
FROM
act_info ai
WHERE
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml
index f0904b26a4..67f4cb64a7 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml
@@ -113,7 +113,11 @@
lai.REQUIREMENT AS requirement,
lai.SPONSOR_NAME AS sponsorName,
lai.SPONSOR_CONTACTS AS sponsorContacts,
- lai.SPONSOR_TEL AS sponsorTel
+ lai.SPONSOR_TEL AS sponsorTel,
+ lai.ACT_TYPE,
+ lai.UNIT_ID,
+ lai.SERVICE_MATTER,
+ lai.TARGET
FROM
latest_act_info lai
WHERE
From 8e92658b0d5e223920f75054cf1e6a1b2bd290f0 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Mon, 27 Dec 2021 12:44:21 +0800
Subject: [PATCH 29/56] change topic
---
.../constants/ConsomerGroupConstants.java | 7 +++-
.../rocketmq/constants/TopicConstants.java | 10 ++++--
.../CalPartyUnitSatisfactionFormDTO.java | 19 -----------
.../ServerSatisfactionCalFormDTO.java | 28 ++++++++++++++++
.../dto/result/demand/FinishResultDTO.java | 11 +++++--
.../controller/IcPartyUnitController.java | 6 ++--
.../controller/IcUserDemandRecController.java | 7 ++--
.../controller/ResiDemandController.java | 8 +++--
.../com/epmet/dao/IcUserDemandRecDao.java | 4 ++-
.../epmet/mq/RocketMQConsumerRegister.java | 8 ++---
...> ServerSatisfactionCalEventListener.java} | 32 +++++++++----------
.../com/epmet/service/IcPartyUnitService.java | 4 +--
.../epmet/service/IcUserDemandRecService.java | 5 +--
.../service/impl/IcPartyUnitServiceImpl.java | 7 ++--
.../impl/IcUserDemandRecServiceImpl.java | 9 +++---
.../service/impl/WorkActServiceImpl.java | 11 ++++---
.../resources/mapper/IcUserDemandRecDao.xml | 9 +++---
.../com/epmet/constant/SystemMessageType.java | 13 +++++---
.../impl/SystemMessageServiceImpl.java | 6 +++-
19 files changed, 125 insertions(+), 79 deletions(-)
delete mode 100644 epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java
create mode 100644 epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java
rename epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/{PartyUnitSatisfactionCalEventListener.java => ServerSatisfactionCalEventListener.java} (77%)
diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
index 67bfc91273..9bbd564ea2 100644
--- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
+++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
@@ -54,6 +54,11 @@ public interface ConsomerGroupConstants {
*/
String RESI_GROUP_POINT_OPERATION_GROUP = "resi_group_point_operation_group";
+ /**
+ * 社区服务(原居民需求)积分操作消费组
+ */
+ String COMMUNITY_SERVICE_POINT_OPERATION_GROUP = "community_service_point_operation_group";
+
/**
* 开放的对接数据(中间库) 组织变更事件监听器分组
*/
@@ -82,5 +87,5 @@ public interface ConsomerGroupConstants {
/**
* 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度
*/
- String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
+ String USER_DEMAND_FINISH_GROUP = "user_demand_finish_group";
}
diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
index bf0c23abab..f4c2d45e89 100644
--- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
+++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
@@ -55,9 +55,10 @@ public interface TopicConstants {
String IC_RESI_USER = "ic_resi_user";
/**
- * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度
+ * 需求完成
+ * 1、如果服务方是区域化党建单位,重新计算这个单位的满意度
*/
- String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
+ String USER_DEMAND = "user_demand";
/**
* 爱心互助
@@ -68,4 +69,9 @@ public interface TopicConstants {
* 楼院小组
*/
String RESI_GROUP = "resi_group";
+
+ /**
+ * 社区服务,原居民需求
+ */
+ String COMMUNITY_SERVICE="community_service";
}
diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java
deleted file mode 100644
index bfaf63703a..0000000000
--- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.epmet.commons.rocketmq.messages;
-
-
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
-
-/**
- * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度,或者直接计算整个客户
- */
-@Data
-public class CalPartyUnitSatisfactionFormDTO implements Serializable {
- public interface AddUserInternalGroup {
- }
- @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class)
- private String customerId;
- private String partyUnitId;
-}
diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java
new file mode 100644
index 0000000000..998d1523cb
--- /dev/null
+++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java
@@ -0,0 +1,28 @@
+package com.epmet.commons.rocketmq.messages;
+
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度,或者直接计算整个客户
+ */
+@Data
+public class ServerSatisfactionCalFormDTO implements Serializable {
+ public interface AddUserInternalGroup {
+ }
+ @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class)
+ private String customerId;
+ /**
+ * 服务方id:可以值区域化党建单位id
+ * 后面也可以是社会组织、社区自组织id...
+ */
+ private String serverId;
+ /**
+ * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
+ */
+ @NotBlank(message = "serviceType不能为空",groups = AddUserInternalGroup.class)
+ private String serviceType;
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
index db0bff7f8d..fb0ac6327a 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
@@ -6,12 +6,19 @@ import java.io.Serializable;
/**
* 完成需求时,是否需要计算 区域化党建单位的满意度
- *
*/
@Data
public class FinishResultDTO implements Serializable {
+ /**
+ * 服务方id:可以值区域化党建单位id、也可以是社会组织、社区自组织id、爱心互助的志愿者用户id
+ */
private String serverId;
+ /**
+ * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
+ */
private String serviceType;
- private Boolean grantPoint;
+ /**
+ * 奖励积分:只有服务方是志愿者且积分大于0时,才发放积分
+ */
private Integer awardPoint;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
index 27f193b978..5aaf4863fb 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
@@ -17,7 +17,7 @@
package com.epmet.controller;
-import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
+import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
@@ -189,8 +189,8 @@ public class IcPartyUnitController {
* @return
*/
@PostMapping("cal-partyunit-satisfation")
- public Result calPartyUnitSatisfation(@RequestBody CalPartyUnitSatisfactionFormDTO formDTO){
- ValidatorUtils.validateEntity(formDTO,CalPartyUnitSatisfactionFormDTO.AddUserInternalGroup.class);
+ public Result calPartyUnitSatisfation(@RequestBody ServerSatisfactionCalFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO,ServerSatisfactionCalFormDTO.AddUserInternalGroup.class);
icPartyUnitService.calPartyUnitSatisfation(formDTO);
return new Result();
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
index 31c250bc83..97e013eafc 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
@@ -17,7 +17,7 @@
package com.epmet.controller;
-import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
+import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
@@ -191,9 +191,10 @@ public class IcUserDemandRecController {
FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO);
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if(UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())){
- CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
+ ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
- mqMsg.setPartyUnitId(finishResultDTO.getServerId());
+ mqMsg.setServerId(finishResultDTO.getServerId());
+ mqMsg.setServiceType(finishResultDTO.getServiceType());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index 329d03d55e..1cc774248f 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -1,7 +1,7 @@
package com.epmet.controller;
-import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
+import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
@@ -122,9 +122,10 @@ public class ResiDemandController {
FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO);
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) {
- CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
+ ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
- mqMsg.setPartyUnitId(finishResultDTO.getServerId());
+ mqMsg.setServerId(finishResultDTO.getServerId());
+ mqMsg.setServiceType(finishResultDTO.getServiceType());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
@@ -132,6 +133,7 @@ public class ResiDemandController {
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// todo
// 志愿者发放积分
+
}
return new Result();
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
index 2ba049bd30..f03ece8c19 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
@@ -85,7 +85,9 @@ public interface IcUserDemandRecDao extends BaseDao {
@Param("startDateId") String startDateId,
@Param("endDateId") String endDateId);
- List selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId);
+ List selectGroupByServer(@Param("customerId") String customerId,
+ @Param("serverId") String serverId,
+ @Param("serviceType") String serviceType);
/**
* 居民端-需求大厅(未处理、处理中、已完成)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
index 3f599eefc0..2278c905e7 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
@@ -4,7 +4,7 @@ import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants;
import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.rocketmq.register.MQAbstractRegister;
import com.epmet.commons.rocketmq.register.MQConsumerProperties;
-import com.epmet.mq.listener.PartyUnitSatisfactionCalEventListener;
+import com.epmet.mq.listener.ServerSatisfactionCalEventListener;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import org.springframework.stereotype.Component;
@@ -20,11 +20,11 @@ public class RocketMQConsumerRegister extends MQAbstractRegister {
public void registerAllListeners(String env, MQConsumerProperties consumerProperties) {
// 客户初始化监听器注册
register(consumerProperties,
- ConsomerGroupConstants.CAL_PARTY_UNIT_SATISFACTION,
+ ConsomerGroupConstants.USER_DEMAND_FINISH_GROUP,
MessageModel.CLUSTERING,
- TopicConstants.CAL_PARTY_UNIT_SATISFACTION,
+ TopicConstants.USER_DEMAND,
"*",
- new PartyUnitSatisfactionCalEventListener());
+ new ServerSatisfactionCalEventListener());
// ...其他监听器类似
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/ServerSatisfactionCalEventListener.java
similarity index 77%
rename from epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java
rename to epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/ServerSatisfactionCalEventListener.java
index b7c3abc938..606a3801c3 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/ServerSatisfactionCalEventListener.java
@@ -2,13 +2,14 @@ package com.epmet.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
-import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
+import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
+import com.epmet.constant.SystemMessageType;
import com.epmet.service.IcPartyUnitService;
import org.apache.commons.lang.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
@@ -22,13 +23,7 @@ import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.concurrent.TimeUnit;
-/**
- * @Description 计算区域化党建单位,群众满意度=分数相加➗ 需求的总个数。
- * @author wxz
- * @date 2021.10.13 15:21:48
-*/
-public class PartyUnitSatisfactionCalEventListener implements MessageListenerConcurrently {
-
+public class ServerSatisfactionCalEventListener implements MessageListenerConcurrently {
private Logger logger = LoggerFactory.getLogger(getClass());
private RedisUtils redisUtils;
@@ -57,23 +52,28 @@ public class PartyUnitSatisfactionCalEventListener implements MessageListenerCon
String tags = messageExt.getTags();
String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL);
- logger.info("【计算区域化党建单位群众满意度事件监听器】-需求完成-收到消息内容:{},操作:{}", msg, tags);
- CalPartyUnitSatisfactionFormDTO obj = JSON.parseObject(msg, CalPartyUnitSatisfactionFormDTO.class);
+ logger.info("【需求完成计算服务方群众满意度事件监听器】-需求完成-收到消息内容:{},操作:{}", msg, tags);
+ ServerSatisfactionCalFormDTO obj = JSON.parseObject(msg, ServerSatisfactionCalFormDTO.class);
DistributedLock distributedLock = null;
RLock lock = null;
try {
distributedLock = SpringContextUtils.getBean(DistributedLock.class);
- lock = distributedLock.getLock(String.format("lock:ic_warn_stats:%s", obj.getCustomerId()),
+ lock = distributedLock.getLock(String.format("lock:user_demand:%s", obj.getCustomerId()),
30L, 30L, TimeUnit.SECONDS);
- //待执行方法
- SpringContextUtils.getBean(IcPartyUnitService.class).calPartyUnitSatisfation(obj);
+ switch (tags) {
+ case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION:
+ //区域化党建单位-计算群众满意度
+ SpringContextUtils.getBean(IcPartyUnitService.class).calPartyUnitSatisfation(obj);
+ break;
+ //后面社会组织、社区自组织可能都会计算....先预备着
+ }
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
- logger.error("【计算区域化党建单位群众满意度事件监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
+ logger.error("【需求完成计算服务方群众满意度事件监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
} catch (Exception e) {
// 不是我们自己抛出的异常,可以让MQ重试
- logger.error("【计算区域化党建单位群众满意度监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
+ logger.error("【需求完成计算服务方群众满意度监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
throw e;
} finally {
distributedLock.unLock(lock);
@@ -83,7 +83,7 @@ public class PartyUnitSatisfactionCalEventListener implements MessageListenerCon
try {
removePendingMqMsgCache(pendingMsgLabel);
} catch (Exception e) {
- logger.error("【计算区域化党建单位群众满意度监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
+ logger.error("【需求完成计算服务方群众满意度监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
index 16a96f8194..5108fb6dbc 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
@@ -18,8 +18,8 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
-import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@@ -147,7 +147,7 @@ public interface IcPartyUnitService extends BaseService {
* 计算区域化党建单位的群众满意度
* @param formDTO
*/
- void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO);
+ void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO);
List queryListById(List partyUnitIds);
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
index e912a301db..63cd2daf50 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
@@ -141,10 +141,11 @@ public interface IcUserDemandRecService extends BaseService groupByPartyUnit(String customerId, String partyUnitId);
+ List groupByServer(String customerId, String serverId,String serviceType);
/**
* 居民端-需求大厅(未处理、处理中、已完成)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
index 4141ceb9b6..43c0cd8bb0 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
@@ -22,7 +22,7 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
-import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
+import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
@@ -440,10 +440,11 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = icUserDemandRecService.groupByPartyUnit(formDTO.getCustomerId(), formDTO.getPartyUnitId());
+ List list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(),formDTO.getServiceType());
for (ServiceStatDTO serviceStatDTO : list) {
if (0 != serviceStatDTO.getDemandCount()) {
BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP);
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index 8f99ed7e9b..8d17d2f3c7 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -906,15 +906,16 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl groupByPartyUnit(String customerId, String partyUnitId) {
- if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(partyUnitId)){
+ public List groupByServer(String customerId, String serverId,String serviceType) {
+ if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(serverId)){
return new ArrayList<>();
}
- return baseDao.selectGroupByPartyUnit(customerId,partyUnitId);
+ return baseDao.selectGroupByServer(customerId,serverId,serviceType);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
index 244dd6f2cc..a54b43cce2 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
@@ -6,9 +6,7 @@ import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
-import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
-import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
@@ -17,7 +15,10 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.user.LoginUserUtil;
-import com.epmet.commons.tools.utils.*;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.DateUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.*;
import com.epmet.dao.*;
import com.epmet.dto.*;
@@ -843,7 +844,7 @@ public class WorkActServiceImpl implements WorkActService {
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
- codeFormDTO.setCustomerId(customerId);
+ codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
@@ -924,7 +925,7 @@ public class WorkActServiceImpl implements WorkActService {
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
- codeFormDTO.setCustomerId(formDTO.getCustomerId());
+ codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
index 6b8e7cf980..96eba189bf 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
@@ -397,7 +397,8 @@
-
+
+
SELECT
S.SERVER_ID AS serverId,
SUM( M.SCORE ) AS totalScore,
@@ -411,9 +412,9 @@
AND r.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND r.`STATUS` = 'finished'
- and s.SERVICE_TYPE ='party_unit'
-
- and s.server_id=#{partyUnitId}
+ and s.SERVICE_TYPE='#{serviceType}
+
+ and s.server_id=#{serverId}
group by s.SERVER_ID
diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
index 4418c1ebde..660693f986 100644
--- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
+++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
@@ -129,14 +129,14 @@ public interface SystemMessageType {
* 发布话题
*/
String PUBLISH_ONE_TOPIC = "publish_one_topic";
- /**
- * 对小组内话题进行15字以上评论
- */
- String PARTICIPATE_ONE_TOPIC = "participate_one_topic";
/**
* 话题被转为议题(小组中发布的话题被组长转为议题)
*/
String TOPIC_TO_ISSUE = "topic_to_issue";
+ /**
+ * 对小组内话题进行15字以上评论
+ */
+ String PARTICIPATE_ONE_TOPIC = "participate_one_topic";
/**
* 转话题为议题(将自建小组中话题转为议题)
*/
@@ -149,4 +149,9 @@ public interface SystemMessageType {
* 组长解决组内话题
*/
String LEADER_RESOLVE_TOPIC = "leader_resolve_topic";
+
+ /**
+ * 完成用户需求,需求人提交评价
+ */
+ String FINISH_USER_DEMAND="finish_user_demand";
}
diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
index 83b6c23e7e..4f668a3c5a 100644
--- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
+++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
@@ -193,7 +193,7 @@ public class SystemMessageServiceImpl implements SystemMessageService {
topic = TopicConstants.IC_RESI_USER;
break;
case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION:
- topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION;
+ topic=TopicConstants.USER_DEMAND;
break;
case SystemMessageType.INVITE_NEW_INTO_GROUP:
case SystemMessageType.INVITE_RESI_INTO_GROUP:
@@ -210,6 +210,10 @@ public class SystemMessageServiceImpl implements SystemMessageService {
case SystemMessageType.ACTIVE_INSERT_LIVE:
topic = TopicConstants.EPMET_HEART;
break;
+ //社区服务相关积分
+ case SystemMessageType.FINISH_USER_DEMAND:
+ topic=TopicConstants.COMMUNITY_SERVICE;
+ break;
}
return topic;
}
From 4e0650ceeec5b232f07edabd904829281ab3fc49 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Mon, 27 Dec 2021 14:35:04 +0800
Subject: [PATCH 30/56] =?UTF-8?q?=E8=AF=84=E4=BB=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../commons/tools/constant/MqConstant.java | 2 +
.../form/mq/eventmsg/BasePointEventMsg.java | 2 +
.../epmet/commons/tools/enums/EventEnum.java | 1 +
.../dto/result/demand/FinishResultDTO.java | 7 ++
.../epmet/constant/UserDemandConstant.java | 2 +
.../controller/IcUserDemandRecController.java | 26 +++++++-
.../controller/ResiDemandController.java | 27 +++++++-
.../impl/IcUserDemandRecServiceImpl.java | 13 ++++
.../epmet/mq/RocketMQConsumerRegister.java | 1 +
.../com/epmet/mq/listener/PointListener.java | 17 +++--
.../service/UserPointActionLogService.java | 6 ++
.../impl/UserPointActionLogServiceImpl.java | 65 +++++++++++++++++++
12 files changed, 161 insertions(+), 8 deletions(-)
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java
index 8ccaba98b4..8d458c4a60 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java
@@ -17,4 +17,6 @@ public interface MqConstant {
* 减分标识 minus
*/
String MINUS="minus";
+
+ String SOURCE_TYPE_DEMAND="demand";
}
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java
index 9235fe77a7..ff2849d331 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java
@@ -92,4 +92,6 @@ public class BasePointEventMsg implements Serializable {
private String eventTag;
private String eventClass;
+ private String objectId;
+ private String eventName;
}
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java
index 44d229ec3b..3cccd74d7a 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java
@@ -18,6 +18,7 @@ public enum EventEnum {
SHIFT_TOPIC_TO_ISSUE("shift_topic_to_issue","resi_group","转话题为议题(将自建小组中话题转为议题)"),
TOPIC_SHIFTED_TO_PROJECT("topic_to_project","resi_group","话题被转为项目"),
LEADER_RESOLVE_TOPIC("leader_resolve_topic","resi_group","组长解决组内话题"),
+ FINISH_USER_DEMAND("finish_user_demand","community_service","服务完成"),
;
private String eventClass;
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
index fb0ac6327a..53ae15ba01 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
@@ -21,4 +21,11 @@ public class FinishResultDTO implements Serializable {
* 奖励积分:只有服务方是志愿者且积分大于0时,才发放积分
*/
private Integer awardPoint;
+
+ /**
+ * 完成了XXX的需求
+ */
+ private String remark;
+ private String firstCategoryName;
+ private String categoryCode;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
index 9b4cf5ee00..4a78599455 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
@@ -76,4 +76,6 @@ public interface UserDemandConstant {
String DEMAND_PUBLISHER="publisher";
String DEMAND_SERVER="server";
+
+ String GRANT_POINT_REMARK="完成了%s的需求";
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
index 97e013eafc..2aec455511 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
@@ -19,7 +19,10 @@ package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
+import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
@@ -41,6 +44,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
import java.util.List;
@@ -200,8 +204,28 @@ public class IcUserDemandRecController {
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
- // todo
// 志愿者发放积分
+ List actPointEventMsgList = new ArrayList<>();
+ BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
+ actPointEventMsg.setCustomerId(formDTO.getCustomerId());
+ actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
+ actPointEventMsg.setSourceId(formDTO.getDemandRecId());
+ actPointEventMsg.setUserId(finishResultDTO.getServerId());
+ actPointEventMsg.setActionFlag(MqConstant.PLUS);
+ actPointEventMsg.setIsCommon(false);
+ actPointEventMsg.setRemark(finishResultDTO.getRemark());
+ actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
+ actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
+ actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
+ actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
+ actPointEventMsgList.add(actPointEventMsg);
+ SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
+ sendMsgForm.setContent(actPointEventMsgList);
+ sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
+ Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
+ if (!mqResult.success()) {
+ log.error(String.format("demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId()));
+ }
}
return new Result();
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index 1cc774248f..f870444ee9 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -4,8 +4,11 @@ package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
+import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
+import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@@ -24,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import java.util.ArrayList;
import java.util.List;
@@ -131,9 +135,28 @@ public class ResiDemandController {
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
- // todo
// 志愿者发放积分
-
+ List actPointEventMsgList = new ArrayList<>();
+ BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
+ actPointEventMsg.setCustomerId(formDTO.getCustomerId());
+ actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
+ actPointEventMsg.setSourceId(formDTO.getDemandRecId());
+ actPointEventMsg.setUserId(finishResultDTO.getServerId());
+ actPointEventMsg.setActionFlag(MqConstant.PLUS);
+ actPointEventMsg.setIsCommon(false);
+ actPointEventMsg.setRemark(finishResultDTO.getRemark());
+ actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
+ actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
+ actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
+ actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
+ actPointEventMsgList.add(actPointEventMsg);
+ SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
+ sendMsgForm.setContent(actPointEventMsgList);
+ sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
+ Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
+ if (!mqResult.success()) {
+ log.error(String.format("需求评价完成:demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId()));
+ }
}
return new Result();
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index 8d17d2f3c7..2233765ddc 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -451,6 +451,13 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl formDTO = JSON.parseArray(msg, BasePointEventMsg.class);
+ userPointActionLogService.grantServerPoint(formDTO);
+ }
/**
* @description
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java
index b156816c80..360edcb9cb 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java
@@ -119,6 +119,12 @@ public interface UserPointActionLogService extends BaseService grantPointParam);
+ /**
+ * 需求完成-志愿者发放积分
+ * @param grantPointParam
+ */
+ void grantServerPoint(List grantPointParam);
+
/**
* @Description 通过事件推送进行积分加减
* @param event
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
index 45bbb65790..4ede07c03d 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
@@ -578,4 +578,69 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl baseDao.selectPageResiPoin(formDTO));
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}
+
+ /**
+ * 需求完成,给志愿者发放积分
+ * @param list
+ */
+ @Override
+ public void grantServerPoint(List list){
+ if (CollectionUtils.isEmpty(list)){
+ return;
+ }
+ list.forEach(grantPoint->{
+ if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,grantPoint.getActionFlag())){
+ //减
+ if(grantPoint.getPoint() > NumConstant.ZERO){
+ //保证负数
+ grantPoint.setPoint(grantPoint.getPoint() * NumConstant.ONE_NEG);
+ }
+ }else{
+ //加
+ if(grantPoint.getPoint() < NumConstant.ZERO){
+ //保证正数
+ grantPoint.setPoint(grantPoint.getPoint() * NumConstant.ONE_NEG);
+ }
+ }
+ //1.新增用户积分行为记录
+ UserPointActionLogEntity action = new UserPointActionLogEntity();
+ action.setCustomerId(grantPoint.getCustomerId());
+ action.setPoint(grantPoint.getPoint());
+ //完成了XXX的需求
+ action.setEventStatement(grantPoint.getRemark());
+ //需求分类表中一级分类的名称
+ action.setEventId(EventEnum.FINISH_USER_DEMAND.getEventTag());
+ action.setActionFlag(grantPoint.getActionFlag());
+ action.setUserId(grantPoint.getUserId());
+ action.setCreatedBy(grantPoint.getOperatorId());
+ action.setUpdatedBy(grantPoint.getOperatorId());
+ action.setSourceType(grantPoint.getSourceType());
+ action.setSourceId(grantPoint.getSourceId());
+ // 需求所属分类编码,对应objectId
+ action.setObjectId(grantPoint.getObjectId());
+ //需求所属分类-一级分类名称
+ action.setEventName(grantPoint.getEventName());
+ baseDao.insert(action);
+ //2.新增/修改用户积分日统计
+ DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date());
+ UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal,UserPointStatisticalDailyEntity.class);
+ statistical.setPointChange(grantPoint.getPoint());
+ statistical.setActionFlag(grantPoint.getActionFlag());
+ statistical.setCustomerId(grantPoint.getCustomerId());
+ statistical.setUserId(grantPoint.getUserId());
+ statistical.setCreatedBy(grantPoint.getOperatorId());
+ statistical.setUpdatedBy(grantPoint.getOperatorId());
+ userPointStatisticalDailyService.insertOrUpdate(statistical);
+ //3.新增/修改用户积分日统计
+ UserPointTotalEntity point = new UserPointTotalEntity();
+ point.setCustomerId(grantPoint.getCustomerId());
+ point.setUserId(grantPoint.getUserId());
+ point.setTotalPoint(grantPoint.getPoint());
+ point.setUsablePoint(grantPoint.getPoint());
+ point.setUsedPoint(NumConstant.ZERO);
+ point.setCreatedBy(grantPoint.getOperatorId());
+ point.setUpdatedBy(grantPoint.getOperatorId());
+ userPointTotalService.insertOrUpdate(point);
+ });
+ }
}
\ No newline at end of file
From 5a14bca4da90285b5fccd97ff1b5a875eef25ae8 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Mon, 27 Dec 2021 15:11:12 +0800
Subject: [PATCH 31/56] =?UTF-8?q?=E5=8F=91=E5=88=86=E5=92=8B=E4=B8=8D?=
=?UTF-8?q?=E7=BB=99=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/controller/IcUserDemandRecController.java | 1 +
.../src/main/java/com/epmet/controller/ResiDemandController.java | 1 +
2 files changed, 2 insertions(+)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
index 2aec455511..8627843a8d 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
@@ -218,6 +218,7 @@ public class IcUserDemandRecController {
actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
+ actPointEventMsg.setPoint(finishResultDTO.getAwardPoint());
actPointEventMsgList.add(actPointEventMsg);
SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
sendMsgForm.setContent(actPointEventMsgList);
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index f870444ee9..f9b78dfcf2 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -149,6 +149,7 @@ public class ResiDemandController {
actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
+ actPointEventMsg.setPoint(finishResultDTO.getAwardPoint());
actPointEventMsgList.add(actPointEventMsg);
SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
sendMsgForm.setContent(actPointEventMsgList);
From 0a52bad8f2a491f1a731f22e1963b460bea86147 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Mon, 27 Dec 2021 16:19:29 +0800
Subject: [PATCH 32/56] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E4=B8=8D=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/epmet/dto/IcUserDemandRecDTO.java | 7 ++
.../dto/result/demand/FinishResultDTO.java | 4 +
.../feign/EpmetHeartOpenFeignClient.java | 7 ++
.../EpmetHeartOpenFeignClientFallback.java | 10 +++
.../controller/IcUserDemandRecController.java | 68 ++++++++--------
.../controller/ResiDemandController.java | 79 +++++++++++--------
.../com/epmet/dao/IcUserDemandRecDao.java | 3 +
.../epmet/service/IcUserDemandRecService.java | 5 ++
.../impl/IcUserDemandRecServiceImpl.java | 36 ++++++---
.../resources/mapper/IcUserDemandRecDao.xml | 17 ++++
.../epmet-job/epmet-job-server/pom.xml | 6 ++
.../epmet/task/AutoEvaluateDemandTask.java | 24 ++++++
.../impl/UserPointActionLogServiceImpl.java | 13 ---
13 files changed, 189 insertions(+), 90 deletions(-)
create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java
index b070d80073..30b24a8498 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java
@@ -145,6 +145,11 @@ public class IcUserDemandRecDTO implements Serializable {
*/
private Boolean evaluateFlag;
+ /**
+ * 奖励积分
+ */
+ private Integer awardPoint;
+
/**
* 删除标识:0.未删除 1.已删除
*/
@@ -175,4 +180,6 @@ public class IcUserDemandRecDTO implements Serializable {
*/
private Date updatedTime;
+ private String serverId;
+ private String serviceType;
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
index 53ae15ba01..8ea54cc72f 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
@@ -22,6 +22,10 @@ public class FinishResultDTO implements Serializable {
*/
private Integer awardPoint;
+ /**
+ * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录
+ */
+ private Boolean evaluateFlag;
/**
* 完成了XXX的需求
*/
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
index a21cccb8f3..9dffeb784e 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
@@ -67,4 +67,11 @@ public interface EpmetHeartOpenFeignClient {
*/
@PostMapping("/heart/resi/volunteer/page")
Result> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input);
+
+ /**
+ * 服务方填写实际服务时间,并点击确认后。 7天内需求人未作出评价,默认完成情况为已完成,五星好评,为服务方发放积分
+ * @return
+ */
+ @PostMapping("/heart/residemand/autoevaluate")
+ Result AutoEvaluateDemand();
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
index 27c2c9bdc8..f4e19d0906 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
@@ -60,4 +60,14 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result> queryVolunteerPage(VolunteerCommonFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryVolunteerPage", input);
}
+
+ /**
+ * 服务方填写实际服务时间,并点击确认后。 7天内需求人未作出评价,默认完成情况为已完成,五星好评,为服务方发放积分
+ *
+ * @return
+ */
+ @Override
+ public Result AutoEvaluateDemand() {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "autoEvaluate");
+ }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
index 8627843a8d..4a71e4d5e3 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
@@ -193,39 +193,41 @@ public class IcUserDemandRecController {
formDTO.setUserType(UserDemandConstant.STAFF);
ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.IcShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO);
- //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
- if(UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())){
- ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO();
- mqMsg.setCustomerId(formDTO.getCustomerId());
- mqMsg.setServerId(finishResultDTO.getServerId());
- mqMsg.setServiceType(finishResultDTO.getServiceType());
- SystemMsgFormDTO form = new SystemMsgFormDTO();
- form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
- form.setContent(mqMsg);
- epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
- } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
- // 志愿者发放积分
- List actPointEventMsgList = new ArrayList<>();
- BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
- actPointEventMsg.setCustomerId(formDTO.getCustomerId());
- actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
- actPointEventMsg.setSourceId(formDTO.getDemandRecId());
- actPointEventMsg.setUserId(finishResultDTO.getServerId());
- actPointEventMsg.setActionFlag(MqConstant.PLUS);
- actPointEventMsg.setIsCommon(false);
- actPointEventMsg.setRemark(finishResultDTO.getRemark());
- actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
- actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
- actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
- actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
- actPointEventMsg.setPoint(finishResultDTO.getAwardPoint());
- actPointEventMsgList.add(actPointEventMsg);
- SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
- sendMsgForm.setContent(actPointEventMsgList);
- sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
- Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
- if (!mqResult.success()) {
- log.error(String.format("demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId()));
+ if(finishResultDTO.getEvaluateFlag()){
+ //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
+ if(UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())){
+ ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO();
+ mqMsg.setCustomerId(formDTO.getCustomerId());
+ mqMsg.setServerId(finishResultDTO.getServerId());
+ mqMsg.setServiceType(finishResultDTO.getServiceType());
+ SystemMsgFormDTO form = new SystemMsgFormDTO();
+ form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
+ form.setContent(mqMsg);
+ epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
+ } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && null != finishResultDTO.getAwardPoint() && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
+ // 志愿者发放积分
+ List actPointEventMsgList = new ArrayList<>();
+ BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
+ actPointEventMsg.setCustomerId(formDTO.getCustomerId());
+ actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
+ actPointEventMsg.setSourceId(formDTO.getDemandRecId());
+ actPointEventMsg.setUserId(finishResultDTO.getServerId());
+ actPointEventMsg.setActionFlag(MqConstant.PLUS);
+ actPointEventMsg.setIsCommon(false);
+ actPointEventMsg.setRemark(finishResultDTO.getRemark());
+ actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
+ actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
+ actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
+ actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
+ actPointEventMsg.setPoint(finishResultDTO.getAwardPoint());
+ actPointEventMsgList.add(actPointEventMsg);
+ SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
+ sendMsgForm.setContent(actPointEventMsgList);
+ sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
+ Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
+ if (!mqResult.success()) {
+ log.error(String.format("demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId()));
+ }
}
}
return new Result();
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index f9b78dfcf2..fbdbc7afca 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -124,39 +124,41 @@ public class ResiDemandController {
formDTO.setApp(tokenDto.getApp());
ValidatorUtils.validateEntity(formDTO, EvaluateDemandFormDTO.ShowGroup.class, EvaluateDemandFormDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO);
- //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
- if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) {
- ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO();
- mqMsg.setCustomerId(formDTO.getCustomerId());
- mqMsg.setServerId(finishResultDTO.getServerId());
- mqMsg.setServiceType(finishResultDTO.getServiceType());
- SystemMsgFormDTO form = new SystemMsgFormDTO();
- form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
- form.setContent(mqMsg);
- epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
- } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
- // 志愿者发放积分
- List actPointEventMsgList = new ArrayList<>();
- BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
- actPointEventMsg.setCustomerId(formDTO.getCustomerId());
- actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
- actPointEventMsg.setSourceId(formDTO.getDemandRecId());
- actPointEventMsg.setUserId(finishResultDTO.getServerId());
- actPointEventMsg.setActionFlag(MqConstant.PLUS);
- actPointEventMsg.setIsCommon(false);
- actPointEventMsg.setRemark(finishResultDTO.getRemark());
- actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
- actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
- actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
- actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
- actPointEventMsg.setPoint(finishResultDTO.getAwardPoint());
- actPointEventMsgList.add(actPointEventMsg);
- SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
- sendMsgForm.setContent(actPointEventMsgList);
- sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
- Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
- if (!mqResult.success()) {
- log.error(String.format("需求评价完成:demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId()));
+ if(finishResultDTO.getEvaluateFlag()){
+ //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
+ if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) {
+ ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO();
+ mqMsg.setCustomerId(formDTO.getCustomerId());
+ mqMsg.setServerId(finishResultDTO.getServerId());
+ mqMsg.setServiceType(finishResultDTO.getServiceType());
+ SystemMsgFormDTO form = new SystemMsgFormDTO();
+ form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
+ form.setContent(mqMsg);
+ epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
+ } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && null != finishResultDTO.getAwardPoint() && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
+ // 志愿者发放积分
+ List actPointEventMsgList = new ArrayList<>();
+ BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
+ actPointEventMsg.setCustomerId(formDTO.getCustomerId());
+ actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
+ actPointEventMsg.setSourceId(formDTO.getDemandRecId());
+ actPointEventMsg.setUserId(finishResultDTO.getServerId());
+ actPointEventMsg.setActionFlag(MqConstant.PLUS);
+ actPointEventMsg.setIsCommon(false);
+ actPointEventMsg.setRemark(finishResultDTO.getRemark());
+ actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
+ actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
+ actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
+ actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
+ actPointEventMsg.setPoint(finishResultDTO.getAwardPoint());
+ actPointEventMsgList.add(actPointEventMsg);
+ SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
+ sendMsgForm.setContent(actPointEventMsgList);
+ sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
+ Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
+ if (!mqResult.success()) {
+ log.error(String.format("需求评价完成:demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId()));
+ }
}
}
return new Result();
@@ -242,4 +244,15 @@ public class ResiDemandController {
ValidatorUtils.validateEntity(formDTO, UserDemandRelFormDTO.AddInternalGroup.class);
return new Result().ok(icUserDemandRecService.queryUserDemandRel(formDTO));
}
+
+ /**
+ * 服务方填写实际服务时间,并点击确认后。 7天内需求人未作出评价,默认完成情况为已完成,五星好评,为服务方发放积分
+ *
+ * @return
+ */
+ @PostMapping("autoevaluate")
+ public Result autoEvaluate(){
+ icUserDemandRecService.autoEvaluate();
+ return new Result();
+ }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
index f03ece8c19..6d11009c14 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
@@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.demand.IcResiUserDemandFromDTO;
import com.epmet.dto.form.demand.PageListAnalysisFormDTO;
import com.epmet.dto.form.demand.UserDemandPageFormDTO;
@@ -111,4 +112,6 @@ public interface IcUserDemandRecDao extends BaseDao {
List queryMyDemandForResiClient(@Param("gridId") String gridId,
@Param("type")String type,
@Param("demandUserId")String demandUserId);
+
+ List selectNoEvaluate();
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
index 63cd2daf50..57e5192dc8 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
@@ -213,4 +213,9 @@ public interface IcUserDemandRecService extends BaseService list=baseDao.selectNoEvaluate();
+
+ }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
index 96eba189bf..6e7c5f60aa 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
@@ -496,4 +496,21 @@
order by r.WANT_SERVICE_TIME asc
+
+
+ SELECT
+ r.*,
+ s.SERVER_ID,
+ s.SERVICE_TYPE
+ FROM
+ ic_user_demand_rec r
+ INNER JOIN ic_user_demand_service s ON ( r.id = s.demand_rec_id )
+ WHERE
+ r.DEL_FLAG = '0'
+ AND r.`STATUS` = 'finished'
+ AND r.EVALUATE_FLAG = '0'
+ and s.SERVICE_START_TIME is not NULL
+ and s.SERVICE_END_TIME is not null
+ and timestampdiff(day,s.UPDATED_TIME,now()) >7
+
\ No newline at end of file
diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml
index 4ebf4f1fd3..5c1655d562 100644
--- a/epmet-module/epmet-job/epmet-job-server/pom.xml
+++ b/epmet-module/epmet-job/epmet-job-server/pom.xml
@@ -90,6 +90,12 @@
2.0.0
compile
+
+ com.epmet
+ epmet-heart-client
+ 2.0.0
+ compile
+
diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java
new file mode 100644
index 0000000000..1f1f2e74f9
--- /dev/null
+++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java
@@ -0,0 +1,24 @@
+package com.epmet.task;
+
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.feign.EpmetHeartOpenFeignClient;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author yinzuomei
+ * @dscription 每天晚上23:50执行,需求已完成,未评分的自动评分=》发放积分,计算满意度
+ */
+@Slf4j
+@Component("resiEventAutoAuditTask")
+public class AutoEvaluateDemandTask implements ITask {
+ @Autowired
+ private EpmetHeartOpenFeignClient heartOpenFeignClient;
+
+ @Override
+ public void run(String params) {
+ Result result = heartOpenFeignClient.AutoEvaluateDemand();
+ }
+}
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
index 4ede07c03d..3c1b72151a 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
@@ -589,19 +589,6 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl{
- if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,grantPoint.getActionFlag())){
- //减
- if(grantPoint.getPoint() > NumConstant.ZERO){
- //保证负数
- grantPoint.setPoint(grantPoint.getPoint() * NumConstant.ONE_NEG);
- }
- }else{
- //加
- if(grantPoint.getPoint() < NumConstant.ZERO){
- //保证正数
- grantPoint.setPoint(grantPoint.getPoint() * NumConstant.ONE_NEG);
- }
- }
//1.新增用户积分行为记录
UserPointActionLogEntity action = new UserPointActionLogEntity();
action.setCustomerId(grantPoint.getCustomerId());
From ac3b50d029f93f9f023f937f701ef4b1860edc44 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Mon, 27 Dec 2021 17:03:42 +0800
Subject: [PATCH 33/56] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E4=B8=8D=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/java/com/epmet/constant/UserDemandConstant.java | 2 +-
.../com/epmet/service/impl/IcUserDemandRecServiceImpl.java | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
index 4a78599455..beb25ce050 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
@@ -77,5 +77,5 @@ public interface UserDemandConstant {
String DEMAND_PUBLISHER="publisher";
String DEMAND_SERVER="server";
- String GRANT_POINT_REMARK="完成了%s的需求";
+ String GRANT_POINT_REMARK="完成了%s的需求:%s";
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index 7d6071fdab..f8a40d37c9 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -453,7 +453,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl 100 ? entity.getContent().substring(0, 99) : entity.getContent();
+ finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content));
}
//4、修改主表状态为已完成
@@ -1089,7 +1090,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl 100 ? entity.getContent().substring(0, 99) : entity.getContent();
+ finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content));
//5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自XXX(需求人姓名)的评价,请查看。
sendVolunnterEvaluated(entity);
return finishResultDTO;
From 6bee625a4e2e5b98739185568a732c343626829d Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Mon, 27 Dec 2021 17:08:01 +0800
Subject: [PATCH 34/56] =?UTF-8?q?=E6=8B=A6=E4=B8=8D=E4=BD=8F=E4=BA=86?=
=?UTF-8?q?=E5=90=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../impl/UserPointActionLogServiceImpl.java | 80 ++++++++++---------
1 file changed, 41 insertions(+), 39 deletions(-)
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
index 3c1b72151a..583a0c0e61 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
@@ -589,45 +589,47 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl{
- //1.新增用户积分行为记录
- UserPointActionLogEntity action = new UserPointActionLogEntity();
- action.setCustomerId(grantPoint.getCustomerId());
- action.setPoint(grantPoint.getPoint());
- //完成了XXX的需求
- action.setEventStatement(grantPoint.getRemark());
- //需求分类表中一级分类的名称
- action.setEventId(EventEnum.FINISH_USER_DEMAND.getEventTag());
- action.setActionFlag(grantPoint.getActionFlag());
- action.setUserId(grantPoint.getUserId());
- action.setCreatedBy(grantPoint.getOperatorId());
- action.setUpdatedBy(grantPoint.getOperatorId());
- action.setSourceType(grantPoint.getSourceType());
- action.setSourceId(grantPoint.getSourceId());
- // 需求所属分类编码,对应objectId
- action.setObjectId(grantPoint.getObjectId());
- //需求所属分类-一级分类名称
- action.setEventName(grantPoint.getEventName());
- baseDao.insert(action);
- //2.新增/修改用户积分日统计
- DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date());
- UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal,UserPointStatisticalDailyEntity.class);
- statistical.setPointChange(grantPoint.getPoint());
- statistical.setActionFlag(grantPoint.getActionFlag());
- statistical.setCustomerId(grantPoint.getCustomerId());
- statistical.setUserId(grantPoint.getUserId());
- statistical.setCreatedBy(grantPoint.getOperatorId());
- statistical.setUpdatedBy(grantPoint.getOperatorId());
- userPointStatisticalDailyService.insertOrUpdate(statistical);
- //3.新增/修改用户积分日统计
- UserPointTotalEntity point = new UserPointTotalEntity();
- point.setCustomerId(grantPoint.getCustomerId());
- point.setUserId(grantPoint.getUserId());
- point.setTotalPoint(grantPoint.getPoint());
- point.setUsablePoint(grantPoint.getPoint());
- point.setUsedPoint(NumConstant.ZERO);
- point.setCreatedBy(grantPoint.getOperatorId());
- point.setUpdatedBy(grantPoint.getOperatorId());
- userPointTotalService.insertOrUpdate(point);
+ if (null != grantPoint.getPoint()) {
+ //1.新增用户积分行为记录
+ UserPointActionLogEntity action = new UserPointActionLogEntity();
+ action.setCustomerId(grantPoint.getCustomerId());
+ action.setPoint(grantPoint.getPoint());
+ //完成了XXX的需求
+ action.setEventStatement(grantPoint.getRemark());
+ //需求分类表中一级分类的名称
+ action.setEventId(EventEnum.FINISH_USER_DEMAND.getEventTag());
+ action.setActionFlag(grantPoint.getActionFlag());
+ action.setUserId(grantPoint.getUserId());
+ action.setCreatedBy(grantPoint.getOperatorId());
+ action.setUpdatedBy(grantPoint.getOperatorId());
+ action.setSourceType(grantPoint.getSourceType());
+ action.setSourceId(grantPoint.getSourceId());
+ // 需求所属分类编码,对应objectId
+ action.setObjectId(grantPoint.getObjectId());
+ //需求所属分类-一级分类名称
+ action.setEventName(grantPoint.getEventName());
+ baseDao.insert(action);
+ //2.新增/修改用户积分日统计
+ DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date());
+ UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal, UserPointStatisticalDailyEntity.class);
+ statistical.setPointChange(grantPoint.getPoint());
+ statistical.setActionFlag(grantPoint.getActionFlag());
+ statistical.setCustomerId(grantPoint.getCustomerId());
+ statistical.setUserId(grantPoint.getUserId());
+ statistical.setCreatedBy(grantPoint.getOperatorId());
+ statistical.setUpdatedBy(grantPoint.getOperatorId());
+ userPointStatisticalDailyService.insertOrUpdate(statistical);
+ //3.新增/修改用户积分日统计
+ UserPointTotalEntity point = new UserPointTotalEntity();
+ point.setCustomerId(grantPoint.getCustomerId());
+ point.setUserId(grantPoint.getUserId());
+ point.setTotalPoint(grantPoint.getPoint());
+ point.setUsablePoint(grantPoint.getPoint());
+ point.setUsedPoint(NumConstant.ZERO);
+ point.setCreatedBy(grantPoint.getOperatorId());
+ point.setUpdatedBy(grantPoint.getOperatorId());
+ userPointTotalService.insertOrUpdate(point);
+ }
});
}
}
\ No newline at end of file
From c09580cb933d1d16d84f165f080e365585cefa67 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Mon, 27 Dec 2021 17:34:04 +0800
Subject: [PATCH 35/56] '
---
.../src/main/resources/mapper/IcUserDemandRecDao.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
index 6e7c5f60aa..dbeb852712 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
@@ -412,7 +412,7 @@
AND r.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND r.`STATUS` = 'finished'
- and s.SERVICE_TYPE='#{serviceType}
+ and s.SERVICE_TYPE=#{serviceType}
and s.server_id=#{serverId}
From 70d921f2f8cb58713a8ab961c5b8b10abfb2a526 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Tue, 28 Dec 2021 09:29:45 +0800
Subject: [PATCH 36/56] =?UTF-8?q?job=E5=92=8Cheart?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dto/form/AutoEvaluateDemandFormDTO.java | 15 +++
.../dto/result/demand/FinishResultDTO.java | 1 +
.../feign/EpmetHeartOpenFeignClient.java | 3 +-
.../EpmetHeartOpenFeignClientFallback.java | 5 +-
.../epmet/constant/UserDemandConstant.java | 6 +-
.../controller/ResiDemandController.java | 5 +-
.../com/epmet/dao/IcUserDemandRecDao.java | 4 +-
.../IcUserDemandSatisfactionEntity.java | 2 +-
.../epmet/service/IcUserDemandRecService.java | 3 +-
.../IcUserDemandSatisfactionService.java | 11 ++
.../impl/IcUserDemandRecServiceImpl.java | 46 +++++++-
.../IcUserDemandSatisfactionServiceImpl.java | 109 ++++++++++++++++++
.../resources/mapper/IcUserDemandRecDao.xml | 14 ++-
.../epmet/task/AutoEvaluateDemandTask.java | 9 +-
14 files changed, 218 insertions(+), 15 deletions(-)
create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java
create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandSatisfactionService.java
create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java
new file mode 100644
index 0000000000..fd716562ae
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java
@@ -0,0 +1,15 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 自动评价参数
+ */
+@Data
+public class AutoEvaluateDemandFormDTO implements Serializable {
+ private String customerId;
+ private Integer exceedDay;
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
index 8ea54cc72f..77f86a5f43 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
@@ -32,4 +32,5 @@ public class FinishResultDTO implements Serializable {
private String remark;
private String firstCategoryName;
private String categoryCode;
+ private String demandRecId;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
index 9dffeb784e..d4f3c8c92d 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
@@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
+import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
@@ -73,5 +74,5 @@ public interface EpmetHeartOpenFeignClient {
* @return
*/
@PostMapping("/heart/residemand/autoevaluate")
- Result AutoEvaluateDemand();
+ Result AutoEvaluateDemand(@RequestBody AutoEvaluateDemandFormDTO formDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
index f4e19d0906..eed34f0116 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
@@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
+import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
@@ -67,7 +68,7 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
* @return
*/
@Override
- public Result AutoEvaluateDemand() {
- return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "autoEvaluate");
+ public Result AutoEvaluateDemand(AutoEvaluateDemandFormDTO formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "autoEvaluate",formDTO);
}
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
index beb25ce050..a18b304aeb 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
@@ -32,7 +32,7 @@ public interface UserDemandConstant {
*/
String STAFF="staff";
String RESI="resi";
-
+ String SYS="sys";
/**
* 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish;;评价:evaluate
@@ -78,4 +78,8 @@ public interface UserDemandConstant {
String DEMAND_SERVER="server";
String GRANT_POINT_REMARK="完成了%s的需求:%s";
+
+ String DEFAULT_EVALUATE_REMARK="此用户没有填写内容,由系统默认评分";
+ // 完成结果:已解决 resolved,未解决 unresolved
+ String RESOLVED="resolved";
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index fbdbc7afca..5b8417ad82 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -14,6 +14,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
+import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.*;
@@ -251,8 +252,8 @@ public class ResiDemandController {
* @return
*/
@PostMapping("autoevaluate")
- public Result autoEvaluate(){
- icUserDemandRecService.autoEvaluate();
+ public Result autoEvaluate(@RequestBody AutoEvaluateDemandFormDTO formDTO){
+ icUserDemandRecService.autoEvaluate(formDTO);
return new Result();
}
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
index 6d11009c14..6ab67eed69 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
@@ -113,5 +113,7 @@ public interface IcUserDemandRecDao extends BaseDao {
@Param("type")String type,
@Param("demandUserId")String demandUserId);
- List selectNoEvaluate();
+ List selectNoEvaluate(@Param("customerId")String customerId,@Param("exceedDay")Integer exceedDay);
+
+ int evaluate(@Param("demandRecId")String demandRecId, @Param("finishResult")String finishResult);
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java
index ab17c5d738..819fb8239d 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java
@@ -50,7 +50,7 @@ public class IcUserDemandSatisfactionEntity extends BaseEpmetEntity {
private String demandRecId;
/**
- * 当前操作用户属于哪个端?工作端:staff;居民端:resi
+ * 当前操作用户属于哪个端?工作端:staff;居民端:resi;系统操作:sys
*/
private String userType;
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
index 57e5192dc8..093eb4e011 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
@@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcUserDemandRecDTO;
+import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.*;
import com.epmet.entity.IcUserDemandRecEntity;
@@ -217,5 +218,5 @@ public interface IcUserDemandRecService extends BaseService {
+ List evaluateDemandAuto(String customerId, Integer exceedDay);
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index f8a40d37c9..41969b7cdc 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -21,10 +21,13 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
+import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
+import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum;
+import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
@@ -37,6 +40,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant;
+import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.IcUserDemandOperateLogDao;
@@ -106,6 +110,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl list=baseDao.selectNoEvaluate();
-
+ public void autoEvaluate(AutoEvaluateDemandFormDTO formDTO) {
+ if (null == formDTO.getExceedDay()) {
+ formDTO.setExceedDay(NumConstant.SEVEN);
+ }
+ List list=icUserDemandSatisfactionService.evaluateDemandAuto(formDTO.getCustomerId(),formDTO.getExceedDay());
+ if(CollectionUtils.isNotEmpty(list)){
+ List actPointEventMsgList = new ArrayList<>();
+ list.forEach(finishResultDTO->{
+ BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
+ actPointEventMsg.setCustomerId(formDTO.getCustomerId());
+ actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
+ actPointEventMsg.setSourceId(finishResultDTO.getDemandRecId());
+ actPointEventMsg.setUserId(finishResultDTO.getServerId());
+ actPointEventMsg.setActionFlag(MqConstant.PLUS);
+ actPointEventMsg.setIsCommon(false);
+ actPointEventMsg.setRemark(finishResultDTO.getRemark());
+ actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
+ actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
+ actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
+ actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
+ actPointEventMsg.setPoint(finishResultDTO.getAwardPoint());
+ actPointEventMsgList.add(actPointEventMsg);
+ });
+ SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
+ sendMsgForm.setContent(actPointEventMsgList);
+ sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
+ Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
+ if (!mqResult.success()) {
+ log.error(String.format("需求评价完成:demandRecId:%s,给志愿者发放积分失败", JSON.toJSONString(sendMsgForm)));
+ }
+ }
}
+
+
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
new file mode 100644
index 0000000000..f2b91050a0
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
@@ -0,0 +1,109 @@
+package com.epmet.service.impl;
+
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
+import com.epmet.commons.tools.constant.Constant;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.constant.UserDemandConstant;
+import com.epmet.dao.IcUserDemandOperateLogDao;
+import com.epmet.dao.IcUserDemandRecDao;
+import com.epmet.dao.IcUserDemandSatisfactionDao;
+import com.epmet.dao.IcUserDemandServiceDao;
+import com.epmet.dto.IcUserDemandRecDTO;
+import com.epmet.dto.result.demand.FinishResultDTO;
+import com.epmet.entity.IcUserDemandOperateLogEntity;
+import com.epmet.entity.IcUserDemandSatisfactionEntity;
+import com.epmet.entity.IcUserDemandServiceEntity;
+import com.epmet.service.IcPartyUnitService;
+import com.epmet.service.IcResiDemandDictService;
+import com.epmet.service.IcUserDemandSatisfactionService;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+public class IcUserDemandSatisfactionServiceImpl extends BaseServiceImpl implements IcUserDemandSatisfactionService {
+
+ @Autowired
+ private IcUserDemandRecDao icUserDemandRecDao;
+ @Autowired
+ private IcUserDemandOperateLogDao operateLogDao;
+ @Autowired
+ private IcUserDemandServiceDao demandServiceDao;
+ @Autowired
+ private IcResiDemandDictService demandDictService;
+ @Autowired
+ private IcPartyUnitService icPartyUnitService;
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public List evaluateDemandAuto(String customerId, Integer exceedDay) {
+ // 查询完成后,超过7天未评价的记录
+ List list=icUserDemandRecDao.selectNoEvaluate(customerId,exceedDay);
+ if(CollectionUtils.isEmpty(list)){
+ return Collections.EMPTY_LIST;
+ }
+ List resultList=new ArrayList<>();
+ Date nowDate=new Date();
+ for(IcUserDemandRecDTO demand:list){
+
+ // 1、插入评价得分记录
+ IcUserDemandSatisfactionEntity satisfactionEntity = new IcUserDemandSatisfactionEntity();
+ satisfactionEntity.setCustomerId(demand.getCustomerId());
+ satisfactionEntity.setDemandRecId(demand.getId());
+ satisfactionEntity.setEvaluateTime(nowDate);
+ satisfactionEntity.setUserType(UserDemandConstant.SYS);
+ satisfactionEntity.setUserId(Constant.APP_USER_FLAG);
+ satisfactionEntity.setScore(new BigDecimal(NumConstant.FIVE_STR));
+ satisfactionEntity.setRemark(UserDemandConstant.DEFAULT_EVALUATE_REMARK);
+ baseDao.insert(satisfactionEntity);
+
+ // 2、插入评价操作日志
+ IcUserDemandOperateLogEntity evaluateEntity = new IcUserDemandOperateLogEntity();
+ evaluateEntity.setCustomerId(demand.getCustomerId());
+ evaluateEntity.setDemandRecId(demand.getId());
+ evaluateEntity.setUserType(UserDemandConstant.SYS);
+ evaluateEntity.setUserId(Constant.APP_USER_FLAG);
+ evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
+ evaluateEntity.setOperateTime(nowDate);
+ operateLogDao.insert(evaluateEntity);
+
+ // 3、更新主表已评价标识,是否解决标识。
+ icUserDemandRecDao.evaluate(demand.getId(),UserDemandConstant.RESOLVED);
+
+ //4、返回服务方,志愿者发放积分,区域化党建单位,计算群众满意度
+ IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(demand.getId());
+ if(null==serviceEntity){
+ continue;
+ }
+ if(UserDemandConstant.PARTY_UNIT.equals(serviceEntity.getServiceType())){
+ ServerSatisfactionCalFormDTO satisfactionCalFormDTO=new ServerSatisfactionCalFormDTO();
+ satisfactionCalFormDTO.setCustomerId(demand.getCustomerId());
+ satisfactionCalFormDTO.setServiceType(serviceEntity.getServiceType());
+ satisfactionCalFormDTO.setServerId(serviceEntity.getServerId());
+ icPartyUnitService.calPartyUnitSatisfation(satisfactionCalFormDTO);
+ }else if(UserDemandConstant.VOLUNTEER.equals(serviceEntity.getServiceType())){
+ FinishResultDTO finishResultDTO = new FinishResultDTO();
+ finishResultDTO.setServerId(serviceEntity.getServerId());
+ finishResultDTO.setServiceType(serviceEntity.getServiceType());
+ finishResultDTO.setAwardPoint(demand.getAwardPoint());
+ finishResultDTO.setEvaluateFlag(true);
+ if(StringUtils.isBlank(demand.getParentCode())||NumConstant.ZERO_STR.equals(demand.getParentCode())){
+ finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(demand.getCustomerId(),demand.getCategoryCode()));
+ }else{
+ finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(demand.getCustomerId(),demand.getParentCode()));
+ }
+ String content = demand.getContent().length() > 100 ? demand.getContent().substring(0, 99) : demand.getContent();
+ finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,demand.getDemandUserName(),content));
+ resultList.add(finishResultDTO) ;
+ }
+ }
+ return resultList;
+ }
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
index dbeb852712..bf1ab18831 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
@@ -511,6 +511,18 @@
AND r.EVALUATE_FLAG = '0'
and s.SERVICE_START_TIME is not NULL
and s.SERVICE_END_TIME is not null
- and timestampdiff(day,s.UPDATED_TIME,now()) >7
+ and timestampdiff(day,s.UPDATED_TIME,now()) > #{exceedDay}
+
+ AND r.customer_id =#{customerId}
+
+
+
+
+ update ic_user_demand_rec
+ set EVALUATE_FLAG='1',
+ FINISH_RESULT=#{finishResult},
+ UPDATED_TIME=NOW()
+ where id=#{demandRecId}
+
\ No newline at end of file
diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java
index 1f1f2e74f9..c2e21696ab 100644
--- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java
+++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java
@@ -1,9 +1,12 @@
package com.epmet.task;
+import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -19,6 +22,10 @@ public class AutoEvaluateDemandTask implements ITask {
@Override
public void run(String params) {
- Result result = heartOpenFeignClient.AutoEvaluateDemand();
+ AutoEvaluateDemandFormDTO formDTO = new AutoEvaluateDemandFormDTO();
+ if (StringUtils.isNotBlank(params)) {
+ formDTO = JSON.parseObject(params, AutoEvaluateDemandFormDTO.class);
+ }
+ Result result = heartOpenFeignClient.AutoEvaluateDemand(formDTO);
}
}
From 65ba30517c24585fd797047ac1be279f9a70b3ff Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Tue, 28 Dec 2021 09:38:23 +0800
Subject: [PATCH 37/56] =?UTF-8?q?job=E5=92=8Cheart?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../service/impl/IcUserDemandSatisfactionServiceImpl.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
index f2b91050a0..fc03960b4d 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
@@ -17,9 +17,11 @@ import com.epmet.entity.IcUserDemandServiceEntity;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcUserDemandSatisfactionService;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
@@ -27,7 +29,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
-
+@Slf4j
+@Service
public class IcUserDemandSatisfactionServiceImpl extends BaseServiceImpl implements IcUserDemandSatisfactionService {
@Autowired
From 9902bc30ba027ad8879aac7dd5e347b4b0a23aa4 Mon Sep 17 00:00:00 2001
From: sunyuchao
Date: Tue, 28 Dec 2021 10:15:25 +0800
Subject: [PATCH 38/56] .
---
.../main/java/com/epmet/service/impl/ResiEventServiceImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
index 3f7252aab5..6be91e0cdd 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
@@ -346,7 +346,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl
Date: Tue, 28 Dec 2021 10:32:56 +0800
Subject: [PATCH 39/56] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E8=84=9A=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/resources/db/migration/V0.0.5__activity.sql | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.5__activity.sql
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.5__activity.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.5__activity.sql
new file mode 100644
index 0000000000..fd9732bc6e
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.5__activity.sql
@@ -0,0 +1,9 @@
+ALTER TABLE `epmet_heart`.`act_info`
+ ADD COLUMN `ACT_TYPE` varchar(10) NULL COMMENT '活动类型 爱心活动heart 联建活动party' AFTER `CUSTOMER_ID`,
+ ADD COLUMN `UNIT_ID` varchar(64) NULL COMMENT '联建单位ID' AFTER `ACT_TYPE`,
+ ADD COLUMN `SERVICE_MATTER` varchar(64) NULL COMMENT '服务事项' AFTER `UNIT_ID`,
+ ADD COLUMN `TARGET` varchar(100) NULL COMMENT '活动目标' AFTER `TITLE`;
+
+
+ALTER TABLE `epmet_heart`.`ic_party_activity`
+ ADD COLUMN `ACT_ID` varchar(64) NULL COMMENT 'act_info表ID' AFTER `PIDS`;
\ No newline at end of file
From 55551c785ad692189f041c58d5b485be33e3756b Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Tue, 28 Dec 2021 11:10:33 +0800
Subject: [PATCH 40/56] bizTyp=community_service
---
.../dto/form/AutoEvaluateDemandFormDTO.java | 7 +-
.../dto/result/demand/FinishResultDTO.java | 1 -
.../controller/ResiDemandController.java | 5 +-
.../com/epmet/dao/IcUserDemandRecDao.java | 4 +-
.../epmet/service/IcUserDemandRecService.java | 5 -
.../IcUserDemandSatisfactionService.java | 11 +-
.../impl/IcUserDemandRecServiceImpl.java | 41 +------
.../IcUserDemandSatisfactionServiceImpl.java | 100 ++++++++++++------
.../resources/mapper/IcUserDemandRecDao.xml | 7 +-
.../impl/UserPointActionLogServiceImpl.java | 1 +
10 files changed, 94 insertions(+), 88 deletions(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java
index fd716562ae..2df4640227 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java
@@ -11,5 +11,10 @@ import java.io.Serializable;
@Data
public class AutoEvaluateDemandFormDTO implements Serializable {
private String customerId;
- private Integer exceedDay;
+ private Integer exceedValue;
+ /**
+ * day
+ * minute
+ */
+ private String type;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
index 77f86a5f43..8ea54cc72f 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
@@ -32,5 +32,4 @@ public class FinishResultDTO implements Serializable {
private String remark;
private String firstCategoryName;
private String categoryCode;
- private String demandRecId;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index 5b8417ad82..814c875150 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -20,6 +20,7 @@ import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.IcUserDemandRecService;
+import com.epmet.service.IcUserDemandSatisfactionService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -46,6 +47,8 @@ public class ResiDemandController {
private IcUserDemandRecService icUserDemandRecService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
+ @Autowired
+ private IcUserDemandSatisfactionService demandSatisfactionService;
/**
* 居民端-需求大厅(未处理、处理中、已完成)
@@ -253,7 +256,7 @@ public class ResiDemandController {
*/
@PostMapping("autoevaluate")
public Result autoEvaluate(@RequestBody AutoEvaluateDemandFormDTO formDTO){
- icUserDemandRecService.autoEvaluate(formDTO);
+ demandSatisfactionService.evaluateDemandAuto(formDTO);
return new Result();
}
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
index 6ab67eed69..27eaa8c689 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
@@ -113,7 +113,9 @@ public interface IcUserDemandRecDao extends BaseDao {
@Param("type")String type,
@Param("demandUserId")String demandUserId);
- List selectNoEvaluate(@Param("customerId")String customerId,@Param("exceedDay")Integer exceedDay);
+ List selectNoEvaluate(@Param("customerId")String customerId,
+ @Param("exceedValue")Integer exceedValue,
+ @Param("type")String type);
int evaluate(@Param("demandRecId")String demandRecId, @Param("finishResult")String finishResult);
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
index 093eb4e011..da3fd68cdf 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
@@ -20,7 +20,6 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcUserDemandRecDTO;
-import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.*;
import com.epmet.entity.IcUserDemandRecEntity;
@@ -215,8 +214,4 @@ public interface IcUserDemandRecService extends BaseService {
- List evaluateDemandAuto(String customerId, Integer exceedDay);
+ /**
+ *
+ * @param formDTO
+ * @return
+ */
+ void evaluateDemandAuto(AutoEvaluateDemandFormDTO formDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index 41969b7cdc..b194d61dc2 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -21,13 +21,10 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
-import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
-import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum;
-import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
@@ -40,7 +37,6 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant;
-import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.IcUserDemandOperateLogDao;
@@ -1101,6 +1097,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl 100 ? entity.getContent().substring(0, 99) : entity.getContent();
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content));
+ finishResultDTO.setCategoryCode(entity.getCategoryCode());
//5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自XXX(需求人姓名)的评价,请查看。
sendVolunnterEvaluated(entity);
return finishResultDTO;
@@ -1537,42 +1534,6 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl list=icUserDemandSatisfactionService.evaluateDemandAuto(formDTO.getCustomerId(),formDTO.getExceedDay());
- if(CollectionUtils.isNotEmpty(list)){
- List actPointEventMsgList = new ArrayList<>();
- list.forEach(finishResultDTO->{
- BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
- actPointEventMsg.setCustomerId(formDTO.getCustomerId());
- actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
- actPointEventMsg.setSourceId(finishResultDTO.getDemandRecId());
- actPointEventMsg.setUserId(finishResultDTO.getServerId());
- actPointEventMsg.setActionFlag(MqConstant.PLUS);
- actPointEventMsg.setIsCommon(false);
- actPointEventMsg.setRemark(finishResultDTO.getRemark());
- actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
- actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
- actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
- actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
- actPointEventMsg.setPoint(finishResultDTO.getAwardPoint());
- actPointEventMsgList.add(actPointEventMsg);
- });
- SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
- sendMsgForm.setContent(actPointEventMsgList);
- sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
- Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
- if (!mqResult.success()) {
- log.error(String.format("需求评价完成:demandRecId:%s,给志愿者发放积分失败", JSON.toJSONString(sendMsgForm)));
- }
- }
- }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
index fc03960b4d..5334324302 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
@@ -1,19 +1,27 @@
package com.epmet.service.impl;
+import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.constant.Constant;
+import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
+import com.epmet.commons.tools.enums.EventEnum;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dao.IcUserDemandOperateLogDao;
import com.epmet.dao.IcUserDemandRecDao;
import com.epmet.dao.IcUserDemandSatisfactionDao;
import com.epmet.dao.IcUserDemandServiceDao;
import com.epmet.dto.IcUserDemandRecDTO;
-import com.epmet.dto.result.demand.FinishResultDTO;
+import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
+import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.entity.IcUserDemandOperateLogEntity;
import com.epmet.entity.IcUserDemandSatisfactionEntity;
import com.epmet.entity.IcUserDemandServiceEntity;
+import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcUserDemandSatisfactionService;
@@ -26,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Date;
import java.util.List;
@Slf4j
@@ -43,19 +50,72 @@ public class IcUserDemandSatisfactionServiceImpl extends BaseServiceImpl evaluateDemandAuto(String customerId, Integer exceedDay) {
+ public void evaluateDemandAuto(AutoEvaluateDemandFormDTO formDTO) {
+ if (null == formDTO.getExceedValue()) {
+ formDTO.setExceedValue(NumConstant.SEVEN);
+ formDTO.setType("day");
+ }
// 查询完成后,超过7天未评价的记录
- List list=icUserDemandRecDao.selectNoEvaluate(customerId,exceedDay);
+ List list=icUserDemandRecDao.selectNoEvaluate(formDTO.getCustomerId(),formDTO.getExceedValue(),formDTO.getType());
if(CollectionUtils.isEmpty(list)){
- return Collections.EMPTY_LIST;
+ return;
}
- List resultList=new ArrayList<>();
Date nowDate=new Date();
for(IcUserDemandRecDTO demand:list){
+ //4、返回服务方,志愿者发放积分,区域化党建单位,计算群众满意度
+ IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(demand.getId());
+ if(null==serviceEntity){
+ continue;
+ }
+ if(UserDemandConstant.PARTY_UNIT.equals(serviceEntity.getServiceType())){
+ ServerSatisfactionCalFormDTO satisfactionCalFormDTO=new ServerSatisfactionCalFormDTO();
+ satisfactionCalFormDTO.setCustomerId(demand.getCustomerId());
+ satisfactionCalFormDTO.setServiceType(serviceEntity.getServiceType());
+ satisfactionCalFormDTO.setServerId(serviceEntity.getServerId());
+ icPartyUnitService.calPartyUnitSatisfation(satisfactionCalFormDTO);
+ }else if(UserDemandConstant.VOLUNTEER.equals(serviceEntity.getServiceType())){
+ List actPointEventMsgList = new ArrayList<>();
+ BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
+ actPointEventMsg.setCustomerId(demand.getCustomerId());
+ actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
+ actPointEventMsg.setSourceId(demand.getId());
+ actPointEventMsg.setUserId(serviceEntity.getServerId());
+ actPointEventMsg.setActionFlag(MqConstant.PLUS);
+ actPointEventMsg.setIsCommon(false);
+ String content = demand.getContent().length() > 100 ? demand.getContent().substring(0, 99) : demand.getContent();
+ actPointEventMsg.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,demand.getDemandUserName(),content));
+ actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
+ actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
+ if(StringUtils.isBlank(demand.getParentCode())||NumConstant.ZERO_STR.equals(demand.getParentCode())){
+ actPointEventMsg.setEventName(demandDictService.getCategoryName(demand.getCustomerId(),demand.getCategoryCode()));
+ }else{
+ actPointEventMsg.setEventName(demandDictService.getCategoryName(demand.getCustomerId(),demand.getParentCode()));
+ }
+ actPointEventMsg.setObjectId(demand.getCategoryCode());
+ actPointEventMsg.setPoint(demand.getAwardPoint());
+ actPointEventMsgList.add(actPointEventMsg);
+ SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
+ sendMsgForm.setContent(actPointEventMsgList);
+ sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
+ Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
+ if (!mqResult.success()) {
+ log.warn(String.format("需求自动评价志愿者发放积分失败:demandRecId:%s,消息体:%s", demand.getId(), JSON.toJSONString(sendMsgForm)));
+ continue;
+ }
+ }
+
// 1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity = new IcUserDemandSatisfactionEntity();
satisfactionEntity.setCustomerId(demand.getCustomerId());
@@ -79,34 +139,6 @@ public class IcUserDemandSatisfactionServiceImpl extends BaseServiceImpl 100 ? demand.getContent().substring(0, 99) : demand.getContent();
- finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,demand.getDemandUserName(),content));
- resultList.add(finishResultDTO) ;
- }
}
- return resultList;
}
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
index bf1ab18831..4298ad6186 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
@@ -511,7 +511,12 @@
AND r.EVALUATE_FLAG = '0'
and s.SERVICE_START_TIME is not NULL
and s.SERVICE_END_TIME is not null
- and timestampdiff(day,s.UPDATED_TIME,now()) > #{exceedDay}
+
+ and timestampdiff(day,s.UPDATED_TIME,now()) > #{exceedValue}
+
+
+ and timestampdiff(MINUTE,s.UPDATED_TIME,now()) > #{exceedValue}
+
AND r.customer_id =#{customerId}
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
index 583a0c0e61..0fbb19a3d8 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
@@ -593,6 +593,7 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl
Date: Tue, 28 Dec 2021 11:13:25 +0800
Subject: [PATCH 41/56] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=AF=A6=E6=83=85?=
=?UTF-8?q?=E8=AF=AD=E9=9F=B3=E9=99=84=E4=BB=B6=E5=8A=A0=E8=BF=94=E5=8F=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/dto/result/EventDetailResultDTO.java | 8 +++++++-
.../java/com/epmet/entity/ResiEventAttachmentEntity.java | 5 +++++
.../java/com/epmet/service/impl/ResiEventServiceImpl.java | 8 ++++++--
.../src/main/resources/db/migration/V0.0.18__alter.sql | 3 +++
.../src/main/resources/mapper/ResiEventDao.xml | 2 ++
5 files changed, 23 insertions(+), 3 deletions(-)
create mode 100644 epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.18__alter.sql
diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java
index 4f0e1f1ff0..0ba4733a75 100644
--- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java
+++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java
@@ -1,5 +1,6 @@
package com.epmet.dto.result;
+import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.dto.EventProjectInfoDTO;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
@@ -79,7 +80,7 @@ public class EventDetailResultDTO implements Serializable {
/**
* 语音附件url集合
*/
- private List voiceList;
+ private List voiceList;
/**
* 事件附件
*/
@@ -127,5 +128,10 @@ public class EventDetailResultDTO implements Serializable {
* 附件类型
*/
private String type;
+
+ /**
+ * 附件类型
+ */
+ private Integer duration;
}
}
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java
index b28acf8317..658922b493 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java
@@ -89,4 +89,9 @@ public class ResiEventAttachmentEntity extends BaseEpmetEntity {
*/
private String reason;
+ /**
+ * 语音或视频时长,秒
+ * */
+ private Integer duration;
+
}
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
index 6be91e0cdd..90e37213f9 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
@@ -216,12 +216,15 @@ public class ResiEventServiceImpl extends BaseServiceImpl eventImgs = new ArrayList<>();
- List voiceList = new ArrayList<>();
+ List voiceList = new ArrayList<>();
dto.getAttachmentList().forEach(file->{
if("image".equals(file.getType())){
eventImgs.add(file.getUrl());
}else if("voice".equals(file.getType())){
- voiceList.add(file.getUrl());
+ FileCommonDTO fl = new FileCommonDTO();
+ fl.setUrl(file.getUrl());
+ fl.setDuration(file.getDuration());
+ voiceList.add(fl);
}
});
dto.setEventImgs(eventImgs);
@@ -350,6 +353,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl
+
@@ -155,6 +156,7 @@
ea.id AS resiEventAttachmentId,
ea.ATTACHMENT_URL AS url,
ea.ATTACHMENT_TYPE AS type,
+ ea.duration AS duration,
IF(ISNULL(em.USER_SHOW_NAME),NULL,concat('人大代表-',em.USER_SHOW_NAME)) AS person,
re.GRID_ID AS gridId,
re.CREATED_BY AS eventUserId,
From 1fa6beb13a72d5b823c727c8326fc655d8f83387 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Tue, 28 Dec 2021 12:48:49 +0800
Subject: [PATCH 42/56] autoEvaluateDemandTask
---
.../src/main/java/com/epmet/task/AutoEvaluateDemandTask.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java
index c2e21696ab..c1ce071d0e 100644
--- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java
+++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java
@@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
* @dscription 每天晚上23:50执行,需求已完成,未评分的自动评分=》发放积分,计算满意度
*/
@Slf4j
-@Component("resiEventAutoAuditTask")
+@Component("autoEvaluateDemandTask")
public class AutoEvaluateDemandTask implements ITask {
@Autowired
private EpmetHeartOpenFeignClient heartOpenFeignClient;
From 51571a2f0f331ffefcbf0ca8151c8f0f75430844 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Tue, 28 Dec 2021 13:11:02 +0800
Subject: [PATCH 43/56] >0
---
.../epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
index 5334324302..c8b87ed69e 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
@@ -85,7 +85,7 @@ public class IcUserDemandSatisfactionServiceImpl extends BaseServiceImpl NumConstant.ZERO) {
List actPointEventMsgList = new ArrayList<>();
BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
actPointEventMsg.setCustomerId(demand.getCustomerId());
From 34b48a1cc42d2a5b622523e5f0666450952ee425 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Tue, 28 Dec 2021 14:29:40 +0800
Subject: [PATCH 44/56] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=9C=80=E6=B1=82?=
=?UTF-8?q?=E8=A2=AB=E6=8C=87=E6=B4=BE=E3=80=82=E5=BA=94=E8=AF=A5=E9=80=9A?=
=?UTF-8?q?=E7=9F=A5=E6=88=91=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../epmet/service/impl/IcUserDemandRecServiceImpl.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index b194d61dc2..a15b3cde39 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -1428,6 +1428,14 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl communityOrgMap = getCommunityOrgMap(Arrays.asList(serverId));
serviceName = MapUtils.isNotEmpty(communityOrgMap) ? communityOrgMap.get(serverId).getOrganizationName() : StrConstant.EPMETY_STR;
+ }else if(UserDemandConstant.VOLUNTEER.equals(serviceType)){
+ //如果指派给了志愿者-》您提出的需求将由XX为您解决,请查看
+ UserResiInfoListFormDTO userResiInfoListFormDTO=new UserResiInfoListFormDTO();
+ userResiInfoListFormDTO.setUserIdList(Arrays.asList(serverId));
+ Result> userRes = epmetUserOpenFeignClient.getUserResiInfoList(userResiInfoListFormDTO);
+ if(userRes.success()){
+ serviceName=userRes.getData().get(NumConstant.ZERO).getRealName();
+ }
}
if (StringUtils.isNotBlank(serviceName)) {
UserMessageFormDTO userMessage = new UserMessageFormDTO();
From 630d19c101859e5286d3482c11550d6aaeeb0ea4 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Tue, 28 Dec 2021 15:14:24 +0800
Subject: [PATCH 45/56] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=AE=8C=E6=88=90pc?=
=?UTF-8?q?=E5=92=8C=E5=B0=8F=E7=A8=8B=E5=BA=8F=E9=80=9A=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/controller/ResiDemandController.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
index 814c875150..d0a3c1ab0c 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
@@ -4,6 +4,7 @@ package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
@@ -106,7 +107,11 @@ public class ResiDemandController {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setType(UserDemandConstant.FINISHED);
- formDTO.setUserType(UserDemandConstant.RESI);
+ if (AppClientConstant.APP_GOV.equals(tokenDto.getApp())) {
+ formDTO.setUserType(UserDemandConstant.STAFF);
+ } else if (AppClientConstant.APP_RESI.equals(tokenDto.getApp())) {
+ formDTO.setUserType(UserDemandConstant.RESI);
+ }
ValidatorUtils.validateEntity(formDTO, FinishStaffFromDTO.ResiShowGroup.class, FinishStaffFromDTO.AddUserInternalGroup.class);
icUserDemandRecService.finish(formDTO);
return new Result();
From 2439adcfd5cb525da0a7fde8787f273fd7deac64 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Tue, 28 Dec 2021 15:28:37 +0800
Subject: [PATCH 46/56] test
---
.../impl/IcUserDemandRecServiceImpl.java | 53 ++++++++++---------
1 file changed, 27 insertions(+), 26 deletions(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index a15b3cde39..17833fe7cb 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -409,45 +409,50 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl 100 ? entity.getContent().substring(0, 99) : entity.getContent();
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content));
}
-
- //4、修改主表状态为已完成
- entity.setStatus(UserDemandConstant.FINISHED);
baseDao.updateById(entity);
-
// 5、如果是居民端用户提出的需求,发消息:您提出的需求已完成,请进行服务评价。
sendDemandUserFinished(entity);
return finishResultDTO;
@@ -483,14 +484,14 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl
Date: Tue, 28 Dec 2021 16:41:04 +0800
Subject: [PATCH 47/56] =?UTF-8?q?=E5=9E=83=E5=9C=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dto/result/GridBaseInfoResultDTO.java | 6 +++-
.../epmet/dto/result/GridDetailResultDTO.java | 6 +++-
.../service/impl/CustomerGridServiceImpl.java | 29 ++++++++++++++++++-
3 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java
index c8d547fe17..4bc56543a1 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java
@@ -34,9 +34,13 @@ public class GridBaseInfoResultDTO implements Serializable {
*/
private String code = "";
/**
- * 编码
+ * 网格类型 字典表value值
*/
private String gridType = "";
+ /**
+ * 网格类型 字典表label值
+ */
+ private String gridTypeName = "";
/**
* 负责人
*/
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java
index bfb95d5c23..f9a2726a1a 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java
@@ -70,9 +70,13 @@ public class GridDetailResultDTO implements Serializable {
*/
private String code = "";
/**
- * 网格类型
+ * 网格类型 字典表value值
*/
private String gridType = "";
+ /**
+ * 网格类型 字典表label值
+ */
+ private String gridTypeName = "";
/**
* 负责人
*/
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
index bd83c240df..b358c04b81 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
@@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
+import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
@@ -43,6 +44,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerGridEntity;
+import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
@@ -51,6 +53,7 @@ import com.epmet.service.CustomerGridService;
import com.epmet.util.ModuleConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -87,6 +90,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl page(Map params) {
@@ -216,6 +221,12 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> staffGridList = epmetUserFeignClient.getStaffGridList(customerStaffGridDTOS);
griddetail.setStaffGridList(staffGridList.getData());
+ //查询网格类型字典表数据
+ Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode());
+ Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
+ if (StringUtils.isNotBlank(griddetail.getGridType())) {
+ griddetail.setGridTypeName(statusMap.get(griddetail.getGridType()));
+ }
return new Result().ok(griddetail);
}
@@ -356,7 +367,23 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> getAllGridsByAgency(CommonAgencyIdFormDTO agencyFormDTO) {
- return new Result>().ok(baseDao.selectGridListByAgencyId(agencyFormDTO.getAgencyId(),null));
+ //1.查询组织下网格列表数据
+ List list = baseDao.selectGridListByAgencyId(agencyFormDTO.getAgencyId(),null);
+ if (org.springframework.util.CollectionUtils.isEmpty(list)) {
+ return new Result>();
+ }
+
+ //2.查询网格类型字典表数据
+ Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode());
+ Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
+
+ //3.封装数据并返回
+ list.forEach(l->{
+ if (StringUtils.isNotBlank(l.getGridType())) {
+ l.setGridTypeName(statusMap.get(l.getGridType()));
+ }
+ });
+ return new Result>().ok(list);
}
/**
From 82fbccf7099e5725149df5dc1840a627aa14d08e Mon Sep 17 00:00:00 2001
From: zxc <1272811460@qq.com>
Date: Tue, 28 Dec 2021 17:20:15 +0800
Subject: [PATCH 48/56] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AF=A6=E6=83=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../form/PartyServiceCenterDetailFormDTO.java | 22 +++++++++++++
.../IcPartyServiceCenterController.java | 11 +++++++
.../epmet/dao/IcPartyServiceCenterDao.java | 8 +++++
.../service/IcPartyServiceCenterService.java | 8 +++++
.../impl/IcPartyServiceCenterServiceImpl.java | 11 +++++++
.../mapper/IcPartyServiceCenterDao.xml | 32 +++++++++++++++++++
6 files changed, 92 insertions(+)
create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterDetailFormDTO.java
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterDetailFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterDetailFormDTO.java
new file mode 100644
index 0000000000..b7ec31560e
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterDetailFormDTO.java
@@ -0,0 +1,22 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @DateTime 2021/12/28 5:05 下午
+ * @DESC
+ */
+@Data
+public class PartyServiceCenterDetailFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 8849427528238500433L;
+
+ public interface PartyServiceCenterDetailForm{}
+
+ @NotBlank(message = "partyServiceCenterId不能为空",groups = PartyServiceCenterDetailForm.class)
+ private String partyServiceCenterId;
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
index f6071938ce..3b2872a7f3 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
@@ -229,5 +229,16 @@ public class IcPartyServiceCenterController {
return new Result>().ok(icPartyServiceCenterService.appointmentRecordMini(formDTO,tokenDto));
}
+ /**
+ * @Description 党群服务中心详情
+ * @param formDTO
+ * @author zxc
+ * @date 2021/12/28 5:13 下午
+ */
+ @PostMapping("partyservicecenterdetail")
+ public Result partyServiceCenterDetail(@RequestBody PartyServiceCenterDetailFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO, PartyServiceCenterDetailFormDTO.PartyServiceCenterDetailForm.class);
+ return new Result().ok(icPartyServiceCenterService.partyServiceCenterDetail(formDTO));
+ }
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java
index 52a90184cf..ad1ff57769 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java
@@ -43,6 +43,14 @@ public interface IcPartyServiceCenterDao extends BaseDao partyServiceCenterList(@Param("orgId")String orgId);
+ /**
+ * @Description 查询党群服务中心详情
+ * @param centerId
+ * @author zxc
+ * @date 2021/12/28 5:15 下午
+ */
+ PartyServiceCenterListResultDTO partyServiceCenterDetail(@Param("centerId")String centerId);
+
/**
* @Description 获取网格所属组织下所有的可预约事项
* @param orgId
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
index 3a4cbcec4c..37d93ce41a 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
@@ -183,4 +183,12 @@ public interface IcPartyServiceCenterService extends BaseService appointmentRecordMini(AppointmentRecordMiniFormDTO formDTO,TokenDto tokenDto);
+ /**
+ * @Description 党群服务中心详情
+ * @param formDTO
+ * @author zxc
+ * @date 2021/12/28 5:13 下午
+ */
+ PartyServiceCenterListResultDTO partyServiceCenterDetail(PartyServiceCenterDetailFormDTO formDTO);
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
index bba2cb0455..561ad068aa 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
@@ -479,6 +479,17 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl();
}
+ /**
+ * @Description 党群服务中心详情
+ * @param formDTO
+ * @author zxc
+ * @date 2021/12/28 5:13 下午
+ */
+ @Override
+ public PartyServiceCenterListResultDTO partyServiceCenterDetail(PartyServiceCenterDetailFormDTO formDTO) {
+ return baseDao.partyServiceCenterDetail(formDTO.getPartyServiceCenterId());
+ }
+
public List getTimeList(String start,String end,Integer interval){
List result = new ArrayList<>();
List intervalTimeList = getIntervalTimeList(start, end, interval);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml
index 275a3be71b..dc979d5df6 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml
@@ -67,4 +67,36 @@
AND c.DEL_FLAG = 0
AND c.ORG_ID = #{orgId}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT
+ sc.ID AS partyServiceCenterId,
+ sc.CENTER_NAME AS centerName,
+ sc.ADDRESS AS address,
+ sc.WORK_PHONE AS workPhone,
+ sc.AM_START_TIME AS amStartTime,
+ sc.AM_END_TIME AS amEndTime,
+ sc.PM_START_TIME AS pmStartTime,
+ sc.PM_END_TIME AS pmEndTime,
+ sc.LONGITUDE AS longitude,
+ sc.LATITUDE AS latitude
+ FROM ic_party_service_center sc
+ WHERE sc.DEL_FLAG = 0
+ AND ID = #{centerId}
+
\ No newline at end of file
From 4c245f3092b2c860ab383512a06be048df391ec6 Mon Sep 17 00:00:00 2001
From: sunyuchao
Date: Tue, 28 Dec 2021 17:22:52 +0800
Subject: [PATCH 49/56] =?UTF-8?q?=E8=BF=9B=E7=BD=91=E6=A0=BC=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E5=A2=9E=E5=8A=A0=E7=BD=91=E6=A0=BC=E7=BB=8F=E7=BA=AC?=
=?UTF-8?q?=E5=BA=A6=E8=BF=94=E5=8F=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/dao/CustomerGridDao.java | 6 +++
.../service/impl/CustomerGridServiceImpl.java | 7 +--
.../main/resources/mapper/CustomerGridDao.xml | 49 +++++++++++++++++++
.../result/UserInfoOnEnterGridResultDTO.java | 10 ++++
.../impl/RegisterRelationServiceImpl.java | 2 +
5 files changed, 71 insertions(+), 3 deletions(-)
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
index eca348b6f2..48dacdf82d 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
@@ -345,4 +345,10 @@ public interface CustomerGridDao extends BaseDao {
List selectByPid(@Param("pid") String pid);
List getGridOptionForQuery(String gridPids);
+
+ /**
+ * @Author sun
+ * @Description 网格组织信息
+ **/
+ CustomerGridDTO gridAgencyByGrid(@Param("gridId") String gridId);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
index b358c04b81..6ecf0130d6 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
@@ -770,15 +770,16 @@ public class CustomerGridServiceImpl extends BaseServiceImpl
+
+
+ SELECT
+ CONCAT(
+ ca.organization_name,
+ "-",
+ cg.grid_name
+ ) gridNamePath,
+ ca.all_parent_name allParentName,
+ cg.id,
+ cg.customer_id,
+ cg.grid_name,
+ cg.coordinates,
+ cg.area_code,
+ cg.code,
+ cg.sync_flag,
+ cg.manage_district,
+ cg.total_user,
+ cg.pid,
+ cg.pids,
+ cg.grid_type,
+ cg.contacts,
+ cg.mobile,
+
+ ( CASE WHEN cg.longitude is null THEN
+ ( SELECT longitude FROM customer_agency
+ WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
+ ORDER BY pid ASC LIMIT 1
+ )
+ ELSE cg.longitude
+ END
+ ) longitude,
+ ( CASE WHEN cg.latitude is null THEN
+ ( SELECT latitude FROM customer_agency
+ WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
+ ORDER BY pid ASC LIMIT 1
+ )
+ ELSE cg.latitude
+ END
+ ) latitude
+ FROM
+ customer_grid cg
+ INNER JOIN customer_agency ca ON cg.pid = ca.id
+ WHERE
+ cg.del_flag = '0'
+ AND ca.del_flag = '0'
+ AND cg.id = #{gridId}
+
+
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java
index 3561cb4060..e8bff9cd33 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java
@@ -30,6 +30,16 @@ public class UserInfoOnEnterGridResultDTO implements Serializable{
* */
private String currentGridId;
+ /**
+ * 网格经度【没值则去客户跟组织的值】
+ */
+ private String longitude;
+
+ /**
+ * 网格纬度【没值则去客户跟组织的值】
+ */
+ private String latitude;
+
/**
* 当前网格名称
* */
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
index 0e0a8ef246..0ab2d16b99 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
@@ -309,6 +309,8 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl
Date: Tue, 28 Dec 2021 17:35:52 +0800
Subject: [PATCH 50/56] =?UTF-8?q?=E5=BC=95=E5=85=A5=E8=B7=AF=E5=BE=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../IcPlacePatrolReviewRecordServiceImpl.java | 21 ++++++-------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
index 8019f867c7..75bdadad72 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
@@ -17,28 +17,20 @@
package com.epmet.service.impl;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
-import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
-import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.RenException;
-import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcPlacePatrolReviewRecordDao;
import com.epmet.dao.IcPlacePatrolTeamStaffDao;
import com.epmet.dto.IcPlacePatrolTeamStaffDTO;
-import com.epmet.dto.form.*;
-import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO;
+import com.epmet.dto.form.AddPlacePatrolReviewRecordFormDTO;
+import com.epmet.dto.form.EditPlacePatrolReviewRecordFormDTO;
+import com.epmet.dto.form.GetListPlacePatrolReviewRecordFormDTO;
import com.epmet.dto.result.GetListPlacePatrolReviewRecordResultDTO;
-import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO;
import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO;
import com.epmet.entity.IcPlacePatrolRecordEntity;
import com.epmet.entity.IcPlacePatrolReviewRecordEntity;
-import com.epmet.entity.IcPlacePatrolTeamEntity;
-import com.epmet.entity.IcPlacePatrolTeamStaffEntity;
-import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.service.IcPlacePatrolRecordService;
import com.epmet.service.IcPlacePatrolReviewRecordService;
import com.github.pagehelper.PageHelper;
@@ -50,7 +42,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
-import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -111,13 +102,13 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl
Date: Tue, 28 Dec 2021 17:44:00 +0800
Subject: [PATCH 51/56] =?UTF-8?q?=E5=BC=95=E5=85=A5=E8=B7=AF=E5=BE=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../service/impl/IcPlacePatrolReviewRecordServiceImpl.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
index 75bdadad72..a67d4980b8 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
@@ -35,6 +35,7 @@ import com.epmet.service.IcPlacePatrolRecordService;
import com.epmet.service.IcPlacePatrolReviewRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
+import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -102,13 +103,13 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl
Date: Wed, 29 Dec 2021 09:06:40 +0800
Subject: [PATCH 52/56] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=B1=BB=E5=9E=8B?=
=?UTF-8?q?=E5=AD=97=E5=85=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/java/com/epmet/commons/tools/enums/DictTypeEnum.java | 1 +
.../java/com/epmet/service/impl/CustomerGridServiceImpl.java | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
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 39f80d7910..7afc85aab1 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
@@ -21,6 +21,7 @@ public enum DictTypeEnum {
USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10),
AGE_GROUP("age_group", "年龄范围", 11),
PATROL_WORK_TYPE("patrol_work_type", "例行工作分类", 13),
+ GRID_TYPE("grid_type", "网格类型", 12),
;
private final String code;
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
index 6ecf0130d6..f95eb8343a 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
@@ -222,7 +222,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> staffGridList = epmetUserFeignClient.getStaffGridList(customerStaffGridDTOS);
griddetail.setStaffGridList(staffGridList.getData());
//查询网格类型字典表数据
- Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode());
+ Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.GRID_TYPE.getCode());
Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
if (StringUtils.isNotBlank(griddetail.getGridType())) {
griddetail.setGridTypeName(statusMap.get(griddetail.getGridType()));
@@ -374,7 +374,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode());
+ Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.GRID_TYPE.getCode());
Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
//3.封装数据并返回
From 083cf37f38f883843284011fb19f90fddd7dd2aa Mon Sep 17 00:00:00 2001
From: zhaoqifeng
Date: Wed, 29 Dec 2021 09:32:39 +0800
Subject: [PATCH 53/56] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/java/com/epmet/dto/ActInfoDTO.java | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java
index b747b77985..10180e0222 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java
@@ -44,6 +44,27 @@ public class ActInfoDTO implements Serializable {
*/
private String customerId;
+ /**
+ * 活动类型爱心活动heart 联建活动party
+ */
+ private String actType;
+
+ /**
+ * 联建单位
+ */
+ private String unitId;
+ private String unitName;
+ /**
+ * 活动目标
+ */
+ private String target;
+
+ /**
+ * 服务事项
+ */
+ private String serviceMatter;
+ private String serviceMatterName;
+
/**
* 活动标题
*/
From 0ce1b0a8b8b07746b54a9b170d52d62b8c5f06ca Mon Sep 17 00:00:00 2001
From: sunyuchao
Date: Wed, 29 Dec 2021 09:58:45 +0800
Subject: [PATCH 54/56] =?UTF-8?q?sql=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mapper/govorg/CustomerStaffAgencyDao.xml | 19 ++-------
.../resources/mapper/CustomerAgencyDao.xml | 19 ++-------
.../main/resources/mapper/CustomerGridDao.xml | 40 +++----------------
3 files changed, 12 insertions(+), 66 deletions(-)
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
index ee8caafc3e..d2c47a0922 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
@@ -27,25 +27,12 @@
ca.level,
ca.area_code,
ca.parent_area_code,
- ( CASE WHEN ca.longitude is null THEN
- ( SELECT longitude FROM customer_agency
- WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
- ORDER BY pid ASC LIMIT 1
- )
- ELSE ca.longitude
- END
- ) longitude,
- ( CASE WHEN ca.latitude is null THEN
- ( SELECT latitude FROM customer_agency
- WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
- ORDER BY pid ASC LIMIT 1
- )
- ELSE ca.latitude
- END
- ) latitude
+ IFNULL(ca.longitude, cc.longitude) longitude,
+ IFNULL(ca.latitude, cc.latitude) latitude
FROM
customer_staff_agency csa
INNER JOIN customer_agency ca ON csa.agency_id = ca.id
+ INNER JOIN customer_agency cc ON cc.pid = '0' AND ca.customer_id = cc.customer_id
WHERE
csa.del_flag = '0'
AND ca.del_flag = '0'
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
index be7125e80c..13629cef31 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
@@ -190,23 +190,10 @@
ca.organization_name AS "agencyName",
ca.pids AS "pids",
ca.level level,
- ( CASE WHEN ca.longitude is null THEN
- ( SELECT longitude FROM customer_agency
- WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
- ORDER BY pid ASC LIMIT 1
- )
- ELSE ca.longitude
- END
- ) longitude,
- ( CASE WHEN ca.latitude is null THEN
- ( SELECT latitude FROM customer_agency
- WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
- ORDER BY pid ASC LIMIT 1
- )
- ELSE ca.latitude
- END
- ) latitude
+ IFNULL(ca.longitude, cc.longitude) longitude,
+ IFNULL(ca.latitude, cc.latitude) latitude
FROM customer_agency ca
+ INNER JOIN customer_agency cc ON cc.pid = '0' AND ca.customer_id = cc.customer_id
WHERE ca.del_flag = '0'
AND ca.pids = #{subAgencyPids}
ORDER BY ca.created_time DESC
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
index a08a4f534c..4c34ea5bed 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
@@ -409,25 +409,11 @@
) agencyGridName,
cg.grid_name gridName,
- ( CASE WHEN cg.longitude is null THEN
- ( SELECT longitude FROM customer_agency
- WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
- ORDER BY pid ASC LIMIT 1
- )
- ELSE cg.longitude
- END
- ) longitude,
- ( CASE WHEN cg.latitude is null THEN
- ( SELECT latitude FROM customer_agency
- WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
- ORDER BY pid ASC LIMIT 1
- )
- ELSE cg.latitude
- END
- ) latitude
+ IFNULL(cg.longitude, ca.longitude) longitude,
+ IFNULL(cg.latitude, ca.latitude) latitude
FROM
customer_grid cg
- INNER JOIN customer_agency ca ON cg.pid = ca.id
+ INNER JOIN customer_agency ca ON ca.pid = '0' AND ca.customer_id = cg.customer_id
WHERE
cg.del_flag = '0'
AND ca.del_flag = '0'
@@ -758,25 +744,11 @@
cg.contacts,
cg.mobile,
- ( CASE WHEN cg.longitude is null THEN
- ( SELECT longitude FROM customer_agency
- WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
- ORDER BY pid ASC LIMIT 1
- )
- ELSE cg.longitude
- END
- ) longitude,
- ( CASE WHEN cg.latitude is null THEN
- ( SELECT latitude FROM customer_agency
- WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
- ORDER BY pid ASC LIMIT 1
- )
- ELSE cg.latitude
- END
- ) latitude
+ IFNULL(cg.longitude,ca.longitude) longitude,
+ IFNULL(cg.latitude,ca.latitude) latitude
FROM
customer_grid cg
- INNER JOIN customer_agency ca ON cg.pid = ca.id
+ INNER JOIN customer_agency ca ON ca.pid = '0' AND ca.customer_id = cg.customer_id
WHERE
cg.del_flag = '0'
AND ca.del_flag = '0'
From 36f7e1d87b7d3242bfea4c1a0b34a649e525d92d Mon Sep 17 00:00:00 2001
From: zhaoqifeng
Date: Wed, 29 Dec 2021 10:26:03 +0800
Subject: [PATCH 55/56] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/controller/WorkActDraftController.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java
index e960a2f926..9d018d7d81 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java
@@ -1,5 +1,7 @@
package com.epmet.controller;
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.work.*;
@@ -82,8 +84,9 @@ public class WorkActDraftController {
* @Date 2020/7/21 17:24
**/
@PostMapping("preview")
- public Result previewActDetail(@RequestBody ActPreviewFormDTO formDTO){
+ public Result previewActDetail(@LoginUser TokenDto tokenDto, @RequestBody ActPreviewFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ActPreviewFormDTO.UserInternalGroup.class);
+ formDTO.setCustomerId(tokenDto.getCustomerId());
ActPreviewResultDTO resultDTO=workActDraftService.previewActDetail(formDTO);
return new Result().ok(resultDTO);
}
From 38eeeecee2962c4f7828717d0abc1c9c7713a7e9 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Wed, 29 Dec 2021 10:36:43 +0800
Subject: [PATCH 56/56] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E4=B8=8A?=
=?UTF-8?q?=E6=8A=A5=E7=9A=84=E9=9C=80=E6=B1=82=EF=BC=8C=E6=8C=87=E6=B4=BE?=
=?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85=E6=97=B6=EF=BC=8C=E9=9C=80=E6=B1=82?=
=?UTF-8?q?=E4=BA=BA=E4=B8=8E=E6=9C=8D=E5=8A=A1=E6=96=B9=E4=B8=8D=E8=83=BD?=
=?UTF-8?q?=E6=98=AF=E4=B8=80=E4=B8=AA=E4=BA=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/epmet/service/impl/IcUserDemandRecServiceImpl.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
index 17833fe7cb..45a1e6f1f8 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
@@ -373,6 +373,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl