Ver código fonte

私有化部署:获取设备信息的接口

tangxiangan 1 ano atrás
pai
commit
f86b9333d8

+ 4 - 1
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/controller/VppDeviceController.java

@@ -108,11 +108,14 @@ public class VppDeviceController {
         return new ResultMap<>(CommonConstant.SUCCESS, VppDeviceConstant.SUCCESS_MSG_Canceled,Boolean.TRUE);
     }
 
-    @PreCheckRole(roles = {RoleEnum.TEAM_ADMIN,RoleEnum.SUPER_ADMIN})
     @PostMapping("/activation")
     public ResultMap<ActivationVO> activation(@RequestBody VerifyParam verifyParam) {
         return new ResultMap<>(CommonConstant.SUCCESS, VppDeviceConstant.SUCCESS_ACTIVATION_SUCCESS,vppDeviceService.activation(verifyParam));
     }
 
+    @PostMapping("/verify")
+    public ResultMap<ActivationVO> verify(@RequestBody VerifyParam verifyParam) {
+        return new ResultMap<>(CommonConstant.SUCCESS, VppDeviceConstant.SUCCESS_ACTIVATION_SUCCESS,vppDeviceService.verify(verifyParam));
+    }
 
 }

+ 33 - 0
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/mapper/AppsMapper.java

@@ -0,0 +1,33 @@
+package cn.kdan.pdf.tech.core.mapper;
+
+import cn.kdan.pdf.tech.core.model.Apps;
+import cn.kdan.pdf.tech.core.model.AppsExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.session.RowBounds;
+
+public interface AppsMapper {
+    long countByExample(AppsExample example);
+
+    int deleteByExample(AppsExample example);
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(Apps row);
+
+    int insertSelective(Apps row);
+
+    List<Apps> selectByExampleWithRowbounds(AppsExample example, RowBounds rowBounds);
+
+    List<Apps> selectByExample(AppsExample example);
+
+    Apps selectByPrimaryKey(Integer id);
+
+    int updateByExampleSelective(@Param("row") Apps row, @Param("example") AppsExample example);
+
+    int updateByExample(@Param("row") Apps row, @Param("example") AppsExample example);
+
+    int updateByPrimaryKeySelective(Apps row);
+
+    int updateByPrimaryKey(Apps row);
+}

+ 2 - 0
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/mapper/ext/ExtVppLicenseCodeMapper.java

@@ -29,6 +29,8 @@ public interface ExtVppLicenseCodeMapper extends LicenseCodesMapper {
 
     List<LicenseCodes> listBySubscriptionIds(@Param("subscriptionIds") List<String> subscriptionIds);
 
+    List<LicenseCodes> listByValidFlag(@Param("flags") List<Short> flags);
+
     /**
      * 私有化部署验证序列码用到
      * @param cdkey cdkey

+ 166 - 0
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/model/Apps.java

@@ -0,0 +1,166 @@
+package cn.kdan.pdf.tech.core.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Apps implements Serializable {
+    private Integer id;
+
+    private String name;
+
+    private String code;
+
+    private Date createdAt;
+
+    private Date updatedAt;
+
+    private Integer latestVersionId;
+
+    private Double maxTrailDays;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public Apps withId(Integer id) {
+        this.setId(id);
+        return this;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public Apps withName(String name) {
+        this.setName(name);
+        return this;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public Apps withCode(String code) {
+        this.setCode(code);
+        return this;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public Date getCreatedAt() {
+        return createdAt;
+    }
+
+    public Apps withCreatedAt(Date createdAt) {
+        this.setCreatedAt(createdAt);
+        return this;
+    }
+
+    public void setCreatedAt(Date createdAt) {
+        this.createdAt = createdAt;
+    }
+
+    public Date getUpdatedAt() {
+        return updatedAt;
+    }
+
+    public Apps withUpdatedAt(Date updatedAt) {
+        this.setUpdatedAt(updatedAt);
+        return this;
+    }
+
+    public void setUpdatedAt(Date updatedAt) {
+        this.updatedAt = updatedAt;
+    }
+
+    public Integer getLatestVersionId() {
+        return latestVersionId;
+    }
+
+    public Apps withLatestVersionId(Integer latestVersionId) {
+        this.setLatestVersionId(latestVersionId);
+        return this;
+    }
+
+    public void setLatestVersionId(Integer latestVersionId) {
+        this.latestVersionId = latestVersionId;
+    }
+
+    public Double getMaxTrailDays() {
+        return maxTrailDays;
+    }
+
+    public Apps withMaxTrailDays(Double maxTrailDays) {
+        this.setMaxTrailDays(maxTrailDays);
+        return this;
+    }
+
+    public void setMaxTrailDays(Double maxTrailDays) {
+        this.maxTrailDays = maxTrailDays;
+    }
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        Apps other = (Apps) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
+            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
+            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
+            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
+            && (this.getLatestVersionId() == null ? other.getLatestVersionId() == null : this.getLatestVersionId().equals(other.getLatestVersionId()))
+            && (this.getMaxTrailDays() == null ? other.getMaxTrailDays() == null : this.getMaxTrailDays().equals(other.getMaxTrailDays()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
+        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
+        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
+        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
+        result = prime * result + ((getLatestVersionId() == null) ? 0 : getLatestVersionId().hashCode());
+        result = prime * result + ((getMaxTrailDays() == null) ? 0 : getMaxTrailDays().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", name=").append(name);
+        sb.append(", code=").append(code);
+        sb.append(", createdAt=").append(createdAt);
+        sb.append(", updatedAt=").append(updatedAt);
+        sb.append(", latestVersionId=").append(latestVersionId);
+        sb.append(", maxTrailDays=").append(maxTrailDays);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 650 - 0
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/model/AppsExample.java

@@ -0,0 +1,650 @@
+package cn.kdan.pdf.tech.core.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class AppsExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public AppsExample() {
+        oredCriteria = new ArrayList<>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Integer value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Integer value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Integer value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Integer value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Integer> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Integer> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Integer value1, Integer value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameIsNull() {
+            addCriterion("`name` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameIsNotNull() {
+            addCriterion("`name` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameEqualTo(String value) {
+            addCriterion("`name` =", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameNotEqualTo(String value) {
+            addCriterion("`name` <>", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameGreaterThan(String value) {
+            addCriterion("`name` >", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameGreaterThanOrEqualTo(String value) {
+            addCriterion("`name` >=", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameLessThan(String value) {
+            addCriterion("`name` <", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameLessThanOrEqualTo(String value) {
+            addCriterion("`name` <=", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameLike(String value) {
+            addCriterion("`name` like", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameNotLike(String value) {
+            addCriterion("`name` not like", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameIn(List<String> values) {
+            addCriterion("`name` in", values, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameNotIn(List<String> values) {
+            addCriterion("`name` not in", values, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameBetween(String value1, String value2) {
+            addCriterion("`name` between", value1, value2, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameNotBetween(String value1, String value2) {
+            addCriterion("`name` not between", value1, value2, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeIsNull() {
+            addCriterion("code is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeIsNotNull() {
+            addCriterion("code is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeEqualTo(String value) {
+            addCriterion("code =", value, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeNotEqualTo(String value) {
+            addCriterion("code <>", value, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeGreaterThan(String value) {
+            addCriterion("code >", value, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeGreaterThanOrEqualTo(String value) {
+            addCriterion("code >=", value, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeLessThan(String value) {
+            addCriterion("code <", value, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeLessThanOrEqualTo(String value) {
+            addCriterion("code <=", value, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeLike(String value) {
+            addCriterion("code like", value, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeNotLike(String value) {
+            addCriterion("code not like", value, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeIn(List<String> values) {
+            addCriterion("code in", values, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeNotIn(List<String> values) {
+            addCriterion("code not in", values, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeBetween(String value1, String value2) {
+            addCriterion("code between", value1, value2, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeNotBetween(String value1, String value2) {
+            addCriterion("code not between", value1, value2, "code");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtIsNull() {
+            addCriterion("created_at is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtIsNotNull() {
+            addCriterion("created_at is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtEqualTo(Date value) {
+            addCriterion("created_at =", value, "createdAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtNotEqualTo(Date value) {
+            addCriterion("created_at <>", value, "createdAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtGreaterThan(Date value) {
+            addCriterion("created_at >", value, "createdAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
+            addCriterion("created_at >=", value, "createdAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtLessThan(Date value) {
+            addCriterion("created_at <", value, "createdAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
+            addCriterion("created_at <=", value, "createdAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtIn(List<Date> values) {
+            addCriterion("created_at in", values, "createdAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtNotIn(List<Date> values) {
+            addCriterion("created_at not in", values, "createdAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtBetween(Date value1, Date value2) {
+            addCriterion("created_at between", value1, value2, "createdAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
+            addCriterion("created_at not between", value1, value2, "createdAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtIsNull() {
+            addCriterion("updated_at is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtIsNotNull() {
+            addCriterion("updated_at is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtEqualTo(Date value) {
+            addCriterion("updated_at =", value, "updatedAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtNotEqualTo(Date value) {
+            addCriterion("updated_at <>", value, "updatedAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtGreaterThan(Date value) {
+            addCriterion("updated_at >", value, "updatedAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
+            addCriterion("updated_at >=", value, "updatedAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtLessThan(Date value) {
+            addCriterion("updated_at <", value, "updatedAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
+            addCriterion("updated_at <=", value, "updatedAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtIn(List<Date> values) {
+            addCriterion("updated_at in", values, "updatedAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtNotIn(List<Date> values) {
+            addCriterion("updated_at not in", values, "updatedAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtBetween(Date value1, Date value2) {
+            addCriterion("updated_at between", value1, value2, "updatedAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
+            addCriterion("updated_at not between", value1, value2, "updatedAt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdIsNull() {
+            addCriterion("latest_version_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdIsNotNull() {
+            addCriterion("latest_version_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdEqualTo(Integer value) {
+            addCriterion("latest_version_id =", value, "latestVersionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdNotEqualTo(Integer value) {
+            addCriterion("latest_version_id <>", value, "latestVersionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdGreaterThan(Integer value) {
+            addCriterion("latest_version_id >", value, "latestVersionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("latest_version_id >=", value, "latestVersionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdLessThan(Integer value) {
+            addCriterion("latest_version_id <", value, "latestVersionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdLessThanOrEqualTo(Integer value) {
+            addCriterion("latest_version_id <=", value, "latestVersionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdIn(List<Integer> values) {
+            addCriterion("latest_version_id in", values, "latestVersionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdNotIn(List<Integer> values) {
+            addCriterion("latest_version_id not in", values, "latestVersionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdBetween(Integer value1, Integer value2) {
+            addCriterion("latest_version_id between", value1, value2, "latestVersionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andLatestVersionIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("latest_version_id not between", value1, value2, "latestVersionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysIsNull() {
+            addCriterion("max_trail_days is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysIsNotNull() {
+            addCriterion("max_trail_days is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysEqualTo(Double value) {
+            addCriterion("max_trail_days =", value, "maxTrailDays");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysNotEqualTo(Double value) {
+            addCriterion("max_trail_days <>", value, "maxTrailDays");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysGreaterThan(Double value) {
+            addCriterion("max_trail_days >", value, "maxTrailDays");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysGreaterThanOrEqualTo(Double value) {
+            addCriterion("max_trail_days >=", value, "maxTrailDays");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysLessThan(Double value) {
+            addCriterion("max_trail_days <", value, "maxTrailDays");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysLessThanOrEqualTo(Double value) {
+            addCriterion("max_trail_days <=", value, "maxTrailDays");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysIn(List<Double> values) {
+            addCriterion("max_trail_days in", values, "maxTrailDays");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysNotIn(List<Double> values) {
+            addCriterion("max_trail_days not in", values, "maxTrailDays");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysBetween(Double value1, Double value2) {
+            addCriterion("max_trail_days between", value1, value2, "maxTrailDays");
+            return (Criteria) this;
+        }
+
+        public Criteria andMaxTrailDaysNotBetween(Double value1, Double value2) {
+            addCriterion("max_trail_days not between", value1, value2, "maxTrailDays");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameLikeInsensitive(String value) {
+            addCriterion("upper(`name`) like", value.toUpperCase(), "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andCodeLikeInsensitive(String value) {
+            addCriterion("upper(code) like", value.toUpperCase(), "code");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 7 - 0
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/service/VppDeviceService.java

@@ -67,4 +67,11 @@ public interface VppDeviceService {
     ActivationVO activation(VerifyParam verifyParam);
 
     void expireDevice(String subscriptionId);
+
+    /**
+     * 设备每次启动的时候获取设备信息
+     * @param verifyParam
+     * @return ActivationVO
+     */
+    ActivationVO verify(VerifyParam verifyParam);
 }

+ 48 - 2
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/service/impl/VppDeviceServiceImpl.java

@@ -5,6 +5,7 @@ import cn.kdan.pdf.tech.core.enums.CaptchaActionEnum;
 import cn.kdan.pdf.tech.core.enums.DeviceStatusEnum;
 import cn.kdan.pdf.tech.core.enums.LicenseCodeStatusEnum;
 import cn.kdan.pdf.tech.core.enums.PlatformEnum;
+import cn.kdan.pdf.tech.core.mapper.AppsMapper;
 import cn.kdan.pdf.tech.core.mapper.ext.ExtVppDeviceMapper;
 import cn.kdan.pdf.tech.core.model.*;
 import cn.kdan.pdf.tech.core.params.VerifyParam;
@@ -61,8 +62,7 @@ public class VppDeviceServiceImpl implements VppDeviceService {
     @Resource
     private VppLicenseCodeService licenseCodeService;
     @Resource
-    private VppLicenseCodeServiceImpl vppLicenseCodeServiceImpl;
-
+    private AppsMapper appsMapper;
     // 运营后台地址,图片地址emailImagesUrl
     @Value("${readerproUrl}")
     private String readerproUrl;
@@ -304,4 +304,50 @@ public class VppDeviceServiceImpl implements VppDeviceService {
         extVppDeviceMapper.updateByExampleSelective(devices,devicesExample);
     }
 
+    @Override
+    public ActivationVO verify(VerifyParam verifyParam) {
+        // 查询设备是否已激活
+        DevicesExample devicesExample = new DevicesExample();
+        devicesExample.createCriteria()
+                .andUniqueSnEqualTo(verifyParam.getUniqueSn());
+        List<Devices> list = extVppDeviceMapper.selectByExample(devicesExample);
+        Devices devices = new Devices();
+        DeviceResVO deviceResVO = new DeviceResVO();
+        if(!CollectionUtils.isEmpty(list)){
+            devices.setAppVersion(verifyParam.getAppVersion());
+            devices.setId(list.get(0).getId());
+            extVppDeviceMapper.updateByPrimaryKeySelective(devices);
+        }else{
+            // 新增设备
+            AppsExample example = new AppsExample();
+            example.createCriteria().andCodeEqualTo(verifyParam.getAppCode());
+            List<Apps> apps = appsMapper.selectByExample(example);
+            if (!CollectionUtils.isEmpty(apps)) {
+                devices.setAppId(apps.get(0).getId());
+            }
+            devices.setAppVersion(verifyParam.getAppVersion());
+            devices.setModel(verifyParam.getModel());
+            devices.setOs(verifyParam.getOs());
+            devices.setUniqueSn(verifyParam.getUniqueSn());
+            devices.setTimeZone(verifyParam.getTimeZone());
+            PlatformEnum platformEnum = PlatformEnum.getEnumByCode(verifyParam.getPlatform());
+            devices.setPlatform(platformEnum.code());
+            devices.setStatus(DeviceStatusEnum.UNACTIVATED.code());
+            devices.setIsVpp(Short.valueOf("2"));
+            extVppDeviceMapper.insert(devices);
+        }
+        deviceResVO.setStatus(Objects.requireNonNull(DeviceStatusEnum.getEnumByCode(devices.getStatus())).value());
+        if(list.size()>0&&list.get(0).getStatus().equals(DeviceStatusEnum.ACTIVE.code())){
+            List<LicenseCodesVO> licenseCodes = licenseCodeService.getWithInfo(verifyParam.getCdkey());
+            if (CollectionUtils.isEmpty(licenseCodes)) {
+                throw new BackendRuntimeException(VppDeviceConstant.EXCEPTION_MSG_INVALID_LICENSE_KEY);
+            }
+            LicenseCodesVO licenseCodesVO = licenseCodes.get(0);
+            Products products = productService.getById(licenseCodesVO.getProductId());
+            deviceResVO.setProductCode(products.getCode());
+        }
+        ActivationVO activationVO = new ActivationVO();
+        activationVO.setDevice(deviceResVO);
+        return activationVO;
+    }
 }

+ 5 - 7
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/service/impl/VppLicenseCodeServiceImpl.java

@@ -505,13 +505,11 @@ public class VppLicenseCodeServiceImpl implements VppLicenseCodeService {
 
     @Override
     public List<LicenseCodes> listActive() {
-        LicenseCodesExample example = new LicenseCodesExample();
-        //排除删除的退款的已过期的
-        example.createCriteria()
-               .andValidFlagNotEqualTo(LicenseCodeStatusEnum.DELETED.code())
-                .andValidFlagNotEqualTo(LicenseCodeStatusEnum.EXPIRED.code())
-                .andValidFlagNotEqualTo(LicenseCodeStatusEnum.Refunded.code());
-        return licenseCodeMapper.selectByExample(example);
+        List<Short> values = new ArrayList<>();
+        values.add(Short.valueOf(LicenseCodeStatusEnum.DELETED.code().shortValue()));
+        values.add(Short.valueOf(LicenseCodeStatusEnum.EXPIRED.code().shortValue()));
+        values.add(Short.valueOf(LicenseCodeStatusEnum.Refunded.code().shortValue()));
+        return licenseCodeMapper.listByValidFlag(values);
     }
 
     @Override

+ 1 - 1
pdf-tech-core/src/main/resources/application-pro.yml

@@ -12,7 +12,7 @@ security:
 
 jdbc:
   driverClassName: org.postgresql.Driver
-  url: jdbc:postgresql://localhost:5432/db_larger1
+  url: jdbc:postgresql://192.168.10.157:5432/db_larger1
   username: postgres
   password: postgres
 

+ 1 - 1
pdf-tech-core/src/main/resources/application.yml

@@ -90,6 +90,6 @@ cors:
   allow-origins: "*"
   allow-max-age: "3600"
 httpMatchers:
-  request: "/login,/logout,/vppMember/resetPassword,/oauth/**,/auth/**,/vppMember/create,/vppTeam/confirmTeamMember,/static/images/**"
+  request: "/login,/logout,/vppMember/resetPassword,/oauth/**,/auth/**,/vppMember/create,/vppTeam/confirmTeamMember,/static/images/**,/vppDevice/activation,/vppDevice/verify"
   web: "/hystrix.stream,/webjars/**,/resources/**,/swagger-ui.html,/swagger-resources/**,/v2/api-docs,/static/images/**"
 

+ 9 - 6
pdf-tech-core/src/main/resources/generatorConfig.xml

@@ -55,12 +55,15 @@
 <!--            <columnOverride column="product_id" property="productId" javaType="java.lang.Integer" />-->
 <!--            <columnOverride column="valid_flag" property="validFlag" javaType="java.lang.Integer" />-->
 <!--        </table>-->
-        <table tableName="license_codes">
-            <columnOverride column="id" property="id" javaType="java.lang.String" />
-            <columnOverride column="member_id" property="memberId" javaType="java.lang.String" />
-            <columnOverride column="subscription_id" property="subscriptionId" javaType="java.lang.String" />
-            <columnOverride column="product_id" property="productId" javaType="java.lang.Integer" />
-            <columnOverride column="valid_flag" property="validFlag" javaType="java.lang.Integer" />
+<!--        <table tableName="license_codes">-->
+<!--            <columnOverride column="id" property="id" javaType="java.lang.String" />-->
+<!--            <columnOverride column="member_id" property="memberId" javaType="java.lang.String" />-->
+<!--            <columnOverride column="subscription_id" property="subscriptionId" javaType="java.lang.String" />-->
+<!--            <columnOverride column="product_id" property="productId" javaType="java.lang.Integer" />-->
+<!--            <columnOverride column="valid_flag" property="validFlag" javaType="java.lang.Short" />-->
+<!--        </table>-->
+        <table tableName="apps">
+            <columnOverride column="id" property="id" javaType="java.lang.Integer" />
         </table>
 <!--        <table tableName="devices">-->
 <!--            <columnOverride column="id" property="id" javaType="java.lang.String" />-->

+ 257 - 0
pdf-tech-core/src/main/resources/sqlmap/AppsMapper.xml

@@ -0,0 +1,257 @@
+<?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="cn.kdan.pdf.tech.core.mapper.AppsMapper">
+  <resultMap id="BaseResultMap" type="cn.kdan.pdf.tech.core.model.Apps">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="code" jdbcType="VARCHAR" property="code" />
+    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
+    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
+    <result column="latest_version_id" jdbcType="INTEGER" property="latestVersionId" />
+    <result column="max_trail_days" jdbcType="DOUBLE" property="maxTrailDays" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, `name`, code, created_at, updated_at, latest_version_id, max_trail_days
+  </sql>
+  <select id="selectByExample" parameterType="cn.kdan.pdf.tech.core.model.AppsExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from apps
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from apps
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from apps
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="cn.kdan.pdf.tech.core.model.AppsExample">
+    delete from apps
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="cn.kdan.pdf.tech.core.model.Apps">
+    insert into apps (id, `name`, code, 
+      created_at, updated_at, latest_version_id, 
+      max_trail_days)
+    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
+      #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{latestVersionId,jdbcType=INTEGER}, 
+      #{maxTrailDays,jdbcType=DOUBLE})
+  </insert>
+  <insert id="insertSelective" parameterType="cn.kdan.pdf.tech.core.model.Apps">
+    insert into apps
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="code != null">
+        code,
+      </if>
+      <if test="createdAt != null">
+        created_at,
+      </if>
+      <if test="updatedAt != null">
+        updated_at,
+      </if>
+      <if test="latestVersionId != null">
+        latest_version_id,
+      </if>
+      <if test="maxTrailDays != null">
+        max_trail_days,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="code != null">
+        #{code,jdbcType=VARCHAR},
+      </if>
+      <if test="createdAt != null">
+        #{createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updatedAt != null">
+        #{updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="latestVersionId != null">
+        #{latestVersionId,jdbcType=INTEGER},
+      </if>
+      <if test="maxTrailDays != null">
+        #{maxTrailDays,jdbcType=DOUBLE},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="cn.kdan.pdf.tech.core.model.AppsExample" resultType="java.lang.Long">
+    select count(*) from apps
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update apps
+    <set>
+      <if test="row.id != null">
+        id = #{row.id,jdbcType=BIGINT},
+      </if>
+      <if test="row.name != null">
+        `name` = #{row.name,jdbcType=VARCHAR},
+      </if>
+      <if test="row.code != null">
+        code = #{row.code,jdbcType=VARCHAR},
+      </if>
+      <if test="row.createdAt != null">
+        created_at = #{row.createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="row.updatedAt != null">
+        updated_at = #{row.updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="row.latestVersionId != null">
+        latest_version_id = #{row.latestVersionId,jdbcType=INTEGER},
+      </if>
+      <if test="row.maxTrailDays != null">
+        max_trail_days = #{row.maxTrailDays,jdbcType=DOUBLE},
+      </if>
+    </set>
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update apps
+    set id = #{row.id,jdbcType=BIGINT},
+      `name` = #{row.name,jdbcType=VARCHAR},
+      code = #{row.code,jdbcType=VARCHAR},
+      created_at = #{row.createdAt,jdbcType=TIMESTAMP},
+      updated_at = #{row.updatedAt,jdbcType=TIMESTAMP},
+      latest_version_id = #{row.latestVersionId,jdbcType=INTEGER},
+      max_trail_days = #{row.maxTrailDays,jdbcType=DOUBLE}
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="cn.kdan.pdf.tech.core.model.Apps">
+    update apps
+    <set>
+      <if test="name != null">
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="code != null">
+        code = #{code,jdbcType=VARCHAR},
+      </if>
+      <if test="createdAt != null">
+        created_at = #{createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updatedAt != null">
+        updated_at = #{updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="latestVersionId != null">
+        latest_version_id = #{latestVersionId,jdbcType=INTEGER},
+      </if>
+      <if test="maxTrailDays != null">
+        max_trail_days = #{maxTrailDays,jdbcType=DOUBLE},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="cn.kdan.pdf.tech.core.model.Apps">
+    update apps
+    set `name` = #{name,jdbcType=VARCHAR},
+      code = #{code,jdbcType=VARCHAR},
+      created_at = #{createdAt,jdbcType=TIMESTAMP},
+      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
+      latest_version_id = #{latestVersionId,jdbcType=INTEGER},
+      max_trail_days = #{maxTrailDays,jdbcType=DOUBLE}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <select id="selectByExampleWithRowbounds" parameterType="cn.kdan.pdf.tech.core.model.AppsExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from apps
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+</mapper>

+ 33 - 33
pdf-tech-core/src/main/resources/sqlmap/LicenseCodesMapper.xml

@@ -82,8 +82,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, member_id, subscription_id, cdkey, times, used_times, created_at, updated_at, 
-    last_remind_at, product_id, vpp_member_id, team_id, company_id, `type`, end_up_at, 
+    id, member_id, subscription_id, cdkey, times, used_times, created_at, updated_at,
+    last_remind_at, product_id, vpp_member_id, team_id, company_id, `type`, end_up_at,
     valid_flag, assigned_date, activated_date, is_vpp, sign
   </sql>
   <select id="selectByExample" parameterType="cn.kdan.pdf.tech.core.model.LicenseCodesExample" resultMap="BaseResultMap">
@@ -101,14 +101,14 @@
     </if>
   </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select 
+    select
     <include refid="Base_Column_List" />
     from license_codes
-    where id = #{id,jdbcType=OTHER}
+    where id = #{id}::uuid
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
     delete from license_codes
-    where id = #{id,jdbcType=OTHER}
+    where id = #{id}::uuid
   </delete>
   <delete id="deleteByExample" parameterType="cn.kdan.pdf.tech.core.model.LicenseCodesExample">
     delete from license_codes
@@ -117,19 +117,19 @@
     </if>
   </delete>
   <insert id="insert" parameterType="cn.kdan.pdf.tech.core.model.LicenseCodes">
-    insert into license_codes (id, member_id, subscription_id, 
-      cdkey, times, used_times, 
-      created_at, updated_at, last_remind_at, 
-      product_id, vpp_member_id, team_id, 
-      company_id, `type`, end_up_at, 
-      valid_flag, assigned_date, activated_date, 
+    insert into license_codes (id, member_id, subscription_id,
+      cdkey, times, used_times,
+      created_at, updated_at, last_remind_at,
+      product_id, vpp_member_id, team_id,
+      company_id, `type`, end_up_at,
+      valid_flag, assigned_date, activated_date,
       is_vpp, sign)
-    values (#{id,jdbcType=OTHER}, #{memberId,jdbcType=OTHER}, #{subscriptionId,jdbcType=OTHER}, 
-      #{cdkey,jdbcType=VARCHAR}, #{times,jdbcType=SMALLINT}, #{usedTimes,jdbcType=SMALLINT}, 
-      #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{lastRemindAt,jdbcType=TIMESTAMP}, 
-      #{productId,jdbcType=INTEGER}, #{vppMemberId,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR}, 
-      #{companyId,jdbcType=VARCHAR}, #{type,jdbcType=SMALLINT}, #{endUpAt,jdbcType=TIMESTAMP}, 
-      #{validFlag,jdbcType=SMALLINT}, #{assignedDate,jdbcType=TIMESTAMP}, #{activatedDate,jdbcType=TIMESTAMP}, 
+    values (#{id}::uuid, #{memberId}::uuid, #{subscriptionId}::uuid,
+      #{cdkey,jdbcType=VARCHAR}, #{times,jdbcType=SMALLINT}, #{usedTimes,jdbcType=SMALLINT},
+      #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{lastRemindAt,jdbcType=TIMESTAMP},
+      #{productId,jdbcType=INTEGER}, #{vppMemberId,jdbcType=VARCHAR}, #{teamId,jdbcType=VARCHAR},
+      #{companyId,jdbcType=VARCHAR}, #{type,jdbcType=SMALLINT}, #{endUpAt,jdbcType=TIMESTAMP},
+      #{validFlag,jdbcType=SMALLINT}, #{assignedDate,jdbcType=TIMESTAMP}, #{activatedDate,jdbcType=TIMESTAMP},
       #{isVpp,jdbcType=SMALLINT}, #{sign,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="cn.kdan.pdf.tech.core.model.LicenseCodes">
@@ -198,13 +198,13 @@
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
-        #{id,jdbcType=OTHER},
+        #{id}::uuid,
       </if>
       <if test="memberId != null">
-        #{memberId,jdbcType=OTHER},
+        #{memberId}::uuid,
       </if>
       <if test="subscriptionId != null">
-        #{subscriptionId,jdbcType=OTHER},
+        #{subscriptionId}::uuid,
       </if>
       <if test="cdkey != null">
         #{cdkey,jdbcType=VARCHAR},
@@ -269,13 +269,13 @@
     update license_codes
     <set>
       <if test="row.id != null">
-        id = #{row.id,jdbcType=OTHER},
+        id = #{row.id}::uuid,
       </if>
       <if test="row.memberId != null">
-        member_id = #{row.memberId,jdbcType=OTHER},
+        member_id = #{row.memberId}::uuid,
       </if>
       <if test="row.subscriptionId != null">
-        subscription_id = #{row.subscriptionId,jdbcType=OTHER},
+        subscription_id = #{row.subscriptionId}::uuid,
       </if>
       <if test="row.cdkey != null">
         cdkey = #{row.cdkey,jdbcType=VARCHAR},
@@ -335,9 +335,9 @@
   </update>
   <update id="updateByExample" parameterType="map">
     update license_codes
-    set id = #{row.id,jdbcType=OTHER},
-      member_id = #{row.memberId,jdbcType=OTHER},
-      subscription_id = #{row.subscriptionId,jdbcType=OTHER},
+    set id = #{row.id}::uuid,
+      member_id = #{row.memberId}::uuid,
+      subscription_id = #{row.subscriptionId}::uuid,
       cdkey = #{row.cdkey,jdbcType=VARCHAR},
       times = #{row.times,jdbcType=SMALLINT},
       used_times = #{row.usedTimes,jdbcType=SMALLINT},
@@ -363,10 +363,10 @@
     update license_codes
     <set>
       <if test="memberId != null">
-        member_id = #{memberId,jdbcType=OTHER},
+        member_id = #{memberId}::uuid,
       </if>
       <if test="subscriptionId != null">
-        subscription_id = #{subscriptionId,jdbcType=OTHER},
+        subscription_id = #{subscriptionId}::uuid,
       </if>
       <if test="cdkey != null">
         cdkey = #{cdkey,jdbcType=VARCHAR},
@@ -420,12 +420,12 @@
         sign = #{sign,jdbcType=VARCHAR},
       </if>
     </set>
-    where id = #{id,jdbcType=OTHER}
+    where id = #{id}::uuid
   </update>
   <update id="updateByPrimaryKey" parameterType="cn.kdan.pdf.tech.core.model.LicenseCodes">
     update license_codes
-    set member_id = #{memberId,jdbcType=OTHER},
-      subscription_id = #{subscriptionId,jdbcType=OTHER},
+    set member_id = #{memberId}::uuid,
+      subscription_id = #{subscriptionId}::uuid,
       cdkey = #{cdkey,jdbcType=VARCHAR},
       times = #{times,jdbcType=SMALLINT},
       used_times = #{usedTimes,jdbcType=SMALLINT},
@@ -443,7 +443,7 @@
       activated_date = #{activatedDate,jdbcType=TIMESTAMP},
       is_vpp = #{isVpp,jdbcType=SMALLINT},
       sign = #{sign,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=OTHER}
+    where id = #{id}::uuid
   </update>
   <select id="selectByExampleWithRowbounds" parameterType="cn.kdan.pdf.tech.core.model.LicenseCodesExample" resultMap="BaseResultMap">
     select
@@ -459,4 +459,4 @@
       order by ${orderByClause}
     </if>
   </select>
-</mapper>
+</mapper>

+ 26 - 0
pdf-tech-core/src/main/resources/sqlmap/ext/ExtVppLicenseCodeMapper.xml

@@ -157,4 +157,30 @@
                 #{item}::uuid
         </foreach>
     </select>
+    <select id="listByValidFlag" resultMap="ResultMap">
+        select id,
+        member_id,
+        subscription_id,
+        cdkey,
+        times,
+        used_times,
+        created_at,
+        updated_at,
+        last_remind_at,
+        product_id,
+        vpp_member_id,
+        team_id,
+        company_id,
+        type,
+        end_up_at,
+        valid_flag,
+        assigned_date,
+        activated_date,
+        is_vpp
+        from license_codes
+        WHERE valid_flag not in
+        <foreach item="item" index="index" collection="flags" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </select>
 </mapper>