|
|
@ -36,6 +36,7 @@ import com.epmet.dto.form.CustomerGridFormDTO; |
|
|
|
import com.epmet.dto.form.PatrolRoutineWorkFormDTO; |
|
|
|
import com.epmet.dto.form.PcWorkListFormDTO; |
|
|
|
import com.epmet.dto.form.patrol.PatrolQueryFormDTO; |
|
|
|
import com.epmet.dto.result.AllGridsByUserIdResultDTO; |
|
|
|
import com.epmet.dto.result.PatrolRoutineWorkResult; |
|
|
|
import com.epmet.dto.result.PcWorkListResultDTO; |
|
|
|
import com.epmet.entity.PatrolRoutineWorkEntity; |
|
|
@ -60,6 +61,7 @@ import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 巡查例行工作 |
|
|
@ -171,10 +173,40 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW |
|
|
|
if (CollectionUtils.isEmpty(list)){ |
|
|
|
return result; |
|
|
|
} |
|
|
|
Result<List<DictTreeResultDTO>> workTypeResult = adminOpenFeignClient.dictTree("patrol_work_type"); |
|
|
|
if (!workTypeResult.success()){ |
|
|
|
throw new EpmetException("查询例行工作分类失败..."); |
|
|
|
} |
|
|
|
List<String> gridIds = list.stream().map(m -> m.getGridId()).distinct().collect(Collectors.toList()); |
|
|
|
Result<List<AllGridsByUserIdResultDTO>> gridNamesResult = govOrgOpenFeignClient.getGridListByGridIds(gridIds); |
|
|
|
if (!gridNamesResult.success()){ |
|
|
|
throw new EpmetException("查询网格名字失败..."); |
|
|
|
} |
|
|
|
list.forEach(l -> { |
|
|
|
l.setWorkTypeName(disposeWorkTypeCode(workTypeResult.getData(),l.getWorkTypeCode())); |
|
|
|
gridNamesResult.getData().stream().filter(g -> l.getGridId().equals(g.getGridId())).forEach(g -> l.setGridName(g.getGridName())); |
|
|
|
}); |
|
|
|
result.setList(list); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
public List<String> disposeWorkTypeCode(List<DictTreeResultDTO> workTypeList,List<String> code){ |
|
|
|
if (CollectionUtils.isEmpty(code)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
List<String> result = new ArrayList<>(); |
|
|
|
code.forEach(c -> { |
|
|
|
workTypeList.forEach(w1 -> { |
|
|
|
w1.getChildren().forEach(w2 -> { |
|
|
|
if (c.equals(w2.getId())){ |
|
|
|
result.add(w1.getName() + "-" + w2.getName()); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* desc:递归遍历树形结构 构建pids 根节点pids 为空字符串 |
|
|
|
* |
|
|
|