|
@@ -59,7 +59,7 @@ public class TaskService {
|
|
String simType = t.getSimType();
|
|
String simType = t.getSimType();
|
|
BeanUtils.copyProperties(t, vo);
|
|
BeanUtils.copyProperties(t, vo);
|
|
// 查询获得数据结构。
|
|
// 查询获得数据结构。
|
|
- List<FaultTreeVo> listToQ = (List<FaultTreeVo>) faultService.selectAllTreeViaSimType(simType).get(AjaxResult.DATA_TAG);
|
|
|
|
|
|
+ List<FaultTreeVo> listToQ = (List<FaultTreeVo>) faultService.listAllTreeStyleBySimType(simType).get(AjaxResult.DATA_TAG);
|
|
// 变成扁平list
|
|
// 变成扁平list
|
|
List<FaultTreeVo> listToF = FaultService.flatten(listToQ);
|
|
List<FaultTreeVo> listToF = FaultService.flatten(listToQ);
|
|
for (FaultTreeVo o : listToF) {
|
|
for (FaultTreeVo o : listToF) {
|
|
@@ -106,7 +106,7 @@ public class TaskService {
|
|
if (!simService.checkSimTypeOk(tv.getSimType())) {
|
|
if (!simService.checkSimTypeOk(tv.getSimType())) {
|
|
return AjaxResult.error("simType error!");
|
|
return AjaxResult.error("simType error!");
|
|
}
|
|
}
|
|
- if (!Task.TASK_TYPE_TEACHER_ADD.equals(tv.getTaskType())) {
|
|
|
|
|
|
+ if (!Task.Type.TEACHER_ADD.equals(tv.getTaskType())) {
|
|
return AjaxResult.error("taskType value error!");
|
|
return AjaxResult.error("taskType value error!");
|
|
}
|
|
}
|
|
if (StringUtils.isEmpty(tv.getName())) {
|
|
if (StringUtils.isEmpty(tv.getName())) {
|
|
@@ -159,15 +159,15 @@ public class TaskService {
|
|
/**
|
|
/**
|
|
* 批量删除任务
|
|
* 批量删除任务
|
|
*
|
|
*
|
|
- * @param taskIds 需要删除的任务主键
|
|
|
|
|
|
+ * @param ids 需要删除的任务主键
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
- public AjaxResult deleteTaskByTaskIds(Long[] taskIds) {
|
|
|
|
- if (taskIds == null || taskIds.length == 0) {
|
|
|
|
|
|
+ public AjaxResult deleteTaskByTaskIds(Long[] ids) {
|
|
|
|
+ if (ids == null || ids.length == 0) {
|
|
return AjaxResult.error("taskIds null!");
|
|
return AjaxResult.error("taskIds null!");
|
|
}
|
|
}
|
|
- for (Long tId : taskIds) {
|
|
|
|
|
|
+ for (Long tId : ids) {
|
|
taskMapper.deleteTaskByTaskId(tId);
|
|
taskMapper.deleteTaskByTaskId(tId);
|
|
taskFaultService.deleteTaskFaultByTaskId(tId);
|
|
taskFaultService.deleteTaskFaultByTaskId(tId);
|
|
}
|
|
}
|
|
@@ -202,7 +202,7 @@ public class TaskService {
|
|
if (!simService.checkSimTypeOk(tv.getSimType())) {
|
|
if (!simService.checkSimTypeOk(tv.getSimType())) {
|
|
return AjaxResult.error("simType error!");
|
|
return AjaxResult.error("simType error!");
|
|
}
|
|
}
|
|
- if (!Task.TASK_TYPE_TEACHER_ADD.equals(tv.getTaskType())) {
|
|
|
|
|
|
+ if (!Task.Type.TEACHER_ADD.equals(tv.getTaskType())) {
|
|
return AjaxResult.error("taskType value error!");
|
|
return AjaxResult.error("taskType value error!");
|
|
}
|
|
}
|
|
if (StringUtils.isEmpty(tv.getName())) {
|
|
if (StringUtils.isEmpty(tv.getName())) {
|
|
@@ -252,11 +252,11 @@ public class TaskService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 为了新建,返回一个带tree结构的数据对象。
|
|
|
|
|
|
+ * 为了新建Task,返回一个带tree结构的任务详细信息。
|
|
*
|
|
*
|
|
* @return 任务
|
|
* @return 任务
|
|
*/
|
|
*/
|
|
- public AjaxResult getInfoForAdd(String simType) {
|
|
|
|
|
|
+ public AjaxResult getInfoForAdd(final String simType) {
|
|
// check
|
|
// check
|
|
if (StringUtils.isEmpty(simType)) {
|
|
if (StringUtils.isEmpty(simType)) {
|
|
return AjaxResult.error("simType empty!");
|
|
return AjaxResult.error("simType empty!");
|
|
@@ -265,9 +265,7 @@ public class TaskService {
|
|
return AjaxResult.error("simType value error!");
|
|
return AjaxResult.error("simType value error!");
|
|
}
|
|
}
|
|
// query obj.
|
|
// query obj.
|
|
- Fault q = new Fault();
|
|
|
|
- q.setSimType(simType);
|
|
|
|
- List<FaultTreeVo> ftList = (List<FaultTreeVo>) faultService.selectAllTreeViaSimType(simType).get(AjaxResult.DATA_TAG);
|
|
|
|
|
|
+ List<FaultTreeVo> ftList = (List<FaultTreeVo>) faultService.listAllTreeStyleBySimType(simType).get(AjaxResult.DATA_TAG);
|
|
TaskVo t = new TaskVo();
|
|
TaskVo t = new TaskVo();
|
|
t.setTaskId(Task.EMPTY_TASK_ID);
|
|
t.setTaskId(Task.EMPTY_TASK_ID);
|
|
t.setSelectedData(ftList);
|
|
t.setSelectedData(ftList);
|