Merge remote-tracking branch 'origin/master'
| | |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper-spring-boot-starter</artifactId> |
| | | <version>${pagehelper.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>jsqlparser</artifactId> |
| | | <groupId>com.github.jsqlparser</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | </project> |
| | | </project> |
| | |
| | | |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | |
| | | import javax.annotation.Nullable; |
| | | import java.lang.management.ManagementFactory; |
| | | import java.sql.Timestamp; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 时间工具类 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class DateUtils extends org.apache.commons.lang3.time.DateUtils |
| | |
| | | public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; |
| | | |
| | | private static String[] parsePatterns = { |
| | | "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", |
| | | "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", |
| | | "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", |
| | | "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; |
| | | |
| | | /** |
| | | * 获取当前Date型日期 |
| | | * |
| | | * |
| | | * @return Date() 当前日期 |
| | | */ |
| | | public static Date getNowDate() |
| | |
| | | |
| | | /** |
| | | * 获取当前日期, 默认格式为yyyy-MM-dd |
| | | * |
| | | * |
| | | * @return String |
| | | */ |
| | | public static String getDate() |
| | |
| | | ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); |
| | | return Date.from(zdt.toInstant()); |
| | | } |
| | | |
| | | /** |
| | | * 获取某天的开始时间 |
| | | * |
| | | * @param date |
| | | * @return 2023-01-01 00:00:00 |
| | | */ |
| | | public static Date getDayStart(@Nullable Date date) { |
| | | if (Objects.isNull(date)) { |
| | | date = new Date(); |
| | | } |
| | | LocalDateTime localDateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.of("GMT+8")); |
| | | LocalDateTime of = LocalDateTime.of(localDateTime.getYear(), localDateTime.getMonth(), localDateTime.getDayOfMonth(), 0, 0, 0); |
| | | return Timestamp.valueOf(of); |
| | | } |
| | | |
| | | /** |
| | | * 获取某天的结束时间 |
| | | * |
| | | * @param date |
| | | * @return 2023-01-01 23:59:59 |
| | | */ |
| | | public static Date getDayEnd(@Nullable Date date) { |
| | | if (Objects.isNull(date)) { |
| | | date = new Date(); |
| | | } |
| | | LocalDateTime localDateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()); |
| | | LocalDateTime of = LocalDateTime.of(localDateTime.getYear(), localDateTime.getMonth(), localDateTime.getDayOfMonth(), 23, 59, 59); |
| | | return Timestamp.valueOf(of); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ycl.platform.domain.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ycl.platform.base.AbsEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 考核规则 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("t_check_rule") |
| | | @ApiModel(value = "CheckRule对象", description = "考核规则") |
| | | public class CheckRule extends AbsEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("规则名称") |
| | | @TableField("rule_name") |
| | | private String ruleName; |
| | | |
| | | @ApiModelProperty("规则描述") |
| | | @TableField("rule_detail") |
| | | private String ruleDetail; |
| | | |
| | | @ApiModelProperty("天网视频点位数") |
| | | @TableField("video_point_num") |
| | | private Integer videoPointNum; |
| | | |
| | | @ApiModelProperty("车辆卡口点位数") |
| | | @TableField("vehicle_checkpoint_num") |
| | | private Integer vehicleCheckpointNum; |
| | | |
| | | @ApiModelProperty("人脸卡口点位数") |
| | | @TableField("face_chceckpoint_num") |
| | | private Integer faceChceckpointNum; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.platform.domain.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ycl.platform.base.AbsEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 考核模板 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("t_check_template") |
| | | @ApiModel(value = "CheckTemplate对象", description = "考核模板") |
| | | public class CheckTemplate extends AbsEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 模板名称 |
| | | */ |
| | | @TableField("template_name") |
| | | private String templateName; |
| | | |
| | | @ApiModelProperty("调整系数") |
| | | @TableField("adjust_coefficient") |
| | | private BigDecimal adjustCoefficient; |
| | | |
| | | /** |
| | | * 调整系数的方式:乘除 |
| | | */ |
| | | @TableField("adjust_way") |
| | | private String adjustWay; |
| | | |
| | | @ApiModelProperty("状态") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.platform.domain.form; |
| | | |
| | | import com.ycl.system.domain.group.Update; |
| | | import com.ycl.system.domain.group.Add; |
| | | import com.ycl.platform.base.AbsForm; |
| | | import com.ycl.platform.domain.entity.CheckRule; |
| | | import java.time.LocalDateTime; |
| | | import org.springframework.beans.BeanUtils; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 考核规则表单 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "CheckRule表单", description = "考核规则表单") |
| | | public class CheckRuleForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "规则名称不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("规则名称") |
| | | private String ruleName; |
| | | |
| | | @NotBlank(message = "规则描述不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("规则描述") |
| | | private String ruleDetail; |
| | | |
| | | @NotNull(message = "天网视频点位数不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("天网视频点位数") |
| | | private Integer videoPointNum; |
| | | |
| | | @NotNull(message = "车辆卡口点位数不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("车辆卡口点位数") |
| | | private Integer vehicleCheckpointNum; |
| | | |
| | | @NotNull(message = "人脸卡口点位数不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("人脸卡口点位数") |
| | | private Integer faceChceckpointNum; |
| | | |
| | | public static CheckRule getEntityByForm(@NonNull CheckRuleForm form, CheckRule entity) { |
| | | if(entity == null) { |
| | | entity = new CheckRule(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.platform.domain.form; |
| | | |
| | | import com.ycl.platform.domain.vo.RuleItemVO; |
| | | import com.ycl.system.domain.group.Update; |
| | | import com.ycl.system.domain.group.Add; |
| | | import com.ycl.platform.base.AbsForm; |
| | | import com.ycl.platform.domain.entity.CheckTemplate; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import org.springframework.beans.BeanUtils; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 考核模板表单 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "CheckTemplate表单", description = "考核模板表单") |
| | | public class CheckTemplateForm extends AbsForm { |
| | | |
| | | @NotNull(message = "模板名称不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("模板名称") |
| | | private String templateName; |
| | | |
| | | @NotNull(message = "调整系数不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("调整系数") |
| | | private BigDecimal adjustCoefficient; |
| | | |
| | | @NotNull(message = "调整系数计算方式不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("调整系数计算方式") |
| | | private String adjustWay; |
| | | |
| | | @NotBlank(message = "状态不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("状态") |
| | | private String status; |
| | | |
| | | @NotEmpty(message = "考核规则不能为空") |
| | | @ApiModelProperty("考核规则") |
| | | private List<RuleItemVO> ruleFormList; |
| | | |
| | | public static CheckTemplate getEntityByForm(@NonNull CheckTemplateForm form, CheckTemplate entity) { |
| | | if(entity == null) { |
| | | entity = new CheckTemplate(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.platform.domain.form; |
| | | |
| | | import com.ycl.platform.base.AbsForm; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 违约审核表单 |
| | | * |
| | | * @author:xp |
| | | * @date:2024/3/6 8:59 |
| | | */ |
| | | @Data |
| | | public class DefaultAuditForm extends AbsForm { |
| | | |
| | | /** |
| | | * 审核结果 |
| | | */ |
| | | @NotBlank(message = "审核结果不能为空") |
| | | private String auditingResult; |
| | | |
| | | /** |
| | | * 审核说明 |
| | | */ |
| | | private String remark; |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.platform.domain.query; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ycl.platform.base.AbsQuery; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 考核规则查询 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "CheckRule查询", description = "考核规则查询") |
| | | public class CheckRuleQuery extends AbsQuery { |
| | | |
| | | /** |
| | | * 规则名称 |
| | | */ |
| | | private String ruleName; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date start; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date end; |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ycl.platform.domain.query; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ycl.platform.base.AbsQuery; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 考核模板查询 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "CheckTemplate查询", description = "考核模板查询") |
| | | public class CheckTemplateQuery extends AbsQuery { |
| | | |
| | | /** |
| | | * 模板名称 |
| | | */ |
| | | private String templateName; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | private String status; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date start; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date end; |
| | | |
| | | } |
| | | |
| | |
| | | package com.ycl.platform.domain.query; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ycl.platform.base.AbsQuery; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | import org.springframework.lang.NonNull; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import utils.DateUtils; |
| | | |
| | | /** |
| | | * 违规审核查询 |
| | |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "DefaultAuditing查询", description = "违规审核查询") |
| | | public class DefaultAuditingQuery extends AbsQuery { |
| | | |
| | | /** |
| | | * 违规单位 |
| | | */ |
| | | private Integer unitId; |
| | | |
| | | /** |
| | | * 审核时间范围 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date auditingStartTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date auditingEndTime; |
| | | |
| | | /** |
| | | * 创建时间范围 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createStartTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createEndTime; |
| | | |
| | | /** |
| | | * 设置时间,使其包含今天 |
| | | */ |
| | | public void setTime() { |
| | | if (Objects.nonNull(auditingStartTime)) { |
| | | auditingStartTime = DateUtils.getDayStart(auditingStartTime); |
| | | } |
| | | if (Objects.nonNull(auditingEndTime)) { |
| | | auditingEndTime = DateUtils.getDayEnd(auditingEndTime); |
| | | } |
| | | if (Objects.nonNull(createStartTime)) { |
| | | createStartTime = DateUtils.getDayStart(createStartTime); |
| | | } |
| | | if (Objects.nonNull(createEndTime)) { |
| | | createEndTime = DateUtils.getDayEnd(createEndTime); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ycl.platform.domain.vo; |
| | | |
| | | import com.ycl.platform.base.AbsVo; |
| | | import com.ycl.platform.domain.entity.CheckRule; |
| | | import java.util.List; |
| | | import java.time.LocalDateTime; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 考核规则展示 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class CheckRuleVO extends AbsVo { |
| | | |
| | | /** 规则名称 */ |
| | | private String ruleName; |
| | | |
| | | /** 规则描述 */ |
| | | private String ruleDetail; |
| | | |
| | | /** 天网视频点位数 */ |
| | | private Integer videoPointNum; |
| | | |
| | | /** 车辆卡口点位数 */ |
| | | private Integer vehicleCheckpointNum; |
| | | |
| | | /** 人脸卡口点位数 */ |
| | | private Integer faceChceckpointNum; |
| | | |
| | | public static CheckRuleVO getVoByEntity(@NonNull CheckRule entity, CheckRuleVO vo) { |
| | | if(vo == null) { |
| | | vo = new CheckRuleVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.platform.domain.vo; |
| | | |
| | | import com.ycl.platform.base.AbsVo; |
| | | import com.ycl.platform.domain.entity.CheckTemplate; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.ycl.platform.domain.form.CheckTemplateForm; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 考核模板展示 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class CheckTemplateVO extends AbsVo { |
| | | |
| | | /** 模板名称 */ |
| | | private String templateName; |
| | | |
| | | /** 调整系数 */ |
| | | private BigDecimal adjustCoefficient; |
| | | |
| | | /** 调整系数的方式:乘除 */ |
| | | private String adjustWay; |
| | | |
| | | /** 状态 */ |
| | | private String status; |
| | | |
| | | /** 规则列表 */ |
| | | private List<RuleItemVO> ruleFormList; |
| | | |
| | | public static CheckTemplateVO getVoByEntity(@NonNull CheckTemplate entity, CheckTemplateVO vo) { |
| | | if(vo == null) { |
| | | vo = new CheckTemplateVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ycl.platform.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ycl.platform.base.AbsVo; |
| | | import com.ycl.platform.domain.entity.DefaultAuditing; |
| | | import java.util.List; |
| | |
| | | /** 违规 */ |
| | | private Integer defaultId; |
| | | |
| | | /** |
| | | * 违约规则名 |
| | | */ |
| | | private String defaultRuleName; |
| | | |
| | | /** |
| | | * 违约运维单位 |
| | | */ |
| | | private String unitName; |
| | | |
| | | /** 审核状态 */ |
| | | private String auditingStatus; |
| | | |
| | |
| | | private String remark; |
| | | |
| | | /** 审核时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime auditingTime; |
| | | |
| | | /** 审核人 */ |
| | | private Integer auditingUser; |
| | | private String auditingUserName; |
| | | |
| | | public static DefaultAuditingVO getVoByEntity(@NonNull DefaultAuditing entity, DefaultAuditingVO vo) { |
| | | if(vo == null) { |
New file |
| | |
| | | package com.ycl.platform.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author:xp |
| | | * @date:2024/3/7 9:24 |
| | | */ |
| | | @Data |
| | | public class RuleItemVO { |
| | | |
| | | /** |
| | | * 规则 |
| | | */ |
| | | private Integer ruleId; |
| | | |
| | | /** |
| | | * 权重 |
| | | */ |
| | | private BigDecimal weight; |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.config; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @author xp |
| | | * @date 2024/3/6 |
| | | */ |
| | | @Configuration |
| | | public class MybatisPlusConfig { |
| | | |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | | |
| | | // 配置分页插件 |
| | | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); |
| | | return interceptor; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ycl.platform.controller; |
| | | |
| | | import com.ycl.system.domain.group.Update; |
| | | import com.ycl.system.domain.group.Add; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import com.ycl.platform.service.CheckRuleService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.platform.domain.form.CheckRuleForm; |
| | | import com.ycl.platform.domain.query.CheckRuleQuery; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 考核规则 前端控制器 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "考核规则", tags = "考核规则管理") |
| | | @RestController |
| | | @RequestMapping("/check-rule") |
| | | public class CheckRuleController { |
| | | |
| | | private final CheckRuleService checkRuleService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) CheckRuleForm form) { |
| | | return checkRuleService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) CheckRuleForm form) { |
| | | return checkRuleService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return checkRuleService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return checkRuleService.remove(ids); |
| | | } |
| | | |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(@RequestBody CheckRuleQuery query) { |
| | | return checkRuleService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return checkRuleService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return checkRuleService.all(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ycl.platform.controller; |
| | | |
| | | import com.ycl.system.domain.group.Update; |
| | | import com.ycl.system.domain.group.Add; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import com.ycl.platform.service.CheckTemplateService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.platform.domain.form.CheckTemplateForm; |
| | | import com.ycl.platform.domain.query.CheckTemplateQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 考核模板 前端控制器 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "考核模板", tags = "考核模板管理") |
| | | @RestController |
| | | @RequestMapping("/check-template") |
| | | public class CheckTemplateController { |
| | | |
| | | private final CheckTemplateService checkTemplateService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) CheckTemplateForm form) { |
| | | return checkTemplateService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) CheckTemplateForm form) { |
| | | return checkTemplateService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return checkTemplateService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return checkTemplateService.remove(ids); |
| | | } |
| | | |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(@RequestBody CheckTemplateQuery query) { |
| | | return checkTemplateService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return checkTemplateService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return checkTemplateService.all(); |
| | | } |
| | | } |
| | |
| | | package com.ycl.platform.controller; |
| | | |
| | | import com.ycl.platform.domain.form.DefaultAuditForm; |
| | | import com.ycl.system.domain.group.Update; |
| | | import com.ycl.system.domain.group.Add; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | return defaultAuditingService.remove(ids); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(DefaultAuditingQuery query) { |
| | | public Result page(@RequestBody DefaultAuditingQuery query) { |
| | | return defaultAuditingService.page(query); |
| | | } |
| | | |
| | |
| | | public Result list() { |
| | | return defaultAuditingService.all(); |
| | | } |
| | | |
| | | @PostMapping("/auditing") |
| | | @ApiOperation(value = "审核", notes = "审核") |
| | | public Result auditing(@RequestBody @Validated DefaultAuditForm form) { |
| | | return defaultAuditingService.auditing(form); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ycl.platform.mapper; |
| | | |
| | | import com.ycl.platform.domain.entity.CheckRule; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ycl.platform.domain.vo.CheckRuleVO; |
| | | import com.ycl.platform.domain.form.CheckRuleForm; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * 考核规则 Mapper 接口 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Mapper |
| | | public interface CheckRuleMapper extends BaseMapper<CheckRule> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.platform.mapper; |
| | | |
| | | import com.ycl.platform.domain.entity.CheckTemplate; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ycl.platform.domain.vo.CheckTemplateVO; |
| | | import com.ycl.platform.domain.form.CheckTemplateForm; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * 考核模板 Mapper 接口 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Mapper |
| | | public interface CheckTemplateMapper extends BaseMapper<CheckTemplate> { |
| | | |
| | | } |
| | |
| | | package com.ycl.platform.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.platform.domain.entity.DefaultAuditing; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ycl.platform.domain.query.DefaultAuditingQuery; |
| | | import com.ycl.platform.domain.vo.DefaultAuditingVO; |
| | | import com.ycl.platform.domain.form.DefaultAuditingForm; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 违规审核 Mapper 接口 |
| | |
| | | @Mapper |
| | | public interface DefaultAuditingMapper extends BaseMapper<DefaultAuditing> { |
| | | |
| | | Page page(IPage page, @Param("query") DefaultAuditingQuery query); |
| | | } |
| | | |
New file |
| | |
| | | package com.ycl.platform.service; |
| | | |
| | | import com.ycl.platform.domain.entity.CheckRule; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.platform.domain.form.CheckRuleForm; |
| | | import com.ycl.platform.domain.query.CheckRuleQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 考核规则 服务类 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | public interface CheckRuleService extends IService<CheckRule> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(CheckRuleForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(CheckRuleForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(CheckRuleQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | } |
New file |
| | |
| | | package com.ycl.platform.service; |
| | | |
| | | import com.ycl.platform.domain.entity.CheckTemplate; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.platform.domain.form.CheckTemplateForm; |
| | | import com.ycl.platform.domain.query.CheckTemplateQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 考核模板 服务类 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | public interface CheckTemplateService extends IService<CheckTemplate> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(CheckTemplateForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(CheckTemplateForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(CheckTemplateQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | } |
| | |
| | | |
| | | import com.ycl.platform.domain.entity.DefaultAuditing; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ycl.platform.domain.form.DefaultAuditForm; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.platform.domain.form.DefaultAuditingForm; |
| | | import com.ycl.platform.domain.query.DefaultAuditingQuery; |
| | |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | |
| | | /** |
| | | * 审核 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result auditing(DefaultAuditForm form); |
| | | } |
New file |
| | |
| | | package com.ycl.platform.service.impl; |
| | | |
| | | import com.ycl.platform.base.BaseSelect; |
| | | import com.ycl.platform.domain.entity.CheckRule; |
| | | import com.ycl.platform.domain.entity.YwUnit; |
| | | import com.ycl.platform.mapper.CheckRuleMapper; |
| | | import com.ycl.platform.service.CheckRuleService; |
| | | import com.ycl.system.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.platform.domain.form.CheckRuleForm; |
| | | import com.ycl.platform.domain.vo.CheckRuleVO; |
| | | import com.ycl.platform.domain.query.CheckRuleQuery; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.system.page.PageUtil; |
| | | import com.ycl.utils.DateUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | import java.util.ArrayList; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | /** |
| | | * 考核规则 服务实现类 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class CheckRuleServiceImpl extends ServiceImpl<CheckRuleMapper, CheckRule> implements CheckRuleService { |
| | | |
| | | private final CheckRuleMapper checkRuleMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(CheckRuleForm form) { |
| | | CheckRule entity = CheckRuleForm.getEntityByForm(form, null); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | | return Result.error("添加失败"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(CheckRuleForm form) { |
| | | |
| | | CheckRule entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | return Result.ok("修改成功"); |
| | | } |
| | | return Result.error("修改失败"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result remove(List<String> ids) { |
| | | if(baseMapper.deleteBatchIds(ids) > 0) { |
| | | return Result.ok("删除成功"); |
| | | } |
| | | return Result.error("删除失败"); |
| | | } |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result removeById(String id) { |
| | | if(baseMapper.deleteById(id) > 0) { |
| | | return Result.ok("删除成功"); |
| | | } |
| | | return Result.error("删除失败"); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result page(CheckRuleQuery query) { |
| | | |
| | | IPage<CheckRule> page = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .like(StringUtils.hasText(query.getRuleName()), CheckRule::getRuleName, query.getRuleName()) |
| | | .between(Objects.nonNull(query.getStart()) && Objects.nonNull(query.getEnd()), |
| | | CheckRule::getCreateTime, |
| | | DateUtils.getDayStart(query.getStart()), |
| | | DateUtils.getDayEnd(query.getEnd())) |
| | | .orderByDesc(CheckRule::getCreateTime) |
| | | .page(PageUtil.getPage(query, CheckRule.class)); |
| | | |
| | | List<CheckRuleVO> vos = page.getRecords().stream() |
| | | .map( |
| | | entity -> CheckRuleVO.getVoByEntity(entity, null) |
| | | ) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | |
| | | CheckRule entity = baseMapper.selectById(id); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | CheckRuleVO vo = CheckRuleVO.getVoByEntity(entity, null); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<CheckRule> entities = baseMapper.selectList(null); |
| | | List<BaseSelect> vos = entities.stream() |
| | | .map( |
| | | entity -> { |
| | | BaseSelect vo = new BaseSelect(); |
| | | vo.setId(entity.getId()); |
| | | vo.setValue(entity.getRuleName()); |
| | | return vo; |
| | | } |
| | | ) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ycl.platform.service.impl; |
| | | |
| | | import com.ycl.platform.domain.entity.CheckTemplate; |
| | | import com.ycl.platform.domain.entity.YwUnit; |
| | | import com.ycl.platform.mapper.CheckTemplateMapper; |
| | | import com.ycl.platform.service.CheckTemplateService; |
| | | import com.ycl.system.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.platform.domain.form.CheckTemplateForm; |
| | | import com.ycl.platform.domain.vo.CheckTemplateVO; |
| | | import com.ycl.platform.domain.query.CheckTemplateQuery; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.system.page.PageUtil; |
| | | import com.ycl.utils.DateUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | import java.util.ArrayList; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | /** |
| | | * 考核模板 服务实现类 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-06 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class CheckTemplateServiceImpl extends ServiceImpl<CheckTemplateMapper, CheckTemplate> implements CheckTemplateService { |
| | | |
| | | private final CheckTemplateMapper checkTemplateMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(CheckTemplateForm form) { |
| | | CheckTemplate entity = CheckTemplateForm.getEntityByForm(form, null); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | | return Result.error("添加失败"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(CheckTemplateForm form) { |
| | | |
| | | CheckTemplate entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | return Result.ok("修改成功"); |
| | | } |
| | | return Result.error("修改失败"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result remove(List<String> ids) { |
| | | if(baseMapper.deleteBatchIds(ids) > 0) { |
| | | return Result.ok("删除成功"); |
| | | } |
| | | return Result.error("删除失败"); |
| | | } |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result removeById(String id) { |
| | | if(baseMapper.deleteById(id) > 0) { |
| | | return Result.ok("删除成功"); |
| | | } |
| | | return Result.error("删除失败"); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result page(CheckTemplateQuery query) { |
| | | IPage<CheckTemplate> page = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .like(StringUtils.hasText(query.getTemplateName()), CheckTemplate::getTemplateName, query.getTemplateName()) |
| | | .eq(StringUtils.hasText(query.getStatus()), CheckTemplate::getStatus, query.getStatus()) |
| | | .between(Objects.nonNull(query.getStart()) && Objects.nonNull(query.getEnd()), |
| | | CheckTemplate::getCreateTime, |
| | | DateUtils.getDayStart(query.getStart()), |
| | | DateUtils.getDayEnd(query.getEnd())) |
| | | .orderByDesc(CheckTemplate::getCreateTime) |
| | | .page(PageUtil.getPage(query, CheckTemplate.class)); |
| | | |
| | | List<CheckTemplateVO> vos = page.getRecords().stream() |
| | | .map( |
| | | entity -> CheckTemplateVO.getVoByEntity(entity, null) |
| | | ) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | |
| | | CheckTemplate entity = baseMapper.selectById(id); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | CheckTemplateVO vo = CheckTemplateVO.getVoByEntity(entity, null); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<CheckTemplate> entities = baseMapper.selectList(null); |
| | | List<CheckTemplateVO> vos = entities.stream() |
| | | .map( |
| | | entity -> CheckTemplateVO.getVoByEntity(entity, null) |
| | | ) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | } |
| | |
| | | package com.ycl.platform.service.impl; |
| | | |
| | | import com.ycl.exception.ServiceException; |
| | | import com.ycl.platform.domain.entity.DefaultAuditing; |
| | | import com.ycl.platform.domain.form.DefaultAuditForm; |
| | | import com.ycl.platform.mapper.DefaultAuditingMapper; |
| | | import com.ycl.platform.service.DefaultAuditingService; |
| | | import com.ycl.system.Result; |
| | |
| | | import com.ycl.platform.domain.form.DefaultAuditingForm; |
| | | import com.ycl.platform.domain.vo.DefaultAuditingVO; |
| | | import com.ycl.platform.domain.query.DefaultAuditingQuery; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | import java.util.ArrayList; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | |
| | | */ |
| | | @Override |
| | | public Result page(DefaultAuditingQuery query) { |
| | | |
| | | IPage<DefaultAuditing> page = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .orderByDesc(DefaultAuditing::getCreateTime) |
| | | .page(PageUtil.getPage(query, DefaultAuditing.class)); |
| | | |
| | | List<DefaultAuditingVO> vos = page.getRecords().stream() |
| | | .map( |
| | | entity -> DefaultAuditingVO.getVoByEntity(entity, null) |
| | | ) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos).total(page.getTotal()); |
| | | query.setTime(); |
| | | IPage page = PageUtil.getPage(query, DefaultAuditing.class); |
| | | baseMapper.page(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public Result auditing(DefaultAuditForm form) { |
| | | DefaultAuditing defaultAuditing = baseMapper.selectById(form.getId()); |
| | | if (Objects.isNull(defaultAuditing)) { |
| | | throw new ServiceException("该违约不存在"); |
| | | } |
| | | if ("pass".equals(form.getAuditingResult())) { |
| | | defaultAuditing.setAuditingStatus("审核通过"); |
| | | } else { |
| | | defaultAuditing.setAuditingStatus("审核未通过"); |
| | | } |
| | | BeanUtils.copyProperties(form, defaultAuditing); |
| | | defaultAuditing.setAuditingTime(LocalDateTime.now()); |
| | | baseMapper.updateById(defaultAuditing); |
| | | return Result.ok("操作成功"); |
| | | } |
| | | } |
New file |
| | |
| | | <?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.CheckRuleMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ycl.platform.domain.vo.CheckRuleVO"> |
| | | <result column="id" property="id" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="rule_name" property="ruleName" /> |
| | | <result column="rule_detail" property="ruleDetail" /> |
| | | <result column="video_point_num" property="videoPointNum" /> |
| | | <result column="vehicle_checkpoint_num" property="vehicleCheckpointNum" /> |
| | | <result column="face_chceckpoint_num" property="faceChceckpointNum" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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.CheckTemplateMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ycl.platform.domain.vo.CheckTemplateVO"> |
| | | <result column="id" property="id" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="adjust_coefficient" property="adjustCoefficient" /> |
| | | <result column="adjust_way" property="adjustWay" /> |
| | | <result column="status" property="status" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | <result column="auditing_status" property="auditingStatus" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="auditing_time" property="auditingTime" /> |
| | | <result column="auditing_user" property="auditingUser" /> |
| | | <result column="nick_name" property="auditingUserName" /> |
| | | <result column="rule_name" property="defaultRuleName" /> |
| | | <result column="unit_name" property="unitName" /> |
| | | </resultMap> |
| | | |
| | | <select id="page" resultMap="BaseResultMap"> |
| | | SELECT |
| | | tda.id, |
| | | tda.create_time, |
| | | tda.default_id, |
| | | tda.auditing_status, |
| | | tda.remark, |
| | | tda.auditing_time, |
| | | tda.auditing_user, |
| | | su.nick_name, |
| | | (SELECT unit_name FROM t_yw_unit WHERE id = tdr.unit_id AND deleted = 0) as unit_name, |
| | | (SELECT rule_name FROM t_default_rule WHERE id = tdr.default_rule_id AND deleted = 0) as rule_name |
| | | FROM |
| | | t_default_auditing tda |
| | | INNER JOIN t_default_record tdr ON tda.default_id = tdr.id AND tda.deleted = 0 AND tdr.deleted = 0 |
| | | LEFT JOIN sys_user su ON tda.auditing_user = su.user_id |
| | | <where> |
| | | |
| | | <if test="query.unitId != null and query.unitId != ''"> |
| | | AND tdr.unit_id = #{query.unitId} |
| | | </if> |
| | | <if test="query.auditingStartTime != null and query.auditingEndTime != null"> |
| | | AND tda.auditing_time BETWEEN #{query.auditingStartTime} AND #{query.auditingEndTime} |
| | | </if> |
| | | <if test="query.createStartTime != null and query.createEndTime != null"> |
| | | AND tda.create_time BETWEEN #{query.createStartTime} AND #{query.createEndTime} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |