|
@@ -1269,6 +1269,29 @@ public class PlanSchedulingServiceImpl implements PlanSchedulingService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public PageResult<EquipBoilerPageRespVO> pendingInspectionPageBoiler(PendingInspectionEquipReqVO pageReqVO) {
|
|
public PageResult<EquipBoilerPageRespVO> pendingInspectionPageBoiler(PendingInspectionEquipReqVO pageReqVO) {
|
|
|
|
|
+ // 根据部门名称模糊匹配部门ID
|
|
|
|
|
+ if (StrUtil.isNotEmpty(pageReqVO.getDeptName())) {
|
|
|
|
|
+ List<DeptRespDTO> allDepts = deptApi.getDeptAllList().getCheckedData();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(allDepts)) {
|
|
|
|
|
+ String deptName = pageReqVO.getDeptName();
|
|
|
|
|
+ List<String> matchedDeptIds = allDepts.stream()
|
|
|
|
|
+ .filter(d -> d.getName() != null && d.getName().contains(deptName))
|
|
|
|
|
+ .map(DeptRespDTO::getId)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ if (CollUtil.isNotEmpty(matchedDeptIds)) {
|
|
|
|
|
+ pageReqVO.setDeptId(matchedDeptIds.get(0));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return new PageResult<>(Collections.emptyList(), 0L);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (pageReqVO.getCheckDateStart() == null){
|
|
|
|
|
+ pageReqVO.setCheckDateStart(LocalDate.now().minusYears(100));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (pageReqVO.getCheckDateEnd() == null){
|
|
|
|
|
+ pageReqVO.setCheckDateEnd(LocalDate.now().plusYears(100));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 查询总数
|
|
// 查询总数
|
|
|
Long total = equipBoilerMapper.selectPendingInspectionBoilerCount(pageReqVO);
|
|
Long total = equipBoilerMapper.selectPendingInspectionBoilerCount(pageReqVO);
|
|
|
|
|
|
|
@@ -1361,6 +1384,32 @@ public class PlanSchedulingServiceImpl implements PlanSchedulingService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public PageResult<EquipPipePageRespVO> pendingInspectionPagePipe(PendingInspectionEquipReqVO pageReqVO) {
|
|
public PageResult<EquipPipePageRespVO> pendingInspectionPagePipe(PendingInspectionEquipReqVO pageReqVO) {
|
|
|
|
|
+ // 根据部门名称模糊匹配部门ID
|
|
|
|
|
+ if (StrUtil.isNotEmpty(pageReqVO.getDeptName())) {
|
|
|
|
|
+ List<DeptRespDTO> allDepts = deptApi.getDeptAllList().getCheckedData();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(allDepts)) {
|
|
|
|
|
+ String deptName = pageReqVO.getDeptName();
|
|
|
|
|
+ List<String> matchedDeptIds = allDepts.stream()
|
|
|
|
|
+ .filter(d -> d.getName() != null && d.getName().contains(deptName))
|
|
|
|
|
+ .map(DeptRespDTO::getId)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ if (CollUtil.isNotEmpty(matchedDeptIds)) {
|
|
|
|
|
+ // 取第一个匹配的部门ID(或可扩展为多选)
|
|
|
|
|
+ pageReqVO.setDeptId(matchedDeptIds.get(0));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 无匹配部门,直接返回空
|
|
|
|
|
+ return new PageResult<>(Collections.emptyList(), 0L);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (pageReqVO.getCheckDateStart() == null){
|
|
|
|
|
+ pageReqVO.setCheckDateStart(LocalDate.now().minusYears(100));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (pageReqVO.getCheckDateEnd() == null){
|
|
|
|
|
+ pageReqVO.setCheckDateEnd(LocalDate.now().plusYears(100));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 查询总数
|
|
// 查询总数
|
|
|
Long total = equipPipeMapper.selectPendingInspectionPipeCount(pageReqVO);
|
|
Long total = equipPipeMapper.selectPendingInspectionPipeCount(pageReqVO);
|
|
|
|
|
|
|
@@ -1677,6 +1726,29 @@ public class PlanSchedulingServiceImpl implements PlanSchedulingService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ public void updatePipeIsValid(PipeIsValidUpdateVO updateVO) {
|
|
|
|
|
+ List<String> ids = updateVO.getIds();
|
|
|
|
|
+ if (CollUtil.isEmpty(ids)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 将 Boolean 转为数据库存储的字符串 "是" / "否"
|
|
|
|
|
+ String isEffectiveValue = Boolean.TRUE.equals(updateVO.getIsEffective()) ? "是" : "否";
|
|
|
|
|
+
|
|
|
|
|
+ List<EquipPipeDO> equipPipeDOS = equipPipeMapper.selectByIds(ids);
|
|
|
|
|
+ if (CollUtil.isEmpty(equipPipeDOS)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ equipPipeDOS.forEach(pipe -> {
|
|
|
|
|
+ EquipPipeDO updateDO = new EquipPipeDO();
|
|
|
|
|
+ updateDO.setId(pipe.getId());
|
|
|
|
|
+ updateDO.setIsEffective(isEffectiveValue);
|
|
|
|
|
+ equipPipeMapper.updateById(updateDO);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void updateEquipContactBatch(ContactUpdateVO contactUpdateVO, Integer equipMainType) {
|
|
public void updateEquipContactBatch(ContactUpdateVO contactUpdateVO, Integer equipMainType) {
|