From 0ae1dd1104e8f3a57e70e177c478a11ec3bbc88a Mon Sep 17 00:00:00 2001 From: chengyufei <1932574737@qq.com> Date: Fri, 28 Jul 2023 17:08:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=A2=84=E8=AE=A1=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E6=97=B6=E9=97=B42.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/task/modules/TaskForm.vue | 225 +++++++++--------- .../task/controller/TaskController.java | 10 + 2 files changed, 122 insertions(+), 113 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue b/ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue index 0ddb167..399f3b8 100644 --- a/ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue +++ b/ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue @@ -5,24 +5,17 @@ - + - - - - - - - + + + + + + + @@ -31,26 +24,27 @@ - + - + - + - +
{{ item.type_Name }} - + {{ child.type_Name }} @@ -62,66 +56,59 @@ - + - - - - - + + + + + - + - + - - + + - + style="width: 80%"> + - + + placeholder="请选择任务状态" style="width: 100%" /> @@ -129,7 +116,7 @@ - + @@ -137,36 +124,37 @@ - + - + - + - + - + - + @@ -193,13 +181,13 @@ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java index 6e8d9bf..fafd347 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java @@ -454,6 +454,8 @@ public class TaskController extends JeecgController { return workTime; }else { //时间跨度没有超过两天 + if (startTime.compareTo(date4) >= 0) + return workTime; //任务是下午下班之后发布的,且是下班之后提交的,没有多余工作时间 if (startTime.compareTo(date1) <= 0) startTime = date1; //发布任务在8点之前 if (startTime.compareTo(date2) <= 0){ @@ -530,6 +532,11 @@ public class TaskController extends JeecgController { long tempTime = 0; if (startTime.compareTo(date1) <= 0) startTime = date1; //任务发布在8点半之前,修正时间 + if (startTime.compareTo(date4) >= 0){ + startTime = date1; //任务发布在晚上下班后,修正到第二天早上上班时间 + offset ++; + } + if (startTime.compareTo(date2) < 0){ //上午发布任务 tempTime = date2.getTime() - startTime.getTime(); @@ -547,6 +554,8 @@ public class TaskController extends JeecgController { tempTime = date4.getTime() - startTime.getTime(); if (tempTime >= millisecond) return new Date(startTime.getTime() + millisecond + DAYTIME*offset); + else + millisecond -= tempTime; } //时间修正,天数偏移量加1,到这里有两中情况,1、白天工作时间不足抵消 2、下午6点之后发布任务 offset ++; @@ -557,6 +566,7 @@ public class TaskController extends JeecgController { return new Date(startTime.getTime() + millisecond + DAYTIME*offset); //上午偏移不足,下午一定够,因为不会跨两天 millisecond -= tempTime; + startTime = date3; return new Date(startTime.getTime() + millisecond + DAYTIME*offset); }