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 78b2ba49e0..47f1b391db 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 @@ -409,87 +409,4 @@ public class DataFilterAspect { } return scopeStrs; } - - /** - * 模拟范围数据 - * - * @return - */ - private Set genScopeDtos() { - OperationScopeDTO scopeDTO1 = new OperationScopeDTO(); - scopeDTO1.setScopeKey("org_curr"); - scopeDTO1.setScopeName("本机关"); - scopeDTO1.setScopeIndex("ac_0"); - - OperationScopeDTO scopeDTO2 = new OperationScopeDTO(); - scopeDTO2.setScopeKey("org_curr_and_sub"); - scopeDTO2.setScopeName("本机关及下级"); - scopeDTO2.setScopeIndex("ac_501"); - - OperationScopeDTO scopeDTO3 = new OperationScopeDTO(); - scopeDTO3.setScopeKey("org_curr_sub"); - scopeDTO3.setScopeName("本机关的下级"); - scopeDTO3.setScopeIndex("ac_502"); - - OperationScopeDTO scopeDTO4 = new OperationScopeDTO(); - scopeDTO4.setScopeKey("org_equal_and_sub"); - scopeDTO4.setScopeName("同级机关及下级"); - scopeDTO4.setScopeIndex("ae_601"); - - OperationScopeDTO scopeDTO5 = new OperationScopeDTO(); - scopeDTO5.setScopeKey("org_equal_sub"); - scopeDTO5.setScopeName("同级机关的下级"); - scopeDTO5.setScopeIndex("ae_602"); - - Set scopeDTOS = new HashSet<>(); - scopeDTOS.add(scopeDTO1); - scopeDTOS.add(scopeDTO2); - scopeDTOS.add(scopeDTO3); - scopeDTOS.add(scopeDTO4); - scopeDTOS.add(scopeDTO5); - return scopeDTOS; - } - - ///** - // * 获取数据过滤的SQL - // */ - //@Deprecated - //private String getSqlFilter(UserDetail user, JoinPoint point){ - // MethodSignature signature = (MethodSignature) point.getSignature(); - // DataFilter dataFilter = signature.getMethod().getAnnotation(DataFilter.class); - // //获取表的别名 - // String tableAlias = dataFilter.tableAlias(); - // if(StringUtils.isNotBlank(tableAlias)){ - // tableAlias += "."; - // } - // - // StringBuilder sqlFilter = new StringBuilder(); - // - // //查询条件前缀 - // String prefix = dataFilter.prefix(); - // if(StringUtils.isNotBlank(prefix)){ - // sqlFilter.append(" ").append(prefix); - // } - // - // sqlFilter.append(" ("); - // - // //部门ID列表 - // List deptIdList = user.getDeptIdList(); - // if(CollUtil.isNotEmpty(deptIdList)){ - // sqlFilter.append(tableAlias).append(dataFilter.deptId()); - // - // sqlFilter.append(" in(").append(StringUtils.join(deptIdList, ",")).append(")"); - // } - // - // //查询本人数据 - // if (dataFilter.isPendingCreator()) { - // if(CollUtil.isNotEmpty(deptIdList)){ - // sqlFilter.append(" or "); - // } - // sqlFilter.append(tableAlias).append(dataFilter.userId()).append("=").append(user.getId()); - // } - // sqlFilter.append(")"); - // - // return sqlFilter.toString(); - //} } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/OpeScopeConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/OpeScopeConstant.java index 9d11c7d3b3..f2c29f7238 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/OpeScopeConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/OpeScopeConstant.java @@ -1,6 +1,10 @@ package com.epmet.commons.tools.constant; public class OpeScopeConstant { + + // 权限覆盖所有范围 + public static final String ORG_ALL = "org_all"; + //"同级组织的下级" public static final String ORG_EQUAL_SUB = "org_equal_sub"; //"同级组织及下级" diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendMsgResi2GovFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendMsgResi2GovFormDTO.java new file mode 100644 index 0000000000..3ea73a34b5 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendMsgResi2GovFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 居民端的行为触发发送消息给政府端的入参 + * @Author yinzuomei + * @Date 2020/4/19 20:54 + */ +@Data +public class SendMsgResi2GovFormDTO implements Serializable { + private static final long serialVersionUID = -1844010483732604630L; + + /** + * 发送人Id resiUser的Id + * */ + private String from; + + /** + * 角色key + * */ + private String roleKey; + + /** + * 消息内容 + * */ + private String msg; + + /** + * 组织Id 可能是agencyId、deptId、gridId + * */ + private String institutionId; + + /** + * 组织标识 1:agency 2:department 3:grid + * */ + private String institutionFlag; + + /** + *客户Id + */ + private String customerId; + + /** + * 等级 1:当前组织下 2:所属机构(agency)下 + * 当institutionFlag为1时,permissionLevel默认为1 + * */ + private String permissionLevel; +} 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 4acd697b6a..d857148255 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.2 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-message-server:0.3.3 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 46bb33b442..c010cc11c2 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.2 + 0.3.3 com.epmet epmet-message diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java index ca08d47299..ebb6141067 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java @@ -24,7 +24,6 @@ import com.epmet.dto.UserMessageDTO; import com.epmet.dto.form.MymessageFormDTO; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.entity.UserMessageEntity; - import java.util.List; import java.util.Map; diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java index e5f3a2ba9e..1e5cc4e52e 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java @@ -34,6 +34,8 @@ import com.epmet.entity.UserMessageEntity; import com.epmet.redis.UserMessageRedis; import com.epmet.service.UserMessageService; 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; @@ -50,6 +52,7 @@ import java.util.Map; */ @Service public class UserMessageServiceImpl extends BaseServiceImpl implements UserMessageService { + private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private UserMessageRedis userMessageRedis; diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/utils/ModuleConstant.java index 863fa85e40..0843644411 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -26,5 +26,29 @@ public interface ModuleConstant extends Constant { */ String MAIL_CONFIG_KEY = "MAIL_CONFIG_KEY"; + /** + * 组织:机构 + * */ + String INSTITUTION_AGENCY = "1"; + + /** + * 组织:部门 + * */ + String INSTITUTION_DEPT = "2"; + + /** + * 祖师:网格 + * */ + String INSTITUTION_GRID = "3"; + + /** + * 当前组织下 + * */ + String PERMISSION_LEVEL_CURRENT = "1"; + + /** + * 所属机构(agency)下 + * */ + String PERMISSION_LEVEL_PARENT = "2"; } diff --git a/epmet-module/gov-access/gov-access-server/docker-compose.yml b/epmet-module/gov-access/gov-access-server/docker-compose.yml index 97308b20a8..f718b955d9 100644 --- a/epmet-module/gov-access/gov-access-server/docker-compose.yml +++ b/epmet-module/gov-access/gov-access-server/docker-compose.yml @@ -2,7 +2,7 @@ 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.4 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-access-server:0.3.5 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index 39eb648ee5..236e3e4779 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.4 + 0.3.5 gov-access com.epmet diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml index 032ebac635..5e303a2a5c 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml @@ -45,7 +45,7 @@ SELECT - id AS gridId, - grid_name AS gridName + IFNULL(CONCAT(ca.all_parent_name,'-',ca.organization_name),'') AS gridName FROM - customer_grid + customer_grid cg + LEFT JOIN customer_agency ca ON ca.id = cg.pid WHERE - id = #{gridId} - AND del_flag = 0 + cg.id = #{gridId} + AND cg.del_flag = 0 + AND ca.del_flag = 0