duhongyu 2 tygodni temu
rodzic
commit
8cd90426fc

+ 5 - 0
smart-steward-entity/src/main/java/com/smartSteward/entity/database/task/TaskCheck.java

@@ -1,6 +1,8 @@
1 1
 package com.smartSteward.entity.database.task;
2 2
 
3 3
 import java.util.Date;
4
+import java.util.List;
5
+
4 6
 import com.fasterxml.jackson.annotation.JsonFormat;
5 7
 import io.swagger.annotations.ApiModel;
6 8
 import io.swagger.annotations.ApiModelProperty;
@@ -126,4 +128,7 @@ public class TaskCheck extends BaseEntity
126 128
    /** 逻辑删除标识 */
127 129
    @ApiModelProperty("逻辑删除标识")
128 130
    private Long delFlag;
131
+   /** 检查子项列表 */
132
+   @ApiModelProperty("检查子项列表")
133
+   private List<TaskCheckSubItem> taskCheckSubItems;
129 134
 }

+ 18 - 1
smart-steward-entity/src/main/java/com/smartSteward/entity/database/task/TaskCheckItem.java

@@ -1,5 +1,6 @@
1 1
 package com.smartSteward.entity.database.task;
2 2
 
3
+import com.smartSteward.common.annotation.FilePathField;
3 4
 import io.swagger.annotations.ApiModel;
4 5
 import io.swagger.annotations.ApiModelProperty;
5 6
 import lombok.Data;
@@ -34,7 +35,7 @@ public class TaskCheckItem extends BaseEntity
34 35
    @Excel(name = "检查子项ID")
35 36
    @ApiModelProperty("检查子项ID")
36 37
    @NotNull(message = "检查子项ID不能为空")
37
-   private Long subitemId;
38
+   private Long subItemId;
38 39
 
39 40
    /** 检查项名称 */
40 41
    @Excel(name = "检查项名称")
@@ -80,6 +81,7 @@ public class TaskCheckItem extends BaseEntity
80 81
    /** 示例图 */
81 82
    @Excel(name = "示例图")
82 83
    @ApiModelProperty("示例图")
84
+   @FilePathField()
83 85
    private String exampleImage;
84 86
 
85 87
    /** 检查说明 */
@@ -105,11 +107,26 @@ public class TaskCheckItem extends BaseEntity
105 107
    @ApiModelProperty("照片")
106 108
    private String photo;
107 109
    /** 分数 */
110
+   @Excel(name = "分数")
108 111
    @ApiModelProperty("分数")
109 112
    private Integer score;
110 113
 
111 114
    /** 限制分数 */
115
+   @Excel(name = "限制分数")
112 116
    @ApiModelProperty("限制分数")
113 117
    private Integer limitScore;
118
+   /** 输入内容 */
119
+   @Excel(name = "输入内容")
120
+   @ApiModelProperty("输入内容")
121
+   private String inputItem;
122
+
123
+   @Excel(name = "检查结果",readConverterExp = "1=正常,2=异常")
124
+   @ApiModelProperty("检查结果1正常2异常")
125
+   private Long result;
126
+
127
+
128
+
129
+
130
+
114 131
 
115 132
 }

+ 9 - 0
smart-steward-entity/src/main/java/com/smartSteward/entity/database/task/TaskCheckSubItem.java

@@ -8,6 +8,7 @@ import com.smartSteward.common.annotation.Excel;
8 8
 import com.smartSteward.common.core.BaseEntity;
9 9
 
10 10
 import javax.validation.constraints.*;
11
+import java.util.List;
11 12
 
12 13
 /**
13 14
 * 任务检查子项对象 task_check_sub_item
@@ -40,4 +41,12 @@ public class TaskCheckSubItem extends BaseEntity
40 41
    @Excel(name = "排序序号")
41 42
    @ApiModelProperty("排序序号")
42 43
    private Long sortOrder;
44
+
45
+   /** 模板子项主键ID */
46
+   @ApiModelProperty("模板子项主键ID")
47
+   private Long subItemId;
48
+
49
+   /** 检查项列表 */
50
+   @ApiModelProperty("检查项列表")
51
+   private List<TaskCheckItem> taskCheckItems;
43 52
 }

+ 7 - 0
smart-steward-mapper/src/main/java/com/smartSteward/mapper/task/TaskCheckItemMapper.java

@@ -25,6 +25,13 @@ public interface TaskCheckItemMapper
25 25
      * @return 任务检查项集合
26 26
      */
27 27
     public List<TaskCheckItem> selectTaskCheckItemList(TaskCheckItem taskCheckItem);
28
+     /**
29
+     * 批量新增任务检查项
30
+     *
31
+     * @param list 任务检查项列表
32
+     * @return 结果
33
+     */
34
+    public int insertBatchTaskCheckItem(List<TaskCheckItem> list);
28 35
 
29 36
     /**
30 37
      * 新增任务检查项

+ 7 - 0
smart-steward-mapper/src/main/java/com/smartSteward/mapper/task/TaskCheckSubItemMapper.java

@@ -25,6 +25,13 @@ public interface TaskCheckSubItemMapper
25 25
      * @return 任务检查子项集合
26 26
      */
27 27
     public List<TaskCheckSubItem> selectTaskCheckSubItemList(TaskCheckSubItem taskCheckSubItem);
28
+     /**
29
+     * 批量新增任务检查子项
30
+     *
31
+     * @param list 任务检查子项列表
32
+     * @return 结果
33
+     */
34
+    public int insertBatchTaskCheckSubItem(List<TaskCheckSubItem> list);
28 35
 
29 36
     /**
30 37
      * 新增任务检查子项

+ 88 - 12
smart-steward-mapper/src/main/resources/mapper/task/TaskCheckItemMapper.xml

@@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
7 7
     <resultMap type="TaskCheckItem" id="TaskCheckItemResult">
8 8
         <result property="id"    column="id"    />
9 9
         <result property="checkId"    column="check_id"    />
10
-        <result property="subitemId"    column="subitem_id"    />
10
+        <result property="subItemId"    column="sub_item_id"    />
11 11
         <result property="itemName"    column="item_name"    />
12 12
         <result property="isRandom"    column="is_random"    />
13 13
         <result property="tag"    column="tag"    />
@@ -28,17 +28,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
28 28
         <result property="photo"    column="photo"    />
29 29
         <result property="score"    column="score"    />
30 30
         <result property="limitScore"    column="limit_score"    />
31
+        <result property="inputItem"    column="input_item"    />
32
+        <result property="result"    column="result"    />
31 33
     </resultMap>
32 34
 
33 35
     <sql id="selectTaskCheckItemVo">
34
-        select id, check_id, subitem_id, item_name, is_random, tag, has_input, input_content, has_photo, photo_prompt, check_result, example_image, check_description, sort_order, status, create_by, update_by, update_time, create_time, del_flag, photo, score, limit_score from task_check_item
36
+        select id, check_id, sub_item_id, item_name, is_random, tag, has_input, input_content,
37
+        has_photo, photo_prompt, check_result, example_image, check_description, sort_order,
38
+        status, create_by, update_by, update_time, create_time, del_flag, photo, score,
39
+        limit_score, input_item, result from task_check_item
35 40
     </sql>
36 41
 
37 42
     <select id="selectTaskCheckItemList" parameterType="TaskCheckItem" resultMap="TaskCheckItemResult">
38 43
         <include refid="selectTaskCheckItemVo"/>
39 44
         <where>
40 45
             <if test="checkId != null "> and check_id = #{checkId}</if>
41
-            <if test="subitemId != null "> and subitem_id = #{subitemId}</if>
46
+            <if test="subItemId != null "> and sub_item_id = #{subItemId}</if>
42 47
             <if test="itemName != null  and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
43 48
             <if test="isRandom != null "> and is_random = #{isRandom}</if>
44 49
             <if test="tag != null  and tag != ''"> and tag = #{tag}</if>
@@ -54,6 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
54 59
             <if test="delFlag != null "> and del_flag = #{delFlag}</if>
55 60
             <if test="score != null "> and score = #{score}</if>
56 61
             <if test="limitScore != null "> and limit_score = #{limitScore}</if>
62
+            <if test="inputItem != null  and inputItem != ''"> and input_item = #{inputItem}</if>
63
+            <if test="result != null "> and result = #{result}</if>
57 64
             <!-- 如果有station_id字段,则增加站点集合查询条件 -->
58 65
         </where>
59 66
     </select>
@@ -67,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
67 74
         insert into task_check_item
68 75
         <trim prefix="(" suffix=")" suffixOverrides=",">
69 76
             <if test="checkId != null">check_id,</if>
70
-            <if test="subitemId != null">subitem_id,</if>
77
+            <if test="subItemId != null">sub_item_id,</if>
71 78
             <if test="itemName != null and itemName != ''">item_name,</if>
72 79
             <if test="isRandom != null">is_random,</if>
73 80
             <if test="tag != null">tag,</if>
@@ -88,10 +95,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
88 95
             <if test="photo != null">photo,</if>
89 96
             <if test="score != null">score,</if>
90 97
             <if test="limitScore != null">limit_score,</if>
98
+            <if test="inputItem != null and inputItem != ''">input_item,</if>
99
+            <if test="result != null">result,</if>
91 100
         </trim>
92 101
         <trim prefix="values (" suffix=")" suffixOverrides=",">
93 102
             <if test="checkId != null">#{checkId},</if>
94
-            <if test="subitemId != null">#{subitemId},</if>
103
+            <if test="subItemId != null">#{subItemId},</if>
95 104
             <if test="itemName != null and itemName != ''">#{itemName},</if>
96 105
             <if test="isRandom != null">#{isRandom},</if>
97 106
             <if test="tag != null">#{tag},</if>
@@ -112,6 +121,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
112 121
             <if test="photo != null">#{photo},</if>
113 122
             <if test="score != null">#{score},</if>
114 123
             <if test="limitScore != null">#{limitScore},</if>
124
+            <if test="inputItem != null and inputItem != ''">#{inputItem},</if>
125
+            <if test="result != null">#{result},</if>
115 126
         </trim>
116 127
     </insert>
117 128
 
@@ -119,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
119 130
         update task_check_item
120 131
         <trim prefix="SET" suffixOverrides=",">
121 132
             <if test="checkId != null">check_id = #{checkId},</if>
122
-            <if test="subitemId != null">subitem_id = #{subitemId},</if>
133
+            <if test="subItemId != null">sub_item_id = #{subItemId},</if>
123 134
             <if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
124 135
             <if test="isRandom != null">is_random = #{isRandom},</if>
125 136
             <if test="tag != null">tag = #{tag},</if>
@@ -140,18 +151,83 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
140 151
             <if test="photo != null">photo = #{photo},</if>
141 152
             <if test="score != null">score = #{score},</if>
142 153
             <if test="limitScore != null">limit_score = #{limitScore},</if>
154
+            <if test="inputItem != null and inputItem != ''">input_item = #{inputItem},</if>
155
+            <if test="result != null">result = #{result},</if>
143 156
         </trim>
144 157
         where id = #{id} and del_flag = 0
145 158
     </update>
146 159
 
147
-    <delete id="deleteTaskCheckItemById" parameterType="Long">
148
-        delete from task_check_item where id = #{id} and del_flag = 0
149
-    </delete>
150 160
 
151
-    <delete id="deleteTaskCheckItemByIds" parameterType="String">
152
-        delete from task_check_item where id in 
161
+    <sql id="insertBatchSql">
162
+        insert into task_check_item(
163
+        check_id,
164
+        sub_item_id,
165
+        item_name,
166
+        is_random,
167
+        tag,
168
+        has_input,
169
+        input_content,
170
+        has_photo,
171
+        photo_prompt,
172
+        check_result,
173
+        example_image,
174
+        check_description,
175
+        sort_order,
176
+        status,
177
+        create_by,
178
+        update_by,
179
+        update_time,
180
+        create_time,
181
+        del_flag,
182
+        photo,
183
+        score,
184
+        limit_score,
185
+        input_item,
186
+        result
187
+        )
188
+        values
189
+        <foreach collection="list" item="item" separator=",">
190
+            (
191
+            #{item.checkId},
192
+            #{item.subItemId},
193
+            #{item.itemName},
194
+            #{item.isRandom},
195
+            #{item.tag},
196
+            #{item.hasInput},
197
+            #{item.inputContent},
198
+            #{item.hasPhoto},
199
+            #{item.photoPrompt},
200
+            #{item.checkResult},
201
+            #{item.exampleImage},
202
+            #{item.checkDescription},
203
+            #{item.sortOrder},
204
+            #{item.status},
205
+            #{item.createBy},
206
+            #{item.updateBy},
207
+            #{item.updateTime},
208
+            #{item.createTime},
209
+            #{item.delFlag},
210
+            #{item.photo},
211
+            #{item.score},
212
+            #{item.limitScore},
213
+            #{item.inputItem},
214
+            #{item.result},
215
+            )
216
+        </foreach>
217
+    </sql>
218
+
219
+    <insert id="insertBatchTaskCheckItem"  useGeneratedKeys="true" keyProperty="id">
220
+        <include refid="insertBatchSql"/>
221
+    </insert>
222
+
223
+    <update id="deleteTaskCheckItemById" parameterType="Long">
224
+       update task_check_item set del_flag = 1 where id = #{id} and del_flag = 0
225
+    </update>
226
+
227
+    <update id="deleteTaskCheckItemByIds" parameterType="String">
228
+        update task_check_item set del_flag = 1 where id in
153 229
         <foreach item="id" collection="array" open="(" separator="," close=")">
154 230
             #{id}
155 231
         </foreach>
156
-    </delete>
232
+    </update>
157 233
 </mapper>

+ 22 - 0
smart-steward-mapper/src/main/resources/mapper/task/TaskCheckSubItemMapper.xml

@@ -44,6 +44,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
44 44
          </trim>
45 45
     </insert>
46 46
 
47
+    <sql id="insertBatchSql">
48
+        insert into task_check_sub_item(
49
+            check_id,
50
+            name,
51
+            sort_order
52
+        )
53
+        values
54
+        <foreach collection="list" item="item" separator=",">
55
+            (
56
+                #{item.checkId},
57
+                #{item.name},
58
+                #{item.sortOrder}
59
+            )
60
+        </foreach>
61
+    </sql>
62
+
63
+    <insert id="insertBatchTaskCheckSubItem"  useGeneratedKeys="true" keyProperty="id">
64
+        <include refid="insertBatchSql"/>
65
+    </insert>
66
+
67
+
68
+
47 69
     <update id="updateTaskCheckSubItem" parameterType="TaskCheckSubItem">
48 70
         update task_check_sub_item
49 71
         <trim prefix="SET" suffixOverrides=",">

+ 122 - 56
smart-steward-service/src/main/java/com/smartSteward/service/schedule/impl/ScheduleTasksServiceImpl.java

@@ -13,9 +13,7 @@ import com.smartSteward.entity.database.task.*;
13 13
 import com.smartSteward.entity.view.system.SysUserStationResult;
14 14
 import com.smartSteward.mapper.inspection.InspectionMainMapper;
15 15
 import com.smartSteward.mapper.system.SysUserMapper;
16
-import com.smartSteward.mapper.task.TaskAttachmentMapper;
17
-import com.smartSteward.mapper.task.TaskCheckMapper;
18
-import com.smartSteward.mapper.task.TaskPhotoMapper;
16
+import com.smartSteward.mapper.task.*;
19 17
 import com.smartSteward.service.inspection.IInspectionMainService;
20 18
 import org.springframework.beans.factory.annotation.Autowired;
21 19
 import org.springframework.stereotype.Service;
@@ -42,7 +40,10 @@ public class ScheduleTasksServiceImpl implements IScheduleTasksService {
42 40
     private TaskCheckMapper taskCheckMapper;
43 41
     @Autowired
44 42
     private InspectionMainMapper inspectionMainMapper;
45
-
43
+    @Autowired
44
+    private TaskCheckSubItemMapper taskCheckSubItemMapper;
45
+    @Autowired
46
+    private TaskCheckItemMapper taskCheckItemMapper;
46 47
 
47 48
 
48 49
     /**
@@ -71,7 +72,7 @@ public class ScheduleTasksServiceImpl implements IScheduleTasksService {
71 72
     public String validateTask(ScheduleTasks scheduleTasks) {
72 73
 
73 74
         if (Objects.equals(scheduleTasks.getFormType(), FormTypeEnum.INSPECTION.getCode())
74
-                &&scheduleTasks.getChecklist()==null) {
75
+                && scheduleTasks.getChecklist() == null) {
75 76
             return "请选择检查表单";
76 77
         }
77 78
         return "";
@@ -397,67 +398,132 @@ public class ScheduleTasksServiceImpl implements IScheduleTasksService {
397 398
         int insert = taskCheckMapper.insertTaskCheck(taskCheck);
398 399
         if (insert > 0) {
399 400
             if (scheduleTasks.getChecklist() != null) {
401
+                List<TaskCheckItem> taskCheckItems = new ArrayList<>();
402
+                List<TaskCheckSubItem> taskCheckSubItems = new ArrayList<>();
400 403
                 //获取检查表单
401 404
                 InspectionMain inspectionMain = inspectionMainMapper.selectInspectionById(scheduleTasks.getChecklist());
402 405
                 if (inspectionMain != null) {
406
+                    if (inspectionMain.getSubItems() != null && inspectionMain.getSubItems().size() > 0) {
407
+                        //遍历子项
408
+                        inspectionMain.getSubItems().forEach(subItem -> {
409
+                            //创建子项
410
+                            TaskCheckSubItem taskCheckSubItem = new TaskCheckSubItem();
411
+                            taskCheckSubItem.setCheckId(taskCheck.getId());
412
+                            taskCheckSubItem.setName(subItem.getName());
413
+                            taskCheckSubItem.setSortOrder(subItem.getSortOrder());
414
+                            taskCheckSubItem.setSubItemId(subItem.getId());
415
+                            taskCheckSubItems.add(taskCheckSubItem);
416
+                        });
417
+                    }
418
+
419
+                    if (taskCheckSubItems.size() > 0) {
420
+                        //批量新增子项
421
+                        taskCheckSubItemMapper.insertBatchTaskCheckSubItem(taskCheckSubItems);
422
+                        if (inspectionMain.getItems() != null && inspectionMain.getItems().size() > 0) {
423
+                            //遍历检查项
424
+                            inspectionMain.getItems().forEach(item -> {
425
+                                TaskCheckItem taskCheckItem = new TaskCheckItem();
426
+                                //设置检查项id
427
+                                taskCheckItem.setCheckId(taskCheck.getId());
428
+                                //设置子项id
429
+                                taskCheckItem.setSubItemId(taskCheckSubItems.stream()
430
+                                        .filter(subItem -> subItem.getSubItemId().equals(item.getSubItemId()))
431
+                                        .findFirst()
432
+                                        .map(TaskCheckSubItem::getId)
433
+                                        .orElse(null));
434
+                                //设置检查项名称
435
+                                taskCheckItem.setItemName(item.getItemName());
436
+                                //设置是否随机
437
+                                taskCheckItem.setIsRandom(item.getIsRandom());
438
+                                //设置标签
439
+                                taskCheckItem.setTag(item.getTag());
440
+                                //设置是否有输入项
441
+                                taskCheckItem.setHasInput(item.getHasInput());
442
+                                //设置输入项内容/提示
443
+                                taskCheckItem.setInputContent(item.getInputContent());
444
+                                //设置是否有拍照
445
+                                taskCheckItem.setHasPhoto(item.getHasPhoto());
446
+                                //设置拍照提示
447
+                                taskCheckItem.setPhotoPrompt(item.getPhotoPrompt());
448
+                                //设置检查结果
449
+                                taskCheckItem.setCheckResult(item.getCheckResult());
450
+                                //设置示例图
451
+                                taskCheckItem.setExampleImage(item.getExampleImage());
452
+                                //设置检查说明
453
+                                taskCheckItem.setCheckDescription(item.getCheckDescription());
454
+                                //设置排序序号
455
+                                taskCheckItem.setSortOrder(item.getSortOrder());
456
+                                //设置状态
457
+                                taskCheckItem.setStatus(item.getStatus());
458
+                                //设置限制分数
459
+                                taskCheckItem.setLimitScore(item.getLimitScore());
460
+                                taskCheckItems.add(taskCheckItem);
461
+                            });
462
+                        }
463
+                    }
464
+                    if (taskCheckItems.size() > 0) {
403 465
 
466
+                        //去除子项id为null的检查项
467
+                        taskCheckItems.removeIf(item -> item.getSubItemId() == null);
468
+                        if(taskCheckItems.size() > 0){
469
+                            //批量新增检查项
470
+                            taskCheckItemMapper.insertBatchTaskCheckItem(taskCheckItems);
471
+                        }
472
+                    }
404 473
                 }
405 474
             }
406 475
             return taskCheck.getId();
407 476
         }
408
-        return insert;
409
-    }
410
-
411
-
477
+         return insert;
412 478
 
479
+     }
413 480
 
414 481
 
482
+        /**
483
+         * 获取任务时间
484
+         *
485
+         * @param day           天
486
+         * @param hour          小时
487
+         * @param frequencyEnum 任务频率枚举
488
+         * @return 任务时间
489
+         */
490
+        private Date getTime (Long day, Long hour, TaskFrequencyEnum frequencyEnum){
491
+            Date nextExecutionTime = null;
492
+            Date startTime = null;
493
+            switch (frequencyEnum) {
494
+                case DAILY:
495
+                    if (day == -1) {
496
+                        //如果是-1,说明开始日期是前一天获取前一天日期
497
+                        startTime = DateUtils.addDays(new Date(), -1);
498
+                    } else {
499
+                        startTime = new Date();
500
+                    }
501
+                    break;
502
+                case WEEKLY:
503
+                    // 获取今日是本周第几天
504
+                    int currentDayOfWeek = DateUtils.getDayOfWeek(new Date());
505
+                    if (day >= currentDayOfWeek) {
506
+                        // 如果开始时间在当前时间之后,说明开始时间就是本周
507
+                        startTime = DateUtils.getThisWeekDate(day);
508
+                    } else {
509
+                        // 如果开始时间在当前时间之前,说明开始时间是下周
510
+                        startTime = DateUtils.getNextWeekDate(day);
511
+                    }
512
+                    break;
513
+                case MONTHLY:
514
+                    //获取符合条件的日期
515
+                    startTime = DateUtils.generateDate(Math.toIntExact(day), Math.toIntExact(hour));
516
+                    break;
517
+                default:
518
+                    startTime = DateUtils.addDays(new Date(), (int) (day - 1));
519
+                    break;
520
+            }
521
+            //获取开始日期的时间字符串,格式为yyyy-MM-dd
522
+            String dateTime = DateUtils.dateTime(startTime);
523
+            //将时间字符串解析为Date对象,格式为yyyy-MM-dd HH:mm:ss
524
+            nextExecutionTime = DateUtils.parseDate(
525
+                    dateTime + " " + hour + ":00");
526
+            return nextExecutionTime;
415 527
 
416
-    /**
417
-     * 获取任务时间
418
-     *
419
-     * @param day           天
420
-     * @param hour          小时
421
-     * @param frequencyEnum 任务频率枚举
422
-     * @return 任务时间
423
-     */
424
-    private Date getTime(Long day, Long hour, TaskFrequencyEnum frequencyEnum) {
425
-        Date nextExecutionTime = null;
426
-        Date startTime = null;
427
-        switch (frequencyEnum) {
428
-            case DAILY:
429
-                if (day == -1) {
430
-                    //如果是-1,说明开始日期是前一天获取前一天日期
431
-                    startTime = DateUtils.addDays(new Date(), -1);
432
-                } else {
433
-                    startTime = new Date();
434
-                }
435
-                break;
436
-            case WEEKLY:
437
-                // 获取今日是本周第几天
438
-                int currentDayOfWeek = DateUtils.getDayOfWeek(new Date());
439
-                if (day >= currentDayOfWeek) {
440
-                    // 如果开始时间在当前时间之后,说明开始时间就是本周
441
-                    startTime = DateUtils.getThisWeekDate(day);
442
-                } else {
443
-                    // 如果开始时间在当前时间之前,说明开始时间是下周
444
-                    startTime = DateUtils.getNextWeekDate(day);
445
-                }
446
-                break;
447
-            case MONTHLY:
448
-                //获取符合条件的日期
449
-                startTime = DateUtils.generateDate(Math.toIntExact(day), Math.toIntExact(hour));
450
-                break;
451
-            default:
452
-                startTime = DateUtils.addDays(new Date(), (int) (day - 1));
453
-                break;
454 528
         }
455
-        //获取开始日期的时间字符串,格式为yyyy-MM-dd
456
-        String dateTime = DateUtils.dateTime(startTime);
457
-        //将时间字符串解析为Date对象,格式为yyyy-MM-dd HH:mm:ss
458
-        nextExecutionTime = DateUtils.parseDate(
459
-                dateTime + " " + hour + ":00");
460
-        return nextExecutionTime;
461
-
462
-    }
463
-}
529
+    }