From cf7dc6b2de60e259bc8bcbbfd60485963ec2cfaa Mon Sep 17 00:00:00 2001 From: wangliwen Date: Sat, 29 Oct 2022 14:36:53 +0800 Subject: [PATCH 01/26] =?UTF-8?q?=E5=AD=97=E5=85=B8=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E7=A6=81=E7=94=A8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/renren/modules/sys/dto/SysDictDataDTO.java | 4 ++++ .../main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java | 3 +++ .../java/io/renren/modules/sys/entity/SysDictDataEntity.java | 5 +++++ .../java/io/renren/modules/sys/entity/SysDictTypeEntity.java | 5 +++++ .../src/main/resources/db/V7.1__sys_dict_data_col.sql | 4 ++++ 5 files changed, 21 insertions(+) create mode 100644 renren-admin/src/main/resources/db/V7.1__sys_dict_data_col.sql diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictDataDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictDataDTO.java index d3d8303d..23b5d42f 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictDataDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictDataDTO.java @@ -53,4 +53,8 @@ public class SysDictDataDTO implements Serializable { @ApiModelProperty(value = "更新时间") @JsonProperty(access = JsonProperty.Access.READ_ONLY) private Date updateDate; + + @ApiModelProperty(value = "启用状态") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Integer status; } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java index 06cfbdba..ef4de77e 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java @@ -52,6 +52,9 @@ public class SysDictTypeDTO implements Serializable { @JsonProperty(access = JsonProperty.Access.READ_ONLY) private Date updateDate; + @ApiModelProperty(value = "启用状态") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Integer status; @ApiModelProperty(value = "对应字典数据") @JsonProperty(access = JsonProperty.Access.READ_ONLY) diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictDataEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictDataEntity.java index b010abaa..a087e060 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictDataEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictDataEntity.java @@ -47,4 +47,9 @@ public class SysDictDataEntity extends BaseEntity { */ @TableField(fill = FieldFill.INSERT_UPDATE) private Date updateDate; + + /** + * 启用状态 + */ + private Integer status; } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictTypeEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictTypeEntity.java index 3ea12338..b9b2c087 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictTypeEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictTypeEntity.java @@ -43,4 +43,9 @@ public class SysDictTypeEntity extends BaseEntity { */ @TableField(fill = FieldFill.INSERT_UPDATE) private Date updateDate; + + /** + * 启用状态 + */ + private Integer status; } \ No newline at end of file diff --git a/renren-admin/src/main/resources/db/V7.1__sys_dict_data_col.sql b/renren-admin/src/main/resources/db/V7.1__sys_dict_data_col.sql new file mode 100644 index 00000000..b8e5f326 --- /dev/null +++ b/renren-admin/src/main/resources/db/V7.1__sys_dict_data_col.sql @@ -0,0 +1,4 @@ +ALTER TABLE `sys_dict_data` +MODIFY COLUMN `status` int NULL DEFAULT 1 COMMENT '启用状态(0未启用 1启用)' AFTER `update_date`; +ALTER TABLE `sys_dict_type` +MODIFY COLUMN `status` int NULL DEFAULT 1 COMMENT '启用状态(0未启用 1启用)' AFTER `update_date`; \ No newline at end of file From d2d2c7080110d963a18cef51eb17122e2298423d Mon Sep 17 00:00:00 2001 From: wangliwen Date: Sat, 29 Oct 2022 15:14:26 +0800 Subject: [PATCH 02/26] =?UTF-8?q?=E3=80=82=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/V7.1__sys_dict_data_col.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/resources/db/V7.1__sys_dict_data_col.sql b/renren-admin/src/main/resources/db/V7.1__sys_dict_data_col.sql index b8e5f326..3f6ffc79 100644 --- a/renren-admin/src/main/resources/db/V7.1__sys_dict_data_col.sql +++ b/renren-admin/src/main/resources/db/V7.1__sys_dict_data_col.sql @@ -1,4 +1,4 @@ ALTER TABLE `sys_dict_data` -MODIFY COLUMN `status` int NULL DEFAULT 1 COMMENT '启用状态(0未启用 1启用)' AFTER `update_date`; +ADD COLUMN `status` int NULL DEFAULT 1 COMMENT '启用状态(0未启用 1启用)' AFTER `update_date`; ALTER TABLE `sys_dict_type` -MODIFY COLUMN `status` int NULL DEFAULT 1 COMMENT '启用状态(0未启用 1启用)' AFTER `update_date`; \ No newline at end of file +ADD COLUMN `status` int NULL DEFAULT 1 COMMENT '启用状态(0未启用 1启用)' AFTER `update_date`; \ No newline at end of file From 1d70c445e6c04162071b735cf9f075060972df47 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 31 Oct 2022 10:05:52 +0800 Subject: [PATCH 03/26] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/resource/service/impl/ResourceServiceImpl.java | 3 +++ .../io/renren/modules/sys/controller/SysUserController.java | 2 +- .../renren/modules/sys/service/impl/SysUserServiceImpl.java | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index bf72ffd4..53468243 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -225,6 +225,9 @@ public class ResourceServiceImpl extends CrudServiceImpl params, HttpServletResponse response) throws Exception { List list = sysUserService.list(params); - + params.put("export", true); ExcelUtils.exportExcelToTarget(response, null, "用户管理", list, SysUserExcel.class); } diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java index c5047c0b..b1aaf7fb 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java @@ -97,7 +97,7 @@ public class SysUserServiceImpl extends BaseServiceImpl list(Map params) { - //普通管理员,只能查询所属部门及子部门的数据 + // 普通管理员,只能查询所属部门及子部门的数据 UserDetail user = SecurityUser.getUser(); if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) { params.put("deptIdList", sysDeptService.getSubDeptIdList(user.getDeptId())); @@ -106,6 +106,9 @@ public class SysUserServiceImpl extends BaseServiceImpl entityList = baseDao.getList(params); return ConvertUtils.sourceToTarget(entityList, SysUserDTO.class); From f59eb5471f505029297389f5cd3abc41814c2e3d Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 31 Oct 2022 10:42:07 +0800 Subject: [PATCH 04/26] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E5=8F=AA=E5=87=BA=E6=9C=AC=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusController.java | 31 +++++++++++++++++++ .../service/impl/ResourceServiceImpl.java | 17 ++++++++++ .../resources/mapper/resource/ResourceDao.xml | 11 +++++-- 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index 83ab710e..c2f3c9c5 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -16,7 +16,10 @@ import io.renren.modules.resource.excel.census.config.CustomCellWriteHeightConfi import io.renren.modules.resource.excel.census.config.CustomCellWriteWeightConfig; import io.renren.modules.resource.service.ResourceService; import io.renren.modules.resourceBrowse.service.ResourceBrowseService; +import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysDeptDTO; +import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; @@ -475,6 +478,13 @@ public class CensusController { @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), }) public Result selectCensusResourceTable(@RequestParam Map params) { + UserDetail user = SecurityUser.getUser(); + if (user.getDeptId() != null) { + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 + } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 + + } return new Result().ok(resourceService.selectCensusResourceTable(params)); } @@ -489,6 +499,13 @@ public class CensusController { @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), }) public void exportSelectCensusResourceTable(@RequestParam Map params, HttpServletResponse response) throws IOException { + UserDetail user = SecurityUser.getUser(); + if (user.getDeptId() != null) { + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 + } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 + + } ArrayList resultList = (ArrayList) resourceDao.selectCensusResourceTable(params); List> date = resultList.stream().map(index -> { List data = new ArrayList<>(); @@ -542,6 +559,13 @@ public class CensusController { @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), }) public Result selectCensusApplyTable(@RequestParam Map params) { + UserDetail user = SecurityUser.getUser(); + if (user.getDeptId() != null) { + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 + } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 + + } return new Result().ok(resourceService.selectCensusApplyTable(params)); } @@ -556,6 +580,13 @@ public class CensusController { @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), }) public void exportSelectCensusApplyTable(@RequestParam Map params, HttpServletResponse response) throws IOException { + UserDetail user = SecurityUser.getUser(); + if (user.getDeptId() != null) { + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 + } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 + + } ArrayList resultList = (ArrayList) resourceDao.selectCensusApplyTable(params); List> date = resultList.stream().map(index -> { List data = new ArrayList<>(); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 53468243..73feb0f3 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -45,10 +45,13 @@ import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO; import io.renren.modules.resourceMountApply.service.TResourceMountApplyService; import io.renren.modules.resourceScore.dao.ResourceScoreDao; import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dao.SysDeptDao; import io.renren.modules.sys.dao.SysRegionDao; +import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.entity.SysDeptEntity; +import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import lombok.SneakyThrows; @@ -2075,6 +2078,13 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params); Map>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); @@ -2251,6 +2261,13 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params); Map>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 70976a8b..d7ba8f93 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1763,7 +1763,8 @@ END ) AS "type" FROM - (SELECT IF(d.type='组件服务', A.attr_value, d.type) AS type, d.id, d.dept_id, d.del_flag FROM tb_data_resource d LEFT JOIN + (SELECT IF(d.type='组件服务', A.attr_value, d.type) AS type, d.id, d.dept_id, d.del_flag FROM tb_data_resource d + LEFT JOIN tb_data_attr a ON d.id=a.data_resource_id AND a.attr_type='组件类型' AND a.del_flag=0) tdr, sys_dept sd, sys_user su, @@ -1775,7 +1776,7 @@ AND taa.user_id = su.id AND su.dept_id = sd.id AND taa.resource_id = tdr.id - AND dept.id = tdr.dept_id + AND dept.id = tdr.dept_id AND (tdr.type = '应用资源' OR tdr.type = '智能算法' OR tdr.type = '图层服务' OR tdr.type = '开发组件' OR tdr.type = '业务组件') @@ -1922,6 +1923,9 @@ AND tdr.type = #{type} + + AND sd.district = #{region} + AND SUBSTR(tdr.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate} @@ -1975,6 +1979,9 @@ AND tdr.type = #{type} + + AND sd.district = #{region} + AND SUBSTR(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate} From ceb3a5ec67e47342cc77eef1cd89c5e975abd390 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 31 Oct 2022 10:47:40 +0800 Subject: [PATCH 05/26] ... --- .../io/renren/modules/sys/controller/SysUserController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java index b3b3b65e..dfaa4fb5 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java @@ -167,8 +167,8 @@ public class SysUserController { // @RequiresPermissions("sys:user:export") @ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType = "String") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { - List list = sysUserService.list(params); params.put("export", true); + List list = sysUserService.list(params); ExcelUtils.exportExcelToTarget(response, null, "用户管理", list, SysUserExcel.class); } From 1be6e6d2bda4b2b086594bd36ba0f5f3398e47a5 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 31 Oct 2022 11:08:04 +0800 Subject: [PATCH 06/26] npe --- .../common/controller/CensusController.java | 21 +++++++++++-------- .../service/impl/ResourceServiceImpl.java | 11 +++++----- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index c2f3c9c5..7a7f18b9 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -19,7 +19,6 @@ import io.renren.modules.resourceBrowse.service.ResourceBrowseService; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysDeptDTO; -import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; @@ -482,9 +481,10 @@ public class CensusController { if (user.getDeptId() != null) { SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 - } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 - } +// else if (SuperAdminEnum.YES.value() == user.getSuperAdmin()) { // 超级管理员 +// +// } return new Result().ok(resourceService.selectCensusResourceTable(params)); } @@ -503,9 +503,10 @@ public class CensusController { if (user.getDeptId() != null) { SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 - } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 - } +// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 +// +// } ArrayList resultList = (ArrayList) resourceDao.selectCensusResourceTable(params); List> date = resultList.stream().map(index -> { List data = new ArrayList<>(); @@ -563,9 +564,10 @@ public class CensusController { if (user.getDeptId() != null) { SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 - } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 - } +// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 +// +// } return new Result().ok(resourceService.selectCensusApplyTable(params)); } @@ -584,9 +586,10 @@ public class CensusController { if (user.getDeptId() != null) { SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 - } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 - } +// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 +// +// } ArrayList resultList = (ArrayList) resourceDao.selectCensusApplyTable(params); List> date = resultList.stream().map(index -> { List data = new ArrayList<>(); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 73feb0f3..5b8a81c9 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -51,7 +51,6 @@ import io.renren.modules.sys.dao.SysRegionDao; import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.entity.SysDeptEntity; -import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import lombok.SneakyThrows; @@ -2082,9 +2081,10 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params); Map>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); @@ -2265,9 +2265,10 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params); Map>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); From a16c129c516ee1967d278477375e5e10b1b0de5f Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 31 Oct 2022 11:41:58 +0800 Subject: [PATCH 07/26] ... --- .../resource/service/impl/ResourceServiceImpl.java | 10 +++------- .../io/renren/modules/security/config/ShiroConfig.java | 4 ++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 5b8a81c9..5bb9cc07 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -2081,10 +2081,8 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params); Map>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); @@ -2264,11 +2262,9 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params); Map>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); diff --git a/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java b/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java index 7965f2f6..4ec2e23d 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java +++ b/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java @@ -82,6 +82,10 @@ public class ShiroConfig { filterMap.put("/upload", "anon"); filterMap.put("/upload/**", "anon"); filterMap.put("/census/center/v3/**", "oauth2"); + filterMap.put("/census/center/selectDeptDetailTypeCountList", "oauth2"); + filterMap.put("/census/center/selectCensusResourceTable", "oauth2"); + filterMap.put("/census/center/exportSelectDeptDetailTypeCountList", "oauth2"); + filterMap.put("/census/center/exportSelectCensusResourceTable", "oauth2"); filterMap.put("/census/center/**", "anon"); // 全局各类统计 包含 /census/center/v2 filterMap.put("/metrics/**", "anon"); filterMap.put("/gateway-monitor/**", "anon"); From 2af6dfc830b4b2423c076fc14feac50955ba619e Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 31 Oct 2022 12:52:18 +0800 Subject: [PATCH 08/26] ... --- .../resource/service/impl/ResourceServiceImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 5bb9cc07..b7d81493 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -51,6 +51,7 @@ import io.renren.modules.sys.dao.SysRegionDao; import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.entity.SysDeptEntity; +import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import lombok.SneakyThrows; @@ -2078,7 +2079,9 @@ public class ResourceServiceImpl extends CrudServiceImpl Date: Mon, 31 Oct 2022 13:49:45 +0800 Subject: [PATCH 09/26] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=8F=AA=E5=87=BA=E6=9C=AC=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E9=83=A8=E9=97=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/controller/SysDeptController.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java index cd1e026d..100e4698 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java @@ -8,8 +8,10 @@ import io.renren.common.validator.group.AddGroup; import io.renren.common.validator.group.DefaultGroup; import io.renren.common.validator.group.UpdateGroup; import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysUserDTO; +import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; @@ -66,11 +68,23 @@ public class SysDeptController { @LogOperation("查询所有部门列表") // @RequiresPermissions("sys:dept:list") public Result>> all(String name) { + UserDetail user = SecurityUser.getUser(); List> list = new ArrayList<>(); - if (StringUtils.isNotEmpty(name)) { - list = jdbcTemplate.queryForList(String.format("SELECT id,`name` FROM sys_dept WHERE `name` LIKE '%s';", "%" + name + "%")); - } else { - list = jdbcTemplate.queryForList("SELECT id,`name` FROM sys_dept;"); + if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 + if (StringUtils.isNotEmpty(name)) { + list = jdbcTemplate.queryForList(String.format("SELECT id,`name` FROM sys_dept WHERE `name` LIKE '%s';", "%" + name + "%")); + } else { + list = jdbcTemplate.queryForList("SELECT id,`name` FROM sys_dept;"); + } + } else { // 区域管理员 + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + if (sysDeptDTO.getDistrict() != null) { + if (StringUtils.isNotEmpty(name)) { + list = jdbcTemplate.queryForList(String.format("SELECT id,`name` FROM sys_dept WHERE `name` LIKE '%s' AND WHERE district = %d;", "%" + name + "%", sysDeptDTO.getDistrict())); + } else { + list = jdbcTemplate.queryForList(String.format("SELECT id,`name` FROM sys_dept WHERE district = %d;", sysDeptDTO.getDistrict())); + } + } } return new Result>>().ok(list); } From ddd1c3196aeaa2a3718c456e8001ef1c4255a6aa Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Mon, 31 Oct 2022 14:55:36 +0800 Subject: [PATCH 10/26] =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E3=80=81url=E5=89=8D=E7=BC=80=E6=94=B9=E4=B8=BAucs-admin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SysLogOperationServiceImpl.java | 8 +++--- .../sys/controller/SysDeptController.java | 26 +++++++++++++++++++ .../src/main/resources/application.yml | 2 +- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogOperationServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogOperationServiceImpl.java index f6e2dfde..23507047 100644 --- a/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogOperationServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogOperationServiceImpl.java @@ -56,14 +56,14 @@ public class SysLogOperationServiceImpl extends BaseServiceImpl - wrapper.like("request_uri", "/renren-admin/resource%/insert") + wrapper.like("request_uri", "/ucs-admin/resource%/insert") .or() - .like("request_uri", "/renren-admin/resource%/update") + .like("request_uri", "/ucs-admin/resource%/update") .or() - .like("request_uri", "/renren-admin/resource%/delete")); + .like("request_uri", "/ucs-admin/resource%/delete")); } else { queryWrapper.like(StringUtils.isNotBlank(operationType), "request_uri", operationType); } diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java index 100e4698..acbf715b 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java @@ -1,6 +1,8 @@ package io.renren.modules.sys.controller; import io.renren.common.annotation.LogOperation; +import io.renren.common.constant.Constant; +import io.renren.common.page.PageData; import io.renren.common.utils.Result; import io.renren.common.validator.AssertUtils; import io.renren.common.validator.ValidatorUtils; @@ -15,14 +17,18 @@ import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; import java.util.*; +import java.util.stream.Collectors; /** * 部门管理 @@ -48,6 +54,26 @@ public class SysDeptController { return new Result>().ok(list); } + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int") + }) + public Result> page(@ApiIgnore @RequestParam Map params) { + long curPage = 1; + long limit = 10; + if (params.get(Constant.PAGE) != null) { + curPage = Long.parseLong((String) params.get(Constant.PAGE)); + } + if (params.get(Constant.LIMIT) != null) { + limit = Long.parseLong((String) params.get(Constant.LIMIT)); + } + List dtoList = sysDeptService.list(new HashMap<>(1)); + List result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()); + return new Result>().ok(new PageData(result, dtoList.size())); + } + @GetMapping("listForRegion") @ApiOperation("查询区域管理员管理的部门") @LogOperation("查询区域管理员管理的部门") diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index 78bced7a..4381134f 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -36,7 +36,7 @@ server: min-spare: 30 port: 9090 servlet: - context-path: /renren-admin + context-path: /ucs-admin session: cookie: http-only: true From 6375d433c6cc6e6902c6ea29105383cacd13713f Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Mon, 31 Oct 2022 16:16:14 +0800 Subject: [PATCH 11/26] =?UTF-8?q?1.=E8=83=BD=E5=8A=9B=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=BA=94=E7=94=A8=E7=B3=BB=E7=BB=9F=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E4=B8=8A=E6=9E=B6=E5=BA=94=E7=94=A8=E9=99=90?= =?UTF-8?q?=E5=88=B6=202.=E8=83=BD=E5=8A=9B=E4=BD=BF=E7=94=A8=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=97=B6=E9=97=B4=E9=94=99=E8=AF=AFbug=203.=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2bug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResourceController.java | 8 ++++++++ .../modules/resource/dao/ResourceDao.java | 2 ++ .../resource/service/ResourceService.java | 3 +++ .../service/impl/ResourceServiceImpl.java | 7 +++++++ .../resources/mapper/resource/ResourceDao.xml | 19 ++++++++++++++++++- .../main/resources/mapper/sys/SysDeptDao.xml | 3 +-- 6 files changed, 39 insertions(+), 3 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 6b3d82bb..c6f02a0c 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -678,4 +678,12 @@ public class ResourceController { return new Result().ok(resourceService.getSquareList(jsonObject)); } + @GetMapping("/getAppListByDept") + @ApiOperation("/根据部门查询部门上架应用列表") + @LogOperation("/根据部门查询部门上架应用列表") + public Result getAppListByDept(String key) { + return new Result().ok(resourceService.getAppListByDept(key)); + } + + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index 22682303..d9e6e957 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java @@ -215,4 +215,6 @@ public interface ResourceDao extends BaseDao { @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize); Integer getSquareListCount(@Param("type") String type, @Param("deptType") Integer deptType, @Param("area") String area); + + List getAppListByDept(@Param("deptId") Long deptId, @Param("key") String key); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java index db38453c..91a83caf 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java @@ -159,4 +159,7 @@ public interface ResourceService extends CrudService + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml b/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml index 45a309ba..f05608a6 100644 --- a/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml +++ b/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml @@ -7,12 +7,11 @@ select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1 where 1 = 1 AND name != '访客部门' - t1.id in + AND t1.id in #{id} - order by t1.sort asc From ca652464d9a815e683f2abbd554854de15e506a7 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 31 Oct 2022 16:35:21 +0800 Subject: [PATCH 12/26] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=8F=91=E9=80=81=E4=BA=9A=E5=BE=AE=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SysNoticeServiceImpl.java | 16 ++++++++++++---- renren-admin/src/main/resources/application.yml | 4 +++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java index 17ba31e3..7a7d3229 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java @@ -29,6 +29,7 @@ import org.apache.shiro.session.UnknownSessionException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; @@ -65,6 +66,9 @@ public class SysNoticeServiceImpl extends CrudServiceImpl getWrapper(Map params) { QueryWrapper wrapper = new QueryWrapper<>(); @@ -212,10 +216,14 @@ public class SysNoticeServiceImpl extends CrudServiceImpl message = new MessageData().msg(notice.getTitle()); webSocketServer.sendMessage(finalUserIdList, message); }, executor).thenRunAsync(() -> { - try { - sendToYaweiUser(notice, finalUserIdList); - } catch (Exception exception) { - logger.error("", exception); + if (noticeYaWei) { + try { + sendToYaweiUser(notice, finalUserIdList); + } catch (Exception exception) { + logger.error("", exception); + } + } else { + logger.info("无需发送到第三方 亚微消息"); } }, executor); } diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index 4381134f..be426500 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -152,4 +152,6 @@ front: # 基础设施,部门最大申请数量 infrastructure: dept-can-apply-max: 10 - +# 是否发亚微消息 +notice: + yawei: true From 468c71b304e2bbef898cd26ec3810499bbf3eab2 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 31 Oct 2022 16:47:16 +0800 Subject: [PATCH 13/26] =?UTF-8?q?=E5=B1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/notice/service/impl/SysNoticeServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java index 7a7d3229..cc017413 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java @@ -66,7 +66,7 @@ public class SysNoticeServiceImpl extends CrudServiceImpl Date: Mon, 31 Oct 2022 18:08:23 +0800 Subject: [PATCH 14/26] =?UTF-8?q?=E3=80=82=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../renren/modules/security/config/ShiroConfig.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java b/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java index 4ec2e23d..47656484 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java +++ b/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java @@ -82,10 +82,17 @@ public class ShiroConfig { filterMap.put("/upload", "anon"); filterMap.put("/upload/**", "anon"); filterMap.put("/census/center/v3/**", "oauth2"); - filterMap.put("/census/center/selectDeptDetailTypeCountList", "oauth2"); - filterMap.put("/census/center/selectCensusResourceTable", "oauth2"); + + filterMap.put("/census/center/exportSelectApplyDeptDetailTypeCountList", "oauth2"); filterMap.put("/census/center/exportSelectDeptDetailTypeCountList", "oauth2"); filterMap.put("/census/center/exportSelectCensusResourceTable", "oauth2"); + filterMap.put("/census/center/exportSelectCensusApplyTable", "oauth2"); + + filterMap.put("/census/center/selectApplyDeptDetailTypeCountList", "oauth2"); + filterMap.put("/census/center/selectDeptDetailTypeCountList", "oauth2"); + filterMap.put("/census/center/selectCensusResourceTable", "oauth2"); + filterMap.put("/census/center/selectCensusApplyTable", "oauth2"); + filterMap.put("/census/center/**", "anon"); // 全局各类统计 包含 /census/center/v2 filterMap.put("/metrics/**", "anon"); filterMap.put("/gateway-monitor/**", "anon"); From c4dcb0c4cc67ebb3f22e8e8712e63b6f2b209561 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Mon, 31 Oct 2022 18:08:58 +0800 Subject: [PATCH 15/26] =?UTF-8?q?=E5=87=8F=E5=B0=91=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataResource/domain/TsingtaoDataResourceService.java | 4 ++++ .../domain/TsingtaoXHADataResourceService.java | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java index feb4d2df..3293ee83 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java @@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; +import org.springframework.web.client.ResourceAccessException; import org.springframework.web.client.RestTemplate; import java.nio.charset.Charset; @@ -77,6 +78,9 @@ public class TsingtaoDataResourceService extends AbstractDataResourceService { result.put("data", objects); return result; + } catch (ResourceAccessException e) { + logger.error("青岛市资源数据接口连接超时!!!"); + return null; } catch (Exception e) { logger.error("青岛市资源数据调用失败!!!", e); return null; diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoXHADataResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoXHADataResourceService.java index a8a66e95..4b2fc8bb 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoXHADataResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoXHADataResourceService.java @@ -11,6 +11,7 @@ import okhttp3.Request; import okhttp3.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.web.client.ResourceAccessException; import java.util.concurrent.TimeUnit; @@ -47,8 +48,12 @@ public class TsingtaoXHADataResourceService extends AbstractDataResourceService } else { logger.error("西海岸数据资源列表获取失败"); } - } catch (Exception exception) { - logger.error("西海岸数据资源列表获取失败", exception); + } catch (ResourceAccessException e) { + logger.error("西海岸资源数据接口连接超时!!!"); + return null; + } catch (Exception e) { + logger.error("西海岸资源数据调用失败!!!", e); + return null; } return result; } From 59fd3fb7d6bc41bfab82ee8032cebe7c47dc0de3 Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Tue, 1 Nov 2022 09:36:24 +0800 Subject: [PATCH 16/26] =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E5=AE=A4=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=BC=9A=E5=AE=A2=E5=8E=85=E3=80=81=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/service/impl/ResourceServiceImpl.java | 8 ++++++-- .../src/main/resources/mapper/resource/ResourceDao.xml | 10 ++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index bd3b1c61..32d78e97 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -1917,7 +1917,11 @@ public class ResourceServiceImpl extends CrudServiceImpl all = CompletableFuture.allOf(jcss, hkt, sphy); all.join(); - return resultMap; + return new LinkedHashMap(){{ + put("视频资源", resultMap.get("视频资源")); + put("会客厅", resultMap.get("会客厅")); + put("视频会议", resultMap.get("视频会议")); + }}; } @Override @@ -1931,7 +1935,7 @@ public class ResourceServiceImpl extends CrudServiceImpl resourceCountList = baseDao.selectCollectResourceList(); - Map result = new HashMap(); + Map result = new LinkedHashMap(); resourceCountList.stream().filter(it -> it.get("type") != null && !it.get("type").equals("")).forEach(it -> result.put(it.get("type"), it.get("count"))); return result; } diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 2d2207bc..b816ab95 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1797,7 +1797,7 @@ GROUP BY sd.id, tdr.type - + UNION SELECT @@ -1986,14 +1986,14 @@ AND SUBSTR(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate} - + UNION ALL SELECT tmb.dept AS 'deptName', tm.`name` AS 'resourceName', '青岛市大数据发展管理局' AS 'resourceDeptName', - '会议室' AS 'type', + '会客厅' AS 'type', tmb.create_date AS 'createDate', CASE tmb.state WHEN 1 THEN '审核中' WHEN 2 THEN '通过' WHEN 3 THEN '不通过' ELSE '审核中' END AS 'approveStatus', @@ -2040,9 +2040,11 @@ FROM tb_data_attr a INNER JOIN mysql.help_topic b ON a.attr_type='应用领域' AND a.del_flag=0 AND b.help_topic_id (length(a.attr_value) - length(REPLACE(a.attr_value, ';', '')) + 1)) tda ON tdr.id=tda.data_resource_id + LEFT JOIN (select sdd.sort, sdd.dict_label from sys_dict_data sdd left join tb_data_category tdc on sdd.dict_type_id=tdc.link_value + where 1=1 and sdd.status=1 and tdc.del_flag=0 and tdc.name='应用领域' and tdc.root_category='应用资源') dict ON dict.dict_label=tda.attr_value WHERE 1=1 AND tdr.del_flag=0 AND tdr.type='应用资源' GROUP BY tda.attr_value - ORDER BY count DESC + ORDER BY ANY_VALUE(IFNULL(dict.sort, 9999)) ASC SELECT type, - count(id) AS "count" + count(id) AS "count", + ( + CASE + type + WHEN '应用资源' THEN + 1 + WHEN '组件服务' THEN + 2 + WHEN '基础设施' THEN + 3 + WHEN '知识库' THEN + 5 + WHEN '数据资源' THEN + 4 + END + ) AS "type_index" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 @@ -2272,18 +2287,18 @@ From 14761e669c58aeee69f2f58f6c1b3a0956a45613 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 1 Nov 2022 11:45:12 +0800 Subject: [PATCH 18/26] ... --- .../modules/resource/service/impl/ResourceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index cccf72c4..3cf5b481 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -2083,7 +2083,7 @@ public class ResourceServiceImpl extends CrudServiceImpl Date: Tue, 1 Nov 2022 13:41:37 +0800 Subject: [PATCH 19/26] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/resource/service/impl/ResourceServiceImpl.java | 2 +- .../src/main/resources/mapper/notice/SysNoticeDao.xml | 3 ++- .../src/main/resources/mapper/resource/ResourceDao.xml | 6 ++++-- renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 3cf5b481..28468e54 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -1917,7 +1917,7 @@ public class ResourceServiceImpl extends CrudServiceImpl all = CompletableFuture.allOf(jcss, hkt, sphy); all.join(); - return new LinkedHashMap(){{ + return new LinkedHashMap() {{ put("视频资源", resultMap.get("视频资源")); put("会客厅", resultMap.get("会客厅")); put("视频会议", resultMap.get("视频会议")); diff --git a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml index a8fedc1c..c8928bad 100644 --- a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml +++ b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml @@ -25,6 +25,7 @@ - update sys_notice set apply_state = #{applyState} where receiver_type_ids like concat('%', #{userId}, '%') and apply_id=#{applyId} + update sys_notice set apply_state = #{applyState} where receiver_type_ids like concat('%', #{userId}, '%') and + apply_id=#{applyId} \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 3f2ec584..95346ade 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -2055,8 +2055,10 @@ FROM tb_data_attr a INNER JOIN mysql.help_topic b ON a.attr_type='应用领域' AND a.del_flag=0 AND b.help_topic_id (length(a.attr_value) - length(REPLACE(a.attr_value, ';', '')) + 1)) tda ON tdr.id=tda.data_resource_id - LEFT JOIN (select sdd.sort, sdd.dict_label from sys_dict_data sdd left join tb_data_category tdc on sdd.dict_type_id=tdc.link_value - where 1=1 and sdd.status=1 and tdc.del_flag=0 and tdc.name='应用领域' and tdc.root_category='应用资源') dict ON dict.dict_label=tda.attr_value + LEFT JOIN (select sdd.sort, sdd.dict_label from sys_dict_data sdd left join tb_data_category tdc on + sdd.dict_type_id=tdc.link_value + where 1=1 and sdd.status=1 and tdc.del_flag=0 and tdc.name='应用领域' and tdc.root_category='应用资源') dict ON + dict.dict_label=tda.attr_value WHERE 1=1 AND tdr.del_flag=0 AND tdr.type='应用资源' GROUP BY tda.attr_value ORDER BY ANY_VALUE(IFNULL(dict.sort, 9999)) ASC diff --git a/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml b/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml index f05608a6..54e7a2b0 100644 --- a/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml +++ b/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml @@ -7,7 +7,7 @@ select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1 where 1 = 1 AND name != '访客部门' - AND t1.id in + AND t1.id in #{id} From 9f3e1a1f5bedb89e7a361fb184305990422874fe Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 1 Nov 2022 15:06:15 +0800 Subject: [PATCH 20/26] =?UTF-8?q?=E5=AF=BC=E5=87=BA=20=E4=B8=8E=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=86=85=E5=AE=B9=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResourceServiceImpl.java | 21 ++++++++++++------- .../sys/service/impl/SysUserServiceImpl.java | 2 ++ .../src/main/resources/application.yml | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 28468e54..c8780a02 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -2071,10 +2071,19 @@ public class ResourceServiceImpl extends CrudServiceImpl !temp.contains(index)).forEach(index -> { + int index_ = 0; + for (int i = 0; i < censusTypes.length; i++) { + if (censusTypes[i].equals(index)) { + index_ = i + 1; + break; + } + } + int finalIndex_ = index_; Map nullMap = new HashMap() { { put("count", "0"); put("type", index); + put("type_index", finalIndex_); } }; resultList.add(nullMap); @@ -2178,8 +2187,7 @@ public class ResourceServiceImpl extends CrudServiceImpl>> typeCountListMap1 = // 区级部门 - typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("3")) - .collect(Collectors.groupingBy(m -> m.get("district").toString())); + typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("3")).collect(Collectors.groupingBy(m -> m.get("district").toString())); resultList = resultList.stream().map(index -> { if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); @@ -2196,8 +2204,7 @@ public class ResourceServiceImpl extends CrudServiceImpl>> typeCountListMap2 = // 企业部门 - typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("4")) - .collect(Collectors.groupingBy(m -> m.get("dept_id").toString())); + typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("4")).collect(Collectors.groupingBy(m -> m.get("dept_id").toString())); resultList = resultList.stream().map(index -> { if (typeCountListMap2.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 index.put("count", typeCountListMap2.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); @@ -2361,8 +2368,7 @@ public class ResourceServiceImpl extends CrudServiceImpl>> typeCountListMap1 = // 区级部门 - typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("3")) - .collect(Collectors.groupingBy(m -> m.get("district").toString())); + typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("3")).collect(Collectors.groupingBy(m -> m.get("district").toString())); resultList = resultList.stream().map(index -> { if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); @@ -2378,8 +2384,7 @@ public class ResourceServiceImpl extends CrudServiceImpl>> typeCountListMap2 = // 企业部门 - typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("4")) - .collect(Collectors.groupingBy(m -> m.get("dept_id").toString())); + typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("4")).collect(Collectors.groupingBy(m -> m.get("dept_id").toString())); resultList = resultList.stream().map(index -> { if (typeCountListMap2.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 index.put("count", typeCountListMap2.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java index b1aaf7fb..e300c07f 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java @@ -97,6 +97,8 @@ public class SysUserServiceImpl extends BaseServiceImpl list(Map params) { + //转换成like + paramsToLike(params, "username", "real_name"); // 普通管理员,只能查询所属部门及子部门的数据 UserDetail user = SecurityUser.getUser(); if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) { diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index be426500..18f68411 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -18,7 +18,7 @@ big_date: assignee_meet_role_id: 1576849766277849089 # 需要进行统计数目的资源 type/需要进行统计申请的资源类型 applyType census: - type: 组件服务,应用资源,基础设施,数据资源,知识库 + type: 应用资源,组件服务,基础设施,数据资源,知识库 applyType: 应用资源,业务组件,图层服务,开发组件,智能算法 # 海信网关 hisense: From f6a6dc0302eaf11c039b3d1af29a65059f29f0fc Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 1 Nov 2022 16:38:49 +0800 Subject: [PATCH 21/26] ... --- .../renren/modules/resource/controller/ResourceController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index c6f02a0c..b4b2b930 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -203,6 +203,7 @@ public class ResourceController { List ids = jdbcTemplate.queryForList("SELECT id FROM tb_data_resource", Long.class); ids.forEach(id -> { ResourceDTO data = resourceService.selectWithAttrs(id); + data.setUpdateDate(new Date()); resourceService.update(data); }); }, executor); From 9e59df5338144a67ccfe1f6b8a6b430bf5ec1412 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Tue, 1 Nov 2022 17:12:28 +0800 Subject: [PATCH 22/26] =?UTF-8?q?1.=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83-?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E6=8C=89=E7=BB=84=E4=BB=B6=E7=B1=BB=E5=9E=8B=E7=BB=86?= =?UTF-8?q?=E5=88=86=202.=E5=85=A8=E5=B1=80=E6=90=9C=E7=B4=A2=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E8=A7=86=E9=A2=91=E8=B5=84=E6=BA=90=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResourceServiceImpl.java | 31 ++++++++++--------- .../resourceBrowse/ResourceBrowseDao.xml | 14 +++++++-- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index bd3b1c61..c580cc82 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -2030,24 +2030,24 @@ public class ResourceServiceImpl extends CrudServiceImpl infrastructureCount = CompletableFuture.runAsync(() -> { //基础设施 - HashMap queryMap = new HashMap<>(); - queryMap.put("cameraName", keyWorld); - Integer countNew = cameraChannelMapper.selectByParentIdCountNew(queryMap, null, ""); - resultList.add(new HashMap() { - { - put("count", countNew + ""); - put("type", "基础设施"); - } - }); + //2022-11-1 去除摄像头查询 + //CompletableFuture infrastructureCount = CompletableFuture.runAsync(() -> { //基础设施 + // HashMap queryMap = new HashMap<>(); + // queryMap.put("cameraName", keyWorld); + // Integer countNew = cameraChannelMapper.selectByParentIdCountNew(queryMap, null, ""); + // resultList.add(new HashMap() { + // { + // put("count", countNew + ""); + // put("type", "基础设施"); + // } + // }); + // + //}, executor); - }, executor); //统计增加会议室搜索结果 - CompletableFuture meetingRoomCount = CompletableFuture.runAsync(() -> { //会议室 - meetCountNew[0] = tMeetingroomMapper.selectByName(keyWorld).size(); - }, executor); + CompletableFuture meetingRoomCount = CompletableFuture.runAsync(() -> meetCountNew[0] = tMeetingroomMapper.selectByName(keyWorld).size(), executor); - CompletableFuture all = CompletableFuture.allOf(DBresourceCount, dataResourceCount, infrastructureCount, meetingRoomCount); + CompletableFuture all = CompletableFuture.allOf(DBresourceCount, dataResourceCount, meetingRoomCount); all.join(); } @@ -2055,6 +2055,7 @@ public class ResourceServiceImpl extends CrudServiceImpl temp = new ArrayList<>(); resultList.forEach(map -> { diff --git a/renren-admin/src/main/resources/mapper/resourceBrowse/ResourceBrowseDao.xml b/renren-admin/src/main/resources/mapper/resourceBrowse/ResourceBrowseDao.xml index 1e63f0eb..7898b0f6 100644 --- a/renren-admin/src/main/resources/mapper/resourceBrowse/ResourceBrowseDao.xml +++ b/renren-admin/src/main/resources/mapper/resourceBrowse/ResourceBrowseDao.xml @@ -54,10 +54,20 @@