From 9aafec73f2a5df0ccee2712505c63d44d91336c6 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期一, 28 四月 2025 14:40:09 +0800 Subject: [PATCH] 1、端口、IP、标签配置.docx文档修改:民勤配置项变化; 2、农户取水年度统计逻辑变化; 3、灌溉计划迟延时间可配置。 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ThreadJob.java | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ThreadJob.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ThreadJob.java new file mode 100644 index 0000000..cfd912a --- /dev/null +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ThreadJob.java @@ -0,0 +1,41 @@ +package com.dy.common.util; + + +@SuppressWarnings("unused") +@Deprecated +public abstract class ThreadJob { + protected Thread thread ; + protected boolean stop = false ; + public void stop(){ + this.stop = true ; + } + public boolean isStop(){ + return this.stop ; + } + public Thread getThread(){ + return this.thread ; + } + public void start(Callback callback) throws Exception { + this.thread = new Thread(() -> { + Exception[] exe = {null} ; + Object[] obj = {null} ; + try { + obj[0] = execute() ; + }catch(Exception e){ + e.printStackTrace(); + exe[0] = e ; + }finally { + if(callback != null){ + if(exe[0] != null){ + callback.exception(exe[0]); + }else{ + callback.call(obj[0]); + } + } + } + }); + thread.start() ; + } + public abstract Object execute() throws Exception ; +} + -- Gitblit v1.8.0