diff --git a/epmet-admin/epmet-admin-server/docker-compose.yml b/epmet-admin/epmet-admin-server/docker-compose.yml index de2d42400a..9146d19288 100644 --- a/epmet-admin/epmet-admin-server/docker-compose.yml +++ b/epmet-admin/epmet-admin-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-admin-server: container_name: epmet-admin-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-admin-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-admin-server:0.3.1 ports: - "8082:8082" network_mode: host # 使用现有网络 diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index 3e6ea66091..1f80a977de 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet epmet-admin diff --git a/epmet-admin/epmet-admin-server/src/test/java/io/renren/service/DynamicDataSourceTest.java b/epmet-admin/epmet-admin-server/src/test/java/io/renren/service/DynamicDataSourceTest.java index 823c7bb233..22069ffd12 100644 --- a/epmet-admin/epmet-admin-server/src/test/java/io/renren/service/DynamicDataSourceTest.java +++ b/epmet-admin/epmet-admin-server/src/test/java/io/renren/service/DynamicDataSourceTest.java @@ -1,48 +1,48 @@ -/** - * 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 org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -/** - * 多数据源测试 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@RunWith(SpringRunner.class) -@SpringBootTest -public class DynamicDataSourceTest { - @Autowired - private DynamicDataSourceTestService dynamicDataSourceTestService; - - @Test - public void test(){ - Long id = 1067246875800000001L; - dynamicDataSourceTestService.selectById(id); - dynamicDataSourceTestService.updateUser(id); - dynamicDataSourceTestService.updateUserBySlave1(id); - dynamicDataSourceTestService.updateUserBySlave2(id); - } - - -} +///** +// * 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 org.junit.Test; +//import org.junit.runner.RunWith; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.boot.test.context.SpringBootTest; +//import org.springframework.test.context.junit4.SpringRunner; +// +///** +// * 多数据源测试 +// * +// * @author Mark sunlightcs@gmail.com +// * @since 1.0.0 +// */ +//@RunWith(SpringRunner.class) +//@SpringBootTest +//public class DynamicDataSourceTest { +// @Autowired +// private com.epmet.service.DynamicDataSourceTestService dynamicDataSourceTestService; +// +// @Test +// public void test(){ +// Long id = 1067246875800000001L; +// dynamicDataSourceTestService.selectById(id); +// dynamicDataSourceTestService.updateUser(id); +// dynamicDataSourceTestService.updateUserBySlave1(id); +// dynamicDataSourceTestService.updateUserBySlave2(id); +// } +// +// +//} diff --git a/epmet-auth/docker-compose.yml b/epmet-auth/docker-compose.yml index 34a1b75aa1..cb94815239 100644 --- a/epmet-auth/docker-compose.yml +++ b/epmet-auth/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-auth:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-auth:0.3.1 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index d7f65bb65c..cde69ddcea 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet epmet-cloud diff --git a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 527db417ef..27c596f0de 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -3,10 +3,12 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import java.util.List; @@ -27,4 +29,12 @@ public interface GovOrgFeignClient { **/ @PostMapping(value = "/gov/org/customeragency/getStaffOrgList",consumes = MediaType.APPLICATION_JSON_VALUE) Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO); + + /** + * 查询人员部门列表 + * @param staffId + * @return + */ + @PostMapping("/gov/org/department/staff/{staffId}/departmentlist") + Result> getDepartmentListByStaffId(@PathVariable("staffId") String staffId); } diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java index a1ccd0bdf0..0e42e2436f 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -22,5 +23,10 @@ public class GovOrgFeignClientFallback implements GovOrgFeignClient { public Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffOrgList", staffOrgFormDTO); } + + @Override + public Result> getDepartmentListByStaffId(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDepartmentListByStaffId", staffId); + } } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 35ce90b25c..6b5fc2914d 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.impl; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import com.epmet.common.token.constant.LoginConstant; 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.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; @@ -12,6 +13,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; @@ -27,11 +29,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * @Description 政府端登录服务 @@ -166,6 +167,22 @@ public class GovLoginServiceImpl implements GovLoginService { govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); govTokenDto.setAgencyId(staffLatestAgency.getAgencyId()); govTokenDto.setCustomerId(staffLatestAgency.getCustomerId()); + + try { + Result> deptListResult = govOrgFeignClient.getDepartmentListByStaffId(staffLatestAgency.getStaffId()); + if (deptListResult.success()) { + if (!CollectionUtils.isEmpty(deptListResult.getData())) { + Set deptIdLists = deptListResult.getData().stream().map(dept -> dept.getDepartmentId()).collect(Collectors.toSet()); + govTokenDto.setDeptIdList(deptIdLists); + } + } else { + logger.error("登录:查询部门列表,远程调用返回错误:{}", deptListResult.getMsg()); + } + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error("登录:查询部门列表异常:{}", errorStackTrace); + } + cpUserDetailRedis.set(govTokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); } diff --git a/epmet-auth/src/test/java/com/epmet/TokenGenTest.java b/epmet-auth/src/test/java/com/epmet/TokenGenTest.java index 3368e2d1cf..60f7654b22 100644 --- a/epmet-auth/src/test/java/com/epmet/TokenGenTest.java +++ b/epmet-auth/src/test/java/com/epmet/TokenGenTest.java @@ -11,7 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import java.util.Arrays; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; @RunWith(SpringRunner.class) @@ -43,6 +45,7 @@ public class TokenGenTest { govTokenDto.setUpdateTime(System.currentTimeMillis()); govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(tokenStr).getTime()); govTokenDto.setAgencyId("1"); + govTokenDto.setDeptIdList(new HashSet<>(Arrays.asList("1","2","3"))); govTokenDto.setCustomerId("f76def116c9c2dc0269cc17867af122c"); cpUserDetailRedis.set(govTokenDto, expire); } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java index 13910a6f3a..382e268146 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java @@ -9,13 +9,12 @@ package com.epmet.commons.mybatis.aspect; import com.epmet.commons.mybatis.annotation.DataFilter; +import com.epmet.commons.mybatis.constant.AccessSettingConstant; import com.epmet.commons.mybatis.constant.OpeScopeConstant; -import com.epmet.commons.mybatis.dto.form.OperationScopeDTO; -import com.epmet.commons.mybatis.dto.form.OperationScopeFormDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermCacheResultDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; +import com.epmet.commons.mybatis.dto.form.*; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.feign.GovAccessFeignClient; +import com.epmet.commons.mybatis.feign.GovOrgFeignClient; import com.epmet.commons.tools.aspect.AccessOpeAspect; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; @@ -46,12 +45,20 @@ public class DataFilterAspect { private static final Logger log = LoggerFactory.getLogger(DataFilterAspect.class); + /** + * 线程变量,记录是否已经添加了至少一个过滤条件 + */ + private static final ThreadLocal hasConditions = new ThreadLocal(); + @Autowired private LoginUserUtil loginUserUtil; @Autowired private GovAccessFeignClient govAccessFeignClient; + @Autowired + private GovOrgFeignClient govOrgFeignClient; + public static final String orgIdPathSpliter = ":"; @Before("@annotation(com.epmet.commons.mybatis.annotation.DataFilter)") @@ -94,22 +101,20 @@ public class DataFilterAspect { // 校验操作权限 validateOpePermission(permCacheResultDTO.getPermissions(), requirePermission); + hasConditions.set(false); + // 生成过滤sql + String sqlFilterSegment = getSqlFilterSegment(userId, permCacheResultDTO.getRoleIdList(), requirePermission, + permCacheResultDTO.getOrgIdPath(), permCacheResultDTO.getGridId(), tableAlias, permCacheResultDTO.getDeptIdList()); + + // 填充到Service方法列表中的DataScope对象中 Object[] methodArgs = point.getArgs(); for (Object methodArg : methodArgs) { if (methodArg instanceof DataScope) { - ((DataScope) methodArg).setSqlFilter(getSqlFilterSegment( - userId, - permCacheResultDTO.getRoleIdList(), - requirePermission, - permCacheResultDTO.getOrgIdPath(), - permCacheResultDTO.getGridId(), - tableAlias)); + ((DataScope) methodArg).setSqlFilter(sqlFilterSegment); return; } } - - //throw new RenException(ErrorCode.DATA_SCOPE_PARAMS_ERROR); } /** @@ -128,89 +133,149 @@ public class DataFilterAspect { * * @return */ - private String getSqlFilterSegment(String userId,Set roleIds, String reqiurePermission, String orgIdPath, String gridId, String tableAlias) { - // 根据角色列表查询操作范围列表 - Set scopeDTOS = new HashSet<>(); - roleIds.forEach(roleId -> { - OperationScopeFormDTO osformDto = new OperationScopeFormDTO(); - osformDto.setRoleId(roleId); - osformDto.setOperationKey(reqiurePermission); - Result> result = govAccessFeignClient.getOperationScopesByRoleId(osformDto); - if (result.success()) { - scopeDTOS.addAll(result.getData()); - } - }); + private String getSqlFilterSegment(String userId, Set roleIds, String reqiurePermission, String orgIdPath, + String gridId, String tableAlias, Set deptIds) { - // 过滤范围 - HashSet scopes = filteScopes(scopeDTOS); - if (CollectionUtils.isEmpty(scopes)) { - // 没有范围限制 - return ""; - } StringBuilder sb = new StringBuilder(); + Map accessSettings = listRoleAccessSettings(roleIds); + // 1.生成sql:组织范围过滤 - genOrgScopeSql(sb, orgIdPath, scopes, tableAlias); + genOrgScopeSql(sb, orgIdPath, roleIds, reqiurePermission, tableAlias); // 2.生成sql:我发起的 - genIStartedSql(sb, userId, tableAlias); + String iCreated = accessSettings.get(AccessSettingConstant.I_CREATED_KEY); + if (StringUtils.isNotBlank(iCreated) && AccessSettingConstant.I_CREATED_YES.equals(iCreated)) { + genICreatedSql(sb, userId, tableAlias); + } // 3.生成sql:本网格的 - genInGrid(sb, gridId, tableAlias); + String inGrid = accessSettings.get(AccessSettingConstant.IN_GRID_KEY); + if (StringUtils.isNotBlank(inGrid) && AccessSettingConstant.IN_GRID_YES.equals(inGrid)) { + genInGrid(sb, gridId, tableAlias); + } + + // 4.生成sql:根据部门列表 + String inDept = accessSettings.get(AccessSettingConstant.IN_DEPARTMENT_KEY); + if (StringUtils.isNotBlank(inDept) && AccessSettingConstant.IN_DEPARTMENT_YES.equals(inDept)) { + genDepartmentFilterSql(sb, deptIds); + } - //sb.append(")"); - System.out.println("生成的过滤sql:" + sb.toString()); return sb.toString(); } + /** + * 列出角色对应的权限设置项 + * @param roleIds + * @return + */ + private Map listRoleAccessSettings(Set roleIds) { + Map settings = new HashMap<>(); + roleIds.forEach(roleId -> { + settings.putAll(listRoleAccessSettings(roleId)); + }); + return settings; + } + + private Map listRoleAccessSettings(String roleId) { + Result> result = govAccessFeignClient.listAccessSettings(roleId); + if (result.success()) { + return result.getData(); + } else { + log.error("角色[{}]查询权限配置AccessSettings失败:{}", roleId, result.getMsg()); + } + return new HashMap<>(); + } + /** + * 生成部门过滤sql + * + * @param sb + */ + private void genDepartmentFilterSql(StringBuilder sb, Set deptIdList) { + //Result> deptListResult = govOrgFeignClient.getDepartmentListByStaffId(staffId); + if (CollectionUtils.isEmpty(deptIdList)) { + return; + } + deptIdList.forEach(deptId -> { + sb.append(hasConditions.get() ? " OR " : "").append(" DEPARTMENT_ID = '").append(deptId).append("' "); + }); + hasConditions.set(true); + } + /** * 网格sql + * * @param sb * @param gridId * @param tableAlias */ private void genInGrid(StringBuilder sb, String gridId, String tableAlias) { if (StringUtils.isBlank(tableAlias)) { - sb.append(" OR GRID_ID ='").append(gridId).append("'"); + sb.append(hasConditions.get() ? " OR " : "").append(" GRID_ID ='").append(gridId).append("' "); } else { - sb.append(" OR ").append(tableAlias).append(".GRID_ID ='").append(gridId).append("'"); + sb.append(hasConditions.get() ? " OR " : "").append(tableAlias).append(".GRID_ID ='").append(gridId).append("' "); } + hasConditions.set(true); } /** * sql:我发起的 + * * @param userId */ - private void genIStartedSql(StringBuilder sb, String userId, String tableAlias) { + private void genICreatedSql(StringBuilder sb, String userId, String tableAlias) { if (StringUtils.isBlank(tableAlias)) { - sb.append(" OR CREATED_BY ='").append(userId).append("'"); + sb.append(hasConditions.get() ? " OR " : " ").append(" CREATED_BY ='").append(userId).append("'"); } else { - sb.append(" OR ").append(tableAlias).append(".CREATED_BY ='").append(userId).append("'"); + sb.append(hasConditions.get() ? " OR " : " ").append(tableAlias).append(".CREATED_BY ='").append(userId).append("'"); } + hasConditions.set(true); } /** * 计算组织范围过滤sql,整体入口 + * * @param sb * @param orgIdPath - * @param scopes */ - public void genOrgScopeSql(StringBuilder sb, String orgIdPath, HashSet scopes, String tableAlias) { + public void genOrgScopeSql(StringBuilder sb, String orgIdPath, Set roleIds, String reqiurePermission, String tableAlias) { + + // 根据角色列表查询操作范围列表 + Set scopeDTOS = new HashSet<>(); + roleIds.forEach(roleId -> { + OperationScopeFormDTO osformDto = new OperationScopeFormDTO(); + osformDto.setRoleId(roleId); + osformDto.setOperationKey(reqiurePermission); + Result> result = govAccessFeignClient.getOperationScopesByRoleId(osformDto); + if (result.success()) { + scopeDTOS.addAll(result.getData()); + } + }); + + // 过滤范围 + HashSet scopes = filteScopes(scopeDTOS); + if (CollectionUtils.isEmpty(scopes)) { + // 没有范围限制 + return; + } + // 取出父组织ID path 和当前组织ID String pOrgPath = orgIdPath.substring(0, orgIdPath.lastIndexOf(orgIdPathSpliter)); String currOrgPath = orgIdPath.substring(orgIdPath.lastIndexOf(orgIdPathSpliter) + 1); genOrgScopeSql(sb, scopes, currOrgPath, pOrgPath, tableAlias); sb.replace(sb.lastIndexOf("OR"), sb.lastIndexOf("OR") + 3, ""); + hasConditions.set(true); } /** * 计算组织范围过滤sql + * * @param scopes * @param currOrg * @param pOrgPath * @return */ - private void genOrgScopeSql(StringBuilder sb,HashSet scopes, String currOrg, String pOrgPath, String tableAlias) { + private void genOrgScopeSql(StringBuilder sb, HashSet scopes, String currOrg, String pOrgPath, String tableAlias) { for (String scope : scopes) { switch (scope) { case OpeScopeConstant.ORG_CURR: @@ -261,6 +326,9 @@ public class DataFilterAspect { for (OperationScopeDTO scope : scopeDTOS) { String scopeIndex = scope.getScopeIndex(); + if (StringUtils.isBlank(scopeIndex)) { + continue; + } String[] currArr = scopeIndex.split("_"); if ("0".equals(currArr[1])) { // 为0,说明没有包含关系,直接放入 diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/AccessSettingConstant.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/AccessSettingConstant.java new file mode 100644 index 0000000000..4ccb9a8b41 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/AccessSettingConstant.java @@ -0,0 +1,15 @@ +package com.epmet.commons.mybatis.constant; + +public class AccessSettingConstant { + public static final String I_CREATED_KEY = "I_CREATED"; + public static final String I_CREATED_YES = "YES"; + + public static final String I_PART_KEY = "I_PART"; + public static final String I_PART_YES = "YES"; + + public static final String IN_GRID_KEY = "IN_GRID"; + public static final String IN_GRID_YES = "YES"; + + public static final String IN_DEPARTMENT_KEY = "IN_DEPARTMENT"; + public static final String IN_DEPARTMENT_YES = "YES"; +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/DepartmentListResultDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/DepartmentListResultDTO.java new file mode 100644 index 0000000000..1bf20bae66 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/DepartmentListResultDTO.java @@ -0,0 +1,49 @@ +/** + * 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.commons.mybatis.dto.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 组织首页-获取机关下部门列表-部门详情数据 + * + * @author sun + */ +@Data +public class DepartmentListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + private String departmentId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门下总人数 + */ + private Integer totalUser; +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/RoleAccessSettingResultDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/RoleAccessSettingResultDTO.java new file mode 100644 index 0000000000..f4099cfaa1 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/RoleAccessSettingResultDTO.java @@ -0,0 +1,13 @@ +package com.epmet.commons.mybatis.dto.form; + +import lombok.Data; + +@Data +public class RoleAccessSettingResultDTO { + + private String settingKey; + private String id; + private String settingName; + private String roleId; + +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java index 7775756b38..ec090d7aee 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java @@ -17,6 +17,11 @@ public class StaffPermCacheResultDTO { */ private Set roleIdList; + /** + * 部门id列表 + */ + private Set deptIdList; + /** * 机构Id */ diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java index 50b20890e7..354df4950f 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java @@ -1,23 +1,23 @@ package com.epmet.commons.mybatis.feign; -import com.epmet.commons.mybatis.dto.form.OperationScopeDTO; -import com.epmet.commons.mybatis.dto.form.OperationScopeFormDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermCacheResultDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; +import com.epmet.commons.mybatis.dto.form.*; import com.epmet.commons.mybatis.feign.fallback.GovAccessFeignClientFallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import java.util.List; +import java.util.Map; import java.util.Set; /** * @Description * @Author sun */ +//, url = "localhost:8099" @FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class) public interface GovAccessFeignClient { @@ -36,4 +36,11 @@ public interface GovAccessFeignClient { @PostMapping("/gov/access/access/operationscopes") Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO); + /** + * 查询角色的权限相关配置 + * @param roleId + * @return + */ + @PostMapping("/gov/access/access/role/{roleId}/accesssettings") + Result> listAccessSettings(@PathVariable("roleId") String roleId); } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovOrgFeignClient.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovOrgFeignClient.java new file mode 100644 index 0000000000..67226cdd0e --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovOrgFeignClient.java @@ -0,0 +1,30 @@ +package com.epmet.commons.mybatis.feign; + +import com.epmet.commons.mybatis.dto.form.*; +import com.epmet.commons.mybatis.feign.fallback.GovAccessFeignClientFallback; +import com.epmet.commons.mybatis.feign.fallback.GovOrgFeignClientFallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; +import java.util.Set; + +/** + * @Description + * @Author sun + */ +//, url = "localhost:8092" +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallback.class) +public interface GovOrgFeignClient { + + /** + * 查询人员部门列表 + * @param staffId + * @return + */ + @PostMapping("/gov/org/department/staff/{staffId}/departmentlist") + Result> getDepartmentListByStaffId(@PathVariable("staffId") String staffId); +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java index 6dfa1b89cc..ae74de9483 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java @@ -1,15 +1,14 @@ package com.epmet.commons.mybatis.feign.fallback; -import com.epmet.commons.mybatis.dto.form.OperationScopeDTO; -import com.epmet.commons.mybatis.dto.form.OperationScopeFormDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermCacheResultDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; +import com.epmet.commons.mybatis.dto.form.*; import com.epmet.commons.mybatis.feign.GovAccessFeignClient; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import org.springframework.stereotype.Component; +import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -30,4 +29,9 @@ public class GovAccessFeignClientFallback implements GovAccessFeignClient { public Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getOperationScopesByRoleId", operationScopeFormDTO); } + + @Override + public Result> listAccessSettings(String roleId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listAccessSettings", roleId); + } } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovOrgFeignClientFallback.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovOrgFeignClientFallback.java new file mode 100644 index 0000000000..cce3d60309 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovOrgFeignClientFallback.java @@ -0,0 +1,27 @@ +package com.epmet.commons.mybatis.feign.fallback; + +import com.epmet.commons.mybatis.dto.form.*; +import com.epmet.commons.mybatis.feign.GovAccessFeignClient; +import com.epmet.commons.mybatis.feign.GovOrgFeignClient; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Set; + +/** + * 调用政府端权限 + * @Author wxz + * @Description + * @Date 2020/4/24 11:17 + **/ +@Component +public class GovOrgFeignClientFallback implements GovOrgFeignClient { + + @Override + public Result> getDepartmentListByStaffId(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getDepartmentListByStaffId", staffId); + } +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java index d26f7525a1..e211c01e4e 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java @@ -80,6 +80,9 @@ public class DataFilterInterceptor extends AbstractSqlParserHandler implements I String orderBy = "ORDER BY"; String groupBy = "GROUP BY"; String sqlFilter = scope.getSqlFilter(); + if (StringUtils.isBlank(sqlFilter)) { + return invocation.proceed(); + } if (originalSql.indexOf("WHERE") == 0) { // 不包含where,需要手动拼接上 sqlFilter = " WHERE ".concat(sqlFilter); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index f0c689c875..8a55f6c7a9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -31,6 +31,7 @@ public interface NumConstant { int FORTY = 40; int FIFTY = 50; int ONE_HUNDRED = 100; + int MAX = 99999999; long ZERO_L = 0L; long ONE_L = 1L; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index f8fb4b718d..79f32f7d1f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -74,6 +74,11 @@ public interface ServiceConstant { */ String EPMET_MESSAGE_SERVER = "epmet-message-server"; + /** + * 楼院小组 + */ + String RESI_GROUP_SERVER ="resi-group-server"; + /** * 政府端权限服务 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 6598010561..0b6c64d6ef 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -215,6 +215,15 @@ public class RedisKeys { * @return */ public static String getRoleOpeScopesKey(String roleId, String opeKey) { - return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(opeKey); + return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(":").concat(opeKey); + } + + /** + * 角色ID对应的权限配置 + * @param roleId + * @return + */ + public static String getRoleAccessSettingKey(String roleId) { + return rootPrefix.concat("gov:access:role:accesssettings:").concat(roleId); } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java index 49d6cb15a3..de94567fb6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java @@ -62,7 +62,7 @@ public class GovTokenDto extends BaseTokenDto implements Serializable { /** * 部门id列表 */ - private List deptIdList; + private Set deptIdList; /** * 功能权限列表,实际上是gov_staff => staff_role => role_operation查询到的operationKey diff --git a/epmet-gateway/docker-compose.yml b/epmet-gateway/docker-compose.yml index 92f43dd02d..4a0582ca7e 100644 --- a/epmet-gateway/docker-compose.yml +++ b/epmet-gateway/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-gateway:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-gateway:0.3.2 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 7ccab3e048..0455fd3a0b 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.2 com.epmet epmet-cloud @@ -154,15 +154,17 @@ - lb://resi-partymember-server - - - http://127.0.0.1:8099 - - + http://127.0.0.1:8096 + + + http://127.0.0.1:8097 + - http://127.0.0.1:8098 + http://127.0.0.1:8098 + + http://127.0.0.1:8099 + @@ -219,6 +221,8 @@ lb://resi-group-server lb://resi-partymember-server + + lb://gov-grid-server lb://gov-access-server @@ -286,6 +290,8 @@ lb://gov-mine-server + + lb://gov-grid-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 64cd74507d..f83c45f2f1 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -167,6 +167,15 @@ spring: filters: - StripPrefix=1 - CpAuth=true + #政府端网格管理 + - id: gov-grid-server + uri: @gateway.routes.gov-grid-server.uri@ + order: 18 + predicates: + - Path=${server.servlet.context-path}/gov/grid/** + filters: + - StripPrefix=1 + - CpAuth=true #政府端权限服务 @@ -227,6 +236,7 @@ renren: - /resi/mine/** - /resi/group/** - /resi/partymember/** + - /gov/grid/** management: endpoints: web: @@ -290,9 +300,11 @@ epmet: - /resi/guide/stranger/getgridhome - /resi/guide/user/entergrid - /auth/login/logout + - /auth/gov/loginwxmp/loginout - /resi/mine/** - /resi/group/** - /resi/partymember/** + - /gov/grid/** - /gov/mine/** - /gov/access/** swaggerUrls: diff --git a/epmet-module/epmet-message/epmet-message-server/docker-compose.yml b/epmet-module/epmet-message/epmet-message-server/docker-compose.yml index ae7864d1f1..76db1b8a99 100644 --- a/epmet-module/epmet-message/epmet-message-server/docker-compose.yml +++ b/epmet-module/epmet-message/epmet-message-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-message-server: container_name: epmet-message-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-message-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-message-server:0.3.1 ports: - "8085:8085" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index f54b2636a0..b713085343 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet epmet-message diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java index 191314af0a..a35af017c9 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java @@ -51,4 +51,9 @@ public class StaffPermCacheFormDTO { */ private Set roleIdList; + /** + * 当前所在网格id + */ + private String gridId; + } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleAccessSettingResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleAccessSettingResultDTO.java new file mode 100644 index 0000000000..7330f3b425 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleAccessSettingResultDTO.java @@ -0,0 +1,14 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class RoleAccessSettingResultDTO { + + private String settingKey; + private String id; + private String settingName; + private String settingValue; + private String roleId; + +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java index ce24cf9501..d19ed3ff27 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java @@ -18,6 +18,11 @@ public class StaffPermCacheResultDTO { */ private Set roleIdList; + /** + * 部门id列表 + */ + private Set deptIdList; + /** * 组织ID */ diff --git a/epmet-module/gov-access/gov-access-server/Dockerfile b/epmet-module/gov-access/gov-access-server/Dockerfile new file mode 100644 index 0000000000..af8e62bd87 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8099 + +ENTRYPOINT ["java","-Xms32m","-Xmx200m","-jar","./app.jar"] \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/docker-compose.yml b/epmet-module/gov-access/gov-access-server/docker-compose.yml new file mode 100644 index 0000000000..ab43232d2f --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3.7" +services: + gov-access-server: + container_name: gov-access-server-dev + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-access-server:0.3.1 + ports: + - "8099:8099" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index f71a21d4a0..9fe84d7d5b 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.0 + 0.3.1 gov-access com.epmet diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java index e34df14a06..2f9bdcb567 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.OperationScopeDTO; import com.epmet.dto.form.OperationScopeFormDTO; import com.epmet.dto.form.StaffPermCacheFormDTO; +import com.epmet.dto.result.RoleAccessSettingResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.dto.result.StaffPermCacheResultDTO; import com.epmet.entity.OperationScopeEntity; @@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -32,7 +34,7 @@ public class AccessController { private AccessService accessService; /** - * 更新工作人员权限缓存 + * 更新工作人员权限缓存(前端查询权限时候gov-mine会调用此处) * @param staffPermCacheFormDTO * @return */ @@ -45,12 +47,13 @@ public class AccessController { Set permissions = staffPermCacheFormDTO.getPermissions(); Set roleIdList = staffPermCacheFormDTO.getRoleIdList(); String orgId = staffPermCacheFormDTO.getOrgIdPath(); - accessService.updatePermissionCache(staffId, app, client, permissions, roleIdList, orgId); + String gridId = staffPermCacheFormDTO.getGridId(); + accessService.updatePermissionCache(staffId, app, client, permissions, roleIdList, orgId, gridId); return new Result(); } /** - * 查询用户当前权限列表(DataFilterAspect中用到) + * 从缓存中查询用户当前权限列表(DataFilterAspect中用到) * @return */ @PostMapping("getcurrpermissions") @@ -64,6 +67,7 @@ public class AccessController { resultDTO.setRoleIdList(govTokenDto.getRoleIdList()); resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath()); resultDTO.setGridId(govTokenDto.getGridId()); + resultDTO.setDeptIdList(govTokenDto.getDeptIdList()); } return new Result().ok(resultDTO); } @@ -78,4 +82,15 @@ public class AccessController { Set scopes = accessService.listOperationScopesByRoleId(operationScopeFormDTO.getRoleId(), operationScopeFormDTO.getOperationKey()); return new Result>().ok(scopes); } + + /** + * 查询角色的权限相关配置 + * @param roleId + * @return + */ + @PostMapping("/role/{roleId}/accesssettings") + public Result> listAccessSettings(@PathVariable("roleId") String roleId) { + Map settings = accessService.listAccessSettings(roleId); + return new Result>().ok(settings); + } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleAccessSettingDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleAccessSettingDao.java new file mode 100644 index 0000000000..42acf285e0 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleAccessSettingDao.java @@ -0,0 +1,37 @@ +/** + * 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.dto.result.RoleAccessSettingResultDTO; +import com.epmet.entity.RoleAccessSettingEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 权限配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-26 + */ +@Mapper +public interface RoleAccessSettingDao extends BaseDao { + + List listRoleAccessSettingsByRoleId(String roleId); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleAccessSettingEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleAccessSettingEntity.java new file mode 100644 index 0000000000..bbb8d650bf --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleAccessSettingEntity.java @@ -0,0 +1,65 @@ +/** + * 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 2020-04-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("role_access_setting") +public class RoleAccessSettingEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 配置KEY + */ + private String settingKey; + + /** + * 配置name + */ + private String settingName; + /** + * 配置值 + */ + private String settingValue; + + /** + * 角色ID + */ + private String roleId; + + /** + * 操作简介 + */ + private String brief; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleAccessSettingRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleAccessSettingRedis.java new file mode 100644 index 0000000000..02efbb9850 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleAccessSettingRedis.java @@ -0,0 +1,37 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.result.RoleAccessSettingResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiConsumer; + +@Component +public class RoleAccessSettingRedis { + + @Autowired + private RedisUtils redisUtils; + + public void set(Map settings, String roleId) { + String roleAccessSettingKey = RedisKeys.getRoleAccessSettingKey(roleId); + redisUtils.hMSet(roleAccessSettingKey, settings); + } + + public Map get(String roleId) { + String roleAccessSettingKey = RedisKeys.getRoleAccessSettingKey(roleId); + Map s = redisUtils.hGetAll(roleAccessSettingKey); + Map settings = new HashMap<>(); + s.forEach((s1, o) -> { + if (o != null) { + settings.put(s1, String.valueOf(o)); + } + }); + return settings; + } + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java index df16e1e9df..dcda2ebe7e 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java @@ -1,10 +1,12 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.GovTokenDto; +import com.epmet.dto.result.RoleAccessSettingResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.entity.OperationScopeEntity; import java.util.List; +import java.util.Map; import java.util.Set; public interface AccessService { @@ -13,7 +15,7 @@ public interface AccessService { * @param staffId * @param permissions */ - void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, String orgIdPath); + void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, String orgIdPath, String gridId); /** * 查询用户当前权限列表 @@ -28,4 +30,11 @@ public interface AccessService { * @return */ Set listOperationScopesByRoleId(String roleId, String operationKey); + + /** + * 查询角色的权限相关配置 + * @param roleId + * @return + */ + Map listAccessSettings(String roleId); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index 34e458ec6a..0249885536 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -4,7 +4,10 @@ import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.dao.OperationScopeDao; +import com.epmet.dao.RoleAccessSettingDao; +import com.epmet.dto.result.RoleAccessSettingResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; +import com.epmet.redis.RoleAccessSettingRedis; import com.epmet.redis.RoleOpeScopeRedis; import com.epmet.service.AccessService; import org.slf4j.Logger; @@ -13,7 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.Set; +import java.util.*; @Service public class AccessServiceImpl implements AccessService { @@ -26,16 +29,24 @@ public class AccessServiceImpl implements AccessService { @Autowired private OperationScopeDao operationScopeDao; + @Autowired + private RoleAccessSettingDao roleAccessSettingDao; + @Autowired private RoleOpeScopeRedis roleOpeScopeRedis; + @Autowired + private RoleAccessSettingRedis roleAccessSettingRedis; + + /** * 更新权限缓存 * @param staffId * @param permissions */ @Override - public void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, String orgIdPath) { + public void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, + String orgIdPath, String gridId) { GovTokenDto govTokenDto = cpUserDetailRedis.get(app, client, staffId, GovTokenDto.class); if (govTokenDto == null) { logger.warn("更新[{}]用户缓存:Redis中不存在该用户TokenDto缓存信息", staffId); @@ -45,6 +56,7 @@ public class AccessServiceImpl implements AccessService { govTokenDto.setPermissions(permissions); govTokenDto.setRoleIdList(roleIdList); govTokenDto.setOrgIdPath(orgIdPath); + govTokenDto.setGridId(gridId); // 将新的TokenDto更新到redis中 long expire = cpUserDetailRedis.getExpire(app, client, staffId); @@ -77,4 +89,26 @@ public class AccessServiceImpl implements AccessService { } return scopes; } + + /** + * 查询角色的权限相关配置 + * @param roleId + * @return + */ + @Override + public Map listAccessSettings(String roleId) { + Map settings = roleAccessSettingRedis.get(roleId); + //if (CollectionUtils.isEmpty(settings)) { + // // 数据库查出来,放入redis一份。此处为权限过滤器用到,存在缓存穿透,所以不采用这种方式。 + // // 改用为:变动setting的时候手动更新缓存的方式 + // List settingsDB = roleAccessSettingDao.listRoleAccessSettingsByRoleId(roleId); + // if (!CollectionUtils.isEmpty(settingsDB)) { + // roleAccessSettingRedis.set(settingsDB, roleId); + // } + //} + if (settings == null) { + settings = new HashMap<>(); + } + return settings; + } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql index 93d8c2a148..62e72134a0 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql @@ -5,6 +5,8 @@ -- SET NAMES utf8mb4; -- #SET FOREIGN_KEY_CHECKS = 0; +CREATE DATABASE `epmet_gov_access` DEFAULT CHARACTER SET utf8mb4; + -- DROP TABLE IF EXISTS `permission_scope`; CREATE TABLE `operation_scope` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id', @@ -73,4 +75,22 @@ CREATE TABLE `role_scope` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能操作哪些范围' ROW_FORMAT = Dynamic; +-- 2020.04.26 wxz -- + +CREATE TABLE `role_access_setting` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `SETTING_KEY` varchar(30) NOT NULL COMMENT '配置KEY', + `SETTING_NAME` varchar(30) NOT NULL COMMENT '配置name', + `SETTING_VALUE` varchar(30) NOT NULL COMMENT '配置值', + `ROLE_ID` varchar(64) DEFAULT NULL COMMENT '角色ID', + `BRIEF` varchar(255) DEFAULT NULL COMMENT '操作简介', + `DEL_FLAG` tinyint(1) DEFAULT NULL, + `REVISION` int(10) DEFAULT NULL, + `CREATED_BY` varchar(64) DEFAULT NULL, + `CREATED_TIME` datetime DEFAULT NULL, + `UPDATED_BY` varchar(64) DEFAULT NULL, + `UPDATED_TIME` datetime DEFAULT NULL, + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='权限配置' + -- SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleAccessSettingDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleAccessSettingDao.xml new file mode 100644 index 0000000000..cc31938799 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleAccessSettingDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/test/java/com/epmet/test/govaccess/AccessSettingTest.java b/epmet-module/gov-access/gov-access-server/src/test/java/com/epmet/test/govaccess/AccessSettingTest.java new file mode 100644 index 0000000000..6ac8bf1547 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/test/java/com/epmet/test/govaccess/AccessSettingTest.java @@ -0,0 +1,38 @@ +package com.epmet.test.govaccess; + +import com.epmet.dao.RoleAccessSettingDao; +import com.epmet.dto.result.RoleAccessSettingResultDTO; +import com.epmet.redis.RoleAccessSettingRedis; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class AccessSettingTest { + + @Autowired + private RoleAccessSettingDao roleAccessSettingDao; + + @Autowired + private RoleAccessSettingRedis roleAccessSettingRedis; + + @Test + public void addAccessSettings2Redis() { + List settings = roleAccessSettingDao.listRoleAccessSettingsByRoleId("1"); + HashMap objectObjectHashMap = new HashMap<>(); + settings.forEach(s -> { + objectObjectHashMap.put(s.getSettingKey(), s.getSettingValue()); + }); + roleAccessSettingRedis.set(objectObjectHashMap, "1"); + Map map = roleAccessSettingRedis.get("1"); + System.out.println(map); + } + +} diff --git a/epmet-module/gov-grid/gov-grid-client/pom.xml b/epmet-module/gov-grid/gov-grid-client/pom.xml new file mode 100644 index 0000000000..297cb07121 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/pom.xml @@ -0,0 +1,25 @@ + + + + gov-grid + com.epmet + 2.0.0 + + 4.0.0 + + gov-grid-client + + + javax.validation + validation-api + + + org.projectlombok + lombok + + + + + \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/.gitkeep b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/.gitkeep b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java new file mode 100644 index 0000000000..fe9dae424c --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 党员认证-审核历史列表入参 + * @Author yinzuomei + * @Date 2020/4/26 23:28 + */ +@Data +public class AuditedPartyMemberFormDTO implements Serializable { + private static final long serialVersionUID = -6698685200715718225L; + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; +} + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java new file mode 100644 index 0000000000..a05bf1ddb9 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 党员认证-待审核列表入参 + * @Author yinzuomei + * @Date 2020/4/26 15:59 + */ +@Data +public class AuditingPartyMemberFormDTO implements Serializable { + private static final long serialVersionUID = 6022180109189321760L; + + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; +} + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/.gitkeep b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java new file mode 100644 index 0000000000..a5558e101b --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 党员认证-审核历史列表f返参 + * @Author yinzuomei + * @Date 2020/4/26 23:29 + */ +@Data +public class AuditedPartyMemberResultDTO implements Serializable { + private static final long serialVersionUID = 4203582446687799299L; + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * auto_confirm_failed:自动认证失败,rejected :拒绝 + */ + private String status; + + /** + * read已读unread未读 + */ + private String gridFullPath; +} + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java new file mode 100644 index 0000000000..5259b62602 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 党员认证-待审核列表返参 + * @Author yinzuomei + * @Date 2020/4/26 16:08 + */ +@Data +public class AuditingPartyMemberResultDTO implements Serializable { + private static final long serialVersionUID = 5408510275912925158L; + + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String readFlag; + + /** + * read已读unread未读 + */ + private String gridFullPath; +} + diff --git a/epmet-module/gov-grid/gov-grid-server/Dockerfile b/epmet-module/gov-grid/gov-grid-server/Dockerfile new file mode 100644 index 0000000000..b0772443a7 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8097 + +ENTRYPOINT ["java","-Xms32m","-Xmx200m","-jar","./app.jar"] \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-server/docker-compose.yml b/epmet-module/gov-grid/gov-grid-server/docker-compose.yml new file mode 100644 index 0000000000..315dd41d48 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3.7" +services: + gov-grid-server: + container_name: gov-grid-server-dev + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-grid-server:0.3.1 + ports: + - "8097:8097" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml new file mode 100644 index 0000000000..3e692a9b87 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/pom.xml @@ -0,0 +1,169 @@ + + + 4.0.0 + 0.3.1 + + com.epmet + gov-grid + 2.0.0 + + gov-grid-server + jar + + + + com.epmet + gov-grid-client + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + + com.epmet + gov-org-client + 2.0.0 + + + com.epmet + resi-partymember-client + 2.0.0 + compile + + + com.epmet + resi-group-client + 2.0.0 + compile + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + + dev-local + + true + + + 8097 + dev + + + 0 + 127.0.0.1 + 6379 + 123456 + + false + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + dev + + + 8097 + dev + + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + + + test + + + 8097 + test + + + 0 + 10.10.10.248 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/GovGridApplication.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/GovGridApplication.java new file mode 100644 index 0000000000..ac047e4a68 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/GovGridApplication.java @@ -0,0 +1,23 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class GovGridApplication { + + public static void main(String[] args) { + SpringApplication.run(GovGridApplication.class, args); + } + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..e15538fdaa --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "govgrid"; + } +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/SwaggerConfig.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/SwaggerConfig.java new file mode 100644 index 0000000000..e4ceef42ee --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/SwaggerConfig.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.constant.Constant; +import io.swagger.annotations.ApiOperation; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.List; + +import static com.google.common.collect.Lists.newArrayList; + +/** + * Swagger配置 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + //加了ApiOperation注解的类,才生成接口文档 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + //包下的类,才生成接口文档 + //.apis(RequestHandlerSelectors.basePackage("io.renren.controller")) + .paths(PathSelectors.any()) + .build() + .directModelSubstitute(java.util.Date.class, String.class) + .securitySchemes(security()); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("人人开源") + .description("系统模块开发文档") + .termsOfServiceUrl("https://www.renren.io/community") + .version("1.4.0") + .build(); + } + + private List security() { + return newArrayList( + new ApiKey(Constant.TOKEN_HEADER, Constant.TOKEN_HEADER, "header") + ); + } + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java new file mode 100644 index 0000000000..128c08fa0a --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java @@ -0,0 +1,126 @@ +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.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO; +import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO; +import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO; +import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO; +import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO; +import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO; +import com.epmet.service.ResiGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Description 政府端管理楼院小组业务 + * @ClassName ResiGroupController + * @Author wangc + * @date 2020.04.16 15:30 + */ +@RestController +@RequestMapping("resi/group") +public class ResiGroupController { + @Autowired + ResiGroupService resiGroupService; + /** + * 小组审核历史列表 + * + * @param formDTO 参数 + * @return + */ + @PostMapping("audited") + public Result> audited(@RequestBody GroupAuditedFromDTO formDTO) { + return resiGroupService.audited(formDTO); + } + + /** + * 本网格小组列表 + * + * @param formDTO 参数 + * @return Result> + */ + @PostMapping("groupsingrid") + public Result> getGroupsInGrid(GroupAuditedFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiGroupService.getGroupsInGrid(formDTO); + } + + /** + * 小组管理界面信息 + * + * @param formDTO 参数 + * @return Result + */ + @PostMapping("getgroupsummarize") + public Result getGroupSummarize(GovGroupSummarizeFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiGroupService.getGroupSummarize(formDTO); + } + + /** + * @Description 查询小组待审核列表 + * @Param ApplyingGroupsFormDTO.class + * @return Result> + * @Author wangc + * @Date 2020.04.20 13:59 + **/ + @PostMapping("auditing") + public Result> auditing(@LoginUser TokenDto tokenDto, @RequestBody ApplyingGroupsFormDTO applyingGroupsFormDTO){ + applyingGroupsFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(applyingGroupsFormDTO); + return resiGroupService.auditing(applyingGroupsFormDTO); + } + + /** + * @Description 得到待审核/未审核小组信息的详情 + * @Param CommonGroupIdFromDTO -> String groupId + * @return Result + * @Author wangc + * @Date 2020.04.20 14:08 + **/ + @PostMapping("applygroupdetail") + public Result applyGroupDetail(@LoginUser TokenDto tokenDto, @RequestBody CommonGroupIdFromDTO groupIdFromDTO){ + groupIdFromDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(groupIdFromDTO); + return resiGroupService.applyGroupDetail(groupIdFromDTO); + } + + /** + * @Description 建组申请-审核通过 + * @Param AgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.20 14:25 + **/ + @PostMapping("approve") + public Result agreeApplying(@LoginUser TokenDto tokenDto, @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO){ + agreeApplyGroupFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(agreeApplyGroupFormDTO); + return resiGroupService.agreeApplying(agreeApplyGroupFormDTO); + } + + /** + * @Description 建组申请-审核驳回 + * @Param DisAgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.20 14:26 + **/ + @PostMapping("reject") + public Result disagreeApplying(@LoginUser TokenDto tokenDto, @RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO){ + disAgreeApplyGroupFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); + return resiGroupService.disagreeApplying(disAgreeApplyGroupFormDTO); + } +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java new file mode 100644 index 0000000000..565127f1db --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java @@ -0,0 +1,53 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuditedPartyMemberFormDTO; +import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.result.AuditedPartyMemberResultDTO; +import com.epmet.dto.result.AuditingPartyMemberResultDTO; +import com.epmet.service.ResiPartyMemberService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Description 基层治理-党员认证 + * @Author yinzuomei + * @Date 2020/4/26 14:01 + */ +@RestController +@RequestMapping("partymember") +public class ResiPartyMemberController { + @Autowired + private ResiPartyMemberService resiPartyMemberService; + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 待审核列表:自动审核失败且已经录入了补充信息的 + * @Date 2020/4/26 16:04 + **/ + @PostMapping("auditing") + public Result> auditing(@RequestBody AuditingPartyMemberFormDTO formDTO) { + return resiPartyMemberService.auditing(formDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 党员认证-审核历史列表(审核历史:只包括自动审核失败和拒绝的审核失败:居民未填写补充信息。) + * @Date 2020/4/26 23:31 + **/ + @PostMapping("audited") + public Result> audited(@RequestBody AuditedPartyMemberFormDTO formDTO) { + return resiPartyMemberService.audited(formDTO); + } +} + + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java new file mode 100644 index 0000000000..e2eed38422 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java @@ -0,0 +1,85 @@ +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.resi.group.dto.comment.form.ResiQueryCommentFormDTO; +import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; +import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO; +import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO; +import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; +import com.epmet.service.ResiTopicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("resi/topic") +public class ResiTopicController { + @Autowired + private ResiTopicService resiTopicService; + + /** + * @Description 政府端群组管理-屏蔽话题列表查询 + * @Param tokenDto + * @Param ResiTopicPageFormDTO.class + * @return List + * @Author wangc + * @Date 2020.04.01 16:45 + **/ + @PostMapping("hiddenlist") + Result> hiddenList(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){ + ValidatorUtils.validateEntity(topicPageFormDTO); + return resiTopicService.hiddenList(topicPageFormDTO); + } + + /** + * @Description 政府端群组管理-查看历史话题(分页,允许状态筛选) + * @Param tokenDto + * @Param ResiTopicPageFormDTO.class + * @return Result> + * @Author wangc + * @Date 2020.04.01 10:36 + **/ + @PostMapping("alltopics") + Result> allTopics(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicPageFormDTO topicPageFormDTO){ + ValidatorUtils.validateEntity(topicPageFormDTO); + return resiTopicService.allTopics(topicPageFormDTO); + } + + /** + * @Description 政府端群组管理-获取话题详情 + * @Param tokenDto + * @Param String + * @return Result + * @Author wangc + * @Date 2020.04.01 23:48 + **/ + @PostMapping("topicdetail") + Result getTopicDetailGov(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicDetailFormDTO topicDetailFormDTO){ + ValidatorUtils.validateEntity(topicDetailFormDTO); + return resiTopicService.topicDetail(topicDetailFormDTO); + } + + /** + * @Description 政府端群组管理-获取某个话题的评论列表 + * @Param tokenDto + * @Param ResiQueryCommentFormDTO + * @return Result> + * @Author wangc + * @Date 2020.04.01 23:49 + **/ + @PostMapping("topiccomments") + Result> topicComments(@LoginUser TokenDto tokenDto,@RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){ + ValidatorUtils.validateEntity(queryCommentFormDTO); + return resiTopicService.topicComments(queryCommentFormDTO); + } + + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiWarmheartedController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiWarmheartedController.java new file mode 100644 index 0000000000..47181d2db8 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiWarmheartedController.java @@ -0,0 +1,88 @@ +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.resi.partymember.dto.warmhearted.form.*; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; +import com.epmet.service.ResiWarmheartedService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Description 政府端管理热心居民业务 + * @ClassName ResiWarmheartedController + * @Author wangc + * @date 2020.04.16 15:30 + */ +@RestController +@RequestMapping("resi/warmhearted") +public class ResiWarmheartedController { + + @Autowired + private ResiWarmheartedService resiWarmheartedService; + + /** + * 热心居民审核历史列表 + * + * @param formDTO 参数 + * @return + */ + @PostMapping("audited") + public Result> audited(@RequestBody ResiWarmheartedAuditedFromDTO formDTO) { + return resiWarmheartedService.audited(formDTO); + } + + /** + * @param + * @Author sun + * @Description 政府端-获取待审核的热心居民申请列表 + **/ + @PostMapping("auditing") + public Result> auditing(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiWarmheartedService.auditing(formDTO); + } + + /** + * @param + * @Author sun + * @Description 政府端-热心居民申请-审核通过 + **/ + @PostMapping("approve") + public Result approve(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditApproveFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiWarmheartedService.approve(formDTO); + } + + /** + * @param + * @Author sun + * @Description 政府端-热心居民申请-审核驳回 + **/ + @PostMapping("reject") + public Result reject(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditRejectFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiWarmheartedService.reject(formDTO); + } + + /** + * @param + * @Author sun + * @Description 政府端-热心居民申请详情信息 + **/ + @PostMapping("getdetail") + public Result getDetail(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmGetDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiWarmheartedService.getDetail(formDTO); + } + + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/dao/.gitkeep b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/dao/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/entity/.gitkeep b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/entity/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/excel/.gitkeep b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/excel/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/exception/ModuleErrorCode.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/exception/ModuleErrorCode.java new file mode 100644 index 0000000000..f7aba2c2c7 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/exception/ModuleErrorCode.java @@ -0,0 +1,16 @@ +package com.epmet.exception; + +import com.epmet.commons.tools.exception.ErrorCode; + +/** + * 模块错误编码,由9位数字组成,前6位为模块编码,后3位为业务编码 + *

+ * 如:100001001(100001代表模块,001代表业务代码) + *

+ * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface ModuleErrorCode extends ErrorCode { + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java new file mode 100644 index 0000000000..2978f72a86 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java @@ -0,0 +1,144 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.fallback.ResiGroupFeignClientFallBack; +import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; +import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; +import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO; +import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO; +import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO; +import com.epmet.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO; +import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; +import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO; +import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO; +import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO; +import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO; +import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/17 15:24 + */ +@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupFeignClientFallBack.class) +public interface ResiGroupFeignClient { + /** + * 小组审核历史列表 + * + * @param formDTO 参数 + * @return Result> + */ + @PostMapping("/resi/group/group/audited") + Result> audited(GroupAuditedFromDTO formDTO); + + /** + * 本网格小组列表 + * + * @param formDTO 参数 + * @return Result> + */ + @PostMapping("/resi/group/group/groupsingrid") + Result> getGroupsInGrid(GroupAuditedFromDTO formDTO); + + /** + * 小组管理界面信息 + * + * @param formDTO 参数 + * @return Result + */ + @PostMapping("/resi/group/group/getgovgroupsummarize") + Result getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO); + + /** + * @Description 得到小组待审核列表,用户信息不注入TokenDTO,通过外部服务调用直接传入参数 + * @Param ApplyingGroupsFormDTO.class + * @return Result> + * @Author wangc + * @Date 2020.04.20 13:59 + **/ + @PostMapping("/resi/group/group/getapplyinggroups") + Result> getApplyingGroups(ApplyingGroupsFormDTO applyingGroupsFormDTO); + + /** + * @Description 得到待审核/未审核小组信息的详情 + * @Param CommonGroupIdFromDTO -> String groupId + * @return Result + * @Author wangc + * @Date 2020.04.20 14:08 + **/ + @PostMapping("/resi/group/group/getapplyinggroupdetail") + Result getApplyingGroupDetail(CommonGroupIdFromDTO groupId); + + /** + * @Description 建组申请-审核通过 + * @Param AgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.20 14:25 + **/ + @PostMapping("/resi/group/group/agreeapplying") + Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO); + + /** + * @Description 建组申请-审核驳回 + * @Param DisAgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.20 14:26 + **/ + @PostMapping("/resi/group/group/disagreeapplying") + Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO); + + /** + * @Description 政府端群组管理-屏蔽话题列表查询 + * @Param tokenDto + * @Param ResiTopicPageFormDTO.class + * @return List + * @Author wangc + * @Date 2020.04.01 16:45 + **/ + @PostMapping("/resi/group/topic/gethiddentopicgov") + Result> getHiddenTopicGov(ResiTopicPageFormDTO topicPageFormDTO); + + /** + * @Description 政府端群组管理-查看历史话题(分页,允许状态筛选) + * @Param tokenDto + * @Param ResiTopicPageFormDTO.class + * @return Result> + * @Author wangc + * @Date 2020.04.01 10:36 + **/ + @PostMapping("/resi/group/topic/getpasttopiclistgov") + Result> getPastTopicListGov(ResiTopicPageFormDTO topicPageFormDTO); + + /** + * @Description 政府端群组管理-获取话题详情 + * @Param tokenDto + * @Param String + * @return Result + * @Author wangc + * @Date 2020.04.01 23:48 + **/ + @PostMapping("/resi/group/topic/gettopicdetailgov") + Result getTopicDetailGov(ResiTopicDetailFormDTO topicDetailFormDTO); + + /** + * @Description 政府端群组管理-获取某个话题的评论列表 + * @Param tokenDto + * @Param ResiQueryCommentFormDTO + * @return Result> + * @Author wangc + * @Date 2020.04.01 23:49 + **/ + @PostMapping("/resi/group/comment/getcommentlistoftopicgov") + Result> getCommentListOfTopicGov(ResiQueryCommentFormDTO queryCommentFormDTO); + + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java new file mode 100644 index 0000000000..8bee3c6646 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java @@ -0,0 +1,90 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.fallback.ResiPartymemberFeignClientFallBack; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; +import com.epmet.resi.partymember.dto.warmhearted.form.*; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * 调用epmet-user服务 + * + * @author 赵奇风 + */ +@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = ResiPartymemberFeignClientFallBack.class) +public interface ResiPartymemberFeignClient { + /** + * 居民端-热心居民申请-提交申请数据 + * + * @author zhaoqf + **/ + @PostMapping(value = "resi/partymember/resiwarmheartedapply/audited", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> audited(@RequestBody ResiWarmheartedAuditedFromDTO formDTO); + + /** + * 政府端-获取待审核的热心居民申请列表 + * @param + * @return void + * @author sun + */ + @PostMapping(value = "resi/partymember/resiwarmheartedapply/auditing", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> auditing(@RequestBody ResiWarmAuditFormDTO formDTO); + + /** + * 政府端-热心居民申请-审核通过 + * @param + * @return void + * @author sun + */ + @PostMapping(value = "resi/partymember/resiwarmheartedapply/approve", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result approve(@RequestBody ResiWarmAuditApproveFormDTO formDTO); + + /** + * 政府端-热心居民申请-审核驳回 + * @param + * @return void + * @author sun + */ + @PostMapping(value = "resi/partymember/resiwarmheartedapply/reject", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result reject(@RequestBody ResiWarmAuditRejectFormDTO formDTO); + + /** + * 政府端-获取待审核的热心居民申请列表 + * @param + * @return void + * @author sun + */ + @PostMapping(value = "resi/partymember/resiwarmheartedapply/getdetail", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result getDetail(@RequestBody ResiWarmGetDetailFormDTO formDTO); + + /** + * @param underReviewParyMemberFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表 + * @Date 2020/4/26 21:53 + **/ + @PostMapping(value = "resi/partymember/partymemberbaseinfo/auditing", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> auditingPartyMember(@RequestBody UnderReviewParyMemberFormDTO underReviewParyMemberFormDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param reviewedParyMemberFormDTO + * @Author yinzuomei + * @Description 党员认证-审核历史列表查询 + * @Date 2020/4/26 23:38 + **/ + @PostMapping(value = "resi/partymember/partymemberbaseinfo/audited", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> auditedPartyMember(@RequestBody ReviewedParyMemberFormDTO reviewedParyMemberFormDTO); +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/.gitkeep b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java new file mode 100644 index 0000000000..8cae519fd5 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java @@ -0,0 +1,114 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.ResiGroupFeignClient; +import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; +import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; +import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO; +import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO; +import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO; +import com.epmet.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO; +import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; +import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO; +import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO; +import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO; +import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO; +import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/17 15:27 + */ +@Component +public class ResiGroupFeignClientFallBack implements ResiGroupFeignClient { + @Override + public Result> audited(GroupAuditedFromDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "audited", formDTO); + } + + @Override + public Result> getGroupsInGrid(GroupAuditedFromDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getGroupsInGrid", formDTO); + } + + @Override + public Result getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getGovGroupSummarize", formDTO); + } + + /** + * @Description 得到小组待审核列表,用户信息不注入TokenDTO,通过外部服务调用直接传入参数 + * @Param ApplyingGroupsFormDTO.class + * @return Result> + * @Author wangc + * @Date 2020.04.20 13:59 + **/ + @Override + public Result> getApplyingGroups(ApplyingGroupsFormDTO applyingGroupsFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getApplyingGroups", applyingGroupsFormDTO); + } + + /** + * @Description 得到待审核/未审核小组信息的详情 + * @Param CommonGroupIdFromDTO -> String groupId + * @return Result + * @Author wangc + * @Date 2020.04.20 14:08 + **/ + @Override + public Result getApplyingGroupDetail(CommonGroupIdFromDTO groupId) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getApplyingGroupDetail", groupId); + } + + /** + * @Description 建组申请-审核通过 + * @Param AgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.20 14:25 + **/ + @Override + public Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "agreeApplying", agreeApplyGroupFormDTO); + } + + /** + * @Description 建组申请-审核驳回 + * @Param DisAgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.20 14:26 + **/ + @Override + public Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "disagreeApplying", disAgreeApplyGroupFormDTO); + } + + @Override + public Result> getHiddenTopicGov(ResiTopicPageFormDTO topicPageFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getHiddenTopicGov", topicPageFormDTO); + } + + @Override + public Result> getPastTopicListGov(ResiTopicPageFormDTO topicPageFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getPastTopicListGov", topicPageFormDTO); + } + + @Override + public Result getTopicDetailGov(ResiTopicDetailFormDTO topicDetailFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getTopicDetailGov", topicDetailFormDTO); + } + + @Override + public Result> getCommentListOfTopicGov(ResiQueryCommentFormDTO queryCommentFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getCommentListOfTopicGov", queryCommentFormDTO); + } +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java new file mode 100644 index 0000000000..a5151d6503 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java @@ -0,0 +1,60 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.ResiPartymemberFeignClient; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; +import com.epmet.resi.partymember.dto.warmhearted.form.*; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/16 17:01 + */ +@Component +public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignClient { + @Override + public Result> audited(ResiWarmheartedAuditedFromDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "audited", formDTO); + } + + @Override + public Result> auditing(ResiWarmAuditFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "auditing", formDTO); + } + + @Override + public Result approve(ResiWarmAuditApproveFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "approve", formDTO); + } + + @Override + public Result reject(ResiWarmAuditRejectFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "reject", formDTO); + } + + @Override + public Result getDetail(ResiWarmGetDetailFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getDetail", formDTO); + } + + @Override + public Result> auditingPartyMember(UnderReviewParyMemberFormDTO underReviewParyMemberFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "auditing", underReviewParyMemberFormDTO); + } + + @Override + public Result> auditedPartyMember(ReviewedParyMemberFormDTO reviewedParyMemberFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "audited", reviewedParyMemberFormDTO); + } + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/redis/.gitkeep b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/redis/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiGroupService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiGroupService.java new file mode 100644 index 0000000000..bc605971c0 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiGroupService.java @@ -0,0 +1,81 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO; +import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO; +import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO; +import com.epmet.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO; +import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; +import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO; +import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO; + +import java.util.List; + +/** + * @Description + * @IntefaceName ResiGroupService + * @Author wangc + * @date 2020.04.16 15:40 + */ +public interface ResiGroupService { + /** + * 小组审核历史列表 + * @param formDTO 参数 + * @return Result> + */ + Result> audited(GroupAuditedFromDTO formDTO); + + /** + * 本网格小组列表 + * + * @param formDTO 参数 + * @return Result> + */ + Result> getGroupsInGrid(GroupAuditedFromDTO formDTO); + + /** + * 小组管理界面信息 + * + * @param formDTO 参数 + * @return Result + */ + Result getGroupSummarize(GovGroupSummarizeFromDTO formDTO); + + /** + * @Description 查询小组待审核列表-调用resi-group服务 + * @Param ApplyingGroupsFormDTO.class + * @return Result> + * @Author wangc + * @Date 2020.04.20 13:59 + **/ + Result> auditing(ApplyingGroupsFormDTO applyingGroupsFormDTO); + + /** + * @Description 得到待审核/未审核小组信息的详情-调用resi-group服务 + * @Param CommonGroupIdFromDTO -> String groupId + * @return Result + * @Author wangc + * @Date 2020.04.20 14:08 + **/ + Result applyGroupDetail(CommonGroupIdFromDTO groupIdFromDTO); + + /** + * @Description 建组申请-审核通过-调用resi-group服务 + * @Param AgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.20 14:25 + **/ + Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO); + + /** + * @Description 建组申请-审核驳回-调用resi-group服务 + * @Param DisAgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.20 14:26 + **/ + Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO); + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java new file mode 100644 index 0000000000..f6171b98e1 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java @@ -0,0 +1,33 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuditedPartyMemberFormDTO; +import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.result.AuditedPartyMemberResultDTO; +import com.epmet.dto.result.AuditingPartyMemberResultDTO; + +import java.util.List; + +/** + * @Description 基层治理-党员认证 + * @Author yinzuomei + * @Date 2020/4/26 16:02 + */ +public interface ResiPartyMemberService { + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 待审核列表 + * @Date 2020/4/26 16:04 + **/ + Result> auditing(AuditingPartyMemberFormDTO formDTO); + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 党员认证-审核历史列表(审核历史:只包括自动审核失败和拒绝的审核失败:居民未填写补充信息。) + * @Date 2020/4/26 23:32 + **/ + Result> audited(AuditedPartyMemberFormDTO formDTO); +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiTopicService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiTopicService.java new file mode 100644 index 0000000000..af003cd5a4 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiTopicService.java @@ -0,0 +1,57 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; +import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; +import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO; +import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO; +import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +public interface ResiTopicService { + + /** + * @Description 政府端群组管理-屏蔽话题列表查询 + * @Param tokenDto + * @Param ResiTopicPageFormDTO.class + * @return List + * @Author wangc + * @Date 2020.04.01 16:45 + **/ + Result> hiddenList(ResiTopicPageFormDTO topicPageFormDTO); + + /** + * @Description 政府端群组管理-查看历史话题(分页,允许状态筛选) + * @Param tokenDto + * @Param ResiTopicPageFormDTO.class + * @return Result> + * @Author wangc + * @Date 2020.04.01 10:36 + **/ + Result> allTopics(ResiTopicPageFormDTO topicPageFormDTO); + + /** + * @Description 政府端群组管理-获取话题详情 + * @Param tokenDto + * @Param String + * @return Result + * @Author wangc + * @Date 2020.04.01 23:48 + **/ + Result topicDetail(ResiTopicDetailFormDTO topicDetailFormDTO); + + /** + * @Description 政府端群组管理-获取某个话题的评论列表 + * @Param tokenDto + * @Param ResiQueryCommentFormDTO + * @return Result> + * @Author wangc + * @Date 2020.04.01 23:49 + **/ + Result> topicComments(ResiQueryCommentFormDTO queryCommentFormDTO); + + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiWarmheartedService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiWarmheartedService.java new file mode 100644 index 0000000000..05c905b87d --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiWarmheartedService.java @@ -0,0 +1,61 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.partymember.dto.warmhearted.form.*; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description + * @IntefaceName ResiWarmheartedService + * @Author wangc + * @date 2020.04.16 15:37 + */ +@Service +public interface ResiWarmheartedService { + /** + * 热心居民审核历史列表 + * @param formDTO 参数 + * @return ResiWarmheartedAuditedResultDTO + */ + Result> audited(ResiWarmheartedAuditedFromDTO formDTO); + + /** + * 政府端-获取待审核的热心居民申请列表 + * + * @param + * @return void + * @author sun + */ + Result> auditing(ResiWarmAuditFormDTO formDTO); + + /** + * 政府端-热心居民申请-审核通过 + * + * @param + * @return void + * @author sun + */ + Result approve(ResiWarmAuditApproveFormDTO formDTO); + + /** + * 政府端-热心居民申请-审核驳回 + * + * @param + * @return void + * @author sun + */ + Result reject(ResiWarmAuditRejectFormDTO formDTO); + + /** + * 政府端-热心居民申请详情信息 + * + * @param + * @return void + * @author sun + */ + Result getDetail(ResiWarmGetDetailFormDTO formDTO); +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiGroupServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiGroupServiceImpl.java new file mode 100644 index 0000000000..f05619c012 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiGroupServiceImpl.java @@ -0,0 +1,65 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.ResiGroupFeignClient; +import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO; +import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO; +import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO; +import com.epmet.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO; +import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; +import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO; +import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO; +import com.epmet.service.ResiGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description + * @ClassName ResiGroupServiceImpl + * @Author wangc + * @date 2020.04.16 15:38 + */ +@Service +public class ResiGroupServiceImpl implements ResiGroupService{ + @Autowired + private ResiGroupFeignClient resiGroupFeignClient; + @Override + public Result> audited(GroupAuditedFromDTO formDTO) { + return resiGroupFeignClient.audited(formDTO); + } + + @Override + public Result> getGroupsInGrid(GroupAuditedFromDTO formDTO) { + return resiGroupFeignClient.getGroupsInGrid(formDTO); + } + + @Override + public Result getGroupSummarize(GovGroupSummarizeFromDTO formDTO) { + return resiGroupFeignClient.getGovGroupSummarize(formDTO); + } + + @Override + public Result> auditing(ApplyingGroupsFormDTO applyingGroupsFormDTO) { + return resiGroupFeignClient.getApplyingGroups(applyingGroupsFormDTO); + } + + @Override + public Result applyGroupDetail(CommonGroupIdFromDTO groupIdFromDTO) { + return resiGroupFeignClient.getApplyingGroupDetail(groupIdFromDTO); + } + + @Override + public Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { + return resiGroupFeignClient.agreeApplying(agreeApplyGroupFormDTO); + } + + @Override + public Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { + return resiGroupFeignClient.disagreeApplying(disAgreeApplyGroupFormDTO); + } + + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java new file mode 100644 index 0000000000..9809bdcb37 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java @@ -0,0 +1,70 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuditedPartyMemberFormDTO; +import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.result.AuditedPartyMemberResultDTO; +import com.epmet.dto.result.AuditingPartyMemberResultDTO; +import com.epmet.feign.ResiPartymemberFeignClient; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; +import com.epmet.service.ResiPartyMemberService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 基层治理-党员认证 + * @Author yinzuomei + * @Date 2020/4/26 16:02 + */ +@Service +public class ResiPartyMemberServiceImpl implements ResiPartyMemberService { + protected final Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private ResiPartymemberFeignClient resiPartymemberFeignClient; + + @Override + public Result> auditing(AuditingPartyMemberFormDTO formDTO) { + UnderReviewParyMemberFormDTO underReviewParyMemberFormDTO = ConvertUtils.sourceToTarget(formDTO, UnderReviewParyMemberFormDTO.class); + List list = new ArrayList<>(); + Result> result = resiPartymemberFeignClient.auditingPartyMember(underReviewParyMemberFormDTO); + if (!result.success()) { + logger.error(String.format("调用resi-partymember-server模块失败,错误提示%s", result.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if (null == result.getData() || result.getData().isEmpty()) { + logger.info(String.format("网格id[%s],待审核党员列表查询为空", formDTO.getGridId())); + return new Result>().ok(list); + } + list = ConvertUtils.sourceToTarget(result.getData(), AuditingPartyMemberResultDTO.class); + return new Result>().ok(list); + } + + @Override + public Result> audited(AuditedPartyMemberFormDTO formDTO) { + ReviewedParyMemberFormDTO reviewedParyMemberFormDTO = ConvertUtils.sourceToTarget(formDTO, ReviewedParyMemberFormDTO.class); + List list = new ArrayList<>(); + Result> result = resiPartymemberFeignClient.auditedPartyMember(reviewedParyMemberFormDTO); + if (!result.success()) { + logger.error(String.format("调用resi-partymember-server模块失败,错误提示%s", result.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if (null == result.getData() || result.getData().isEmpty()) { + logger.info(String.format("网格id[%s],待审核党员列表查询为空", formDTO.getGridId())); + return new Result>().ok(list); + } + list = ConvertUtils.sourceToTarget(result.getData(), AuditedPartyMemberResultDTO.class); + return new Result>().ok(list); + } +} + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java new file mode 100644 index 0000000000..b07c045e22 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java @@ -0,0 +1,79 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.ResiGroupFeignClient; +import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; +import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; +import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO; +import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO; +import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; +import com.epmet.service.ResiTopicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ResiTopicServiceImpl implements ResiTopicService { + + @Autowired + private ResiGroupFeignClient resiGroupFeignClient; + + /** + * @Description 政府端群组管理-屏蔽话题列表查询 + * @Param tokenDto + * @Param ResiTopicPageFormDTO.class + * @return List + * @Author wangc + * @Date 2020.04.01 16:45 + **/ + @Override + public Result> hiddenList(ResiTopicPageFormDTO topicPageFormDTO) { + topicPageFormDTO.setPageNo(NumConstant.ONE); + topicPageFormDTO.setPageSize(NumConstant.MAX); + return resiGroupFeignClient.getHiddenTopicGov(topicPageFormDTO); + } + + /** + * @Description 政府端群组管理-查看历史话题(分页,允许状态筛选) + * @Param tokenDto + * @Param ResiTopicPageFormDTO.class + * @return Result> + * @Author wangc + * @Date 2020.04.01 10:36 + **/ + @Override + public Result> allTopics(ResiTopicPageFormDTO topicPageFormDTO) { + topicPageFormDTO.setPageNo(NumConstant.ONE); + topicPageFormDTO.setPageSize(NumConstant.MAX); + return resiGroupFeignClient.getPastTopicListGov(topicPageFormDTO); + } + + /** + * @Description 政府端群组管理-获取话题详情 + * @Param tokenDto + * @Param String + * @return Result + * @Author wangc + * @Date 2020.04.01 23:48 + **/ + @Override + public Result topicDetail(ResiTopicDetailFormDTO topicDetailFormDTO) { + return resiGroupFeignClient.getTopicDetailGov(topicDetailFormDTO); + } + + /** + * @Description 政府端群组管理-获取某个话题的评论列表 + * @Param tokenDto + * @Param ResiQueryCommentFormDTO + * @return Result> + * @Author wangc + * @Date 2020.04.01 23:49 + **/ + @Override + public Result> topicComments(ResiQueryCommentFormDTO queryCommentFormDTO) { + return resiGroupFeignClient.getCommentListOfTopicGov(queryCommentFormDTO); + } +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiWarmheartedServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiWarmheartedServiceImpl.java new file mode 100644 index 0000000000..52a9c7b556 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiWarmheartedServiceImpl.java @@ -0,0 +1,78 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.ResiPartymemberFeignClient; +import com.epmet.resi.partymember.dto.warmhearted.form.*; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; +import com.epmet.service.ResiWarmheartedService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description + * @ClassName ResiWarmheartedServiceImpl + * @Author wangc + * @date 2020.04.16 15:41 + */ +@Service +public class ResiWarmheartedServiceImpl implements ResiWarmheartedService { + @Autowired + private ResiPartymemberFeignClient resiPartymemberFeignClient; + + @Override + public Result> audited(ResiWarmheartedAuditedFromDTO formDTO) { + return resiPartymemberFeignClient.audited(formDTO); + } + + /** + * 政府端-获取待审核的热心居民申请列表 + * + * @param + * @return void + * @author sun + */ + @Override + public Result> auditing(ResiWarmAuditFormDTO formDTO) { + return resiPartymemberFeignClient.auditing(formDTO); + } + + /** + * 政府端-热心居民申请-审核通过 + * + * @param + * @return void + * @author sun + */ + @Override + public Result approve(ResiWarmAuditApproveFormDTO formDTO) { + return resiPartymemberFeignClient.approve(formDTO); + } + + /** + * 政府端-热心居民申请-审核驳回 + * + * @param + * @return void + * @author sun + */ + @Override + public Result reject(ResiWarmAuditRejectFormDTO formDTO) { + return resiPartymemberFeignClient.reject(formDTO); + } + + /** + * 政府端-热心居民申请详情信息 + * + * @param + * @return void + * @author sun + */ + @Override + public Result getDetail(ResiWarmGetDetailFormDTO formDTO) { + return resiPartymemberFeignClient.getDetail(formDTO); + } + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/util/ModuleConstant.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/util/ModuleConstant.java new file mode 100644 index 0000000000..b32ebc8649 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/util/ModuleConstant.java @@ -0,0 +1,10 @@ +package com.epmet.util; + +/** + * @Description 网格管理模块常量类 + * @IntefaceName ModuleConstant + * @Author wangc + * @date 2020.04.16 15:42 + */ +public interface ModuleConstant { +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..1df1097460 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml @@ -0,0 +1,71 @@ +server: + port: @server.port@ + servlet: + context-path: /gov/grid + +spring: + main: + allow-bean-definition-overriding: true + application: + name: gov-grid-server + #环境 dev|test|prod + profiles: + active: dev + messages: + encoding: UTF-8 + basename: i18n/messages_common + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..1c80278558 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/mapper/.gitkeep b/epmet-module/gov-grid/gov-grid-server/src/main/resources/mapper/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-grid/pom.xml b/epmet-module/gov-grid/pom.xml new file mode 100644 index 0000000000..5c0bc36a59 --- /dev/null +++ b/epmet-module/gov-grid/pom.xml @@ -0,0 +1,20 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + gov-grid + pom + + gov-grid-client + gov-grid-server + + + + \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/Dockerfile b/epmet-module/gov-mine/gov-mine-server/Dockerfile new file mode 100644 index 0000000000..0bdb6f026f --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8098 + +ENTRYPOINT ["java","-Xms32m","-Xmx200m","-jar","./app.jar"] \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/docker-compose.yml b/epmet-module/gov-mine/gov-mine-server/docker-compose.yml new file mode 100644 index 0000000000..0eda346168 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3.7" +services: + gov-mine-server: + container_name: gov-mine-server-dev + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-mine-server:0.3.2 + ports: + - "8098:8098" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index b06d8fc331..98c8c81e93 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.0 + 0.3.2 com.epmet gov-mine diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index aba15e9636..87a64b8fae 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -25,6 +25,7 @@ import java.util.List; * @Description * @Author sun */ +//, url = "localhost:8087" @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) public interface EpmetUserFeignClient { /** diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java index b41a5e59ca..8cb514ad3f 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java @@ -16,7 +16,7 @@ import java.util.List; * @Description * @Author sun */ -@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class, url = "localhost:8099") +@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class) public interface GovAccessFeignClient { /** diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 8c03d28764..45f0647c4b 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -19,6 +19,7 @@ import java.util.List; * @Description * @Author sun */ +//, url = "localhost:8092" @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) public interface GovOrgFeignClient { diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index d76e2e2f34..13340d53e1 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -38,27 +38,25 @@ public class AccessServiceImpl implements AccessService { @Autowired private GovOrgFeignClient govOrgFeignClient; - @Autowired - private CpUserDetailRedis cpUserDetailRedis; - - @Override - public Set listOpeKeysByStaffId(String app, String client, String staffId, String agencyId, String gridId) { + public List queryGovStaffRoles(String staffId, String orgId) { List roleDTOS = new ArrayList<>(); - // 查询机关单位权限 StaffRoleFormDTO formDTO = new StaffRoleFormDTO(); formDTO.setStaffId(staffId); - formDTO.setOrgId(agencyId); - Result> agencyResult = userFeignClient.getRolesOfStaff(formDTO); - if (!CollectionUtils.isEmpty(agencyResult.getData())) { - roleDTOS.addAll(agencyResult.getData()); - } - // 查询网格权限 - formDTO.setStaffId(staffId); - formDTO.setOrgId(gridId); + formDTO.setOrgId(orgId); Result> gridResult = userFeignClient.getRolesOfStaff(formDTO); if (!CollectionUtils.isEmpty(gridResult.getData())) { roleDTOS.addAll(gridResult.getData()); } + return roleDTOS; + } + + @Override + public Set listOpeKeysByStaffId(String app, String client, String staffId, String agencyId, String gridId) { + List roleDTOS = new ArrayList<>(); + // 查询机关单位中的角色 + roleDTOS.addAll(queryGovStaffRoles(staffId, agencyId)); + // 查询网格中的角色 + roleDTOS.addAll(queryGovStaffRoles(staffId, gridId)); // 拼装操作key列表 Set opeKeys = new HashSet<>(); @@ -86,7 +84,7 @@ public class AccessServiceImpl implements AccessService { // 查询该直属机关的orgIdPath Result agencyById = govOrgFeignClient.getAgencyById(agencyId); - if (agencyById.getCode() != 0 || agencyById.getData() == null) { + if (!agencyById.success() || agencyById.getData() == null) { logger.error("根据当前机构id[{}]查询pids失败:{}", agencyId, agencyById.getMsg()); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } @@ -98,6 +96,7 @@ public class AccessServiceImpl implements AccessService { staffPermCacheFormDTO.setStaffId(staffId); staffPermCacheFormDTO.setPermissions(opeKeys); staffPermCacheFormDTO.setRoleIdList(roleIds); + staffPermCacheFormDTO.setGridId(gridId); // 拼接orgIdPath staffPermCacheFormDTO.setOrgIdPath(String.format("%s:%s", agencyById.getData().getPids(), agencyId)); govAccessFeignClient.updatePermissionCache(staffPermCacheFormDTO); diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java index 8cc0f73320..797324673c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java @@ -49,7 +49,7 @@ public class CustomerStaffAgencyDTO implements Serializable { private String userId; /** - * 组织机构ID customer_organization.id + * 组织机构ID customer_agency.id */ private String agencyId; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java index e4a410120e..6cc332a6e7 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java @@ -45,4 +45,9 @@ public class EditAgencyFormDTO implements Serializable { @NotBlank(message = "机关组织名称不能为空") private String agencyName; + /** + * token中用户Id + */ + private String userId; + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java index 01f072752a..bd8d994b8a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java @@ -35,6 +35,6 @@ public class AddAgencyResultDTO implements Serializable { /** * 机关组织Id */ - private String agencyId; + private String agencyId = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java index b6206d0c6d..bc450263e5 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java @@ -35,6 +35,6 @@ public class AddDepartmentResultDTO implements Serializable { /** * 新增部门Id */ - private String departmentId; + private String departmentId = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java index 9673700fcc..b1261e2761 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java @@ -35,12 +35,12 @@ public class AgencyListResultDTO implements Serializable { /** * 机关组织Id */ - private String agencyId; + private String agencyId = ""; /** * 机关组织名称 */ - private String agencyName; + private String agencyName = ""; /** * 总人数 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java index e372d86d8d..4b819ec2b5 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java @@ -36,12 +36,12 @@ public class AgencysResultDTO implements Serializable { /** * 机关组织Id */ - private String agencyId; + private String agencyId = ""; /** * 组织名称 */ - private String agencyName; + private String agencyName = ""; /** * 机关级别(社区级:community, @@ -50,27 +50,27 @@ public class AgencysResultDTO implements Serializable { * 市级: city * 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) */ - private String level; + private String level = ""; /** * 地区编码 */ - private Integer areaCode; + private String areaCode = ""; /** - * 国家 + * 省份 */ - private String country; + private String province = ""; /** - * 省份 + * 城市 */ - private String province; + private String city = ""; /** - * 城市 + * 区县 */ - private String city; + private String district = ""; /** * 本机关的所有上级机关 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java index e63020a209..106fcfcd4c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java @@ -35,17 +35,17 @@ public class DepartInStaffListResultDTO implements Serializable { /** * 用户ID */ - private String staffId; + private String staffId = ""; /** * 用户姓名 */ - private String staffName; + private String staffName = ""; /** * 用户头像 */ - private String staffHeadPhoto; + private String staffHeadPhoto = ""; /** * 性别 @@ -55,6 +55,6 @@ public class DepartInStaffListResultDTO implements Serializable { /** * 角色名称 */ - private String roleName; + private String roleName = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java index d36a4222ee..8d7ab9dff2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java @@ -33,20 +33,25 @@ public class DepartmentDetailResultDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 组织机构Id + */ + private String agencyId = ""; + /** * 部门Id */ - private String departmentId; + private String departmentId = ""; /** * 部门名称 */ - private String departmentName; + private String departmentName = ""; /** * 部门职责 */ - private String departmentDuty; + private String departmentDuty = ""; /** * 部门下工作人员列表 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java index 7fafa0238d..3d7a87ec9d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java @@ -35,12 +35,12 @@ public class DepartmentListResultDTO implements Serializable { /** * 部门Id */ - private String departmentId; + private String departmentId = ""; /** * 部门名称 */ - private String departmentName; + private String departmentName = ""; /** * 部门下总人数 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java new file mode 100644 index 0000000000..fff7b43caf --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 网格所属组织基本信息 + * @Author yinzuomei + * @Date 2020/4/26 22:35 + */ +@Data +public class GridInfoResultDTO implements Serializable { + private static final long serialVersionUID = 4360690752084258055L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区组织ID + */ + private String commnuityName; + + /** + * 社区名称 + */ + private String commuityId; + + /** + * 乡(镇、街道)级组织名称 + */ + private String streetName; + + /** + * 乡(镇、街道)级id + */ + private String streetId; + + /** + * 区县级组织id + */ + private String districtId; + + /** + * 区县级组织名称 + */ + private String districtName; + + /** + * 市级组织id + */ + private String cityId; + + /** + * 市级组织名称 + */ + private String cityName; + + /** + * 省级组织id + */ + private String provinceId; + + /** + * 省级组织名称 + */ + private String proviceName; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java index 73608b1943..60683bf779 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java @@ -36,11 +36,11 @@ public class ParentListResultDTO implements Serializable { /** * 机关组织Id */ - private String id; + private String id = ""; /** * 机关组织名称 */ - private String name; + private String name = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java index 57ab12c3df..17dc985695 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java @@ -35,11 +35,11 @@ public class SubListResultDTO implements Serializable { /** * 机关组织Id */ - private String agencyId; + private String agencyId = ""; /** * 机关组织名称 */ - private String agencyName; + private String agencyName = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index a9dc0ab939..ec2f4270d6 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.6 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index a9bd2b6ba3..651dd0b281 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.6 com.epmet gov-org diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 7f192ee942..6f554aa48c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -68,6 +68,7 @@ public class AgencyController { */ @PostMapping("editagency") public Result editAgency(@LoginUser TokenDto tokenDTO, @RequestBody EditAgencyFormDTO formDTO) { + formDTO.setUserId(tokenDTO.getUserId()); ValidatorUtils.validateEntity(formDTO); return agencyService.editAgency(formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 6daed0e8a4..2f6fee3031 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -30,6 +30,7 @@ import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -126,6 +127,18 @@ public class CustomerGridController { return new Result().ok(data); } + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 22:41 + **/ + @GetMapping("getGridInfo/{gridId}") + public Result getGridInfo(@PathVariable("gridId") String gridId) { + return customerGridService.getGridInfo(gridId); + } + /** * @param userId * @return diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java index 757d7383a7..de20bc5b13 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java @@ -23,8 +23,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java index 2373876d5c..0e2058eeb7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -7,12 +7,10 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.service.CustomerStaffAgencyService; +import com.epmet.service.CustomerStaffAgencyService; import com.epmet.service.DepartmentService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -141,4 +139,14 @@ public class DepartmentController { ValidatorUtils.validateEntity(departmentStaffInfoFormDTO); return departmentService.removeStaff(departmentStaffInfoFormDTO); } + + /** + * 根据StaffId查询所属部门列表 + * @return + */ + @PostMapping("staff/{staffId}/departmentlist") + public Result> getDepartmentListByStaffId(@PathVariable("staffId") String staffId) { + List deptList = departmentService.listDepartmentListByStaffId(staffId); + return new Result>().ok(deptList); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 8a4c14548b..ba4bde9b07 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.result.AgencyListResultDTO; import com.epmet.dto.result.ParentListResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; @@ -68,4 +69,12 @@ public interface CustomerAgencyDao extends BaseDao { * @Description 获取组织列表 **/ List selectAgencyList(@Param("pId") String pId); + + /** + * @param customerAgencyDTO + * @return + * @Author sun + * @Description 查询当前组织的所有下级组织列表 + **/ + List selectFindList(CustomerAgencyDTO customerAgencyDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java index b7569a1396..5ecfdff97f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java @@ -49,4 +49,11 @@ public interface CustomerDepartmentDao extends BaseDao * @Description 根据当前机关Id查询该机关下的直属部门列表 **/ List selectDepartmentList(@Param("agencyId") String agencyId); + + /** + * 根据StaffId查询所属部门列表 + * @param staffId + * @return + */ + List listDepartmentListByStaffId(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java index 0aa07837ec..f9b1d01de8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java @@ -49,7 +49,7 @@ public class CustomerStaffAgencyEntity extends BaseEpmetEntity { private String userId; /** - * 组织机构ID customer_organization.id + * 组织机构ID customer_agency.id */ private String agencyId; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffAgencyExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffAgencyExcel.java index a870073498..55abe860f5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffAgencyExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffAgencyExcel.java @@ -40,8 +40,8 @@ public class CustomerStaffAgencyExcel { @Excel(name = "用户ID") private String userId; - @Excel(name = "组织机构ID customer_organization.id") - private String orgId; + @Excel(name = "组织机构ID customer_agency.id") + private String agencyId; @Excel(name = "删除标识") private Integer delFlag; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 45d3572e74..6001753a03 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -18,7 +18,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -28,9 +27,11 @@ import com.epmet.dto.result.AddGridResultDTO; import com.epmet.dto.form.CommonAgencyIdFormDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerGridEntity; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -120,6 +121,15 @@ public interface CustomerGridService extends BaseService { */ Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 22:42 + **/ + Result getGridInfo(String gridId); + /** * @param userId * @return @@ -163,7 +173,7 @@ public interface CustomerGridService extends BaseService { * @Date 2020.04.23 14:45 **/ Result getGridListByAgency(CommonAgencyIdFormDTO agencyFormDTO); - + /** * @Description 查找指定机构下的全部网格列表 对应接口:/gov/org/grid/allgrids * @Param CommonAgencyIdFormDTO -> agencyId diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java index cf5285b735..2f9adf3d59 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java @@ -31,7 +31,7 @@ import java.util.List; import java.util.Map; /** - * 网格人员关系表 + * 网格人员关系表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-20 @@ -97,7 +97,8 @@ public interface CustomerStaffGridService extends BaseService customerId ; staffId diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java index fe941cca10..375af23acf 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java @@ -94,4 +94,11 @@ public interface DepartmentService { * @Date 2020.04.26 16:57 **/ Result removeStaff(CommonDepartmentStaffInfoFormDTO departmentStaffInfoFormDTO); + + /** + * 根据StaffId查询所属部门列表 + * @param staffId + * @return + */ + List listDepartmentListByStaffId(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index f1901d64cf..ea5cee6df4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -24,10 +24,12 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.service.AgencyService; +import com.epmet.service.CustomerAgencyService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,8 +37,7 @@ 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.*; /** * 机关单位信息 @@ -49,6 +50,8 @@ public class AgencyServiceImpl implements AgencyService { private static final Logger log = LoggerFactory.getLogger(AgencyServiceImpl.class); @Autowired private CustomerAgencyDao customerAgencyDao; + @Autowired + private CustomerAgencyService customerAgencyService; /** * @param formDTO @@ -103,10 +106,46 @@ public class AgencyServiceImpl implements AgencyService { CustomerAgencyEntity entity = new CustomerAgencyEntity(); entity.setId(formDTO.getAgencyId()); entity.setOrganizationName(formDTO.getAgencyName()); + //1:更新当前组织信息 if (customerAgencyDao.updateById(entity) < NumConstant.ONE) { log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION); } + //2:查询当前组织的所有下级组织列表(查询pids字段值包含该组织id的数据) + CustomerAgencyDTO agencyDTO = new CustomerAgencyDTO(); + agencyDTO.setPids(formDTO.getAgencyId()); + List agencyList = customerAgencyDao.selectFindList(agencyDTO); + if (null == agencyList || agencyList.size() < NumConstant.ONE) { + return result; + } + //3:循环组织列表,查询每一个组织的所有上级组织重新拼接所有上级名称(allParentName)字段值 + List editList = new ArrayList<>(); + Date date = new Date(); + agencyList.forEach(agency->{ + CustomerAgencyEntity customerAgencyEntity = new CustomerAgencyEntity(); + //3-1:查询当前组织的所有上级组织 + List listStr = Arrays.asList(agency.getPids().split(":")); + List parentList = customerAgencyDao.selectPAgencyById(listStr); + //3-2:重新拼接当前组织的所有上级名称字段值,将组织Id和拼好的值存入集合 + StringBuffer allParentName = new StringBuffer(); + parentList.forEach(parents->{ + if(StringUtils.isBlank(allParentName)){ + allParentName.append(parents.getName()); + }else { + allParentName.append("-").append(parents.getName()); + } + }); + customerAgencyEntity.setId(agency.getId()); + customerAgencyEntity.setAllParentName(allParentName.toString()); + customerAgencyEntity.setUpdatedBy(formDTO.getUserId()); + customerAgencyEntity.setUpdatedTime(date); + editList.add(customerAgencyEntity); + }); + //4:批量更新因一个组织名称变动而引起的其他组织字段值的变动 + if (!customerAgencyService.updateBatchById(editList)) { + log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); + throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION); + } return result; } @@ -151,9 +190,11 @@ public class AgencyServiceImpl implements AgencyService { @Override public Result agencyDetail(AgencydetailFormDTO formDTO) { AgencysResultDTO agencysResultDTO = new AgencysResultDTO(); + List parentList = new ArrayList<>(); //1:查询本机关详细信息 CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getAgencyId()); if (null == entity) { + agencysResultDTO.setParentList(parentList); return new Result().ok(agencysResultDTO); } agencysResultDTO = ConvertUtils.sourceToTarget(entity, AgencysResultDTO.class); @@ -161,10 +202,11 @@ public class AgencyServiceImpl implements AgencyService { agencysResultDTO.setAgencyName(entity.getOrganizationName()); //2:查询本机关的所有上级机关,按自上而下层级顺序 if (null == entity.getPids()) { + agencysResultDTO.setParentList(parentList); return new Result().ok(agencysResultDTO); } List listStr = Arrays.asList(entity.getPids().split(":")); - List parentList = customerAgencyDao.selectPAgencyById(listStr); + parentList = customerAgencyDao.selectPAgencyById(listStr); agencysResultDTO.setParentList(parentList); return new Result().ok(agencysResultDTO); } @@ -180,7 +222,7 @@ public class AgencyServiceImpl implements AgencyService { SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO(); //1:根据当前机关Id查询直属下一级机关列表 List agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId()); - subAgencyResultDTO.setAgencyList(agencyList); + subAgencyResultDTO.setAgencyList(null == agencyList ? new ArrayList() : agencyList); //2:统计下一级机关数 subAgencyResultDTO.setSubAgencyCount(agencyList.size()); return new Result().ok(subAgencyResultDTO); @@ -195,7 +237,7 @@ public class AgencyServiceImpl implements AgencyService { @Override public Result> agencyList(AgencyListFormDTO formDTO) { List agencyList = customerAgencyDao.selectAgencyList(formDTO.getAgencyId()); - return new Result>().ok(agencyList); + return new Result>().ok(null == agencyList ? new ArrayList() : agencyList); } @Override 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 6889e34433..cdde922137 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 @@ -21,26 +21,26 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerGridDao; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.form.CommonAgencyIdFormDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.redis.CustomerGridRedis; +import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerStaffGridService; import com.epmet.util.ModuleConstant; @@ -52,7 +52,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - import java.util.*; import java.util.stream.Collectors; @@ -68,7 +67,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getGridInfo(String gridId) { + GridInfoResultDTO gridInfoResultDTO=new GridInfoResultDTO(); + CustomerGridDTO customerGridDTO = this.get(gridId); + if(null==customerGridDTO){ + return new Result<>(); + } + gridInfoResultDTO.setCustomerId(customerGridDTO.getCustomerId()); + String pids=customerGridDTO.getPids(); + String[] pidArray = pids.split(":"); + for(String agencyId:pidArray){ + CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(agencyId); + if(null!=customerAgencyDTO){ + switch(customerAgencyDTO.getLevel()){ + case "community" : + //社区级 + gridInfoResultDTO.setCommuityId(customerAgencyDTO.getId()); + gridInfoResultDTO.setCommnuityName(customerAgencyDTO.getOrganizationName()); + break; + case "street" : + //乡(镇、街道)级 + gridInfoResultDTO.setStreetId(customerAgencyDTO.getId()); + gridInfoResultDTO.setStreetName(customerAgencyDTO.getOrganizationName()); + break; + case "district": + //区县级 + gridInfoResultDTO.setDistrictId(customerAgencyDTO.getId()); + gridInfoResultDTO.setDistrictName(customerAgencyDTO.getOrganizationName()); + break; + case "city": + //市级 + gridInfoResultDTO.setCityId(customerAgencyDTO.getId()); + gridInfoResultDTO.setCityName(customerAgencyDTO.getOrganizationName()); + break; + case "province": + //省级 + gridInfoResultDTO.setProvinceId(customerAgencyDTO.getId()); + gridInfoResultDTO.setProviceName(customerAgencyDTO.getOrganizationName()); + break; + } + } + } + return new Result().ok(gridInfoResultDTO); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java index 4bdf464241..456d99f584 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java @@ -20,6 +20,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; @@ -45,7 +46,7 @@ import java.util.List; import java.util.Map; /** - * 网格人员关系表 + * 网格人员关系表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-20 @@ -75,8 +76,8 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + 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); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java index 670236e098..95e44f7bc1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java @@ -48,6 +48,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -162,6 +163,7 @@ public class DepartmentServiceImpl implements DepartmentService { //2:查询部门下工作人员的用户Id集合 List userIdList = customerStaffDepartmentDao.selectUserIdByDepartmentId(formDTO.getDepartmentId()); if (null == userIdList || userIdList.size() < NumConstant.ONE) { + departmentDetailResultDTO.setStaffList(new ArrayList()); return result.ok(departmentDetailResultDTO); } DepartmentInStaffFormDTO departmentInStaffFormDTO = new DepartmentInStaffFormDTO(); @@ -192,7 +194,7 @@ public class DepartmentServiceImpl implements DepartmentService { DepartmentInAgencyResultDTO departmentInAgencyResultDTO = new DepartmentInAgencyResultDTO(); //1:根据当前机关Id查询该机关下的直属部门列表 List departmentList = customerDepartmentDao.selectDepartmentListByAgencyId(formDTO.getAgencyId()); - departmentInAgencyResultDTO.setDepartmentList(departmentList); + departmentInAgencyResultDTO.setDepartmentList(null == departmentList ? new ArrayList() : departmentList); //2:统计下一级机关数 departmentInAgencyResultDTO.setDepartmentCount(departmentList.size()); return new Result().ok(departmentInAgencyResultDTO); @@ -207,7 +209,7 @@ public class DepartmentServiceImpl implements DepartmentService { @Override public Result> departmentList(DepartmentListFormDTO formDTO) { List departmentList = customerDepartmentDao.selectDepartmentList(formDTO.getAgencyId()); - return new Result>().ok(departmentList); + return new Result>().ok((null == departmentList ? new ArrayList() : departmentList)); } /** @@ -268,4 +270,9 @@ public class DepartmentServiceImpl implements DepartmentService { log.warn(ModuleConstant.DEPT_INFO_NOT_FOUND); return new Result().error(); } + + @Override + public List listDepartmentListByStaffId(String staffId) { + return customerDepartmentDao.listDepartmentListByStaffId(staffId); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java index f2085748a5..345909e3ec 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java @@ -1,6 +1,4 @@ -package com.epmet.util;/** - * Created by 11 on 2020/3/23. - */ +package com.epmet.util; /** * @Description 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 a849c06edf..017ae50451 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 @@ -3,23 +3,26 @@ - - - - - - - - - - - - - - - - - + + ca.id AS "id", + ca.customer_id AS "customerId", + ca.pid AS "pid", + ca.pids AS "pids", + ca.all_parent_name AS "allParentName", + ca.organization_name AS "organizationName", + ca.level AS "level", + ca.area_code AS "areaCode", + ca.total_user AS "totalUser", + ca.province AS "province", + ca.city AS "city", + ca.district AS "district", + ca.del_flag AS "delflag", + ca.revision AS "revision", + ca.created_by AS "createdby", + ca.created_time AS "createdtime", + ca.updated_by AS "updatedby", + ca.updated_time AS "updatedtime" + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml index 932f7f66d3..e440745e06 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -26,4 +26,11 @@ ORDER BY created_time DESC + + \ No newline at end of file diff --git a/epmet-module/oper-access/oper-access-server/docker-compose.yml b/epmet-module/oper-access/oper-access-server/docker-compose.yml index 408d95e028..5a1d46a22f 100644 --- a/epmet-module/oper-access/oper-access-server/docker-compose.yml +++ b/epmet-module/oper-access/oper-access-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-access-server: container_name: oper-access-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-access-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-access-server:0.3.1 ports: - "8093:8093" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-access/oper-access-server/pom.xml b/epmet-module/oper-access/oper-access-server/pom.xml index ad0c4c39e2..a66ed82570 100644 --- a/epmet-module/oper-access/oper-access-server/pom.xml +++ b/epmet-module/oper-access/oper-access-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.0 + 0.3.1 oper-access com.epmet diff --git a/epmet-module/oper-crm/oper-crm-server/docker-compose.yml b/epmet-module/oper-crm/oper-crm-server/docker-compose.yml index dfd9895bad..7f764b7352 100644 --- a/epmet-module/oper-crm/oper-crm-server/docker-compose.yml +++ b/epmet-module/oper-crm/oper-crm-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-crm-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-crm-server:0.3.2 ports: - "8090:8090" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 7756ee30a5..fa01ae7bee 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.2 com.epmet oper-crm @@ -91,7 +91,7 @@ - dev-dev + dev-local true @@ -131,7 +131,7 @@ - + epmet elink@833066 diff --git a/epmet-module/oper-customize/oper-customize-server/docker-compose.yml b/epmet-module/oper-customize/oper-customize-server/docker-compose.yml index f349aa1dab..8ef5e0356c 100644 --- a/epmet-module/oper-customize/oper-customize-server/docker-compose.yml +++ b/epmet-module/oper-customize/oper-customize-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-customize-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-customize-server:0.3.1 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 41fba9d560..63fe24d991 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet oper-customize diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index f1e9ea9c5b..025ecabf30 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -27,6 +27,7 @@ resi-mine resi-group resi-partymember + gov-grid gov-access gov-mine diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java index 0097751804..9d9971ccf3 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java @@ -67,4 +67,9 @@ public interface TopicConstant { * 构造queryWrapper 附件排序 * */ String SORT = "SORT"; + + /** + * 构造queryWrapper 用户Id + * */ + String CUSTOMER_USER_ID = "CUSTOMER_USER_ID"; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupOperationDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupOperationDTO.java index fd59a8a46b..35f15243dc 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupOperationDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupOperationDTO.java @@ -87,4 +87,14 @@ public class ResiGroupOperationDTO implements Serializable { * OPERATE_USER_ID操作人id */ private String operateUserId; + + /** + * 审核人员已读未读标识 (未读:unread; 已读:read) + * */ + private String readFlag; + + /** + * 消息通知内容 + * */ + private String messageText; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyingGroupsFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyingGroupsFormDTO.java new file mode 100644 index 0000000000..a30ecae5ef --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyingGroupsFormDTO.java @@ -0,0 +1,47 @@ +package com.epmet.resi.group.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 政府端查询待审核的小组 + * @ClassName ApplyingGroupsFormDTO + * @Author wangc + * @date 2020.04.17 14:59 + */ +@Data +public class ApplyingGroupsFormDTO implements Serializable{ + private static final long serialVersionUID = 1L; + + /** + * 客户Id + * */ + @NotBlank(message = "客户Id不能为空") + private String customerId; + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空") + private String gridId; + + /** + * 请求页码 最小是1 + * */ + @Min(value = 1) + private Integer pageNo; + + /** + * 每页数据 默认20 + * */ + private Integer pageSize = 20; + + /** + * 用户Id + * */ + @NotBlank(message = "用户Id不能为空") + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGroupIdFromDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGroupIdFromDTO.java new file mode 100644 index 0000000000..2dbfe636dd --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGroupIdFromDTO.java @@ -0,0 +1,29 @@ +package com.epmet.resi.group.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 通用的传参DTO 只传groupId和userId + * @ClassName CommonGroupIdFromDTO + * @Author wangc + * @date 2020.04.20 14:04 + */ +@Data +public class CommonGroupIdFromDTO implements Serializable{ + private static final long serialVersionUID = 1L; + + /** + * 组Id + * */ + @NotBlank(message = "组Id不能为空") + private String groupId; + + /** + * 用户Id + * */ + @NotBlank(message = "用户Id不能为空") + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java new file mode 100644 index 0000000000..7757d54e37 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java @@ -0,0 +1,19 @@ +package com.epmet.resi.group.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/20 9:30 + */ +@Data +public class GovGroupSummarizeFromDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 小组id + */ + private String groupId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupAuditedFromDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupAuditedFromDTO.java new file mode 100644 index 0000000000..f1401ff8df --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupAuditedFromDTO.java @@ -0,0 +1,36 @@ +package com.epmet.resi.group.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/17 13:39 + */ +@Data +public class GroupAuditedFromDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空") + private String customerId; + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + /** + * 页码 + */ + @NotBlank(message = "页码不能为空") + private Integer pageNo; + /** + * 每页显示数量 + */ + @NotBlank(message = "每页显示数量不能为空") + private Integer pageSize; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java new file mode 100644 index 0000000000..f8747baee9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java @@ -0,0 +1,78 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 建组申请详情 + * @ClassName ApplyingGroupDetailResultDTO + * @Author wangc + * @date 2020.04.17 16:13 + */ +@Data +public class ApplyingGroupDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 组Id + * */ + private String groupId; + + /** + * 组名称 + * */ + private String groupName; + + /** + * 组头像 + * */ + private String groupHeadPhoto; + + /** + * 组介绍 + * */ + private String groupIntroduction; + + /** + * 申请时间 + * */ + private Date createdTime; + + /** + * 组长名称 + * */ + private String groupLeaderName; + + /** + * 已同意该申请approved 、已驳回rejected + * */ + private String status; + + /** + * 驳回理由 + * */ + private String rejectReason; + + /** + * 从数据库中获取组长的用户Id,方便获取组长用户信息,返回时将此值置为NULL + * */ + private String leaderId; + + /** + * 街道 + * */ + private String street; + + /** + * 未读已读标识 unread read + * */ + private String readFlag; + + /** + * 从数据库中获取组操作记录Id,返回时将此值置为NULL + * */ + private String operationId; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupResultDTO.java new file mode 100644 index 0000000000..3683f760c5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * @Description 政府端查询待审核的小组 + * @ClassName ApplyingGroupResultDTO + * @Author wangc + * @date 2020.04.17 15:20 + */ +@Data +public class ApplyingGroupResultDTO implements Serializable{ + private static final long serialVersionUID = 1L; + + /** + * 组Id + * */ + private String groupId; + + /** + * 组名称 + * */ + private String groupName; + + /** + * 组头像 + * */ + private String groupHeadPhoto; + + /** + * 申请时间 + * */ + private String createdTime; + + /** + * 审核人员已读未读标识(未读:unread ; 已读:read ) + * */ + private String readFlag; + + /** + * 消息通知内容 + * */ + private String messageText; + + + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GovGroupSummarizeResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GovGroupSummarizeResultDTO.java new file mode 100644 index 0000000000..e0b0c2fd4c --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GovGroupSummarizeResultDTO.java @@ -0,0 +1,43 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/20 9:24 + */ +@Data +public class GovGroupSummarizeResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 组id + */ + private String groupId; + /** + * 组头像 + */ + private String groupHeadPhoto; + /** + * 组名 + */ + private String groupName; + /** + * 成员总数 + */ + private Integer totalMember; + /** + * 组长名称 + */ + private String leaderName; + /** + * 组介绍 + */ + private String groupIntroduction; + /** + * 话题总数 + */ + private Integer totalTopics; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupAuditedResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupAuditedResultDTO.java new file mode 100644 index 0000000000..8c2f0cd7cf --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupAuditedResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/17 13:40 + */ +@Data +public class GroupAuditedResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 小组ID + */ + private String groupId; + /** + * 小组名称 + */ + private String groupName; + /** + * 小组头像 + */ + private String groupHeadPhoto; + /** + * 小组介绍 + */ + private String groupIntroduction; + /** + * 小组状态已驳回rejected ,已通过approved + */ + private String status; + /** + * 审核时间HH:mm + */ + private Date auditedTime; + /** + * 消息通知内容 + */ + private String messageText; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupsInGridResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupsInGridResultDTO.java new file mode 100644 index 0000000000..fa4d22740a --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupsInGridResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/17 15:53 + */ +@NoArgsConstructor +@Data +public class GroupsInGridResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 小组id + */ + private String groupId; + /** + * 小组名称 + */ + private String groupName; + /** + * 小组头像 + */ + private String groupHeadPhoto; + /** + * 成员总数 + */ + private Integer totalMember; + /** + * 党员总数 + */ + private Integer totalPartyMember; + /** + * 当前状态审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed + */ + private String status; +} diff --git a/epmet-module/resi-group/resi-group-server/docker-compose.yml b/epmet-module/resi-group/resi-group-server/docker-compose.yml index 2ce2a5c1c8..71d431ff77 100644 --- a/epmet-module/resi-group/resi-group-server/docker-compose.yml +++ b/epmet-module/resi-group/resi-group-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-group-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-group-server:0.3.1 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 70d3d5a8c4..0b840fc27d 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet resi-group diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java index 321069290b..bbb8188665 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java @@ -56,4 +56,18 @@ public class ResiCommentController { ValidatorUtils.validateEntity(queryCommentFormDTO); return commentService.getCommentList(tokenDto,queryCommentFormDTO); } + + /** + * @Description 政府端群组管理-获取某个话题的评论列表 + * @Param tokenDto + * @Param ResiQueryCommentFormDTO + * @return Result> + * @Author wangc + * @Date 2020.04.01 23:49 + **/ + @PostMapping("getcommentlistoftopicgov") + public Result> getCommentListOfTopicGov(@RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){ + ValidatorUtils.validateEntity(queryCommentFormDTO); + return commentService.getCommentList(null,queryCommentFormDTO); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index ccb77ea7cb..8d1e757349 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -25,10 +25,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.modules.group.service.ResiGroupService; import com.epmet.modules.utils.ModuleConstant; import com.epmet.resi.group.dto.group.form.*; -import com.epmet.resi.group.dto.group.result.CreatedResultDTO; -import com.epmet.resi.group.dto.group.result.GroupSummarizeResultDTO; -import com.epmet.resi.group.dto.group.result.MyGroupResultDTO; -import com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO; +import com.epmet.resi.group.dto.group.result.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -51,10 +48,11 @@ public class ResiGroupController { private ResiGroupService resiGroupService; @GetMapping("test/{test}") - public Result test(@PathVariable("test")String test){ - int result=1/0; + public Result test(@PathVariable("test") String test) { + int result = 1 / 0; return new Result().ok("请求成功啦❤"); } + /** * @param tokenDto * @param myGroupFormDTO @@ -219,4 +217,84 @@ public class ResiGroupController { ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO); } + + /** + * 小组审核历史列表 + * + * @param formDTO 参数 + * @return Result> + */ + @PostMapping("audited") + public Result> audited(GroupAuditedFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiGroupService.audited(formDTO); + } + + /** + * 本网格小组列表 + * + * @param formDTO 参数 + * @return Result> + */ + @PostMapping("groupsingrid") + public Result> getGroupsInGrid(GroupAuditedFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiGroupService.getGroupsInGrid(formDTO); + } + + /** + * 小组管理界面信息 + * + * @param formDTO 参数 + * @return Result + */ + @PostMapping("getgovgroupsummarize") + public Result getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) { + return resiGroupService.getGovGroupSummarize(formDTO); + } + + /** + * @Description 得到小组待审核列表,用户信息不注入TokenDTO,通过外部服务调用直接传入参数 + * @Param ApplyingGroupsFormDTO.class + * @return Result> + * @Author wangc + * @Date 2020.04.20 13:59 + **/ + @PostMapping("getapplyinggroups") + public Result> getApplyingGroups(@RequestBody ApplyingGroupsFormDTO applyingGroupsFormDTO){ + ValidatorUtils.validateEntity(applyingGroupsFormDTO); + return resiGroupService.getApplyingGroups(applyingGroupsFormDTO); + } + + /** + * @Description 得到待审核/未审核小组信息的详情 + * @Param CommonGroupIdFromDTO -> String groupId; String userId + * @return Result + * @Author wangc + * @Date 2020.04.20 14:08 + **/ + @PostMapping("getapplyinggroupdetail") + public Result getApplyingGroupDetail(@RequestBody CommonGroupIdFromDTO groupIdFromDTO){ + ValidatorUtils.validateEntity(groupIdFromDTO); + return resiGroupService.getApplyingGroupDetail(groupIdFromDTO); + } + + @PostMapping("agreeapplying") + public Result agreeApplying( @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { + ValidatorUtils.validateEntity(agreeApplyGroupFormDTO); + return resiGroupService.agreeApplyGroup(agreeApplyGroupFormDTO); + } + + /** + * @Description 建组申请-审核驳回-供外部服务调用,当前用户Id需要调用时一并传入 + * @Param DisAgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.20 14:26 + **/ + @PostMapping("disagreeapplying") + public Result disagreeApplying(@RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { + ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); + return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java index bf67a9ebd5..4bc70f4762 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java @@ -23,6 +23,7 @@ import com.epmet.resi.group.dto.group.form.*; import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -106,4 +107,36 @@ public interface ResiGroupDao extends BaseDao { * @Date 2020/3/30 16:03 **/ List checkResiGroupName(ApplyCreateGroupFormDTO applyCreateGroupFormDTO); + + /** + * 查询小组审核历史列表 + * @param formDTO + * @return + */ + List selectAuditedGroupList(GroupAuditedFromDTO formDTO); + + /** + * 查询网格小组列表 + * @param formDTO + * @return + */ + List selectGroupsByGridId(GroupAuditedFromDTO formDTO); + + /** + * @Description 查询申请中的的小组 + * @Param ApplyingGroupsFormDTO + * @return List + * @Author wangc + * @Date 2020.04.20 00:11 + **/ + List getApplyingGroupsByCustIdAndGridId(ApplyingGroupsFormDTO applyingGroupsFormDTO); + + /** + * @Description 获取组审核信息详情:已审核/未审核通用 + * @Param groupId + * @return ApplyingGroupDetailResultDTO + * @Author wangc + * @Date 2020.04.20 11:17 + **/ + ApplyingGroupDetailResultDTO getApplyingGroupDetailByGroupId(@Param("groupId") String groupId); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupOperationEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupOperationEntity.java index 90e74625bc..b3d2c0151f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupOperationEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupOperationEntity.java @@ -57,4 +57,14 @@ public class ResiGroupOperationEntity extends BaseEpmetEntity { * OPERATE_USER_ID操作人id */ private String operateUserId; + + /** + * 审核人员已读未读标识 (未读:unread; 已读:read) + * */ + private String readFlag; + + /** + * 消息通知内容 + * */ + private String messageText; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java index 12d4ab4d7a..8971aae9dc 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java @@ -17,13 +17,24 @@ package com.epmet.modules.group.redis; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.group.service.ResiGroupService; +import com.epmet.modules.group.service.ResiGroupStatisticalService; +import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO; +import com.epmet.resi.group.dto.group.ResiGroupStatisticalDTO; +import com.epmet.resi.group.dto.group.ResiGroupStatisticalInfoRedisDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.*; + /** * 群组信息表 * @@ -35,6 +46,13 @@ public class ResiGroupRedis { @Autowired private RedisUtils redisUtils; + @Autowired + private ResiGroupService groupService; + + @Autowired + private ResiGroupStatisticalService statisticalService; + + public void delete(Object[] ids) { } @@ -51,10 +69,75 @@ public class ResiGroupRedis { } } + /** + * @Description 查询组的缓存信息,如果有直接返回,如果没有,则从数据库中查询,将数据放入缓存并返回 + * @Param + * @return + * @Author wangc + * @Date 2020.04.18 12:00 + **/ public ResiGroupInfoRedisDTO get(String groupId){ + if(StringUtils.isNotBlank(groupId)){ ResiGroupInfoRedisDTO groupCache = (ResiGroupInfoRedisDTO) redisUtils.get(RedisKeys.getResiGroupInfoKey(groupId)); + if(null == groupCache || StringUtils.isBlank(groupCache.getGroupId())){ + //如果缓存中没有该组信息,从数据库中查询并放入缓存 + ResiGroupDTO groupMySql = groupService.get(groupId); + if(null != groupMySql && StringUtils.isNotBlank(groupMySql.getId())){ + ResiGroupInfoRedisDTO groupRedis = ConvertUtils.sourceToTarget(groupMySql,ResiGroupInfoRedisDTO.class); + groupRedis.setGroupId(groupMySql.getId()); + groupRedis.setGroupState(groupMySql.getState()); + Map param = new HashMap<>(); + param.put(TopicConstant.RESI_GROUP_ID,groupId); + param.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR); + List statisticalMySql = statisticalService.list(param); + if(null != statisticalMySql && statisticalMySql.size() >= 1){ + if(statisticalMySql.size() > 1){ + /* + Collections.sort(statisticalMySql, new Comparator() { + @Override + public int compare(ResiGroupStatisticalDTO o1, ResiGroupStatisticalDTO o2) { + if(null != o1.getCreatedTime() && null != o2.getCreatedTime()){ + return + o1.getCreatedTime().getTime() > o2.getCreatedTime().getTime() ? + -1 : (o1.getCreatedTime().getTime() == o2.getCreatedTime().getTime() ? + 0: 1); + }else{ + return 0; + } + } + }); + + statisticalMySql.sort((ResiGroupStatisticalDTO o1, ResiGroupStatisticalDTO o2) -> + o1.getCreatedTime().compareTo(o2.getCreatedTime()) + ); + //升序 + statisticalMySql.sort(Comparator.comparing(e -> e.getCreatedTime())); + + statisticalMySql.sort(Comparator.comparing(ResiGroupStatisticalDTO :: getCreatedTime, + (o1 , o2) -> { + return o2.compareTo(o 1); + })); + */ + + //按照createdTime降序排序 + statisticalMySql.sort(Comparator.comparing(ResiGroupStatisticalDTO :: getCreatedTime, + Collections.reverseOrder())); + } + ResiGroupStatisticalDTO statistical = statisticalMySql.get(0); + ResiGroupStatisticalInfoRedisDTO statisticalRedis = + ConvertUtils.sourceToTarget(statistical,ResiGroupStatisticalInfoRedisDTO.class); + statisticalRedis.setTotalEarnestMembers(statistical.getTotalEarnestMemebers()); + statisticalRedis.setTotalNormalMembers(statistical.getTotalNormalMemebers()); + groupRedis.setGroupStatisticalInfo(statisticalRedis); + } + //将从数据库中查询出的数据放入缓存 + set(groupRedis); + //返回数据 + return groupRedis; + } + } return groupCache; } return null; diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index 39bac55512..8d3f760279 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -20,17 +20,12 @@ package com.epmet.modules.group.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.modules.group.entity.ResiGroupEntity; import com.epmet.resi.group.dto.UserRoleDTO; import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.form.*; -import com.epmet.resi.group.dto.group.result.CreatedResultDTO; -import com.epmet.resi.group.dto.group.result.GroupSummarizeResultDTO; -import com.epmet.resi.group.dto.group.result.MyGroupResultDTO; -import com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO; +import com.epmet.resi.group.dto.group.result.*; import java.util.List; import java.util.Map; @@ -176,8 +171,8 @@ public interface ResiGroupService extends BaseService { Result initApplyCreatedGroup(InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO); /** - * @return com.epmet.commons.tools.utils.Result * @param agreeApplyGroupFormDTO + * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei * @Description 审核(同意)群申请-测试用后面会放到政府端 * @Date 2020/3/31 12:44 @@ -185,8 +180,8 @@ public interface ResiGroupService extends BaseService { Result agreeApplyGroup(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO); /** - * @return com.epmet.commons.tools.utils.Result * @param disAgreeApplyGroupFormDTO + * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei * @Description 审核(拒绝)群申请-测试用后面会放到政府端 * @Date 2020/3/31 13:22 @@ -194,14 +189,56 @@ public interface ResiGroupService extends BaseService { Result disagreeApplyGroup(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO); /** - * @return com.epmet.resi.group.dto.UserRoleDTO * @param app * @param userId * @param customerId * @param gridId + * @return com.epmet.resi.group.dto.UserRoleDTO * @Author yinzuomei * @Description 判断用户当前角色 * @Date 2020/4/1 0:00 **/ UserRoleDTO checkPartyMemberOrWarmHeated(String app, String userId, String customerId, String gridId); + + /** + * 小组审核历史列表 + * + * @param formDTO 参数 + * @return Result> + */ + Result> audited(GroupAuditedFromDTO formDTO); + + /** + * 本网格小组列表 + * + * @param formDTO 参数 + * @return Result> + */ + Result> getGroupsInGrid(GroupAuditedFromDTO formDTO); + + /** + * 小组管理界面信息 + * + * @param formDTO 参数 + * @return Result + */ + Result getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO); + + /** + * @Description 查询待审核的小组 + * @Param ApplyingGroupsFormDTO + * @return Result> + * @Author wangc + * @Date 2020.04.18 10:17 + **/ + Result> getApplyingGroups(ApplyingGroupsFormDTO applyingGroupsFormDTO); + + /** + * @Description 建组申请详情 + * @Param AgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.19 23:32 + **/ + Result getApplyingGroupDetail(CommonGroupIdFromDTO groupId); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 5d1a0ac277..4c21340893 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -30,20 +30,22 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.UserResiInfoFormDTO; +import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.form.UserRoleFormDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.dto.result.UserRoleResultDTO; -import com.epmet.modules.exception.ModuleErrorCode; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.dao.ResiGroupOperationDao; import com.epmet.modules.group.entity.ResiGroupEntity; +import com.epmet.modules.group.entity.ResiGroupOperationEntity; import com.epmet.modules.group.redis.ResiGroupRedis; import com.epmet.modules.group.service.ResiGroupOperationService; import com.epmet.modules.group.service.ResiGroupService; import com.epmet.modules.group.service.ResiGroupStatisticalService; import com.epmet.modules.member.dao.GroupMemeberOperationDao; import com.epmet.modules.member.dao.ResiGroupMemberDao; +import com.epmet.modules.member.redis.ResiGroupMemberRedis; import com.epmet.modules.member.service.GroupMemeberOperationService; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.modules.utils.ModuleConstant; @@ -54,12 +56,10 @@ import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.dto.UserRoleDTO; import com.epmet.resi.group.dto.group.*; import com.epmet.resi.group.dto.group.form.*; -import com.epmet.resi.group.dto.group.result.CreatedResultDTO; -import com.epmet.resi.group.dto.group.result.GroupSummarizeResultDTO; -import com.epmet.resi.group.dto.group.result.MyGroupResultDTO; -import com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO; +import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; +import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -107,6 +107,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl page(Map params) { @@ -314,7 +317,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl param = new HashMap<>(); - param.put("resiGroupId",resiGroupDTO.getId()); + //6、新增小组缓存信息、组员缓存信息 + Map param = new HashMap<>(); + param.put(ModuleConstant.RESI_GROUP_ID_CAMEL, resiGroupDTO.getId()); + param.put(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); List statisticalList = resiGroupStatisticalService.list(param); - if(null != statisticalList && statisticalList.size() > 0){ - ResiGroupInfoRedisDTO groupRedis = transferToGroupInfoRedis(resiGroupDTO,statisticalList.get(0)); + if (null != statisticalList && statisticalList.size() > 0) { + ResiGroupInfoRedisDTO groupRedis = transferToGroupInfoRedis(resiGroupDTO, statisticalList.get(0)); resiGroupRedis.set(groupRedis); - }else{ - //当没有查询到组统计信息时 - UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO(); - userRoleFormDTO.setApp("resi"); - userRoleFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); - userRoleFormDTO.setUserId(agreeApplyGroupFormDTO.getUserId()); - //userRoleFormDTO.setGridId - //epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); + + ResiGroupMemberInfoRedisDTO memberRedis = new ResiGroupMemberInfoRedisDTO(); + memberRedis.setUserId(resiGroupMemberDTO.getCustomerUserId()); + memberRedis.setGroupLeaderFlag("leader"); + memberRedis.setEnterGroupType(resiGroupMemberDTO.getEnterGroupType()); + memberRedis.setMemberStatus(resiGroupMemberDTO.getStatus()); + memberRedis.setGroupId(resiGroupMemberDTO.getResiGroupId()); + + UserResiInfoFormDTO userParam = new UserResiInfoFormDTO(); + userParam.setUserId(resiGroupMemberDTO.getCustomerUserId()); + userParam.setCustomerId(resiGroupDTO.getCustomerId()); + Result userInfo = + epmetUserFeignClient.getUserResiInfoDTO(userParam); + if(userInfo.success() && null != userInfo.getData()){ + memberRedis.setUserShowName(userInfo.getData().getShowName()); + memberRedis.setUserHeadPhoto(userInfo.getData().getHeadPhoto()); + }else{ + logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND); + } + resiGroupMemberRedis.set(memberRedis); + } else { + /* + 当没有查询到组统计信息时,需要自己封装统计信息 + @param UserRoleFormDTO::getApp + @param UserRoleFormDTO::getCustomerId + @param UserRoleFormDTO::getUserId + @param UserRoleFormDTO::getGridId + 查询用户身份信息[热心居民/党员] + epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); + */ + logger.warn(ModuleConstant.NO_SUCH_GROUP_STASTICAL_INFO); } @@ -502,11 +529,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl> audited(GroupAuditedFromDTO formDTO) { + Result> result = new Result<>(); + //查询条件 + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + //获取审核列表 + List resultList = baseDao.selectAuditedGroupList(formDTO); + + return result.ok(resultList); + } + + @Override + public Result> getGroupsInGrid(GroupAuditedFromDTO formDTO) { + List resultList = new ArrayList<>(); + //查询条件 + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + List list = baseDao.selectGroupsByGridId(formDTO); + list.forEach(i -> { + //缓存中获取组信息 + ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(i.getId()); + GroupsInGridResultDTO groupsInGridResultDTO = new GroupsInGridResultDTO(); + groupsInGridResultDTO.setGroupId(resiGroupInfoRedisDTO.getGroupId()); + groupsInGridResultDTO.setGroupName(resiGroupInfoRedisDTO.getGroupName()); + groupsInGridResultDTO.setGroupHeadPhoto(resiGroupInfoRedisDTO.getGroupHeadPhoto()); + groupsInGridResultDTO.setStatus(resiGroupInfoRedisDTO.getGroupState()); + groupsInGridResultDTO.setTotalMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalMembers()); + groupsInGridResultDTO.setTotalPartyMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalPartyMembers()); + resultList.add(groupsInGridResultDTO); + }); + + return new Result>().ok(resultList); + } + + @Override + public Result getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) { + GovGroupSummarizeResultDTO resultDTO = new GovGroupSummarizeResultDTO(); + //从缓存中获取组相关信息 + ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(formDTO.getGroupId()); + resultDTO.setGroupId(resiGroupInfoRedisDTO.getGroupId()); + resultDTO.setGroupHeadPhoto(resiGroupInfoRedisDTO.getGroupHeadPhoto()); + resultDTO.setGroupIntroduction(resiGroupInfoRedisDTO.getGroupIntroduction()); + resultDTO.setGroupName(resiGroupInfoRedisDTO.getGroupName()); + resultDTO.setTotalMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalMembers()); + resultDTO.setTotalTopics(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalTopics()); + + //获取组长信息 + Result groupLeaderUserInfo = this.getGroupLeaderUserInfo(formDTO.getGroupId()); + if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) { + resultDTO.setLeaderName(groupLeaderUserInfo.getData().getShowName()); + } else { + logger.info("组长注册信息查询失败" + groupLeaderUserInfo.getMsg()); + } + + return new Result().ok(resultDTO); + } + /** + * @return ResiGroupInfoRedisDTO * @Description 将ResiGroupDTO与ResiGroupStatisticalDTO转换成ResiGroupInfoRedisDTO * @Param ResiGroupDTO * @Param ResiGroupStatisticalDTO - * @return ResiGroupInfoRedisDTO * @Author wangc * @Date 2020.04.13 16:36 **/ - private ResiGroupInfoRedisDTO transferToGroupInfoRedis(ResiGroupDTO groupDTO,ResiGroupStatisticalDTO statisticalDTO){ + private ResiGroupInfoRedisDTO transferToGroupInfoRedis(ResiGroupDTO groupDTO, ResiGroupStatisticalDTO statisticalDTO) { ResiGroupStatisticalInfoRedisDTO statisticalObjct = - ConvertUtils.sourceToTarget(statisticalDTO,ResiGroupStatisticalInfoRedisDTO.class); + ConvertUtils.sourceToTarget(statisticalDTO, ResiGroupStatisticalInfoRedisDTO.class); statisticalObjct.setTotalEarnestMembers(statisticalDTO.getTotalEarnestMemebers()); statisticalObjct.setTotalNormalMembers(statisticalDTO.getTotalNormalMemebers()); ResiGroupInfoRedisDTO targetObject = - ConvertUtils.sourceToTarget(groupDTO,ResiGroupInfoRedisDTO.class); + ConvertUtils.sourceToTarget(groupDTO, ResiGroupInfoRedisDTO.class); targetObject.setGroupId(groupDTO.getId()); targetObject.setGroupState(groupDTO.getState()); SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN); - if(null != groupDTO.getLatestTopicPublishDate()){ + if (null != groupDTO.getLatestTopicPublishDate()) { targetObject.setLatestTopicPublishDate(format.format(groupDTO.getLatestTopicPublishDate())); } targetObject.setGroupStatisticalInfo(statisticalObjct); return targetObject; } + /** + * @Description 查询待审核的小组 (不从缓存中取,这时还没有成功建组,缓存中没有组数据) + * @Param ApplyingGroupsFormDTO + * @return Result> + * @Author wangc + * @Date 2020.04.18 10:18 + **/ + @Override + public Result> getApplyingGroups(ApplyingGroupsFormDTO params){ + if(null == params.getPageNo()){ + throw new RenException(ModuleConstant.PAGE_INDEX_NOT_NULL); + } + params.setPageNo((params.getPageNo() - NumConstant.ONE) * params.getPageSize()); + return new Result>().ok(baseDao.getApplyingGroupsByCustIdAndGridId(params)); + } + + /** + * @Description 建组申请详情 已审核(更新已读未读标识)/未审核 + * @Param AgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.19 23:32 + **/ + @Override + public Result getApplyingGroupDetail(CommonGroupIdFromDTO groupId){ + //1.查询小组信息 + //注意,这里查询出的组申请详情中,无论是已审核还是未审核,都是将该组信息关联到初始化组时状态为[待审核、审核通过、拒绝]其中之一的组操作记录上,并读取审核的已读未读信息,上述三种状态在一个组的所有操作记录当中只可能存在一种,与之后的屏蔽、取消屏蔽、关闭无关,如果查出多条说明建组的逻辑有问题 + ApplyingGroupDetailResultDTO detail = baseDao.getApplyingGroupDetailByGroupId(groupId.getGroupId()); + //2.查询用户信息(TODO 先走数据库,之后改成走缓存) + List userId = new ArrayList<>(); + userId.add(detail.getLeaderId()); + Result> userInfoResult = + epmetUserFeignClient.getUserResiInfoList(new UserResiInfoListFormDTO(userId)); + if(userInfoResult.success() && null != userInfoResult.getData() && userInfoResult.getData().size() >= 1){ + detail.setGroupHeadPhoto(userInfoResult.getData().get(0).getHeadPhoto()); + //姓氏+先生/女士 注:在数据库中拼接成[街道+显示名称]默认格式,故要进行截取 + //detail.setGroupLeaderName(userInfoResult.getData().get(0).getShowName().split("-")[NumConstant.ONE]); + //姓氏+名称 + detail.setGroupLeaderName(userInfoResult.getData().get(0).getSurname() + userInfoResult.getData().get(0).getName()); + detail.setStreet(userInfoResult.getData().get(0).getStreet()); + }else{ + logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND); + } + //3.未读改成已读 + if(StringUtils.equals(detail.getReadFlag(),ModuleConstant.UNREAD)){ + ResiGroupOperationEntity operationEntity = new ResiGroupOperationEntity(); + operationEntity.setId(detail.getOperationId()); + operationEntity.setReadFlag(ModuleConstant.READ); + operationEntity.setUpdatedBy(groupId.getUserId()); + resiGroupOperationDao.updateById(operationEntity); + } + //4.将组长用户Id隐藏 + detail.setLeaderId(null); + detail.setOperationId(null); + + return new Result().ok(detail); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java index 4ddcf25a3b..d59e819155 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java @@ -17,12 +17,26 @@ package com.epmet.modules.member.redis; + +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UserResiInfoFormDTO; +import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.group.service.ResiGroupService; +import com.epmet.modules.member.service.ResiGroupMemberService; +import com.epmet.modules.utils.ModuleConstant; +import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -39,6 +53,17 @@ public class ResiGroupMemberRedis { @Autowired private RedisUtils redisUtils; + @Autowired + private ResiGroupMemberService memberService; + + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + @Autowired + private ResiGroupService groupService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + public void delete(Object[] ids) { } @@ -67,14 +92,54 @@ public class ResiGroupMemberRedis { * @Date 2020.04.13 23:36 **/ public ResiGroupMemberInfoRedisDTO get(String groupId ,String userId){ - /* - Map map = redisUtils.hGetAll(); - if (MapUtil.isEmpty(map)) { - return null; + + ResiGroupMemberInfoRedisDTO memberCache = + (ResiGroupMemberInfoRedisDTO) redisUtils.get(RedisKeys.getResiGroupMemberInfoKey(groupId,userId)); + //如果缓存中没有该成员数据 + if(null == memberCache && StringUtils.isNotBlank(memberCache.getUserId())){ + Map param = new HashMap<>(); + param.put(TopicConstant.CUSTOMER_USER_ID,userId); + param.put(TopicConstant.RESI_GROUP_ID,groupId); + param.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR); + List memberList = memberService.list(param); + if(null != memberList && memberList.size() >= 1){ + if(memberList.size() > 1) { + memberList.sort(Comparator.comparing(ResiGroupMemberDTO::getCreatedTime, Collections.reverseOrder())); + } + ResiGroupMemberDTO memberMySql = memberList.get(0); + ResiGroupMemberInfoRedisDTO memberRedis = ConvertUtils.sourceToTarget(memberMySql,ResiGroupMemberInfoRedisDTO.class); + + memberRedis.setUserId(memberMySql.getCustomerUserId()); + memberRedis.setGroupId(memberMySql.getResiGroupId()); + memberRedis.setMemberStatus(memberMySql.getStatus()); + + + UserResiInfoFormDTO userParam = new UserResiInfoFormDTO(); + userParam.setUserId(memberMySql.getCustomerUserId()); + userParam.setCustomerId(groupService.get(groupId).getCustomerId()); + Result userInfo = epmetUserFeignClient.getUserResiInfoDTO(userParam); + if(userInfo.success()){ + if(null != userInfo.getData()){ + memberRedis.setUserShowName(userInfo.getData().getShowName()); + memberRedis.setUserHeadPhoto(userInfo.getData().getHeadPhoto()); + } + }else{ + logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND); + } + + set(memberRedis); + return memberRedis; + }else{ + //日志打印效果:找不到组员信息,组Id: ********,用户Id:******** + logger.warn(ModuleConstant.GROUO_MEMBER_INFO_NOT_FOUND + .concat(ModuleConstant.GROUP_ID) + .concat(groupId) + .concat(ModuleConstant.USER_ID) + .concat(userId)); + } } - //map to bean - ResiGroupMemberInfoRedisDTO member = BeanUtil.mapToBean(map, ResiGroupMemberInfoRedisDTO.class, true);*/ - return (ResiGroupMemberInfoRedisDTO) redisUtils.get(RedisKeys.getResiGroupMemberInfoKey(groupId,userId)); + + return memberCache; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java index e02a61318e..33da2273dd 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java @@ -132,7 +132,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - + wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); return wrapper; } @@ -176,6 +176,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(groupId), "RESI_GROUP_ID", groupId) .eq(StringUtils.isNotBlank(userId), "CUSTOMER_USER_ID", userId); + wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); List list = baseDao.selectList(wrapper); if (null == list || list.size() == 0) { return null; @@ -358,6 +359,8 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl paramsMap = new HashMap<>(); paramsMap.put(TopicConstant.RESI_GROUP_ID,groupMemeberOperationDTO.getGroupId()); + paramsMap.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR); + //不再进行计算,直接从数据库中拉取更新过的数据(在同一个事务中) List statisticalDTO = resiGroupStatisticalService.list(paramsMap); if(null != statisticalDTO && statisticalDTO.size() > 0){ ResiGroupStatisticalInfoRedisDTO statisticalObjct = diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index b8dba5abcc..3114599050 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -82,7 +82,7 @@ public class ResiTopicController { * @Date 2020.04.02 00:01 **/ @PostMapping("getlatesttopics") - Result> getLatestTopics(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicDefaultPageFormDTO topicDefaultPageFormDTO){ + public Result> getLatestTopics(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicDefaultPageFormDTO topicDefaultPageFormDTO){ ValidatorUtils.validateEntity(topicDefaultPageFormDTO); return topicService.getLatestTopics(tokenDto,topicDefaultPageFormDTO.getGroupId()); } @@ -141,4 +141,46 @@ public class ResiTopicController { ValidatorUtils.validateEntity(closeFormDTO); return topicService.closeTopic(tokenDto,closeFormDTO); } + + /** + * @Description 政府端群组管理-屏蔽话题列表查询 + * @Param tokenDto + * @Param ResiTopicPageFormDTO.class + * @return List + * @Author wangc + * @Date 2020.04.01 16:45 + **/ + @PostMapping("gethiddentopicgov") + public Result> getHiddenTopicGov(@RequestBody ResiTopicPageFormDTO topicPageFormDTO){ + ValidatorUtils.validateEntity(topicPageFormDTO); + return topicService.getHiddenTopics(null,topicPageFormDTO); + } + + /** + * @Description 政府端群组管理-查看历史话题(分页,允许状态筛选) + * @Param tokenDto + * @Param ResiTopicPageFormDTO.class + * @return Result> + * @Author wangc + * @Date 2020.04.01 10:36 + **/ + @PostMapping("getpasttopiclistgov") + public Result> getPastTopicListGov(@RequestBody ResiTopicPageFormDTO topicPageFormDTO){ + ValidatorUtils.validateEntity(topicPageFormDTO); + return topicService.getPastTopicList(null,topicPageFormDTO); + } + /** + * @Description 政府端群组管理-获取话题详情 + * @Param tokenDto + * @Param String + * @return Result + * @Author wangc + * @Date 2020.04.01 23:48 + **/ + @PostMapping("gettopicdetailgov") + public Result getTopicDetailGov( @RequestBody ResiTopicDetailFormDTO topicDetailFormDTO ){ + ValidatorUtils.validateEntity(topicDetailFormDTO); + return topicService.getTopicDetail(null,topicDetailFormDTO.getTopicId()); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index 67fd903074..9fc3289632 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java @@ -98,7 +98,7 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - + wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); return wrapper; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 1925d2b28b..a1303453ba 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -138,6 +138,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); return wrapper; @@ -235,6 +236,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); wrapper.eq(TopicConstant.RESI_GROUP_ID,resiTopicPublishFormDTO.getGroupId()); List statistical = resiGroupStatisticalDao.selectList(wrapper); if(null != statistical && statistical.size() >= NumConstant.ONE){ @@ -524,6 +526,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); wrapper.eq(TopicConstant.TOPIC_ID,topicId); wrapper.orderByAsc(TopicConstant.SORT); List attachments = resiTopicAttachmentDao.selectList(wrapper); @@ -542,36 +545,6 @@ public class ResiTopicServiceImpl extends BaseServiceImpl userInfo = epmetUserFeignClient.getUserResiInfoDTO(userParam); - if(userInfo.success()){ - if(null != userInfo.getData()){ - resultDTO.setReleaseUserName(userInfo.getData().getShowName()); - resultDTO.setReleaseUserHeadPhoto(userInfo.getData().getHeadPhoto()); - - ResiGroupMemberInfoRedisDTO memberRedisDTO = new ResiGroupMemberInfoRedisDTO(); - ResiGroupMemberDTO memberMySql = resiGroupMemberDao.selectGroupMemberInfo(group.getId(), userInfo.getData().getUserId()); - - memberRedisDTO.setUserId(userInfo.getData().getUserId()); - memberRedisDTO.setUserHeadPhoto(userInfo.getData().getHeadPhoto()); - memberRedisDTO.setUserShowName(userInfo.getData().getShowName()); - - memberRedisDTO.setEnterGroupType(memberMySql.getEnterGroupType()); - memberRedisDTO.setGroupLeaderFlag(memberMySql.getGroupLeaderFlag()); - memberRedisDTO.setMemberStatus(memberMySql.getStatus()); - - memberRedisDTO.setGroupId(group.getId()); - resiGroupMemberRedis.set(memberRedisDTO); - } - - }else{ - logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND); - } } return new Result().ok(resultDTO); @@ -598,16 +571,6 @@ public class ResiTopicServiceImpl extends BaseServiceImpl 0) { - - /*List userIdList = new ArrayList<>(); - for (ResiTopicInfoResultDTO topic : hiddenTopics) { - userIdList.add(topic.getUserId()); - } - UserResiInfoListFormDTO formDTO = new UserResiInfoListFormDTO(); - formDTO.setUserIdList(userIdList); - Result> userResiInfoDTOListResult = epmetUserFeignClient.getUserResiInfoList(formDTO); - setUserInfo(userResiInfoDTOListResult, hiddenTopics);*/ - setCacheUserInfo(topicPageFormDTO.getGroupId(), hiddenTopics); } @@ -818,6 +781,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl + + + + + + + + + + diff --git a/epmet-module/resi-guide/resi-guide-server/docker-compose.yml b/epmet-module/resi-guide/resi-guide-server/docker-compose.yml index 0fc4046b76..732186e463 100644 --- a/epmet-module/resi-guide/resi-guide-server/docker-compose.yml +++ b/epmet-module/resi-guide/resi-guide-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-guide-server: container_name: resi-guide-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-guide-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-guide-server:0.3.1 ports: - "8091:8091" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index b4688e19d9..0d31597b1f 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet resi-guide @@ -76,6 +76,11 @@ 2.0.0 compile + + org.yaml + snakeyaml + ${snakeyaml.version} + diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java index 729ce30565..edc0784fa5 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java @@ -101,6 +101,7 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); Calendar before3daysDate = Calendar.getInstance(); before3daysDate.setTime(new Date()); before3daysDate.add(Calendar.DATE, -3); diff --git a/epmet-module/resi-mine/resi-mine-server/docker-compose.yml b/epmet-module/resi-mine/resi-mine-server/docker-compose.yml index 8e86a64717..6c11ddb5a4 100644 --- a/epmet-module/resi-mine/resi-mine-server/docker-compose.yml +++ b/epmet-module/resi-mine/resi-mine-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-mine-server: container_name: resi-mine-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-mine-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-mine-server:0.3.1 ports: - "8094:8094" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 77cc559c92..3a8a7018f2 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet resi-mine diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java index 03283c179a..943a096740 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java @@ -43,6 +43,7 @@ public class ResiWarmheartedController { **/ @PostMapping("submit") public Result submit(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedSubmitFormDTO formDTO) { + formDTO.setApp(tokenDTO.getApp()); ValidatorUtils.validateEntity(formDTO); return resiWarmheartedService.submit(tokenDTO, formDTO); } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java new file mode 100644 index 0000000000..5e67b98be6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; + +/** + * @Description 政府端(小程序)党员认证-审核历史列表入参 + * @Author yinzuomei + * @Date 2020/4/26 23:35 + */ +@Data +public class ReviewedParyMemberFormDTO { + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java new file mode 100644 index 0000000000..a9fc379e2f --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 政府端(小程序端)查询待审核列表入参 + * @Author yinzuomei + * @Date 2020/4/26 17:57 + */ +@Data +public class UnderReviewParyMemberFormDTO implements Serializable { + private static final long serialVersionUID = 1730875402752895514L; + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java new file mode 100644 index 0000000000..c73aeb5f52 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.util.Date; + +/** + * @Description 政府端(小程序)党员认证-审核历史列表返参 + * @Author yinzuomei + * @Date 2020/4/26 23:36 + */ +@Data +public class ReviewedParyMemberResultDTO { + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * auto_confirm_failed:自动认证失败,rejected :拒绝 + */ + private String status; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java new file mode 100644 index 0000000000..baf6df1f52 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 政府端(小程序端)查询待审核列表返参 + * @Author yinzuomei + * @Date 2020/4/26 18:47 + */ +@Data +public class UnderReviewParyMemberResultDTO implements Serializable { + private static final long serialVersionUID = 2890001061547093376L; + + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * read已读unread未读 + */ + private String readFlag; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/ResiWarmheartedApplyDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/ResiWarmheartedApplyDTO.java index 31c92d0a34..4f301d4ba1 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/ResiWarmheartedApplyDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/ResiWarmheartedApplyDTO.java @@ -69,6 +69,16 @@ public class ResiWarmheartedApplyDTO implements Serializable { */ private String refuseReason; + /** + * 审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点) + */ + private String readFlag; + + /** + * 消息通知内容 + */ + private String messageText; + /** * 热心居民申请行为记录表Id (resi_warmhearted_visit.id) */ diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditApproveFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditApproveFormDTO.java new file mode 100644 index 0000000000..058627678a --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditApproveFormDTO.java @@ -0,0 +1,51 @@ +/** + * 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.resi.partymember.dto.warmhearted.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 政府端-人工审核热心居民申请-审核通过-入参配置 + * @author sun + */ +@Data +public class ResiWarmAuditApproveFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 热心居民申请id + */ + @NotBlank(message = "申请ID不能为空") + private String applyId; + + /** + * 用户Id + */ + private String userId; + + /** + * 所属端 app + */ + private String app; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditFormDTO.java new file mode 100644 index 0000000000..844fdee598 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditFormDTO.java @@ -0,0 +1,66 @@ +/** + * 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.resi.partymember.dto.warmhearted.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 政府端-获取待审核的热心居民申请列表-入参配置 + * + * @author sun + */ +@Data +public class ResiWarmAuditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户当前所在网格所属客户id + */ + @NotBlank(message = "客户id不能为空") + private String customerId; + + /** + * 用户当前所在网格id + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示条数 + */ + private Integer pageSize = 10; + + /** + * 审核状态 【key:audit_status,value:(under_auditting:待审核,approved:通过,rejected :未通过)】 + */ + private String auditStatus; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditRejectFormDTO.java similarity index 74% rename from epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java rename to epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditRejectFormDTO.java index 707e41f30f..6f19739bcc 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditRejectFormDTO.java @@ -24,11 +24,11 @@ import java.io.Serializable; /** - * 政府端-人工审核热心居民申请-配置入参 + * 政府端-人工审核热心居民申请-审核驳回-入参配置 * @author sun */ @Data -public class ResiWarmheartedAuditFormDTO implements Serializable { +public class ResiWarmAuditRejectFormDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -36,28 +36,22 @@ public class ResiWarmheartedAuditFormDTO implements Serializable { * 热心居民申请id */ @NotBlank(message = "申请ID不能为空") - private String resiWarmApplyId; - - /** - * 审核状态(0:取消驳回 1:审核通过) - */ - @NotBlank(message = "审核状态不能为空") - private String auditStatus; + private String applyId; /** * 驳回理由 */ + @NotBlank(message = "驳回理由不能为空") private String refuseReason; /** - * 客户Id CUSTOMER.id + * 用户Id */ - @NotBlank(message = "客户ID不能为空") - private String customerId; + private String userId; /** - * 用户Id + * 所属端 app */ - private String userId; + private String app; } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmGetDetailFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmGetDetailFormDTO.java new file mode 100644 index 0000000000..97bb2b4f44 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmGetDetailFormDTO.java @@ -0,0 +1,42 @@ +/** + * 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.resi.partymember.dto.warmhearted.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 政府端-热心居民申请详情信息-入参配置 + * + * @author sun + */ +@Data +public class ResiWarmGetDetailFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 热心居民申请id + */ + @NotBlank(message = "申请ID不能为空") + private String applyId; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditedFromDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditedFromDTO.java new file mode 100644 index 0000000000..c7a9b8bacd --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditedFromDTO.java @@ -0,0 +1,31 @@ +package com.epmet.resi.partymember.dto.warmhearted.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 热心居民-审核历史请求参数 + * @date 2020/4/16 13:51 + */ +@Data +public class ResiWarmheartedAuditedFromDTO implements Serializable { + private static final long serialVersionUID = -7290137219142856024L; + /** + * 客户id + */ + private String customerId; + /** + * 网格id + */ + private String gridId; + /** + * 页码 + */ + private Integer pageNo; + /** + * 每页显示数量 + */ + private Integer pageSize; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java index 38adf78eae..7ce698f0af 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java @@ -61,4 +61,14 @@ public class ResiWarmheartedSubmitFormDTO implements Serializable { */ private String userId; + /** + * 所属端 app + */ + private String app; + + /** + * 消息内容 + */ + private String messageText; + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmAuditResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmAuditResultDTO.java new file mode 100644 index 0000000000..8e00af9ca4 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmAuditResultDTO.java @@ -0,0 +1,106 @@ +/** + * 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.resi.partymember.dto.warmhearted.result; + + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 政府端-获取待审核的热心居民申请列表-返参配置 + * + * @author sun + */ +@Data +public class ResiWarmAuditResultDTO implements Serializable { + + private static final long serialVersionUID = -1L; + + /** + * 申请单Id + */ + private String applyId; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 网格Id (customer_grid.id) + */ + private String gridId; + + /** + * 申请用户id + */ + private String userId; + + /** + * 热心居民申请理由 (300字) + */ + private String reason; + + /** + * 审核状态 【key:audit_status,value:(under_auditting:待审核,approved:通过,rejected :未通过)】 + */ + private String auditStatus; + + /** + * 拒绝理由 + */ + private String refuseReason; + + /** + * 申请用户头像 + */ + private String userHeadPhoto; + + /** + * 申请用户的显示昵称 + */ + private String userNickName; + + /** + * 阅读标记 未读unread 界面显示红点,已读read不显示红点 + */ + private String readFlag; + + /** + * 消息通知内容 + */ + private String messageText; + + /** + * 热心居民申请行为记录表Id (resi_warmhearted_visit.id) + */ + private String resiWarmVisitId; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * 街道 + */ + private String street; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmheartedAuditedResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmheartedAuditedResultDTO.java new file mode 100644 index 0000000000..7b8a147be8 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmheartedAuditedResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.resi.partymember.dto.warmhearted.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author zhaoqifeng + * @dscription 热心居民-审核历史返回值 + * @date 2020/4/16 13:52 + */ +@Data +public class ResiWarmheartedAuditedResultDTO implements Serializable { + private static final long serialVersionUID = 4109086860497055842L; + /** + * 申请单id + */ + private String applyId; + /** + * 申请用户id + */ + private String userId; + /** + * 申请用户头像 + */ + private String userHeadPhoto; + /** + * 申请用户显示昵称 + */ + private String userNickName; + /** + * 申请时间HH:mm + */ + private Date applyTime; + /** + * 已驳回rejected ,已通过approved + */ + private String status; + /** + * 消息通知内容 + */ + private String messageText; + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml b/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml index 19c370d73f..c0884953e7 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-partymember-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-partymember-server:0.3.1 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 1b3efe725e..fe38df5cae 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet resi-partymember @@ -81,6 +81,18 @@ RELEASE compile + + com.epmet + epmet-message-client + 2.0.0 + compile + + + com.epmet + gov-org-client + 2.0.0 + compile + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java index 106ea6c7fa..d73c5178bc 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java @@ -97,15 +97,25 @@ public interface PartyMemberConstant { String UNDER_AUDITTING = "under_auditting"; /** - * 审核状态 通过 + * 审核状态 通过 approved:人工审核通过, */ String APPROVED = "approved"; /** - * 审核状态 未通过 + * 审核状态 未通过rejected :拒绝 */ String REJECTED = "rejected"; + /** + * 自动认证成功 + */ + String AUTO_CONFIRM_SUCCESS="auto_confirm_success"; + + /** + * 自动认证失败 + */ + String AUTO_CONFIRM_FAILED="auto_confirm_failed"; + /** * 网格ID */ diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java index b39f6bbea2..50b8cf9bb5 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java @@ -2,10 +2,13 @@ package com.epmet.modules.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.modules.feign.fallback.EpmetMessageFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; /** * @author kamui @@ -21,4 +24,13 @@ public interface EpmetMessageFeignClient { @GetMapping(value = "message/sms/captcha/{mobile}") Result sendSmsCaptcha(@PathVariable String mobile); + /** + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 新增未读消息 + **/ + @PostMapping(value = "message/usermessage/saveusermessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveUserMessage(UserMessageFormDTO formDto); + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java index 30cb07eb4b..6f15d6b399 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java @@ -5,12 +5,15 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserRoleDTO; import com.epmet.dto.form.UserResiInfoFormDTO; +import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.feign.fallback.EpmetUserFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import java.util.List; + /** * @author zhaoqifeng * @dscription @@ -21,6 +24,7 @@ public interface EpmetUserFeignClient { /** * 查询用户注册信息 + * * @param userResiInfoFormDTO 参数 * @return Result */ @@ -29,11 +33,12 @@ public interface EpmetUserFeignClient { /** * 党员认证时,如果没有注册居民,则注册居民信息 + * * @param userResiInfoDTO * @author zhaoqifeng **/ @PostMapping("/epmetuser/userresiinfo/saveResiInfo") - Result saveResiInfo (@RequestBody UserResiInfoDTO userResiInfoDTO); + Result saveResiInfo(@RequestBody UserResiInfoDTO userResiInfoDTO); /** * 添加用户角色关系 @@ -44,4 +49,14 @@ public interface EpmetUserFeignClient { @PostMapping("/epmetuser/userrole/saveUserRole") Result saveUserRole(@RequestBody UserRoleDTO userRoleDTO); + /** + * 根据userId集合查询用户注册信息 + * + * @param userResiInfoListFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Date 2020/4/7 18:24 + **/ + @PostMapping("/epmetuser/userresiinfo/getuserresiinfolist") + Result> getUserResiInfoList(@RequestBody UserResiInfoListFormDTO userResiInfoListFormDTO); + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java new file mode 100644 index 0000000000..632ef902ed --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java @@ -0,0 +1,42 @@ +package com.epmet.modules.feign; + + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.modules.feign.fallback.GovOrgFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + + +/** + * @Description Feign调用gov-org-server模块 + * @ClassName GovOrgFeginFallBack + * @Author sun + */ +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) +public interface GovOrgFeignClient { + + /** + * 根据网格Id查询网格信息 + * @param customerGridFormDTO + * @return + */ + @PostMapping("/gov/org/customergrid/getcustomergridbygridid") + Result getCustomerGridByGridId(@RequestBody CustomerGridFormDTO customerGridFormDTO); + + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 23:16 + **/ + @GetMapping("/gov/org/customergrid/getGridInfo/{gridId}") + Result queryGridInfo(@PathVariable("gridId") String gridId); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java index e87f27e4d3..f588f55781 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java @@ -3,6 +3,7 @@ package com.epmet.modules.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.modules.feign.EpmetMessageFeignClient; import org.springframework.stereotype.Component; @@ -18,4 +19,9 @@ public class EpmetMessageFeignClientFallback implements EpmetMessageFeignClient return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendSmsCaptcha", mobile); } + @Override + public Result saveUserMessage(UserMessageFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessage", formDto); + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java index 93e9d3cf20..1203bc053d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java @@ -6,10 +6,13 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserRoleDTO; import com.epmet.dto.form.UserResiInfoFormDTO; +import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * @author zhaoqifeng * @dscription @@ -31,4 +34,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result saveUserRole(UserRoleDTO userRoleDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveUserRole", userRoleDTO); } + + @Override + public Result> getUserResiInfoList(UserResiInfoListFormDTO userResiInfoListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserResiInfoList", userResiInfoListFormDTO); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java new file mode 100644 index 0000000000..c9d63ef62d --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java @@ -0,0 +1,34 @@ +package com.epmet.modules.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.modules.feign.GovOrgFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Description Feign + * @ClassName GovOrgFeginFallBack + * @Author sun + */ +@Component +public class GovOrgFeignClientFallBack implements GovOrgFeignClient { + + /** + * 根据网格Id查询网格信息 + * @param customerGridFormDTO + * @return + */ + @Override + public Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerGridByGridId",customerGridFormDTO); + } + + @Override + public Result queryGridInfo(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo",gridId); + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java index 9aecbeedfd..ac20a61f89 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java @@ -28,10 +28,15 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.modules.partymember.excel.PartymemberBaseInfoExcel; import com.epmet.modules.partymember.service.PartymemberBaseInfoService; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -91,4 +96,27 @@ public class PartymemberBaseInfoController { ExcelUtils.exportExcelToTarget(response, null, list, PartymemberBaseInfoExcel.class); } + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表 + * @Date 2020/4/26 20:35 + **/ + @PostMapping("auditing") + public Result> auditing(@RequestBody @Valid UnderReviewParyMemberFormDTO formDTO){ + return partymemberBaseInfoService.auditing(formDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 政府端(小程序端)查询审核历史 + * @Date 2020/4/26 23:40 + **/ + @PostMapping("audited") + public Result> audited(@RequestBody @Valid ReviewedParyMemberFormDTO formDTO){ + return partymemberBaseInfoService.audited(formDTO); + } } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java index 7a879e4072..6c614045fb 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java @@ -20,6 +20,10 @@ package com.epmet.modules.partymember.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -57,4 +61,21 @@ public interface PartymemberBaseInfoDao extends BaseDao selectBaseInfoByName(PartymemberInfoDTO param); + /** + * @param formDTO + * @return java.util.List + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表-根据网格id分页查询待审核党员列表 + * @Date 2020/4/26 20:43 + **/ + List selectListUnderReviewParyMember(UnderReviewParyMemberFormDTO formDTO); + + /** + * @param formDTO + * @return java.util.List + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表-根据网格id分页查询待审核党员列表 自动审核失败且未填写补充信息的+拒绝的 + * @Date 2020/4/26 23:43 + **/ + List selectListReviewedParyMember(ReviewedParyMemberFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java index f9b379a912..e317427c92 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java @@ -19,16 +19,21 @@ package com.epmet.modules.partymember.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import java.util.List; import java.util.Map; /** - * 党员库基本信息表 + * 党员库基本信息表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-30 @@ -97,8 +102,27 @@ public interface PartymemberBaseInfoService extends BaseService> + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表 + * @Date 2020/4/26 20:36 + **/ + Result> auditing(UnderReviewParyMemberFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 政府端(小程序端)查询审核历史 + * @Date 2020/4/26 23:40 + **/ + Result> audited(ReviewedParyMemberFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 54e7dc19f4..28959478c1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -153,7 +153,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService PartymemberInfoEntity partyMemberInfoEntity = ConvertUtils.sourceToTarget(partyMemberInfoDTO, PartymemberInfoEntity.class); - if (confirmAutoDTO == null || (confirmAutoDTO.getResult().compareTo(PartyMemberConstant.BENCHMARK) < 0 && !confirmAutoDTO.getComparisonResults())) { + if (confirmAutoDTO == null || !confirmAutoDTO.getComparisonResults()) { //将访问记录更新到热心居民申请行为记录表 saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, PartyMemberConstant.OPERATE_AUTO_FAILED); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java index 2f8e281b68..72455af8c3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java @@ -21,9 +21,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyMemberConstant; +import com.epmet.dto.form.UserResiInfoListFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.partymember.dao.PartymemberBaseInfoDao; import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.modules.partymember.redis.PartymemberBaseInfoRedis; @@ -31,6 +38,10 @@ import com.epmet.modules.partymember.service.PartymemberBaseInfoService; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import info.debatty.java.stringsimilarity.Levenshtein; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; @@ -39,7 +50,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; -import java.util.stream.Collectors; + +import static java.util.stream.Collectors.toList; /** * 党员库基本信息表 @@ -52,6 +64,10 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl 0) { //优先判断身份证和手机号 - Optional matchingResult = - idCardList.stream().filter(baseInfo -> baseInfo.getMobile().equals(partyMemberInfo.getMobile())).findFirst(); - - if (matchingResult.isPresent()) { - confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true); - return confirmAutoDTO; + List matchingList = idCardList.stream().filter(baseInfo -> + baseInfo.getMobile().equals(partyMemberInfo.getMobile())).collect(toList()); + + if (matchingList.size() > 0) { + //姓名匹配度是01(含)以上 + List nameMatchingList = idCardList.stream().filter(baseInfo -> + getOneSimilarity(baseInfo.getName(), name, + PartyMemberConstant.NAME_SMALL)).collect(toList()); + if (nameMatchingList.size() > 0) { + //获取匹配度最高的一条 + PartymemberBaseInfoEntity baseInfoEntity = + nameMatchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> + getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0); + confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true); + return confirmAutoDTO; + } } //判断身份证和姓名 - matchingResult = idCardList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).findFirst(); - - if (matchingResult.isPresent()) { - confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true); + matchingList = idCardList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).collect(toList()); + + if (matchingList.size() > 0) { + //手机号匹配度是01(含)以上 + List mobileMatchingList = idCardList.stream().filter(baseInfo -> + getOneSimilarity(baseInfo.getMobile(), partyMemberInfo.getMobile(), + PartyMemberConstant.MOBILE_SMALL)).collect(toList()); + if (mobileMatchingList.size() > 0) { + //获取匹配度最高的一条 + PartymemberBaseInfoEntity baseInfoEntity = + mobileMatchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> + getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0); + confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true); + return confirmAutoDTO; + } + } + //有一项是11的情况下,另外两项需要是10(含)以上,可以认证通过; + matchingList = idCardList.stream().filter(baseInfo -> + getOneSimilarity(baseInfo.getMobile(), partyMemberInfo.getMobile(), + PartyMemberConstant.MOBILE_MOST) && getOneSimilarity(baseInfo.getName(), + name, PartyMemberConstant.NAME_MOST)).collect(toList()); + + if (matchingList.size() > 0) { + //获取匹配度最高的一条 + PartymemberBaseInfoEntity baseInfoEntity = + matchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> + getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0); + confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true); return confirmAutoDTO; } - //获取匹配度最高的数据 sortList.add(idCardList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> - getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0)); + getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0)); } else { //根据手机号匹配数据 @@ -151,32 +200,63 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl 0) { //判断手机号和姓名 - Optional matchingResult = - mobileList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).findFirst(); - - if (matchingResult.isPresent()) { - confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true); + List matchingList = + mobileList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).collect(toList()); + + if (matchingList.size() > 0) { + //身份证匹配度是01(含)以上 + List idCardMatchingList = mobileList.stream().filter(baseInfo -> + getOneSimilarity(baseInfo.getIdCard(), partyMemberInfo.getIdCard(), + PartyMemberConstant.ID_SMALL)).collect(toList()); + if (idCardMatchingList.size() > 0) { + //获取匹配度最高的一条 + PartymemberBaseInfoEntity baseInfoEntity = + idCardMatchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> + getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0); + confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true); + return confirmAutoDTO; + } + } + //有一项是11的情况下,另外两项需要是10(含)以上,可以认证通过; + matchingList = mobileList.stream().filter(baseInfo -> + getOneSimilarity(baseInfo.getIdCard(), partyMemberInfo.getIdCard(), + PartyMemberConstant.ID_MOST) && getOneSimilarity(baseInfo.getName(), + name, PartyMemberConstant.NAME_MOST)).collect(toList()); + + if (matchingList.size() > 0) { + //获取匹配度最高的一条 + PartymemberBaseInfoEntity baseInfoEntity = + matchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> + getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0); + confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true); return confirmAutoDTO; } - //获取匹配度最高的数据 sortList.add(mobileList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> - getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0)); + getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0)); } else { //根据姓名匹配数据 List nameList = baseDao.selectBaseInfoByName(partyMemberInfo); if (null != nameList && nameList.size() > 0) { + //有一项是11的情况下,另外两项需要是10(含)以上,可以认证通过; + List matchingList = nameList.stream().filter(baseInfo -> + getOneSimilarity(baseInfo.getIdCard(), partyMemberInfo.getIdCard(), + PartyMemberConstant.ID_MOST) && getOneSimilarity(baseInfo.getMobile(), + partyMemberInfo.getMobile(), PartyMemberConstant.MOBILE_MOST)).collect(toList()); + + if (matchingList.size() > 0) { + //获取匹配度最高的一条 + PartymemberBaseInfoEntity baseInfoEntity = + matchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> + getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0); + confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true); + return confirmAutoDTO; + } + //获取匹配度最高的数据 sortList.add(nameList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> - getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0)); - - PartymemberBaseInfoEntity similar = - nameList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> - getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0); - - confirmAutoDTO = getResult(similar, partyMemberInfo, false); - return confirmAutoDTO; + getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0)); } else { return null; @@ -184,13 +264,94 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl - getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0); + getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0); return getResult(similar, partyMemberInfo, false); } + @Override + public Result> auditing(UnderReviewParyMemberFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + List list = baseDao.selectListUnderReviewParyMember(formDTO); + if (null == list || list.isEmpty()) { + return new Result>().ok(new ArrayList<>()); + } + //查询网格信息 + Result gridInfoResult = govOrgFeignClient.queryGridInfo(formDTO.getGridId()); + String gridFullPath = ""; + if (gridInfoResult.success() && null != gridInfoResult.getData()) { + gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), + gridInfoResult.getData().getCommnuityName(), + gridInfoResult.getData().getGridName()); + gridFullPath = gridFullPath.replaceAll("--", "").trim(); + } + //查询居民认证信息,获取居民头像 + List userIdList = new ArrayList<>(); + for (UnderReviewParyMemberResultDTO underReviewParyMember : list) { + userIdList.add(underReviewParyMember.getUserId()); + underReviewParyMember.setGridFullPath(gridFullPath); + } + UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); + userResiInfoListFormDTO.setUserIdList(userIdList); + Result> userResiInfoResult = epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO); + if (userResiInfoResult.success()) { + for (UnderReviewParyMemberResultDTO underReviewParyMemberInfo : list) { + for (UserResiInfoResultDTO userResiInfo : userResiInfoResult.getData()) { + if (underReviewParyMemberInfo.getUserId().equals(userResiInfo.getUserId())) { + underReviewParyMemberInfo.setUserHeadPhoto(userResiInfo.getHeadPhoto()); + break; + } + } + } + } + return new Result>().ok(list); + } + + + @Override + public Result> audited(ReviewedParyMemberFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + //审核历史:只包括自动审核失败和拒绝的 + //审核失败:居民未填写补充信息。 + List list = baseDao.selectListReviewedParyMember(formDTO); + if (null == list || list.isEmpty()) { + return new Result>().ok(new ArrayList<>()); + } + //查询网格信息 + Result gridInfoResult = govOrgFeignClient.queryGridInfo(formDTO.getGridId()); + String gridFullPath = ""; + if (gridInfoResult.success() && null != gridInfoResult.getData()) { + gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), + gridInfoResult.getData().getCommnuityName(), + gridInfoResult.getData().getGridName()); + gridFullPath = gridFullPath.replaceAll("--", "").trim(); + } + //查询居民认证信息,获取居民头像 + List userIdList = new ArrayList<>(); + for (ReviewedParyMemberResultDTO reviewedParyMemberResultDTO : list) { + userIdList.add(reviewedParyMemberResultDTO.getUserId()); + reviewedParyMemberResultDTO.setGridFullPath(gridFullPath); + } + UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); + userResiInfoListFormDTO.setUserIdList(userIdList); + Result> userResiInfoResult = epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO); + if (userResiInfoResult.success()) { + for (ReviewedParyMemberResultDTO reviewedParyMember : list) { + for (UserResiInfoResultDTO userResiInfo : userResiInfoResult.getData()) { + if (reviewedParyMember.getUserId().equals(userResiInfo.getUserId())) { + reviewedParyMember.setUserHeadPhoto(userResiInfo.getHeadPhoto()); + break; + } + } + } + } + return new Result>().ok(list); + } + /** * 生成返回结果 @@ -274,4 +435,15 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl> page(@RequestParam Map params) { - PageData page = resiWarmheartedApplyService.page(params); - return new Result>().ok(page); - } - - @GetMapping("{id}") - public Result get(@PathVariable("id") String id) { - ResiWarmheartedApplyDTO data = resiWarmheartedApplyService.get(id); - return new Result().ok(data); - } - - @PostMapping - public Result save(@RequestBody ResiWarmheartedApplyDTO dto) { - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - resiWarmheartedApplyService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody ResiWarmheartedApplyDTO dto) { - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - resiWarmheartedApplyService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids) { - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - resiWarmheartedApplyService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = resiWarmheartedApplyService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, ResiWarmheartedApplyExcel.class); - } - - @PostMapping("init") - public Result init(@RequestBody ResiWarmheartedFormDTO formDTO) { - return resiWarmheartedApplyService.init(formDTO); - } - - @PostMapping("submit") - public Result submit(@RequestBody ResiWarmheartedSubmitFormDTO formDTO) { - return resiWarmheartedApplyService.submit(formDTO); - } - - @PostMapping("manageaudit") - public Result manageAudit(@RequestBody ResiWarmheartedAuditFormDTO formDTO) { - return resiWarmheartedApplyService.manageAudit(formDTO); - } + @Autowired + private ResiWarmheartedApplyService resiWarmheartedApplyService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = resiWarmheartedApplyService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + ResiWarmheartedApplyDTO data = resiWarmheartedApplyService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ResiWarmheartedApplyDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + resiWarmheartedApplyService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ResiWarmheartedApplyDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + resiWarmheartedApplyService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + resiWarmheartedApplyService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = resiWarmheartedApplyService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ResiWarmheartedApplyExcel.class); + } + + @PostMapping("init") + public Result init(@RequestBody ResiWarmheartedFormDTO formDTO) { + return resiWarmheartedApplyService.init(formDTO); + } + + @PostMapping("submit") + public Result submit(@RequestBody ResiWarmheartedSubmitFormDTO formDTO) { + return resiWarmheartedApplyService.submit(formDTO); + } + + /** + * 热心居民审核历史列表 + * + * @param formDTO 参数 + * @return + */ + @PostMapping("audited") + public Result> audited(@RequestBody ResiWarmheartedAuditedFromDTO formDTO) { + return resiWarmheartedApplyService.audited(formDTO); + } + + /** + * @param + * @Author sun + * @Description 政府端-获取待审核的热心居民申请列表 + **/ + @PostMapping("auditing") + public Result> auditing(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiWarmheartedApplyService.auditing(formDTO); + } + + /** + * @param + * @Author sun + * @Description 政府端-热心居民申请-审核通过 + **/ + @PostMapping("approve") + public Result approve(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditApproveFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiWarmheartedApplyService.approve(formDTO); + } + + /** + * @param + * @Author sun + * @Description 政府端-热心居民申请-审核驳回 + **/ + @PostMapping("reject") + public Result reject(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditRejectFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiWarmheartedApplyService.reject(formDTO); + } + + /** + * @param + * @Author sun + * @Description 政府端-热心居民申请详情信息 + **/ + @PostMapping("getdetail") + public Result getDetail(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmGetDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiWarmheartedApplyService.getDetail(formDTO); + } } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java index 843eac1b54..5467173db1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java @@ -18,12 +18,16 @@ package com.epmet.modules.warmhearted.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.commons.tools.utils.Result; import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; +import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmAuditFormDTO; +import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditedFromDTO; import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 热心居民申请表 * @@ -40,4 +44,12 @@ public interface ResiWarmheartedApplyDao extends BaseDao selectAuditedApplyList(ResiWarmheartedAuditedFromDTO params); + + /** + * 查询待审核状态的热心居民申请 + * @param formDTO + * @return + */ + List selectResiWarmAuditList(ResiWarmAuditFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/entity/ResiWarmheartedApplyEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/entity/ResiWarmheartedApplyEntity.java index 6c5545dabf..4df8b1c43c 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/entity/ResiWarmheartedApplyEntity.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/entity/ResiWarmheartedApplyEntity.java @@ -68,6 +68,16 @@ public class ResiWarmheartedApplyEntity extends BaseEpmetEntity { */ private String refuseReason; + /** + * 审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点) + */ + private String readFlag; + + /** + * 消息通知内容 + */ + private String messageText; + /** * 热心居民申请行为记录表Id (resi_warmhearted_visit.id) */ diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/excel/ResiWarmheartedApplyExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/excel/ResiWarmheartedApplyExcel.java index cee8444ca4..f04c5afcaa 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/excel/ResiWarmheartedApplyExcel.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/excel/ResiWarmheartedApplyExcel.java @@ -52,6 +52,12 @@ public class ResiWarmheartedApplyExcel { @Excel(name = "拒绝理由") private String refuseReason; + @Excel(name = "阅读标记") + private String readFlag; + + @Excel(name = "消息通知内容") + private String messageText; + @Excel(name = "热心居民申请行为记录表Id (resi_warmhearted_visit.id)") private String resiWarmVisitId; diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java index 87fb3ffd31..0fba6e16ff 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java @@ -22,9 +22,9 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; -import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO; -import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; -import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO; +import com.epmet.resi.partymember.dto.warmhearted.form.*; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; import java.util.List; @@ -117,11 +117,45 @@ public interface ResiWarmheartedApplyService extends BaseService> audited(ResiWarmheartedAuditedFromDTO formDTO); + + /** + * 政府端-获取待审核的热心居民申请列表 + * + * @param + * @return void + * @author sun + */ + Result> auditing(ResiWarmAuditFormDTO formDTO); + + /** + * 政府端-热心居民申请-审核通过 + * + * @param + * @return void + * @author sun + */ + Result approve(ResiWarmAuditApproveFormDTO formDTO); + + /** + * 政府端-热心居民申请-审核驳回 + * + * @param + * @return void + * @author sun + */ + Result reject(ResiWarmAuditRejectFormDTO formDTO); + + /** + * 政府端-热心居民申请详情信息 * * @param * @return void * @author sun */ - Result manageAudit(ResiWarmheartedAuditFormDTO formDTO); + Result getDetail(ResiWarmGetDetailFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java index cae8a76100..b78ffa53eb 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java @@ -19,7 +19,6 @@ package com.epmet.modules.warmhearted.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; @@ -31,11 +30,18 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyMemberConstant; +import com.epmet.constant.ReadFlagConstant; +import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.UserRoleDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.UserResiInfoFormDTO; +import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.modules.feign.EpmetMessageFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; -import com.epmet.modules.utils.ModuleConstant; +import com.epmet.modules.feign.GovOrgFeignClient; +import com.epmet.modules.warmhearted.constant.ResiWarmUserMessageConstant; import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant; import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao; import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; @@ -43,22 +49,22 @@ import com.epmet.modules.warmhearted.redis.ResiWarmheartedApplyRedis; import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService; import com.epmet.modules.warmhearted.service.ResiWarmheartedVisitService; import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; -import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO; -import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; -import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO; +import com.epmet.resi.partymember.dto.warmhearted.form.*; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; -import java.util.Date; import java.util.List; import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.stream.Collectors; /** * 热心居民申请表 @@ -69,174 +75,391 @@ import org.slf4j.LoggerFactory; @Service public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl implements ResiWarmheartedApplyService { - private static final Logger logger = LoggerFactory.getLogger(ResiWarmheartedApplyServiceImpl.class); - @Autowired - private ResiWarmheartedApplyRedis resiWarmheartedApplyRedis; - @Autowired - private ResiWarmheartedVisitService resiWarmheartedVisitService; - @Autowired - private ResiWarmheartedApplyDao resiWarmheartedApplyDao; - @Autowired - private EpmetUserFeignClient epmetUserFeignClient; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, ResiWarmheartedApplyDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, ResiWarmheartedApplyDTO.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 ResiWarmheartedApplyDTO get(String id) { - ResiWarmheartedApplyEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, ResiWarmheartedApplyDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(ResiWarmheartedApplyDTO dto) { - ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ResiWarmheartedApplyDTO dto) { - ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result init(ResiWarmheartedFormDTO formDTO) { - Result result = new Result(); - //0:先判断该用户是否是已注册居民 - UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); - userResiInfoFormDTO.setCustomerId(formDTO.getCustomerId()); - userResiInfoFormDTO.setUserId(formDTO.getUserId()); - Result result1 = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); - if (!result1.success() || null == result1.getData()) { - result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); - result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg()); - return result; - } - //1:热心居民申请行为记录表新增数据 - result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO); - if (!result.success()) { - logger.error(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION); - } - ResiWarmheartedResultDTO resiWarmheartedResultDTO = result.getData(); - //2:查询是否已申请热心居民(不查询审核未通过的) - formDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED); - ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(formDTO); - if (null == resiWarmheartedApplyDTO || StringUtils.isEmpty(resiWarmheartedApplyDTO.getId())) { - //是否已申请热心居民 0:否, 1:是 - resiWarmheartedResultDTO.setIsApplied(NumConstant.ZERO_STR); - } else { - resiWarmheartedResultDTO.setIsApplied(NumConstant.ONE_STR); - result.setCode(NumConstant.ZERO); - result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_INIT); - } - return result.ok(resiWarmheartedResultDTO); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result submit(ResiWarmheartedSubmitFormDTO formDTO) { - Result result = new Result(); - //0:为防止前台点击多次提交 先查询一下是否有已提交数据 - ResiWarmheartedFormDTO ResiWarmheartedFormDTO = ConvertUtils.sourceToTarget(formDTO, ResiWarmheartedFormDTO.class); - ResiWarmheartedFormDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED); - ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(ResiWarmheartedFormDTO); - if (null != resiWarmheartedApplyDTO) { - logger.error(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION); - throw new RenException(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION); - }else{ - //1:将申请记录存入热心居民申请表中 - saveResiWarmApply(formDTO); - //2:将最后一次操作行为更新到热心居民申请行为记录表中 - resiWarmheartedVisitService.updateResiWarmVisit(formDTO); - result.setCode(NumConstant.ZERO); - result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_SUBMIT); - } - return result; - } - - /** - * 热心居民申请表新增数据 - * - * @param formDTO - * @return - */ - public void saveResiWarmApply(ResiWarmheartedSubmitFormDTO formDTO) { - ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity(); - entity.setCustomerId(formDTO.getCustomerId()); - entity.setGridId(formDTO.getGridId()); - entity.setUserId(formDTO.getUserId()); - entity.setReason(formDTO.getReason()); - entity.setResiWarmVisitId(formDTO.getResiWarmVisitId()); - entity.setAuditStatus(ResiWarmheartedVisitConstant.UNDER_AUDITTING); - baseDao.insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result manageAudit(ResiWarmheartedAuditFormDTO formDTO) { - Result result = new Result(); - //1:更新热心居民申请表数据 - ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity(); - entity.setId(formDTO.getResiWarmApplyId()); - if (NumConstant.ZERO_STR.equals(formDTO.getAuditStatus())) { - //审核状态-未通过 - entity.setAuditStatus(PartyMemberConstant.REJECTED); - } else { - //审核状态-通过 - entity.setAuditStatus(PartyMemberConstant.APPROVED); - } - if (!StringUtils.isBlank(formDTO.getRefuseReason())) { - entity.setRefuseReason(formDTO.getRefuseReason()); - } - int num = baseDao.updateById(entity); - //2:审核通过的添加热心居民的角色 - if (num > NumConstant.ZERO && NumConstant.ONE_STR.equals(formDTO.getAuditStatus())) { - //查询需要添加热心居民角色的userId - ResiWarmheartedApplyEntity resiWarmheartedApplyEntity = baseDao.selectById(formDTO.getResiWarmApplyId()); - UserRoleDTO dto = new UserRoleDTO(); - dto.setCustomerId(formDTO.getCustomerId()); - dto.setUserId(resiWarmheartedApplyEntity.getUserId()); - //所属端-居民端 - dto.setApp(AppClientConstant.APP_RESI); - //角色-热心居民 - dto.setRoleKey(EpmetRoleKeyConstant.WARMHEARTED); - //角色表新增网格Id - dto.setGridId(resiWarmheartedApplyEntity.getGridId()); - result = epmetUserFeignClient.saveUserRole(dto); + private static final Logger logger = LoggerFactory.getLogger(ResiWarmheartedApplyServiceImpl.class); + @Autowired + private ResiWarmheartedApplyRedis resiWarmheartedApplyRedis; + @Autowired + private ResiWarmheartedVisitService resiWarmheartedVisitService; + @Autowired + private ResiWarmheartedApplyDao resiWarmheartedApplyDao; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private EpmetMessageFeignClient epmetMessageFeignClient; + @Autowired + private GovOrgFeignClient govOrgFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ResiWarmheartedApplyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ResiWarmheartedApplyDTO.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 ResiWarmheartedApplyDTO get(String id) { + ResiWarmheartedApplyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ResiWarmheartedApplyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ResiWarmheartedApplyDTO dto) { + ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ResiWarmheartedApplyDTO dto) { + ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result init(ResiWarmheartedFormDTO formDTO) { + Result result = new Result(); + //0:先判断该用户是否是已注册居民 + UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); + userResiInfoFormDTO.setCustomerId(formDTO.getCustomerId()); + userResiInfoFormDTO.setUserId(formDTO.getUserId()); + Result result1 = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); + if (!result1.success() || null == result1.getData()) { + result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); + result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg()); + return result; + } + //1:热心居民申请行为记录表新增数据 + result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO); + if (!result.success()) { + logger.error(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION); + } + ResiWarmheartedResultDTO resiWarmheartedResultDTO = result.getData(); + //2:查询是否已申请热心居民(不查询审核未通过的) + formDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED); + ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(formDTO); + if (null == resiWarmheartedApplyDTO || StringUtils.isEmpty(resiWarmheartedApplyDTO.getId())) { + //是否已申请热心居民 0:否, 1:是 + resiWarmheartedResultDTO.setIsApplied(NumConstant.ZERO_STR); + } else { + resiWarmheartedResultDTO.setIsApplied(NumConstant.ONE_STR); + result.setCode(NumConstant.ZERO); + result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_INIT); + } + return result.ok(resiWarmheartedResultDTO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result submit(ResiWarmheartedSubmitFormDTO formDTO) { + Result result = new Result(); + //0:为防止前台点击多次提交 先查询一下是否有已提交数据 + ResiWarmheartedFormDTO ResiWarmheartedFormDTO = ConvertUtils.sourceToTarget(formDTO, ResiWarmheartedFormDTO.class); + ResiWarmheartedFormDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED); + ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(ResiWarmheartedFormDTO); + if (null != resiWarmheartedApplyDTO) { + logger.error(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION); + throw new RenException(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION); + } else { + //0:调用user服务获取申请人的基本信息 + UserResiInfoFormDTO resiInfoParam = new UserResiInfoFormDTO(); + resiInfoParam.setCustomerId(formDTO.getCustomerId()); + resiInfoParam.setUserId(formDTO.getUserId()); + Result resultUserInfo = epmetUserFeignClient.getUserResiInfoDTO(resiInfoParam); + if (!resultUserInfo.success() || null == resultUserInfo.getData()) { + throw new RenException(ResiWarmheartedVisitConstant.SELECT_USERINFO_EXCEPTION); + } + String showName = resultUserInfo.getData().getShowName(); + String messageContent = String.format(ResiWarmUserMessageConstant.RESIWARM_APPLY_MSG, showName); + formDTO.setMessageText(messageContent); + //1:将申请记录存入热心居民申请表中 + saveResiWarmApply(formDTO); + //2:将最后一次操作行为更新到热心居民申请行为记录表中 + resiWarmheartedVisitService.updateResiWarmVisit(formDTO); + //3:添加消息信息,给网格长发消息 + saveResiWarmUserMessage(formDTO); + result.setCode(NumConstant.ZERO); + result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_SUBMIT); + } + return result; + } + /** + * 热心居民申请表新增数据 + * + * @param formDTO + * @return + */ + public void saveResiWarmApply(ResiWarmheartedSubmitFormDTO formDTO) { + ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setGridId(formDTO.getGridId()); + entity.setUserId(formDTO.getUserId()); + entity.setReason(formDTO.getReason()); + entity.setResiWarmVisitId(formDTO.getResiWarmVisitId()); + entity.setAuditStatus(ResiWarmheartedVisitConstant.UNDER_AUDITTING); + entity.setReadFlag(ResiWarmheartedVisitConstant.UN_READ); + entity.setMessageText(formDTO.getMessageText()); + baseDao.insert(entity); + } + /** + * 热心居民申请像网格长发送消息 + * + * @param formDTO + * @return + * @Author sun + */ + private void saveResiWarmUserMessage(ResiWarmheartedSubmitFormDTO formDTO) { + UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); + userMessageFormDTO.setCustomerId(formDTO.getCustomerId()); + userMessageFormDTO.setGridId(formDTO.getGridId()); + //网格长用户Id TODO + //userMessageFormDTO.setUserId(); + userMessageFormDTO.setUserId(formDTO.getUserId());//先在token中取一个默认值 + userMessageFormDTO.setApp(formDTO.getApp()); + userMessageFormDTO.setTitle(ResiWarmUserMessageConstant.GROUP_TITLE); + userMessageFormDTO.setMessageContent(formDTO.getMessageText()); + userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); + //保存消息 + epmetMessageFeignClient.saveUserMessage(userMessageFormDTO); + } + + @Override + public Result> audited(ResiWarmheartedAuditedFromDTO formDTO) { + Result> result = new Result<>(); + List resultList = new ArrayList<>(); + //查询条件 + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + //获取审核列表 + List applyList = baseDao.selectAuditedApplyList(formDTO); + if (null == applyList || applyList.size() == 0) { + return result.ok(resultList); + } + //提取所有userID + List userIds = + applyList.stream().map(ResiWarmheartedApplyEntity::getUserId).collect(Collectors.toList()); + //获取用户昵称,头像 + UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); + userResiInfoListFormDTO.setUserIdList(userIds); + List userResiInfoList = + epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO).getData(); + if (null == userResiInfoList || userResiInfoList.size() == 0) { + return result.ok(resultList); } - return result; - } + resultList = applyList.stream().flatMap(apply -> userResiInfoList.stream().filter(user -> + apply.getUserId().equals(user.getUserId())).map(userInfo -> { + ResiWarmheartedAuditedResultDTO resultDTO = new ResiWarmheartedAuditedResultDTO(); + resultDTO.setApplyId(apply.getId()); + resultDTO.setUserId(apply.getUserId()); + resultDTO.setStatus(apply.getAuditStatus()); + resultDTO.setApplyTime(apply.getUpdatedTime()); + resultDTO.setMessageText(apply.getMessageText()); + resultDTO.setUserNickName(userInfo.getShowName()); + resultDTO.setUserHeadPhoto(userInfo.getHeadPhoto()); + return resultDTO; + })).collect(Collectors.toList()); + + return result.ok(resultList); + } + + /** + * 政府端-获取待审核的热心居民申请列表 + * + * @param + * @return void + * @author sun + */ + @Override + public Result> auditing(ResiWarmAuditFormDTO formDTO) { + Result> result = new Result<>(); + List applyList = new ArrayList<>(); + //1:查询待审核状态的热心居民申请 + formDTO.setAuditStatus(PartyMemberConstant.UNDER_AUDITTING); + formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize()); + applyList = baseDao.selectResiWarmAuditList(formDTO); + if (null == applyList || applyList.size() < NumConstant.ONE) { + return result.ok(applyList); + } + //2:调用epmet-user服务 获取用户头像 昵称 + //遍历获取所有的userId + List userIds = applyList.stream().map(ResiWarmAuditResultDTO::getUserId).collect(Collectors.toList()); + //获取所有用户的头像 昵称 + UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); + userResiInfoListFormDTO.setUserIdList(userIds); + List userResiInfoList = epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO).getData(); + if (null == userResiInfoList || userResiInfoList.size() < NumConstant.ONE) { + return result.ok(applyList); + } + //3:将每个用户的头像 昵称放到对应实体中返回给前台 + List resultList = applyList.stream().flatMap(apply -> userResiInfoList.stream().filter(user -> + apply.getUserId().equals(user.getUserId())).map(userInfo -> { + ResiWarmAuditResultDTO resultDTO = ConvertUtils.sourceToTarget(apply, ResiWarmAuditResultDTO.class); + resultDTO.setUserNickName(null == userInfo.getShowName() ? "" : userInfo.getShowName()); + resultDTO.setUserHeadPhoto(null == userInfo.getHeadPhoto() ? "" : userInfo.getHeadPhoto()); + return resultDTO; + })).collect(Collectors.toList()); + + return result.ok(resultList); + } + + /** + * 政府端-热心居民申请-审核通过 + * + * @param + * @return void + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result approve(ResiWarmAuditApproveFormDTO formDTO) { + Result result = new Result(); + //0:先校验数据是否是未审核状态,防止接口测试调用多次 + ResiWarmheartedApplyEntity entity = baseDao.selectById(formDTO.getApplyId()); + if (null == entity || !ResiWarmheartedVisitConstant.UNDER_AUDITTING.equals(entity.getAuditStatus())) { + result.error(ResiWarmheartedVisitConstant.AUDIT_EXCEPTION); + return result; + } + //1:更新热心居民申请表数据 + //审核状态-通过 + entity.setAuditStatus(PartyMemberConstant.APPROVED); + int num = baseDao.updateById(entity); + //2:审核通过的添加热心居民的角色 + if (num < NumConstant.ONE) { + result.error(ResiWarmheartedVisitConstant.UPDATE_EXCEPTION); + return result; + } + //查询需要添加热心居民角色的userId + UserRoleDTO dto = new UserRoleDTO(); + dto.setCustomerId(entity.getCustomerId()); + dto.setUserId(entity.getUserId()); + //所属端-居民端 + dto.setApp(AppClientConstant.APP_RESI); + //角色-热心居民 + dto.setRoleKey(EpmetRoleKeyConstant.WARMHEARTED); + //角色表新增网格Id + dto.setGridId(entity.getGridId()); + result = epmetUserFeignClient.saveUserRole(dto); + //3:为申请人发送审核通过消息提示 + result = auditMessage(entity, ResiWarmUserMessageConstant.AUDIT_APPROVE_MSG); + return result; + } + /** + * 热心居民申请审核通过向申请人发送消息 + * @Author sun + * @param formDTO + * @param userMsg 消息模板 + */ + private Result auditMessage(ResiWarmheartedApplyEntity formDTO, String userMsg) { + UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); + userMessageFormDTO.setCustomerId(formDTO.getCustomerId()); + userMessageFormDTO.setGridId(formDTO.getGridId()); + userMessageFormDTO.setUserId(formDTO.getUserId()); + userMessageFormDTO.setApp(AppClientConstant.APP_RESI); + userMessageFormDTO.setTitle(ResiWarmUserMessageConstant.GROUP_TITLE); + //调用gov-org服务查询网格信息 + CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(formDTO.getGridId()); + Result result = govOrgFeignClient.getCustomerGridByGridId(customerGridFormDTO); + String gridName = null; + if (result.success() && null != result.getData()) { + gridName = result.getData().getGridName(); + } + String messageContent = String.format(userMsg, gridName); + userMessageFormDTO.setMessageContent(messageContent); + userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); + //保存消息 + return epmetMessageFeignClient.saveUserMessage(userMessageFormDTO); + } + /** + * 政府端-热心居民申请-审核驳回 + * + * @param + * @return void + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result reject(ResiWarmAuditRejectFormDTO formDTO) { + Result result = new Result(); + //0:先校验数据是否是未审核状态,防止接口测试调用多次 + ResiWarmheartedApplyEntity entity = baseDao.selectById(formDTO.getApplyId()); + if (null == entity || !ResiWarmheartedVisitConstant.UNDER_AUDITTING.equals(entity.getAuditStatus())) { + result.error(ResiWarmheartedVisitConstant.AUDIT_EXCEPTION); + return result; + } + //1:更新热心居民申请表数据 + //审核状态-未通过 + entity.setAuditStatus(PartyMemberConstant.REJECTED); + entity.setRefuseReason(formDTO.getRefuseReason()); + baseDao.updateById(entity); + //2:为申请人发送审核驳回消息提示 + //查询申请信息 + auditMessage(entity, ResiWarmUserMessageConstant.AUDIT_REJECT_MSG); + return result; + } + + /** + * 政府端-热心居民申请详情信息 + * + * @param + * @return void + * @author sun + */ + @Override + public Result getDetail(ResiWarmGetDetailFormDTO formDTO) { + Result result = new Result<>(); + //1:根据申请Id查询热心居民申请审核详情 + ResiWarmheartedApplyEntity entity = baseDao.selectById(formDTO.getApplyId()); + if (null == entity) { + result.error(ResiWarmheartedVisitConstant.SELECT_EXCEPTION); + return result; + } + //2:修改申请数据状态为已读 + if(!ResiWarmheartedVisitConstant.READ.equals(entity.getReadFlag())){ + entity.setReadFlag(ResiWarmheartedVisitConstant.READ); + baseDao.updateById(entity); + } + //3:调用epmet-user服务查询用户头像 昵称信息 + UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); + userResiInfoFormDTO.setCustomerId(entity.getCustomerId()); + userResiInfoFormDTO.setUserId(entity.getUserId()); + Result resultUserInfo = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); + if (!resultUserInfo.success() || null == resultUserInfo.getData()) { + result.error(ResiWarmheartedVisitConstant.SELECT_EXCEPTION); + return result; + } + UserResiInfoResultDTO userInfo = resultUserInfo.getData(); + ResiWarmAuditResultDTO resultDTO = ConvertUtils.sourceToTarget(entity, ResiWarmAuditResultDTO.class); + resultDTO.setApplyTime(entity.getUpdatedTime()); + resultDTO.setUserNickName(null == userInfo.getShowName() ? "" : userInfo.getShowName()); + resultDTO.setUserHeadPhoto(null == userInfo.getHeadPhoto() ? "" : userInfo.getHeadPhoto()); + resultDTO.setStreet(userInfo.getStreet()); + return result.ok(resultDTO); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml index eb61f263ec..2f4819d69b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml @@ -54,5 +54,58 @@ AND DEL_FLAG = 0 + + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml index ba8099f0fb..7056d086e8 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml @@ -56,6 +56,48 @@ AND rw.audit_status != #{auditStatus} + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql new file mode 100644 index 0000000000..ae2431928e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql @@ -0,0 +1,9 @@ +#epmet_resi_partymember数据库-热心居民申请表新增字段 +ALTER TABLE resi_warmhearted_apply ADD ( + READ_FLAG VARCHAR (255) DEFAULT NULL COMMENT '审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)', + MESSAGE_TEXT VARCHAR (500) DEFAULT NULL COMMENT '消息通知内容' +); +-- 修改党员认证结果2020-04-26 +alter table partymember_info modify column CONFIRM_RESULT varchar(20) COMMENT '认证结果:auto_confirm_success:自动认证成功,auto_confirm_failed:自动认证失败,approved:人工审核通过,rejected :拒绝)'; +-- 添加已读未读标志 +ALTER TABLE partymember_confirm_manual ADD ( READ_FLAG VARCHAR ( 20 ) COMMENT '审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)' ); \ No newline at end of file diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index c5fd005922..c53cf90100 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.4 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 761a0299a9..dc93c476d5 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.4 com.epmet epmet-user diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 8af4a38647..37d59a6225 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -263,7 +263,7 @@ public class CustomerStaffController { * @Description 根据客户Id及userId集合查询用户基本信息 */ @PostMapping("getdepartmentstafflist") - public Result> getDepartmentStaffList(DepartmentInStaffFormDTO fromDTO) { + public Result> getDepartmentStaffList(@RequestBody DepartmentInStaffFormDTO fromDTO) { return customerStaffService.getDepartmentStaffList(fromDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 42a85a7111..85dae3de67 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; @@ -25,6 +26,7 @@ import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.springframework.context.annotation.Scope; import java.util.List; @@ -42,7 +44,8 @@ public interface StaffRoleDao extends BaseDao { * @param orgId * @return */ - List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); + List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId, + @Param("dataScope") DataScope dataScope); /** * 删除工作人员权限 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index acbb5833f7..1f518e6910 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping; * @Author sun * @Date 2020/3/16 */ +//, url = "localhost:8092" @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) public interface GovOrgFeignClient { 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 3defd336ac..e2f315d22f 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 @@ -172,6 +172,7 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(UserCustomerConstant.CUSTOMER_ID,enterGridFormDTO.getCustomerId()); wrapper.eq(UserCustomerConstant.USER_ID,enterGridFormDTO.getUserId()); + wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); //1.查找用户注册关系表,如果没有表示当前用户为陌生人(拉取用户微信表信息),如果有表示当前用户已经进行居民认证 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 30af740a8b..15b5b1c311 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -114,9 +114,9 @@ public class StaffRoleServiceImpl extends BaseServiceImpl listStaffsInRole(String roleKey, String orgId, DataScope dataScope) { - return baseDao.listStaffIdsByRoleKeyAndOrgId(roleKey, orgId); + return baseDao.listStaffIdsByRoleKeyAndOrgId(roleKey, orgId, dataScope); } @Override