From 4ab4265e19c5f7aaf07fac997941cd202e2763d2 Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Mon, 24 Oct 2022 18:30:44 +0800 Subject: [PATCH 1/7] =?UTF-8?q?enke:=E6=9F=A5=E8=AF=A2=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/db/V7.0__enke_hostinfo_add_table.sql | 44 ++++++++++++++++++ .../enke/{ => controller}/EnkeController.java | 33 +++++++++++--- .../renren/modules/enke/dao/HostInfoDao.java | 21 +++++++++ .../renren/modules/enke/dto/HostInfoDTO.java | 32 +++++++++++++ .../modules/enke/entity/HostInfoEntity.java | 44 ++++++++++++++++++ .../modules/enke/service/EnkeService.java | 17 +++++++ .../enke/service/impl/EnkeServiceImpl.java | 45 +++++++++++++++++++ .../db/V7.0__enke_hostinfo_add_table.sql | 44 ++++++++++++++++++ .../resources/mapper/enke/HostInfoDao.xml | 10 +++++ 9 files changed, 284 insertions(+), 6 deletions(-) create mode 100644 config/db/V7.0__enke_hostinfo_add_table.sql rename renren-admin/src/main/java/io/renren/modules/enke/{ => controller}/EnkeController.java (74%) create mode 100644 renren-admin/src/main/java/io/renren/modules/enke/dao/HostInfoDao.java create mode 100644 renren-admin/src/main/java/io/renren/modules/enke/dto/HostInfoDTO.java create mode 100644 renren-admin/src/main/java/io/renren/modules/enke/entity/HostInfoEntity.java create mode 100644 renren-admin/src/main/java/io/renren/modules/enke/service/EnkeService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/enke/service/impl/EnkeServiceImpl.java create mode 100644 renren-admin/src/main/resources/db/V7.0__enke_hostinfo_add_table.sql create mode 100644 renren-admin/src/main/resources/mapper/enke/HostInfoDao.xml diff --git a/config/db/V7.0__enke_hostinfo_add_table.sql b/config/db/V7.0__enke_hostinfo_add_table.sql new file mode 100644 index 00000000..9a4b6e86 --- /dev/null +++ b/config/db/V7.0__enke_hostinfo_add_table.sql @@ -0,0 +1,44 @@ +DROP TABLE IF EXISTS `enke_hostinfo`; +CREATE TABLE `enke_hostinfo` +( + `id` bigint NOT NULL AUTO_INCREMENT, + `hostName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'hostName', + `owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'owner', + `ipAddress` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ipAddress', + `multicastAddress` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'multicastAddress', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB + AUTO_INCREMENT = 100 + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci + ROW_FORMAT = DYNAMIC COMMENT ='enke_hostinfo'; + +INSERT INTO `enke_hostinfo` +VALUES (1, '市预警信息发布中心', '市预警信息发布中心', '127.0.0.1', '127.0.0.1', '2022-09-22 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (2, '市园林和林业局', '市园林和林业局', '127.0.0.1', '127.0.0.1', '2022-09-21 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (3, '城阳区应急指挥中心', '城阳区应急指挥中心', '127.0.0.1', '127.0.0.1', '2022-09-20 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (4, '地铁集团', '地铁集团', '127.0.0.1', '127.0.0.1', '2022-09-19 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (5, '市市场监管局', '市市场监管局', '127.0.0.1', '127.0.0.1', '2022-09-18 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (6, '市教育局(值班室)', '市教育局(值班室)', '127.0.0.1', '127.0.0.1', '2022-09-17 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (7, '青岛市政府总值班室', '青岛市政府总值班室', '127.0.0.1', '127.0.0.1', '2022-09-16 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (8, '市教育局', '市教育局', '127.0.0.1', '127.0.0.1', '2022-09-15 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (9, '高新区管委(值班室)', '高新区管委(值班室)', '127.0.0.1', '127.0.0.1', '2022-09-14 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (10, '市人防办', '市人防办', '127.0.0.1', '127.0.0.1', '2022-09-13 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (11, '市公安局', '市公安局', '127.0.0.1', '127.0.0.1', '2022-09-12 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (12, '市交通运输局', '市交通运输局', '127.0.0.1', '127.0.0.1', '2022-09-11 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (13, '一网统揽平台组', '一网统揽平台组', '127.0.0.1', '127.0.0.1', '2022-09-10 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (14, '青岛市一网统揽项目组', '青岛市一网统揽项目组', '127.0.0.1', '127.0.0.1', '2022-09-09 09:20:07'); diff --git a/renren-admin/src/main/java/io/renren/modules/enke/EnkeController.java b/renren-admin/src/main/java/io/renren/modules/enke/controller/EnkeController.java similarity index 74% rename from renren-admin/src/main/java/io/renren/modules/enke/EnkeController.java rename to renren-admin/src/main/java/io/renren/modules/enke/controller/EnkeController.java index b629bda5..f568d775 100644 --- a/renren-admin/src/main/java/io/renren/modules/enke/EnkeController.java +++ b/renren-admin/src/main/java/io/renren/modules/enke/controller/EnkeController.java @@ -1,19 +1,22 @@ -package io.renren.modules.enke; +package io.renren.modules.enke.controller; +import io.renren.common.page.PageData; +import io.renren.common.utils.Result; import io.renren.modules.activiti.service.ActHistoryService; +import io.renren.modules.enke.dto.HostInfoDTO; +import io.renren.modules.enke.service.EnkeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; -import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; -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 springfox.documentation.annotations.ApiIgnore; import sw.vc3term.contingencyplan.ContingencyPlanUtil; +import java.io.UnsupportedEncodingException; import java.net.Inet4Address; import java.net.InetAddress; import java.net.NetworkInterface; @@ -21,6 +24,7 @@ import java.net.SocketException; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; +import java.util.Map; /** * @Auther:lizhicheng2@hisense.com @@ -39,6 +43,9 @@ public class EnkeController { private static final Logger logger = LoggerFactory.getLogger(ActHistoryService.class); + @Autowired + private EnkeService enkeService; + static { cp = ContingencyPlanUtil.getInstance(); // 初始化会议 @@ -47,6 +54,20 @@ public class EnkeController { cp.setLocalAddress(CollectionUtils.isEmpty(ips) ? "0.0.0.0" : ips.get(0), ContingencyPlanUtil.LOCAL_PORT); } + /** + * 第二步:发起会议前将同步过来的用户返回给前端选择 + * + * @return 是否成功同步 + * @throws UnsupportedEncodingException + * @author libin + */ + @ApiOperation(value = "getEnkeUsers") + @RequestMapping(value = "/getEnkeUsers", method = RequestMethod.GET) + public Result> getEnkeUsers(@ApiIgnore @RequestParam Map params) { + PageData page = enkeService.page(params); + return new Result>().ok(page); + } + @ApiOperation(value = "正式启动会议") @PostMapping("/initiateMeet") public boolean initiateMeet(@RequestBody String attender) { diff --git a/renren-admin/src/main/java/io/renren/modules/enke/dao/HostInfoDao.java b/renren-admin/src/main/java/io/renren/modules/enke/dao/HostInfoDao.java new file mode 100644 index 00000000..fccc913f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/enke/dao/HostInfoDao.java @@ -0,0 +1,21 @@ +package io.renren.modules.enke.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.enke.dto.HostInfoDTO; +import io.renren.modules.enke.entity.HostInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * @Auther:lizhicheng2@hisense.com + * @date:2022/10/24 + * @des + */ +@Mapper +public interface HostInfoDao extends BaseDao { + + List getHostInfoDTOList(Map params); + +} diff --git a/renren-admin/src/main/java/io/renren/modules/enke/dto/HostInfoDTO.java b/renren-admin/src/main/java/io/renren/modules/enke/dto/HostInfoDTO.java new file mode 100644 index 00000000..466a578a --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/enke/dto/HostInfoDTO.java @@ -0,0 +1,32 @@ +package io.renren.modules.enke.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @Auther:lizhicheng2@hisense.com + * @date:2022/10/24 + * @des + */ +@Data +@ApiModel(value = "hostInfo") +public class HostInfoDTO { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键ID") + private Long id; + @ApiModelProperty(value = "hostName") + private String hostName; + @ApiModelProperty(value = "owner") + private String owner; + @ApiModelProperty(value = "ipAddress") + private String ipAddress; + @ApiModelProperty(value = "multicastAddress") + private String multicastAddress; + @ApiModelProperty(value = "创建时间") + private Date createDate; + +} diff --git a/renren-admin/src/main/java/io/renren/modules/enke/entity/HostInfoEntity.java b/renren-admin/src/main/java/io/renren/modules/enke/entity/HostInfoEntity.java new file mode 100644 index 00000000..e49b951e --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/enke/entity/HostInfoEntity.java @@ -0,0 +1,44 @@ +package io.renren.modules.enke.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.renren.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * @Auther:lizhicheng2@hisense.com + * @date:2022/10/24 + * @des + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("enke_hostinfo") +public class HostInfoEntity extends BaseEntity { + + /** + * 融合服务名称 + */ + private String hostName; + /** + * 融合服务名称 + */ + private String owner; + /** + * 融合服务名称 + */ + private String ipAddress; + /** + * 融合服务名称 + */ + private String multicastAddress; + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createDate; + +} diff --git a/renren-admin/src/main/java/io/renren/modules/enke/service/EnkeService.java b/renren-admin/src/main/java/io/renren/modules/enke/service/EnkeService.java new file mode 100644 index 00000000..4e6d967e --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/enke/service/EnkeService.java @@ -0,0 +1,17 @@ +package io.renren.modules.enke.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.enke.dto.HostInfoDTO; +import io.renren.modules.enke.entity.HostInfoEntity; +import io.renren.modules.fuse.dto.TbFuseDTO; +import io.renren.modules.fuse.entity.TbFuseEntity; + +/** + * @Auther:lizhicheng2@hisense.com + * @date:2022/10/24 + * @des + */ +public interface EnkeService extends CrudService { + + +} diff --git a/renren-admin/src/main/java/io/renren/modules/enke/service/impl/EnkeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/enke/service/impl/EnkeServiceImpl.java new file mode 100644 index 00000000..ba7d3443 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/enke/service/impl/EnkeServiceImpl.java @@ -0,0 +1,45 @@ +package io.renren.modules.enke.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.constant.Constant; +import io.renren.common.page.PageData; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.enke.dao.HostInfoDao; +import io.renren.modules.enke.dto.HostInfoDTO; +import io.renren.modules.enke.entity.HostInfoEntity; +import io.renren.modules.enke.service.EnkeService; +import io.renren.modules.fuse.dto.TbFuseDTO; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Auther:lizhicheng2@hisense.com + * @date:2022/10/24 + * @des + */ +@Service +public class EnkeServiceImpl extends CrudServiceImpl implements EnkeService { + + @Override + public QueryWrapper getWrapper(Map params) { + return null; + } + + @Override + public PageData page(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 = baseDao.getHostInfoDTOList(params); + List result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()); + return new PageData(result, dtoList.size()); + } +} diff --git a/renren-admin/src/main/resources/db/V7.0__enke_hostinfo_add_table.sql b/renren-admin/src/main/resources/db/V7.0__enke_hostinfo_add_table.sql new file mode 100644 index 00000000..9a4b6e86 --- /dev/null +++ b/renren-admin/src/main/resources/db/V7.0__enke_hostinfo_add_table.sql @@ -0,0 +1,44 @@ +DROP TABLE IF EXISTS `enke_hostinfo`; +CREATE TABLE `enke_hostinfo` +( + `id` bigint NOT NULL AUTO_INCREMENT, + `hostName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'hostName', + `owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'owner', + `ipAddress` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ipAddress', + `multicastAddress` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'multicastAddress', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB + AUTO_INCREMENT = 100 + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci + ROW_FORMAT = DYNAMIC COMMENT ='enke_hostinfo'; + +INSERT INTO `enke_hostinfo` +VALUES (1, '市预警信息发布中心', '市预警信息发布中心', '127.0.0.1', '127.0.0.1', '2022-09-22 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (2, '市园林和林业局', '市园林和林业局', '127.0.0.1', '127.0.0.1', '2022-09-21 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (3, '城阳区应急指挥中心', '城阳区应急指挥中心', '127.0.0.1', '127.0.0.1', '2022-09-20 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (4, '地铁集团', '地铁集团', '127.0.0.1', '127.0.0.1', '2022-09-19 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (5, '市市场监管局', '市市场监管局', '127.0.0.1', '127.0.0.1', '2022-09-18 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (6, '市教育局(值班室)', '市教育局(值班室)', '127.0.0.1', '127.0.0.1', '2022-09-17 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (7, '青岛市政府总值班室', '青岛市政府总值班室', '127.0.0.1', '127.0.0.1', '2022-09-16 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (8, '市教育局', '市教育局', '127.0.0.1', '127.0.0.1', '2022-09-15 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (9, '高新区管委(值班室)', '高新区管委(值班室)', '127.0.0.1', '127.0.0.1', '2022-09-14 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (10, '市人防办', '市人防办', '127.0.0.1', '127.0.0.1', '2022-09-13 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (11, '市公安局', '市公安局', '127.0.0.1', '127.0.0.1', '2022-09-12 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (12, '市交通运输局', '市交通运输局', '127.0.0.1', '127.0.0.1', '2022-09-11 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (13, '一网统揽平台组', '一网统揽平台组', '127.0.0.1', '127.0.0.1', '2022-09-10 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (14, '青岛市一网统揽项目组', '青岛市一网统揽项目组', '127.0.0.1', '127.0.0.1', '2022-09-09 09:20:07'); diff --git a/renren-admin/src/main/resources/mapper/enke/HostInfoDao.xml b/renren-admin/src/main/resources/mapper/enke/HostInfoDao.xml new file mode 100644 index 00000000..b691a0a0 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/enke/HostInfoDao.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file From 00b55a9c6baf2ef608b5992a25dac62f128ebd01 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 25 Oct 2022 10:05:13 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=83=BD=E5=8A=9B=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8C=BA=E5=9F=9F=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusController.java | 4 + .../service/impl/ResourceServiceImpl.java | 60 +++++++- .../resources/mapper/resource/ResourceDao.xml | 135 ++++++++++-------- 3 files changed, 138 insertions(+), 61 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 5f1b7696..83ab710e 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 @@ -375,6 +375,7 @@ public class CensusController { @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "region", value = "所属区域id", paramType = "query", dataType = "String"), }) public Result selectApplyDeptDetailTypeCountList(@RequestParam Map params) { return new Result().ok(resourceService.selectApplyDeptDetailTypeCountList(params)); @@ -388,6 +389,7 @@ public class CensusController { @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "region", value = "所属区域id", paramType = "query", dataType = "String"), }) public void exportSelectApplyDeptDetailTypeCountList(@RequestParam Map params, HttpServletResponse response) throws IOException { ArrayList resultList = (ArrayList) resourceService.selectApplyDeptDetailTypeCountList(params); @@ -421,6 +423,7 @@ public class CensusController { @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "region", value = "所属区域id", paramType = "query", dataType = "String"), }) public Result selectDeptDetailTypeCountList(@RequestParam Map params) { return new Result().ok(resourceService.selectDeptDetailTypeCountList(params)); @@ -434,6 +437,7 @@ public class CensusController { @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "region", value = "所属区域id", paramType = "query", dataType = "String"), }) public void exportSelectDeptDetailTypeCountList(@RequestParam Map params, HttpServletResponse response) throws IOException { ArrayList resultList = (ArrayList) resourceService.selectDeptDetailTypeCountList(params); 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 b1a24ed6..582612c1 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 @@ -2040,7 +2040,36 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params); + Map>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); + ArrayList resultList = new ArrayList<>(); + Map countMap = new HashMap<>(); + typeCountListMap.forEach((k, v) -> { + HashMap map = new HashMap<>(); + map.put("count", v.stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); + map.put("name", k); + v.forEach(item -> { + map.put(item.get("type").toString(), item.get("count")); + if (countMap.containsKey(item.get("type"))) { + countMap.replace(item.get("type").toString(), Integer.parseInt(item.get("count").toString()) + countMap.get(item.get("type"))); + } else { + countMap.put(item.get("type").toString(), Integer.parseInt(item.get("count").toString())); + } + }); + resultList.add(map); + }); + Integer total = 0; + for (Integer count : countMap.values()) { + total += count; + } + countMap.put("count", total); + HashMap count = new HashMap<>(); + count.put("name", "总计"); + count.putAll(countMap); + resultList.add(count); + return resultList; + } else if (params.containsKey("region") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("region").toString())) { // 查区域 List> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params); Map>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); ArrayList resultList = new ArrayList<>(); @@ -2196,6 +2225,35 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params); + Map>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); + ArrayList resultList = new ArrayList<>(); + Map countMap = new HashMap<>(); + typeCountListMap.forEach((k, v) -> { + HashMap map = new HashMap<>(); + map.put("count", v.stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); + map.put("name", k); + v.forEach(item -> { + map.put(item.get("type").toString(), item.get("count")); + if (countMap.containsKey(item.get("type"))) { + countMap.replace(item.get("type").toString(), Integer.parseInt(item.get("count").toString()) + countMap.get(item.get("type"))); + } else { + countMap.put(item.get("type").toString(), Integer.parseInt(item.get("count").toString())); + } + }); + resultList.add(map); + }); + Integer total = 0; + for (Integer count : countMap.values()) { + total += count; + } + countMap.put("count", total); + HashMap count = new HashMap<>(); + count.put("name", "总计"); + count.putAll(countMap); + resultList.add(count); + return resultList; } else { // 全部部门 List> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params); Map>> typeCountListMap = // 市级部门 diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index a229dc7f..52f7ce5a 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1766,6 +1766,9 @@ AND tdr.type = #{type} + + AND sd.district = #{region} + AND SUBSTR(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate} @@ -1851,6 +1854,9 @@ AND sd.id = #{deptId} + + AND sd.district = #{region} + AND tdr.type = #{type} @@ -1960,7 +1966,8 @@ '青岛市大数据发展管理局' AS 'resourceDeptName', '会议室' AS 'type', tmb.create_date AS 'createDate', - CASE tmb.state WHEN 1 THEN '审核中' WHEN 2 THEN '通过' WHEN 3 THEN '不通过' ELSE '审核中' END AS 'approveStatus', + CASE tmb.state WHEN 1 THEN '审核中' WHEN 2 THEN '通过' WHEN 3 THEN '不通过' ELSE '审核中' END AS + 'approveStatus', '' AS 'applyNumber' FROM t_meetingroom_book tmb, @@ -2011,49 +2018,49 @@ @@ -2107,46 +2114,54 @@ From ab54087d8abfdc31f53744c08aa732db71f8dfc8 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 25 Oct 2022 10:27:32 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E6=A0=91=E7=BC=93=E5=AD=98=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- renren-admin/src/main/resources/ehcache.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/resources/ehcache.xml b/renren-admin/src/main/resources/ehcache.xml index 553c9454..c9379564 100644 --- a/renren-admin/src/main/resources/ehcache.xml +++ b/renren-admin/src/main/resources/ehcache.xml @@ -34,8 +34,8 @@ From b4d5f8dea0d3870fb87552cce208bbf6c13bbb56 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 25 Oct 2022 13:39:57 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=B9=BF=E5=9C=BA?= =?UTF-8?q?=E6=8C=89=E5=BA=94=E7=94=A8=E9=A2=86=E5=9F=9F=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/resource/ResourceDao.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 52f7ce5a..a19e71f6 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1601,8 +1601,7 @@ AND sd.type = #{type} - AND JSON_CONTAINS( tdr.info_list, JSON_OBJECT( 'attrType', '应用领域' )) - AND JSON_EXTRACT( tdr.info_list, '$[*].attrValue' ) LIKE CONCAT( '%', #{area}, '%' ) + AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%' ) ORDER BY sd.type, sr.sort, sd.sort, tdr.dept_id, tdr.visitor DESC, tdr.id DESC From c6f6823f2ade5d0a8fd45df67d3cb109eced89d2 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 25 Oct 2022 14:05:05 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/resource/ResourceDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index a19e71f6..d8d1828e 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1868,7 +1868,7 @@ + SELECT IFNULL(COUNT(1), 0) + FROM + tb_data_resource tdr + LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id + LEFT JOIN sys_region sr ON sd.district = sr.id + WHERE + 1 = 1 + AND MATCH (tdr.type) AGAINST ( '应用资源' IN BOOLEAN MODE) + AND tdr.del_flag = 0 + + AND sd.type = #{type} + + + AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%' ) + + + + + + + \ No newline at end of file