|
|
@@ -5,6 +5,7 @@ import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import com.ruoyi.common.enums.ExecutorName;
|
|
|
+import com.ruoyi.common.utils.Arith;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.interfaces.domain.vo.FlowDispatchBatchVo;
|
|
|
import com.ruoyi.interfaces.domain.vo.JobTaskVo;
|
|
|
@@ -53,7 +54,7 @@ public class MdFlowDispatchController extends BaseController {
|
|
|
flowDispatchVo.setUpdateBy(getUsername());
|
|
|
flowDispatchVo.setJobName(flowDispatchVo.getFlowJobName());
|
|
|
Long update = mdFlowDispatchService.update(flowDispatchVo);
|
|
|
- if (update.equals(0L))return error("更新失败");
|
|
|
+ if (update.equals(0L)) return error("更新失败");
|
|
|
return success();
|
|
|
}
|
|
|
|
|
|
@@ -62,16 +63,16 @@ public class MdFlowDispatchController extends BaseController {
|
|
|
MdFlowDispatchVo info = mdFlowDispatchService.getInfo(id);
|
|
|
if (StringUtils.isNull(info)) return error("任务不存在");
|
|
|
if ("1".equals(info.getJobStatus())) return error("请先关闭任务");
|
|
|
-
|
|
|
- Long delete = mdFlowDispatchService.delete(id);
|
|
|
Set<Long> ids = new HashSet<>();
|
|
|
ids.add(info.getId());
|
|
|
SnailJobOpenApi.deleteJob(ids).execute();
|
|
|
+ Long delete = mdFlowDispatchService.delete(id);
|
|
|
return success(delete);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 计算任务执行批次
|
|
|
+ *
|
|
|
* @param par
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -80,12 +81,21 @@ public class MdFlowDispatchController extends BaseController {
|
|
|
public TableDataInfo getBatchDataTable(FlowDispatchBatchVo par) {
|
|
|
startPage();
|
|
|
List<FlowDispatchBatchVo> data = mdFlowDispatchService.selectFlowDispatchBatch(par);
|
|
|
+ data.forEach(item -> {
|
|
|
+ if (StringUtils.isNotNull(item.getExecutionAt()) && StringUtils.isNotNull(item.getCreateDt())) {
|
|
|
+ double sub = Arith.sub(item.getExecutionAt(), item.getCreateDt().getTime());
|
|
|
+ item.setExecutionAtMi(Arith.div(sub, 1000, 2)
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
return getDataTable(data);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 计算任务详情
|
|
|
+ *
|
|
|
* @param par
|
|
|
* @return
|
|
|
*/
|