123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- package com.shkpr.service.alambizplugin.apiparam;
- import com.shkpr.service.alambizplugin.constants.GisSurveyCheckTypeEnum;
- import com.shkpr.service.alambizplugin.controllervalid.CommonParamValidSK;
- import lombok.Getter;
- import lombok.Setter;
- import org.apache.commons.lang3.StringUtils;
- import javax.validation.constraints.NotNull;
- import javax.validation.constraints.Size;
- import java.time.LocalDateTime;
- import java.util.Arrays;
- import java.util.Objects;
- /**
- * 系统检查入参
- *
- * @author 欧阳劲驰
- * @since 1.0.0
- */
- @Getter
- @Setter
- public class GisSurveyCheckParams {
- /**
- * 检查类型:0:项目,1:任务
- */
- @NotNull(groups = {CommonParamValidSK.class})
- private Integer checkType;
- /**
- * 项目id
- */
- @Size(max = 64, groups = {CommonParamValidSK.class})
- private String projId;
- /**
- * 任务id
- */
- @Size(max = 64, groups = {CommonParamValidSK.class})
- private String jobId;
- /**
- * 当前操作人id
- */
- @NotNull(groups = {CommonParamValidSK.class})
- @Size(max = 64, groups = {CommonParamValidSK.class})
- private String operator;
- /**
- * 忽略失败
- */
- private Boolean ignoreFail = false;
- /**
- * 返回上次结果
- */
- private Boolean returnLastResult = false;
- /**
- * 是否启动检查(满足检查条件的情况下)
- */
- private Boolean checkStart = true;
- /**
- * 孤立点启动
- */
- private Boolean isolatedPointsStart = true;
- /**
- * 孤立线启动
- */
- private Boolean isolatedLinesStart = true;
- /**
- * 重复点启动
- */
- private Boolean duplicatePointsStart = true;
- /**
- * 重叠线启动
- */
- private Boolean overlapLinesStart = true;
- /**
- * 元素/属性的变化时间
- * <p>系统内部用</p>
- */
- private LocalDateTime refreshTime;
- /**
- * 入参校验
- *
- * @return 校验状态
- */
- public boolean checkValid() {
- //检查项目类型
- if (checkType == null || Arrays.stream(GisSurveyCheckTypeEnum.values())
- .noneMatch(e -> Objects.equals(e.getCode(), checkType))) {
- return false;
- }
- //检查项目ID和任务ID
- if (Objects.equals(checkType, GisSurveyCheckTypeEnum.PROJECT.getCode())) {
- return StringUtils.isNotBlank(projId);
- } else if (Objects.equals(checkType, GisSurveyCheckTypeEnum.JOB.getCode())) {
- return StringUtils.isNotBlank(jobId);
- }
- return false;
- }
- }
|