From f32c25a67a7f3ce0bde1f266b9f8abd6379b7378 Mon Sep 17 00:00:00 2001 From: ‘liusuyi’ <1951119284@qq.com> Date: 星期一, 21 八月 2023 16:06:56 +0800 Subject: [PATCH] 增加派警管理业务 获取部门和相机接口增加通道list --- ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java index e0a498f..e89ccca 100644 --- a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java +++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java @@ -2,6 +2,7 @@ import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell; import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper; import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService; @@ -13,10 +14,13 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.bean.BeanValidators; import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.common.utils.uuid.IdUtils; +import lombok.ToString; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.validation.Validator; @@ -85,7 +89,14 @@ * @return 缁撴灉 */ @Override + @Transactional public int insertArdAlarmpointsWell(ArdAlarmpointsWell ardAlarmpointsWell) { + boolean wellIdExists = ardAlarmpointsWellMapper.checkWellIdExists(ardAlarmpointsWell.getWellId()); + if(wellIdExists) + { + throw new RuntimeException("浜曞彿宸插瓨鍦�"); + } + ardAlarmpointsWell.setId(IdUtils.simpleUUID()); ardAlarmpointsWell.setUserId(SecurityUtils.getUserId()); ardAlarmpointsWell.setCreateBy(SecurityUtils.getUsername()); ardAlarmpointsWell.setCreateTime(DateUtils.getNowDate()); @@ -99,7 +110,13 @@ * @return 缁撴灉 */ @Override + @Transactional public int updateArdAlarmpointsWell(ArdAlarmpointsWell ardAlarmpointsWell) { + boolean wellIdExists = ardAlarmpointsWellMapper.checkWellIdExists(ardAlarmpointsWell.getWellId()); + if(wellIdExists) + { + throw new RuntimeException("浜曞彿宸插瓨鍦�"); + } ardAlarmpointsWell.setUpdateBy(SecurityUtils.getUsername()); ardAlarmpointsWell.setUpdateTime(DateUtils.getNowDate()); return ardAlarmpointsWellMapper.updateArdAlarmpointsWell(ardAlarmpointsWell); @@ -210,4 +227,12 @@ } } } + + + @Override + public List<ArdAlarmpointsWell> wellByDeptList(List<Long> deptList) { + QueryWrapper<ArdAlarmpointsWell> queryWrapper = new QueryWrapper<>(); + queryWrapper.in("dept_id",deptList); + return ardAlarmpointsWellMapper.selectList(queryWrapper); + } } -- Gitblit v1.9.3