调整异常数据界面业务
This commit is contained in:
@@ -579,4 +579,13 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
* 根据Pid获取所有子节点
|
||||
*/
|
||||
List<String> getSubIdByPid(@Param("pid") String pid);
|
||||
|
||||
|
||||
/**
|
||||
* 根据监测点id获取终端id
|
||||
*
|
||||
* @param ids 监测点集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<String> getDevIdsLine(@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
@@ -1935,5 +1935,19 @@
|
||||
AND t2.Monitor_Flag = 0
|
||||
</if>
|
||||
</select>
|
||||
<select id="getDevIdsLine" resultType="java.lang.String">
|
||||
SELECT
|
||||
DISTINCT d.id
|
||||
FROM
|
||||
pq_line a
|
||||
INNER JOIN pq_line v ON a.pid = v.id
|
||||
INNER JOIN pq_line d ON v.pid = d.id
|
||||
where
|
||||
a.id in
|
||||
<foreach collection="ids" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -44,6 +44,13 @@ public interface DeptLineService extends IService<DeptLine> {
|
||||
List<DeptLine> selectDeptBindLines(List<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 根据监测点id获取部门信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<DeptLine> selectDeptLine(List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据部门ids集合查询所有监测点id
|
||||
* @param ids 部门ids
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -34,10 +35,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -111,6 +109,22 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
return this.lambdaQuery().in(DeptLine::getId, ids).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptLine> selectDeptLine(List<String> ids) {
|
||||
List<DeptLine> list = this.lambdaQuery().in(DeptLine::getLineId, ids).list();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
List<Dept> data = deptFeignClient.getAllDept().getData();
|
||||
Map<String, String> deptName = data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||
for (DeptLine deptLine : list) {
|
||||
if (deptName.containsKey(deptLine.getId())) {
|
||||
deptLine.setId(deptName.get(deptLine.getId()));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineByDeptIds(List<String> ids,String manufacturer, List<Integer> runFlag, List<Integer> dataType, String objType) {
|
||||
return this.baseMapper.getLineIdByDeptIds(ids, manufacturer ,runFlag, dataType, objType);
|
||||
|
||||
Reference in New Issue
Block a user