From 0c1f76c4a9c34a2adb05a94da4b20f3560374a29 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期五, 19 四月 2024 15:52:27 +0800
Subject: [PATCH] 考核模板
---
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplateRule.java | 92 ---
ycl-common/src/main/java/constant/CheckConstants.java | 19
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateRuleServiceImpl.java | 3
ycl-server/src/main/java/com/ycl/handler/GlobalExceptionHandler.java | 12
ycl-server/src/main/resources/mapper/zgyw/CheckTemplateMapper.xml | 32 +
ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml | 20
ycl-server/src/main/java/com/ycl/platform/mapper/CheckRuleMapper.java | 10
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckRule.java | 119 ----
ycl-server/src/main/java/com/ycl/platform/controller/CheckRuleController.java | 79 +--
ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateRuleService.java | 3
ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateRuleMapper.java | 7
ycl-pojo/src/main/java/com/ycl/platform/domain/query/CheckTemplateQuery.java | 39 +
ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckRuleVO.java | 52 --
ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateService.java | 16
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckRuleServiceImpl.java | 28
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplate.java | 171 +------
/dev/null | 88 ----
ycl-common/src/main/java/annotation/AutoFill.java | 16
ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateMapper.java | 13
ycl-server/src/main/java/com/ycl/platform/service/ICheckRuleService.java | 9
ycl-server/src/main/java/com/ycl/aop/AutoFillAspect.java | 84 ++++
ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java | 67 +-
document/需求确认书.docx | 0
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java | 175 ++++++--
ycl-server/src/main/resources/mapper/zgyw/CheckRuleMapper.xml | 57 +-
25 files changed, 550 insertions(+), 661 deletions(-)
diff --git "a/document/\351\234\200\346\261\202\347\241\256\350\256\244\344\271\246.docx" "b/document/\351\234\200\346\261\202\347\241\256\350\256\244\344\271\246.docx"
index 643e3e7..19c6b91 100644
--- "a/document/\351\234\200\346\261\202\347\241\256\350\256\244\344\271\246.docx"
+++ "b/document/\351\234\200\346\261\202\347\241\256\350\256\244\344\271\246.docx"
Binary files differ
diff --git a/ycl-common/src/main/java/annotation/AutoFill.java b/ycl-common/src/main/java/annotation/AutoFill.java
new file mode 100644
index 0000000..d2acb4f
--- /dev/null
+++ b/ycl-common/src/main/java/annotation/AutoFill.java
@@ -0,0 +1,16 @@
+package annotation;
+
+import enumeration.OperationType;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface AutoFill {
+ OperationType value();
+}
+
+
diff --git a/ycl-common/src/main/java/constant/CheckConstants.java b/ycl-common/src/main/java/constant/CheckConstants.java
new file mode 100644
index 0000000..c0a5099
--- /dev/null
+++ b/ycl-common/src/main/java/constant/CheckConstants.java
@@ -0,0 +1,19 @@
+package constant;
+
+/**
+ * 鑰冩牳甯搁噺
+ */
+public class CheckConstants {
+ //杞﹁締瑙勫垯
+ public static final Short Rule_Category_Car = 1;
+ //浜鸿劯瑙勫垯
+ public static final Short Rule_Category_Face = 2;
+ //瑙嗛瑙勫垯
+ public static final Short Rule_Category_Video = 0;
+
+ public static final String Delete = "1";
+
+ public static final String Status_Use = "0";
+ public static final String Status_Stop = "1";
+
+}
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckRule.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckRule.java
index f2bb4b8..f83afb4 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckRule.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckRule.java
@@ -1,137 +1,54 @@
package com.ycl.platform.domain.entity;
import annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.ycl.system.entity.BaseEntity;
+import lombok.Data;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
+
+import java.util.Date;
/**
* 鑰冩牳瑙勫垯瀵硅薄 t_check_rule
*
* @author ruoyi
- * @date 2024-04-01
+ * @date 2024-04-15
*/
+@Data
public class CheckRule extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Long id;
-
/** 瑙勫垯鍚嶇О */
@Excel(name = "瑙勫垯鍚嶇О")
private String ruleName;
- /** 瑙勫垯缁嗗垯 */
- @Excel(name = "瑙勫垯缁嗗垯")
+ /** 瀵瑰簲index琛ㄥ瓧娈靛悕 */
+ @Excel(name = "瀵瑰簲index琛ㄥ瓧娈靛悕")
private String ruleIndex;
- /** 瑙勫垯绫诲瀷 */
- @Excel(name = "瑙勫垯绫诲瀷")
- private Long ruleCategory;
+ /** 0.瑙嗛鐩戞帶;1.杞﹁締璇嗗埆;2.浜哄憳璇� */
+ @Excel(name = "0.瑙嗛鐩戞帶;1.杞﹁締璇嗗埆;2.浜哄憳璇�")
+ private Short ruleCategory;
- /** 鑰冩牳绫诲瀷 */
- @Excel(name = "鑰冩牳绫诲瀷")
- private Long examineCategory;
+ /** 鍙厤缃殑瑙勫垯鍙傛暟json */
+ @Excel(name = "鍙厤缃殑瑙勫垯鍙傛暟json")
+ private String ruleCondition;
/** 瑙勫垯鎻忚堪 */
@Excel(name = "瑙勫垯鎻忚堪")
private String ruleDescription;
- /** 鍚敤鐘舵�� */
- @Excel(name = "鍚敤鐘舵��")
- private Long state;
+ /** 0/1 鍚敤/鍋滅敤 */
+ @Excel(name = "0/1 鍚敤/鍋滅敤")
+ private Short state;
/** 閫昏緫鍒犻櫎 */
+ @Excel(name = "閫昏緫鍒犻櫎")
private String deleted;
- public void setId(Long id)
- {
- this.id = id;
- }
- public Long getId()
- {
- return id;
- }
- public void setRuleName(String ruleName)
- {
- this.ruleName = ruleName;
- }
-
- public String getRuleName()
- {
- return ruleName;
- }
- public void setRuleIndex(String ruleIndex)
- {
- this.ruleIndex = ruleIndex;
- }
-
- public String getRuleIndex()
- {
- return ruleIndex;
- }
- public void setRuleCategory(Long ruleCategory)
- {
- this.ruleCategory = ruleCategory;
- }
-
- public Long getRuleCategory()
- {
- return ruleCategory;
- }
- public void setExamineCategory(Long examineCategory)
- {
- this.examineCategory = examineCategory;
- }
-
- public Long getExamineCategory()
- {
- return examineCategory;
- }
- public void setRuleDescription(String ruleDescription)
- {
- this.ruleDescription = ruleDescription;
- }
-
- public String getRuleDescription()
- {
- return ruleDescription;
- }
-
- public void setState(Long state)
- {
- this.state = state;
- }
-
- public Long getState()
- {
- return state;
- }
- public void setDeleted(String deleted)
- {
- this.deleted = deleted;
- }
-
- public String getDeleted()
- {
- return deleted;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
- .append("id", getId())
- .append("ruleName", getRuleName())
- .append("ruleIndex", getRuleIndex())
- .append("ruleCategory", getRuleCategory())
- .append("examineCategory", getExamineCategory())
- .append("ruleDescription", getRuleDescription())
- .append("state", getState())
- .append("createTime", getCreateTime())
- .append("updateTime", getUpdateTime())
- .append("deleted", getDeleted())
- .toString();
- }
}
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplate.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplate.java
index a89ec25..76c6bd4 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplate.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplate.java
@@ -1,9 +1,15 @@
package com.ycl.platform.domain.entity;
import annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.ycl.system.entity.BaseEntity;
+import lombok.Data;
+import lombok.experimental.Accessors;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
+
+import java.math.BigDecimal;
+import java.util.Date;
/**
* 鑰冩牳妯℃澘瀵硅薄 t_check_template
@@ -11,12 +17,14 @@
* @author ruoyi
* @date 2024-04-01
*/
-public class CheckTemplate extends BaseEntity
+@Data
+@Accessors(chain = true)
+public class CheckTemplate
{
private static final long serialVersionUID = 1L;
/** */
- private Long id;
+ private Integer id;
/** 妯℃澘鍚嶇О */
@Excel(name = "妯℃澘鍚嶇О")
@@ -29,10 +37,16 @@
/** 璋冩暣鏂瑰紡锛氫箻闄� */
@Excel(name = "璋冩暣鏂瑰紡锛氫箻闄�")
private String adjustWay;
-
+ /** 鑰冩牳鏍囩(鐪佸巺 甯傚眬)*/
+ @Excel(name = "鑰冩牳鏍囩")
+ private Short examineTag;
/** 鑰冩牳绫诲瀷 */
@Excel(name = "鑰冩牳绫诲瀷")
- private Long examineCategory;
+ private Short examineCategory;
+
+ /** 瀹氭椂浠诲姟id*/
+ @Excel(name = "瀹氭椂浠诲姟id")
+ private Integer jobId;
/** 鍚敤/鍋滅敤 */
@Excel(name = "鍚敤/鍋滅敤")
@@ -42,149 +56,28 @@
@Excel(name = "鍖哄幙")
private String deptId;
- /** 鍒涘缓浜篿d */
+ /** 鎶ヨ鍒嗘暟 */
+ @Excel(name = "鎶ヨ鍒嗘暟")
+ private BigDecimal alarmScore;
+ /** 鑰冩牳棰戠巼 */
+ @Excel(name = "鑰冩牳棰戠巼")
+ private Short frequency;
+ /** 鑰冩牳鎻忚堪 */
+ @Excel(name = "鑰冩牳鎻忚堪")
+ private String description;
+
private Long createUser;
-
- /** 鍒涘缓浜哄鍚� */
- @Excel(name = "鍒涘缓浜哄鍚�")
private String createUserName;
-
- /** */
private Long updateUser;
-
- /** */
- @Excel(name = "")
private String updateUserName;
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date updateTime;
/** 閫昏緫鍒犻櫎 */
private String deleted;
- public void setId(Long id)
- {
- this.id = id;
- }
- public Long getId()
- {
- return id;
- }
- public void setTemplateName(String templateName)
- {
- this.templateName = templateName;
- }
- public String getTemplateName()
- {
- return templateName;
- }
- public void setAdjustCoefficient(Long adjustCoefficient)
- {
- this.adjustCoefficient = adjustCoefficient;
- }
-
- public Long getAdjustCoefficient()
- {
- return adjustCoefficient;
- }
- public void setAdjustWay(String adjustWay)
- {
- this.adjustWay = adjustWay;
- }
-
- public String getAdjustWay()
- {
- return adjustWay;
- }
- public void setExamineCategory(Long examineCategory)
- {
- this.examineCategory = examineCategory;
- }
-
- public Long getExamineCategory()
- {
- return examineCategory;
- }
- public void setStatus(String status)
- {
- this.status = status;
- }
-
- public String getStatus()
- {
- return status;
- }
- public void setDeptId(String deptId)
- {
- this.deptId = deptId;
- }
-
- public String getDeptId()
- {
- return deptId;
- }
- public void setCreateUser(Long createUser)
- {
- this.createUser = createUser;
- }
-
- public Long getCreateUser()
- {
- return createUser;
- }
- public void setCreateUserName(String createUserName)
- {
- this.createUserName = createUserName;
- }
-
- public String getCreateUserName()
- {
- return createUserName;
- }
- public void setUpdateUser(Long updateUser)
- {
- this.updateUser = updateUser;
- }
-
- public Long getUpdateUser()
- {
- return updateUser;
- }
- public void setUpdateUserName(String updateUserName)
- {
- this.updateUserName = updateUserName;
- }
-
- public String getUpdateUserName()
- {
- return updateUserName;
- }
- public void setDeleted(String deleted)
- {
- this.deleted = deleted;
- }
-
- public String getDeleted()
- {
- return deleted;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
- .append("id", getId())
- .append("templateName", getTemplateName())
- .append("adjustCoefficient", getAdjustCoefficient())
- .append("adjustWay", getAdjustWay())
- .append("examineCategory", getExamineCategory())
- .append("status", getStatus())
- .append("deptId", getDeptId())
- .append("createTime", getCreateTime())
- .append("updateTime", getUpdateTime())
- .append("createUser", getCreateUser())
- .append("createUserName", getCreateUserName())
- .append("updateUser", getUpdateUser())
- .append("updateUserName", getUpdateUserName())
- .append("deleted", getDeleted())
- .toString();
- }
}
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplateRule.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplateRule.java
index fbe2615..01fa7de 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplateRule.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplateRule.java
@@ -1,7 +1,13 @@
package com.ycl.platform.domain.entity;
import annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
import com.ycl.system.entity.BaseEntity;
+import lombok.Data;
+import lombok.experimental.Accessors;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
@@ -13,97 +19,31 @@
* @author ruoyi
* @date 2024-04-01
*/
-public class CheckTemplateRule extends BaseEntity
+@Data
+@Accessors(chain = true)
+@TableName("t_check_template_rule")
+public class CheckTemplateRule
{
private static final long serialVersionUID = 1L;
/** */
+ @TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 鑰冩牳妯℃澘 */
@Excel(name = "鑰冩牳妯℃澘")
- private Long checkTemplateId;
+ @TableField("check_template_id")
+ private Integer checkTemplateId;
/** 鑰冩牳瑙勫垯 */
@Excel(name = "鑰冩牳瑙勫垯")
- private Long checkRuleId;
+ @TableField("check_rule_id")
+ private Integer checkRuleId;
/** 瑙勫垯鏉冮噸 */
@Excel(name = "瑙勫垯鏉冮噸")
+ @TableField("weight")
private BigDecimal weight;
- /** 婊″垎 */
- @Excel(name = "婊″垎")
- private BigDecimal maxScore;
- /** 瀹℃牳鐘舵�� */
- @Excel(name = "瀹℃牳鐘舵��")
- private Long auditState;
-
- public void setId(Long id)
- {
- this.id = id;
- }
-
- public Long getId()
- {
- return id;
- }
- public void setCheckTemplateId(Long checkTemplateId)
- {
- this.checkTemplateId = checkTemplateId;
- }
-
- public Long getCheckTemplateId()
- {
- return checkTemplateId;
- }
- public void setCheckRuleId(Long checkRuleId)
- {
- this.checkRuleId = checkRuleId;
- }
-
- public Long getCheckRuleId()
- {
- return checkRuleId;
- }
- public void setWeight(BigDecimal weight)
- {
- this.weight = weight;
- }
-
- public BigDecimal getWeight()
- {
- return weight;
- }
- public void setMaxScore(BigDecimal maxScore)
- {
- this.maxScore = maxScore;
- }
-
- public BigDecimal getMaxScore()
- {
- return maxScore;
- }
- public void setAuditState(Long auditState)
- {
- this.auditState = auditState;
- }
-
- public Long getAuditState()
- {
- return auditState;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
- .append("id", getId())
- .append("checkTemplateId", getCheckTemplateId())
- .append("checkRuleId", getCheckRuleId())
- .append("weight", getWeight())
- .append("maxScore", getMaxScore())
- .append("auditState", getAuditState())
- .toString();
- }
}
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/query/CheckTemplateQuery.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/query/CheckTemplateQuery.java
index 388afbd..557758b 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/query/CheckTemplateQuery.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/query/CheckTemplateQuery.java
@@ -1,60 +1,65 @@
package com.ycl.platform.domain.query;
-import annotation.Excel;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
import com.ycl.platform.base.AbsQuery;
import io.swagger.annotations.ApiModel;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
+import java.util.Map;
@Data
@Accessors(chain = true)
@ApiModel(value = "瑙勫垯妯℃澘鏌ヨ", description = "瑙勫垯妯℃澘鏌ヨ")
public class CheckTemplateQuery extends AbsQuery {
/** */
- private Long id;
+ private Integer id;
/** 妯℃澘鍚嶇О */
- @Excel(name = "妯℃澘鍚嶇О")
+ @NotBlank(message = "妯℃澘鍚嶄笉鑳戒负绌�")
private String templateName;
/** 璋冩暣绯绘暟 */
- @Excel(name = "璋冩暣绯绘暟")
private Long adjustCoefficient;
/** 璋冩暣鏂瑰紡锛氫箻闄� */
- @Excel(name = "璋冩暣鏂瑰紡锛氫箻闄�")
private String adjustWay;
+ /** 鑰冩牳鏍囩锛�0/1 鐪佸巺/甯傚眬锛�*/
+ @NotNull(message = "鑰冩牳鏍囩涓嶈兘涓虹┖")
+ private Short examineTag;
+
/** 鑰冩牳绫诲瀷 */
- @Excel(name = "鑰冩牳绫诲瀷")
- private Long examineCategory;
+ @NotNull(message = "鑰冩牳绫诲瀷涓嶈兘涓虹┖")
+ private Short examineCategory;
+
+ /** 瀹氭椂浠诲姟id*/
+ private Integer jobId;
/** 鍚敤/鍋滅敤 */
- @Excel(name = "鍚敤/鍋滅敤")
+ @NotBlank(message = "鍚敤鐘舵�佷笉鑳戒负绌�")
private String status;
/** 鍖哄幙 */
- @Excel(name = "鍖哄幙")
- private List deptId;
+ private List<Integer> deptId;
/** 鍒涘缓浜篿d */
private Long createUser;
/** 鍒涘缓浜哄鍚� */
- @Excel(name = "鍒涘缓浜哄鍚�")
private String createUserName;
/** */
private Long updateUser;
/** */
- @Excel(name = "")
private String updateUserName;
/** 閫昏緫鍒犻櫎 */
@@ -76,4 +81,14 @@
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(fill = FieldFill.UPDATE)
private Date updateTime;
+
+ /** 鎶ヨ鍒嗘暟 */
+ private String alarmScore;
+ /** 鑰冩牳棰戠巼 */
+ @NotNull(message = "鑰冩牳棰戠巼涓嶈兘涓虹┖")
+ private Short frequency;
+ /** 鑰冩牳鎻忚堪 */
+ private String description;
+ /** 鑰冩牳瑙勫垯 */
+ private List<Map<String,Object>> ruleFormList;
}
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckRuleVO.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckRuleVO.java
index b4ca16c..d321861 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckRuleVO.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckRuleVO.java
@@ -1,55 +1,15 @@
package com.ycl.platform.domain.vo;
-import annotation.Excel;
-import com.ycl.platform.base.AbsVo;
+import com.ycl.platform.domain.entity.CheckRule;
import lombok.Data;
import lombok.experimental.Accessors;
-import java.math.BigDecimal;
+import java.util.List;
-/**
- * 鑰冩牳瑙勫垯灞曠ず
- *
- */
@Data
@Accessors(chain = true)
-public class CheckRuleVO extends AbsVo {
- /**
- * 妯℃澘id
- */
- private Integer templateId;
-
- /** 妯℃澘鍚� */
- private String templateName;
- /**
- * 瀹℃牳鐘舵��
- */
- private Integer auditState;
- /**
- * 瑙勫垯鍚嶇О
- */
- private String ruleName;
- /**
- * 瑙勫垯绫诲瀷
- */
- private String ruleCategory;
-
- /** 瑙勫垯缁嗗垯 */
- private String ruleIndex;
-
- /** 鑰冩牳绫诲瀷 */
- private Long examineCategory;
-
- /** 瑙勫垯鎻忚堪 */
- private String ruleDescription;
-
- /** 瑙勫垯鏉冮噸 */
- private BigDecimal weight;
-
- /** 鍚敤鐘舵�� */
- private Long state;
-
- /** 閫昏緫鍒犻櫎 */
- private String deleted;
-
+public class CheckRuleVO {
+ private List<CheckRule> videoRules;
+ private List<CheckRule> faceRules;
+ private List<CheckRule> carRules;
}
diff --git a/ycl-server/src/main/java/com/ycl/aop/AutoFillAspect.java b/ycl-server/src/main/java/com/ycl/aop/AutoFillAspect.java
new file mode 100644
index 0000000..02c0db3
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/aop/AutoFillAspect.java
@@ -0,0 +1,84 @@
+package com.ycl.aop;
+
+import annotation.AutoFill;
+import com.ycl.utils.SecurityUtils;
+import enumeration.OperationType;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
+import java.util.Date;
+
+@Aspect
+@Component
+@Slf4j
+public class AutoFillAspect {
+ /**
+ * 鍒囧叆鐐�
+ */
+ @Pointcut("execution(* com.ycl.platform.mapper.*.*(..)) && @annotation(annotation.AutoFill)")
+ public void autoFillPointCut(){
+
+ }
+
+ /**
+ * 鍓嶇疆閫氱煡锛屽湪閫氱煡涓繘琛屽叕鍏卞瓧娈电殑璧嬪��
+ */
+ @Before("autoFillPointCut()")
+ public void autoFill(JoinPoint joinPoint){
+ log.info("寮�濮嬭繘琛屽叕鍏卞瓧娈佃嚜鍔ㄥ~鍏�");
+
+ //鑾峰彇鍒板綋鍓嶈鎷︽埅鐨勬柟娉曚笂鐨勬暟鎹簱鎿嶄綔绫诲瀷
+ MethodSignature signature = (MethodSignature) joinPoint.getSignature();//鏂规硶绛惧悕瀵硅薄
+ AutoFill autoFill = signature.getMethod().getAnnotation(AutoFill.class);//鑾峰緱鏂规硶涓婄殑娉ㄨВ瀵硅薄
+ OperationType operationType = autoFill.value();//鑾峰緱鏁版嵁搴撴搷浣滅被鍨�
+
+ //鑾峰彇鍒板綋鍓嶈鎷︽埅鐨勬柟娉曠殑鍙傛暟--瀹炰綋瀵硅薄
+ Object[] args = joinPoint.getArgs();
+ if(args == null || args.length == 0){
+ return;
+ }
+
+ Object entity = args[0];
+
+ //鍑嗗璧嬪�肩殑鏁版嵁
+ Date now = new Date();
+ Long userId = SecurityUtils.getUserId();
+
+ //鏍规嵁褰撳墠涓嶅悓鐨勬搷浣滅被鍨嬶紝涓哄搴旂殑灞炴�ч�氳繃鍙嶅皠鏉ヨ祴鍊�
+ if(operationType == OperationType.INSERT){
+ //涓�4涓叕鍏卞瓧娈佃祴鍊�
+ try {
+ Method setCreateTime = entity.getClass().getDeclaredMethod("setCreateTime", Date.class);
+ Method setCreateUser = entity.getClass().getDeclaredMethod("setCreateUser", Long.class);
+ Method setUpdateTime = entity.getClass().getDeclaredMethod("setUpdateTime", Date.class);
+ Method setUpdateUser = entity.getClass().getDeclaredMethod("setUpdateUser", Long.class);
+
+ //閫氳繃鍙嶅皠涓哄璞″睘鎬ц祴鍊�
+ setCreateTime.invoke(entity,now);
+ setCreateUser.invoke(entity,userId);
+ setUpdateTime.invoke(entity,now);
+ setUpdateUser.invoke(entity,userId);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }else if(operationType == OperationType.UPDATE){
+ //涓�2涓叕鍏卞瓧娈佃祴鍊�
+ try {
+ Method setUpdateTime = entity.getClass().getDeclaredMethod("setUpdateTime", Date.class);
+ Method setUpdateUser = entity.getClass().getDeclaredMethod("setUpdateUser", Long.class);
+
+ //閫氳繃鍙嶅皠涓哄璞″睘鎬ц祴鍊�
+ setUpdateTime.invoke(entity,now);
+ setUpdateUser.invoke(entity,userId);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/ycl-server/src/main/java/com/ycl/handler/GlobalExceptionHandler.java b/ycl-server/src/main/java/com/ycl/handler/GlobalExceptionHandler.java
index bcaade1..1002ff5 100644
--- a/ycl-server/src/main/java/com/ycl/handler/GlobalExceptionHandler.java
+++ b/ycl-server/src/main/java/com/ycl/handler/GlobalExceptionHandler.java
@@ -6,6 +6,7 @@
import com.ycl.utils.StringUtils;
import constant.HttpStatus;
import jakarta.servlet.http.HttpServletRequest;
+import jakarta.validation.UnexpectedTypeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
@@ -102,7 +103,16 @@
String message = e.getBindingResult().getFieldError().getDefaultMessage();
return AjaxResult.error(message);
}
-
+ /**
+ * 鍙傛暟鏍¢獙寮傚父
+ */
+ @ExceptionHandler(UnexpectedTypeException.class)
+ public AjaxResult handleUnexpectedTypeException(UnexpectedTypeException e)
+ {
+ log.error(e.getMessage(), e);
+ String message = e.getMessage();
+ return AjaxResult.error(message);
+ }
/**
* 婕旂ず妯″紡寮傚父
*/
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CheckPublishController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CheckPublishController.java
deleted file mode 100644
index 611828b..0000000
--- a/ycl-server/src/main/java/com/ycl/platform/controller/CheckPublishController.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package com.ycl.platform.controller;
-
-import annotation.Log;
-import com.ycl.platform.domain.entity.CheckPublish;
-import com.ycl.platform.service.ICheckPublishService;
-import com.ycl.system.AjaxResult;
-import com.ycl.system.controller.BaseController;
-import com.ycl.system.page.TableDataInfo;
-import com.ycl.utils.poi.ExcelUtil;
-import enumeration.BusinessType;
-import jakarta.servlet.http.HttpServletResponse;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-
-/**
- * 鑰冩牳鍙戝竷Controller
- *
- * @author ruoyi
- * @date 2024-04-01
- */
-@RestController
-@RequestMapping("/check/publish")
-public class CheckPublishController extends BaseController
-{
- @Autowired
- private ICheckPublishService checkPublishService;
-
- /**
- * 鏌ヨ鑰冩牳鍙戝竷鍒楄〃
- */
-// @PreAuthorize("@ss.hasPermi('system:publish:list')")
- @GetMapping("/list")
- public TableDataInfo list(CheckPublish checkPublish)
- {
- startPage();
- List<CheckPublish> list = checkPublishService.selectCheckPublishList(checkPublish);
- return getDataTable(list);
- }
-
- /**
- * 瀵煎嚭鑰冩牳鍙戝竷鍒楄〃
- */
- @PreAuthorize("@ss.hasPermi('system:publish:export')")
- @Log(title = "鑰冩牳鍙戝竷", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, CheckPublish checkPublish)
- {
- List<CheckPublish> list = checkPublishService.selectCheckPublishList(checkPublish);
- ExcelUtil<CheckPublish> util = new ExcelUtil<CheckPublish>(CheckPublish.class);
- util.exportExcel(response, list, "鑰冩牳鍙戝竷鏁版嵁");
- }
-
- /**
- * 鑾峰彇鑰冩牳鍙戝竷璇︾粏淇℃伅
- */
-// @PreAuthorize("@ss.hasPermi('system:publish:query')")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id)
- {
- return success(checkPublishService.selectCheckPublishById(id));
- }
-
- /**
- * 鏂板鑰冩牳鍙戝竷
- */
-// @PreAuthorize("@ss.hasPermi('system:publish:add')")
- @Log(title = "鑰冩牳鍙戝竷", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody CheckPublish checkPublish)
- {
- return toAjax(checkPublishService.insertCheckPublish(checkPublish));
- }
-
- /**
- * 淇敼鑰冩牳鍙戝竷
- */
- @PreAuthorize("@ss.hasPermi('system:publish:edit')")
- @Log(title = "鑰冩牳鍙戝竷", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody CheckPublish checkPublish)
- {
- return toAjax(checkPublishService.updateCheckPublish(checkPublish));
- }
-
- /**
- * 鍒犻櫎鑰冩牳鍙戝竷
- */
- @PreAuthorize("@ss.hasPermi('system:publish:remove')")
- @Log(title = "鑰冩牳鍙戝竷", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
- {
- return toAjax(checkPublishService.deleteCheckPublishByIds(ids));
- }
-}
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CheckRuleController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CheckRuleController.java
index 81ae394..6c6f303 100644
--- a/ycl-server/src/main/java/com/ycl/platform/controller/CheckRuleController.java
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/CheckRuleController.java
@@ -2,27 +2,20 @@
import annotation.Log;
import com.ycl.platform.domain.entity.CheckRule;
-import com.ycl.platform.domain.query.CheckRuleQuery;
import com.ycl.platform.domain.vo.CheckRuleVO;
import com.ycl.platform.service.ICheckRuleService;
import com.ycl.system.AjaxResult;
import com.ycl.system.controller.BaseController;
-import com.ycl.system.page.TableDataInfo;
-import com.ycl.utils.poi.ExcelUtil;
import enumeration.BusinessType;
-import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
/**
* 鑰冩牳瑙勫垯Controller
*
* @author ruoyi
- * @date 2024-04-01
+ * @date 2024-04-15
*/
@RestController
@RequestMapping("/check/rule")
@@ -34,53 +27,30 @@
/**
* 鏌ヨ鑰冩牳瑙勫垯鍒楄〃
*/
-// @PreAuthorize("@ss.hasPermi('system:rule:list')")
- @PostMapping("/list")
- public TableDataInfo list(@RequestBody CheckRuleQuery checkRuleQuery)
+ @PreAuthorize("@ss.hasPermi('check:rule:list')")
+ @GetMapping("/list")
+ public AjaxResult list(CheckRule checkRule)
{
- startPage();
- List<CheckRuleVO> list = checkRuleService.selectCheckRuleList(checkRuleQuery);
- return getDataTable(list);
+ CheckRuleVO checkRuleVO = checkRuleService.selectCheckRuleList(checkRule);
+ return success(checkRuleVO);
}
- /**
- * 瀵煎嚭鑰冩牳瑙勫垯鍒楄〃
- */
- @PreAuthorize("@ss.hasPermi('system:rule:export')")
- @Log(title = "鑰冩牳瑙勫垯", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, CheckRuleQuery checkRuleQuery)
- {
- List<CheckRuleVO> list = checkRuleService.selectCheckRuleList(checkRuleQuery);
- ExcelUtil<CheckRuleVO> util = new ExcelUtil<CheckRuleVO>(CheckRuleVO.class);
- util.exportExcel(response, list, "鑰冩牳瑙勫垯鏁版嵁");
- }
/**
* 鑾峰彇鑰冩牳瑙勫垯璇︾粏淇℃伅
*/
-// @PreAuthorize("@ss.hasPermi('system:rule:query')")
+ @PreAuthorize("@ss.hasPermi('check:rule:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(checkRuleService.selectCheckRuleById(id));
}
- /**
- * 鏂板鑰冩牳瑙勫垯
- */
- @PreAuthorize("@ss.hasPermi('system:rule:add')")
- @Log(title = "鑰冩牳瑙勫垯", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody CheckRule checkRule)
- {
- return toAjax(checkRuleService.insertCheckRule(checkRule));
- }
/**
* 淇敼鑰冩牳瑙勫垯
*/
- @PreAuthorize("@ss.hasPermi('system:rule:edit')")
+ @PreAuthorize("@ss.hasPermi('check:rule:edit')")
@Log(title = "鑰冩牳瑙勫垯", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CheckRule checkRule)
@@ -88,14 +58,27 @@
return toAjax(checkRuleService.updateCheckRule(checkRule));
}
- /**
- * 鍒犻櫎鑰冩牳瑙勫垯
- */
- @PreAuthorize("@ss.hasPermi('system:rule:remove')")
- @Log(title = "鑰冩牳瑙勫垯", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
- {
- return toAjax(checkRuleService.deleteCheckRuleByIds(ids));
- }
+// /**
+// * 瀵煎嚭鑰冩牳瑙勫垯鍒楄〃
+// */
+// @PreAuthorize("@ss.hasPermi('check:rule:export')")
+// @Log(title = "鑰冩牳瑙勫垯", businessType = BusinessType.EXPORT)
+// @PostMapping("/export")
+// public void export(HttpServletResponse response, CheckRule checkRule)
+// {
+// List<CheckRule> list = checkRuleService.selectCheckRuleList(checkRule);
+// ExcelUtil<CheckRule> util = new ExcelUtil<CheckRule>(CheckRule.class);
+// util.exportExcel(response, list, "鑰冩牳瑙勫垯鏁版嵁");
+// }
+
+// /**
+// * 鏂板鑰冩牳瑙勫垯
+// */
+// @PreAuthorize("@ss.hasPermi('check:rule:add')")
+// @Log(title = "鑰冩牳瑙勫垯", businessType = BusinessType.INSERT)
+// @PostMapping
+// public AjaxResult add(@RequestBody CheckRule checkRule)
+// {
+// return toAjax(checkRuleService.insertCheckRule(checkRule));
+// }
}
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java
index 18f3e66..8f6248c 100644
--- a/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java
@@ -8,12 +8,11 @@
import com.ycl.system.Result;
import com.ycl.system.controller.BaseController;
import com.ycl.system.page.TableDataInfo;
-import com.ycl.utils.poi.ExcelUtil;
import enumeration.BusinessType;
import io.swagger.annotations.ApiOperation;
-import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -34,69 +33,69 @@
/**
* 鏌ヨ鑰冩牳妯℃澘鍒楄〃
*/
-// @PreAuthorize("@ss.hasPermi('system:template:list')")
+ @PreAuthorize("@ss.hasPermi('check:template:list')")
@GetMapping("/list")
public TableDataInfo list(CheckTemplateQuery checkTemplateDTO)
{
startPage();
- List<CheckTemplate> list = checkTemplateService.selectCheckTemplateList(checkTemplateDTO);
+ List<CheckTemplateQuery> list = checkTemplateService.selectCheckTemplateList(checkTemplateDTO);
return getDataTable(list);
}
- /**
- * 瀵煎嚭鑰冩牳妯℃澘鍒楄〃
- */
-// @PreAuthorize("@ss.hasPermi('system:template:export')")
- @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, CheckTemplateQuery checkTemplateDTO)
- {
- List<CheckTemplate> list = checkTemplateService.selectCheckTemplateList(checkTemplateDTO);
- ExcelUtil<CheckTemplate> util = new ExcelUtil<CheckTemplate>(CheckTemplate.class);
- util.exportExcel(response, list, "鑰冩牳妯℃澘鏁版嵁");
- }
/**
* 鑾峰彇鑰冩牳妯℃澘璇︾粏淇℃伅
*/
-// @PreAuthorize("@ss.hasPermi('system:template:query')")
+ @PreAuthorize("@ss.hasPermi('check:template:query')")
@GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id)
+ public AjaxResult getInfo(@PathVariable("id") String id)
{
- return success(checkTemplateService.selectCheckTemplateById(id));
+ return success(checkTemplateService.selectCheckTemplateById(Integer.parseInt(id)));
}
/**
* 鏂板鑰冩牳妯℃澘
*/
-// @PreAuthorize("@ss.hasPermi('system:template:add')")
+ @PreAuthorize("@ss.hasPermi('check:template:add')")
@Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.INSERT)
@PostMapping
- public AjaxResult add(@RequestBody CheckTemplateQuery checkTemplateDTO)
+ public AjaxResult add(@RequestBody @Validated CheckTemplateQuery checkTemplateDTO)
{
+
return toAjax(checkTemplateService.insertCheckTemplate(checkTemplateDTO));
+ }
+
+ /**
+ * 澶嶅埗鑰冩牳妯℃澘
+ */
+ @PreAuthorize("@ss.hasPermi('check:template:copy')")
+ @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.INSERT)
+ @PostMapping("/copy")
+ public AjaxResult copy(@RequestBody CheckTemplateQuery checkTemplateDTO)
+ {
+ return toAjax(checkTemplateService.copyCheckTemplate(checkTemplateDTO));
}
/**
* 淇敼鑰冩牳妯℃澘
*/
- @PreAuthorize("@ss.hasPermi('system:template:edit')")
+ @PreAuthorize("@ss.hasPermi('check:template:edit')")
@Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.UPDATE)
@PutMapping
- public AjaxResult edit(@RequestBody CheckTemplate checkTemplate)
+ public AjaxResult edit(@RequestBody CheckTemplateQuery checkTemplateDTO)
{
- return toAjax(checkTemplateService.updateCheckTemplate(checkTemplate));
+ return toAjax(checkTemplateService.updateCheckTemplate(checkTemplateDTO));
}
/**
* 鍒犻櫎鑰冩牳妯℃澘
*/
- @PreAuthorize("@ss.hasPermi('system:template:remove')")
+ @PreAuthorize("@ss.hasPermi('check:template:remove')")
@Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
+ @DeleteMapping("/{id}")
+ public AjaxResult remove(@PathVariable String id)
{
- return toAjax(checkTemplateService.deleteCheckTemplateByIds(ids));
+ return toAjax(checkTemplateService.deleteCheckTemplateById(Integer.parseInt(id)));
}
@GetMapping("/pullList")
@@ -104,4 +103,16 @@
public Result pullList() {
return checkTemplateService.pullList();
}
+// /**
+// * 瀵煎嚭鑰冩牳妯℃澘鍒楄〃
+// */
+//// @PreAuthorize("@ss.hasPermi('system:template:export')")
+// @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.EXPORT)
+// @PostMapping("/export")
+// public void export(HttpServletResponse response, CheckTemplateQuery checkTemplateDTO)
+// {
+// List<CheckTemplate> list = checkTemplateService.selectCheckTemplateList(checkTemplateDTO);
+// ExcelUtil<CheckTemplate> util = new ExcelUtil<CheckTemplate>(CheckTemplate.class);
+// util.exportExcel(response, list, "鑰冩牳妯℃澘鏁版嵁");
+// }
}
diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckRuleMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckRuleMapper.java
index fdf0420..fe971e4 100644
--- a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckRuleMapper.java
+++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckRuleMapper.java
@@ -1,8 +1,6 @@
package com.ycl.platform.mapper;
import com.ycl.platform.domain.entity.CheckRule;
-import com.ycl.platform.domain.query.CheckRuleQuery;
-import com.ycl.platform.domain.vo.CheckRuleVO;
import java.util.List;
@@ -10,7 +8,7 @@
* 鑰冩牳瑙勫垯Mapper鎺ュ彛
*
* @author ruoyi
- * @date 2024-04-01
+ * @date 2024-04-15
*/
public interface CheckRuleMapper
{
@@ -20,15 +18,15 @@
* @param id 鑰冩牳瑙勫垯涓婚敭
* @return 鑰冩牳瑙勫垯
*/
- public CheckRuleVO selectCheckRuleById(Long id);
+ public CheckRule selectCheckRuleById(Long id);
/**
* 鏌ヨ鑰冩牳瑙勫垯鍒楄〃
*
- * @param checkRuleQuery 鑰冩牳瑙勫垯
+ * @param checkRule 鑰冩牳瑙勫垯
* @return 鑰冩牳瑙勫垯闆嗗悎
*/
- public List<CheckRuleVO> selectCheckRuleList(CheckRuleQuery checkRuleQuery);
+ public List<CheckRule> selectCheckRuleList(CheckRule checkRule);
/**
* 鏂板鑰冩牳瑙勫垯
diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateMapper.java
index 02479a1..0bc5546 100644
--- a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateMapper.java
+++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateMapper.java
@@ -1,7 +1,10 @@
package com.ycl.platform.mapper;
+import annotation.AutoFill;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ycl.platform.domain.entity.CheckTemplate;
import com.ycl.platform.domain.query.CheckTemplateQuery;
+import enumeration.OperationType;
import java.util.List;
@@ -11,7 +14,7 @@
* @author ruoyi
* @date 2024-04-01
*/
-public interface CheckTemplateMapper
+public interface CheckTemplateMapper extends BaseMapper<CheckTemplate>
{
/**
* 鏌ヨ鑰冩牳妯℃澘
@@ -19,7 +22,7 @@
* @param id 鑰冩牳妯℃澘涓婚敭
* @return 鑰冩牳妯℃澘
*/
- public CheckTemplate selectCheckTemplateById(Long id);
+ public CheckTemplate selectCheckTemplateById(Integer id);
/**
* 鏌ヨ鑰冩牳妯℃澘鍒楄〃
@@ -35,6 +38,7 @@
* @param checkTemplate 鑰冩牳妯℃澘
* @return 缁撴灉
*/
+ @AutoFill(OperationType.INSERT)
public int insertCheckTemplate(CheckTemplate checkTemplate);
/**
@@ -43,6 +47,7 @@
* @param checkTemplate 鑰冩牳妯℃澘
* @return 缁撴灉
*/
+ @AutoFill(OperationType.UPDATE)
public int updateCheckTemplate(CheckTemplate checkTemplate);
/**
@@ -51,7 +56,7 @@
* @param id 鑰冩牳妯℃澘涓婚敭
* @return 缁撴灉
*/
- public int deleteCheckTemplateById(Long id);
+ public int deleteCheckTemplateById(Integer id);
/**
* 鎵归噺鍒犻櫎鑰冩牳妯℃澘
@@ -59,5 +64,5 @@
* @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
* @return 缁撴灉
*/
- public int deleteCheckTemplateByIds(Long[] ids);
+ public int deleteCheckTemplateByIds(Integer[] ids);
}
diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateRuleMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateRuleMapper.java
index 3bf44a8..2d1f9e0 100644
--- a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateRuleMapper.java
+++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateRuleMapper.java
@@ -1,5 +1,6 @@
package com.ycl.platform.mapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ycl.platform.domain.entity.CheckTemplateRule;
import java.util.List;
@@ -10,7 +11,7 @@
* @author ruoyi
* @date 2024-04-01
*/
-public interface CheckTemplateRuleMapper
+public interface CheckTemplateRuleMapper extends BaseMapper<CheckTemplateRule>
{
/**
* 鏌ヨ鑰冩牳妯℃澘-瑙勫垯涓棿
@@ -59,4 +60,8 @@
* @return 缁撴灉
*/
public int deleteCheckTemplateRuleByIds(Long[] ids);
+
+ List<CheckTemplateRule> selectListByTemplateId(Integer id);
+
+ void deleteByTemplateId(Integer templateId);
}
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckPublishService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckPublishService.java
deleted file mode 100644
index d71ba7f..0000000
--- a/ycl-server/src/main/java/com/ycl/platform/service/ICheckPublishService.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package com.ycl.platform.service;
-
-import com.ycl.platform.domain.entity.CheckPublish;
-
-import java.util.List;
-
-/**
- * 鑰冩牳鍙戝竷Service鎺ュ彛
- *
- * @author ruoyi
- * @date 2024-04-01
- */
-public interface ICheckPublishService
-{
- /**
- * 鏌ヨ鑰冩牳鍙戝竷
- *
- * @param id 鑰冩牳鍙戝竷涓婚敭
- * @return 鑰冩牳鍙戝竷
- */
- public CheckPublish selectCheckPublishById(Long id);
-
- /**
- * 鏌ヨ鑰冩牳鍙戝竷鍒楄〃
- *
- * @param checkPublish 鑰冩牳鍙戝竷
- * @return 鑰冩牳鍙戝竷闆嗗悎
- */
- public List<CheckPublish> selectCheckPublishList(CheckPublish checkPublish);
-
- /**
- * 鏂板鑰冩牳鍙戝竷
- *
- * @param checkPublish 鑰冩牳鍙戝竷
- * @return 缁撴灉
- */
- public int insertCheckPublish(CheckPublish checkPublish);
-
- /**
- * 淇敼鑰冩牳鍙戝竷
- *
- * @param checkPublish 鑰冩牳鍙戝竷
- * @return 缁撴灉
- */
- public int updateCheckPublish(CheckPublish checkPublish);
-
- /**
- * 鎵归噺鍒犻櫎鑰冩牳鍙戝竷
- *
- * @param ids 闇�瑕佸垹闄ょ殑鑰冩牳鍙戝竷涓婚敭闆嗗悎
- * @return 缁撴灉
- */
- public int deleteCheckPublishByIds(Long[] ids);
-
- /**
- * 鍒犻櫎鑰冩牳鍙戝竷淇℃伅
- *
- * @param id 鑰冩牳鍙戝竷涓婚敭
- * @return 缁撴灉
- */
- public int deleteCheckPublishById(Long id);
-}
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckRuleService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckRuleService.java
index 6235915..714280d 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/ICheckRuleService.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckRuleService.java
@@ -1,7 +1,6 @@
package com.ycl.platform.service;
import com.ycl.platform.domain.entity.CheckRule;
-import com.ycl.platform.domain.query.CheckRuleQuery;
import com.ycl.platform.domain.vo.CheckRuleVO;
import java.util.List;
@@ -10,7 +9,7 @@
* 鑰冩牳瑙勫垯Service鎺ュ彛
*
* @author ruoyi
- * @date 2024-04-01
+ * @date 2024-04-15
*/
public interface ICheckRuleService
{
@@ -20,15 +19,15 @@
* @param id 鑰冩牳瑙勫垯涓婚敭
* @return 鑰冩牳瑙勫垯
*/
- public CheckRuleVO selectCheckRuleById(Long id);
+ public CheckRule selectCheckRuleById(Long id);
/**
* 鏌ヨ鑰冩牳瑙勫垯鍒楄〃
*
- * @param checkRuleQuery 鑰冩牳瑙勫垯
+ * @param checkRule 鑰冩牳瑙勫垯
* @return 鑰冩牳瑙勫垯闆嗗悎
*/
- public List<CheckRuleVO> selectCheckRuleList(CheckRuleQuery checkRuleQuery);
+ public CheckRuleVO selectCheckRuleList(CheckRule checkRule);
/**
* 鏂板鑰冩牳瑙勫垯
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateRuleService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateRuleService.java
index e833e20..33f9f8a 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateRuleService.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateRuleService.java
@@ -1,5 +1,6 @@
package com.ycl.platform.service;
+import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.platform.domain.entity.CheckTemplateRule;
import java.util.List;
@@ -10,7 +11,7 @@
* @author ruoyi
* @date 2024-04-01
*/
-public interface ICheckTemplateRuleService
+public interface ICheckTemplateRuleService extends IService<CheckTemplateRule>
{
/**
* 鏌ヨ鑰冩牳妯℃澘-瑙勫垯涓棿
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateService.java
index 44eb4ea..eeeaee6 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateService.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateService.java
@@ -1,5 +1,6 @@
package com.ycl.platform.service;
+import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.platform.domain.entity.CheckTemplate;
import com.ycl.platform.domain.query.CheckTemplateQuery;
import com.ycl.system.Result;
@@ -12,7 +13,7 @@
* @author ruoyi
* @date 2024-04-01
*/
-public interface ICheckTemplateService
+public interface ICheckTemplateService extends IService<CheckTemplate>
{
/**
* 鏌ヨ鑰冩牳妯℃澘
@@ -20,7 +21,7 @@
* @param id 鑰冩牳妯℃澘涓婚敭
* @return 鑰冩牳妯℃澘
*/
- public CheckTemplateQuery selectCheckTemplateById(Long id);
+ public CheckTemplateQuery selectCheckTemplateById(Integer id);
/**
* 鏌ヨ鑰冩牳妯℃澘鍒楄〃
@@ -28,7 +29,7 @@
* @param checkTemplateDTO 鑰冩牳妯℃澘
* @return 鑰冩牳妯℃澘闆嗗悎
*/
- public List<CheckTemplate> selectCheckTemplateList(CheckTemplateQuery checkTemplateDTO);
+ public List<CheckTemplateQuery> selectCheckTemplateList(CheckTemplateQuery checkTemplateDTO);
/**
* 鏂板鑰冩牳妯℃澘
@@ -41,10 +42,10 @@
/**
* 淇敼鑰冩牳妯℃澘
*
- * @param checkTemplate 鑰冩牳妯℃澘
+ * @param checkTemplateDTO 鑰冩牳妯℃澘
* @return 缁撴灉
*/
- public int updateCheckTemplate(CheckTemplate checkTemplate);
+ public int updateCheckTemplate(CheckTemplateQuery checkTemplateDTO);
/**
* 鎵归噺鍒犻櫎鑰冩牳妯℃澘
@@ -52,7 +53,7 @@
* @param ids 闇�瑕佸垹闄ょ殑鑰冩牳妯℃澘涓婚敭闆嗗悎
* @return 缁撴灉
*/
- public int deleteCheckTemplateByIds(Long[] ids);
+ public int deleteCheckTemplateByIds(Integer[] ids);
/**
* 鍒犻櫎鑰冩牳妯℃澘淇℃伅
@@ -60,8 +61,9 @@
* @param id 鑰冩牳妯℃澘涓婚敭
* @return 缁撴灉
*/
- public int deleteCheckTemplateById(Long id);
+ public int deleteCheckTemplateById(Integer id);
Result pullList();
+ int copyCheckTemplate(CheckTemplateQuery checkTemplateDTO);
}
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckPublishServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckPublishServiceImpl.java
deleted file mode 100644
index b855ad4..0000000
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckPublishServiceImpl.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.ycl.platform.service.impl;
-
-import com.ycl.platform.domain.entity.CheckPublish;
-import com.ycl.platform.mapper.CheckPublishMapper;
-import com.ycl.platform.service.ICheckPublishService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import utils.DateUtils;
-
-import java.util.List;
-
-/**
- * 鑰冩牳鍙戝竷Service涓氬姟灞傚鐞�
- *
- * @author ruoyi
- * @date 2024-04-01
- */
-@Service
-public class CheckPublishServiceImpl implements ICheckPublishService
-{
- @Autowired
- private CheckPublishMapper checkPublishMapper;
-
- /**
- * 鏌ヨ鑰冩牳鍙戝竷
- *
- * @param id 鑰冩牳鍙戝竷涓婚敭
- * @return 鑰冩牳鍙戝竷
- */
- @Override
- public CheckPublish selectCheckPublishById(Long id)
- {
- return checkPublishMapper.selectCheckPublishById(id);
- }
-
- /**
- * 鏌ヨ鑰冩牳鍙戝竷鍒楄〃
- *
- * @param checkPublish 鑰冩牳鍙戝竷
- * @return 鑰冩牳鍙戝竷
- */
- @Override
- public List<CheckPublish> selectCheckPublishList(CheckPublish checkPublish)
- {
- return checkPublishMapper.selectCheckPublishList(checkPublish);
- }
-
- /**
- * 鏂板鑰冩牳鍙戝竷
- *
- * @param checkPublish 鑰冩牳鍙戝竷
- * @return 缁撴灉
- */
- @Override
- public int insertCheckPublish(CheckPublish checkPublish)
- {
- checkPublish.setCreateTime(DateUtils.getNowDate());
- return checkPublishMapper.insertCheckPublish(checkPublish);
- }
-
- /**
- * 淇敼鑰冩牳鍙戝竷
- *
- * @param checkPublish 鑰冩牳鍙戝竷
- * @return 缁撴灉
- */
- @Override
- public int updateCheckPublish(CheckPublish checkPublish)
- {
- checkPublish.setUpdateTime(DateUtils.getNowDate());
- return checkPublishMapper.updateCheckPublish(checkPublish);
- }
-
- /**
- * 鎵归噺鍒犻櫎鑰冩牳鍙戝竷
- *
- * @param ids 闇�瑕佸垹闄ょ殑鑰冩牳鍙戝竷涓婚敭
- * @return 缁撴灉
- */
- @Override
- public int deleteCheckPublishByIds(Long[] ids)
- {
- return checkPublishMapper.deleteCheckPublishByIds(ids);
- }
-
- /**
- * 鍒犻櫎鑰冩牳鍙戝竷淇℃伅
- *
- * @param id 鑰冩牳鍙戝竷涓婚敭
- * @return 缁撴灉
- */
- @Override
- public int deleteCheckPublishById(Long id)
- {
- return checkPublishMapper.deleteCheckPublishById(id);
- }
-}
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 9a2b177..a0220fc 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,21 +1,26 @@
package com.ycl.platform.service.impl;
import com.ycl.platform.domain.entity.CheckRule;
-import com.ycl.platform.domain.query.CheckRuleQuery;
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
@@ -25,12 +30,11 @@
/**
* 鏌ヨ鑰冩牳瑙勫垯
- *
* @param id 鑰冩牳瑙勫垯涓婚敭
* @return 鑰冩牳瑙勫垯
*/
@Override
- public CheckRuleVO selectCheckRuleById(Long id)
+ public CheckRule selectCheckRuleById(Long id)
{
return checkRuleMapper.selectCheckRuleById(id);
}
@@ -38,13 +42,19 @@
/**
* 鏌ヨ鑰冩牳瑙勫垯鍒楄〃
*
- * @param checkRuleQuery 鑰冩牳瑙勫垯
+ * @param checkRule 鑰冩牳瑙勫垯
* @return 鑰冩牳瑙勫垯
*/
@Override
- public List<CheckRuleVO> selectCheckRuleList(CheckRuleQuery checkRuleQuery)
+ public CheckRuleVO selectCheckRuleList(CheckRule checkRule)
{
- return checkRuleMapper.selectCheckRuleList(checkRuleQuery);
+ 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;
}
/**
@@ -56,20 +66,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);
}
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateRuleServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateRuleServiceImpl.java
index a04f93b..5fe1377 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateRuleServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateRuleServiceImpl.java
@@ -1,5 +1,6 @@
package com.ycl.platform.service.impl;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.platform.domain.entity.CheckTemplateRule;
import com.ycl.platform.mapper.CheckTemplateRuleMapper;
import com.ycl.platform.service.ICheckTemplateRuleService;
@@ -15,7 +16,7 @@
* @date 2024-04-01
*/
@Service
-public class CheckTemplateRuleServiceImpl implements ICheckTemplateRuleService
+public class CheckTemplateRuleServiceImpl extends ServiceImpl<CheckTemplateRuleMapper,CheckTemplateRule> implements ICheckTemplateRuleService
{
@Autowired
private CheckTemplateRuleMapper checkTemplateRuleMapper;
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java
index e05625e..c7158ab 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java
@@ -1,25 +1,32 @@
package com.ycl.platform.service.impl;
+import com.alibaba.fastjson2.JSONArray;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.platform.base.BaseSelect;
import com.ycl.platform.domain.entity.CheckTemplate;
+import com.ycl.platform.domain.entity.CheckTemplateRule;
import com.ycl.platform.domain.query.CheckTemplateQuery;
import com.ycl.platform.mapper.CheckTemplateMapper;
+import com.ycl.platform.mapper.CheckTemplateRuleMapper;
+import com.ycl.platform.service.ICheckTemplateRuleService;
import com.ycl.platform.service.ICheckTemplateService;
import com.ycl.system.Result;
import com.ycl.system.entity.SysDept;
import com.ycl.system.service.ISysDeptService;
-import io.jsonwebtoken.lang.Collections;
+import com.ycl.utils.SecurityUtils;
+import constant.CheckConstants;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
import utils.DateUtils;
import utils.StringUtils;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
+import java.math.BigDecimal;
+import java.util.*;
import java.util.stream.Collectors;
/**
@@ -29,12 +36,13 @@
* @date 2024-04-01
*/
@Service
-public class CheckTemplateServiceImpl implements ICheckTemplateService {
+public class CheckTemplateServiceImpl extends ServiceImpl<CheckTemplateMapper,CheckTemplate> implements ICheckTemplateService {
@Autowired
private CheckTemplateMapper checkTemplateMapper;
@Autowired
- private ISysDeptService deptService;
-
+ private ICheckTemplateRuleService templateRuleServicee;
+ @Autowired
+ private CheckTemplateRuleMapper checkTemplateRuleMapper;
/**
* 鏌ヨ鑰冩牳妯℃澘
*
@@ -42,16 +50,26 @@
* @return 鑰冩牳妯℃澘
*/
@Override
- public CheckTemplateQuery selectCheckTemplateById(Long id) {
+ public CheckTemplateQuery selectCheckTemplateById(Integer id) {
CheckTemplate checkTemplate = checkTemplateMapper.selectCheckTemplateById(id);
CheckTemplateQuery checkTemplateQuery = new CheckTemplateQuery();
- BeanUtils.copyProperties(checkTemplate,checkTemplateQuery);
- String deptId = checkTemplate.getDeptId();
- String deptIdStr = deptId.substring(1, deptId.length() - 1);
- List<Integer> deptIds = Arrays.stream(deptIdStr.split(","))
- .mapToInt(Integer::parseInt)
- .boxed().collect(Collectors.toList());
- checkTemplateQuery.setDeptId(deptIds);
+ BeanUtils.copyProperties(checkTemplate, checkTemplateQuery);
+ List<Integer> deptIds = JSONArray.parseArray(checkTemplate.getDeptId(), Integer.class);
+ checkTemplateQuery.setDeptId(deptIds)
+ .setAlarmScore(checkTemplate.getAlarmScore()+"");
+ //鏌ヨ瑙勫垯鏉冮噸
+ List<CheckTemplateRule> templateRuleList = checkTemplateRuleMapper.selectListByTemplateId(checkTemplate.getId());
+ List<Map<String,Object>> list = new ArrayList<>();
+ for (CheckTemplateRule checkTemplateRule : templateRuleList) {
+ Map<String,Object> map = new HashMap<>();
+ map.put("ruleId",checkTemplateRule.getCheckRuleId());
+ map.put("weight",checkTemplateRule.getWeight());
+ list.add(map);
+ }
+ checkTemplateQuery.setRuleFormList(list);
+ //TODO:鏌ヨtemplate_rule琛ㄤ腑鐨勬潈閲嶄俊鎭��
+
+
return checkTemplateQuery;
}
@@ -62,27 +80,19 @@
* @return 鑰冩牳妯℃澘
*/
@Override
- public List<CheckTemplate> selectCheckTemplateList(CheckTemplateQuery checkTemplateDTO) {
+ public List<CheckTemplateQuery> selectCheckTemplateList(CheckTemplateQuery checkTemplateDTO) {
List<CheckTemplate> checkTemplates = checkTemplateMapper.selectCheckTemplateList(checkTemplateDTO);
- //閮ㄩ棬鍖哄煙涓嬫媺鍒楄〃
- Result all = deptService.pullList();
- List<BaseSelect> data = (List<BaseSelect>) all.get("data");
- //缈昏瘧閮ㄩ棬id
+ List<CheckTemplateQuery> checkTemplateList = new ArrayList<>();
+ //杞崲閮ㄩ棬id涓洪泦鍚�,杞崲alarmScore涓簊tring
for (CheckTemplate template : checkTemplates) {
- if(template.getDeptId() == null)continue;
- String[] deptIds = template.getDeptId().replace("[", "").replace("]", "").split(",");
- List<String> deptName = new ArrayList<>();
- for (String deptId : deptIds) {
- List<String> deptStr = data.stream()
- .filter(baseSelect -> baseSelect.getId().equals(Integer.parseInt(deptId)))
- .map(BaseSelect::getValue)
- .collect(Collectors.toList());
- deptName.addAll(deptStr);
- }
- template.setDeptId(StringUtils.join(deptName,","));
+ List<Integer> deptIds = JSONArray.parseArray(template.getDeptId(), Integer.class);
+ CheckTemplateQuery checkTemplateQuery = new CheckTemplateQuery();
+ BeanUtils.copyProperties(template, checkTemplateQuery);
+ checkTemplateQuery.setDeptId(deptIds);
+ checkTemplateList.add(checkTemplateQuery);
}
- return checkTemplates;
+ return checkTemplateList;
}
/**
@@ -92,12 +102,55 @@
* @return 缁撴灉
*/
@Override
+ @Transactional(rollbackFor = Exception.class)
public int insertCheckTemplate(CheckTemplateQuery checkTemplateDTO) {
- checkTemplateDTO.setCreateTime(DateUtils.getNowDate());
+ //TODO:鏂板瀹氭椂浠诲姟锛岀姸鎬佸悓妯℃澘,鐒跺悗璧嬪�糺obId缁檛emplate
+
+
+ String username = SecurityUtils.getUsername();
+ /** 鎻掑叆t_template */
CheckTemplate checkTemplate = new CheckTemplate();
- BeanUtils.copyProperties(checkTemplateDTO,checkTemplate);
- checkTemplate.setDeptId(checkTemplateDTO.getDeptId().toString().replaceAll(" ",""));
- return checkTemplateMapper.insertCheckTemplate(checkTemplate);
+ BeanUtils.copyProperties(checkTemplateDTO, checkTemplate);
+ //浠庡皬鍒板ぇ鎺掑簭
+ List<Integer> deptId = checkTemplateDTO.getDeptId();
+ Collections.sort(deptId);
+ Date nowDate = DateUtils.getNowDate();
+ checkTemplate.setDeptId(JSONArray.toJSONString(deptId))
+ .setUpdateUserName(username)
+ .setCreateUserName(username)
+ //涓嶅~鎶ヨ鍒嗘暟---->闆跺垎---->涓嶆姤璀�
+ .setAlarmScore(new BigDecimal(checkTemplateDTO.getAlarmScore() == null? "":checkTemplateDTO.getAlarmScore()));
+ int i = checkTemplateMapper.insertCheckTemplate(checkTemplate);
+ /** t_template_rule鏂板鏉冮噸 */
+ insertTemlpateRule(checkTemplateDTO, checkTemplate);
+
+ return i;
+ }
+ /**
+ * 澶嶅埗鑰冩牳妯℃澘
+ *
+ * @param checkTemplate 鑰冩牳妯℃澘
+ * @return 缁撴灉
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public int copyCheckTemplate(CheckTemplateQuery checkTemplateDTO) {
+ //TODO:鏂板瀹氭椂浠诲姟锛岀姸鎬佸悓妯℃澘,鐒跺悗璧嬪�糺obId缁檛emplate
+
+ //鎻掑叆妯℃澘琛�
+ CheckTemplate checkTemplate = checkTemplateMapper.selectCheckTemplateById(checkTemplateDTO.getId());
+ String username = SecurityUtils.getUsername();
+ checkTemplate.setUpdateUserName(username)
+ .setCreateUserName(username)
+ .setStatus(CheckConstants.Status_Stop)
+ .setId(null);
+ int i = checkTemplateMapper.insertCheckTemplate(checkTemplate);
+ //鎻掑叆template_rule琛�
+ List<CheckTemplateRule> templateRuleList = checkTemplateRuleMapper.selectListByTemplateId(checkTemplateDTO.getId());
+ templateRuleList.forEach(checkTemplateRule -> checkTemplateRule.setCheckTemplateId(checkTemplate.getId()).setId(null));
+ templateRuleServicee.saveBatch(templateRuleList);
+
+ return i;
}
/**
@@ -107,9 +160,24 @@
* @return 缁撴灉
*/
@Override
- public int updateCheckTemplate(CheckTemplate checkTemplate) {
- checkTemplate.setUpdateTime(DateUtils.getNowDate());
- return checkTemplateMapper.updateCheckTemplate(checkTemplate);
+ @Transactional(rollbackFor = Exception.class)
+ public int updateCheckTemplate(CheckTemplateQuery checkTemplateDTO) {
+ CheckTemplate checkTemplate = new CheckTemplate();
+ BeanUtils.copyProperties(checkTemplateDTO, checkTemplate);
+ checkTemplate.setUpdateUserName(SecurityUtils.getUsername());
+ List<Integer> deptId = checkTemplateDTO.getDeptId();
+ Collections.sort(deptId);
+ checkTemplate.setDeptId(JSONArray.toJSONString(deptId));
+ int i = checkTemplateMapper.updateCheckTemplate(checkTemplate);
+ /** t_template_rule淇敼鏉冮噸 */
+ //鍏堝垹闄ゅ師鏁版嵁
+ checkTemplateRuleMapper.deleteByTemplateId(checkTemplate.getId());
+ //鎻掑叆鏂拌鍒欐暟鎹�
+ insertTemlpateRule(checkTemplateDTO, checkTemplate);
+
+ //TODO:鍒ゆ柇鐘舵�佹槸鍚︿慨鏀癸紝璋冩暣job琛ㄩ噷鐨勭姸鎬�
+
+ return i;
}
/**
@@ -119,7 +187,7 @@
* @return 缁撴灉
*/
@Override
- public int deleteCheckTemplateByIds(Long[] ids) {
+ public int deleteCheckTemplateByIds(Integer[] ids) {
return checkTemplateMapper.deleteCheckTemplateByIds(ids);
}
@@ -130,8 +198,12 @@
* @return 缁撴灉
*/
@Override
- public int deleteCheckTemplateById(Long id) {
- return checkTemplateMapper.deleteCheckTemplateById(id);
+ public int deleteCheckTemplateById(Integer id) {
+ //TODO:鍒犻櫎瀹氭椂浠诲姟
+
+
+ return checkTemplateMapper.updateCheckTemplate(new CheckTemplate().setId(id)
+ .setDeleted(CheckConstants.Delete));
}
@Override
@@ -140,4 +212,21 @@
return Result.ok().data(checkTemplates);
}
+
+
+
+ private void insertTemlpateRule(CheckTemplateQuery checkTemplateDTO, CheckTemplate checkTemplate) {
+ List<Map<String, Object>> ruleFormList = checkTemplateDTO.getRuleFormList();
+ if (!CollectionUtils.isEmpty(ruleFormList)) {
+ List<CheckTemplateRule> templateRuleList = new ArrayList<>();
+ for (Map<String, Object> map : ruleFormList) {
+ templateRuleList.add(new CheckTemplateRule()
+ .setCheckRuleId((Integer) map.get("ruleId"))
+ .setCheckTemplateId(checkTemplate.getId())
+ .setWeight(new BigDecimal(map.get("weight").toString())));
+ }
+ //鎵归噺鎻掑叆鏁版嵁搴�
+ templateRuleServicee.saveBatch(templateRuleList);
+ }
+ }
}
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckPublishMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckPublishMapper.xml
deleted file mode 100644
index 63da8ea..0000000
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckPublishMapper.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.platform.mapper.CheckPublishMapper">
-
- <resultMap type="com.ycl.platform.domain.entity.CheckPublish" id="CheckPublishResult">
- <result property="id" column="id" />
- <result property="examineName" column="examine_name" />
- <result property="templateId" column="template_id" />
- <result property="frequency" column="frequency" />
- <result property="examineCategory" column="examine_category" />
- <result property="alarmScore" column="alarm_score" />
- <result property="description" column="description" />
- <result property="state" column="state" />
- <result property="auditState" column="audit_state" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="createUser" column="create_user" />
- <result property="updateUser" column="update_user" />
- </resultMap>
-
- <sql id="selectCheckPublishVo">
- select id, examine_name, template_id, frequency, examine_category, alarm_score, description, state, audit_state, create_time, update_time, create_user, update_user from t_check_publish
- </sql>
-
- <select id="selectCheckPublishList" resultMap="CheckPublishResult">
- <include refid="selectCheckPublishVo"/>
- <where>
- <if test="examineName != null and examineName != ''"> and examine_name like concat('%', #{examineName}, '%')</if>
- <if test="templateId != null "> and template_id = #{templateId}</if>
- <if test="frequency != null "> and frequency = #{frequency}</if>
- <if test="examineCategory != null "> and examine_category = #{examineCategory}</if>
- <if test="alarmScore != null "> and alarm_score = #{alarmScore}</if>
- <if test="description != null and description != ''"> and description = #{description}</if>
- <if test="state != null "> and state = #{state}</if>
- <if test="auditState != null "> and audit_state = #{auditState}</if>
- </where>
- </select>
-
- <select id="selectCheckPublishById" resultMap="CheckPublishResult">
- <include refid="selectCheckPublishVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertCheckPublish" useGeneratedKeys="true" keyProperty="id">
- insert into t_check_publish
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="examineName != null">examine_name,</if>
- <if test="templateId != null">template_id,</if>
- <if test="frequency != null">frequency,</if>
- <if test="examineCategory != null">examine_category,</if>
- <if test="alarmScore != null">alarm_score,</if>
- <if test="description != null">description,</if>
- <if test="state != null">state,</if>
- <if test="auditState != null">audit_state,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="createUser != null">create_user,</if>
- <if test="updateUser != null">update_user,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="examineName != null">#{examineName},</if>
- <if test="templateId != null">#{templateId},</if>
- <if test="frequency != null">#{frequency},</if>
- <if test="examineCategory != null">#{examineCategory},</if>
- <if test="alarmScore != null">#{alarmScore},</if>
- <if test="description != null">#{description},</if>
- <if test="state != null">#{state},</if>
- <if test="auditState != null">#{auditState},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="createUser != null">#{createUser},</if>
- <if test="updateUser != null">#{updateUser},</if>
- </trim>
- </insert>
-
- <update id="updateCheckPublish">
- update t_check_publish
- <trim prefix="SET" suffixOverrides=",">
- <if test="examineName != null">examine_name = #{examineName},</if>
- <if test="templateId != null">template_id = #{templateId},</if>
- <if test="frequency != null">frequency = #{frequency},</if>
- <if test="examineCategory != null">examine_category = #{examineCategory},</if>
- <if test="alarmScore != null">alarm_score = #{alarmScore},</if>
- <if test="description != null">description = #{description},</if>
- <if test="state != null">state = #{state},</if>
- <if test="auditState != null">audit_state = #{auditState},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="createUser != null">create_user = #{createUser},</if>
- <if test="updateUser != null">update_user = #{updateUser},</if>
- </trim>
- where id = #{id}
- </update>
-
- <delete id="deleteCheckPublishById" >
- delete from t_check_publish where id = #{id}
- </delete>
-
- <delete id="deleteCheckPublishByIds">
- delete from t_check_publish where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
-</mapper>
\ No newline at end of file
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckResultMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckResultMapper.xml
deleted file mode 100644
index 752da17..0000000
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckResultMapper.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.platform.mapper.CheckResultMapper">
-
- <resultMap type="com.ycl.platform.domain.entity.CheckResult" id="CheckResultResult">
- <result property="id" column="id" />
- <result property="deptId" column="dept_id" />
- <result property="publishId" column="publish_id" />
- <result property="examineCategory" column="examine_category" />
- <result property="checkScore" column="check_score" />
- <result property="publish" column="publish" />
- <result property="checkTime" column="check_time" />
- <result property="updateTime" column="update_time" />
- <result property="deleted" column="deleted" />
- </resultMap>
-
- <sql id="selectCheckResultVo">
- select id, dept_id, publish_id, examine_category, check_score, publish, check_time, update_time, deleted from t_check_result
- </sql>
-
- <select id="selectCheckResultList" resultMap="CheckResultResult">
- <include refid="selectCheckResultVo"/>
- <where>
- <if test="deptId != null "> and dept_id = #{deptId}</if>
- <if test="publishId != null "> and publish_id = #{publishId}</if>
- <if test="examineCategory != null "> and examine_category = #{examineCategory}</if>
- <if test="publish != null "> and publish = #{publish}</if>
- <if test="checkTime != null "> and check_time = #{checkTime}</if>
- </where>
- </select>
-
- <select id="selectCheckResultById" resultMap="CheckResultResult">
- <include refid="selectCheckResultVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertCheckResult" useGeneratedKeys="true" keyProperty="id">
- insert into t_check_result
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="deptId != null">dept_id,</if>
- <if test="publishId != null">publish_id,</if>
- <if test="examineCategory != null">examine_category,</if>
- <if test="checkScore != null">check_score,</if>
- <if test="publish != null">publish,</if>
- <if test="checkTime != null">check_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="deleted != null">deleted,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="deptId != null">#{deptId},</if>
- <if test="publishId != null">#{publishId},</if>
- <if test="examineCategory != null">#{examineCategory},</if>
- <if test="checkScore != null">#{checkScore},</if>
- <if test="publish != null">#{publish},</if>
- <if test="checkTime != null">#{checkTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="deleted != null">#{deleted},</if>
- </trim>
- </insert>
-
- <update id="updateCheckResult" >
- update t_check_result
- <trim prefix="SET" suffixOverrides=",">
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="publishId != null">publish_id = #{publishId},</if>
- <if test="examineCategory != null">examine_category = #{examineCategory},</if>
- <if test="checkScore != null">check_score = #{checkScore},</if>
- <if test="publish != null">publish = #{publish},</if>
- <if test="checkTime != null">check_time = #{checkTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="deleted != null">deleted = #{deleted},</if>
- </trim>
- where id = #{id}
- </update>
-
- <delete id="deleteCheckResultById" >
- delete from t_check_result where id = #{id}
- </delete>
-
- <delete id="deleteCheckResultByIds" >
- delete from t_check_result where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
-</mapper>
\ No newline at end of file
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckRuleMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckRuleMapper.xml
index a940b37..999ac2d 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckRuleMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckRuleMapper.xml
@@ -9,61 +9,59 @@
<result property="ruleName" column="rule_name" />
<result property="ruleIndex" column="rule_index" />
<result property="ruleCategory" column="rule_category" />
- <result property="examineCategory" column="examine_category" />
+ <result property="ruleCondition" column="rule_condition" />
<result property="ruleDescription" column="rule_description" />
- <result property="state" column="state" />
- <result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
+ <result property="state" column="state" />
<result property="deleted" column="deleted" />
</resultMap>
<sql id="selectCheckRuleVo">
- select id, rule_name, rule_index, rule_category, examine_category, rule_description, state, create_time, update_time, deleted from t_check_rule
+ select id, rule_name, rule_index, rule_category, rule_condition, rule_description, rule_object,
+ update_time, state, deleted
+ from t_check_rule
</sql>
- <select id="selectCheckRuleList" resultType="com.ycl.platform.domain.vo.CheckRuleVO">
- select tcr.id, tcr.rule_name, tcr.rule_index, tcr.rule_category, tcr.examine_category, tcr.rule_description,
- tctr.weight, tctr.audit_state,tctr.check_template_id as templateId,tct.template_name
- from t_check_template_rule tctr inner join t_check_rule tcr on tcr.id = tctr.check_rule_id
- inner join t_check_template tct on tctr.check_template_id = tct.id
- <where>
- state = 0
- <if test="ruleName != null and ruleName != ''"> and tcr.rule_name like concat(#{ruleName}, '%')</if>
- <if test="ruleCategory != null "> and tcr.rule_category = #{ruleCategory}</if>
- <if test="examineCategory != null "> and tcr.examine_category = #{examineCategory}</if>
- <if test="auditState != null "> and tctr.audit_state = #{auditState}</if>
- <if test="templateId != null "> and tctr.check_template_id = #{templateId}</if>
+ <select id="selectCheckRuleList" resultMap="CheckRuleResult">
+ select cr.id, cr.rule_name, cr.rule_index, cr.rule_category, cr.rule_condition, cr.rule_description,
+ cr.update_time, cr.state, cr.deleted
+ from t_check_rule cr
+ <where>
+ <if test="ruleName != null and ruleName != ''"> and rule_name like concat('%', #{ruleName}, '%')</if>
+ <if test="ruleIndex != null and ruleIndex != ''"> and rule_index = #{ruleIndex}</if>
+ <if test="ruleCategory != null "> and rule_category = #{ruleCategory}</if>
+ <if test="ruleCondition != null and ruleCondition != ''"> and rule_condition = #{ruleCondition}</if>
+ <if test="ruleDescription != null and ruleDescription != ''"> and rule_description = #{ruleDescription}</if>
+ <if test="state != null "> and state = #{state}</if>
+ <if test="deleted != null and deleted != ''"> and deleted = #{deleted}</if>
</where>
</select>
- <select id="selectCheckRuleById" resultType="com.ycl.platform.domain.vo.CheckRuleVO">
- select tcr.id, tcr.rule_name, tcr.rule_index, tcr.rule_category, tcr.examine_category, tcr.rule_description, tctr.weight, tctr.audit_state,tctr.check_template_id as templateId
- from t_check_rule tcr inner join t_check_template_rule tctr on tcr.id = tctr.check_rule_id
- where tcr.id = #{id} and tcr.state = 0
+ <select id="selectCheckRuleById" resultMap="CheckRuleResult">
+ <include refid="selectCheckRuleVo"/>
+ where id = #{id}
</select>
<insert id="insertCheckRule" useGeneratedKeys="true" keyProperty="id">
insert into t_check_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ruleName != null and ruleName != ''">rule_name,</if>
- <if test="ruleDetail != null">rule_detail,</if>
+ <if test="ruleIndex != null">rule_index,</if>
<if test="ruleCategory != null">rule_category,</if>
- <if test="examineCategory != null">examine_category,</if>
+ <if test="ruleCondition != null">rule_condition,</if>
<if test="ruleDescription != null">rule_description,</if>
- <if test="state != null">state,</if>
- <if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
+ <if test="state != null">state,</if>
<if test="deleted != null">deleted,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ruleName != null and ruleName != ''">#{ruleName},</if>
<if test="ruleIndex != null">#{ruleIndex},</if>
<if test="ruleCategory != null">#{ruleCategory},</if>
- <if test="examineCategory != null">#{examineCategory},</if>
+ <if test="ruleCondition != null">#{ruleCondition},</if>
<if test="ruleDescription != null">#{ruleDescription},</if>
- <if test="state != null">#{state},</if>
- <if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
+ <if test="state != null">#{state},</if>
<if test="deleted != null">#{deleted},</if>
</trim>
</insert>
@@ -74,11 +72,10 @@
<if test="ruleName != null and ruleName != ''">rule_name = #{ruleName},</if>
<if test="ruleIndex != null">rule_index = #{ruleIndex},</if>
<if test="ruleCategory != null">rule_category = #{ruleCategory},</if>
- <if test="examineCategory != null">examine_category = #{examineCategory},</if>
+ <if test="ruleCondition != null">rule_condition = #{ruleCondition},</if>
<if test="ruleDescription != null">rule_description = #{ruleDescription},</if>
- <if test="state != null">state = #{state},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
+ <if test="state != null">state = #{state},</if>
<if test="deleted != null">deleted = #{deleted},</if>
</trim>
where id = #{id}
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateMapper.xml
index d7db920..0ee96f4 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateMapper.xml
@@ -10,8 +10,13 @@
<result property="adjustCoefficient" column="adjust_coefficient" />
<result property="adjustWay" column="adjust_way" />
<result property="examineCategory" column="examine_category" />
+ <result property="examineTag" column="examine_tag" />
+ <result property="jobId" column="job_id" />
<result property="status" column="status" />
<result property="deptId" column="dept_id" />
+ <result property="frequency" column="frequency" />
+ <result property="alarmScore" column="alarm_score" />
+ <result property="description" column="description" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createUser" column="create_user" />
@@ -22,16 +27,20 @@
</resultMap>
<sql id="selectCheckTemplateVo">
- select id, template_name, adjust_coefficient, adjust_way, examine_category, status, dept_id, create_time, update_time, create_user, create_user_name, update_user, update_user_name, deleted from t_check_template
+ select id, template_name, adjust_coefficient, adjust_way, examine_category,examine_tag, status, dept_id, create_time, update_time, create_user, create_user_name, update_user, update_user_name,
+ description,frequency,alarm_score,job_id,deleted from t_check_template
</sql>
<select id="selectCheckTemplateList" resultMap="CheckTemplateResult">
<include refid="selectCheckTemplateVo"/>
- <where>
+ <where>
+ deleted =0
<if test="templateName != null and templateName != ''"> and template_name like concat('%', #{templateName}, '%')</if>
<if test="examineCategory != null "> and examine_category = #{examineCategory}</if>
+ <if test="examineTag != null "> and examine_tag = #{examineTag}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
+ order by examine_tag DESC, examine_category , create_time
</select>
<select id="selectCheckTemplateById" resultMap="CheckTemplateResult">
@@ -46,8 +55,13 @@
<if test="adjustCoefficient != null">adjust_coefficient,</if>
<if test="adjustWay != null and adjustWay != ''">adjust_way,</if>
<if test="examineCategory != null">examine_category,</if>
+ <if test="examineTag != null">examine_tag,</if>
<if test="status != null">status,</if>
<if test="deptId != null">dept_id,</if>
+ <if test="frequency != null">frequency,</if>
+ <if test="alarmScore != null">alarm_score,</if>
+ <if test="description != null">description,</if>
+ <if test="jobId != null">job_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createUser != null">create_user,</if>
@@ -61,8 +75,13 @@
<if test="adjustCoefficient != null">#{adjustCoefficient},</if>
<if test="adjustWay != null and adjustWay != ''">#{adjustWay},</if>
<if test="examineCategory != null">#{examineCategory},</if>
+ <if test="examineTag != null">#{examineTag},</if>
<if test="status != null">#{status},</if>
<if test="deptId != null">#{deptId},</if>
+ <if test="frequency != null">#{frequency},</if>
+ <if test="alarmScore != null">#{alarmScore},</if>
+ <if test="description != null">#{description},</if>
+ <if test="jobId != null">#{jobId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createUser != null">#{createUser},</if>
@@ -80,8 +99,13 @@
<if test="adjustCoefficient != null">adjust_coefficient = #{adjustCoefficient},</if>
<if test="adjustWay != null and adjustWay != ''">adjust_way = #{adjustWay},</if>
<if test="examineCategory != null">examine_category = #{examineCategory},</if>
+ <if test="examineTag != null">examine_tag = #{examineTag},</if>
<if test="status != null">status = #{status},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
+ <if test="jobId != null">job_id = #{jobId},</if>
+ <if test="frequency != null">frequency = #{frequency},</if>
+ <if test="alarmScore != null">alarm_score = #{alarmScore},</if>
+ <if test="description != null">description = #{description},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createUser != null">create_user = #{createUser},</if>
@@ -98,9 +122,11 @@
</delete>
<delete id="deleteCheckTemplateByIds" parameterType="String">
- delete from t_check_template where id in
+ delete from t_check_template where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
+
+
</mapper>
\ No newline at end of file
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml
index 0f94c61..0a25529 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml
@@ -5,16 +5,14 @@
<mapper namespace="com.ycl.platform.mapper.CheckTemplateRuleMapper">
<resultMap type="com.ycl.platform.domain.entity.CheckTemplateRule" id="CheckTemplateRuleResult">
- <result property="id" column="id" />
+ <result property="id" column="id" />
<result property="checkTemplateId" column="check_template_id" />
<result property="checkRuleId" column="check_rule_id" />
<result property="weight" column="weight" />
- <result property="maxScore" column="max_score" />
- <result property="auditState" column="audit_state" />
</resultMap>
<sql id="selectCheckTemplateRuleVo">
- select id, check_template_id, check_rule_id, weight, max_score, audit_state from t_check_template_rule
+ select id, check_template_id, check_rule_id, weight from t_check_template_rule
</sql>
<select id="selectCheckTemplateRuleList" resultMap="CheckTemplateRuleResult">
@@ -22,7 +20,6 @@
<where>
<if test="checkTemplateId != null "> and check_template_id = #{checkTemplateId}</if>
<if test="checkRuleId != null "> and check_rule_id = #{checkRuleId}</if>
- <if test="auditState != null "> and audit_state = #{auditState}</if>
</where>
</select>
@@ -37,15 +34,11 @@
<if test="checkTemplateId != null">check_template_id,</if>
<if test="checkRuleId != null">check_rule_id,</if>
<if test="weight != null">weight,</if>
- <if test="maxScore != null">max_score,</if>
- <if test="auditState != null">audit_state,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkTemplateId != null">#{checkTemplateId},</if>
<if test="checkRuleId != null">#{checkRuleId},</if>
<if test="weight != null">#{weight},</if>
- <if test="maxScore != null">#{maxScore},</if>
- <if test="auditState != null">#{auditState},</if>
</trim>
</insert>
@@ -55,8 +48,6 @@
<if test="checkTemplateId != null">check_template_id = #{checkTemplateId},</if>
<if test="checkRuleId != null">check_rule_id = #{checkRuleId},</if>
<if test="weight != null">weight = #{weight},</if>
- <if test="maxScore != null">max_score = #{maxScore},</if>
- <if test="auditState != null">audit_state = #{auditState},</if>
</trim>
where id = #{id}
</update>
@@ -71,4 +62,11 @@
#{id}
</foreach>
</delete>
+
+ <delete id="deleteByTemplateId">
+ delete from t_check_template_rule where check_template_id = #{templateId}
+ </delete>
+ <select id="selectListByTemplateId" resultType="com.ycl.platform.domain.entity.CheckTemplateRule">
+ select * from t_check_template_rule where check_template_id = #{checkTemplateId}
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0