|  | @@ -7,6 +7,7 @@ import com.ruoyi.common.utils.DateUtils;
 | 
	
		
			
				|  |  |  import com.ruoyi.sim.domain.Fault;
 | 
	
		
			
				|  |  |  import com.ruoyi.sim.domain.vo.FaultTree;
 | 
	
		
			
				|  |  |  import com.ruoyi.sim.service.IFaultService;
 | 
	
		
			
				|  |  | +import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  import com.ruoyi.sim.mapper.TaskMapper;
 | 
	
	
		
			
				|  | @@ -102,19 +103,22 @@ public class TaskServiceImpl implements ITaskService {
 | 
	
		
			
				|  |  |       *
 | 
	
		
			
				|  |  |       * @return 任务
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -    public Task selectNewTaskViaSimType(String simType) {
 | 
	
		
			
				|  |  | +    public AjaxResult getInfoForAdd(String simType) {
 | 
	
		
			
				|  |  |          // check
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        //
 | 
	
		
			
				|  |  | +        if (StringUtils.isEmpty(simType)) {
 | 
	
		
			
				|  |  | +            return AjaxResult.error("simType empty!");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (!faultService.checkSimTypeOk(simType)) {
 | 
	
		
			
				|  |  | +            return AjaxResult.error("simType value error!");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        // query obj.
 | 
	
		
			
				|  |  | +        Fault q = new Fault();
 | 
	
		
			
				|  |  | +        q.setSimType(simType);
 | 
	
		
			
				|  |  | +        List<FaultTree> ftList = (List<FaultTree>) faultService.selectAllTreeViaSimType(simType).get(AjaxResult.DATA_TAG);
 | 
	
		
			
				|  |  |          Task t = new Task();
 | 
	
		
			
				|  |  | -        // fa 构建用于查询的对象。
 | 
	
		
			
				|  |  | -        Fault fa = new Fault();
 | 
	
		
			
				|  |  | -        fa.setSimType(simType);
 | 
	
		
			
				|  |  | -        AjaxResult ar = faultService.listAllTreeViaSimType(simType);
 | 
	
		
			
				|  |  | -        List<FaultTree> ftList = (List<FaultTree>) ar.get(AjaxResult.DATA_TAG);
 | 
	
		
			
				|  |  |          t.setTaskId(Task.EMPTY_TASK_ID);
 | 
	
		
			
				|  |  |          t.setFaultTreeList(ftList);
 | 
	
		
			
				|  |  | -        return t;
 | 
	
		
			
				|  |  | +        return AjaxResult.success(t);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 |