New file |
| | |
| | | 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(); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | 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"; |
| | | |
| | | } |
| | |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | * @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 = "模æ¿åç§°") |
| | |
| | | /** è°æ´æ¹å¼ï¼ä¹é¤ */ |
| | | @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 = "å¯ç¨/åç¨") |
| | |
| | | @Excel(name = "åºå¿") |
| | | private String deptId; |
| | | |
| | | /** å建人id */ |
| | | /** æ¥è¦åæ° */ |
| | | @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(); |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | * @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(); |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | | /** å建人id */ |
| | | private Long createUser; |
| | | |
| | | /** å建人å§å */ |
| | | @Excel(name = "å建人å§å") |
| | | private String createUserName; |
| | | |
| | | /** */ |
| | | private Long updateUser; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String updateUserName; |
| | | |
| | | /** é»è¾å é¤ */ |
| | |
| | | @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; |
| | | } |
| | |
| | | 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; |
| | | } |
New file |
| | |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | /** |
| | | * æ¼ç¤ºæ¨¡å¼å¼å¸¸ |
| | | */ |
| | |
| | | |
| | | 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") |
| | |
| | | /** |
| | | * æ¥è¯¢èæ ¸è§åå表 |
| | | */ |
| | | // @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) |
| | |
| | | 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)); |
| | | // } |
| | | } |
| | |
| | | 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; |
| | |
| | | /** |
| | | * æ¥è¯¢èæ ¸æ¨¡æ¿å表 |
| | | */ |
| | | // @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") |
| | |
| | | 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, "èæ ¸æ¨¡æ¿æ°æ®"); |
| | | // } |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | * èæ ¸è§åMapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | * @date 2024-04-15 |
| | | */ |
| | | public interface CheckRuleMapper |
| | | { |
| | |
| | | * @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); |
| | | |
| | | /** |
| | | * æ°å¢èæ ¸è§å |
| | |
| | | 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; |
| | | |
| | |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | */ |
| | | public interface CheckTemplateMapper |
| | | public interface CheckTemplateMapper extends BaseMapper<CheckTemplate> |
| | | { |
| | | /** |
| | | * æ¥è¯¢èæ ¸æ¨¡æ¿ |
| | |
| | | * @param id èæ ¸æ¨¡æ¿ä¸»é® |
| | | * @return èæ ¸æ¨¡æ¿ |
| | | */ |
| | | public CheckTemplate selectCheckTemplateById(Long id); |
| | | public CheckTemplate selectCheckTemplateById(Integer id); |
| | | |
| | | /** |
| | | * æ¥è¯¢èæ ¸æ¨¡æ¿å表 |
| | |
| | | * @param checkTemplate èæ ¸æ¨¡æ¿ |
| | | * @return ç»æ |
| | | */ |
| | | @AutoFill(OperationType.INSERT) |
| | | public int insertCheckTemplate(CheckTemplate checkTemplate); |
| | | |
| | | /** |
| | |
| | | * @param checkTemplate èæ ¸æ¨¡æ¿ |
| | | * @return ç»æ |
| | | */ |
| | | @AutoFill(OperationType.UPDATE) |
| | | public int updateCheckTemplate(CheckTemplate checkTemplate); |
| | | |
| | | /** |
| | |
| | | * @param id èæ ¸æ¨¡æ¿ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteCheckTemplateById(Long id); |
| | | public int deleteCheckTemplateById(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤èæ ¸æ¨¡æ¿ |
| | |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteCheckTemplateByIds(Long[] ids); |
| | | public int deleteCheckTemplateByIds(Integer[] ids); |
| | | } |
| | |
| | | package com.ycl.platform.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ycl.platform.domain.entity.CheckTemplateRule; |
| | | |
| | | import java.util.List; |
| | |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | */ |
| | | public interface CheckTemplateRuleMapper |
| | | public interface CheckTemplateRuleMapper extends BaseMapper<CheckTemplateRule> |
| | | { |
| | | /** |
| | | * æ¥è¯¢èæ ¸æ¨¡æ¿-è§åä¸é´ |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteCheckTemplateRuleByIds(Long[] ids); |
| | | |
| | | List<CheckTemplateRule> selectListByTemplateId(Integer id); |
| | | |
| | | void deleteByTemplateId(Integer templateId); |
| | | } |
| | |
| | | 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; |
| | |
| | | * èæ ¸è§åServiceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | * @date 2024-04-15 |
| | | */ |
| | | public interface ICheckRuleService |
| | | { |
| | |
| | | * @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); |
| | | |
| | | /** |
| | | * æ°å¢èæ ¸è§å |
| | |
| | | package com.ycl.platform.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ycl.platform.domain.entity.CheckTemplateRule; |
| | | |
| | | import java.util.List; |
| | |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | */ |
| | | public interface ICheckTemplateRuleService |
| | | public interface ICheckTemplateRuleService extends IService<CheckTemplateRule> |
| | | { |
| | | /** |
| | | * æ¥è¯¢èæ ¸æ¨¡æ¿-è§åä¸é´ |
| | |
| | | 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; |
| | |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | */ |
| | | public interface ICheckTemplateService |
| | | public interface ICheckTemplateService extends IService<CheckTemplate> |
| | | { |
| | | /** |
| | | * æ¥è¯¢èæ ¸æ¨¡æ¿ |
| | |
| | | * @param id èæ ¸æ¨¡æ¿ä¸»é® |
| | | * @return èæ ¸æ¨¡æ¿ |
| | | */ |
| | | public CheckTemplateQuery selectCheckTemplateById(Long id); |
| | | public CheckTemplateQuery selectCheckTemplateById(Integer id); |
| | | |
| | | /** |
| | | * æ¥è¯¢èæ ¸æ¨¡æ¿å表 |
| | |
| | | * @param checkTemplateDTO èæ ¸æ¨¡æ¿ |
| | | * @return èæ ¸æ¨¡æ¿éå |
| | | */ |
| | | public List<CheckTemplate> selectCheckTemplateList(CheckTemplateQuery checkTemplateDTO); |
| | | public List<CheckTemplateQuery> selectCheckTemplateList(CheckTemplateQuery checkTemplateDTO); |
| | | |
| | | /** |
| | | * æ°å¢èæ ¸æ¨¡æ¿ |
| | |
| | | /** |
| | | * ä¿®æ¹èæ ¸æ¨¡æ¿ |
| | | * |
| | | * @param checkTemplate èæ ¸æ¨¡æ¿ |
| | | * @param checkTemplateDTO èæ ¸æ¨¡æ¿ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateCheckTemplate(CheckTemplate checkTemplate); |
| | | public int updateCheckTemplate(CheckTemplateQuery checkTemplateDTO); |
| | | |
| | | /** |
| | | * æ¹éå é¤èæ ¸æ¨¡æ¿ |
| | |
| | | * @param ids éè¦å é¤çèæ ¸æ¨¡æ¿ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteCheckTemplateByIds(Long[] ids); |
| | | public int deleteCheckTemplateByIds(Integer[] ids); |
| | | |
| | | /** |
| | | * å é¤èæ ¸æ¨¡æ¿ä¿¡æ¯ |
| | |
| | | * @param id èæ ¸æ¨¡æ¿ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteCheckTemplateById(Long id); |
| | | public int deleteCheckTemplateById(Integer id); |
| | | |
| | | Result pullList(); |
| | | |
| | | int copyCheckTemplate(CheckTemplateQuery checkTemplateDTO); |
| | | } |
| | |
| | | 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 |
| | |
| | | |
| | | /** |
| | | * æ¥è¯¢èæ ¸è§å |
| | | * |
| | | * @param id èæ ¸è§åä¸»é® |
| | | * @return èæ ¸è§å |
| | | */ |
| | | @Override |
| | | public CheckRuleVO selectCheckRuleById(Long id) |
| | | public CheckRule selectCheckRuleById(Long id) |
| | | { |
| | | return checkRuleMapper.selectCheckRuleById(id); |
| | | } |
| | |
| | | /** |
| | | * æ¥è¯¢èæ ¸è§åå表 |
| | | * |
| | | * @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; |
| | | } |
| | | |
| | | /** |
| | |
| | | @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); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | * @date 2024-04-01 |
| | | */ |
| | | @Service |
| | | public class CheckTemplateRuleServiceImpl implements ICheckTemplateRuleService |
| | | public class CheckTemplateRuleServiceImpl extends ServiceImpl<CheckTemplateRuleMapper,CheckTemplateRule> implements ICheckTemplateRuleService |
| | | { |
| | | @Autowired |
| | | private CheckTemplateRuleMapper checkTemplateRuleMapper; |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | * @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; |
| | | /** |
| | | * æ¥è¯¢èæ ¸æ¨¡æ¿ |
| | | * |
| | |
| | | * @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; |
| | | } |
| | | |
| | |
| | | * @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为string |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int insertCheckTemplate(CheckTemplateQuery checkTemplateDTO) { |
| | | checkTemplateDTO.setCreateTime(DateUtils.getNowDate()); |
| | | //TODO:æ°å¢å®æ¶ä»»å¡ï¼ç¶æå模æ¿,ç¶åèµå¼jobIdç»template |
| | | |
| | | |
| | | 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:æ°å¢å®æ¶ä»»å¡ï¼ç¶æå模æ¿,ç¶åèµå¼jobIdç»template |
| | | |
| | | //æå
¥æ¨¡æ¿è¡¨ |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @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; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteCheckTemplateByIds(Long[] ids) { |
| | | public int deleteCheckTemplateByIds(Integer[] ids) { |
| | | return checkTemplateMapper.deleteCheckTemplateByIds(ids); |
| | | } |
| | | |
| | |
| | | * @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 |
| | |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | <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> |
| | |
| | | <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} |
| | |
| | | <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" /> |
| | |
| | | </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"> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | </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> |
| | |
| | | <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"> |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | #{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> |