|
@@ -10,11 +10,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import cn.start.tz.module.pressure2.controller.admin.equippipedetail.vo.*;
|
|
import cn.start.tz.module.pressure2.controller.admin.equippipedetail.vo.*;
|
|
|
|
|
+import cn.start.tz.module.pressure2.dal.dataobject.equippipe.EquipPipeDO;
|
|
|
import cn.start.tz.module.pressure2.dal.dataobject.equippipedetail.EquipPipeDetailDO;
|
|
import cn.start.tz.module.pressure2.dal.dataobject.equippipedetail.EquipPipeDetailDO;
|
|
|
import cn.start.tz.framework.common.pojo.PageResult;
|
|
import cn.start.tz.framework.common.pojo.PageResult;
|
|
|
import cn.start.tz.framework.common.pojo.PageParam;
|
|
import cn.start.tz.framework.common.pojo.PageParam;
|
|
|
import cn.start.tz.framework.common.util.object.BeanUtils;
|
|
import cn.start.tz.framework.common.util.object.BeanUtils;
|
|
|
|
|
|
|
|
|
|
+import cn.start.tz.module.pressure2.dal.mysql.equippipe.EquipPipeMapper;
|
|
|
import cn.start.tz.module.pressure2.dal.mysql.equippipedetail.EquipPipeDetailMapper;
|
|
import cn.start.tz.module.pressure2.dal.mysql.equippipedetail.EquipPipeDetailMapper;
|
|
|
|
|
|
|
|
import static cn.start.tz.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
import static cn.start.tz.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
@@ -32,6 +34,9 @@ public class EquipPipeDetailServiceImpl extends ServiceImpl<EquipPipeDetailMappe
|
|
|
@Resource
|
|
@Resource
|
|
|
private EquipPipeDetailMapper equipPipeDetailMapper;
|
|
private EquipPipeDetailMapper equipPipeDetailMapper;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private EquipPipeMapper equipPipeMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public String createEquipPipeDetail(EquipPipeDetailSaveReqVO createReqVO) {
|
|
public String createEquipPipeDetail(EquipPipeDetailSaveReqVO createReqVO) {
|
|
|
// 插入
|
|
// 插入
|
|
@@ -111,4 +116,41 @@ public class EquipPipeDetailServiceImpl extends ServiceImpl<EquipPipeDetailMappe
|
|
|
return BeanUtils.toBean(list, EquipPipeDetailRespVO.class);
|
|
return BeanUtils.toBean(list, EquipPipeDetailRespVO.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<EquipPipeDetailJoinRespVO> getEquipPipeDetailJoinByPipeRegCode(String pipeRegCode) {
|
|
|
|
|
+ // 按管道注册代码查询管线明细
|
|
|
|
|
+ LambdaQueryWrapper<EquipPipeDetailDO> queryWrapper = new LambdaQueryWrapper<EquipPipeDetailDO>()
|
|
|
|
|
+ .eq(EquipPipeDetailDO::getPipeRegCode, pipeRegCode);
|
|
|
|
|
+ List<EquipPipeDetailDO> detailList = equipPipeDetailMapper.selectList(queryWrapper);
|
|
|
|
|
+ if (detailList.isEmpty()) {
|
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
|
+ }
|
|
|
|
|
+ // 收集关联的管道设备id,批量查询管道设备
|
|
|
|
|
+ Set<String> equipPipeIds = new HashSet<>();
|
|
|
|
|
+ for (EquipPipeDetailDO detail : detailList) {
|
|
|
|
|
+ if (detail.getEquipPipeId() != null) {
|
|
|
|
|
+ equipPipeIds.add(detail.getEquipPipeId());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ Map<String, EquipPipeDO> equipPipeMap = new HashMap<>();
|
|
|
|
|
+ if (!equipPipeIds.isEmpty()) {
|
|
|
|
|
+ List<EquipPipeDO> equipPipeList = equipPipeMapper.selectByIds(equipPipeIds);
|
|
|
|
|
+ for (EquipPipeDO equipPipe : equipPipeList) {
|
|
|
|
|
+ equipPipeMap.put(equipPipe.getId(), equipPipe);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 组装返回结果,补充使用单位名称、使用单位地址、使用状态字段
|
|
|
|
|
+ List<EquipPipeDetailJoinRespVO> result = new ArrayList<>();
|
|
|
|
|
+ for (EquipPipeDetailDO detail : detailList) {
|
|
|
|
|
+ EquipPipeDetailJoinRespVO respVO = BeanUtils.toBean(detail, EquipPipeDetailJoinRespVO.class);
|
|
|
|
|
+ EquipPipeDO equipPipe = equipPipeMap.get(detail.getEquipPipeId());
|
|
|
|
|
+ if (equipPipe != null) {
|
|
|
|
|
+ respVO.setUnitName(equipPipe.getUnitName());
|
|
|
|
|
+ respVO.setUnitAddress(equipPipe.getUnitAddress());
|
|
|
|
|
+ }
|
|
|
|
|
+ result.add(respVO);
|
|
|
|
|
+ }
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|