浏览代码

全部模块:登录设备信息保存

tangxiangan 2 年之前
父节点
当前提交
227418aa4a
共有 24 个文件被更改,包括 2344 次插入223 次删除
  1. 6 0
      pdf-office-account/pom.xml
  2. 47 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/controller/UserController.java
  3. 25 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/mapper/LoginDeviceMapper.java
  4. 33 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/mapper/VppCompanyMapper.java
  5. 29 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/mapper/ext/ExtUserMapper.java
  6. 162 90
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/User.java
  7. 184 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/VppCompany.java
  8. 756 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/VppCompanyExample.java
  9. 14 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/CompanyService.java
  10. 49 1
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/UserService.java
  11. 25 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/impl/CompanyServiceImpl.java
  12. 68 2
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/impl/UserServiceImpl.java
  13. 17 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/vo/UserDetailVO.java
  14. 33 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/vo/UserPageVO.java
  15. 11 2
      pdf-office-account/src/main/resources/generatorConfig.xml
  16. 284 0
      pdf-office-account/src/main/resources/sqlmap/LoginDeviceMapper.xml
  17. 160 97
      pdf-office-account/src/main/resources/sqlmap/UserMapper.xml
  18. 272 0
      pdf-office-account/src/main/resources/sqlmap/VppCompanyMapper.xml
  19. 134 27
      pdf-office-account/src/main/resources/sqlmap/ext/ExtUserMapper.xml
  20. 0 4
      pdf-office-sso/pom.xml
  21. 2 0
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/constant/AuthConstant.java
  22. 5 0
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/controller/AuthController.java
  23. 8 0
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/service/AuthService.java
  24. 20 0
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/service/impl/AuthServiceImpl.java

+ 6 - 0
pdf-office-account/pom.xml

@@ -18,6 +18,12 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
+        <dependency>
+            <groupId>cn.kdan.pdf.office</groupId>
+            <artifactId>pdf-office-api-account</artifactId>
+            <version>0.0.1</version>
+            <scope>compile</scope>
+        </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-aspects</artifactId>

+ 47 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/controller/UserController.java

@@ -1,5 +1,7 @@
 package cn.kdan.cloud.pdf.office.account.controller;
 
+import cn.kdan.cloud.pdf.office.account.vo.UserDetailVO;
+import cn.kdan.cloud.pdf.office.account.vo.UserPageVO;
 import cn.kdan.cloud.pdf.office.common.constant.CommonConstant;
 import cn.kdan.cloud.pdf.office.common.dto.UserRegisterDTO;
 import cn.kdan.cloud.pdf.office.common.pojo.ResultMap;
@@ -8,9 +10,13 @@ import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
 import cn.kdan.cloud.pdf.office.account.constant.UserConstant;
 import cn.kdan.cloud.pdf.office.account.service.UserService;
 
+import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
+import java.util.List;
+
 @RestController
 @RequestMapping("user")
 public class UserController {
@@ -59,5 +65,46 @@ public class UserController {
         return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS,Boolean.TRUE);
     }
 
+    /**
+     * 分页查询
+     *
+     * @param selectType 筛选类型 正选1 反选2
+     * @param appIds 产品id
+     * @param roles 账号身份
+     * @param accountTypes 账号类型
+     * @param accountSources 账号来源
+     * @param payTypes 付费类型
+     * @param queryTimeType 查询时间类型 1 创建时间 2更新时间
+     * @param startTime 开始时间
+     * @param endTime 结束时间
+     * @param queryString 查询string id或者邮箱
+     * @return PageInfo
+     */
+    @GetMapping("/page")
+    public ResultMap<PageInfo<UserPageVO>> page(  @RequestParam(required = false, defaultValue = "1") Integer page,
+                                                  @RequestParam(required = false, defaultValue = "10") Integer pageSize,
+                                                  @RequestParam(required = false) String selectType,
+                                                  @RequestParam(required = false)  List<String> appIds,
+                                                  @RequestParam(required = false)  List<String> roles,
+                                                  @RequestParam(required = false)  List<String> accountTypes,
+                                                  @RequestParam(required = false)  List<String> accountSources,
+                                                  @RequestParam(required = false)  List<String> payTypes,
+                                                  @RequestParam(required = false)  String queryTimeType,
+                                                  @RequestParam(required = false)  Date startTime,
+                                                  @RequestParam(required = false)  Date endTime,
+                                                  @RequestParam(required = false)  List<String> queryString) {
+        return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS,userService.page(page,pageSize,selectType,appIds,roles,accountTypes,accountSources,payTypes,queryTimeType,startTime,endTime,queryString));
+    }
+
+    /**
+     * 运营后台查看账号详情
+     *
+     * @param userId 用户id
+     * @return ResultMap
+     */
+    public ResultMap<UserDetailVO> detail(@RequestParam String userId) {
+        return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS,userService.detail(userId));
+    }
+
 
 }

+ 25 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/mapper/LoginDeviceMapper.java

@@ -0,0 +1,25 @@
+package cn.kdan.cloud.pdf.office.account.mapper;
+
+import cn.kdan.cloud.pdf.office.account.model.LoginDevice;
+import cn.kdan.cloud.pdf.office.account.model.LoginDeviceExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.session.RowBounds;
+
+public interface LoginDeviceMapper {
+    long countByExample(LoginDeviceExample example);
+
+    int deleteByExample(LoginDeviceExample example);
+
+    int insert(LoginDevice record);
+
+    int insertSelective(LoginDevice record);
+
+    List<LoginDevice> selectByExampleWithRowbounds(LoginDeviceExample example, RowBounds rowBounds);
+
+    List<LoginDevice> selectByExample(LoginDeviceExample example);
+
+    int updateByExampleSelective(@Param("record") LoginDevice record, @Param("example") LoginDeviceExample example);
+
+    int updateByExample(@Param("record") LoginDevice record, @Param("example") LoginDeviceExample example);
+}

+ 33 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/mapper/VppCompanyMapper.java

@@ -0,0 +1,33 @@
+package cn.kdan.cloud.pdf.office.account.mapper;
+
+import cn.kdan.cloud.pdf.office.account.model.VppCompany;
+import cn.kdan.cloud.pdf.office.account.model.VppCompanyExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.session.RowBounds;
+
+public interface VppCompanyMapper {
+    long countByExample(VppCompanyExample example);
+
+    int deleteByExample(VppCompanyExample example);
+
+    int deleteByPrimaryKey(String id);
+
+    int insert(VppCompany record);
+
+    int insertSelective(VppCompany record);
+
+    List<VppCompany> selectByExampleWithRowbounds(VppCompanyExample example, RowBounds rowBounds);
+
+    List<VppCompany> selectByExample(VppCompanyExample example);
+
+    VppCompany selectByPrimaryKey(String id);
+
+    int updateByExampleSelective(@Param("record") VppCompany record, @Param("example") VppCompanyExample example);
+
+    int updateByExample(@Param("record") VppCompany record, @Param("example") VppCompanyExample example);
+
+    int updateByPrimaryKeySelective(VppCompany record);
+
+    int updateByPrimaryKey(VppCompany record);
+}

+ 29 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/mapper/ext/ExtUserMapper.java

@@ -2,8 +2,10 @@ package cn.kdan.cloud.pdf.office.account.mapper.ext;
 
 import cn.kdan.cloud.pdf.office.account.mapper.UserMapper;
 import cn.kdan.cloud.pdf.office.account.model.User;
+import cn.kdan.cloud.pdf.office.account.vo.UserPageVO;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 public interface ExtUserMapper  extends UserMapper {
@@ -14,4 +16,31 @@ public interface ExtUserMapper  extends UserMapper {
      * @return User
      */
     List<User> getByAccount(@Param("account") String account,@Param("appId") String appId,@Param("platformType") String platformType);
+
+    /**
+     * 分页查询
+     *
+     * @param selectType 筛选类型 正选1 反选2
+     * @param appIds 产品id
+     * @param roles 账号身份
+     * @param accountTypes 账号类型
+     * @param accountSources 账号来源
+     * @param payTypes 付费类型
+     * @param queryTimeType 查询时间类型 1 创建时间 2更新时间
+     * @param startTime 开始时间
+     * @param endTime 结束时间
+     * @param queryString 查询string id或者邮箱
+     * @return
+     */
+    List<UserPageVO> listWithInfo( @Param("selectType") String selectType,
+                                   @Param("appIds") List<String> appIds,
+                                   @Param("roles") List<String> roles,
+                                   @Param("accountTypes") List<String> accountTypes,
+                                   @Param("accountSources") List<String> accountSources,
+                                   @Param("payTypes") List<String> payTypes,
+                                   @Param("queryTimeType") String queryTimeType,
+                                   @Param("startTime") Date startTime,
+                                   @Param("endTime") Date endTime,
+                                   @Param("queryString") List<String> queryString);
+
 }

+ 162 - 90
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/User.java

@@ -6,28 +6,24 @@ import java.util.Date;
 public class User implements Serializable {
     private String id;
 
+    private String companyId;
+
+    private String appId;
+
     private String email;
 
     private String fullName;
 
     private Integer subscriberType;
 
-    private Date createdAt;
-
-    private Date updatedAt;
-
     private Integer subscribed;
 
     private String digestPassword;
 
     private String phone;
 
-    private String validFlag;
-
     private String industry;
 
-    private String companyId;
-
     private Integer lastPopularizeAt;
 
     private Date lastPresentedCouponAt;
@@ -42,9 +38,21 @@ public class User implements Serializable {
 
     private String area;
 
-    private String appId;
+    private Integer platformType;
 
-    private String platformType;
+    private Integer accountType;
+
+    private Integer accountSource;
+
+    private Integer payType;
+
+    private Date createdAt;
+
+    private Date updatedAt;
+
+    private Integer memberType;
+
+    private String validFlag;
 
     private static final long serialVersionUID = 1L;
 
@@ -61,6 +69,32 @@ public class User implements Serializable {
         this.id = id;
     }
 
+    public String getCompanyId() {
+        return companyId;
+    }
+
+    public User withCompanyId(String companyId) {
+        this.setCompanyId(companyId);
+        return this;
+    }
+
+    public void setCompanyId(String companyId) {
+        this.companyId = companyId;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public User withAppId(String appId) {
+        this.setAppId(appId);
+        return this;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
     public String getEmail() {
         return email;
     }
@@ -100,32 +134,6 @@ public class User implements Serializable {
         this.subscriberType = subscriberType;
     }
 
-    public Date getCreatedAt() {
-        return createdAt;
-    }
-
-    public User withCreatedAt(Date createdAt) {
-        this.setCreatedAt(createdAt);
-        return this;
-    }
-
-    public void setCreatedAt(Date createdAt) {
-        this.createdAt = createdAt;
-    }
-
-    public Date getUpdatedAt() {
-        return updatedAt;
-    }
-
-    public User withUpdatedAt(Date updatedAt) {
-        this.setUpdatedAt(updatedAt);
-        return this;
-    }
-
-    public void setUpdatedAt(Date updatedAt) {
-        this.updatedAt = updatedAt;
-    }
-
     public Integer getSubscribed() {
         return subscribed;
     }
@@ -165,19 +173,6 @@ public class User implements Serializable {
         this.phone = phone;
     }
 
-    public String getValidFlag() {
-        return validFlag;
-    }
-
-    public User withValidFlag(String validFlag) {
-        this.setValidFlag(validFlag);
-        return this;
-    }
-
-    public void setValidFlag(String validFlag) {
-        this.validFlag = validFlag;
-    }
-
     public String getIndustry() {
         return industry;
     }
@@ -191,19 +186,6 @@ public class User implements Serializable {
         this.industry = industry;
     }
 
-    public String getCompanyId() {
-        return companyId;
-    }
-
-    public User withCompanyId(String companyId) {
-        this.setCompanyId(companyId);
-        return this;
-    }
-
-    public void setCompanyId(String companyId) {
-        this.companyId = companyId;
-    }
-
     public Integer getLastPopularizeAt() {
         return lastPopularizeAt;
     }
@@ -295,30 +277,108 @@ public class User implements Serializable {
         this.area = area;
     }
 
-    public String getAppId() {
-        return appId;
+    public Integer getPlatformType() {
+        return platformType;
     }
 
-    public User withAppId(String appId) {
-        this.setAppId(appId);
+    public User withPlatformType(Integer platformType) {
+        this.setPlatformType(platformType);
         return this;
     }
 
-    public void setAppId(String appId) {
-        this.appId = appId;
+    public void setPlatformType(Integer platformType) {
+        this.platformType = platformType;
     }
 
-    public String getPlatformType() {
-        return platformType;
+    public Integer getAccountType() {
+        return accountType;
     }
 
-    public User withPlatformType(String platformType) {
-        this.setPlatformType(platformType);
+    public User withAccountType(Integer accountType) {
+        this.setAccountType(accountType);
         return this;
     }
 
-    public void setPlatformType(String platformType) {
-        this.platformType = platformType;
+    public void setAccountType(Integer accountType) {
+        this.accountType = accountType;
+    }
+
+    public Integer getAccountSource() {
+        return accountSource;
+    }
+
+    public User withAccountSource(Integer accountSource) {
+        this.setAccountSource(accountSource);
+        return this;
+    }
+
+    public void setAccountSource(Integer accountSource) {
+        this.accountSource = accountSource;
+    }
+
+    public Integer getPayType() {
+        return payType;
+    }
+
+    public User withPayType(Integer payType) {
+        this.setPayType(payType);
+        return this;
+    }
+
+    public void setPayType(Integer payType) {
+        this.payType = payType;
+    }
+
+    public Date getCreatedAt() {
+        return createdAt;
+    }
+
+    public User withCreatedAt(Date createdAt) {
+        this.setCreatedAt(createdAt);
+        return this;
+    }
+
+    public void setCreatedAt(Date createdAt) {
+        this.createdAt = createdAt;
+    }
+
+    public Date getUpdatedAt() {
+        return updatedAt;
+    }
+
+    public User withUpdatedAt(Date updatedAt) {
+        this.setUpdatedAt(updatedAt);
+        return this;
+    }
+
+    public void setUpdatedAt(Date updatedAt) {
+        this.updatedAt = updatedAt;
+    }
+
+    public Integer getMemberType() {
+        return memberType;
+    }
+
+    public User withMemberType(Integer memberType) {
+        this.setMemberType(memberType);
+        return this;
+    }
+
+    public void setMemberType(Integer memberType) {
+        this.memberType = memberType;
+    }
+
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public User withValidFlag(String validFlag) {
+        this.setValidFlag(validFlag);
+        return this;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
     }
 
     @Override
@@ -334,17 +394,15 @@ public class User implements Serializable {
         }
         User other = (User) that;
         return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
+            && (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId()))
             && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
             && (this.getFullName() == null ? other.getFullName() == null : this.getFullName().equals(other.getFullName()))
             && (this.getSubscriberType() == null ? other.getSubscriberType() == null : this.getSubscriberType().equals(other.getSubscriberType()))
-            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
-            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
             && (this.getSubscribed() == null ? other.getSubscribed() == null : this.getSubscribed().equals(other.getSubscribed()))
             && (this.getDigestPassword() == null ? other.getDigestPassword() == null : this.getDigestPassword().equals(other.getDigestPassword()))
             && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
-            && (this.getValidFlag() == null ? other.getValidFlag() == null : this.getValidFlag().equals(other.getValidFlag()))
             && (this.getIndustry() == null ? other.getIndustry() == null : this.getIndustry().equals(other.getIndustry()))
-            && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
             && (this.getLastPopularizeAt() == null ? other.getLastPopularizeAt() == null : this.getLastPopularizeAt().equals(other.getLastPopularizeAt()))
             && (this.getLastPresentedCouponAt() == null ? other.getLastPresentedCouponAt() == null : this.getLastPresentedCouponAt().equals(other.getLastPresentedCouponAt()))
             && (this.getMailable() == null ? other.getMailable() == null : this.getMailable().equals(other.getMailable()))
@@ -352,8 +410,14 @@ public class User implements Serializable {
             && (this.getRole() == null ? other.getRole() == null : this.getRole().equals(other.getRole()))
             && (this.getJob() == null ? other.getJob() == null : this.getJob().equals(other.getJob()))
             && (this.getArea() == null ? other.getArea() == null : this.getArea().equals(other.getArea()))
-            && (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId()))
-            && (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType()));
+            && (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType()))
+            && (this.getAccountType() == null ? other.getAccountType() == null : this.getAccountType().equals(other.getAccountType()))
+            && (this.getAccountSource() == null ? other.getAccountSource() == null : this.getAccountSource().equals(other.getAccountSource()))
+            && (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType()))
+            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
+            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
+            && (this.getMemberType() == null ? other.getMemberType() == null : this.getMemberType().equals(other.getMemberType()))
+            && (this.getValidFlag() == null ? other.getValidFlag() == null : this.getValidFlag().equals(other.getValidFlag()));
     }
 
     @Override
@@ -361,17 +425,15 @@ public class User implements Serializable {
         final int prime = 31;
         int result = 1;
         result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
+        result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode());
         result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
         result = prime * result + ((getFullName() == null) ? 0 : getFullName().hashCode());
         result = prime * result + ((getSubscriberType() == null) ? 0 : getSubscriberType().hashCode());
-        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
-        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
         result = prime * result + ((getSubscribed() == null) ? 0 : getSubscribed().hashCode());
         result = prime * result + ((getDigestPassword() == null) ? 0 : getDigestPassword().hashCode());
         result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
-        result = prime * result + ((getValidFlag() == null) ? 0 : getValidFlag().hashCode());
         result = prime * result + ((getIndustry() == null) ? 0 : getIndustry().hashCode());
-        result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
         result = prime * result + ((getLastPopularizeAt() == null) ? 0 : getLastPopularizeAt().hashCode());
         result = prime * result + ((getLastPresentedCouponAt() == null) ? 0 : getLastPresentedCouponAt().hashCode());
         result = prime * result + ((getMailable() == null) ? 0 : getMailable().hashCode());
@@ -379,8 +441,14 @@ public class User implements Serializable {
         result = prime * result + ((getRole() == null) ? 0 : getRole().hashCode());
         result = prime * result + ((getJob() == null) ? 0 : getJob().hashCode());
         result = prime * result + ((getArea() == null) ? 0 : getArea().hashCode());
-        result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode());
         result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode());
+        result = prime * result + ((getAccountType() == null) ? 0 : getAccountType().hashCode());
+        result = prime * result + ((getAccountSource() == null) ? 0 : getAccountSource().hashCode());
+        result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode());
+        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
+        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
+        result = prime * result + ((getMemberType() == null) ? 0 : getMemberType().hashCode());
+        result = prime * result + ((getValidFlag() == null) ? 0 : getValidFlag().hashCode());
         return result;
     }
 
@@ -391,17 +459,15 @@ public class User implements Serializable {
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
+        sb.append(", companyId=").append(companyId);
+        sb.append(", appId=").append(appId);
         sb.append(", email=").append(email);
         sb.append(", fullName=").append(fullName);
         sb.append(", subscriberType=").append(subscriberType);
-        sb.append(", createdAt=").append(createdAt);
-        sb.append(", updatedAt=").append(updatedAt);
         sb.append(", subscribed=").append(subscribed);
         sb.append(", digestPassword=").append(digestPassword);
         sb.append(", phone=").append(phone);
-        sb.append(", validFlag=").append(validFlag);
         sb.append(", industry=").append(industry);
-        sb.append(", companyId=").append(companyId);
         sb.append(", lastPopularizeAt=").append(lastPopularizeAt);
         sb.append(", lastPresentedCouponAt=").append(lastPresentedCouponAt);
         sb.append(", mailable=").append(mailable);
@@ -409,8 +475,14 @@ public class User implements Serializable {
         sb.append(", role=").append(role);
         sb.append(", job=").append(job);
         sb.append(", area=").append(area);
-        sb.append(", appId=").append(appId);
         sb.append(", platformType=").append(platformType);
+        sb.append(", accountType=").append(accountType);
+        sb.append(", accountSource=").append(accountSource);
+        sb.append(", payType=").append(payType);
+        sb.append(", createdAt=").append(createdAt);
+        sb.append(", updatedAt=").append(updatedAt);
+        sb.append(", memberType=").append(memberType);
+        sb.append(", validFlag=").append(validFlag);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 184 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/VppCompany.java

@@ -0,0 +1,184 @@
+package cn.kdan.cloud.pdf.office.account.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class VppCompany implements Serializable {
+    private String id;
+
+    private String name;
+
+    private String description;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    private String validFlag;
+
+    private Byte status;
+
+    private String industry;
+
+    private static final long serialVersionUID = 1L;
+
+    public String getId() {
+        return id;
+    }
+
+    public VppCompany withId(String id) {
+        this.setId(id);
+        return this;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public VppCompany withName(String name) {
+        this.setName(name);
+        return this;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public VppCompany withDescription(String description) {
+        this.setDescription(description);
+        return this;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public VppCompany withCreateTime(Date createTime) {
+        this.setCreateTime(createTime);
+        return this;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public VppCompany withUpdateTime(Date updateTime) {
+        this.setUpdateTime(updateTime);
+        return this;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public VppCompany withValidFlag(String validFlag) {
+        this.setValidFlag(validFlag);
+        return this;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
+    }
+
+    public Byte getStatus() {
+        return status;
+    }
+
+    public VppCompany withStatus(Byte status) {
+        this.setStatus(status);
+        return this;
+    }
+
+    public void setStatus(Byte status) {
+        this.status = status;
+    }
+
+    public String getIndustry() {
+        return industry;
+    }
+
+    public VppCompany withIndustry(String industry) {
+        this.setIndustry(industry);
+        return this;
+    }
+
+    public void setIndustry(String industry) {
+        this.industry = industry;
+    }
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        VppCompany other = (VppCompany) 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.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
+            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
+            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
+            && (this.getValidFlag() == null ? other.getValidFlag() == null : this.getValidFlag().equals(other.getValidFlag()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
+            && (this.getIndustry() == null ? other.getIndustry() == null : this.getIndustry().equals(other.getIndustry()));
+    }
+
+    @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 + ((getDescription() == null) ? 0 : getDescription().hashCode());
+        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
+        result = prime * result + ((getValidFlag() == null) ? 0 : getValidFlag().hashCode());
+        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
+        result = prime * result + ((getIndustry() == null) ? 0 : getIndustry().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(", description=").append(description);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", validFlag=").append(validFlag);
+        sb.append(", status=").append(status);
+        sb.append(", industry=").append(industry);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 756 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/VppCompanyExample.java

@@ -0,0 +1,756 @@
+package cn.kdan.cloud.pdf.office.account.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class VppCompanyExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public VppCompanyExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    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<Criterion>();
+        }
+
+        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(String value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(String value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(String value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(String value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(String value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(String value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLike(String value) {
+            addCriterion("id like", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotLike(String value) {
+            addCriterion("id not like", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<String> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<String> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(String value1, String value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(String value1, String 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 andDescriptionIsNull() {
+            addCriterion("description is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionIsNotNull() {
+            addCriterion("description is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionEqualTo(String value) {
+            addCriterion("description =", value, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionNotEqualTo(String value) {
+            addCriterion("description <>", value, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionGreaterThan(String value) {
+            addCriterion("description >", value, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
+            addCriterion("description >=", value, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionLessThan(String value) {
+            addCriterion("description <", value, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionLessThanOrEqualTo(String value) {
+            addCriterion("description <=", value, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionLike(String value) {
+            addCriterion("description like", value, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionNotLike(String value) {
+            addCriterion("description not like", value, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionIn(List<String> values) {
+            addCriterion("description in", values, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionNotIn(List<String> values) {
+            addCriterion("description not in", values, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionBetween(String value1, String value2) {
+            addCriterion("description between", value1, value2, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionNotBetween(String value1, String value2) {
+            addCriterion("description not between", value1, value2, "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("update_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("update_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("update_time =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("update_time <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("update_time >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("update_time >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("update_time <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("update_time <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("update_time in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("update_time not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("update_time between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("update_time not between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagIsNull() {
+            addCriterion("valid_flag is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagIsNotNull() {
+            addCriterion("valid_flag is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagEqualTo(String value) {
+            addCriterion("valid_flag =", value, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagNotEqualTo(String value) {
+            addCriterion("valid_flag <>", value, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagGreaterThan(String value) {
+            addCriterion("valid_flag >", value, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagGreaterThanOrEqualTo(String value) {
+            addCriterion("valid_flag >=", value, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagLessThan(String value) {
+            addCriterion("valid_flag <", value, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagLessThanOrEqualTo(String value) {
+            addCriterion("valid_flag <=", value, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagLike(String value) {
+            addCriterion("valid_flag like", value, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagNotLike(String value) {
+            addCriterion("valid_flag not like", value, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagIn(List<String> values) {
+            addCriterion("valid_flag in", values, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagNotIn(List<String> values) {
+            addCriterion("valid_flag not in", values, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagBetween(String value1, String value2) {
+            addCriterion("valid_flag between", value1, value2, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagNotBetween(String value1, String value2) {
+            addCriterion("valid_flag not between", value1, value2, "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNull() {
+            addCriterion("`status` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("`status` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(Byte value) {
+            addCriterion("`status` =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Byte value) {
+            addCriterion("`status` <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Byte value) {
+            addCriterion("`status` >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Byte value) {
+            addCriterion("`status` >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Byte value) {
+            addCriterion("`status` <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Byte value) {
+            addCriterion("`status` <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Byte> values) {
+            addCriterion("`status` in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Byte> values) {
+            addCriterion("`status` not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Byte value1, Byte value2) {
+            addCriterion("`status` between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Byte value1, Byte value2) {
+            addCriterion("`status` not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryIsNull() {
+            addCriterion("industry is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryIsNotNull() {
+            addCriterion("industry is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryEqualTo(String value) {
+            addCriterion("industry =", value, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryNotEqualTo(String value) {
+            addCriterion("industry <>", value, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryGreaterThan(String value) {
+            addCriterion("industry >", value, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryGreaterThanOrEqualTo(String value) {
+            addCriterion("industry >=", value, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryLessThan(String value) {
+            addCriterion("industry <", value, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryLessThanOrEqualTo(String value) {
+            addCriterion("industry <=", value, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryLike(String value) {
+            addCriterion("industry like", value, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryNotLike(String value) {
+            addCriterion("industry not like", value, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryIn(List<String> values) {
+            addCriterion("industry in", values, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryNotIn(List<String> values) {
+            addCriterion("industry not in", values, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryBetween(String value1, String value2) {
+            addCriterion("industry between", value1, value2, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryNotBetween(String value1, String value2) {
+            addCriterion("industry not between", value1, value2, "industry");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLikeInsensitive(String value) {
+            addCriterion("upper(id) like", value.toUpperCase(), "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameLikeInsensitive(String value) {
+            addCriterion("upper(`name`) like", value.toUpperCase(), "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andDescriptionLikeInsensitive(String value) {
+            addCriterion("upper(description) like", value.toUpperCase(), "description");
+            return (Criteria) this;
+        }
+
+        public Criteria andValidFlagLikeInsensitive(String value) {
+            addCriterion("upper(valid_flag) like", value.toUpperCase(), "validFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndustryLikeInsensitive(String value) {
+            addCriterion("upper(industry) like", value.toUpperCase(), "industry");
+            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);
+        }
+    }
+}

+ 14 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/CompanyService.java

@@ -0,0 +1,14 @@
+package cn.kdan.cloud.pdf.office.account.service;
+
+import cn.kdan.cloud.pdf.office.account.model.LoginDevice;
+import cn.kdan.cloud.pdf.office.account.model.VppCompany;
+
+import java.util.List;
+
+/**
+ * 公司服务
+ * @author tangxiangan
+ */
+public interface CompanyService {
+    VppCompany getById(String id);
+}

+ 49 - 1
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/UserService.java

@@ -1,5 +1,7 @@
 package cn.kdan.cloud.pdf.office.account.service;
 
+import cn.kdan.cloud.pdf.office.account.vo.UserDetailVO;
+import cn.kdan.cloud.pdf.office.account.vo.UserPageVO;
 import cn.kdan.cloud.pdf.office.common.dto.UserRegisterDTO;
 import cn.kdan.cloud.pdf.office.common.utils.BeanConverter;
 import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
@@ -7,6 +9,7 @@ import com.github.pagehelper.PageInfo;
 import cn.kdan.cloud.pdf.office.account.model.User;
 
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -17,12 +20,57 @@ public interface UserService {
 
     UserInfoVO getById(String userId);
 
+    /**
+     * 分页查询
+     *
+     * @param selectType 筛选类型 正选1 反选2
+     * @param appIds 产品id
+     * @param roles 账号身份
+     * @param accountTypes 账号类型
+     * @param accountSources 账号来源
+     * @param payTypes 付费类型
+     * @param queryTimeType 查询时间类型 1 创建时间 2更新时间
+     * @param startTime 开始时间
+     * @param endTime 结束时间
+     * @param queryString 查询string id或者邮箱
+     * @return PageInfo
+     */
+    PageInfo<UserPageVO> page(Integer page, Integer pageSize,
+                              String selectType,
+                              List<String> appIds,
+                              List<String> roles,
+                              List<String> accountTypes,
+                              List<String> accountSources,
+                              List<String> payTypes,
+                              String queryTimeType,
+                              Date startTime,
+                              Date endTime,
+                              List<String> queryString);
 
     UserInfoVO getByAccount(String account);
 
+    /**
+     * 登录时查询
+     * @param account
+     * @param appId
+     * @param platformType
+     * @return
+     */
     UserInfoVO getByAppAccount(String account, String appId, String platformType);
 
-    UserInfoVO detail(User user);
 
+    /**
+     * 运营后台获取账号详情
+     *
+     * @param userId 用户id
+     * @return UserDetailVO
+     */
+    UserDetailVO detail(String userId);
+
+    /**
+     * 注册用户
+     *
+     * @param userRegisterDTO
+     */
     void register(UserRegisterDTO userRegisterDTO);
 }

+ 25 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/impl/CompanyServiceImpl.java

@@ -0,0 +1,25 @@
+package cn.kdan.cloud.pdf.office.account.service.impl;
+
+import cn.kdan.cloud.pdf.office.account.mapper.VppCompanyMapper;
+import cn.kdan.cloud.pdf.office.account.model.VppCompany;
+import cn.kdan.cloud.pdf.office.account.service.CompanyService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @author tangxiangan
+ */
+@Service
+public class CompanyServiceImpl implements CompanyService {
+
+    @Resource
+    private VppCompanyMapper vppCompanyMapper;
+
+    @Override
+    public VppCompany getById(String id) {
+        return vppCompanyMapper.selectByPrimaryKey(id);
+    }
+
+
+}

+ 68 - 2
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/impl/UserServiceImpl.java

@@ -2,16 +2,23 @@ package cn.kdan.cloud.pdf.office.account.service.impl;
 
 import cn.kdan.cloud.pdf.office.account.constant.UserConstant;
 import cn.kdan.cloud.pdf.office.account.model.*;
+import cn.kdan.cloud.pdf.office.account.service.CompanyService;
 import cn.kdan.cloud.pdf.office.account.service.UserService;
+import cn.kdan.cloud.pdf.office.account.vo.UserDetailVO;
+import cn.kdan.cloud.pdf.office.account.vo.UserPageVO;
 import cn.kdan.cloud.pdf.office.common.constant.CommonConstant;
 import cn.kdan.cloud.pdf.office.common.dto.UserRegisterDTO;
 import cn.kdan.cloud.pdf.office.common.enums.EmailCodeTypeEnum;
 import cn.kdan.cloud.pdf.office.common.enums.ValidStatusEnum;
+import cn.kdan.cloud.pdf.office.common.enums.account.AccountTypeEnum;
+import cn.kdan.cloud.pdf.office.common.enums.account.PDFOfficeUserStatusEnum;
 import cn.kdan.cloud.pdf.office.common.exception.BackendRuntimeException;
 import cn.kdan.cloud.pdf.office.common.utils.CommonUtils;
 import cn.kdan.cloud.pdf.office.common.utils.RedisUtils;
 import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
 import cn.kdan.cloud.pdf.office.account.mapper.ext.ExtUserMapper;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +34,8 @@ public class UserServiceImpl implements UserService {
 
     @Autowired
     private ExtUserMapper userMapper;
+    @Autowired
+    private CompanyService companyService;
 
     @Autowired
     private RedisUtils<String, Object> redisUtils;
@@ -37,6 +46,24 @@ public class UserServiceImpl implements UserService {
         return convert(userMapper.selectByPrimaryKey(userId));
     }
 
+    @Override
+    public PageInfo<UserPageVO> page(Integer page, Integer pageSize,
+                                     String selectType,
+                                     List<String> appIds,
+                                     List<String> roles,
+                                     List<String> accountTypes,
+                                     List<String> accountSources,
+                                     List<String> payTypes,
+                                     String queryTimeType,
+                                     Date startTime,
+                                     Date endTime,
+                                     List<String> queryString) {
+        PageHelper.startPage(page, pageSize);
+        return new PageInfo<>(userMapper.listWithInfo(selectType,appIds,roles,accountTypes,accountSources,payTypes,queryTimeType,startTime,endTime,queryString));
+    }
+
+
+
 
     @Override
     public UserInfoVO getByAccount(String account) {
@@ -60,10 +87,48 @@ public class UserServiceImpl implements UserService {
     }
 
     @Override
-    public UserInfoVO detail(User user) {
-        return convert(user);
+    public UserDetailVO detail(String userId) {
+        UserDetailVO detailVO = new UserDetailVO();
+        User user = userMapper.selectByPrimaryKey(userId);
+        detailVO.setId(user.getId());
+        detailVO.setEmail(user.getEmail());
+        if(StringUtils.isNotEmpty(user.getCompanyId())){
+          VppCompany company =   companyService.getById(user.getCompanyId());
+          detailVO.setCompanyName(company.getName());
+        }
+        //todo 设置产品信息
+        return detailVO;
+    }
+
+
+    public void updateUserForPaySuccess(String userId,String payTpe,String memberType) {
+        //支付成功之后修改用户状态
+        User user = userMapper.selectByPrimaryKey(userId);
+        //通过用户可以查到对应的app
+        user.setUpdatedAt(new Date());
+        //账号类型 付费账号1 免费账号0 AccountTypeEnum
+        user.setAccountType(AccountTypeEnum.PAID_ACCOUNT.value());
+        //付费类型 0 试用 1单次购买 2订阅 3单次购买+订阅 4买断 PaidTypeEnum
+        user.setPayType(null);
+        //0已注销(1订阅中2订阅过期3试用中4试用过期)PDFOfficeUserStatusEnum
+        //用户如果在订阅中 然后给用户赠送了试用,那么状态还是订阅中(根据付费类型和当前状态来判断)
+
+        user.setValidFlag(null);
+        userMapper.updateByPrimaryKey(user);
     }
 
+    public void updateUserForRefund(String userId,String paidType,String userStatus,String MemberType) {
+        //退单之后修改用户状态
+        User user = userMapper.selectByPrimaryKey(userId);
+        user.setUpdatedAt(new Date());
+        // 推线账号类型 付费账号1 免费账号0 AccountTypeEnum
+        // user.setAccountType(AccountTypeEnum.PAID_ACCOUNT.value());
+        //付费类型 0 试用 1单次购买 2订阅 3单次购买+订阅 4买断 PaidTypeEnum
+        user.setPayType(null);
+        //0已注销(1订阅中2订阅过期3试用中4试用过期)PDFOfficeUserStatusEnum
+        user.setValidFlag(null);
+        userMapper.updateByPrimaryKey(user);
+    }
 
     @Override
     public void register(UserRegisterDTO userRegisterDTO) {
@@ -103,4 +168,5 @@ public class UserServiceImpl implements UserService {
             throw new BackendRuntimeException(CommonConstant.EMAIL_VERIFY_CODE_KEY_ERROR);
         }
     }
+
 }

+ 17 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/vo/UserDetailVO.java

@@ -0,0 +1,17 @@
+package cn.kdan.cloud.pdf.office.account.vo;
+
+import lombok.Data;
+
+/**
+ * @author tangxiangan
+ */
+@Data
+public class UserDetailVO {
+
+    private String id;
+
+    private String email;
+
+    private String companyName;
+
+}

+ 33 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/vo/UserPageVO.java

@@ -0,0 +1,33 @@
+package cn.kdan.cloud.pdf.office.account.vo;
+
+import io.swagger.models.auth.In;
+import lombok.Data;
+
+/**
+ * @author tangxiangan
+ */
+@Data
+public class UserPageVO {
+
+    private String id;
+
+    private String appName;
+
+    private String email;
+
+    private String createdAt;
+
+    private String updatedAt;
+
+    private Integer accountType;
+
+    private String validFlag;
+
+    private Integer accountSource;
+
+    private String companyName;
+
+    private String role;
+
+
+}

+ 11 - 2
pdf-office-account/src/main/resources/generatorConfig.xml

@@ -40,7 +40,16 @@
 			<property name="enableSubPackages" value="true" />
 		</javaClientGenerator>
 <!--		<table tableName="oauth_client_details"/>-->
-<!--		<table tableName="user"/>-->
-		<table tableName="login_device"/>
+		<table tableName="user">
+			<columnOverride column="platform_type"  javaType="java.lang.Integer"/>
+			<columnOverride column="account_type"  javaType="java.lang.Integer"/>
+			<columnOverride column="account_source" javaType="java.lang.Integer"/>
+			<columnOverride column="member_type" javaType="java.lang.Integer"/>
+			<columnOverride column="pay_type" javaType="java.lang.Integer"/>
+		</table>
+
+<!--		<table tableName="vpp_company">-->
+<!--		</table>-->
+<!--		<table tableName="login_device"/>-->
 	</context>
 </generatorConfiguration>

+ 284 - 0
pdf-office-account/src/main/resources/sqlmap/LoginDeviceMapper.xml

@@ -0,0 +1,284 @@
+<?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.cloud.pdf.office.account.mapper.LoginDeviceMapper">
+  <resultMap id="BaseResultMap" type="cn.kdan.cloud.pdf.office.account.model.LoginDevice">
+    <result column="id" jdbcType="VARCHAR" property="id" />
+    <result column="product_id" jdbcType="VARCHAR" property="productId" />
+    <result column="unique_sn" jdbcType="VARCHAR" property="uniqueSn" />
+    <result column="user_id" jdbcType="VARCHAR" property="userId" />
+    <result column="model" jdbcType="VARCHAR" property="model" />
+    <result column="os" jdbcType="VARCHAR" property="os" />
+    <result column="language" jdbcType="VARCHAR" property="language" />
+    <result column="time_zone" jdbcType="VARCHAR" property="timeZone" />
+    <result column="app_version" jdbcType="VARCHAR" property="appVersion" />
+    <result column="platform" jdbcType="SMALLINT" property="platform" />
+    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
+    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
+    <result column="app_id" jdbcType="VARCHAR" property="appId" />
+  </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, product_id, unique_sn, user_id, model, os, `language`, time_zone, app_version, 
+    platform, updated_at, created_at, app_id
+  </sql>
+  <select id="selectByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.LoginDeviceExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from login_device
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <delete id="deleteByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.LoginDeviceExample">
+    delete from login_device
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="cn.kdan.cloud.pdf.office.account.model.LoginDevice">
+    insert into login_device (id, product_id, unique_sn, 
+      user_id, model, os, 
+      `language`, time_zone, app_version, 
+      platform, updated_at, created_at, 
+      app_id)
+    values (#{id,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR}, #{uniqueSn,jdbcType=VARCHAR}, 
+      #{userId,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{os,jdbcType=VARCHAR}, 
+      #{language,jdbcType=VARCHAR}, #{timeZone,jdbcType=VARCHAR}, #{appVersion,jdbcType=VARCHAR}, 
+      #{platform,jdbcType=SMALLINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{createdAt,jdbcType=TIMESTAMP}, 
+      #{appId,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="cn.kdan.cloud.pdf.office.account.model.LoginDevice">
+    insert into login_device
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="productId != null">
+        product_id,
+      </if>
+      <if test="uniqueSn != null">
+        unique_sn,
+      </if>
+      <if test="userId != null">
+        user_id,
+      </if>
+      <if test="model != null">
+        model,
+      </if>
+      <if test="os != null">
+        os,
+      </if>
+      <if test="language != null">
+        `language`,
+      </if>
+      <if test="timeZone != null">
+        time_zone,
+      </if>
+      <if test="appVersion != null">
+        app_version,
+      </if>
+      <if test="platform != null">
+        platform,
+      </if>
+      <if test="updatedAt != null">
+        updated_at,
+      </if>
+      <if test="createdAt != null">
+        created_at,
+      </if>
+      <if test="appId != null">
+        app_id,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="productId != null">
+        #{productId,jdbcType=VARCHAR},
+      </if>
+      <if test="uniqueSn != null">
+        #{uniqueSn,jdbcType=VARCHAR},
+      </if>
+      <if test="userId != null">
+        #{userId,jdbcType=VARCHAR},
+      </if>
+      <if test="model != null">
+        #{model,jdbcType=VARCHAR},
+      </if>
+      <if test="os != null">
+        #{os,jdbcType=VARCHAR},
+      </if>
+      <if test="language != null">
+        #{language,jdbcType=VARCHAR},
+      </if>
+      <if test="timeZone != null">
+        #{timeZone,jdbcType=VARCHAR},
+      </if>
+      <if test="appVersion != null">
+        #{appVersion,jdbcType=VARCHAR},
+      </if>
+      <if test="platform != null">
+        #{platform,jdbcType=SMALLINT},
+      </if>
+      <if test="updatedAt != null">
+        #{updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createdAt != null">
+        #{createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="appId != null">
+        #{appId,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.LoginDeviceExample" resultType="java.lang.Long">
+    select count(*) from login_device
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update login_device
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.productId != null">
+        product_id = #{record.productId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.uniqueSn != null">
+        unique_sn = #{record.uniqueSn,jdbcType=VARCHAR},
+      </if>
+      <if test="record.userId != null">
+        user_id = #{record.userId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.model != null">
+        model = #{record.model,jdbcType=VARCHAR},
+      </if>
+      <if test="record.os != null">
+        os = #{record.os,jdbcType=VARCHAR},
+      </if>
+      <if test="record.language != null">
+        `language` = #{record.language,jdbcType=VARCHAR},
+      </if>
+      <if test="record.timeZone != null">
+        time_zone = #{record.timeZone,jdbcType=VARCHAR},
+      </if>
+      <if test="record.appVersion != null">
+        app_version = #{record.appVersion,jdbcType=VARCHAR},
+      </if>
+      <if test="record.platform != null">
+        platform = #{record.platform,jdbcType=SMALLINT},
+      </if>
+      <if test="record.updatedAt != null">
+        updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.createdAt != null">
+        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.appId != null">
+        app_id = #{record.appId,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update login_device
+    set id = #{record.id,jdbcType=VARCHAR},
+      product_id = #{record.productId,jdbcType=VARCHAR},
+      unique_sn = #{record.uniqueSn,jdbcType=VARCHAR},
+      user_id = #{record.userId,jdbcType=VARCHAR},
+      model = #{record.model,jdbcType=VARCHAR},
+      os = #{record.os,jdbcType=VARCHAR},
+      `language` = #{record.language,jdbcType=VARCHAR},
+      time_zone = #{record.timeZone,jdbcType=VARCHAR},
+      app_version = #{record.appVersion,jdbcType=VARCHAR},
+      platform = #{record.platform,jdbcType=SMALLINT},
+      updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
+      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
+      app_id = #{record.appId,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <select id="selectByExampleWithRowbounds" parameterType="cn.kdan.cloud.pdf.office.account.model.LoginDeviceExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from login_device
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+</mapper>

+ 160 - 97
pdf-office-account/src/main/resources/sqlmap/UserMapper.xml

@@ -3,17 +3,15 @@
 <mapper namespace="cn.kdan.cloud.pdf.office.account.mapper.UserMapper">
   <resultMap id="BaseResultMap" type="cn.kdan.cloud.pdf.office.account.model.User">
     <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="company_id" jdbcType="VARCHAR" property="companyId" />
+    <result column="app_id" jdbcType="VARCHAR" property="appId" />
     <result column="email" jdbcType="VARCHAR" property="email" />
     <result column="full_name" jdbcType="VARCHAR" property="fullName" />
     <result column="subscriber_type" jdbcType="INTEGER" property="subscriberType" />
-    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
-    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
     <result column="subscribed" jdbcType="INTEGER" property="subscribed" />
     <result column="digest_password" jdbcType="VARCHAR" property="digestPassword" />
     <result column="phone" jdbcType="VARCHAR" property="phone" />
-    <result column="valid_flag" jdbcType="VARCHAR" property="validFlag" />
     <result column="industry" jdbcType="VARCHAR" property="industry" />
-    <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="last_popularize_at" jdbcType="INTEGER" property="lastPopularizeAt" />
     <result column="last_presented_coupon_at" jdbcType="TIMESTAMP" property="lastPresentedCouponAt" />
     <result column="mailable" jdbcType="INTEGER" property="mailable" />
@@ -21,8 +19,14 @@
     <result column="role" jdbcType="VARCHAR" property="role" />
     <result column="job" jdbcType="VARCHAR" property="job" />
     <result column="area" jdbcType="VARCHAR" property="area" />
-    <result column="app_id" jdbcType="VARCHAR" property="appId" />
-    <result column="platform_type" jdbcType="VARCHAR" property="platformType" />
+    <result column="platform_type" jdbcType="TINYINT" property="platformType" />
+    <result column="account_type" jdbcType="TINYINT" property="accountType" />
+    <result column="account_source" jdbcType="TINYINT" property="accountSource" />
+    <result column="pay_type" jdbcType="TINYINT" property="payType" />
+    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
+    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
+    <result column="member_type" jdbcType="TINYINT" property="memberType" />
+    <result column="valid_flag" jdbcType="VARCHAR" property="validFlag" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -83,9 +87,10 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, email, full_name, subscriber_type, created_at, updated_at, subscribed, digest_password, 
-    phone, valid_flag, industry, company_id, last_popularize_at, last_presented_coupon_at, 
-    mailable, reset_token, `role`, job, area, app_id, platform_type
+    id, company_id, app_id, email, full_name, subscriber_type, subscribed, digest_password, 
+    phone, industry, last_popularize_at, last_presented_coupon_at, mailable, reset_token, 
+    `role`, job, area, platform_type, account_type, account_source, pay_type, created_at, 
+    updated_at, member_type, valid_flag
   </sql>
   <select id="selectByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.UserExample" resultMap="BaseResultMap">
     select
@@ -118,22 +123,24 @@
     </if>
   </delete>
   <insert id="insert" parameterType="cn.kdan.cloud.pdf.office.account.model.User">
-    insert into user (id, email, full_name, 
-      subscriber_type, created_at, updated_at, 
+    insert into user (id, company_id, app_id, 
+      email, full_name, subscriber_type, 
       subscribed, digest_password, phone, 
-      valid_flag, industry, company_id, 
-      last_popularize_at, last_presented_coupon_at, 
+      industry, last_popularize_at, last_presented_coupon_at, 
       mailable, reset_token, `role`, 
-      job, area, app_id, platform_type
-      )
-    values (#{id,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{fullName,jdbcType=VARCHAR}, 
-      #{subscriberType,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, 
+      job, area, platform_type, 
+      account_type, account_source, pay_type, 
+      created_at, updated_at, member_type, 
+      valid_flag)
+    values (#{id,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, 
+      #{email,jdbcType=VARCHAR}, #{fullName,jdbcType=VARCHAR}, #{subscriberType,jdbcType=INTEGER}, 
       #{subscribed,jdbcType=INTEGER}, #{digestPassword,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, 
-      #{validFlag,jdbcType=VARCHAR}, #{industry,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, 
-      #{lastPopularizeAt,jdbcType=INTEGER}, #{lastPresentedCouponAt,jdbcType=TIMESTAMP}, 
+      #{industry,jdbcType=VARCHAR}, #{lastPopularizeAt,jdbcType=INTEGER}, #{lastPresentedCouponAt,jdbcType=TIMESTAMP}, 
       #{mailable,jdbcType=INTEGER}, #{resetToken,jdbcType=INTEGER}, #{role,jdbcType=VARCHAR}, 
-      #{job,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, #{platformType,jdbcType=VARCHAR}
-      )
+      #{job,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR}, #{platformType,jdbcType=TINYINT}, 
+      #{accountType,jdbcType=TINYINT}, #{accountSource,jdbcType=TINYINT}, #{payType,jdbcType=TINYINT}, 
+      #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{memberType,jdbcType=TINYINT}, 
+      #{validFlag,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="cn.kdan.cloud.pdf.office.account.model.User">
     insert into user
@@ -141,6 +148,12 @@
       <if test="id != null">
         id,
       </if>
+      <if test="companyId != null">
+        company_id,
+      </if>
+      <if test="appId != null">
+        app_id,
+      </if>
       <if test="email != null">
         email,
       </if>
@@ -150,12 +163,6 @@
       <if test="subscriberType != null">
         subscriber_type,
       </if>
-      <if test="createdAt != null">
-        created_at,
-      </if>
-      <if test="updatedAt != null">
-        updated_at,
-      </if>
       <if test="subscribed != null">
         subscribed,
       </if>
@@ -165,15 +172,9 @@
       <if test="phone != null">
         phone,
       </if>
-      <if test="validFlag != null">
-        valid_flag,
-      </if>
       <if test="industry != null">
         industry,
       </if>
-      <if test="companyId != null">
-        company_id,
-      </if>
       <if test="lastPopularizeAt != null">
         last_popularize_at,
       </if>
@@ -195,17 +196,41 @@
       <if test="area != null">
         area,
       </if>
-      <if test="appId != null">
-        app_id,
-      </if>
       <if test="platformType != null">
         platform_type,
       </if>
+      <if test="accountType != null">
+        account_type,
+      </if>
+      <if test="accountSource != null">
+        account_source,
+      </if>
+      <if test="payType != null">
+        pay_type,
+      </if>
+      <if test="createdAt != null">
+        created_at,
+      </if>
+      <if test="updatedAt != null">
+        updated_at,
+      </if>
+      <if test="memberType != null">
+        member_type,
+      </if>
+      <if test="validFlag != null">
+        valid_flag,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
         #{id,jdbcType=VARCHAR},
       </if>
+      <if test="companyId != null">
+        #{companyId,jdbcType=VARCHAR},
+      </if>
+      <if test="appId != null">
+        #{appId,jdbcType=VARCHAR},
+      </if>
       <if test="email != null">
         #{email,jdbcType=VARCHAR},
       </if>
@@ -215,12 +240,6 @@
       <if test="subscriberType != null">
         #{subscriberType,jdbcType=INTEGER},
       </if>
-      <if test="createdAt != null">
-        #{createdAt,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updatedAt != null">
-        #{updatedAt,jdbcType=TIMESTAMP},
-      </if>
       <if test="subscribed != null">
         #{subscribed,jdbcType=INTEGER},
       </if>
@@ -230,15 +249,9 @@
       <if test="phone != null">
         #{phone,jdbcType=VARCHAR},
       </if>
-      <if test="validFlag != null">
-        #{validFlag,jdbcType=VARCHAR},
-      </if>
       <if test="industry != null">
         #{industry,jdbcType=VARCHAR},
       </if>
-      <if test="companyId != null">
-        #{companyId,jdbcType=VARCHAR},
-      </if>
       <if test="lastPopularizeAt != null">
         #{lastPopularizeAt,jdbcType=INTEGER},
       </if>
@@ -260,11 +273,29 @@
       <if test="area != null">
         #{area,jdbcType=VARCHAR},
       </if>
-      <if test="appId != null">
-        #{appId,jdbcType=VARCHAR},
-      </if>
       <if test="platformType != null">
-        #{platformType,jdbcType=VARCHAR},
+        #{platformType,jdbcType=TINYINT},
+      </if>
+      <if test="accountType != null">
+        #{accountType,jdbcType=TINYINT},
+      </if>
+      <if test="accountSource != null">
+        #{accountSource,jdbcType=TINYINT},
+      </if>
+      <if test="payType != null">
+        #{payType,jdbcType=TINYINT},
+      </if>
+      <if test="createdAt != null">
+        #{createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updatedAt != null">
+        #{updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="memberType != null">
+        #{memberType,jdbcType=TINYINT},
+      </if>
+      <if test="validFlag != null">
+        #{validFlag,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
@@ -280,6 +311,12 @@
       <if test="record.id != null">
         id = #{record.id,jdbcType=VARCHAR},
       </if>
+      <if test="record.companyId != null">
+        company_id = #{record.companyId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.appId != null">
+        app_id = #{record.appId,jdbcType=VARCHAR},
+      </if>
       <if test="record.email != null">
         email = #{record.email,jdbcType=VARCHAR},
       </if>
@@ -289,12 +326,6 @@
       <if test="record.subscriberType != null">
         subscriber_type = #{record.subscriberType,jdbcType=INTEGER},
       </if>
-      <if test="record.createdAt != null">
-        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.updatedAt != null">
-        updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
-      </if>
       <if test="record.subscribed != null">
         subscribed = #{record.subscribed,jdbcType=INTEGER},
       </if>
@@ -304,15 +335,9 @@
       <if test="record.phone != null">
         phone = #{record.phone,jdbcType=VARCHAR},
       </if>
-      <if test="record.validFlag != null">
-        valid_flag = #{record.validFlag,jdbcType=VARCHAR},
-      </if>
       <if test="record.industry != null">
         industry = #{record.industry,jdbcType=VARCHAR},
       </if>
-      <if test="record.companyId != null">
-        company_id = #{record.companyId,jdbcType=VARCHAR},
-      </if>
       <if test="record.lastPopularizeAt != null">
         last_popularize_at = #{record.lastPopularizeAt,jdbcType=INTEGER},
       </if>
@@ -334,11 +359,29 @@
       <if test="record.area != null">
         area = #{record.area,jdbcType=VARCHAR},
       </if>
-      <if test="record.appId != null">
-        app_id = #{record.appId,jdbcType=VARCHAR},
-      </if>
       <if test="record.platformType != null">
-        platform_type = #{record.platformType,jdbcType=VARCHAR},
+        platform_type = #{record.platformType,jdbcType=TINYINT},
+      </if>
+      <if test="record.accountType != null">
+        account_type = #{record.accountType,jdbcType=TINYINT},
+      </if>
+      <if test="record.accountSource != null">
+        account_source = #{record.accountSource,jdbcType=TINYINT},
+      </if>
+      <if test="record.payType != null">
+        pay_type = #{record.payType,jdbcType=TINYINT},
+      </if>
+      <if test="record.createdAt != null">
+        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updatedAt != null">
+        updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.memberType != null">
+        member_type = #{record.memberType,jdbcType=TINYINT},
+      </if>
+      <if test="record.validFlag != null">
+        valid_flag = #{record.validFlag,jdbcType=VARCHAR},
       </if>
     </set>
     <if test="_parameter != null">
@@ -348,17 +391,15 @@
   <update id="updateByExample" parameterType="map">
     update user
     set id = #{record.id,jdbcType=VARCHAR},
+      company_id = #{record.companyId,jdbcType=VARCHAR},
+      app_id = #{record.appId,jdbcType=VARCHAR},
       email = #{record.email,jdbcType=VARCHAR},
       full_name = #{record.fullName,jdbcType=VARCHAR},
       subscriber_type = #{record.subscriberType,jdbcType=INTEGER},
-      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
-      updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
       subscribed = #{record.subscribed,jdbcType=INTEGER},
       digest_password = #{record.digestPassword,jdbcType=VARCHAR},
       phone = #{record.phone,jdbcType=VARCHAR},
-      valid_flag = #{record.validFlag,jdbcType=VARCHAR},
       industry = #{record.industry,jdbcType=VARCHAR},
-      company_id = #{record.companyId,jdbcType=VARCHAR},
       last_popularize_at = #{record.lastPopularizeAt,jdbcType=INTEGER},
       last_presented_coupon_at = #{record.lastPresentedCouponAt,jdbcType=TIMESTAMP},
       mailable = #{record.mailable,jdbcType=INTEGER},
@@ -366,8 +407,14 @@
       `role` = #{record.role,jdbcType=VARCHAR},
       job = #{record.job,jdbcType=VARCHAR},
       area = #{record.area,jdbcType=VARCHAR},
-      app_id = #{record.appId,jdbcType=VARCHAR},
-      platform_type = #{record.platformType,jdbcType=VARCHAR}
+      platform_type = #{record.platformType,jdbcType=TINYINT},
+      account_type = #{record.accountType,jdbcType=TINYINT},
+      account_source = #{record.accountSource,jdbcType=TINYINT},
+      pay_type = #{record.payType,jdbcType=TINYINT},
+      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
+      updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
+      member_type = #{record.memberType,jdbcType=TINYINT},
+      valid_flag = #{record.validFlag,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -375,6 +422,12 @@
   <update id="updateByPrimaryKeySelective" parameterType="cn.kdan.cloud.pdf.office.account.model.User">
     update user
     <set>
+      <if test="companyId != null">
+        company_id = #{companyId,jdbcType=VARCHAR},
+      </if>
+      <if test="appId != null">
+        app_id = #{appId,jdbcType=VARCHAR},
+      </if>
       <if test="email != null">
         email = #{email,jdbcType=VARCHAR},
       </if>
@@ -384,12 +437,6 @@
       <if test="subscriberType != null">
         subscriber_type = #{subscriberType,jdbcType=INTEGER},
       </if>
-      <if test="createdAt != null">
-        created_at = #{createdAt,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updatedAt != null">
-        updated_at = #{updatedAt,jdbcType=TIMESTAMP},
-      </if>
       <if test="subscribed != null">
         subscribed = #{subscribed,jdbcType=INTEGER},
       </if>
@@ -399,15 +446,9 @@
       <if test="phone != null">
         phone = #{phone,jdbcType=VARCHAR},
       </if>
-      <if test="validFlag != null">
-        valid_flag = #{validFlag,jdbcType=VARCHAR},
-      </if>
       <if test="industry != null">
         industry = #{industry,jdbcType=VARCHAR},
       </if>
-      <if test="companyId != null">
-        company_id = #{companyId,jdbcType=VARCHAR},
-      </if>
       <if test="lastPopularizeAt != null">
         last_popularize_at = #{lastPopularizeAt,jdbcType=INTEGER},
       </if>
@@ -429,28 +470,44 @@
       <if test="area != null">
         area = #{area,jdbcType=VARCHAR},
       </if>
-      <if test="appId != null">
-        app_id = #{appId,jdbcType=VARCHAR},
-      </if>
       <if test="platformType != null">
-        platform_type = #{platformType,jdbcType=VARCHAR},
+        platform_type = #{platformType,jdbcType=TINYINT},
+      </if>
+      <if test="accountType != null">
+        account_type = #{accountType,jdbcType=TINYINT},
+      </if>
+      <if test="accountSource != null">
+        account_source = #{accountSource,jdbcType=TINYINT},
+      </if>
+      <if test="payType != null">
+        pay_type = #{payType,jdbcType=TINYINT},
+      </if>
+      <if test="createdAt != null">
+        created_at = #{createdAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updatedAt != null">
+        updated_at = #{updatedAt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="memberType != null">
+        member_type = #{memberType,jdbcType=TINYINT},
+      </if>
+      <if test="validFlag != null">
+        valid_flag = #{validFlag,jdbcType=VARCHAR},
       </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKey" parameterType="cn.kdan.cloud.pdf.office.account.model.User">
     update user
-    set email = #{email,jdbcType=VARCHAR},
+    set company_id = #{companyId,jdbcType=VARCHAR},
+      app_id = #{appId,jdbcType=VARCHAR},
+      email = #{email,jdbcType=VARCHAR},
       full_name = #{fullName,jdbcType=VARCHAR},
       subscriber_type = #{subscriberType,jdbcType=INTEGER},
-      created_at = #{createdAt,jdbcType=TIMESTAMP},
-      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
       subscribed = #{subscribed,jdbcType=INTEGER},
       digest_password = #{digestPassword,jdbcType=VARCHAR},
       phone = #{phone,jdbcType=VARCHAR},
-      valid_flag = #{validFlag,jdbcType=VARCHAR},
       industry = #{industry,jdbcType=VARCHAR},
-      company_id = #{companyId,jdbcType=VARCHAR},
       last_popularize_at = #{lastPopularizeAt,jdbcType=INTEGER},
       last_presented_coupon_at = #{lastPresentedCouponAt,jdbcType=TIMESTAMP},
       mailable = #{mailable,jdbcType=INTEGER},
@@ -458,8 +515,14 @@
       `role` = #{role,jdbcType=VARCHAR},
       job = #{job,jdbcType=VARCHAR},
       area = #{area,jdbcType=VARCHAR},
-      app_id = #{appId,jdbcType=VARCHAR},
-      platform_type = #{platformType,jdbcType=VARCHAR}
+      platform_type = #{platformType,jdbcType=TINYINT},
+      account_type = #{accountType,jdbcType=TINYINT},
+      account_source = #{accountSource,jdbcType=TINYINT},
+      pay_type = #{payType,jdbcType=TINYINT},
+      created_at = #{createdAt,jdbcType=TIMESTAMP},
+      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
+      member_type = #{memberType,jdbcType=TINYINT},
+      valid_flag = #{validFlag,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <select id="selectByExampleWithRowbounds" parameterType="cn.kdan.cloud.pdf.office.account.model.UserExample" resultMap="BaseResultMap">

+ 272 - 0
pdf-office-account/src/main/resources/sqlmap/VppCompanyMapper.xml

@@ -0,0 +1,272 @@
+<?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.cloud.pdf.office.account.mapper.VppCompanyMapper">
+  <resultMap id="BaseResultMap" type="cn.kdan.cloud.pdf.office.account.model.VppCompany">
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="description" jdbcType="VARCHAR" property="description" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="valid_flag" jdbcType="VARCHAR" property="validFlag" />
+    <result column="status" jdbcType="TINYINT" property="status" />
+    <result column="industry" jdbcType="VARCHAR" property="industry" />
+  </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`, description, create_time, update_time, valid_flag, `status`, industry
+  </sql>
+  <select id="selectByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.VppCompanyExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from vpp_company
+    <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.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from vpp_company
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from vpp_company
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.VppCompanyExample">
+    delete from vpp_company
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="cn.kdan.cloud.pdf.office.account.model.VppCompany">
+    insert into vpp_company (id, `name`, description, 
+      create_time, update_time, valid_flag, 
+      `status`, industry)
+    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{validFlag,jdbcType=VARCHAR}, 
+      #{status,jdbcType=TINYINT}, #{industry,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="cn.kdan.cloud.pdf.office.account.model.VppCompany">
+    insert into vpp_company
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="description != null">
+        description,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="validFlag != null">
+        valid_flag,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="industry != null">
+        industry,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="description != null">
+        #{description,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="validFlag != null">
+        #{validFlag,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=TINYINT},
+      </if>
+      <if test="industry != null">
+        #{industry,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.VppCompanyExample" resultType="java.lang.Long">
+    select count(*) from vpp_company
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update vpp_company
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.name != null">
+        `name` = #{record.name,jdbcType=VARCHAR},
+      </if>
+      <if test="record.description != null">
+        description = #{record.description,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.validFlag != null">
+        valid_flag = #{record.validFlag,jdbcType=VARCHAR},
+      </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=TINYINT},
+      </if>
+      <if test="record.industry != null">
+        industry = #{record.industry,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update vpp_company
+    set id = #{record.id,jdbcType=VARCHAR},
+      `name` = #{record.name,jdbcType=VARCHAR},
+      description = #{record.description,jdbcType=VARCHAR},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      valid_flag = #{record.validFlag,jdbcType=VARCHAR},
+      `status` = #{record.status,jdbcType=TINYINT},
+      industry = #{record.industry,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="cn.kdan.cloud.pdf.office.account.model.VppCompany">
+    update vpp_company
+    <set>
+      <if test="name != null">
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="description != null">
+        description = #{description,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="validFlag != null">
+        valid_flag = #{validFlag,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=TINYINT},
+      </if>
+      <if test="industry != null">
+        industry = #{industry,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="cn.kdan.cloud.pdf.office.account.model.VppCompany">
+    update vpp_company
+    set `name` = #{name,jdbcType=VARCHAR},
+      description = #{description,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      valid_flag = #{validFlag,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=TINYINT},
+      industry = #{industry,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByExampleWithRowbounds" parameterType="cn.kdan.cloud.pdf.office.account.model.VppCompanyExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from vpp_company
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+</mapper>

+ 134 - 27
pdf-office-account/src/main/resources/sqlmap/ext/ExtUserMapper.xml

@@ -2,27 +2,30 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.kdan.cloud.pdf.office.account.mapper.ext.ExtUserMapper">
   <resultMap id="BaseResultMap" type="cn.kdan.cloud.pdf.office.account.model.User">
-    <id column="id" jdbcType="VARCHAR" property="id" />
-    <result column="email" jdbcType="VARCHAR" property="email" />
-    <result column="full_name" jdbcType="VARCHAR" property="fullName" />
-    <result column="subscriber_type" jdbcType="INTEGER" property="subscriberType" />
-    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
-    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
-    <result column="subscribed" jdbcType="INTEGER" property="subscribed" />
-    <result column="digest_password" jdbcType="VARCHAR" property="digestPassword" />
-    <result column="phone" jdbcType="VARCHAR" property="phone" />
-    <result column="valid_flag" jdbcType="VARCHAR" property="validFlag" />
-    <result column="industry" jdbcType="VARCHAR" property="industry" />
-    <result column="company_id" jdbcType="VARCHAR" property="companyId" />
-    <result column="last_popularize_at" jdbcType="INTEGER" property="lastPopularizeAt" />
-    <result column="last_presented_coupon_at" jdbcType="TIMESTAMP" property="lastPresentedCouponAt" />
-    <result column="mailable" jdbcType="INTEGER" property="mailable" />
-    <result column="reset_token" jdbcType="INTEGER" property="resetToken" />
-    <result column="role" jdbcType="VARCHAR" property="role" />
-    <result column="job" jdbcType="VARCHAR" property="job" />
-    <result column="area" jdbcType="VARCHAR" property="area" />
-    <result column="app_id" jdbcType="VARCHAR" property="appId" />
-    <result column="platform_type" jdbcType="VARCHAR" property="platformType" />
+    <id column="id" jdbcType="VARCHAR" property="id"/>
+    <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
+    <result column="app_id" jdbcType="VARCHAR" property="appId"/>
+    <result column="email" jdbcType="VARCHAR" property="email"/>
+    <result column="full_name" jdbcType="VARCHAR" property="fullName"/>
+    <result column="subscriber_type" jdbcType="INTEGER" property="subscriberType"/>
+    <result column="subscribed" jdbcType="INTEGER" property="subscribed"/>
+    <result column="digest_password" jdbcType="VARCHAR" property="digestPassword"/>
+    <result column="phone" jdbcType="VARCHAR" property="phone"/>
+    <result column="industry" jdbcType="VARCHAR" property="industry"/>
+    <result column="last_popularize_at" jdbcType="INTEGER" property="lastPopularizeAt"/>
+    <result column="last_presented_coupon_at" jdbcType="TIMESTAMP" property="lastPresentedCouponAt"/>
+    <result column="mailable" jdbcType="INTEGER" property="mailable"/>
+    <result column="reset_token" jdbcType="INTEGER" property="resetToken"/>
+    <result column="role" jdbcType="VARCHAR" property="role"/>
+    <result column="job" jdbcType="VARCHAR" property="job"/>
+    <result column="area" jdbcType="VARCHAR" property="area"/>
+    <result column="platform_type" jdbcType="TINYINT" property="platformType"/>
+    <result column="account_type" jdbcType="TINYINT" property="accountType"/>
+    <result column="account_source" jdbcType="TINYINT" property="accountSource"/>
+    <result column="pay_type" jdbcType="TINYINT" property="payType"/>
+    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
+    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
+    <result column="valid_flag" jdbcType="VARCHAR" property="validFlag"/>
   </resultMap>
   <select id="getByAccount" resultMap="BaseResultMap">
     SELECT
@@ -34,14 +37,118 @@
       and user.app_id = #{appId}
       and user.platform_type = #{platformType}
     union all
-    SELECT
-      *
-    FROM
-      user
-    WHERE
-      user.email = #{account}
+    SELECT *
+    FROM user
+    WHERE user.email = #{account}
       and user.app_id = #{appId}
       and user.platform_type = #{platformType}
   </select>
 
+  <resultMap id="UserPageMap" type="cn.kdan.cloud.pdf.office.account.vo.UserPageVO">
+    <id column="id" jdbcType="VARCHAR" property="id"/>
+    <result column="app_name" jdbcType="VARCHAR" property="appName"/>
+    <result column="email" jdbcType="VARCHAR" property="email"/>
+    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
+    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
+    <result column="account_type" jdbcType="TINYINT" property="accountType"/>
+    <result column="valid_flag" jdbcType="VARCHAR" property="validFlag"/>
+    <result column="account_source" jdbcType="TINYINT" property="accountSource"/>
+    <result column="role" jdbcType="VARCHAR" property="role"/>
+    <result column="company_name" jdbcType="VARCHAR" property="companyName"/>
+  </resultMap>
+
+  <select id="listWithInfo" resultMap="UserPageMap">
+    select u.id,a.app_name,u.email,u.created_at,u.updated_at,u.account_type,u.valid_flag,u.account_source,u.role,vc.name
+    company_name
+    from user u
+    left join app a on a.id = u.app_id
+    left join vpp_company vc on u.company_id = vc.id
+    where
+    u.platform_type = '1'
+    <if test="appIds != null and appIds.length > 0">
+      and a.id
+      <if test=" selectType = 1 ">
+        in
+      </if>
+      <if test=" selectType = 2 ">
+        not in
+      </if>
+      <foreach item="item" index="index" collection="appIds" open="(" separator="," close=")">
+        #{item}
+      </foreach>
+    </if>
+    <if test="roles != null and roles.length > 0">
+      and u.role
+      <if test=" selectType = 1 ">
+        in
+      </if>
+      <if test=" selectType = 2 ">
+        not in
+      </if>
+      <foreach item="item" index="index" collection="roles" open="(" separator="," close=")">
+        #{item}
+      </foreach>
+    </if>
+    <if test="accountTypes != null and accountTypes.length > 0">
+      and u.account_type
+      <if test=" selectType = 1 ">
+        in
+      </if>
+      <if test=" selectType = 2 ">
+        not in
+      </if>
+      <foreach item="item" index="index" collection="accountTypes" open="(" separator="," close=")">
+        #{item}
+      </foreach>
+    </if>
+    <if test="accountSources != null and accountSources.length > 0">
+      and u.account_source
+      <if test=" selectType = 1 ">
+        in
+      </if>
+      <if test=" selectType = 2 ">
+        not in
+      </if>
+      <foreach item="item" index="index" collection="accountSources" open="(" separator="," close=")">
+        #{item}
+      </foreach>
+    </if>
+    <if test="payTypes != null and payTypes.length > 0">
+      and u.pay_type
+      <if test=" selectType = 1 ">
+        in
+      </if>
+      <if test=" selectType = 2 ">
+        not in
+      </if>
+      <foreach item="item" index="index" collection="payTypes" open="(" separator="," close=")">
+        #{item}
+      </foreach>
+    </if>
+    <if test='queryTimeType!=null and queryTimeType == "1"'>
+      and u.created_at between #{startTime} and #{endTime}
+    </if>
+    <if test='queryTimeType!=null and queryTimeType == "2"'>
+      and u.updated_at between #{startTime} and #{endTime}
+    </if>
+    <if test='queryString != null and queryString != ""'>
+      and u.id
+      <if test=" selectType = 1 ">
+        like
+      </if>
+      <if test=" selectType = 2 ">
+        not like
+      </if>
+      '%'#{queryString}'%'
+      or u.id.email
+      <if test=" selectType = 1 ">
+        like
+      </if>
+      <if test=" selectType = 2 ">
+        not like
+      </if>
+      '%'#{queryString}'%'
+    </if>
+  </select>
+
 </mapper>

+ 0 - 4
pdf-office-sso/pom.xml

@@ -203,10 +203,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>15</source>
-                    <target>15</target>
-                </configuration>
             </plugin>
         </plugins>
     </build>

+ 2 - 0
pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/constant/AuthConstant.java

@@ -65,4 +65,6 @@ public class AuthConstant {
 
     public static final String EMAIL_VERIFY_CODE_KEY_ERROR = "email code error!";
 
+    public static final String EMAIL_REGISTER_ERROR = "Register error!";
+
 }

+ 5 - 0
pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/controller/AuthController.java

@@ -88,6 +88,11 @@ public class AuthController {
         return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS, authService.emailLogin(email,code,appId,platformType,deviceSign,request));
     }
 
+    @GetMapping("/emailRegister")
+    public ResultMap<TokenVO> emailRegister(@RequestBody UserRegisterDTO userRegisterDTO) {
+        return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS, authService.emailRegister(userRegisterDTO));
+    }
+
     @PostMapping("/sendCode")
     public ResultMap<Boolean> sendCode(@RequestParam String email, @RequestParam String appId) {
         EmailSendBO bo = new EmailSendBO();

+ 8 - 0
pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/service/AuthService.java

@@ -1,6 +1,7 @@
 package cn.kdan.cloud.pdf.office.sso.service;
 
 
+import cn.kdan.cloud.pdf.office.common.dto.UserRegisterDTO;
 import cn.kdan.cloud.pdf.office.common.enums.EmailCodeTypeEnum;
 import cn.kdan.cloud.pdf.office.common.vo.TokenVO;
 
@@ -45,4 +46,11 @@ public interface AuthService {
     void isEmailCodeValid(EmailCodeTypeEnum type, String account, String code);
 
     void refreshToken(Principal principal);
+
+    /**
+     * pdf office用户注册 注册后自动登录
+     * @param userRegisterDTO
+     * @return
+     */
+    TokenVO emailRegister(UserRegisterDTO userRegisterDTO);
 }

+ 20 - 0
pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/service/impl/AuthServiceImpl.java

@@ -6,9 +6,11 @@ import cn.kdan.cloud.pdf.office.api.account.feign.UserApi;
 import cn.kdan.cloud.pdf.office.api.account.vo.LoginDevice;
 import cn.kdan.cloud.pdf.office.api.account.vo.OauthClientDetails;
 import cn.kdan.cloud.pdf.office.common.constant.CommonConstant;
+import cn.kdan.cloud.pdf.office.common.dto.UserRegisterDTO;
 import cn.kdan.cloud.pdf.office.common.enums.EmailCodeTypeEnum;
 import cn.kdan.cloud.pdf.office.common.exception.BackendRuntimeException;
 import cn.kdan.cloud.pdf.office.common.pojo.CustomUserDetails;
+import cn.kdan.cloud.pdf.office.common.pojo.ResultMap;
 import cn.kdan.cloud.pdf.office.common.utils.CommonUtils;
 import cn.kdan.cloud.pdf.office.common.utils.RedisUtils;
 import cn.kdan.cloud.pdf.office.common.vo.TokenVO;
@@ -137,6 +139,23 @@ public class AuthServiceImpl implements AuthService {
         return vo;
     }
 
+
+    @Override
+    public TokenVO emailRegister(UserRegisterDTO userRegisterDTO) {
+        ResultMap<Boolean> resultMap = userApi.register(userRegisterDTO);
+        if(resultMap.getCode() == CommonConstant.SUCCESS){
+            //如果是管理平台就去查管理平台的用户表
+            UserInfoVO userInfoVO = userApi.getByAppAccount(userRegisterDTO.getUsername(),
+                    userRegisterDTO.getAppId(),userRegisterDTO.getPlatformType()).getResult();
+            //生成token
+            TokenVO vo = getTokenByUser(CommonUtils.generateDateId(), userInfoVO);
+            //关联设备登录
+            relateTokenAndDevice(vo.getAccess_token(), userInfoVO.getId(), userRegisterDTO.getDeviceSign(), userRegisterDTO.getAppId());
+            return vo;
+        }
+        throw new BackendRuntimeException(AuthConstant.EMAIL_REGISTER_ERROR);
+    }
+
     @Resource
     @Lazy
     private TokenStore tokenStore;
@@ -282,4 +301,5 @@ public class AuthServiceImpl implements AuthService {
         keySet.forEach(key -> redisUtils.expire(key, time));
     }
 
+
 }