Commit 2f2163d9 by fudahua

feat:下载显示周期延长到48小时

parent 4aa8a588
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-cloud-data-hook-api</artifactId> <artifactId>gic-cloud-data-hook-api</artifactId>
<version>3.0-SNAPSHOT</version> <version>2.40</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-cloud-web-service-api</artifactId> <artifactId>gic-cloud-web-service-api</artifactId>
<version>3.0-SNAPSHOT</version> <version>3.80</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-cloud-commons</artifactId> <artifactId>gic-cloud-commons</artifactId>
<version>3.0-SNAPSHOT</version> <version>3.64</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-platform-config</artifactId> <artifactId>gic-platform-config</artifactId>
<version>3.0-SNAPSHOT</version> <version>2.26</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -160,7 +160,7 @@ public class DownloadTaskServiceImpl implements IDownloadTaskService { ...@@ -160,7 +160,7 @@ public class DownloadTaskServiceImpl implements IDownloadTaskService {
public void run() { public void run() {
Calendar calc = Calendar.getInstance(); Calendar calc = Calendar.getInstance();
//calc.add(Calendar.DATE, -1); //calc.add(Calendar.DATE, -1);
calc.add(Calendar.HOUR, -12); // 从一天改为 12 小时 calc.add(Calendar.HOUR, -48); // 从一天改为 12 小时
Date expireDate = calc.getTime(); Date expireDate = calc.getTime();
List<DownloadTask> expiredTasks = downloadTaskDao.getExpiredDownloadTaskList(expireDate); List<DownloadTask> expiredTasks = downloadTaskDao.getExpiredDownloadTaskList(expireDate);
if (expiredTasks.size() > 0) { if (expiredTasks.size() > 0) {
......
...@@ -1097,6 +1097,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService { ...@@ -1097,6 +1097,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
} else if (applyStatusText.indexOf("\"checkStatus\":1") > 0) { // 如果审核超时 } else if (applyStatusText.indexOf("\"checkStatus\":1") > 0) { // 如果审核超时
task.setApplyStatus(DownloadApplyStatus.TIMEOUT); task.setApplyStatus(DownloadApplyStatus.TIMEOUT);
task.setApplyPermitted(Global.NO); task.setApplyPermitted(Global.NO);
task.setOverTime(new Date());
conditionRemove = true; conditionRemove = true;
} }
if (conditionRemove || conditionUpdate) { if (conditionRemove || conditionUpdate) {
......
...@@ -750,6 +750,7 @@ public class FreeQueryServiceImpl implements IFreeQueryService { ...@@ -750,6 +750,7 @@ public class FreeQueryServiceImpl implements IFreeQueryService {
conditionUpdate = true; conditionUpdate = true;
} else if (applyStatusText.indexOf("\"checkStatus\":1") > 0) { // 如果审核超时 } else if (applyStatusText.indexOf("\"checkStatus\":1") > 0) { // 如果审核超时
task.setApplyStatus(DownloadApplyStatus.TIMEOUT); task.setApplyStatus(DownloadApplyStatus.TIMEOUT);
task.setOverTime(new Date());
task.setApplyPermitted(Global.NO); task.setApplyPermitted(Global.NO);
conditionRemove = true; conditionRemove = true;
} }
......
...@@ -198,7 +198,8 @@ ...@@ -198,7 +198,8 @@
<update id="updateTaskStatusError"> <update id="updateTaskStatusError">
UPDATE <include refid="updateTable"/> SET UPDATE <include refid="updateTable"/> SET
status = 'error' status = 'error',
over_time=now()
WHERE WHERE
id in id in
<foreach collection="idList" item="item" open="(" close=")" separator=","> <foreach collection="idList" item="item" open="(" close=")" separator=",">
......
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import java.io.FileOutputStream;
import java.util.Date;
public class ExceTest2 {
public static void main(String[] args) {
int n=25;
int c=100;
Double aDouble = Double.valueOf((double) n / c);
System.out.println(aDouble);
}
}
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import java.io.FileOutputStream;
import java.util.Date;
public class ExcelTest {
public static void main(String[] args) {
try {
// String originalFilePath = SAVE_FOLDER + "/" + condition.getTaskId() + ".xlsx";
SXSSFWorkbook wb = new SXSSFWorkbook(100); // 内存中保留 100 行
Sheet sheet = wb.createSheet();
CellStyle cellStyle = wb.createCellStyle();
DataFormat format = wb.createDataFormat();
cellStyle.setDataFormat(format.getFormat("yyyy-MM-dd HH:mm:ss"));
// CellStyle cellStyle = wb.createCellStyle();
// DataFormat format = wb.createDataFormat();
// cellStyle.setDataFormat(format.getFormat("yyyy-MM-dd HH:mm:ss"));
int n=0;
do {
Row row = sheet.createRow(n);
{
Cell midCell = row.createCell(0);
midCell.setCellStyle(cellStyle);
midCell.setCellValue(new Date());
}
{
Cell midCell = row.createCell(1);
// midCell.setCellStyle(cellStyle);
midCell.setCellValue(Math.random());
}
}while (n++<10);
FileOutputStream fileOut = new FileOutputStream("d://test.xlsx");
wb.write(fileOut);
//fileOut.flush(); // SXSSFWorkbook 使用 auto-flush 模式
fileOut.close();
//wb.close();
wb.dispose(); // SXSSFWorkbook 没有 close 方法
}catch (Exception e) {
e.printStackTrace();
}
}
}
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