瀏覽代碼

Merge branch 'master' of http://git.kdan.cc:8865/Server_Service/pdf_office_back_end

wangPH 2 年之前
父節點
當前提交
39f76d8a37
共有 35 個文件被更改,包括 1376 次插入340 次删除
  1. 4 4
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/controller/LoginDeviceController.java
  2. 19 7
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/controller/UserController.java
  3. 33 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/mapper/UserSubscriptionInfoMapper.java
  4. 0 36
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/User.java
  5. 0 120
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/UserExample.java
  6. 148 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/UserSubscriptionInfo.java
  7. 591 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/UserSubscriptionInfoExample.java
  8. 4 7
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/LoginDeviceService.java
  9. 12 3
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/UserService.java
  10. 19 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/UserSubscriptionInfoService.java
  11. 4 4
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/impl/LoginDeviceServiceImpl.java
  12. 32 11
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/impl/UserServiceImpl.java
  13. 28 0
      pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/impl/UserSubscriptionInfoServiceImpl.java
  14. 9 6
      pdf-office-account/src/main/resources/generatorConfig.xml
  15. 8 38
      pdf-office-account/src/main/resources/sqlmap/UserMapper.xml
  16. 242 0
      pdf-office-account/src/main/resources/sqlmap/UserSubscriptionInfoMapper.xml
  17. 4 4
      pdf-office-api/pdf-office-api-account/src/main/java/cn/kdan/cloud/pdf/office/api/account/feign/LoginDeviceApi.java
  18. 16 9
      pdf-office-api/pdf-office-api-account/src/main/java/cn/kdan/cloud/pdf/office/api/account/feign/UserApi.java
  19. 11 5
      pdf-office-api/pdf-office-api-account/src/main/java/cn/kdan/cloud/pdf/office/api/account/feign/hystrix/UserHystrix.java
  20. 63 0
      pdf-office-api/pdf-office-api-account/src/main/java/cn/kdan/cloud/pdf/office/api/account/vo/UserInfoVO.java
  21. 18 0
      pdf-office-api/pdf-office-api-account/src/main/java/cn/kdan/cloud/pdf/office/api/account/vo/UserSubscriptionInfoVO.java
  22. 3 2
      pdf-office-common/src/main/java/cn/kdan/cloud/pdf/office/common/enums/account/PDFOfficeUserStatusEnum.java
  23. 1 3
      pdf-office-common/src/main/java/cn/kdan/cloud/pdf/office/common/vo/UserInfoVO.java
  24. 2 2
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/PaddleWebhookServiceImpl.java
  25. 3 3
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/SubscriptionsServiceImpl.java
  26. 2 2
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/config/oauth/LoginAuthenticationProvider.java
  27. 2 3
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/config/oauth/LoginAuthenticationSuccessHandler.java
  28. 1 0
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/constant/AuthConstant.java
  29. 0 16
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/controller/AuthController.java
  30. 29 7
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/controller/UserController.java
  31. 7 0
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/service/AuthService.java
  32. 57 29
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/service/impl/AuthServiceImpl.java
  33. 2 3
      pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/service/impl/CustomUserDetailsServiceImpl.java
  34. 2 3
      pdf-office-system/pom.xml
  35. 0 13
      pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/controller/UserController.java

+ 4 - 4
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/controller/LoginDeviceController.java

@@ -43,8 +43,8 @@ public class LoginDeviceController {
     }
 
     @GetMapping("getByDeviceSignAndAppId")
-    public ResultMap<LoginDevice> getByDeviceSignAndAppId(@RequestParam("deviceSign") String deviceSign,@RequestParam("appId") String appId) {
-        return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS,loginDeviceService.getByDeviceSignAndAppId(deviceSign,appId));
+    public ResultMap<LoginDevice> getByDeviceSignAndAppId(@RequestParam("deviceSign") String deviceSign,@RequestParam("userId") String userId) {
+        return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS,loginDeviceService.getByDeviceSignAndAppId(deviceSign,userId));
     }
 
 
@@ -55,8 +55,8 @@ public class LoginDeviceController {
      * @return
      */
     @PostMapping("delete")
-    public ResultMap<Boolean> delete(@RequestParam("deviceSign") String deviceSign,@RequestParam("appId") String appId) {
-        loginDeviceService.delete(deviceSign,appId);
+    public ResultMap<Boolean> delete(@RequestParam("deviceSign") String deviceSign,@RequestParam("userId") String userId) {
+        loginDeviceService.delete(deviceSign,userId);
         return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS,Boolean.TRUE);
     }
 

+ 19 - 7
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/controller/UserController.java

@@ -2,12 +2,13 @@ package cn.kdan.cloud.pdf.office.account.controller;
 
 import cn.kdan.cloud.pdf.office.account.model.User;
 import cn.kdan.cloud.pdf.office.api.account.vo.UserDetailVO;
+import cn.kdan.cloud.pdf.office.api.account.vo.UserInfoVO;
 import cn.kdan.cloud.pdf.office.api.account.vo.UserPageVO;
 import cn.kdan.cloud.pdf.office.api.account.dto.*;
 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;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 
 import cn.kdan.cloud.pdf.office.account.constant.UserConstant;
 import cn.kdan.cloud.pdf.office.account.service.UserService;
@@ -17,7 +18,6 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.security.Principal;
 import java.util.Date;
 import java.util.List;
 
@@ -39,7 +39,7 @@ public class UserController {
      * @return
      */
     @GetMapping("getByAppAccount")
-    public ResultMap<UserInfoVO> getByAppAccount(@RequestParam String account,@RequestParam String appId,@RequestParam String platformType) {
+    public ResultMap<UserVO> getByAppAccount(@RequestParam String account, @RequestParam String appId, @RequestParam String platformType) {
         return new ResultMap<>(CommonConstant.SUCCESS, UserConstant.USER_QUERY_SUCCESS, userService.getByAppAccount(account,appId,platformType));
     }
 
@@ -49,10 +49,22 @@ public class UserController {
      * @return
      */
     @GetMapping("getById")
-    public ResultMap<UserInfoVO> getById(@RequestParam String id) {
+    public ResultMap<UserVO> getById(@RequestParam String id) {
         return new ResultMap<>(CommonConstant.SUCCESS, UserConstant.USER_QUERY_SUCCESS, userService.getById(id));
     }
 
+    /**
+     * 用户信息包括用户的会员信息
+     *
+     * @param id id
+     * @return UserInfoVO
+     */
+    @GetMapping("getInfoById")
+    public ResultMap<UserInfoVO> getInfoById(@RequestParam String id) {
+        return new ResultMap<>(CommonConstant.SUCCESS, UserConstant.USER_QUERY_SUCCESS, userService.getInfoById(id));
+    }
+
+
     /**
      * 注册
      *
@@ -167,12 +179,12 @@ public class UserController {
     /**
      * 更新
      *
-     * @param userInfoVO
+     * @param userVO
      */
     @PostMapping("/updateUser")
-    public ResultMap<Boolean> updateUser(@RequestBody UserInfoVO userInfoVO) {
+    public ResultMap<Boolean> updateUser(@RequestBody UserVO userVO) {
         User user = new User();
-        BeanUtils.copyProperties(userInfoVO,user);
+        BeanUtils.copyProperties(userVO,user);
         userService.updateUser(user);
         return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS,Boolean.TRUE);
     }

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

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

+ 0 - 36
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/User.java

@@ -44,14 +44,10 @@ public class User implements Serializable {
 
     private Integer accountSource;
 
-    private Integer payType;
-
     private Date createdAt;
 
     private Date updatedAt;
 
-    private Integer memberType;
-
     private String remark;
 
     private String validFlag;
@@ -318,19 +314,6 @@ public class User implements Serializable {
         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;
     }
@@ -357,19 +340,6 @@ public class User implements Serializable {
         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 getRemark() {
         return remark;
     }
@@ -428,10 +398,8 @@ public class User implements Serializable {
             && (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.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
             && (this.getValidFlag() == null ? other.getValidFlag() == null : this.getValidFlag().equals(other.getValidFlag()));
     }
@@ -460,10 +428,8 @@ public class User implements Serializable {
         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 + ((getRemark() == null) ? 0 : getRemark().hashCode());
         result = prime * result + ((getValidFlag() == null) ? 0 : getValidFlag().hashCode());
         return result;
@@ -495,10 +461,8 @@ public class User implements Serializable {
         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(", remark=").append(remark);
         sb.append(", validFlag=").append(validFlag);
         sb.append(", serialVersionUID=").append(serialVersionUID);

+ 0 - 120
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/UserExample.java

@@ -1415,66 +1415,6 @@ public class UserExample {
             return (Criteria) this;
         }
 
-        public Criteria andPayTypeIsNull() {
-            addCriterion("pay_type is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeIsNotNull() {
-            addCriterion("pay_type is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeEqualTo(Integer value) {
-            addCriterion("pay_type =", value, "payType");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeNotEqualTo(Integer value) {
-            addCriterion("pay_type <>", value, "payType");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeGreaterThan(Integer value) {
-            addCriterion("pay_type >", value, "payType");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeGreaterThanOrEqualTo(Integer value) {
-            addCriterion("pay_type >=", value, "payType");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeLessThan(Integer value) {
-            addCriterion("pay_type <", value, "payType");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeLessThanOrEqualTo(Integer value) {
-            addCriterion("pay_type <=", value, "payType");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeIn(List<Integer> values) {
-            addCriterion("pay_type in", values, "payType");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeNotIn(List<Integer> values) {
-            addCriterion("pay_type not in", values, "payType");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeBetween(Integer value1, Integer value2) {
-            addCriterion("pay_type between", value1, value2, "payType");
-            return (Criteria) this;
-        }
-
-        public Criteria andPayTypeNotBetween(Integer value1, Integer value2) {
-            addCriterion("pay_type not between", value1, value2, "payType");
-            return (Criteria) this;
-        }
-
         public Criteria andCreatedAtIsNull() {
             addCriterion("created_at is null");
             return (Criteria) this;
@@ -1595,66 +1535,6 @@ public class UserExample {
             return (Criteria) this;
         }
 
-        public Criteria andMemberTypeIsNull() {
-            addCriterion("member_type is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeIsNotNull() {
-            addCriterion("member_type is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeEqualTo(Integer value) {
-            addCriterion("member_type =", value, "memberType");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeNotEqualTo(Integer value) {
-            addCriterion("member_type <>", value, "memberType");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeGreaterThan(Integer value) {
-            addCriterion("member_type >", value, "memberType");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeGreaterThanOrEqualTo(Integer value) {
-            addCriterion("member_type >=", value, "memberType");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeLessThan(Integer value) {
-            addCriterion("member_type <", value, "memberType");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeLessThanOrEqualTo(Integer value) {
-            addCriterion("member_type <=", value, "memberType");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeIn(List<Integer> values) {
-            addCriterion("member_type in", values, "memberType");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeNotIn(List<Integer> values) {
-            addCriterion("member_type not in", values, "memberType");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeBetween(Integer value1, Integer value2) {
-            addCriterion("member_type between", value1, value2, "memberType");
-            return (Criteria) this;
-        }
-
-        public Criteria andMemberTypeNotBetween(Integer value1, Integer value2) {
-            addCriterion("member_type not between", value1, value2, "memberType");
-            return (Criteria) this;
-        }
-
         public Criteria andRemarkIsNull() {
             addCriterion("remark is null");
             return (Criteria) this;

+ 148 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/UserSubscriptionInfo.java

@@ -0,0 +1,148 @@
+package cn.kdan.cloud.pdf.office.account.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class UserSubscriptionInfo implements Serializable {
+    private String id;
+
+    private String userId;
+
+    private Integer platform;
+
+    private Integer status;
+
+    private Date endDate;
+
+    private Integer payType;
+
+    private static final long serialVersionUID = 1L;
+
+    public String getId() {
+        return id;
+    }
+
+    public UserSubscriptionInfo withId(String id) {
+        this.setId(id);
+        return this;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public UserSubscriptionInfo withUserId(String userId) {
+        this.setUserId(userId);
+        return this;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public Integer getPlatform() {
+        return platform;
+    }
+
+    public UserSubscriptionInfo withPlatform(Integer platform) {
+        this.setPlatform(platform);
+        return this;
+    }
+
+    public void setPlatform(Integer platform) {
+        this.platform = platform;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public UserSubscriptionInfo withStatus(Integer status) {
+        this.setStatus(status);
+        return this;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public UserSubscriptionInfo withEndDate(Date endDate) {
+        this.setEndDate(endDate);
+        return this;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public Integer getPayType() {
+        return payType;
+    }
+
+    public UserSubscriptionInfo withPayType(Integer payType) {
+        this.setPayType(payType);
+        return this;
+    }
+
+    public void setPayType(Integer payType) {
+        this.payType = payType;
+    }
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        UserSubscriptionInfo other = (UserSubscriptionInfo) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
+            && (this.getPlatform() == null ? other.getPlatform() == null : this.getPlatform().equals(other.getPlatform()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
+            && (this.getEndDate() == null ? other.getEndDate() == null : this.getEndDate().equals(other.getEndDate()))
+            && (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
+        result = prime * result + ((getPlatform() == null) ? 0 : getPlatform().hashCode());
+        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
+        result = prime * result + ((getEndDate() == null) ? 0 : getEndDate().hashCode());
+        result = prime * result + ((getPayType() == null) ? 0 : getPayType().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(", userId=").append(userId);
+        sb.append(", platform=").append(platform);
+        sb.append(", status=").append(status);
+        sb.append(", endDate=").append(endDate);
+        sb.append(", payType=").append(payType);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 591 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/model/UserSubscriptionInfoExample.java

@@ -0,0 +1,591 @@
+package cn.kdan.cloud.pdf.office.account.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class UserSubscriptionInfoExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public UserSubscriptionInfoExample() {
+        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 andUserIdIsNull() {
+            addCriterion("user_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIsNotNull() {
+            addCriterion("user_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdEqualTo(String value) {
+            addCriterion("user_id =", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotEqualTo(String value) {
+            addCriterion("user_id <>", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdGreaterThan(String value) {
+            addCriterion("user_id >", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdGreaterThanOrEqualTo(String value) {
+            addCriterion("user_id >=", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLessThan(String value) {
+            addCriterion("user_id <", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLessThanOrEqualTo(String value) {
+            addCriterion("user_id <=", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLike(String value) {
+            addCriterion("user_id like", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotLike(String value) {
+            addCriterion("user_id not like", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIn(List<String> values) {
+            addCriterion("user_id in", values, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotIn(List<String> values) {
+            addCriterion("user_id not in", values, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdBetween(String value1, String value2) {
+            addCriterion("user_id between", value1, value2, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotBetween(String value1, String value2) {
+            addCriterion("user_id not between", value1, value2, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformIsNull() {
+            addCriterion("platform is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformIsNotNull() {
+            addCriterion("platform is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformEqualTo(Integer value) {
+            addCriterion("platform =", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotEqualTo(Integer value) {
+            addCriterion("platform <>", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformGreaterThan(Integer value) {
+            addCriterion("platform >", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformGreaterThanOrEqualTo(Integer value) {
+            addCriterion("platform >=", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformLessThan(Integer value) {
+            addCriterion("platform <", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformLessThanOrEqualTo(Integer value) {
+            addCriterion("platform <=", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformIn(List<Integer> values) {
+            addCriterion("platform in", values, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotIn(List<Integer> values) {
+            addCriterion("platform not in", values, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformBetween(Integer value1, Integer value2) {
+            addCriterion("platform between", value1, value2, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotBetween(Integer value1, Integer value2) {
+            addCriterion("platform not between", value1, value2, "platform");
+            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(Integer value) {
+            addCriterion("`status` =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Integer value) {
+            addCriterion("`status` <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Integer value) {
+            addCriterion("`status` >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`status` >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Integer value) {
+            addCriterion("`status` <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("`status` <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Integer> values) {
+            addCriterion("`status` in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Integer> values) {
+            addCriterion("`status` not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Integer value1, Integer value2) {
+            addCriterion("`status` between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("`status` not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateIsNull() {
+            addCriterion("end_date is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateIsNotNull() {
+            addCriterion("end_date is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateEqualTo(Date value) {
+            addCriterion("end_date =", value, "endDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateNotEqualTo(Date value) {
+            addCriterion("end_date <>", value, "endDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateGreaterThan(Date value) {
+            addCriterion("end_date >", value, "endDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateGreaterThanOrEqualTo(Date value) {
+            addCriterion("end_date >=", value, "endDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateLessThan(Date value) {
+            addCriterion("end_date <", value, "endDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateLessThanOrEqualTo(Date value) {
+            addCriterion("end_date <=", value, "endDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateIn(List<Date> values) {
+            addCriterion("end_date in", values, "endDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateNotIn(List<Date> values) {
+            addCriterion("end_date not in", values, "endDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateBetween(Date value1, Date value2) {
+            addCriterion("end_date between", value1, value2, "endDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andEndDateNotBetween(Date value1, Date value2) {
+            addCriterion("end_date not between", value1, value2, "endDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeIsNull() {
+            addCriterion("pay_type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeIsNotNull() {
+            addCriterion("pay_type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeEqualTo(Integer value) {
+            addCriterion("pay_type =", value, "payType");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeNotEqualTo(Integer value) {
+            addCriterion("pay_type <>", value, "payType");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeGreaterThan(Integer value) {
+            addCriterion("pay_type >", value, "payType");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("pay_type >=", value, "payType");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeLessThan(Integer value) {
+            addCriterion("pay_type <", value, "payType");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("pay_type <=", value, "payType");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeIn(List<Integer> values) {
+            addCriterion("pay_type in", values, "payType");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeNotIn(List<Integer> values) {
+            addCriterion("pay_type not in", values, "payType");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeBetween(Integer value1, Integer value2) {
+            addCriterion("pay_type between", value1, value2, "payType");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("pay_type not between", value1, value2, "payType");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLikeInsensitive(String value) {
+            addCriterion("upper(id) like", value.toUpperCase(), "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLikeInsensitive(String value) {
+            addCriterion("upper(user_id) like", value.toUpperCase(), "userId");
+            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);
+        }
+    }
+}

+ 4 - 7
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/LoginDeviceService.java

@@ -1,9 +1,6 @@
 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.User;
-import cn.kdan.cloud.pdf.office.common.dto.UserRegisterDTO;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
 
 import java.util.List;
 
@@ -30,16 +27,16 @@ public interface LoginDeviceService {
      * 删除登录设备记录
      *
      * @param deviceSign 设备码
-     * @param appId 产品id
+     * @param userId userId
      */
-    void delete(String deviceSign, String appId);
+    void delete(String deviceSign, String userId);
 
     /**
      * 判断该设备是否已经登录该账号
      *
      * @param deviceSign 设备id
-     * @param appId appid
+     * @param userId userId
      * @return LoginDevice
      */
-    LoginDevice getByDeviceSignAndAppId(String deviceSign, String appId);
+    LoginDevice getByDeviceSignAndAppId(String deviceSign, String userId);
 }

+ 12 - 3
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/UserService.java

@@ -1,10 +1,11 @@
 package cn.kdan.cloud.pdf.office.account.service;
 
 import cn.kdan.cloud.pdf.office.api.account.vo.UserDetailVO;
+import cn.kdan.cloud.pdf.office.api.account.vo.UserInfoVO;
 import cn.kdan.cloud.pdf.office.api.account.vo.UserPageVO;
 import cn.kdan.cloud.pdf.office.api.account.dto.*;
 import cn.kdan.cloud.pdf.office.common.dto.UserRegisterDTO;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import com.github.pagehelper.PageInfo;
 import cn.kdan.cloud.pdf.office.account.model.User;
 
@@ -18,7 +19,7 @@ import java.util.List;
 public interface UserService {
 
 
-    UserInfoVO getById(String userId);
+    UserVO getById(String userId);
 
     User getUser(String userId);
 
@@ -59,7 +60,7 @@ public interface UserService {
      * @param platformType
      * @return
      */
-    UserInfoVO getByAppAccount(String account, String appId, String platformType);
+    UserVO getByAppAccount(String account, String appId, String platformType);
 
 
     /**
@@ -132,4 +133,12 @@ public interface UserService {
      * @param userId 用户id
      */
     void logOffForUser(String code, String userId);
+
+    /**
+     * 用户信息包括用户的会员信息
+     *
+     * @param id id
+     * @return UserInfoVO
+     */
+    UserInfoVO getInfoById(String id);
 }

+ 19 - 0
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/UserSubscriptionInfoService.java

@@ -0,0 +1,19 @@
+package cn.kdan.cloud.pdf.office.account.service;
+
+import cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfo;
+
+import java.util.List;
+
+/**
+ * 用户的会员服务
+ * @author tangxiangan
+ */
+public interface UserSubscriptionInfoService {
+
+    /**
+     * 获取用户的会员情况
+     * @param userId 用户id
+     * @return
+     */
+    List<UserSubscriptionInfo> listByUserId(String userId);
+}

+ 4 - 4
pdf-office-account/src/main/java/cn/kdan/cloud/pdf/office/account/service/impl/LoginDeviceServiceImpl.java

@@ -33,16 +33,16 @@ public class LoginDeviceServiceImpl implements LoginDeviceService {
     }
 
     @Override
-    public void delete(String deviceSign,String appId) {
+    public void delete(String deviceSign,String userId) {
         LoginDeviceExample example = new LoginDeviceExample();
-        example.createCriteria().andUniqueSnEqualTo(deviceSign).andAppIdEqualTo(appId);
+        example.createCriteria().andUniqueSnEqualTo(deviceSign).andUserIdEqualTo(userId);
         loginDeviceMapper.deleteByExample(example);
     }
 
     @Override
-    public LoginDevice getByDeviceSignAndAppId(String deviceSign, String appId) {
+    public LoginDevice getByDeviceSignAndAppId(String deviceSign, String userId) {
         LoginDeviceExample example = new LoginDeviceExample();
-        example.createCriteria().andUniqueSnEqualTo(deviceSign).andAppIdEqualTo(appId);
+        example.createCriteria().andUniqueSnEqualTo(deviceSign).andUserIdEqualTo(userId);
         List<LoginDevice> list = loginDeviceMapper.selectByExample(example);
         if(CollectionUtils.isEmpty(list)){
             return null;

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

@@ -4,10 +4,13 @@ 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.service.UserSubscriptionInfoService;
 import cn.kdan.cloud.pdf.office.account.utils.RSAUtils;
 import cn.kdan.cloud.pdf.office.api.account.vo.UserDetailVO;
+import cn.kdan.cloud.pdf.office.api.account.vo.UserInfoVO;
 import cn.kdan.cloud.pdf.office.api.account.vo.UserPageVO;
 import cn.kdan.cloud.pdf.office.api.account.dto.*;
+import cn.kdan.cloud.pdf.office.api.account.vo.UserSubscriptionInfoVO;
 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;
@@ -18,7 +21,7 @@ import cn.kdan.cloud.pdf.office.common.enums.account.PlatformTypeEnum;
 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.common.vo.UserVO;
 import cn.kdan.cloud.pdf.office.account.mapper.ext.ExtUserMapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -39,13 +42,15 @@ public class UserServiceImpl implements UserService {
     private ExtUserMapper userMapper;
     @Autowired
     private CompanyService companyService;
+    @Autowired
+    private UserSubscriptionInfoService userSubscriptionInfoService;
 
     @Autowired
     private RedisUtils<String, Object> redisUtils;
 
 
     @Override
-    public UserInfoVO getById(String userId) {
+    public UserVO getById(String userId) {
         return convert(userMapper.selectByPrimaryKey(userId));
     }
 
@@ -80,19 +85,19 @@ public class UserServiceImpl implements UserService {
     }
 
     @Override
-    public UserInfoVO getByAppAccount(String account,String appId,String platformType) {
+    public UserVO getByAppAccount(String account, String appId, String platformType) {
         List<User> list = userMapper.getByAccount(account,appId,Integer.parseInt(platformType));
         return CollectionUtils.isEmpty(list) ? null : convert(list.get(0));
     }
 
 
-    public UserInfoVO convert(User user) {
+    public UserVO convert(User user) {
         if(user == null){
-            return new UserInfoVO();
+            return new UserVO();
         }
-        UserInfoVO userInfoVO = new UserInfoVO();
-        BeanUtils.copyProperties(user, userInfoVO);
-        return userInfoVO;
+        UserVO userVO = new UserVO();
+        BeanUtils.copyProperties(user, userVO);
+        return userVO;
     }
 
     @Override
@@ -123,8 +128,8 @@ public class UserServiceImpl implements UserService {
         //账号类型 付费账号1 免费账号0 AccountTypeEnum
         user.setAccountType(AccountTypeEnum.PAID_ACCOUNT.value());
         //付费类型 0 试用 1单次购买 2订阅 3单次购买+订阅 4买断 PaidTypeEnum
-        user.setPayType(null);
-        user.setMemberType(updateUserForPaySuccessDTO.getMemberType());
+//        user.setPayType(null);
+//        user.setMemberType(updateUserForPaySuccessDTO.getMemberType());
         //0已注销(1订阅中2订阅过期3试用中4试用过期)PDFOfficeUserStatusEnum
         //用户如果在订阅中 然后给用户赠送了试用,那么状态还是订阅中(根据付费类型和当前状态来判断)
 
@@ -140,7 +145,7 @@ public class UserServiceImpl implements UserService {
         // 推线账号类型 付费账号1 免费账号0 AccountTypeEnum
         // user.setAccountType(AccountTypeEnum.PAID_ACCOUNT.value());
         //付费类型 0 试用 1单次购买 2订阅 3单次购买+订阅 4买断 PaidTypeEnum
-        user.setPayType(null);
+//        user.setPayType(null);
         //0已注销(1订阅中2订阅过期3试用中4试用过期)PDFOfficeUserStatusEnum
         user.setValidFlag(null);
         userMapper.updateByPrimaryKey(user);
@@ -212,6 +217,22 @@ public class UserServiceImpl implements UserService {
         handleLogOff(user,"用户手动注销");
     }
 
+    @Override
+    public UserInfoVO getInfoById(String id) {
+        UserInfoVO infoVO = new UserInfoVO();
+        User user = getUser(id);
+        BeanUtils.copyProperties(user,infoVO);
+        List<UserSubscriptionInfo> list = userSubscriptionInfoService.listByUserId(id);
+        List<UserSubscriptionInfoVO> voList = new ArrayList<>();
+        for (UserSubscriptionInfo userSubscriptionInfo : list) {
+            UserSubscriptionInfoVO vo = new UserSubscriptionInfoVO();
+            BeanUtils.copyProperties(userSubscriptionInfo,vo);
+            voList.add(vo);
+        }
+        infoVO.setSubscriptionInfoList(voList);
+        return infoVO;
+    }
+
     /**
      * 注销公共方法
      *

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

@@ -0,0 +1,28 @@
+package cn.kdan.cloud.pdf.office.account.service.impl;
+
+import cn.kdan.cloud.pdf.office.account.mapper.UserSubscriptionInfoMapper;
+import cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfo;
+import cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfoExample;
+import cn.kdan.cloud.pdf.office.account.service.UserSubscriptionInfoService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author tangxiangan
+ */
+@Service
+public class UserSubscriptionInfoServiceImpl implements UserSubscriptionInfoService {
+
+    @Resource
+    private UserSubscriptionInfoMapper userSubscriptionInfoMapper;
+
+
+    @Override
+    public List<UserSubscriptionInfo> listByUserId(String userId) {
+        UserSubscriptionInfoExample example = new UserSubscriptionInfoExample();
+        example.createCriteria().andUserIdEqualTo(userId);
+        return userSubscriptionInfoMapper.selectByExample(example);
+    }
+}

+ 9 - 6
pdf-office-account/src/main/resources/generatorConfig.xml

@@ -40,13 +40,16 @@
 			<property name="enableSubPackages" value="true" />
 		</javaClientGenerator>
 <!--		<table tableName="oauth_client_details"/>-->
-		<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"/>
+<!--		<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="remark" javaType="java.lang.String" jdbcType="VARCHAR"/>-->
+<!--		</table>-->
+		<table tableName="user_subscription_info">
+			<columnOverride column="platform" javaType="java.lang.Integer"/>
+			<columnOverride column="status" javaType="java.lang.Integer"/>
 			<columnOverride column="pay_type" javaType="java.lang.Integer"/>
-			<columnOverride column="remark" javaType="java.lang.String" jdbcType="VARCHAR"/>
 		</table>
 
 <!--		<table tableName="vpp_company">-->

+ 8 - 38
pdf-office-account/src/main/resources/sqlmap/UserMapper.xml

@@ -22,10 +22,8 @@
     <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="remark" jdbcType="VARCHAR" property="remark" />
     <result column="valid_flag" jdbcType="VARCHAR" property="validFlag" />
   </resultMap>
@@ -90,8 +88,8 @@
   <sql id="Base_Column_List">
     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, remark, valid_flag
+    `role`, job, area, platform_type, account_type, account_source, created_at, updated_at, 
+    remark, valid_flag
   </sql>
   <select id="selectByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.UserExample" resultMap="BaseResultMap">
     select
@@ -130,18 +128,18 @@
       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, 
-      remark, valid_flag)
+      account_type, account_source, created_at, 
+      updated_at, remark, 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}, 
       #{industry,jdbcType=VARCHAR}, #{lastPopularizeAt,jdbcType=INTEGER}, #{lastPresentedCouponAt,jdbcType=TIMESTAMP}, 
       #{mailable,jdbcType=INTEGER}, #{resetToken,jdbcType=INTEGER}, #{role,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}, 
-      #{remark,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR})
+      #{accountType,jdbcType=TINYINT}, #{accountSource,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, 
+      #{updatedAt,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="cn.kdan.cloud.pdf.office.account.model.User">
     insert into user
@@ -206,18 +204,12 @@
       <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="remark != null">
         remark,
       </if>
@@ -286,18 +278,12 @@
       <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="remark != null">
         #{remark,jdbcType=VARCHAR},
       </if>
@@ -375,18 +361,12 @@
       <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.remark != null">
         remark = #{record.remark,jdbcType=VARCHAR},
       </if>
@@ -420,10 +400,8 @@
       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},
       remark = #{record.remark,jdbcType=VARCHAR},
       valid_flag = #{record.validFlag,jdbcType=VARCHAR}
     <if test="_parameter != null">
@@ -490,18 +468,12 @@
       <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="remark != null">
         remark = #{remark,jdbcType=VARCHAR},
       </if>
@@ -532,10 +504,8 @@
       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},
       remark = #{remark,jdbcType=VARCHAR},
       valid_flag = #{validFlag,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}

+ 242 - 0
pdf-office-account/src/main/resources/sqlmap/UserSubscriptionInfoMapper.xml

@@ -0,0 +1,242 @@
+<?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.UserSubscriptionInfoMapper">
+  <resultMap id="BaseResultMap" type="cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfo">
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="user_id" jdbcType="VARCHAR" property="userId" />
+    <result column="platform" jdbcType="TINYINT" property="platform" />
+    <result column="status" jdbcType="TINYINT" property="status" />
+    <result column="end_date" jdbcType="TIMESTAMP" property="endDate" />
+    <result column="pay_type" jdbcType="TINYINT" property="payType" />
+  </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, user_id, platform, `status`, end_date, pay_type
+  </sql>
+  <select id="selectByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfoExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from user_subscription_info
+    <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 user_subscription_info
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from user_subscription_info
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfoExample">
+    delete from user_subscription_info
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfo">
+    insert into user_subscription_info (id, user_id, platform, 
+      `status`, end_date, pay_type
+      )
+    values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{platform,jdbcType=TINYINT}, 
+      #{status,jdbcType=TINYINT}, #{endDate,jdbcType=TIMESTAMP}, #{payType,jdbcType=TINYINT}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfo">
+    insert into user_subscription_info
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="userId != null">
+        user_id,
+      </if>
+      <if test="platform != null">
+        platform,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="endDate != null">
+        end_date,
+      </if>
+      <if test="payType != null">
+        pay_type,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="userId != null">
+        #{userId,jdbcType=VARCHAR},
+      </if>
+      <if test="platform != null">
+        #{platform,jdbcType=TINYINT},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=TINYINT},
+      </if>
+      <if test="endDate != null">
+        #{endDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="payType != null">
+        #{payType,jdbcType=TINYINT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfoExample" resultType="java.lang.Long">
+    select count(*) from user_subscription_info
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update user_subscription_info
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.userId != null">
+        user_id = #{record.userId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.platform != null">
+        platform = #{record.platform,jdbcType=TINYINT},
+      </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=TINYINT},
+      </if>
+      <if test="record.endDate != null">
+        end_date = #{record.endDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.payType != null">
+        pay_type = #{record.payType,jdbcType=TINYINT},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update user_subscription_info
+    set id = #{record.id,jdbcType=VARCHAR},
+      user_id = #{record.userId,jdbcType=VARCHAR},
+      platform = #{record.platform,jdbcType=TINYINT},
+      `status` = #{record.status,jdbcType=TINYINT},
+      end_date = #{record.endDate,jdbcType=TIMESTAMP},
+      pay_type = #{record.payType,jdbcType=TINYINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfo">
+    update user_subscription_info
+    <set>
+      <if test="userId != null">
+        user_id = #{userId,jdbcType=VARCHAR},
+      </if>
+      <if test="platform != null">
+        platform = #{platform,jdbcType=TINYINT},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=TINYINT},
+      </if>
+      <if test="endDate != null">
+        end_date = #{endDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="payType != null">
+        pay_type = #{payType,jdbcType=TINYINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfo">
+    update user_subscription_info
+    set user_id = #{userId,jdbcType=VARCHAR},
+      platform = #{platform,jdbcType=TINYINT},
+      `status` = #{status,jdbcType=TINYINT},
+      end_date = #{endDate,jdbcType=TIMESTAMP},
+      pay_type = #{payType,jdbcType=TINYINT}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByExampleWithRowbounds" parameterType="cn.kdan.cloud.pdf.office.account.model.UserSubscriptionInfoExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from user_subscription_info
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+</mapper>

+ 4 - 4
pdf-office-api/pdf-office-api-account/src/main/java/cn/kdan/cloud/pdf/office/api/account/feign/LoginDeviceApi.java

@@ -28,11 +28,11 @@ public interface LoginDeviceApi {
     /**
      * 删除登录设备记录
      * @param deviceSign
-     * @param appId
+     * @param userId
      * @return
      */
     @PostMapping("delete")
-    ResultMap<Boolean> delete(@RequestParam("deviceSign") String deviceSign, @RequestParam("appId") String appId) ;
+    ResultMap<Boolean> delete(@RequestParam("deviceSign") String deviceSign, @RequestParam("userId") String userId) ;
 
 
     /**
@@ -47,11 +47,11 @@ public interface LoginDeviceApi {
     /**
      * 获取登录设备记录
      * @param deviceSign
-     * @param appId
+     * @param userId
      * @return
      */
     @GetMapping("getByDeviceSignAndAppId")
-    ResultMap<LoginDevice> getByDeviceSignAndAppId(@RequestParam("deviceSign") String deviceSign, @RequestParam("appId") String appId) ;
+    ResultMap<LoginDevice> getByDeviceSignAndAppId(@RequestParam("deviceSign") String deviceSign, @RequestParam("userId") String userId) ;
 
 
 }

+ 16 - 9
pdf-office-api/pdf-office-api-account/src/main/java/cn/kdan/cloud/pdf/office/api/account/feign/UserApi.java

@@ -1,15 +1,14 @@
 package cn.kdan.cloud.pdf.office.api.account.feign;
 
 import cn.kdan.cloud.pdf.office.api.account.dto.*;
-import cn.kdan.cloud.pdf.office.api.account.feign.hystrix.OauthClientDetailsApiHystrix;
-import cn.kdan.cloud.pdf.office.api.account.feign.hystrix.UserHystrix;
 import cn.kdan.cloud.pdf.office.api.account.vo.UserDetailVO;
+import cn.kdan.cloud.pdf.office.api.account.vo.UserInfoVO;
 import cn.kdan.cloud.pdf.office.api.account.vo.UserPageVO;
 import cn.kdan.cloud.pdf.office.common.config.FeignConfig;
 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;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import com.github.pagehelper.PageInfo;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.stereotype.Component;
@@ -18,7 +17,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
-import java.security.Principal;
 import java.util.Date;
 import java.util.List;
 
@@ -29,14 +27,23 @@ public interface UserApi {
 
 
     @GetMapping(value = "getByAccount")
-    ResultMap<UserInfoVO> getByAccount(@RequestParam("account") String account);
+    ResultMap<UserVO> getByAccount(@RequestParam("account") String account);
 
 
     @GetMapping(value = "getByAppAccount")
-    ResultMap<UserInfoVO> getByAppAccount(@RequestParam("account") String account,@RequestParam("appId") String appId,@RequestParam("platformType") String platformType);
+    ResultMap<UserVO> getByAppAccount(@RequestParam("account") String account, @RequestParam("appId") String appId, @RequestParam("platformType") String platformType);
 
     @GetMapping(value = "getById")
-    ResultMap<UserInfoVO> getById(@RequestParam("id") String id);
+    ResultMap<UserVO> getById(@RequestParam("id") String id);
+
+    /**
+     * 用户信息包括用户的会员信息
+     *
+     * @param id id
+     * @return UserInfoVO
+     */
+    @GetMapping("getInfoById")
+    ResultMap<UserInfoVO> getInfoById(@RequestParam("id") String id);
 
     @PostMapping(value = "register")
     ResultMap<Boolean> register(@RequestBody UserRegisterDTO userRegisterDTO);
@@ -44,10 +51,10 @@ public interface UserApi {
     /**
      * 更新
      *
-     * @param userInfoVO
+     * @param userVO
      */
     @PostMapping("/updateUser")
-    ResultMap<Boolean> updateUser(@RequestBody UserInfoVO userInfoVO);
+    ResultMap<Boolean> updateUser(@RequestBody UserVO userVO);
 
     /**
      * 支付成功之后修改用户状态

+ 11 - 5
pdf-office-api/pdf-office-api-account/src/main/java/cn/kdan/cloud/pdf/office/api/account/feign/hystrix/UserHystrix.java

@@ -4,11 +4,12 @@ package cn.kdan.cloud.pdf.office.api.account.feign.hystrix;
 import cn.kdan.cloud.pdf.office.api.account.dto.*;
 import cn.kdan.cloud.pdf.office.api.account.feign.UserApi;
 import cn.kdan.cloud.pdf.office.api.account.vo.UserDetailVO;
+import cn.kdan.cloud.pdf.office.api.account.vo.UserInfoVO;
 import cn.kdan.cloud.pdf.office.api.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;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import com.github.pagehelper.PageInfo;
 import org.springframework.stereotype.Service;
 
@@ -18,17 +19,22 @@ import java.util.List;
 @Service
 public class UserHystrix implements UserApi {
     @Override
-    public ResultMap<UserInfoVO> getByAccount(String account) {
+    public ResultMap<UserVO> getByAccount(String account) {
         return new ResultMap<>(CommonConstant.ERROR, CommonConstant.RESULT_ERROR_SERVICE_NOT_AVAILABLE);
     }
 
     @Override
-    public ResultMap<UserInfoVO> getByAppAccount(String account, String appId, String platformType) {
+    public ResultMap<UserVO> getByAppAccount(String account, String appId, String platformType) {
         return new ResultMap<>(CommonConstant.ERROR, CommonConstant.RESULT_ERROR_SERVICE_NOT_AVAILABLE);
     }
 
     @Override
-    public ResultMap<UserInfoVO> getById(String id) {
+    public ResultMap<UserVO> getById(String id) {
+        return new ResultMap<>(CommonConstant.ERROR, CommonConstant.RESULT_ERROR_SERVICE_NOT_AVAILABLE);
+    }
+
+    @Override
+    public ResultMap<UserInfoVO> getInfoById(String id) {
         return new ResultMap<>(CommonConstant.ERROR, CommonConstant.RESULT_ERROR_SERVICE_NOT_AVAILABLE);
     }
 
@@ -38,7 +44,7 @@ public class UserHystrix implements UserApi {
     }
 
     @Override
-    public ResultMap<Boolean> updateUser(UserInfoVO userInfoVO) {
+    public ResultMap<Boolean> updateUser(UserVO userVO) {
         return new ResultMap<>(CommonConstant.ERROR, CommonConstant.RESULT_ERROR_SERVICE_NOT_AVAILABLE);
     }
 

+ 63 - 0
pdf-office-api/pdf-office-api-account/src/main/java/cn/kdan/cloud/pdf/office/api/account/vo/UserInfoVO.java

@@ -0,0 +1,63 @@
+package cn.kdan.cloud.pdf.office.api.account.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 个人信息类 主要返回前端使用
+ */
+@Data
+public class UserInfoVO {
+
+    private String id;
+
+    private String companyId;
+
+    private String appId;
+
+    private String email;
+
+    private String fullName;
+
+    private Integer subscriberType;
+
+    private Integer subscribed;
+
+    private String digestPassword;
+
+    private String phone;
+
+    private String industry;
+
+    private Integer lastPopularizeAt;
+
+    private Date lastPresentedCouponAt;
+
+    private Integer mailable;
+
+    private Integer resetToken;
+
+    private String role;
+
+    private String job;
+
+    private String area;
+
+    private Integer platformType;
+
+    private Integer accountType;
+
+    private Integer accountSource;
+
+    private Date createdAt;
+
+    private Date updatedAt;
+
+    private String remark;
+
+    private String validFlag;
+
+    private List<UserSubscriptionInfoVO> subscriptionInfoList;
+}

+ 18 - 0
pdf-office-api/pdf-office-api-account/src/main/java/cn/kdan/cloud/pdf/office/api/account/vo/UserSubscriptionInfoVO.java

@@ -0,0 +1,18 @@
+package cn.kdan.cloud.pdf.office.api.account.vo;
+
+import java.util.Date;
+
+public class UserSubscriptionInfoVO {
+    private String id;
+
+    private String userId;
+
+    private Integer platform;
+
+    private Integer status;
+
+    private Date endDate;
+
+    private Integer payType;
+
+}

+ 3 - 2
pdf-office-common/src/main/java/cn/kdan/cloud/pdf/office/common/enums/account/PDFOfficeUserStatusEnum.java

@@ -5,13 +5,14 @@ package cn.kdan.cloud.pdf.office.common.enums.account;
  * CD502000
  */
 public enum PDFOfficeUserStatusEnum {
-    //0已注销(1订阅中2订阅过期3试用中4试用过期)
+    //0已注销(1订阅中2订阅过期3试用中4试用过期5注销中
 
     LOGGED_OUT("0"),
     SUBSCRIPTION_IN_PROGRESS("1"),
     SUBSCRIPTION_EXPIRED("2"),
     TRIAL("3"),
-    TRIAL_EXPIRED("4");
+    TRIAL_EXPIRED("4"),
+    LOGGED_OUT_ING("5");
 
     private final String value;
 

+ 1 - 3
pdf-office-common/src/main/java/cn/kdan/cloud/pdf/office/common/vo/UserInfoVO.java

@@ -1,16 +1,14 @@
 package cn.kdan.cloud.pdf.office.common.vo;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
 import lombok.Data;
 
 import java.util.Date;
-import java.util.List;
 
 /**
  * 个人信息类 主要返回前端使用
  */
 @Data
-public class UserInfoVO {
+public class UserVO {
 
     private String id;
 

+ 2 - 2
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/PaddleWebhookServiceImpl.java

@@ -19,7 +19,7 @@ import cn.kdan.cloud.pdf.office.common.enums.account.PDFOfficeUserStatusEnum;
 import cn.kdan.cloud.pdf.office.common.enums.account.PaidTypeEnum;
 import cn.kdan.cloud.pdf.office.common.exception.BackendRuntimeException;
 import cn.kdan.cloud.pdf.office.common.utils.MyDateUtils;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import cn.kdan.cloud.pdf.office.payment.error.ErrorMessage;
 import cn.kdan.cloud.pdf.office.payment.service.OrdersService;
 import cn.kdan.cloud.pdf.office.payment.service.PaddleWebhookService;
@@ -70,7 +70,7 @@ public class PaddleWebhookServiceImpl implements PaddleWebhookService {
         creatSubscription.setThirdSubscriptionId(paddleWebhookDTO.getSubscriptionId());
         subscriptionsService.creatSubscription(creatSubscription);
         // 用户信息
-        UserInfoVO userInfo = userApi.getById(orderUpdate.getUserId()).getResult();
+        UserVO userInfo = userApi.getById(orderUpdate.getUserId()).getResult();
         // 订阅状态
         String validFlag = userInfo.getValidFlag();
         // 查询订单信息获取产品id

+ 3 - 3
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/SubscriptionsServiceImpl.java

@@ -10,7 +10,7 @@ import cn.kdan.cloud.pdf.office.api.product.enums.PlatformEnum;
 import cn.kdan.cloud.pdf.office.api.product.feign.ProductApi;
 import cn.kdan.cloud.pdf.office.api.product.vo.ProductVO;
 import cn.kdan.cloud.pdf.office.common.utils.MyDateUtils;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import cn.kdan.cloud.pdf.office.payment.client.PaddleClient;
 import cn.kdan.cloud.pdf.office.payment.entity.Subscription;
 import cn.kdan.cloud.pdf.office.payment.mapper.SubscriptionsMapper;
@@ -105,9 +105,9 @@ public class SubscriptionsServiceImpl extends ServiceImpl<SubscriptionsMapper, S
         this.creatSubscriptionManual(subscriptionManual);
         // 修改用户状态
         // 判断当前用户是否是订阅中
-        UserInfoVO userInfoVO = userApi.getById(subscriptionManual.getUserId()).getResult();
+        UserVO userVO = userApi.getById(subscriptionManual.getUserId()).getResult();
         // TODO 修改用户状态为试用中
-        String validFlag = userInfoVO.getValidFlag();
+        String validFlag = userVO.getValidFlag();
 //        UpdateUserForPaySuccessDTO successDTO = new UpdateUserForPaySuccessDTO();
 //        userApi.updateUserForPaySuccess(null);
         return null;

+ 2 - 2
pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/config/oauth/LoginAuthenticationProvider.java

@@ -4,7 +4,7 @@ import cn.kdan.cloud.pdf.office.api.account.feign.UserApi;
 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.JsonUtils;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import cn.kdan.cloud.pdf.office.sso.constant.AuthConstant;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,7 +44,7 @@ public class LoginAuthenticationProvider extends AbstractUserDetailsAuthenticati
         if (userDetails instanceof CustomUserDetails) {
             CustomUserDetails customUserDetails = (CustomUserDetails) userDetails;
             if (authentication.getCredentials() != null) {
-                UserInfoVO user = userService.getById(customUserDetails.getId()).getResult();
+                UserVO user = userService.getById(customUserDetails.getId()).getResult();
                 if (user != null) {
                     //判断密码是否正确
                     String presentedPassword = authentication.getCredentials().toString();

+ 2 - 3
pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/config/oauth/LoginAuthenticationSuccessHandler.java

@@ -5,7 +5,7 @@ import cn.kdan.cloud.pdf.office.common.constant.CommonConstant;
 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.JsonUtils;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import cn.kdan.cloud.pdf.office.sso.constant.AuthConstant;
 import cn.kdan.cloud.pdf.office.sso.service.AuthService;
 import lombok.Data;
@@ -18,7 +18,6 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.util.Collections;
 
 /**
  * @author tangxiangan
@@ -40,7 +39,7 @@ public class LoginAuthenticationSuccessHandler implements AuthenticationSuccessH
 //        //将authentication认证信息转换为json格式的字符串写到response里面去
         PrintWriter writer = response.getWriter();
         String userId = ((CustomUserDetails)authentication.getPrincipal()).getId();
-        UserInfoVO userInfVO = userService.getById(userId).getResult();
+        UserVO userInfVO = userService.getById(userId).getResult();
         String sessionId = request.getSession().getId();
 //        redisTemplate.set(SessionConstant.SESSION_+userId,sessionId);
         writer.write(JsonUtils.getJsonString(new ResultMap<>(CommonConstant.SUCCESS, AuthConstant.MSG_LOGIN_SUCCESS,userInfVO)));

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

@@ -95,6 +95,7 @@ public class AuthConstant {
 
     public static final String EXCEPTION_MSG_EMAIL_NOT_REGISTER = "当前账号未注册,点击下一步我们将为您注册账号";
 
+    public static final String EXCEPTION_MSG_EMAIL_LOGOUT_ING = "注销中,无法登录,若有问题可联系客服";
 
     public static final String EXCEPTION_MSG_USER_NOT_EXIST = "User is not exist";
 

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

@@ -92,22 +92,6 @@ public class AuthController {
         return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS, authService.emailLogin(email,password,appId,platformType,deviceSign,request));
     }
 
-    /**
-     * 登出(登出设备)
-     *
-     * @param deviceSign 设备号
-     * @param appId appId
-     * @param request 请求
-     * @param principal 凭证
-     * @return Boolean
-     */
-    @PostMapping("/logout")
-    public ResultMap<Boolean> logout(@RequestParam String deviceSign,@RequestParam String userId,@RequestParam String appId,HttpServletRequest request,Principal principal) {
-        String token = request.getHeader(HttpHeaders.AUTHORIZATION);
-        authService.logout(token,userId,deviceSign,appId);
-        return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS, Boolean.TRUE);
-    }
-
     /**
      * 邮箱注册
      *

+ 29 - 7
pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/controller/UserController.java

@@ -1,16 +1,16 @@
 package cn.kdan.cloud.pdf.office.sso.controller;
 
 import cn.kdan.cloud.pdf.office.api.account.feign.UserApi;
+import cn.kdan.cloud.pdf.office.api.account.vo.UserInfoVO;
 import cn.kdan.cloud.pdf.office.common.constant.CommonConstant;
 import cn.kdan.cloud.pdf.office.common.exception.BackendRuntimeException;
 import cn.kdan.cloud.pdf.office.common.pojo.ResultMap;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import cn.kdan.cloud.pdf.office.sso.service.AuthService;
 import cn.kdan.cloud.pdf.office.common.pojo.CustomUserDetails;
-import org.apache.http.HttpHeaders;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.oauth2.provider.OAuth2Authentication;
+import org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationDetails;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
@@ -33,7 +33,7 @@ public class UserController {
                 String userId = ((CustomUserDetails)((OAuth2Authentication)principal).getPrincipal()).getId();
                 authService.refreshToken(principal);
                 // 获取用户的基本信息
-                UserInfoVO user = userApi.getById(userId).getResult();
+                UserInfoVO user = userApi.getInfoById(userId).getResult();
                 user.setDigestPassword(null);
                 return user;
             }
@@ -52,15 +52,37 @@ public class UserController {
      */
     @PostMapping("/logout")
     public ResultMap<Boolean> logout(@RequestParam String deviceSign, @RequestParam String appId, HttpServletRequest request, Principal principal) {
-        String token = request.getHeader(HttpHeaders.AUTHORIZATION);
+        String token = getToken(principal);
         String userId = getUserId(principal);
         authService.logout(token,userId,deviceSign,appId);
         return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS, Boolean.TRUE);
     }
 
+    /**
+     * 用户自己手动注销
+     *
+     * @param code
+     * @return
+     */
+    @PostMapping("/logOffForUser")
+    public ResultMap<Boolean> logOffForUser(@RequestParam String code, Principal principal) {
+        String userId = getUserId(principal);
+        userApi.logOffForUser(code,userId).getResult();
+        UserVO userVO = userApi.getById(userId).getResult();
+        authService.logOutAll(userVO);
+        return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS,Boolean.TRUE);
+    }
+
     private String getUserId(Principal principal) {
-        if (principal instanceof UsernamePasswordAuthenticationToken) {
-            return ((CustomUserDetails) (((UsernamePasswordAuthenticationToken) principal).getPrincipal())).getId();
+        if (principal instanceof OAuth2Authentication) {
+            return ((CustomUserDetails) (((OAuth2Authentication) principal).getPrincipal())).getId();
+        }
+        throw new BackendRuntimeException(CommonConstant.EXCEPTION_MSG_LOGIN_USER_NOT_FOUND);
+    }
+
+    private String getToken(Principal principal) {
+        if (principal instanceof OAuth2Authentication) {
+            return ((OAuth2AuthenticationDetails) (((OAuth2Authentication) principal).getDetails())).getTokenValue();
         }
         throw new BackendRuntimeException(CommonConstant.EXCEPTION_MSG_LOGIN_USER_NOT_FOUND);
     }

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

@@ -5,6 +5,7 @@ import cn.kdan.cloud.pdf.office.common.dto.UserRegisterDTO;
 import cn.kdan.cloud.pdf.office.common.dto.UserResetPasswordDTO;
 import cn.kdan.cloud.pdf.office.common.enums.EmailCodeTypeEnum;
 import cn.kdan.cloud.pdf.office.common.vo.TokenVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import cn.kdan.cloud.pdf.office.sso.enums.VerifyTypeEnum;
 
 import javax.servlet.http.HttpServletRequest;
@@ -29,6 +30,12 @@ public interface AuthService {
      */
     TokenVO emailLogin(String email, String password, String appId, String platformType, String deviceSign, HttpServletRequest request);
 
+    /**
+     * 登出所有设备
+     *
+     * @param userVO
+     */
+    void logOutAll (UserVO userVO);
 
     /**
      * param

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

@@ -11,13 +11,14 @@ 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.dto.UserResetPasswordDTO;
 import cn.kdan.cloud.pdf.office.common.enums.EmailCodeTypeEnum;
+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.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;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import cn.kdan.cloud.pdf.office.sso.constant.AuthConstant;
 import cn.kdan.cloud.pdf.office.sso.enums.VerifyTypeEnum;
 import cn.kdan.cloud.pdf.office.sso.service.AuthService;
@@ -94,7 +95,7 @@ public class AuthServiceImpl implements AuthService {
     @Override
     public String getAuthorizeCode(String userId,String clientId, HttpServletRequest request) {
         //获取用户的基本信息
-        UserInfoVO userInfoVO = userApi.getById(userId).getResult();
+        UserVO userVO = userApi.getById(userId).getResult();
         Principal principal = request.getUserPrincipal();
         Map<String, Object> model = new HashMap<>();
         Map<String,String> params = new HashMap<>();
@@ -132,19 +133,19 @@ public class AuthServiceImpl implements AuthService {
     }
 
     @Override
-    public TokenVO emailLogin(String email, String password, String appId, String platformType, String deviceSign,HttpServletRequest request) {
+    public TokenVO  emailLogin(String email, String password, String appId, String platformType, String deviceSign,HttpServletRequest request) {
         //如果是管理平台就去查管理平台的用户表
-        UserInfoVO userInfoVO = userApi.getByAppAccount(email,appId,platformType).getResult();
+        UserVO userVO = userApi.getByAppAccount(email,appId,platformType).getResult();
         //检查用户存在
-        checkUser(userInfoVO);
-        checkPassword(password,userInfoVO.getDigestPassword());
+        checkUser(userVO);
+        checkPassword(password, userVO.getDigestPassword());
         //检查邮件验证码
         // checkEmailCodeValid(EmailCodeTypeEnum.LOGIN,email,code);
         // 检查设备是否达到上限
-        checkLoginDeviceNum(userInfoVO.getId(), deviceSign);
-        TokenVO vo = getTokenByUser(password, userInfoVO);
+        checkLoginDeviceNum(userVO.getId(), deviceSign, appId);
+        TokenVO vo = getTokenByUser(password, userVO);
         //关联设备登录
-        relateTokenAndDevice(vo.getAccess_token(), userInfoVO.getId(), deviceSign, appId);
+        relateTokenAndDevice(vo.getAccess_token(), userVO.getId(), deviceSign, appId);
         return vo;
     }
 
@@ -161,12 +162,12 @@ public class AuthServiceImpl implements AuthService {
         ResultMap<Boolean> resultMap = userApi.register(userRegisterDTO);
         if(resultMap.getCode() == CommonConstant.SUCCESS){
             //如果是管理平台就去查管理平台的用户表
-            UserInfoVO userInfoVO = userApi.getByAppAccount(userRegisterDTO.getUsername(),
+            UserVO userVO = userApi.getByAppAccount(userRegisterDTO.getUsername(),
                     userRegisterDTO.getAppId(),userRegisterDTO.getPlatformType()).getResult();
             //生成token
-            TokenVO vo = getTokenByUser(CommonUtils.generateDateId(), userInfoVO);
+            TokenVO vo = getTokenByUser(CommonUtils.generateDateId(), userVO);
             //关联设备登录
-            relateTokenAndDevice(vo.getAccess_token(), userInfoVO.getId(), userRegisterDTO.getDeviceSign(), userRegisterDTO.getAppId());
+            relateTokenAndDevice(vo.getAccess_token(), userVO.getId(), userRegisterDTO.getDeviceSign(), userRegisterDTO.getAppId());
             return vo;
         }
         throw new BackendRuntimeException(AuthConstant.EMAIL_REGISTER_ERROR);
@@ -186,11 +187,23 @@ public class AuthServiceImpl implements AuthService {
         if(userResetPasswordDTO.getFirstPassword().length()>6&&userResetPasswordDTO.getFirstPassword().length()>24){
             throw new BackendRuntimeException(AuthConstant.EXCEPTION_MSG_PASSWORD_SIZE_MAX);
         }
-        UserInfoVO userInfoVO = userApi.getByAppAccount(userResetPasswordDTO.getAccount(),userResetPasswordDTO.getAppId(),userResetPasswordDTO.getPlatformType()).getResult();
+        UserVO userVO = userApi.getByAppAccount(userResetPasswordDTO.getAccount(),userResetPasswordDTO.getAppId(),userResetPasswordDTO.getPlatformType()).getResult();
         //修改密码
-        userInfoVO.setUpdatedAt(new Date());
-        userInfoVO.setDigestPassword(new RSAUtils().encrypt(userResetPasswordDTO.getFirstPassword()));
-        userApi.updateUser(userInfoVO);
+        userVO.setUpdatedAt(new Date());
+        userVO.setDigestPassword(new RSAUtils().encrypt(userResetPasswordDTO.getFirstPassword()));
+        userApi.updateUser(userVO);
+        logOutAll(userVO);
+    }
+
+    @Override
+    public void logOutAll(UserVO userVO) {
+        List<LoginDevice> list = loginDeviceApi.getByUserId(userVO.getId()).getResult();
+        list.forEach( item ->{
+                    String token = redisUtils.hget(userVO.getAppId() + AuthConstant.DEVICE_LOGIN_TOKEN_KEY,
+                            userVO.getId() + CommonConstant.STRIKE_THROUGH + item.getUniqueSn());
+                    logout(token, userVO.getId(),item.getUniqueSn(), userVO.getAppId());
+                }
+        );
     }
 
 
@@ -262,9 +275,9 @@ public class AuthServiceImpl implements AuthService {
         Map<String,String> titleMap = new HashMap<>();
         //设置内容
         Map<String,String> contentMap = new HashMap<>();
+        contentMap.put("@code@",code);
         //注册
         if(action.value().equals(EmailCodeTypeEnum.USER_REGISTER.value())){
-            contentMap.put("@code@",code);
         }
         bo.setSendTitleContent(titleMap);
         //设置内容
@@ -291,11 +304,15 @@ public class AuthServiceImpl implements AuthService {
     /**
      * 判断用户是否存在
      *
-     * @param userInfoVO
+     * @param userVO
      */
-    private void checkUser(UserInfoVO userInfoVO) {
-        if (ObjectUtils.isEmpty(userInfoVO)) {
-            throw new BackendRuntimeException(AuthConstant.EXCEPTION_MSG_EMAIL_EXIST);
+    private void checkUser(UserVO userVO) {
+        if (ObjectUtils.isEmpty(userVO)) {
+            throw new BackendRuntimeException(AuthConstant.EXCEPTION_MSG_EMAIL_NOT_REGISTER);
+        }
+        //注销中的用户无法登陆
+        if(userVO.getValidFlag().equals(PDFOfficeUserStatusEnum.LOGGED_OUT_ING.value())){
+            throw new BackendRuntimeException(AuthConstant.EXCEPTION_MSG_EMAIL_LOGOUT_ING);
         }
     }
 
@@ -304,11 +321,22 @@ public class AuthServiceImpl implements AuthService {
      * @param userId 用户id
      * @param deviceSign 设备
      */
-    private void checkLoginDeviceNum(String userId, String deviceSign) {
+    private void checkLoginDeviceNum(String userId, String deviceSign, String appId) {
         //根据userId查询如果list>2,并且设备号不属于其中的某一个
         List<LoginDevice> list = loginDeviceApi.getByUserId(userId).getResult();
-        List<String> snList = list.stream().map(LoginDevice::getUniqueSn).collect(Collectors.toList());
-        if (CollectionUtils.isNotEmpty(list)&&list.size() >= 2&&!snList.contains(deviceSign)) {
+        //验证token有效性,如果token已经过期则删除对应登录设备信息
+        list.forEach(item->{
+            String token = redisUtils.hget(appId + AuthConstant.DEVICE_LOGIN_TOKEN_KEY, userId + CommonConstant.STRIKE_THROUGH + deviceSign);
+            OAuth2AccessToken oAuth2AccessToken = tokenStore.readAccessToken(token);
+            //如果token过期了,删除设备登录记录
+            if(ObjectUtils.isEmpty(oAuth2AccessToken)||oAuth2AccessToken.isExpired()){
+               loginDeviceApi.delete(deviceSign,userId);
+            }
+        });
+        //查询经过处理后的设备记录
+        List<LoginDevice> finalList = loginDeviceApi.getByUserId(userId).getResult();
+        List<String> snList = finalList.stream().map(LoginDevice::getUniqueSn).collect(Collectors.toList());
+        if (CollectionUtils.isNotEmpty(finalList)&&finalList.size() >= 2&&!snList.contains(deviceSign)) {
             throw new BackendRuntimeException(AuthConstant.EXCEPTION_MSG_DEVICE_NUM_MAX);
         }
     }
@@ -347,10 +375,10 @@ public class AuthServiceImpl implements AuthService {
         }
     }
 
-    private TokenVO getTokenByUser(String code, UserInfoVO userInfoVO) {
+    private TokenVO getTokenByUser(String code, UserVO userVO) {
         Set<SimpleGrantedAuthority> authorities = new LinkedHashSet<>();
-        String account = userInfoVO.getId();
-        CustomUserDetails principal = new CustomUserDetails(userInfoVO.getId(),
+        String account = userVO.getId();
+        CustomUserDetails principal = new CustomUserDetails(userVO.getId(),
                 account,
                 code,
                 true,
@@ -377,7 +405,7 @@ public class AuthServiceImpl implements AuthService {
      * @param appId
      */
     private void relateTokenAndDevice(String token,String userId,String deviceSign,String appId) {
-        LoginDevice loginDevice = loginDeviceApi.getByDeviceSignAndAppId(deviceSign,appId).getResult();
+        LoginDevice loginDevice = loginDeviceApi.getByDeviceSignAndAppId(deviceSign,userId).getResult();
         if(ObjectUtils.isEmpty(loginDevice)){
             //如果账号在该设备没有登录过
             LoginDevice loginDeviceBo = new LoginDevice();
@@ -393,7 +421,7 @@ public class AuthServiceImpl implements AuthService {
 
     private void deleteTokenAndDevice(String userId, String deviceSign, String appId) {
         // 登录设备表删除数据关联用户
-        loginDeviceApi.delete(deviceSign, appId);
+        loginDeviceApi.delete(deviceSign, userId);
         redisUtils.hdel(appId + AuthConstant.DEVICE_LOGIN_TOKEN_KEY, userId + CommonConstant.STRIKE_THROUGH + deviceSign);
     }
 

+ 2 - 3
pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/service/impl/CustomUserDetailsServiceImpl.java

@@ -2,11 +2,10 @@ package cn.kdan.cloud.pdf.office.sso.service.impl;
 
 import cn.kdan.cloud.pdf.office.api.account.feign.UserApi;
 import cn.kdan.cloud.pdf.office.common.utils.JsonUtils;
-import cn.kdan.cloud.pdf.office.common.vo.UserInfoVO;
+import cn.kdan.cloud.pdf.office.common.vo.UserVO;
 import cn.kdan.cloud.pdf.office.sso.constant.AuthConstant;
 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.RedisUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.security.core.userdetails.UserDetailsService;
@@ -25,7 +24,7 @@ public class CustomUserDetailsServiceImpl implements UserDetailsService {
 
     @Override
     public UserDetails loadUserByUsername(String account) throws UsernameNotFoundException {
-        UserInfoVO user = userApi.getByAccount(account).getResult();
+        UserVO user = userApi.getByAccount(account).getResult();
         if (ObjectUtils.isEmpty(user)) {
             throw new UsernameNotFoundException(JsonUtils.getJsonString(new ResultMap<>(AuthConstant.EXCEPTION_CODE_USER_NOT_FOUND, AuthConstant.EXCEPTION_MSG_USER_NOT_FOUND)));
         }

+ 2 - 3
pdf-office-system/pom.xml

@@ -91,10 +91,9 @@
             <artifactId>spring-boot-starter-security</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.springframework.security.oauth.boot</groupId>
-            <artifactId>spring-security-oauth2-autoconfigure</artifactId>
+            <groupId>org.springframework.security.oauth</groupId>
+            <artifactId>spring-security-oauth2</artifactId>
         </dependency>
-        <!-- end -->
 
     </dependencies>
     <dependencyManagement>

+ 0 - 13
pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/controller/UserController.java

@@ -102,19 +102,6 @@ public class UserController {
         return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS,Boolean.TRUE);
     }
 
-    /**
-     * 用户自己手动注销
-     *
-     * @param code
-     * @return
-     */
-    @PostMapping("/logOffForUser")
-    public ResultMap<Boolean> logOffForUser(@RequestParam String code, Principal principal) {
-        String userId = me(principal);
-        userApi.logOffForUser(code,userId).getResult();
-        return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS,Boolean.TRUE);
-    }
-
 
     /**
      * 返回用户id