|
@@ -3,9 +3,11 @@ package com.ruoyi.sim.service.impl;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.sim.domain.TaskFault;
|
|
import com.ruoyi.sim.domain.TaskFault;
|
|
import com.ruoyi.sim.domain.vo.FaultTree;
|
|
import com.ruoyi.sim.domain.vo.FaultTree;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -105,15 +107,23 @@ public class FaultServiceImpl implements IFaultService {
|
|
* @return 故障
|
|
* @return 故障
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<FaultTree> selectFaultListAllTree(Fault fault) {
|
|
|
|
- //
|
|
|
|
|
|
+ public AjaxResult listAllTreeViaSimType(String simType) {
|
|
|
|
+ if (StringUtils.isEmpty(simType)) {
|
|
|
|
+ return AjaxResult.error("simType empty!");
|
|
|
|
+ }
|
|
|
|
+ if (!checkSimTypeOk(simType)) {
|
|
|
|
+ return AjaxResult.error("simType value error!");
|
|
|
|
+ }
|
|
|
|
+ // query obj.
|
|
|
|
+ Fault q = new Fault();
|
|
|
|
+ q.setSimType(simType);
|
|
// fault.getParams().put(TableSupport.PAGE_NUM, 1);
|
|
// fault.getParams().put(TableSupport.PAGE_NUM, 1);
|
|
// fault.getParams().put(TableSupport.PAGE_SIZE, 100);
|
|
// fault.getParams().put(TableSupport.PAGE_SIZE, 100);
|
|
//
|
|
//
|
|
- List<Fault> list = faultMapper.selectFaultList(fault);
|
|
|
|
|
|
+ List<Fault> list = faultMapper.selectFaultList(q);
|
|
log.info("AAAAAAAAAAAAAAAAAAAAAAAAAAAA000000000000");
|
|
log.info("AAAAAAAAAAAAAAAAAAAAAAAAAAAA000000000000");
|
|
log.info(Objects.requireNonNull(list).toString());
|
|
log.info(Objects.requireNonNull(list).toString());
|
|
- log.info(Objects.requireNonNull(fault.getParams()).toString());
|
|
|
|
|
|
+ log.info(Objects.requireNonNull(q.getParams()).toString());
|
|
log.info(Objects.requireNonNull(list.size()).toString());
|
|
log.info(Objects.requireNonNull(list.size()).toString());
|
|
|
|
|
|
List<FaultTree> tempListNode = new ArrayList<>();
|
|
List<FaultTree> tempListNode = new ArrayList<>();
|
|
@@ -125,7 +135,7 @@ public class FaultServiceImpl implements IFaultService {
|
|
log.info(Objects.requireNonNull(tempListNode).toString());
|
|
log.info(Objects.requireNonNull(tempListNode).toString());
|
|
List<FaultTree> tree = toTree(tempListNode, ROOT_FAULT_ID);
|
|
List<FaultTree> tree = toTree(tempListNode, ROOT_FAULT_ID);
|
|
log.info(Objects.requireNonNull(tree).toString());
|
|
log.info(Objects.requireNonNull(tree).toString());
|
|
- return tree;
|
|
|
|
|
|
+ return AjaxResult.success(tree);
|
|
}
|
|
}
|
|
|
|
|
|
public static final String SIM_TYPE_0001 = "0001";
|
|
public static final String SIM_TYPE_0001 = "0001";
|
|
@@ -142,7 +152,7 @@ public class FaultServiceImpl implements IFaultService {
|
|
* @param simType
|
|
* @param simType
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public boolean checkSimType(String simType) {
|
|
|
|
|
|
+ public boolean checkSimTypeOk(String simType) {
|
|
return SIM_TYPE_SET.contains(simType);
|
|
return SIM_TYPE_SET.contains(simType);
|
|
}
|
|
}
|
|
|
|
|