Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-10-25 09:33:49 +08:00
commit fd7b72d47d
9 changed files with 284 additions and 6 deletions

View File

@ -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');

View File

@ -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<PageData<HostInfoDTO>> getEnkeUsers(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<HostInfoDTO> page = enkeService.page(params);
return new Result<PageData<HostInfoDTO>>().ok(page);
}
@ApiOperation(value = "正式启动会议")
@PostMapping("/initiateMeet")
public boolean initiateMeet(@RequestBody String attender) {

View File

@ -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<HostInfoEntity> {
List<HostInfoDTO> getHostInfoDTOList(Map params);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<HostInfoEntity, HostInfoDTO> {
}

View File

@ -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<HostInfoDao, HostInfoEntity, HostInfoDTO> implements EnkeService {
@Override
public QueryWrapper<HostInfoEntity> getWrapper(Map<String, Object> params) {
return null;
}
@Override
public PageData<HostInfoDTO> page(Map<String, Object> 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<HostInfoDTO> dtoList = baseDao.getHostInfoDTOList(params);
List<HostInfoDTO> result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList());
return new PageData(result, dtoList.size());
}
}

View File

@ -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');

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.renren.modules.enke.dao.HostInfoDao">
<select id="getHostInfoDTOList" resultType="io.renren.modules.enke.dto.HostInfoDTO">
select * from enke_hostinfo order by create_date desc
</select>
</mapper>