优化暂态事件推送时部门数据的获取

This commit is contained in:
xy
2025-07-30 11:23:21 +08:00
parent 6c2ddfab67
commit c9ecdad7ed
6 changed files with 45 additions and 14 deletions

View File

@@ -148,6 +148,14 @@ public class DeptLineController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineByLineIds, methodDescribe);
}
@PostMapping("/getDeptListByLineId")
@ApiOperation("根据监测点获取部门id(集合)")
public HttpResult<List<DeptLine>> getDeptListByLineId(@RequestParam("id") String ids) {
String methodDescribe = getMethodDescribe("getDeptListByLineId");
List<DeptLine> lineByLineIds = deptLineService.getDeptListByLineId(ids);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineByLineIds, methodDescribe);
}
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("/getLineNodeByDeptId")
@ApiOperation("部门Id获取所有子集部门绑定监测点")

View File

@@ -128,6 +128,8 @@ public interface DeptLineService extends IService<DeptLine> {
*/
DeptLine getLineByLineIds(String ids);
List<DeptLine> getDeptListByLineId(String id);
List<LineDeviceStateVO> getLineDetailByDeptId(String id);

View File

@@ -35,10 +35,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@@ -194,6 +192,12 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
);
}
@Override
public List<DeptLine> getDeptListByLineId(String id) {
return this.list(new LambdaQueryWrapper<DeptLine>()
.eq(DeptLine::getLineId, id));
}
@Override
public List<LineDeviceStateVO> getLineDetailByDeptId(String id) {
List<String> lineByDeptId = this.getLineNodeByDeptId(id);