Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-12-10 16:10:15 +08:00
commit 4bc0401a46
2 changed files with 21 additions and 7 deletions

View File

@ -11,11 +11,13 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import sw.vc3term.contingencyplan.ContingencyPlanUtil; import sw.vc3term.contingencyplan.ContingencyPlanUtil;
import javax.annotation.PostConstruct;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.Inet4Address; import java.net.Inet4Address;
import java.net.InetAddress; import java.net.InetAddress;
@ -39,19 +41,27 @@ public class EnkeController {
private static final String videoConfernceIp = "35.1.190.62"; private static final String videoConfernceIp = "35.1.190.62";
private static final int videoConferncePort = 8756; private static final int videoConferncePort = 8756;
private static final ContingencyPlanUtil cp; private static ContingencyPlanUtil cp = null;
private static final Logger logger = LoggerFactory.getLogger(ActHistoryService.class); private static final Logger logger = LoggerFactory.getLogger(ActHistoryService.class);
@Autowired @Autowired
private EnkeService enkeService; private EnkeService enkeService;
@Value("#{new Boolean(${enke.enable})}")
private Boolean enke; // 是否进行恩科会议组会
static { @PostConstruct
cp = ContingencyPlanUtil.getInstance(); public void init() {
// 初始化会议 if (enke) {
cp.init(videoConfernceIp, videoConferncePort); cp = ContingencyPlanUtil.getInstance();
List<String> ips = getLocalIP(); // 初始化会议
cp.setLocalAddress(CollectionUtils.isEmpty(ips) ? "0.0.0.0" : ips.get(0), ContingencyPlanUtil.LOCAL_PORT); cp.init(videoConfernceIp, videoConferncePort);
List<String> ips = getLocalIP();
cp.setLocalAddress(CollectionUtils.isEmpty(ips) ? "0.0.0.0" : ips.get(0), ContingencyPlanUtil.LOCAL_PORT);
logger.info("开启组会功能成功!");
} else {
logger.info("不开启组会功能");
}
} }
/** /**
@ -112,6 +122,7 @@ public class EnkeController {
} }
} }
} }
logger.info("本机ip:" + ips);
return ips; return ips;
} }
} }

View File

@ -179,4 +179,7 @@ shangdongtong:
reminders: reminders:
# 催办间隔天数 # 催办间隔天数
interval: 7 interval: 7
# 恩科会议
enke:
enable: true