2025-07-17 15:26:39 +08:00
|
|
|
package com.gunshi.project.hsz.service;
|
2024-07-08 17:47:02 +08:00
|
|
|
|
2025-03-27 14:22:45 +08:00
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
2024-07-08 17:47:02 +08:00
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
2025-07-17 15:26:39 +08:00
|
|
|
import com.gunshi.project.hsz.entity.vo.ProfilePressTreeVo;
|
|
|
|
|
import com.gunshi.project.hsz.mapper.AttDamProfileMapper;
|
|
|
|
|
import com.gunshi.project.hsz.model.AttDamProfile;
|
|
|
|
|
import com.gunshi.project.hsz.util.MyBeanUtil;
|
2024-07-10 13:16:22 +08:00
|
|
|
import jakarta.annotation.Resource;
|
2024-07-08 17:47:02 +08:00
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
2024-07-10 13:16:22 +08:00
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
2024-07-08 17:47:02 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 描述: 监测断面信息表
|
|
|
|
|
* author: xusan
|
|
|
|
|
* date: 2024-07-08 17:30:37
|
|
|
|
|
*/
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public class AttDamProfileService extends ServiceImpl<AttDamProfileMapper, AttDamProfile>
|
|
|
|
|
{
|
2024-07-10 13:16:22 +08:00
|
|
|
@Resource
|
2025-11-03 16:47:35 +08:00
|
|
|
private JcskSyBService jcskSyBService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private JcskSlBService jcskSlBService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private JcskGnssBService jcskGnssBService;
|
|
|
|
|
|
2024-07-10 13:16:22 +08:00
|
|
|
|
|
|
|
|
public List<ProfilePressTreeVo> tree() {
|
2025-11-03 16:47:35 +08:00
|
|
|
|
2025-03-27 14:22:45 +08:00
|
|
|
LambdaQueryWrapper<AttDamProfile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
queryWrapper.orderByAsc(AttDamProfile::getProfileCode);
|
|
|
|
|
List<AttDamProfile> list = this.list(queryWrapper);
|
2024-07-10 13:16:22 +08:00
|
|
|
List<ProfilePressTreeVo> res = MyBeanUtil.collectionCopy(list,ProfilePressTreeVo.class);
|
|
|
|
|
for(ProfilePressTreeVo vo : res){
|
2025-11-03 16:47:35 +08:00
|
|
|
List<String> childrensy = jcskSyBService.getDvcdByProfileCode(vo.getProfileCode());
|
|
|
|
|
vo.setChildren(childrensy);
|
|
|
|
|
//List<OsmoticPressDevice> pressList = pressDeviceAutoDao.list(new LambdaQueryWrapper<OsmoticPressDevice>()
|
|
|
|
|
// .eq(OsmoticPressDevice::getProfileCode, vo.getProfileCode()).orderByAsc(OsmoticPressDevice::getStationCode));
|
|
|
|
|
// vo.setChildren(pressList.stream().map(OsmoticPressDevice::getStationCode).sorted().collect(Collectors.toList()));
|
2024-07-10 13:16:22 +08:00
|
|
|
}
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-08 17:47:02 +08:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|