Commit 38d3544b authored by yzm's avatar yzm

优化后的发布版本2

parent 19a2655c
...@@ -8,7 +8,6 @@ import com.cx.cn.cxquartz.service.quartz.*; ...@@ -8,7 +8,6 @@ import com.cx.cn.cxquartz.service.quartz.*;
import com.cx.cn.cxquartz.service.quartz.impl.EventWriteService; import com.cx.cn.cxquartz.service.quartz.impl.EventWriteService;
import com.cx.cn.cxquartz.util.*; import com.cx.cn.cxquartz.util.*;
import com.cx.cn.cxquartz.vo.*; import com.cx.cn.cxquartz.vo.*;
import com.cx.cn.cxquartz.vo.Point;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -18,12 +17,8 @@ import org.springframework.context.annotation.PropertySource; ...@@ -18,12 +17,8 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import sun.misc.BASE64Encoder;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import java.util.List; import java.util.List;
...@@ -59,9 +54,6 @@ public class ExtController { ...@@ -59,9 +54,6 @@ public class ExtController {
private String outpath; private String outpath;
@Value("${file.webrl}")
private String webrl;
@Value("${voice.unionId}") @Value("${voice.unionId}")
private String unionId; private String unionId;
@Value("${countryside.callbackurl}") @Value("${countryside.callbackurl}")
...@@ -165,21 +157,16 @@ public class ExtController { ...@@ -165,21 +157,16 @@ public class ExtController {
@RequestMapping(value = "/getDeviceSnapshotAndRecognize", method = RequestMethod.POST) @RequestMapping(value = "/getDeviceSnapshotAndRecognize", method = RequestMethod.POST)
public String getDeviceSnapshotAndRecognize(@RequestBody String devicecode) { public String getDeviceSnapshotAndRecognize(@RequestBody String devicecode) {
// logger.info("getDeviceSnapshotAndRecognize is running :{}",devicecode);
//根据判断监控是否存在,该监控检测的事件是什么 //根据判断监控是否存在,该监控检测的事件是什么
List<QuartzTaskInformations> mapList = sbtdspsrService.selectRecogByRtsp(devicecode); List<QuartzTaskInformations> mapList = sbtdspsrService.selectRecogByRtsp(devicecode);
String model = "1"; String model = "1";
//图片框选出来的范围 //图片框选出来的范围
Long[] roiarray; Long[] roiarray;
String videoid, tdmc;
if (null != mapList && !mapList.equals("") && mapList.size() > 0) { if (null != mapList && !mapList.equals("") && mapList.size() > 0) {
//查询该监控下面还没有经过分析的数据 //查询该监控下面还没有经过分析的数据
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("sbbh", devicecode); map.put("sbbh", devicecode);
//List<TraffAlarmRecord> traffalarmrecordlist = traffAlarmRecordService.getTraffAlarmRecordByProgress(map);
// if (traffalarmrecordlist.size() < 1) {
// return ResultUtil.success();
// }
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8); headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Map<String, Object> mapparam = new HashMap<>(); Map<String, Object> mapparam = new HashMap<>();
...@@ -233,18 +220,17 @@ public class ExtController { ...@@ -233,18 +220,17 @@ public class ExtController {
devicecode ; devicecode ;
String filename = devicecode+"_"+ DateUtils.formatCurrDateNoSign()+ "_result.jpg"; String filename = devicecode+"_"+ DateUtils.formatCurrDateNoSign()+ "_result.jpg";
eventWriteService.uploadPicture(traffpictureParamresult,imageurl, points, basepath, filename); eventWriteService.uploadPicture(traffpictureParamresult,imageurl, points, basepath, filename);
String filenameurl=webrl+File.separator+outpath+File.separator+basepath+File.separator+filename; String filenameurl=File.separator+outpath+File.separator+basepath+File.separator+filename;
jobTjParam.setImageUrl(filenameurl); jobTjParam.setImageUrl(filenameurl);
// logger.info("file path:{}",filenameurl); // logger.info("file path:{}",filenameurl);
traffpictureParamresult.setImagedata(filenameurl); traffpictureParamresult.setImagedata(filenameurl);
//traffpictureParamresult.setTargetnum( Integer.parseInt(taskinfo.getMetatype())); traffpictureParamresult.setProcessstatus("-1");
traffPictureService.updateTraffpicture(traffpictureParamresult); traffPictureService.updateTraffpicture(traffpictureParamresult);
//回调 //回调
// logger.info("send to dianxin data:{}",JSONObject.toJSONString(jobTjParam)); // logger.info("send to dianxin data:{}",JSONObject.toJSONString(jobTjParam));
eventWriteService.sendEventByCallUrl(traffpictureParamresult, jobTjParam, taskinfo.getUrl().equals("")?callbackurl:taskinfo.getUrl()); eventWriteService.sendEventByCallUrl(traffpictureParamresult, jobTjParam, taskinfo.getUrl().equals("")?callbackurl:taskinfo.getUrl());
//推送告警到前端
webSocket.GroupSending(new ObjectMapper().writeValueAsString(traffpictureParamresult));
if (unionId.contains(devicecode)) { if (unionId.contains(devicecode)) {
VoiceData voicedata = new VoiceData(); VoiceData voicedata = new VoiceData();
voicedata.setAppKey(appKey); voicedata.setAppKey(appKey);
...@@ -256,6 +242,8 @@ public class ExtController { ...@@ -256,6 +242,8 @@ public class ExtController {
// logger.info(" send to voice: {}", new ObjectMapper().writeValueAsString(voicedata)); // logger.info(" send to voice: {}", new ObjectMapper().writeValueAsString(voicedata));
eventWriteService.sendVoice(voicedata); eventWriteService.sendVoice(voicedata);
} }
//推送告警到前端
webSocket.GroupSending(new ObjectMapper().writeValueAsString(traffpictureParamresult));
} catch (Exception ex) { } catch (Exception ex) {
} }
......
...@@ -33,17 +33,17 @@ public class SbtdspsrController { ...@@ -33,17 +33,17 @@ public class SbtdspsrController {
private SbtdspsrService sbtdspsrService; private SbtdspsrService sbtdspsrService;
//
@RequestMapping(value = "/getSbtdspsrbyrtsp", method = RequestMethod.GET) // @RequestMapping(value = "/getSbtdspsrbyrtsp", method = RequestMethod.GET)
public String addTaskpage() { // public String addTaskpage() {
return "addtask"; // return "addtask";
} // }
@RequestMapping(value = "/list", method = RequestMethod.GET) // @RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody // @ResponseBody
public List<Sbtdspsr> list() { // public List<Sbtdspsr> list() {
return sbtdspsrService.list(); // return sbtdspsrService.list();
//
} // }
} }
...@@ -35,10 +35,9 @@ public class QuartzMainJobFactory implements Job { ...@@ -35,10 +35,9 @@ public class QuartzMainJobFactory implements Job {
String id = jobDataMap.getString("id"); String id = jobDataMap.getString("id");
String taskNo = jobDataMap.getString("taskNo"); String taskNo = jobDataMap.getString("taskNo");
String executorNo = jobDataMap.getString("executorNo"); String executorNo = jobDataMap.getString("executorNo");
String sendType = jobDataMap.getString("sendType");
String url = jobDataMap.getString("url"); String url = jobDataMap.getString("url");
String executeParameter = jobDataMap.getString("executeParameter"); String executeParameter = jobDataMap.getString("executeParameter");
logger.info("定时任务被执行:taskNo={},executorNo={},sendType={},url={},executeParameter={}", taskNo, executorNo, sendType, url, executeParameter); logger.info("定时任务被执行:taskNo={},executorNo={},url={},executeParameter={}", taskNo, executorNo, url, executeParameter);
QuartzService quartzService = (QuartzServiceImpl) ApplicationContextHolder.getBean("quartzServiceImpl"); QuartzService quartzService = (QuartzServiceImpl) ApplicationContextHolder.getBean("quartzServiceImpl");
QuartzTaskRecords records = null; QuartzTaskRecords records = null;
try { try {
...@@ -51,8 +50,8 @@ public class QuartzMainJobFactory implements Job { ...@@ -51,8 +50,8 @@ public class QuartzMainJobFactory implements Job {
//if (ResultEnum.HTTP.getMessage().equals(sendType)) { //if (ResultEnum.HTTP.getMessage().equals(sendType)) {
try { try {
String result = HttpClientUtil.doPost(taskNo.contains("cz_") ? czurl : fxurl, "text/json", executeParameter); String result = HttpClientUtil.doPost(taskNo.contains("cz_") ? czurl : fxurl, "text/json", taskNo);
logger.info("taskNo={},sendtype={}执行结果result{}", taskNo, sendType, result); logger.info("taskNo={},执行结果result{}", taskNo, result);
if (StringUtils.isEmpty(result)) { if (StringUtils.isEmpty(result)) {
throw new RuntimeException("taskNo=" + taskNo + "http方式返回null"); throw new RuntimeException("taskNo=" + taskNo + "http方式返回null");
} }
...@@ -71,14 +70,15 @@ public class QuartzMainJobFactory implements Job { ...@@ -71,14 +70,15 @@ public class QuartzMainJobFactory implements Job {
// } // }
// } // }
} catch (Exception ex) { } catch (Exception ex) {
logger.error(""); String exception=CommonUtil.getExceptionDetail(ex);
logger.error(exception);
atomicInteger.incrementAndGet(); atomicInteger.incrementAndGet();
quartzService.addTaskErrorRecord(records.getId().toString(), taskNo + ":" + ex.getMessage(), CommonUtil.getExceptionDetail(ex)); quartzService.addTaskErrorRecord(records.getId().toString(), taskNo + ":" + ex.getMessage(), exception);
} }
quartzService.updateRecordById(atomicInteger.get(), records.getId()); // quartzService.updateRecordById(atomicInteger.get(), records.getId());
QuartzTaskInformations quartzTaskInformation = new QuartzTaskInformations(); //QuartzTaskInformations quartzTaskInformation = new QuartzTaskInformations();
quartzTaskInformation.setId(Long.parseLong(id)); //quartzTaskInformation.setId(Long.parseLong(id));
quartzTaskInformation.setLastmodifytime(System.currentTimeMillis()); //quartzTaskInformation.setLastmodifytime(System.currentTimeMillis());
quartzService.updateTask(quartzTaskInformation); //quartzService.updateTask(quartzTaskInformation);
} }
} }
...@@ -25,11 +25,11 @@ public class FtpService { ...@@ -25,11 +25,11 @@ public class FtpService {
CacheLoadService cacheLoadService; CacheLoadService cacheLoadService;
@Autowired @Autowired
public FtpService(StringRedisTemplate stringRedisTemplate) { public FtpService(StringRedisTemplate stringRedisTemplate) {
try { // try {
this.ftpList = getFtpList(stringRedisTemplate.opsForValue().get(RedisEnum.FTPLIST.getValue())); // this.ftpList = getFtpList(stringRedisTemplate.opsForValue().get(RedisEnum.FTPLIST.getValue()));
}catch (Exception e){ // }catch (Exception e){
logger.error("ftpList error:"+e.toString()); // logger.error("ftpList error:"+e.toString());
} // }
} }
public Ftp reloadFtp() { public Ftp reloadFtp() {
......
...@@ -173,7 +173,7 @@ public class EventWriteService { ...@@ -173,7 +173,7 @@ public class EventWriteService {
/* 其他失败 */ /* 其他失败 */
} catch (Exception e) { } catch (Exception e) {
traffpictureParamresult.setPushdesc("推送第三方成功失败"); traffpictureParamresult.setPushdesc("推送第三方失败");
log.error("eventwrite - sendEventByCallUrl 异常:" + e.toString()); log.error("eventwrite - sendEventByCallUrl 异常:" + e.toString());
//return ResultObj.error(ResponseEnum.E_9999.getCode(), e.toString()); //return ResultObj.error(ResponseEnum.E_9999.getCode(), e.toString());
} }
......
...@@ -20,6 +20,7 @@ import org.springframework.beans.BeanUtils; ...@@ -20,6 +20,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.core.KafkaTemplate; import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.scheduling.quartz.SchedulerFactoryBean; import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -31,6 +32,7 @@ import java.util.Map; ...@@ -31,6 +32,7 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@Service @Service
@Configuration
public class QuartzServiceImpl implements QuartzService, InitializingBean { public class QuartzServiceImpl implements QuartzService, InitializingBean {
private static final Logger logger = LoggerFactory.getLogger(QuartzServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(QuartzServiceImpl.class);
...@@ -136,9 +138,9 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean { ...@@ -136,9 +138,9 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean {
task.setUnfrozentime(currentTimeMillis); task.setUnfrozentime(currentTimeMillis);
task.setFrozenstatus(ResultEnum.UNFROZEN.name()); task.setFrozenstatus(ResultEnum.UNFROZEN.name());
} }
task.setLastmodifytime(currentTimeMillis); // task.setLastmodifytime(currentTimeMillis);
quartzTaskInformationsService.updateStatusById(task); //quartzTaskInformationsService.updateStatusById(task);
logger.info("taskNo={},taskName={},scheduleRule={},任务{}成功", quartzTaskInformation.getTaskno(), quartzTaskInformation.getTaskname(), quartzTaskInformation.getSchedulerrule(), ResultEnum.FROZEN.name().equals(status) ? "启动" : "暂停"); // logger.info("taskNo={},taskName={},scheduleRule={},任务{}成功", quartzTaskInformation.getTaskno(), quartzTaskInformation.getTaskname(), quartzTaskInformation.getSchedulerrule(), ResultEnum.FROZEN.name().equals(status) ? "启动" : "暂停");
return ResultUtil.success(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage()); return ResultUtil.success(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage());
} }
...@@ -212,11 +214,11 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean { ...@@ -212,11 +214,11 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean {
return null; return null;
} }
long currentTimeMillis = System.currentTimeMillis(); long currentTimeMillis = System.currentTimeMillis();
QuartzTaskInformations task = new QuartzTaskInformations(); //QuartzTaskInformations task = new QuartzTaskInformations();
task.setId(quartzTaskInformation.getId()); //task.setId(quartzTaskInformation.getId());
task.setLastmodifytime(currentTimeMillis); // task.setLastmodifytime(currentTimeMillis);
quartzTaskInformationsService.updateTask(task); // quartzTaskInformationsService.updateTask(task);
logger.info("taskNo={},taskName={}更新最后修改时间成功", quartzTaskInformation.getTaskno(), quartzTaskInformation.getTaskname()); //logger.info("taskNo={},taskName={}更新最后修改时间成功", quartzTaskInformation.getTaskno(), quartzTaskInformation.getTaskname());
quartzTaskRecords = new QuartzTaskRecords(); quartzTaskRecords = new QuartzTaskRecords();
quartzTaskRecords.setTaskno(taskNo); quartzTaskRecords.setTaskno(taskNo);
...@@ -320,16 +322,16 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean { ...@@ -320,16 +322,16 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean {
if (quartzTaskInformations == null) { if (quartzTaskInformations == null) {
return ResultUtil.success(ResultEnum.NO_DATA.getCode(), ResultEnum.NO_DATA.getMessage()); return ResultUtil.success(ResultEnum.NO_DATA.getCode(), ResultEnum.NO_DATA.getMessage());
} }
Long id = quartzTaskInformations.getId(); // Long id = quartzTaskInformations.getId();
String sendType = quartzTaskInformations.getSendtype(); //String sendType = quartzTaskInformations.getSendtype();
String executorNo = quartzTaskInformations.getExecutorno(); //String executorNo = quartzTaskInformations.getExecutorno();
String url = quartzTaskInformations.getUrl(); // String url = quartzTaskInformations.getUrl();
String executeParameter = quartzTaskInformations.getExecuteparamter(); String executeParameter = quartzTaskInformations.getExecuteparamter();
logger.info("定时任务被执行:taskNo={},executorNo={},sendType={},url={},executeParameter={}", taskNo, executorNo, sendType, url, executeParameter); // logger.info("定时任务被执行:taskNo={},executorNo={},sendType={},url={},executeParameter={}", taskNo, executorNo, sendType, url, executeParameter);
QuartzTaskRecords records = null; QuartzTaskRecords records = null;
try { try {
//保存定时任务的执行记录 //保存定时任务的执行记录
records = this.addTaskRecords(taskNo); //records = this.addTaskRecords(taskNo);
if (null == records || !ResultEnum.INIT.name().equals(records.getTaskstatus())) { if (null == records || !ResultEnum.INIT.name().equals(records.getTaskstatus())) {
logger.info("taskNo={}立即运行失--->>保存执行记录失败", taskNo); logger.info("taskNo={}立即运行失--->>保存执行记录失败", taskNo);
return ResultUtil.success(ResultEnum.RUN_NOW_FAIL.getCode(), ResultEnum.RUN_NOW_FAIL.getMessage()); return ResultUtil.success(ResultEnum.RUN_NOW_FAIL.getCode(), ResultEnum.RUN_NOW_FAIL.getMessage());
...@@ -340,7 +342,7 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean { ...@@ -340,7 +342,7 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean {
try { try {
//将抽取的时间段获得,如果是没有规则,全抽所有。、 //将抽取的时间段获得,如果是没有规则,全抽所有。、
//如果是当天上午八点,就抽当天8点之前喝前一天的3点之后0 30 8 ? * * //如果是当天上午八点,就抽当天8点之前喝前一天的3点之后0 30 8 ? * *
HttpClientUtil.doPost(taskNo.contains("cz_") ? czurl : fxurl, "text/json", executeParameter); HttpClientUtil.doPost(taskNo.contains("cz_") ? czurl : fxurl, "text/json", taskNo);
logger.info(""); logger.info("");
} catch (Exception ex) { } catch (Exception ex) {
logger.error(""); logger.error("");
...@@ -363,13 +365,13 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean { ...@@ -363,13 +365,13 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean {
this.addTaskErrorRecord(records.getId().toString(), taskNo + ":" + ex.getMessage(), CommonUtil.getExceptionDetail(ex)); this.addTaskErrorRecord(records.getId().toString(), taskNo + ":" + ex.getMessage(), CommonUtil.getExceptionDetail(ex));
} }
//更改record表的执行状态、最后修改时间、失败个数 //更改record表的执行状态、最后修改时间、失败个数
this.updateRecordById(atomicInteger.get(), records.getId()); // this.updateRecordById(atomicInteger.get(), records.getId());
//更新taskinfo表的最后修改时间 //更新taskinfo表的最后修改时间
QuartzTaskInformations quartzTaskInformation = new QuartzTaskInformations(); // QuartzTaskInformations quartzTaskInformation = new QuartzTaskInformations();
quartzTaskInformation.setId(id); // quartzTaskInformation.setId(id);
quartzTaskInformation.setLastmodifytime(System.currentTimeMillis()); //quartzTaskInformation.setLastmodifytime(System.currentTimeMillis());
this.updateTask(quartzTaskInformation); // this.updateTask(quartzTaskInformation);
return ResultUtil.success(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage()); return ResultUtil.success(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage());
} }
......
server:
port: 4082
spring: spring:
datasource: datasource:
url: jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true url: jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
...@@ -17,37 +19,8 @@ spring: ...@@ -17,37 +19,8 @@ spring:
testOnReturn: false testOnReturn: false
poolPreparedStatements: true poolPreparedStatements: true
maxOpenPreparedStatements: 20 maxOpenPreparedStatements: 20
thymeleaf:
prefix: classpath:/templates/
suffix: .html
cache: false
enabled: true
encoding: UTF-8
mode: HTML
redis:
database: 0
host: 172.16.24.29
# host: 127.0.0.1
port: 6379
logging:
config:
classpath: log/logback-spring.xml
path: /home/prod/deploy/nmys
#logging:
# level:
# root:
# info
local:
czurl: http://localhost:8089/ext/getRTSP/1
fxurl: http://localhost:8089/ext/getDeviceSnapshotAndRecognize
file:
rtspurl: http://172.16.24.29:7080/getDeviceSnapshot
recogurl: http://172.16.24.29:7080/getDeviceSnapshotAndRecognize
uploadurl: http://172.16.24.29:7080/uploadResultFile
countryside:
callbackurl: http://kvideo.51iwifi.com/hesc-mq/hesc/mq/receive/aiCallback
#logging:
# level: local:
# com.cx.cn.cxquartz.dao: czurl: http://localhost:4082/ext/getRTSP/1
# debug fxurl: http://localhost:4082/ext/getDeviceSnapshotAndRecognize
\ No newline at end of file
server:
port: 4085
spring:
datasource:
url: jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
filters: stat
maxActive: 1000
initialSize: 100
maxWait: 60000
minIdle: 500
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
local:
czurl: http://localhost:4085/ext/getRTSP/1
fxurl: http://localhost:4085/ext/getDeviceSnapshotAndRecognize
\ No newline at end of file
server:
port: 8089
spring: spring:
datasource: datasource:
url: jdbc:mysql://192.168.168.110:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true url: jdbc:mysql://192.168.168.110:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
...@@ -17,22 +19,12 @@ spring: ...@@ -17,22 +19,12 @@ spring:
testOnReturn: false testOnReturn: false
poolPreparedStatements: true poolPreparedStatements: true
maxOpenPreparedStatements: 20 maxOpenPreparedStatements: 20
thymeleaf:
prefix: classpath:/templates/
suffix: .html
cache: false
enabled: true
encoding: UTF-8
mode: HTML
redis: redis:
database: 0 database: 0
# host: 172.16.24.29
host: 127.0.0.1 host: 127.0.0.1
port: 6379 port: 6379
logging:
config:
classpath: log/logback-spring.xml
path: /home/prod/deploy/nmys
#logging: #logging:
# level: # level:
# root: # root:
...@@ -45,9 +37,11 @@ file: ...@@ -45,9 +37,11 @@ file:
rtspurl: http://zjh189.ncpoi.cc:7080/getDeviceSnapshot rtspurl: http://zjh189.ncpoi.cc:7080/getDeviceSnapshot
recogurl: http://zjh189.ncpoi.cc:7080/getDeviceSnapshotAndRecognize recogurl: http://zjh189.ncpoi.cc:7080/getDeviceSnapshotAndRecognize
uploadurl: http://home2.ncpoi.cc:7080/uploadResultFile uploadurl: http://home2.ncpoi.cc:7080/uploadResultFile
countryside: countryside:
callbackurl: http://kvideo.51iwifi.com/hesc-mq/hesc/mq/receive/aiCallback11 callbackurl: http://kvideo.51iwifi.com/hesc-mq/hesc/mq/receive
#logging:
# level: logging:
# com.cx.cn.cxquartz.dao: level:
# debug com.cx.cn.cxquartz.dao:
\ No newline at end of file debug
\ No newline at end of file
server:
port: 8089
spring:
datasource:
url: jdbc:mysql://172.16.24.29:3306/hzdxtest?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
username: hzdxtest
password: 1qaz@wsx
driver-class-name: com.mysql.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
filters: stat
maxActive: 1000
initialSize: 100
maxWait: 60000
minIdle: 500
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
local:
czurl: http://localhost:8089/ext/getRTSP/1
fxurl: http://localhost:8089/ext/getDeviceSnapshotAndRecognize
countryside:
callbackurl: http://kvideo.51iwifi.com
file:
rootpath: /home/ubuntu/pictures
logging:
level:
com.cx.cn.cxquartz.dao:
debug
server:
port: 4085
spring: spring:
profiles: profiles:
active: local active: test
mybatis: mybatis:
type-aliases-package: com.cx.cn.cxquartz.bean type-aliases-package: com.cx.cn.cxquartz.bean
...@@ -12,3 +9,17 @@ mybatis: ...@@ -12,3 +9,17 @@ mybatis:
default-fetch-size: 100 default-fetch-size: 100
default-statement-timeout: 3000 default-statement-timeout: 3000
mapper-locations: classpath:mapper/*.xml mapper-locations: classpath:mapper/*.xml
file:
rtspurl: http://172.16.24.29:7180/getDeviceSnapshot
recogurl: http://172.16.24.29:7180/getDeviceSnapshotAndRecognize
uploadurl: http://172.16.24.29:7180/uploadResultFile
rootpath: /home/prod/pictures
outpath: result
redis:
database: 0
host: 172.16.24.29
port: 6379
countryside:
callbackurl: http://kvideo.51iwifi.com/hesc-mq/hesc/mq/receive/aiCallback
DROP TABLE IF EXISTS `quartz_task_informations`;
CREATE TABLE `quartz_task_informations` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`version` int(11) NOT NULL COMMENT '版本号:需要乐观锁控制',
`taskNo` varchar(64) NOT NULL COMMENT '任务编号',
`taskName` varchar(64) NOT NULL COMMENT '任务名称',
`schedulerRule` varchar(64) NOT NULL COMMENT '定时规则表达式',
`frozenStatus` varchar(16) NOT NULL COMMENT '冻结状态',
`executorNo` varchar(128) NOT NULL COMMENT '执行方',
`frozenTime` bigint(13) DEFAULT NULL COMMENT '冻结时间',
`unfrozenTime` bigint(13) DEFAULT NULL COMMENT '解冻时间',
`createTime` bigint(13) NOT NULL COMMENT '创建时间',
`lastModifyTime` bigint(13) DEFAULT NULL COMMENT '最近修改时间',
`sendType` varchar(64) DEFAULT NULL COMMENT '发送方式',
`url` varchar(64) DEFAULT NULL COMMENT '请求地址',
`executeParamter` varchar(2000) DEFAULT NULL COMMENT '执行参数',
`timeKey` varchar(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='定时任务信息表';
DROP TABLE IF EXISTS `quartz_task_records`;
CREATE TABLE `quartz_task_records` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`taskNo` varchar(64) NOT NULL COMMENT '任务编号',
`timeKeyValue` varchar(32) DEFAULT NULL COMMENT '执行时间格式值',
`executeTime` bigint(13) NOT NULL COMMENT '执行时间',
`taskStatus` varchar(16) NOT NULL COMMENT '任务状态',
`failcount` int(10) DEFAULT NULL COMMENT '失败统计数',
`failReason` varchar(64) DEFAULT NULL COMMENT '失败错误描述',
`createTime` bigint(13) NOT NULL COMMENT '创建时间',
`lastModifyTime` bigint(13) DEFAULT NULL COMMENT '最近修改时间',
PRIMARY KEY (`id`),
KEY `idx_task_records_taskno` (`taskNo`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='定时任务执行情况记录表';
DROP TABLE IF EXISTS `quartz_task_errors`;
CREATE TABLE `quartz_task_errors` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`taskExecuteRecordId` varchar(64) NOT NULL COMMENT '任务执行记录Id',
`errorKey` varchar(1024) NOT NULL COMMENT '信息关键字',
`errorValue` text COMMENT '信息内容',
`createTime` bigint(13) NOT NULL COMMENT '创建时间',
`lastModifyTime` bigint(13) DEFAULT NULL COMMENT '最近修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='定时任务出错现场信息表';
...@@ -12,8 +12,6 @@ countryside.eventwrite.url=http://countryside.51iwifi.com/gw/hesc-mq/hesc/mq/rec ...@@ -12,8 +12,6 @@ countryside.eventwrite.url=http://countryside.51iwifi.com/gw/hesc-mq/hesc/mq/rec
countryside.appid=05744e80b2c211ebe32a8e271066b19e countryside.appid=05744e80b2c211ebe32a8e271066b19e
countryside.appsecret=a55a8870b2e911ebe32a8e271066b19e countryside.appsecret=a55a8870b2e911ebe32a8e271066b19e
countryside.tokenurl=http://countryside.51iwifi.com/gw/getAccessToken countryside.tokenurl=http://countryside.51iwifi.com/gw/getAccessToken
file.publicpictureurl=http://zjh189.ncpoi.cc:10001/api/alg/files file.publicpictureurl=http://zjh189.ncpoi.cc:10001/api/alg/files
file.ftppath=jiuling:9ling.cn@172.16.24.29:21 file.ftppath=jiuling:9ling.cn@172.16.24.29:21
...@@ -23,9 +21,7 @@ voice.appKey=9555a51a08a2e1b1c9f02a5b3e9bea11 ...@@ -23,9 +21,7 @@ voice.appKey=9555a51a08a2e1b1c9f02a5b3e9bea11
voice.corpId=587c9d56ee324c0186a86aea85fc7691 voice.corpId=587c9d56ee324c0186a86aea85fc7691
voice.eventId=5 voice.eventId=5
voice.unionId=3YSCA450426N3XP voice.unionId=3YSCA450426N3XP
file.rootpath=/home/prod/pictures
file.outpath=result
file.webrl=http://zjh189.ncpoi.cc:7080
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false"> <configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/> <springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="logs/${spring.application.name}"/> <property name="log.path" value="/home/ubuntu/tar/zjdxtest/logs/${spring.application.name}"/>
<!-- 彩色日志格式 --> <!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN" <property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
select * from select * from
quartz_task_informations b quartz_task_informations b
WHERE WHERE
(taskNo like concat(concat('%fx_',#{rtsp}),'%')) (taskNo = #{rtsp})
and frozenstatus='UNFROZEN' and frozenstatus='UNFROZEN'
</select> </select>
......
...@@ -133,6 +133,9 @@ ...@@ -133,6 +133,9 @@
<if test="objh != null and objh !=''"> <if test="objh != null and objh !=''">
objh =#{objh}, objh =#{objh},
</if> </if>
<if test="processstatus != null and processstatus !=''">
processstatus =#{processstatus},
</if>
</trim> </trim>
where id=#{id} where id=#{id}
......
/* iCheck plugin Flat skin, aero
----------------------------------- */
.icheckbox_flat-aero,
.iradio_flat-aero {
display: inline-block;
*display: inline;
vertical-align: middle;
margin: 0;
padding: 0;
width: 20px;
height: 20px;
background: url(aero.png) no-repeat;
border: none;
cursor: pointer;
}
.icheckbox_flat-aero {
background-position: 0 0;
}
.icheckbox_flat-aero.checked {
background-position: -22px 0;
}
.icheckbox_flat-aero.disabled {
background-position: -44px 0;
cursor: default;
}
.icheckbox_flat-aero.checked.disabled {
background-position: -66px 0;
}
.iradio_flat-aero {
background-position: -88px 0;
}
.iradio_flat-aero.checked {
background-position: -110px 0;
}
.iradio_flat-aero.disabled {
background-position: -132px 0;
cursor: default;
}
.iradio_flat-aero.checked.disabled {
background-position: -154px 0;
}
/* HiDPI support */
@media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) {
.icheckbox_flat-aero,
.iradio_flat-aero {
background-image: url(aero@2x.png);
-webkit-background-size: 176px 22px;
background-size: 176px 22px;
}
}
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
body {
background: #f8f8f8;
font-family: 'PT Sans', Helvetica, Arial, sans-serif;
text-align: center;
color: #fff;
}
.page-container {
margin: 120px auto 0 auto;
}
h1 {
font-size: 30px;
font-weight: 700;
text-shadow: 0 1px 4px rgba(0,0,0,.2);
}
form {
position: relative;
width: 305px;
margin: 15px auto 0 auto;
text-align: center;
}
input {
width: 270px;
height: 42px;
margin-top: 25px;
padding: 0 15px;
background: #2d2d2d; /* browsers that don't support rgba */
background: rgba(45,45,45,.15);
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
border: 1px solid #3d3d3d; /* browsers that don't support rgba */
border: 1px solid rgba(255,255,255,.15);
-moz-box-shadow: 0 2px 3px 0 rgba(0,0,0,.1) inset;
-webkit-box-shadow: 0 2px 3px 0 rgba(0,0,0,.1) inset;
box-shadow: 0 2px 3px 0 rgba(0,0,0,.1) inset;
font-family: 'PT Sans', Helvetica, Arial, sans-serif;
font-size: 14px;
color: #fff;
text-shadow: 0 1px 2px rgba(0,0,0,.1);
-o-transition: all .2s;
-moz-transition: all .2s;
-webkit-transition: all .2s;
-ms-transition: all .2s;
}
input:-moz-placeholder { color: #fff; }
input:-ms-input-placeholder { color: #fff; }
input::-webkit-input-placeholder { color: #fff; }
input:focus {
outline: none;
-moz-box-shadow:
0 2px 3px 0 rgba(0,0,0,.1) inset,
0 2px 7px 0 rgba(0,0,0,.2);
-webkit-box-shadow:
0 2px 3px 0 rgba(0,0,0,.1) inset,
0 2px 7px 0 rgba(0,0,0,.2);
box-shadow:
0 2px 3px 0 rgba(0,0,0,.1) inset,
0 2px 7px 0 rgba(0,0,0,.2);
}
button {
cursor: pointer;
width: 300px;
height: 44px;
margin-top: 25px;
padding: 0;
background: #ef4300;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
border: 1px solid #ff730e;
-moz-box-shadow:
0 15px 30px 0 rgba(255,255,255,.25) inset,
0 2px 7px 0 rgba(0,0,0,.2);
-webkit-box-shadow:
0 15px 30px 0 rgba(255,255,255,.25) inset,
0 2px 7px 0 rgba(0,0,0,.2);
box-shadow:
0 15px 30px 0 rgba(255,255,255,.25) inset,
0 2px 7px 0 rgba(0,0,0,.2);
font-family: 'PT Sans', Helvetica, Arial, sans-serif;
font-size: 14px;
font-weight: 700;
color: #fff;
text-shadow: 0 1px 2px rgba(0,0,0,.1);
-o-transition: all .2s;
-moz-transition: all .2s;
-webkit-transition: all .2s;
-ms-transition: all .2s;
}
button:hover {
-moz-box-shadow:
0 15px 30px 0 rgba(255,255,255,.15) inset,
0 2px 7px 0 rgba(0,0,0,.2);
-webkit-box-shadow:
0 15px 30px 0 rgba(255,255,255,.15) inset,
0 2px 7px 0 rgba(0,0,0,.2);
box-shadow:
0 15px 30px 0 rgba(255,255,255,.15) inset,
0 2px 7px 0 rgba(0,0,0,.2);
}
button:active {
-moz-box-shadow:
0 15px 30px 0 rgba(255,255,255,.15) inset,
0 2px 7px 0 rgba(0,0,0,.2);
-webkit-box-shadow:
0 15px 30px 0 rgba(255,255,255,.15) inset,
0 2px 7px 0 rgba(0,0,0,.2);
box-shadow:
0 5px 8px 0 rgba(0,0,0,.1) inset,
0 1px 4px 0 rgba(0,0,0,.1);
border: 0px solid #ef4300;
}
.error {
display: none;
position: absolute;
top: 27px;
right: -55px;
width: 40px;
height: 40px;
background: #2d2d2d; /* browsers that don't support rgba */
background: rgba(45,45,45,.25);
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
}
.error span {
display: inline-block;
margin-left: 2px;
font-size: 40px;
font-weight: 700;
line-height: 40px;
text-shadow: 0 1px 2px rgba(0,0,0,.1);
-o-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
}
.connect {
width: 305px;
margin: 35px auto 0 auto;
font-size: 18px;
font-weight: 700;
text-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.connect a {
display: inline-block;
width: 32px;
height: 35px;
margin-top: 15px;
-o-transition: all .2s;
-moz-transition: all .2s;
-webkit-transition: all .2s;
-ms-transition: all .2s;
}
.connect a.facebook { background: url(../img/facebook.png) center center no-repeat; }
.connect a.twitter { background: url(../img/twitter.png) center center no-repeat; }
.connect a:hover { background-position: center bottom; }
This diff is collapsed.
/* iCheck plugin Flat skin, red
----------------------------------- */
.icheckbox_flat-red,
.iradio_flat-red {
display: inline-block;
*display: inline;
vertical-align: middle;
margin: 0;
padding: 0;
width: 20px;
height: 20px;
background: url(red.png) no-repeat;
border: none;
cursor: pointer;
}
.icheckbox_flat-red {
background-position: 0 0;
}
.icheckbox_flat-red.checked {
background-position: -22px 0;
}
.icheckbox_flat-red.disabled {
background-position: -44px 0;
cursor: default;
}
.icheckbox_flat-red.checked.disabled {
background-position: -66px 0;
}
.iradio_flat-red {
background-position: -88px 0;
}
.iradio_flat-red.checked {
background-position: -110px 0;
}
.iradio_flat-red.disabled {
background-position: -132px 0;
cursor: default;
}
.iradio_flat-red.checked.disabled {
background-position: -154px 0;
}
/* HiDPI support */
@media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) {
.icheckbox_flat-red,
.iradio_flat-red {
background-image: url(red@2x.png);
-webkit-background-size: 176px 22px;
background-size: 176px 22px;
}
}
\ No newline at end of file
/* ------- This is the CSS Reset ------- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a,
abbr, acronym, address, big, cite, code, del,
dfn, em, img, ins, kbd, q, s, samp, small,
strike, strong, sub, sup, tt, var, u, i, center,
dl, dt, dd, ol, ul, li, fieldset, form, label,
legend, table, caption, tbody, tfoot, thead, tr,
th, td, article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup, menu,
nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* ------- HTML5 display-role reset for older browsers ------- */
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
This diff is collapsed.
This diff is collapsed.
* { margin:0; padding:0; }
body { background:#111; height:100%; }
img { border:none; }
#supersized-loader { position:absolute; top:50%; left:50%; z-index:0; width:60px; height:60px; margin:-30px 0 0 -30px; text-indent:-999em; background:url(/img/backgrounds/progress.gif) no-repeat center center;}
#supersized { display:block; position:fixed; left:0; top:0; overflow:hidden; z-index:-999; height:100%; width:100%; }
#supersized img { width:auto; height:auto; position:relative; display:none; outline:none; border:none; }
#supersized.speed img { -ms-interpolation-mode:nearest-neighbor; image-rendering: -moz-crisp-edges; } /*Speed*/
#supersized.quality img { -ms-interpolation-mode:bicubic; image-rendering: optimizeQuality; } /*Quality*/
#supersized li { display:block; list-style:none; z-index:-30; position:fixed; overflow:hidden; top:0; left:0; width:100%; height:100%; background:#111; }
#supersized a { width:100%; height:100%; display:block; }
#supersized li.prevslide { z-index:-20; }
#supersized li.activeslide { z-index:-10; }
#supersized li.image-loading { background:#111 url(/img/backgrounds/progress.gif) no-repeat center center; width:100%; height:100%; }
#supersized li.image-loading img{ visibility:hidden; }
#supersized li.prevslide img, #supersized li.activeslide img{ display:inline; }
#supersized img { max-width: none !important }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
jQuery(function($){
$.supersized({
// Functionality
slide_interval : 4000, // Length between transitions
transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
transition_speed : 1000, // Speed of transition
performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
// Size & Position
min_width : 0, // Min width allowed (in pixels)
min_height : 0, // Min height allowed (in pixels)
vertical_center : 1, // Vertically center background
horizontal_center : 1, // Horizontally center background
fit_always : 0, // Image will never exceed browser width or height (Ignores min. dimensions)
fit_portrait : 1, // Portrait images will not exceed browser height
fit_landscape : 0, // Landscape images will not exceed browser width
// Components
slide_links : 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank')
slides : [ // Slideshow Images
{image : '/img/backgrounds/1.jpg'},
{image : '/img/backgrounds/2.jpg'},
{image : '/img/backgrounds/3.jpg'}
]
});
});
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>定时任务新增页面</title>
<!-- jquery -->
<script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
<link rel="stylesheet" type="text/css" th:href="@{/css/animate.min.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap.min.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/font-awesome.min.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/mediaelementplayer.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/red.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/simple-line-icons.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>
</head>
<body>
<div class="col-md-12 top-20 padding-0">
<div class="col-md-12">
<div class="panel">
<div class="panel-body">
<div class="panel-heading">
<h4>新增定时任务项</h4>
</div>
<div class="col-md-6" style="padding-left:10px;">
<form action="#" method="post">
<div class="form-group"><label class="col-sm-2 control-label text-right">任务编号:</label>
<div class="col-sm-10"><input type="text" name="taskno" id="taskno" class="form-control">
</div>
</div>
<br/> <br/> <br/>
<div class="form-group"><label class="col-sm-2 control-label text-right">任务名称:</label>
<div class="col-sm-10"><input type="text" name="taskname" id="taskname"
class="form-control"></div>
</div>
<br/> <br/>
<div class="form-group"><label class="col-sm-2 control-label text-right">定时配置规则:</label>
<div class="col-sm-10"><input type="text" placeholder="(例如: * /5 * * * * ? 每5秒执行一次)"
name="schedulerrule" id="schedulerrule" class="form-control">
</div>
</div>
<br/> <br/>
<div class="form-group"><label class="col-sm-2 control-label text-right">冻结状态:</label>
<div class="col-sm-10">
<select class="form-control" id="frozenstatus">
<option th:value="FROZEN" selected="selected" disabled="disabled">冻结</option>
</select>
</div>
</div>
<br/> <br/>
<div class="form-group"><label class="col-sm-2 control-label text-right">执行方:</label>
<div class="col-sm-10"><input type="text" name="executorno" id="executorno"
class="form-control"></div>
</div>
<br/> <br/>
<div class="form-group"><label class="col-sm-2 control-label text-right">执行方式:</label>
<div class="col-sm-10">
<select class="form-control" id="sendtype">
<option th:value="http" >http</option>
<option th:value="kafka" >kafka</option>
</select>
</div>
</div>
<br/> <br/>
<div class="form-group"><label class="col-sm-2 control-label text-right">url:</label>
<div class="col-sm-10"><input type="text" name="url" id="url" class="form-control"></div>
</div>
<br/> <br/>
<div class="form-group"><label class="col-sm-2 control-label text-right">执行参数:</label>
<div class="col-sm-10"><input type="text" name="executeparamter" id="executeparamter"
class="form-control"></div>
</div>
<br/><br/>
<div class="form-group"><label class="col-sm-2 control-label text-right">timeKey:</label>
<div class="col-sm-10"><input type="text" placeholder="(例如: yyyy-MM-dd HH:mm:ss)"
name="timekey" id="timekey" class="form-control"></div>
</div>
<br/> <br/><br/>
<input type="button" class="btn btn-3d btn-danger" th:onclick="'history.go(-1);'" align="left"
style="float:left;margin-left:700px;" value="关闭"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" class="btn btn-3d btn-success" id="savetask" align="right" value="保存"/>
</form>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" th:inline="javascript">
$(function () {
$("#savetask").on('click', function (e) {
var taskno = $("#taskno").val();
var taskname = $("#taskname").val();
var schedulerrule = $("#schedulerrule").val();
var frozenstatus = $("#frozenstatus").val();
var executorno = $("#executorno").val();
var sendtype = $("#sendtype").val();
var url = $("#url").val();
var executeparamter = $("#executeparamter").val();
var timekey = $("#timekey").val();
$.ajax({
url: "/ai/add/task",
dataType: "json",
type: "POST",
data: {
"taskno": taskno,
"taskname": taskname,
"schedulerrule": schedulerrule,
"frozenstatus": frozenstatus,
"executorno": executorno,
"sendtype": sendtype,
"url": url,
"executeparamter": executeparamter,
"timekey": timekey
},
success: function (result) {
if (result.code == 200) {
alert("添加成功!");
location.href = "/";
} else if (result.code == 1001) {
alert("该任务编号已经存在");
}
else {
alert("system error");
}
}
})
});
});
</script>
</body>
</html>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>定时任务后台管理页面</title>
<!-- jquery -->
<script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
<link rel="stylesheet" type="text/css" th:href="@{/css/animate.min.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap.min.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/font-awesome.min.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/mediaelementplayer.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/red.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/simple-line-icons.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>
</head>
<body>
<div class="col-md-12 top-20 padding-0">
<div class="col-md-12">
<div class="panel">
<div class="panel-body">
<div class="col-md-12 padding-0" style="padding-bottom:20px;">
<h2>定时任务列表</h2>
<hr/>
<div class="col-md-6" style="padding-left:10px;">
<form action="import" method="post">
<input type="button" class="btn btn-3d btn-success" style="box-shadow:none;background-color: #73B18D !important;width:70px" onclick="addNewTask()"
value="新增定时任务"/>
</form>
</div>
<div class="col-md-6">
<div class="col-lg-12">
<div class="input-group">
<input type="input" class="form-control" aria-label="..." id="name"/>
<div class="input-group-btn">
<input type="button" id="search" onclick="dosearch()" class="btn btn-3d btn-success" style="box-shadow:none;background-color: #73B18D !important;width:70px;margin-left: 19px;" value="search"/>&nbsp;&nbsp;&nbsp;
</div>
</div>
</div>
</div>
</div>
<div class="responsive-table">
<table class="table table-striped table-bordered" width="100%" cellspacing="0" style="text-align:center;vertical-align:middle;">
<thead>
<tr>
<th style="text-align:center;vertical-align:middle;">任务编号</th>
<th style="text-align:center;vertical-align:middle;">任务名称</th>
<th style="text-align:center;vertical-align:middle;">间隔时间(秒)</th>
<th style="text-align:center;vertical-align:middle;">冻结状态</th>
<th style="text-align:center;vertical-align:middle;">执行参数</th>
<th style="text-align:center;vertical-align:middle;">创建时间</th>
<th style="text-align:center;vertical-align:middle;">最后修改时间</th>
<th style="text-align:center;vertical-align:middle;">操作</th>
</tr>
</thead>
<tbody>
<tr th:each="task:${taskList}">
<td>
<a th:href="@{'/quartz/taskrecords?taskno='+${task.taskno}}" th:text="${task.taskno}"></a>
</td>
<td th:text="${task.taskname}"/>
<td th:text="${task.schedulerrule}"/>
<td>
<span th:if="${task.frozenstatus eq 'UNFROZEN'}">未冻结</span>
<span th:if="${task.frozenstatus eq 'FROZEN'}" style="color:red;">已冻结</span>
</td>
<td th:text="${task.executeparamter}"/>
<td th:text="${#dates.format(task.createtime,'yyyy-MM-dd HH:mm:ss')}"/>
<td th:text="${#dates.format(task.lastmodifytime,'yyyy-MM-dd HH:mm:ss')}"/>
<td>
<span th:if="${task.frozenstatus eq 'UNFROZEN'}"> <input type="button"
class="btn btn-3d btn-danger"
value="暂停" style="box-shadow:none;background-color: #f26c4f !important;width:70px"
th:onclick="'javascript:startOrStop('+${task.taskno}+')'"/>&nbsp;</span>
<span th:if="${task.frozenstatus eq 'FROZEN'}"> <input type="button"
class="btn btn-3d btn-success"
value="启动" style="box-shadow:none;background-color: #73B18D !important;width:70px"
th:onclick="'javascript:startOrStop('+${task.taskno}+')'"/>&nbsp;</span>
<input type="button" class="btn btn-3d btn-success" style="box-shadow:none;background-color: #73B18D !important;width:70px"
th:onclick="'javascript:runRightNow('+${task.taskno}+')'" value="立刻运行一次"/>
<input type="button" class="btn btn-3d btn-success" style="box-shadow:none;background-color: #73B18D !important;width:70px"
th:onclick="'javascript:editpage('+${task.id}+')'" value="修改"/>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6" style="padding-top:20px;">
总共<span style="color: red;" th:text="${size}"/>条记录
</div>
<div class="col-md-6">
<ul class="pagination pull-right">
<li>
<a href="#" aria-label="Previous">
<span aria-hidden="true">上一页</span>
</a>
</li>
<li class="active">
<a href="#">1</a>
</li>
<li>
<a href="#">2</a>
</li>
<li>
<a href="#">3</a>
</li>
<li>
<a href="#">4</a>
</li>
<li>
<a href="#">5</a>
</li>
<li>
<a href="#" aria-label="Next">
<span aria-hidden="true">下一页</span>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" th:inline="javascript">
function editpage(id) {
window.open( "/ai/edit/taskpage?id=" + id);
}
function addNewTask() {
window.open( "/ai/add/taskpage/");
}
function startOrStop(taskNo) {
$.ajax({
url: "/ai/list/optionjob?taskNo=" + taskNo,
type: "GET",
dataType: "json",
success: function (result) {
if (result.code == 200) {
alert("success!");
location.href = "/";
} else if (result.code == 6001) {
alert("任务编号为空!");
} else if (result.code == 1003) {
alert("无此定时任务!");
} else {
alert("system error!");
}
}
});
};
function runRightNow(taskNo) {
$.ajax({
url: "/ai/runtask/rightnow?taskno=" + taskNo,
type: "GET",
dataType: "json",
success: function (result) {
if (result.code == 200) {
alert("运行成功!");
} else if (result.code == 6001) {
alert("任务编号不能为空!");
} else if (result.code == 1003) {
alert("无此定时任务!");
} else {
alert("执行失败!");
}
}
});
}
function dosearch(){
$.ajax({
url: "/ai/list/optionjob?taskNo=" + taskNo,
type: "GET",
dataType: "json",
success: function (result) {
if (result.code == 200) {
alert("success!");
location.href = "/";
} else if (result.code == 6001) {
alert("任务编号为空!");
} else if (result.code == 1003) {
alert("无此定时任务!");
} else {
alert("system error!");
}
}
});
}
</script>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment