fix: 无法查询任务分组
This commit is contained in:
parent
5f38730956
commit
507041620f
|
@ -59,8 +59,8 @@ public class IpUtil {
|
||||||
String[] splitIpInfo = searchIpInfo.split("\\|");
|
String[] splitIpInfo = searchIpInfo.split("\\|");
|
||||||
if (splitIpInfo.length > 0) {
|
if (splitIpInfo.length > 0) {
|
||||||
if ("中国".equals(splitIpInfo[0])) {
|
if ("中国".equals(splitIpInfo[0])) {
|
||||||
// 国内属地返回省份
|
// 国内属地返回省份和地区
|
||||||
return splitIpInfo[2];
|
return splitIpInfo[2] + "," + splitIpInfo[3] + " " + splitIpInfo[4];
|
||||||
} else if ("0".equals(splitIpInfo[0])) {
|
} else if ("0".equals(splitIpInfo[0])) {
|
||||||
if ("内网IP".equals(splitIpInfo[4])) {
|
if ("内网IP".equals(splitIpInfo[4])) {
|
||||||
// 内网 IP
|
// 内网 IP
|
||||||
|
@ -92,10 +92,7 @@ public class IpUtil {
|
||||||
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
String remoteAddr = requestAttributes != null ? getIpAddr(requestAttributes.getRequest()) : "0:0:0:0:0:0:0:1";
|
String remoteAddr = requestAttributes != null ? getIpAddr(requestAttributes.getRequest()) : "0:0:0:0:0:0:0:1";
|
||||||
String ipRegion = IpUtil.getIpRegion(remoteAddr);
|
String ipRegion = IpUtil.getIpRegion(remoteAddr);
|
||||||
return IpEntity.builder()
|
return IpEntity.builder().remoteAddr(remoteAddr).ipRegion(ipRegion).build();
|
||||||
.remoteAddr(remoteAddr)
|
|
||||||
.ipRegion(ipRegion)
|
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class MailSenderUtil {
|
||||||
|
|
||||||
MimeMessage message = javaMailSender.createMimeMessage();
|
MimeMessage message = javaMailSender.createMimeMessage();
|
||||||
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
||||||
|
// message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("to1@example.com,to2@example.com"));
|
||||||
helper.setFrom(username);
|
helper.setFrom(username);
|
||||||
helper.setTo(emailSend.getSendTo());
|
helper.setTo(emailSend.getSendTo());
|
||||||
helper.setSubject(emailSend.getSubject());
|
helper.setSubject(emailSend.getSubject());
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM openjdk:17
|
FROM openjdk:17-jdk-alpine
|
||||||
MAINTAINER server
|
MAINTAINER server
|
||||||
|
|
||||||
#系统编码
|
#系统编码
|
||||||
|
@ -14,6 +14,11 @@ WORKDIR /home/server
|
||||||
# 复制jar包
|
# 复制jar包
|
||||||
COPY target/*.jar /home/server/app.jar
|
COPY target/*.jar /home/server/app.jar
|
||||||
|
|
||||||
|
# 程序内部挂在目录
|
||||||
|
VOLUME /usr/bin/docker
|
||||||
|
VOLUME ["/var/run/docker.sock"]
|
||||||
|
VOLUME /etc/docker/daemon.json
|
||||||
|
|
||||||
# 启动容器时的进程
|
# 启动容器时的进程
|
||||||
ENTRYPOINT ["java","-jar","/home/server/app.jar"]
|
ENTRYPOINT ["java","-jar","/home/server/app.jar"]
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package cn.bunny.services.quartz;
|
||||||
|
|
||||||
|
import cn.bunny.services.factory.EmailFactory;
|
||||||
|
import org.quartz.Job;
|
||||||
|
import org.quartz.JobExecutionContext;
|
||||||
|
import org.quartz.JobExecutionException;
|
||||||
|
|
||||||
|
public class MailingJob implements Job {
|
||||||
|
@Override
|
||||||
|
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||||
|
EmailFactory emailFactory = new EmailFactory();
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,7 +23,7 @@
|
||||||
<select id="selectListByPage" resultType="cn.bunny.dao.entity.quartz.SchedulersGroup">
|
<select id="selectListByPage" resultType="cn.bunny.dao.entity.quartz.SchedulersGroup">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>
|
<include refid="Base_Column_List"/>
|
||||||
from qrtz_schedulers_group
|
from quartz_schedulers_group
|
||||||
<where>
|
<where>
|
||||||
<if test="dto.groupName != null and dto.groupName != ''">
|
<if test="dto.groupName != null and dto.groupName != ''">
|
||||||
and group_name like CONCAT('%',#{dto.groupName},'%')
|
and group_name like CONCAT('%',#{dto.groupName},'%')
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
<!-- 物理删除任务调度分组 -->
|
<!-- 物理删除任务调度分组 -->
|
||||||
<delete id="deleteBatchIdsWithPhysics">
|
<delete id="deleteBatchIdsWithPhysics">
|
||||||
delete
|
delete
|
||||||
from sys_schedulers_group
|
from quartz_schedulers_group
|
||||||
where id in
|
where id in
|
||||||
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
||||||
#{id}
|
#{id}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package cn.bunny.services.quartz;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
|
class DatabaseBackupJobTest {
|
||||||
|
@Test
|
||||||
|
void testProcess() {
|
||||||
|
// 执行备份命令
|
||||||
|
ProcessBuilder processBuilder = new ProcessBuilder("java", "--version");
|
||||||
|
|
||||||
|
try {
|
||||||
|
Process process = processBuilder.start();
|
||||||
|
|
||||||
|
// 使用输出流读取命令的输出
|
||||||
|
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||||
|
reader.lines().forEach(System.out::println);
|
||||||
|
|
||||||
|
// 等待进程结束并获取退出值
|
||||||
|
int exitCode = process.waitFor();
|
||||||
|
System.out.println("Exit code: " + exitCode);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package cn.bunny.services.service.impl;
|
||||||
|
|
||||||
|
import cn.bunny.common.service.utils.ip.IpUtil;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
public class IpTest {
|
||||||
|
@Test
|
||||||
|
void ipTest() {
|
||||||
|
String ip = "58.214.13.154";
|
||||||
|
System.out.println(IpUtil.getIpRegion(ip));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue