| | |
| | | import cn.gistack.sm.sg.mapper.SgProgressReportMapper; |
| | | import cn.gistack.sm.sg.service.SgDeviceService; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | |
| | | @Autowired |
| | | private SgGxStepMapper sgGxStepMapper; |
| | | |
| | | @Autowired |
| | | private SgProgressReportMapper sgProgressReportMapper; |
| | | |
| | | @Override |
| | | public IPage<SgDeviceDO> queryPageList(IPage<SgDeviceDO> page, SgDeviceSearchDTO searchDTO) { |
| | |
| | | */ |
| | | @Override |
| | | public List<SgDeviceDO> getDeviceList(String programId) { |
| | | List<SgDeviceDO> list = new ArrayList<>(); |
| | | QueryWrapper<SgDeviceDO> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("program_id",programId).or() |
| | | .in("device_type", Arrays.asList("sgys", "sgzb")).orderByAsc("create_time"); |
| | | return baseMapper.selectList(queryWrapper); |
| | | queryWrapper.eq("program_id", programId); |
| | | SgDeviceDO sg1 = new SgDeviceDO(); |
| | | sg1.setId((long) 999); |
| | | sg1.setDeviceName("施工准备"); |
| | | sg1.setDeviceType("sgzb"); |
| | | sg1.setStatus(0); |
| | | list.add(sg1); |
| | | |
| | | List<SgDeviceDO> sgDeviceDOS = baseMapper.selectList(queryWrapper); |
| | | if (CollectionUtils.isNotEmpty(sgDeviceDOS)) { |
| | | list.addAll(sgDeviceDOS); |
| | | } |
| | | |
| | | SgDeviceDO sg2 = new SgDeviceDO(); |
| | | sg2.setId((long) 998); |
| | | sg2.setDeviceName("项目验收"); |
| | | sg2.setDeviceType("xmys"); |
| | | sg2.setStatus(0); |
| | | list.add(sg2); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public List<SgGxStepDO> queryStepList(String deviceId) { |
| | | QueryWrapper<SgGxStepDO> queryWrapper = new QueryWrapper<>(); |
| | | if (deviceId.equals("36")) { |
| | | queryWrapper.eq("gx_info_id", 9); |
| | | } else if (deviceId.equals("37")) { |
| | | queryWrapper.eq("gx_info_id", 10); |
| | | } else { |
| | | return sgGxStepMapper.queryStepList(deviceId); |
| | | } |
| | | return sgGxStepMapper.selectList(queryWrapper); |
| | | List<SgGxStepDO> sgGxStepDOS = sgGxStepMapper.queryStepList(deviceId); |
| | | return sgGxStepDOS; |
| | | } |
| | | } |