升级shiro

master
linjj 2 years ago
parent 7a6e0df6fd
commit dcf38e9eca

@ -28,7 +28,7 @@
<jdk.version>1.8</jdk.version>
<mockito.version>1.9.5</mockito.version>
<!--<spring.version>3.2.2.RELEASE</spring.version>-->
<shiro.version>1.2.2</shiro.version>
<shiro.version>1.12.0</shiro.version>
<quartz.version>2.2.1</quartz.version>
<jetty.version>7.6.11.v20130520</jetty.version>
<servlet.version>2.4</servlet.version>
@ -128,11 +128,11 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>fastjson</artifactId>-->
<!-- <version>${fastjson.version}</version>-->
<!-- </dependency>-->
<!-- 日志处理 -->
<dependency>
<groupId>org.slf4j</groupId>

@ -1,11 +1,20 @@
package com.emr.controller;
import com.emr.service.ipml.CaSignServiceImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.util.FileSystemUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* @author
@ -16,13 +25,57 @@ import javax.annotation.Resource;
public class TestController {
@Resource
private CaSignServiceImpl caSignService;
@Value("${caCopyPath}")
private String caCopyPath;
@RequestMapping("font/test")
@ResponseBody
public String test(String masterId) throws Exception{
public String test(String masterId) throws Exception {
long start = System.currentTimeMillis();
caSignService.caSignByMasterId(masterId);
long end = System.currentTimeMillis();
System.out.println("执行后:"+(end-start));
System.out.println("执行后:" + (end - start));
return "完成";
}
/**
*
*
* @param args liuyu
*/
public static void main(String[] args) {
Date date1 = new Date();
Calendar calendar = Calendar.getInstance(); //得到日历
calendar.setTime(date1);//把当前时间赋给日历
calendar.add(calendar.DATE, -15); //设置为前15天
Date date2 = calendar.getTime();//获取15天前的时间
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date date;
//转换成时间戳
long t1 = date2.getTime();
try {
File f = new File("D:\\docus\\caCopy");
File[] files = f.listFiles();
for (int i = 0; i < files.length; i++) {
//获取文件路径
String filePath = files[i].getCanonicalPath();
//获取文件名,文件名为yyyy--mm--dd格式时间
String lastTime = files[i].getName();
//将lastTime时间转为long类型
try {
date = format.parse(lastTime);
} catch (ParseException e) {
throw new RuntimeException(e);
}
Long timestamp = date.getTime();
if (timestamp < t1) {
//删除
FileSystemUtils.deleteRecursively(new File(filePath));
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

@ -46,6 +46,9 @@ public class taskController {
@Value("${autoPdfUrl}")
private String autoPdfUrl;
@Value("${waterTifToJpgPath}")
private String waterTifToJpgPath;
//@Scheduled(cron="0/1 * * * * ? ") //每1秒执行一次
@Scheduled(cron="${fileDelay}")//每天4点触发cron="0 0 4 * * ?"
public void task() throws IOException {
@ -107,6 +110,13 @@ public class taskController {
} catch (IOException e) {
e.printStackTrace();
}
File file = new File(waterTifToJpgPath);
if (file.isDirectory()) {
for (File f : file.listFiles()) {
f.delete();
}
}
}

@ -72,4 +72,6 @@ pdfWater = \u5E7F\u4E1C\u533B\u79D1\u5927\u5B66\u9644\u5C5E\u533B\u9662
#POWER_URLHEAD=http://120.27.212.36:8888/power
#power\u6743\u9650\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934\u5982\uFF1Ahttp://192.168.1.3:8081/power
PdfIsError = C:\\Users\\Administrator\\Desktop\\test\\test070802
PdfIsError = C:\\Users\\Administrator\\Desktop\\test\\test070802
waterTifToJpgPath = D:/jiashi/tifToJpgLoad/
Loading…
Cancel
Save