1.调整河北pms国网上送主配网逻辑

2.技术监督调整
This commit is contained in:
2024-03-12 10:38:55 +08:00
parent af4600f0e9
commit 4b09070081
50 changed files with 1058 additions and 564 deletions

View File

@@ -39,7 +39,7 @@ public interface CommLedgerDeptClient {
@GetMapping("/existMonitorDeptTree")
public HttpResult<List<String>> existMonitorDeptTree();
HttpResult<List<Dept>> existMonitorDeptTree();
}

View File

@@ -38,7 +38,7 @@ public class CommLedgerDeptClientFallbackFactory implements FallbackFactory<Comm
}
@Override
public HttpResult<List<String>> existMonitorDeptTree() {
public HttpResult<List<Dept>> existMonitorDeptTree() {
log.error("{}异常,降级处理,异常为:{}", "获取存在投运监测点的部门id集合", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}

View File

@@ -162,9 +162,9 @@ public class PmsLedgerDeptController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@GetMapping("/existMonitorDeptTree")
@ApiOperation("获取部门树(存在监测点的)")
public HttpResult<List<String>> existMonitorDeptTree() {
public HttpResult<List<Dept>> existMonitorDeptTree() {
String methodDescribe = getMethodDescribe("existMonitorDeptTree");
List<String> result = iMonitorService.existMonitorDeptTree();
List<Dept> result = iMonitorService.existMonitorDeptTree();
//删除返回失败查不到数据返回空数组兼容治理项目没有部门直接报错的bug
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);

View File

@@ -14,6 +14,7 @@ import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pms.pojo.vo.MonitorVO;
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.user.pojo.po.Dept;
import org.springframework.web.multipart.MultipartFile;
@@ -195,5 +196,5 @@ public interface IMonitorService extends IService<Monitor> {
* @author cdf
* @date 2024/2/26
*/
List<String> existMonitorDeptTree();
List<Dept> existMonitorDeptTree();
}

View File

@@ -603,14 +603,13 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
}
@Override
public List<String> existMonitorDeptTree() {
public List<Dept> existMonitorDeptTree() {
DictData dictData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.LINE_STATE.getName(), DicDataEnum.RUN.getName()).getData();
List<Dept> deptList = deptFeignClient.getAllDept().getData();
List<String> monitorList = this.lambdaQuery().select(Monitor::getOrgId).eq(Monitor::getMonitorState,dictData.getId()).list().stream().map(Monitor::getOrgId).distinct().collect(Collectors.toList());
List<Dept> deptTem = deptList.stream().filter(it->monitorList.contains(it.getCode())).collect(Collectors.toList());
List<String> resultDeptId = deptTem.stream().map(item->item.getPids().split(",")).flatMap(Arrays::stream).distinct().collect(Collectors.toList());
resultDeptId.addAll(deptTem.stream().map(Dept::getId).collect(Collectors.toList()));
return resultDeptId;
return deptTem;
}