Browse Source

feat: 风控v4.1.1 处理结束时间

shc 3 years ago
parent
commit
ae8bb87512

+ 13 - 1
hnqz-visual/hnqz-daemon-quartz/src/main/java/com/qunzhixinxi/hnqz/daemon/quartz/controller/SysJobLogController.java

@@ -31,6 +31,10 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.time.LocalDateTime;
+import java.time.temporal.ChronoUnit;
+import java.util.concurrent.TimeUnit;
+
 /**
  * @author frwcloud
  * <p>
@@ -53,7 +57,7 @@ public class SysJobLogController {
 	 */
 	@GetMapping("/page")
 	@ApiOperation(value = "分页定时任务日志查询")
-	public R getSysJobLogPage(Page page, SysJobLog sysJobLog) {
+	public R getSysJobLogPage(Page<SysJobLog> page, SysJobLog sysJobLog) {
 
 
 		sysJobLogService.page(page, Wrappers.<SysJobLog>lambdaQuery()
@@ -63,6 +67,14 @@ public class SysJobLogController {
 				.between(sysJobLog.getStartTime() != null && sysJobLog.getEndTime() != null, SysJobLog::getCreateTime, sysJobLog.getStartTime(), sysJobLog.getEndTime())
 		);
 
+		page.getRecords().forEach(r -> {
+			LocalDateTime createTime = r.getCreateTime();
+			String executeTime = r.getExecuteTime();
+			int execTime = StrUtil.isBlank(executeTime)? 0 : Integer.parseInt(executeTime);
+			LocalDateTime plus = createTime.plus(execTime, ChronoUnit.MILLIS);
+			r.setEndTime(plus);
+		});
+
 		return R.ok(page);
 	}