|
@@ -1,141 +0,0 @@
|
|
|
-package com.ruoyi.zdsz.service.impl;
|
|
|
-
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
-import com.ruoyi.common.utils.StringUtils;
|
|
|
-import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
-import com.ruoyi.common.core.domain.PageQuery;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
-import lombok.RequiredArgsConstructor;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import com.ruoyi.zdsz.domain.bo.ZEngineeringDangerousBo;
|
|
|
-import com.ruoyi.zdsz.domain.vo.ZEngineeringDangerousVo;
|
|
|
-import com.ruoyi.zdsz.domain.ZEngineeringDangerous;
|
|
|
-import com.ruoyi.zdsz.mapper.ZEngineeringDangerousMapper;
|
|
|
-import com.ruoyi.zdsz.service.IZEngineeringDangerousService;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Collection;
|
|
|
-
|
|
|
-/**
|
|
|
- * 危险工程Service业务层处理
|
|
|
- *
|
|
|
- * @author ruoyi
|
|
|
- * @date 2023-12-25
|
|
|
- */
|
|
|
-@RequiredArgsConstructor
|
|
|
-@Service
|
|
|
-public class ZEngineeringDangerousServiceImpl implements IZEngineeringDangerousService {
|
|
|
-
|
|
|
- private final ZEngineeringDangerousMapper baseMapper;
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询危险工程
|
|
|
- */
|
|
|
- @Override
|
|
|
- public ZEngineeringDangerousVo queryById(Long id){
|
|
|
- return baseMapper.selectVoById(id);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询危险工程列表
|
|
|
- */
|
|
|
- @Override
|
|
|
- public TableDataInfo<ZEngineeringDangerousVo> queryPageList(ZEngineeringDangerousBo bo, PageQuery pageQuery) {
|
|
|
- LambdaQueryWrapper<ZEngineeringDangerous> lqw = buildQueryWrapper(bo);
|
|
|
- Page<ZEngineeringDangerousVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
- return TableDataInfo.build(result);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询危险工程列表
|
|
|
- */
|
|
|
- @Override
|
|
|
- public List<ZEngineeringDangerousVo> queryList(ZEngineeringDangerousBo bo) {
|
|
|
- LambdaQueryWrapper<ZEngineeringDangerous> lqw = buildQueryWrapper(bo);
|
|
|
- return baseMapper.selectVoList(lqw);
|
|
|
- }
|
|
|
-
|
|
|
- private LambdaQueryWrapper<ZEngineeringDangerous> buildQueryWrapper(ZEngineeringDangerousBo bo) {
|
|
|
- Map<String, Object> params = bo.getParams();
|
|
|
- LambdaQueryWrapper<ZEngineeringDangerous> lqw = Wrappers.lambdaQuery();
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getBasicInformation()), ZEngineeringDangerous::getBasicInformation, bo.getBasicInformation());
|
|
|
- lqw.like(StringUtils.isNotBlank(bo.getEnginName()), ZEngineeringDangerous::getEnginName, bo.getEnginName());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getEnginAddre()), ZEngineeringDangerous::getEnginAddre, bo.getEnginAddre());
|
|
|
- lqw.eq(bo.getEnginTime() != null, ZEngineeringDangerous::getEnginTime, bo.getEnginTime());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getPipeDiameter()), ZEngineeringDangerous::getPipeDiameter, bo.getPipeDiameter());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getTubularProduct()), ZEngineeringDangerous::getTubularProduct, bo.getTubularProduct());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getCasingPresent()), ZEngineeringDangerous::getCasingPresent, bo.getCasingPresent());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getPipePressure()), ZEngineeringDangerous::getPipePressure, bo.getPipePressure());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getGasSourceDirection()), ZEngineeringDangerous::getGasSourceDirection, bo.getGasSourceDirection());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getTaskPosition()), ZEngineeringDangerous::getTaskPosition, bo.getTaskPosition());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getValvePosition()), ZEngineeringDangerous::getValvePosition, bo.getValvePosition());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getStressReport()), ZEngineeringDangerous::getStressReport, bo.getStressReport());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getSupervisionRecord()), ZEngineeringDangerous::getSupervisionRecord, bo.getSupervisionRecord());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getWorkContactForm()), ZEngineeringDangerous::getWorkContactForm, bo.getWorkContactForm());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getLinePatrolConfirmationForm()), ZEngineeringDangerous::getLinePatrolConfirmationForm, bo.getLinePatrolConfirmationForm());
|
|
|
- lqw.eq(bo.getHazardousWorkPitsLong() != null, ZEngineeringDangerous::getHazardousWorkPitsLong, bo.getHazardousWorkPitsLong());
|
|
|
- lqw.eq(bo.getHazardousWorkPitsWide() != null, ZEngineeringDangerous::getHazardousWorkPitsWide, bo.getHazardousWorkPitsWide());
|
|
|
- lqw.eq(bo.getHazardousWorkPitsDeep() != null, ZEngineeringDangerous::getHazardousWorkPitsDeep, bo.getHazardousWorkPitsDeep());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getNeedSupport()), ZEngineeringDangerous::getNeedSupport, bo.getNeedSupport());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getOtherPipelineConditionsWorkPit()), ZEngineeringDangerous::getOtherPipelineConditionsWorkPit, bo.getOtherPipelineConditionsWorkPit());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getSiteHead()), ZEngineeringDangerous::getSiteHead, bo.getSiteHead());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getSiteHeadPhone()), ZEngineeringDangerous::getSiteHeadPhone, bo.getSiteHeadPhone());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getOperatorInformation()), ZEngineeringDangerous::getOperatorInformation, bo.getOperatorInformation());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getInspectionPort()), ZEngineeringDangerous::getInspectionPort, bo.getInspectionPort());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getPipelinePainting()), ZEngineeringDangerous::getPipelinePainting, bo.getPipelinePainting());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getPipelineSupport()), ZEngineeringDangerous::getPipelineSupport, bo.getPipelineSupport());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getPipelineCorrosionProtection()), ZEngineeringDangerous::getPipelineCorrosionProtection, bo.getPipelineCorrosionProtection());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getMasonryValveWell()), ZEngineeringDangerous::getMasonryValveWell, bo.getMasonryValveWell());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getProtectionWell()), ZEngineeringDangerous::getProtectionWell, bo.getProtectionWell());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getPipeProtectionWelMasonry()), ZEngineeringDangerous::getPipeProtectionWelMasonry, bo.getPipeProtectionWelMasonry());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getBackfill()), ZEngineeringDangerous::getBackfill, bo.getBackfill());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getTamp()), ZEngineeringDangerous::getTamp, bo.getTamp());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getLevelingTheSite()), ZEngineeringDangerous::getLevelingTheSite, bo.getLevelingTheSite());
|
|
|
- return lqw;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增危险工程
|
|
|
- */
|
|
|
- @Override
|
|
|
- public Boolean insertByBo(ZEngineeringDangerousBo bo) {
|
|
|
- ZEngineeringDangerous add = BeanUtil.toBean(bo, ZEngineeringDangerous.class);
|
|
|
- validEntityBeforeSave(add);
|
|
|
- boolean flag = baseMapper.insert(add) > 0;
|
|
|
- if (flag) {
|
|
|
- bo.setId(add.getId());
|
|
|
- }
|
|
|
- return flag;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 修改危险工程
|
|
|
- */
|
|
|
- @Override
|
|
|
- public Boolean updateByBo(ZEngineeringDangerousBo bo) {
|
|
|
- ZEngineeringDangerous update = BeanUtil.toBean(bo, ZEngineeringDangerous.class);
|
|
|
- validEntityBeforeSave(update);
|
|
|
- return baseMapper.updateById(update) > 0;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 保存前的数据校验
|
|
|
- */
|
|
|
- private void validEntityBeforeSave(ZEngineeringDangerous entity){
|
|
|
- //TODO 做一些数据校验,如唯一约束
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 批量删除危险工程
|
|
|
- */
|
|
|
- @Override
|
|
|
- public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
- if(isValid){
|
|
|
- //TODO 做一些业务上的校验,判断是否需要校验
|
|
|
- }
|
|
|
- return baseMapper.deleteBatchIds(ids) > 0;
|
|
|
- }
|
|
|
-}
|