1、将任务列表中,难度系数为0的置为null

This commit is contained in:
2026-03-11 14:27:43 +08:00
parent bb34762d06
commit 933acc8d79

View File

@@ -172,6 +172,8 @@ public class TaskServiceImpl implements ITaskService {
private static final String CONVERT_CREATE_DIR_ERROR_MSG_DIR_EXIST = "任务已存在";
private static final float EPSILON = 1e-6f;
/**
* 预处理请求参数
@@ -1079,6 +1081,13 @@ public class TaskServiceImpl implements ITaskService {
System.out.println("===== 格式化打印所有任务耗时(推荐日志输出) =====");
System.out.println(stopWatch.prettyPrint()); // Spring内置格式化含耗时百分比直接打印日志即可
// 11. 最终返回
// 20260311 如果任务中的难度系数为0就设置为null
for (SpdmNewTaskVo spdmNewTaskVo : newTaskList) {
Float difficult = spdmNewTaskVo.getDifficult();
if (difficult != null && Math.abs(difficult) < EPSILON) {
spdmNewTaskVo.setDifficult(null);
}
}
jsonObject.put("data", newTaskList);
jsonObject.put("currentPage", req.getCurrent());
jsonObject.put("pageSize", req.getSize());