From 0d243e7f5dc593cdc6e0608bb52cd635f8fc6982 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期五, 19 九月 2025 11:59:44 +0800
Subject: [PATCH] 新需求
---
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckRuleServiceImpl.java | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckRuleServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckRuleServiceImpl.java
index 518e882..4735150 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckRuleServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckRuleServiceImpl.java
@@ -1,29 +1,36 @@
package com.ycl.platform.service.impl;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.platform.domain.entity.CheckRule;
+import com.ycl.platform.domain.vo.CheckRuleVO;
import com.ycl.platform.mapper.CheckRuleMapper;
import com.ycl.platform.service.ICheckRuleService;
+import constant.CheckConstants;
+import org.hibernate.annotations.Check;
+import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import utils.DateUtils;
+import java.util.Date;
import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
/**
* 鑰冩牳瑙勫垯Service涓氬姟灞傚鐞�
*
* @author ruoyi
- * @date 2024-04-01
+ * @date 2024-04-15
*/
@Service
-public class CheckRuleServiceImpl implements ICheckRuleService
+public class CheckRuleServiceImpl extends ServiceImpl<CheckRuleMapper, CheckRule> implements ICheckRuleService
{
@Autowired
private CheckRuleMapper checkRuleMapper;
/**
* 鏌ヨ鑰冩牳瑙勫垯
- *
* @param id 鑰冩牳瑙勫垯涓婚敭
* @return 鑰冩牳瑙勫垯
*/
@@ -40,9 +47,15 @@
* @return 鑰冩牳瑙勫垯
*/
@Override
- public List<CheckRule> selectCheckRuleList(CheckRule checkRule)
+ public CheckRuleVO selectCheckRuleList(CheckRule checkRule)
{
- return checkRuleMapper.selectCheckRuleList(checkRule);
+ List<CheckRule> checkRules = checkRuleMapper.selectCheckRuleList(checkRule);
+ Map<Short, List<CheckRule>> map = checkRules.stream().collect(Collectors.groupingBy(CheckRule::getRuleCategory));
+ CheckRuleVO checkRuleVO = new CheckRuleVO()
+ .setCarRules(map.get(CheckConstants.Rule_Category_Car))
+ .setFaceRules(map.get(CheckConstants.Rule_Category_Face))
+ .setVideoRules(map.get(CheckConstants.Rule_Category_Video));
+ return checkRuleVO;
}
/**
@@ -54,20 +67,18 @@
@Override
public int insertCheckRule(CheckRule checkRule)
{
- checkRule.setCreateTime(DateUtils.getNowDate());
return checkRuleMapper.insertCheckRule(checkRule);
}
/**
* 淇敼鑰冩牳瑙勫垯
- *
* @param checkRule 鑰冩牳瑙勫垯
* @return 缁撴灉
*/
@Override
public int updateCheckRule(CheckRule checkRule)
{
- checkRule.setUpdateTime(DateUtils.getNowDate());
+
return checkRuleMapper.updateCheckRule(checkRule);
}
--
Gitblit v1.8.0