| 
					
				 | 
			
			
				@@ -0,0 +1,130 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+package com.ruoyi.business.service.impl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import cn.hutool.core.bean.BeanUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import cn.hutool.core.util.IdUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.core.toolkit.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.core.toolkit.Wrappers; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ruoyi.business.domain.BjNotifyModelConfig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ruoyi.business.domain.bo.BjNotifyModelConfigBo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ruoyi.business.domain.vo.BjNotifyModelConfigVo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ruoyi.business.mapper.BjNotifyModelConfigMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ruoyi.business.service.IBjNotifyModelConfigService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ruoyi.common.core.exception.ServiceException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import lombok.RequiredArgsConstructor; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import lombok.extern.slf4j.Slf4j; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.stereotype.Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.transaction.annotation.Transactional; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import javax.annotation.Resource; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.text.ParseException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.Collection; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 通报模型配置信息查询Service业务层处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * @author libai 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * @date 2025-10-28 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@Slf4j 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@RequiredArgsConstructor 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@Service 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+public class BjNotifyModelConfigServiceImpl implements IBjNotifyModelConfigService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private BjNotifyModelConfigMapper baseMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 查询通报模型配置信息查询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param id 主键 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 通报模型配置信息查询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public BjNotifyModelConfigVo queryById(String id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        BjNotifyModelConfig notifyModelConfig = baseMapper.selectById(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return BeanUtil.copyProperties(notifyModelConfig, BjNotifyModelConfigVo.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 分页查询通报模型配置信息查询列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param bo 查询条件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 通报模型配置信息查询分页列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public List<BjNotifyModelConfigVo> queryPageList(BjNotifyModelConfigBo bo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return baseMapper.queryNotifyModelConfigList(bo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 新增通报模型配置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param bo 通报模型配置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 是否新增成功 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public Boolean insertByBo(BjNotifyModelConfigBo bo) throws ParseException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        BjNotifyModelConfig add = BeanUtil.copyProperties(bo, BjNotifyModelConfig.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String notifyModelConfigId = IdUtil.simpleUUID(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (add != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            add.setNotifyModelConfigId(notifyModelConfigId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        validEntityBeforeSave(add); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return baseMapper.insert(add) > 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 修改通报模型配置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param bo 通报模型配置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 是否修改成功 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public Boolean updateByBo(BjNotifyModelConfigBo bo) throws ParseException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        BjNotifyModelConfig update = BeanUtil.copyProperties(bo, BjNotifyModelConfig.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        validEntityBeforeSave(update); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return baseMapper.updateById(update) > 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 保存前的数据校验 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void validEntityBeforeSave(BjNotifyModelConfig entity) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //TODO 做一些数据校验,如唯一约束 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 校验并批量删除通报模型配置信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param ids     待删除的主键集合 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param isValid 是否进行有效性校验 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 是否删除成功 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (isValid) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //TODO 做一些业务上的校验,判断是否需要校验 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return baseMapper.deleteBatchIds(ids) > 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public BjNotifyModelConfigVo queryByModelName(BjNotifyModelConfigBo bo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (StringUtils.isBlank(bo.getModelName()) && StringUtils.isBlank(bo.getModelChildrenName())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new ServiceException("模型名称和模型子名称不能为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<BjNotifyModelConfig> notifyModelConfigList = baseMapper.selectList(Wrappers.<BjNotifyModelConfig>lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(BjNotifyModelConfig::getModelName, bo.getModelName()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(BjNotifyModelConfig::getModelChildrenName, bo.getModelChildrenName())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (CollectionUtils.isNotEmpty(notifyModelConfigList)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return BeanUtil.copyProperties(notifyModelConfigList.get(0), BjNotifyModelConfigVo.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return new BjNotifyModelConfigVo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |