From 20de831fb2ff47c38a7749400dadc4919e62dd43 Mon Sep 17 00:00:00 2001
From: zxc <954985706@qq.com>
Date: Wed, 15 Jul 2020 16:53:46 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=AC=AC=E4=B8=89=E6=96=B9?=
=?UTF-8?q?=E5=B9=B3=E5=8F=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../commons/tools/constant/NumConstant.java | 1 +
.../main/java/com/epmet/dto/AuthCodeDTO.java | 11 +-
.../com/epmet/dto/AuthResultRecordDTO.java | 116 ++++++
.../com/epmet/dto/AuthorizationInfoDTO.java | 8 +-
...ssTokenDTO.java => BindingAccountDTO.java} | 40 +-
.../java/com/epmet/dto/BusinessInfoDTO.java | 96 +++++
.../com/epmet/dto/CodeAuditRecordDTO.java | 144 +++++++
.../epmet/dto/ComponentAccessTokenDTO.java | 6 +-
.../epmet/dto/ComponentVerifyTicketDTO.java | 4 +-
.../main/java/com/epmet/dto/FuncInfoDTO.java | 2 +-
.../com/epmet/dto/MiniCategoryInfoDTO.java | 96 +++++
.../main/java/com/epmet/dto/MiniInfoDTO.java | 121 ++++++
.../com/epmet/dto/MiniNetworkInfoDTO.java | 96 +++++
...enDTO.java => OpenPlatformAccountDTO.java} | 26 +-
.../main/java/com/epmet/dto/PaInfoDTO.java | 129 ++++++
.../java/com/epmet/dto/PreAuthTokenDTO.java | 6 +-
.../com/epmet/dto/form/AuthCodeFormDTO.java | 8 +-
.../dto/form/AuthorizationInfoFormDTO.java | 7 +-
.../form/AuthorizerAccessTokenFormDTO.java | 2 +-
.../epmet/dto/form/BindingAccountFormDTO.java | 40 ++
.../epmet/dto/form/BusinessInfoFormDTO.java | 60 +++
.../dto/form/CodeAuditRecordFormDTO.java | 115 ++++++
.../dto/form/ComponentAccessTokenFormDTO.java | 3 +-
.../form/ComponentVerifyTicketFormDTO.java | 2 +-
.../com/epmet/dto/form/CreateOpenFormDTO.java | 48 +++
.../com/epmet/dto/form/GoToAuthFormDTO.java | 26 ++
.../dto/form/MiniCategoryInfoFormDTO.java | 60 +++
.../com/epmet/dto/form/MiniInfoFormDTO.java | 76 ++++
.../dto/form/MiniNetworkInfoFormDTO.java | 60 +++
.../com/epmet/dto/form/PaInfoFormDTO.java | 95 +++++
.../epmet/dto/form/PreAuthTokenFormDTO.java | 3 +-
.../epmet/dto/result/AuthCodeResultDTO.java | 26 ++
.../result/AuthorizationInfoResultDTO.java | 2 +-
.../epmet/dto/result/CreateOpenResultDTO.java | 36 ++
.../result/CustomerIdAndClientResultDTO.java | 25 ++
.../epmet/dto/result/GoToAuthResultDTO.java | 45 ++
.../dto/result/TemplateAndAppIdResultDTO.java | 26 ++
.../dto/result/WillOverDueResultDTO.java | 5 +
.../epmet-third/epmet-third-server/pom.xml | 2 +-
.../com/epmet/constant/ModuleConstant.java | 37 ++
.../constant/TencentAuthTypeConstant.java | 33 ++
.../com/epmet/constant/ThirdApiConstant.java | 35 +-
.../epmet/constant/ThirdPlatformConstant.java | 6 +-
.../epmet/constant/ThirdRedisKeyConstant.java | 7 +-
.../constant/ThirdRunTimeInfoConstant.java | 34 ++
.../AppLetAuthorizationController.java | 39 ++
.../controller/AuthRedirectController.java | 9 +-
.../controller/WeChatNotifyController.java | 6 +
.../main/java/com/epmet/dao/AuthCodeDao.java | 23 ++
...TokenDao.java => AuthResultRecordDao.java} | 8 +-
.../com/epmet/dao/AuthorizationInfoDao.java | 27 +-
.../java/com/epmet/dao/BindingAccountDao.java | 41 ++
.../java/com/epmet/dao/BusinessInfoDao.java | 44 ++
.../com/epmet/dao/CodeAuditRecordDao.java | 41 ++
.../com/epmet/dao/CodeAuditResultDao.java | 13 +-
.../java/com/epmet/dao/CodeCustomerDao.java | 20 +-
.../epmet/dao/ComponentAccessTokenDao.java | 21 +
.../epmet/dao/ComponentVerifyTicketDao.java | 12 +
.../java/com/epmet/dao/CustomerMpDao.java | 32 ++
.../com/epmet/dao/MiniCategoryInfoDao.java | 44 ++
.../main/java/com/epmet/dao/MiniInfoDao.java | 50 +++
.../com/epmet/dao/MiniNetworkInfoDao.java | 44 ++
...enDao.java => OpenPlatformAccountDao.java} | 34 +-
.../main/java/com/epmet/dao/PaInfoDao.java | 42 ++
.../java/com/epmet/entity/AuthCodeEntity.java | 11 +-
.../epmet/entity/AuthResultRecordEntity.java | 86 ++++
.../epmet/entity/AuthorizationInfoEntity.java | 8 +-
...nEntity.java => BindingAccountEntity.java} | 29 +-
.../com/epmet/entity/BusinessInfoEntity.java | 66 +++
.../epmet/entity/CodeAuditRecordEntity.java | 114 +++++
.../entity/ComponentAccessTokenEntity.java | 6 +-
.../entity/ComponentVerifyTicketEntity.java | 2 +-
.../java/com/epmet/entity/FuncInfoEntity.java | 2 +-
.../epmet/entity/MiniCategoryInfoEntity.java | 66 +++
.../java/com/epmet/entity/MiniInfoEntity.java | 91 ++++
.../epmet/entity/MiniNetworkInfoEntity.java | 66 +++
...ty.java => OpenPlatformAccountEntity.java} | 17 +-
.../java/com/epmet/entity/PaInfoEntity.java | 99 +++++
.../com/epmet/entity/PreAuthTokenEntity.java | 6 +-
.../main/java/com/epmet/redis/RedisThird.java | 43 +-
.../service/AppLetAuthorizationService.java | 20 +
.../service/ComponentVerifyTicketService.java | 6 +-
.../impl/AppLetAuthorizationServiceImpl.java | 60 +++
.../ComponentVerifyTicketServiceImpl.java | 391 ++++++++++++++----
.../service/impl/WarrantServiceImpl.java | 122 +++++-
.../java/com/epmet/util/WXXmlToMapUtil.java | 2 +-
.../src/main/resources/bootstrap.yml | 9 +-
.../src/main/resources/mapper/AuthCodeDao.xml | 41 +-
.../resources/mapper/AuthResultRecordDao.xml | 6 +
.../resources/mapper/AuthorizationInfoDao.xml | 62 ++-
.../mapper/AuthorizerRefreshTokenDao.xml | 11 -
.../resources/mapper/BindingAccountDao.xml | 24 ++
.../main/resources/mapper/BusinessInfoDao.xml | 27 ++
.../resources/mapper/CodeAuditRecordDao.xml | 35 ++
.../resources/mapper/CodeAuditResultDao.xml | 22 +-
.../main/resources/mapper/CodeCustomerDao.xml | 45 +-
.../mapper/ComponentAccessTokenDao.xml | 33 +-
.../mapper/ComponentVerifyTicketDao.xml | 22 +-
.../main/resources/mapper/CustomerMpDao.xml | 42 ++
.../src/main/resources/mapper/FuncInfoDao.xml | 13 -
.../resources/mapper/MiniCategoryInfoDao.xml | 27 ++
.../src/main/resources/mapper/MiniInfoDao.xml | 55 +++
.../resources/mapper/MiniNetworkInfoDao.xml | 27 ++
.../mapper/OpenFlatformAccountDao.xml | 36 ++
.../resources/mapper/PaCustomerAgencyDao.xml | 2 +-
.../src/main/resources/mapper/PaInfoDao.xml | 34 ++
.../main/resources/mapper/PreAuthTokenDao.xml | 4 +-
.../RefreshAuthorizerAccessTokenDao.xml | 57 ---
108 files changed, 3889 insertions(+), 434 deletions(-)
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthResultRecordDTO.java
rename epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/{RefreshAuthorizerAccessTokenDTO.java => BindingAccountDTO.java} (70%)
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BusinessInfoDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditRecordDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniCategoryInfoDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniInfoDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniNetworkInfoDTO.java
rename epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/{AuthorizerRefreshTokenDTO.java => OpenPlatformAccountDTO.java} (78%)
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaInfoDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BindingAccountFormDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BusinessInfoFormDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeAuditRecordFormDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CreateOpenFormDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GoToAuthFormDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniCategoryInfoFormDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniInfoFormDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniNetworkInfoFormDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PaInfoFormDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthCodeResultDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CreateOpenResultDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerIdAndClientResultDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GoToAuthResultDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateAndAppIdResultDTO.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/TencentAuthTypeConstant.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java
rename epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/{AuthorizerRefreshTokenDao.java => AuthResultRecordDao.java} (81%)
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BindingAccountDao.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditRecordDao.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java
rename epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/{RefreshAuthorizerAccessTokenDao.java => OpenPlatformAccountDao.java} (54%)
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaInfoDao.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthResultRecordEntity.java
rename epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/{RefreshAuthorizerAccessTokenEntity.java => BindingAccountEntity.java} (72%)
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BusinessInfoEntity.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditRecordEntity.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniCategoryInfoEntity.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniInfoEntity.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniNetworkInfoEntity.java
rename epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/{AuthorizerRefreshTokenEntity.java => OpenPlatformAccountEntity.java} (79%)
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaInfoEntity.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthResultRecordDao.xml
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BindingAccountDao.xml
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BusinessInfoDao.xml
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditRecordDao.xml
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniNetworkInfoDao.xml
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenFlatformAccountDao.xml
create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaInfoDao.xml
delete mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/RefreshAuthorizerAccessTokenDao.xml
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
index 8529ad013b..c6d5234ddd 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
@@ -49,5 +49,6 @@ public interface NumConstant {
String THREE_STR = "3";
String FOUR_STR = "4";
String FIVE_STR = "5";
+ String POSITIVE_EIGHT_STR = "+8";
}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthCodeDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthCodeDTO.java
index 59dce8901d..5f8d148691 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthCodeDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthCodeDTO.java
@@ -26,7 +26,7 @@ import lombok.Data;
* 授权回调url反参表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
public class AuthCodeDTO implements Serializable {
@@ -43,6 +43,11 @@ public class AuthCodeDTO implements Serializable {
*/
private String customerId;
+ /**
+ * resi:居民端,work:工作端
+ */
+ private String clientType;
+
/**
* 授权方APPID
*/
@@ -54,9 +59,9 @@ public class AuthCodeDTO implements Serializable {
private String authCode;
/**
- * 有效期 10min
+ * 到期时间
*/
- private Integer expiresIn;
+ private Date expiresInTime;
/**
*
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthResultRecordDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthResultRecordDTO.java
new file mode 100644
index 0000000000..6d64c5af52
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthResultRecordDTO.java
@@ -0,0 +1,116 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 授权结果记录表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-15
+ */
+@Data
+public class AuthResultRecordDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID ID
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 第三方平台AppId 第三方平台AppId
+ */
+ private String componentAppId;
+
+ /**
+ * 微信返回创建时间 微信返回创建时间
+ */
+ private Date wechatCreateTime;
+
+ /**
+ * 通知类型
+ */
+ private String infoType;
+
+ /**
+ * 授权方AppId
+ */
+ private String authorizerAppId;
+
+ /**
+ * 授权码(auth_code)
+ */
+ private String authorizationCode;
+
+ /**
+ * 授权码过期时间
+ */
+ private Date expiresInTime;
+
+ /**
+ * 预授权码
+ */
+ private String preAuthCode;
+
+ /**
+ * 删除状态
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthorizationInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthorizationInfoDTO.java
index ebdc051c24..394b8680bc 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthorizationInfoDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthorizationInfoDTO.java
@@ -26,7 +26,7 @@ import lombok.Data;
* 授权信息表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
public class AuthorizationInfoDTO implements Serializable {
@@ -49,14 +49,14 @@ public class AuthorizationInfoDTO implements Serializable {
private String authorizerAppid;
/**
- * 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值)
+ * 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值)【第三方和微信交互使用】
*/
private String authorizerAccessToken;
/**
- * authorizer_access_token 的有效期(在授权的公众号/小程序具备API权限时,才有此返回值),单位:秒
+ * 到期时间
*/
- private Integer expiresIn;
+ private Date expiresInTime;
/**
* 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/RefreshAuthorizerAccessTokenDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BindingAccountDTO.java
similarity index 70%
rename from epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/RefreshAuthorizerAccessTokenDTO.java
rename to epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BindingAccountDTO.java
index aed9b812f7..87a4abdaac 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/RefreshAuthorizerAccessTokenDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BindingAccountDTO.java
@@ -23,68 +23,68 @@ import lombok.Data;
/**
- * 获取/刷新接口调用令牌记录表
+ * 公众号/小程序绑定开放平台帐号表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
-public class RefreshAuthorizerAccessTokenDTO implements Serializable {
+public class BindingAccountDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
- *
+ * id ID
*/
private String id;
/**
- * 授权方令牌
+ * 开放平台账号ID 开放平台账号ID
*/
- private String authorizerAccessToken;
+ private String openPlatformAccountId;
/**
- * 有效期,单位:秒
+ * 公众号/小程序APPID(授权方APPID) 授权方APPID
*/
- private Integer expiresIn;
+ private String authAppId;
/**
- * 刷新令牌
+ * 客户ID 客户ID
*/
- private String authorizerRefreshToken;
+ private String customerId;
/**
- * 授权方APPID
+ * 客户端 居民端:resi,工作端:work
*/
- private String authAppid;
+ private String clientType;
/**
- * 客户ID
+ *
*/
- private String customerId;
+ private Integer delFlag;
/**
- *
+ * 乐观锁
*/
- private Integer delFlag;
+ private Integer revision;
/**
- *
+ * 创建人
*/
private String createdBy;
/**
- *
+ * 创建时间
*/
private Date createdTime;
/**
- *
+ * 更新人
*/
private String updatedBy;
/**
- *
+ * 更新时间
*/
private Date updatedTime;
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BusinessInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BusinessInfoDTO.java
new file mode 100644
index 0000000000..e29f749675
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BusinessInfoDTO.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 功能开通状况表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-14
+ */
+@Data
+public class BusinessInfoDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 主表ID
+ */
+ private String primaryId;
+
+ /**
+ * 功能类型 open_store:是否开通微信门店功能 open_scan:是否开通微信扫商品功能 open_pay:是否开通微信支付功能 open_card:是否开通微信卡券功能 open_shake:是否开通微信摇一摇功能
+ */
+ private String funcType;
+
+ /**
+ * 开通状态 0:未开通,1:已开通
+ */
+ private Integer openStatus;
+
+ /**
+ * 删除状态 0:正常,1:删除
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditRecordDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditRecordDTO.java
new file mode 100644
index 0000000000..014490dad5
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditRecordDTO.java
@@ -0,0 +1,144 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 代码审核记录表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-15
+ */
+@Data
+public class CodeAuditRecordDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 模板ID
+ */
+ private String templateId;
+
+ /**
+ * 客户端类型:resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 授权方AppId
+ */
+ private String authAppId;
+
+ /**
+ * 小程序的原始 ID
+ */
+ private String toUserName;
+
+ /**
+ * 发送方帐号(一个 OpenID,此时发送方是系统帐号)
+ */
+ private String fromUserName;
+
+ /**
+ * 消息创建时间 (整型),时间戳
+ */
+ private Date wechatCreateTime;
+
+ /**
+ * 消息类型 event
+ */
+ private String msgType;
+
+ /**
+ * 事件类型
+weapp_audit_success:审核通过,
+weapp_audit_fail:审核不通过,
+weapp_audit_delay:审核延后
+ */
+ private String event;
+
+ /**
+ * 审核成功时的时间戳
+ */
+ private Date succTime;
+
+ /**
+ * 审核不通过的时间戳
+ */
+ private Date failTime;
+
+ /**
+ * 审核延后时的时间戳
+ */
+ private Date delayTime;
+
+ /**
+ * 审核不通过的原因
+ */
+ private String reason;
+
+ /**
+ * 审核不通过的截图示例。用 | 分隔的 media_id 的列表,可通过获取永久素材接口拉取截图内容
+ */
+ private String screenShot;
+
+ /**
+ * 删除状态
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentAccessTokenDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentAccessTokenDTO.java
index 630898d5db..037f39a214 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentAccessTokenDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentAccessTokenDTO.java
@@ -26,7 +26,7 @@ import lombok.Data;
* 第三方平台调用凭证
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
public class ComponentAccessTokenDTO implements Serializable {
@@ -44,9 +44,9 @@ public class ComponentAccessTokenDTO implements Serializable {
private String componentAccessToken;
/**
- * 令牌有效期 单位:s 最长 60*60*2
+ * 令牌到期时间
*/
- private Integer expiresIn;
+ private Date expiresInTime;
/**
* 删除状态 0:正常 1:删除
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentVerifyTicketDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentVerifyTicketDTO.java
index 39f78fd2fc..c167790abb 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentVerifyTicketDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentVerifyTicketDTO.java
@@ -26,7 +26,7 @@ import lombok.Data;
* 微信发送的ticket表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-08
+ * @since v1.0.0 2020-07-14
*/
@Data
public class ComponentVerifyTicketDTO implements Serializable {
@@ -41,7 +41,7 @@ public class ComponentVerifyTicketDTO implements Serializable {
/**
* 第三方平台ID
*/
- private String appid;
+ private String componentAppId;
/**
* component_verify_ticket
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/FuncInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/FuncInfoDTO.java
index 482e71f206..14cbcd763e 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/FuncInfoDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/FuncInfoDTO.java
@@ -26,7 +26,7 @@ import lombok.Data;
* 授权给开发者的权限集列表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
public class FuncInfoDTO implements Serializable {
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniCategoryInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniCategoryInfoDTO.java
new file mode 100644
index 0000000000..098f476306
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniCategoryInfoDTO.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 小程序配置类目信息表 小程序配置类目信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-14
+ */
+@Data
+public class MiniCategoryInfoDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 主表ID
+ */
+ private String primaryId;
+
+ /**
+ * 类目排序 first , second
+ */
+ private String categorySort;
+
+ /**
+ * 类目名称 资讯,文娱......
+ */
+ private String categoryName;
+
+ /**
+ * 删除状态
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniInfoDTO.java
new file mode 100644
index 0000000000..501f9437d2
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniInfoDTO.java
@@ -0,0 +1,121 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 小程序信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-14
+ */
+@Data
+public class MiniInfoDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 昵称
+ */
+ private String nickName;
+
+ /**
+ * 头像
+ */
+ private String headImg;
+
+ /**
+ * 小程序类型 默认为 0
+ */
+ private String serviceTypeInfo;
+
+ /**
+ * 小程序认证类型 小程序认证类型
+ */
+ private String verifyTypeInfo;
+
+ /**
+ * 原始 ID
+ */
+ private String userName;
+
+ /**
+ * 主体名称
+ */
+ private String principalName;
+
+ /**
+ * 账号介绍
+ */
+ private String signature;
+
+ /**
+ * 二维码图片的 URL
+ */
+ private String qrcodeUrl;
+
+ /**
+ * 删除状态 0:正常,1:删除
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniNetworkInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniNetworkInfoDTO.java
new file mode 100644
index 0000000000..c928d9afab
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniNetworkInfoDTO.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 小程序配置合法域名信息表 小程序配置合法域名信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-14
+ */
+@Data
+public class MiniNetworkInfoDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 主表ID
+ */
+ private String primaryId;
+
+ /**
+ * 类型
+ */
+ private String networkType;
+
+ /**
+ * 域名 RequestDomain,WsRequestDomain,UploadDomain,DownloadDomain
+ */
+ private String url;
+
+ /**
+ * 删除状态
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthorizerRefreshTokenDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenPlatformAccountDTO.java
similarity index 78%
rename from epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthorizerRefreshTokenDTO.java
rename to epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenPlatformAccountDTO.java
index 32b509fe6f..f9dacb70ce 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthorizerRefreshTokenDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenPlatformAccountDTO.java
@@ -23,35 +23,41 @@ import lombok.Data;
/**
- * 授权方的刷新令牌表
+ * 开放平台账号表
+
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
-public class AuthorizerRefreshTokenDTO implements Serializable {
+public class OpenPlatformAccountDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
- * 主键
+ * id ID
*/
private String id;
/**
- * 授权方的刷新令牌
+ * openId 所创建的开放平台帐号的 appid
+ */
+ private String openAppId;
+
+ /**
+ * 客户ID 客户ID
*/
- private String authorizerRefreshToken;
+ private String customerId;
/**
- * 授权方appid
+ *
*/
- private String authorizerAppid;
+ private Integer delFlag;
/**
- * 删除标识 0-否,1-是
+ * 乐观锁
*/
- private String delFlag;
+ private Integer revision;
/**
* 创建人
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaInfoDTO.java
new file mode 100644
index 0000000000..8d5768aa62
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaInfoDTO.java
@@ -0,0 +1,129 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 公众号信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-14
+ */
+@Data
+public class PaInfoDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 昵称
+ */
+ private String nickName;
+
+ /**
+ * 头像
+ */
+ private String headImg;
+
+ /**
+ * 公众号类型 0:订阅号
+1:由历史老帐号升级后的订阅号
+2:服务号
+ */
+ private String serviceTypeInfo;
+
+ /**
+ * 公众号认证类型 -1:未认证
+0:微信认证
+1:新浪微博认证
+2:腾讯微博认证
+3:已资质认证通过但还未通过名称认证
+4:已资质认证通过、还未通过名称认证,但通过了新浪微博认证
+5:已资质认证通过、还未通过名称认证,但通过了腾讯微博认证
+ */
+ private String verifyTypeInfo;
+
+ /**
+ * 原始ID
+ */
+ private String userName;
+
+ /**
+ * 主体名称
+ */
+ private String principalName;
+
+ /**
+ * 公众号所设置的微信号,可能为空 公众号所设置的微信号,可能为空
+ */
+ private String alias;
+
+ /**
+ * 二维码图片的 URL
+ */
+ private String qrcodeUrl;
+
+ /**
+ * 删除状态 0:正常,1:删除
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PreAuthTokenDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PreAuthTokenDTO.java
index e0caf8be1c..e77f95db84 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PreAuthTokenDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PreAuthTokenDTO.java
@@ -26,7 +26,7 @@ import lombok.Data;
* 预授权码历史记录表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
public class PreAuthTokenDTO implements Serializable {
@@ -44,9 +44,9 @@ public class PreAuthTokenDTO implements Serializable {
private String preAuthToken;
/**
- * 预授权码有效期 单位:s 最长 60*60*2
+ * 预授权码有效期
*/
- private Integer expiresIn;
+ private Date expiresInTime;
/**
* 删除状态 0:正常 1:删除
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthCodeFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthCodeFormDTO.java
index 71e5d419fd..390e0c7aab 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthCodeFormDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthCodeFormDTO.java
@@ -3,6 +3,7 @@ package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
+import java.util.Date;
/**
* @Author zxc
@@ -18,6 +19,11 @@ public class AuthCodeFormDTO implements Serializable {
*/
private String customerId;
+ /**
+ * resi:居民端,work:工作端
+ */
+ private String clientType;
+
/**
* 授权方AppId
*/
@@ -31,7 +37,7 @@ public class AuthCodeFormDTO implements Serializable {
/**
* 有效期 10min
*/
- private Integer expiresIn;
+ private Date expiresInTime;
/**
* 删除状态 0:正常 1:已删除
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizationInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizationInfoFormDTO.java
index f1001e0b4b..2004536f1c 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizationInfoFormDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizationInfoFormDTO.java
@@ -3,6 +3,7 @@ package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
+import java.util.Date;
/**
* @Author zxc
@@ -31,7 +32,7 @@ public class AuthorizationInfoFormDTO implements Serializable {
/**
* authorizer_access_token 的有效期(在授权的公众号/小程序具备API权限时,才有此返回值),单位:秒
*/
- private Integer expiresIn;
+ private Date expiresInTime;
/**
* 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效
@@ -39,8 +40,10 @@ public class AuthorizationInfoFormDTO implements Serializable {
private String authorizerRefreshToken;
/**
- *
+ * 客户端类型 resi:居民端,work:工作端
*/
+ private String clientType;
+
private Integer delFlag = 0;
private String createdBy = "APP_USER";
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizerAccessTokenFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizerAccessTokenFormDTO.java
index 7d0fa419cf..2e5528ea64 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizerAccessTokenFormDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizerAccessTokenFormDTO.java
@@ -22,7 +22,7 @@ public class AuthorizerAccessTokenFormDTO implements Serializable {
/**
* 有效期,单位:秒
*/
- private Integer expiresIn;
+ private Date expiresInTime;
/**
* 刷新令牌
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BindingAccountFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BindingAccountFormDTO.java
new file mode 100644
index 0000000000..9221628d6b
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BindingAccountFormDTO.java
@@ -0,0 +1,40 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/13 17:58
+ */
+@Data
+public class BindingAccountFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 7969402941219659678L;
+
+ /**
+ * 开放平台账号ID 开放平台账号ID
+ */
+ private String openPlatformAccountId;
+
+ /**
+ * 公众号/小程序APPID(授权方APPID) 授权方APPID
+ */
+ private String authAppId;
+
+ /**
+ * 客户ID 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端 居民端:resi,工作端:work
+ */
+ private String clientType;
+
+ private Integer delFlag = 0;
+ private Integer revision = 0;
+ private String createdBy = "APP_USER";
+ private String updatedBy = "APP_USER";
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BusinessInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BusinessInfoFormDTO.java
new file mode 100644
index 0000000000..7a47dd2bb3
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BusinessInfoFormDTO.java
@@ -0,0 +1,60 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/14 15:54
+ */
+@Data
+public class BusinessInfoFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 570372083578341740L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 主表ID
+ */
+ private String primaryId;
+
+ /**
+ * 功能类型 open_store:是否开通微信门店功能 open_scan:是否开通微信扫商品功能 open_pay:是否开通微信支付功能 open_card:是否开通微信卡券功能 open_shake:是否开通微信摇一摇功能
+ */
+ private String funcType;
+
+ /**
+ * 开通状态 0:未开通,1:已开通
+ */
+ private Integer openStatus;
+
+ /**
+ * 删除状态 0:正常,1:删除
+ */
+ private Integer delFlag = 0;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision = 0;
+
+ /**
+ * 创建人
+ */
+ private String createdBy = "APP_USER";
+
+ /**
+ * 更新人
+ */
+ private String updatedBy = "APP_USER";
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeAuditRecordFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeAuditRecordFormDTO.java
new file mode 100644
index 0000000000..c0530f1bb7
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeAuditRecordFormDTO.java
@@ -0,0 +1,115 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/15 14:13
+ */
+@Data
+public class CodeAuditRecordFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 2295533266066734315L;
+
+ /**
+ * ID
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 模板ID
+ */
+ private String templateId;
+
+ /**
+ * 客户端类型:resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 授权方AppId
+ */
+ private String authAppId;
+
+ /**
+ * 小程序的原始 ID
+ */
+ private String toUserName;
+
+ /**
+ * 发送方帐号(一个 OpenID,此时发送方是系统帐号)
+ */
+ private String fromUserName;
+
+ /**
+ * 消息创建时间 (整型),时间戳
+ */
+ private Date wechatCreateTime;
+
+ /**
+ * 消息类型 event
+ */
+ private String msgType;
+
+ /**
+ * 事件类型
+ weapp_audit_success:审核通过,
+ weapp_audit_fail:审核不通过,
+ weapp_audit_delay:审核延后
+ */
+ private String event;
+
+ /**
+ * 审核成功时的时间戳
+ */
+ private Date succTime;
+
+ /**
+ * 审核不通过的时间戳
+ */
+ private Date failTime;
+
+ /**
+ * 审核延后时的时间戳
+ */
+ private Date delayTime;
+
+ /**
+ * 审核不通过的原因
+ */
+ private String reason;
+
+ /**
+ * 审核不通过的截图示例。用 | 分隔的 media_id 的列表,可通过获取永久素材接口拉取截图内容
+ */
+ private String screenShot;
+
+ /**
+ * 删除状态
+ */
+ private Integer delFlag = 0;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision = 0;
+
+ /**
+ * 创建人
+ */
+ private String createdBy = "APP_USER";
+
+ /**
+ * 更新人
+ */
+ private String updatedBy = "APP_USER";
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentAccessTokenFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentAccessTokenFormDTO.java
index 61e2f5063e..d09b6cd4fb 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentAccessTokenFormDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentAccessTokenFormDTO.java
@@ -3,6 +3,7 @@ package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
+import java.util.Date;
/**
* @Author zxc
@@ -21,7 +22,7 @@ public class ComponentAccessTokenFormDTO implements Serializable {
/**
* 令牌有效期 单位:s 最长 60*60*2
*/
- private Integer expiresIn;
+ private Date expiresInTime;
/**
* 删除状态 0:正常 1:删除
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentVerifyTicketFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentVerifyTicketFormDTO.java
index 308b69b4fd..54afadfc32 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentVerifyTicketFormDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentVerifyTicketFormDTO.java
@@ -22,7 +22,7 @@ public class ComponentVerifyTicketFormDTO implements Serializable {
/**
* 第三方平台ID
*/
- private String appid;
+ private String componentAppId;
/**
* component_verify_ticket
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CreateOpenFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CreateOpenFormDTO.java
new file mode 100644
index 0000000000..fae9e3e610
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CreateOpenFormDTO.java
@@ -0,0 +1,48 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/13 17:36
+ */
+@Data
+public class CreateOpenFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 7656834022953140875L;
+
+ private String id;
+
+ /**
+ * openId 所创建的开放平台帐号的 appid
+ */
+ private String openid;
+
+ /**
+ * 客户ID 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision = 0;
+
+ /**
+ * 创建者
+ */
+ private String createdBy = "APP_USER";
+
+ /**
+ * 修改者
+ */
+ private String updatedBy = "APP_USER";
+
+ /**
+ * 是否已删除(0-未删除,1-已删除)
+ */
+ private String delFlag = "0";
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GoToAuthFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GoToAuthFormDTO.java
new file mode 100644
index 0000000000..d9e9ae1790
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GoToAuthFormDTO.java
@@ -0,0 +1,26 @@
+package com.epmet.dto.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/13 10:30
+ */
+@Data
+public class GoToAuthFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 4171794043794295829L;
+ public interface GoToAuth extends CustomerClientShowGroup{}
+
+ /**
+ * 客户端类型 resi:居民端 , work:工作端
+ */
+ @NotBlank(message = "客户端类型不能为空",groups = {GoToAuth.class})
+ private String clientType;
+
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniCategoryInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniCategoryInfoFormDTO.java
new file mode 100644
index 0000000000..f5fd4ab9a1
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniCategoryInfoFormDTO.java
@@ -0,0 +1,60 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/14 15:53
+ */
+@Data
+public class MiniCategoryInfoFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 9211011906485259736L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 主表ID
+ */
+ private String primaryId;
+
+ /**
+ * 类目排序 first , second
+ */
+ private String categorySort;
+
+ /**
+ * 类目名称 资讯,文娱......
+ */
+ private String categoryName;
+
+ /**
+ * 删除状态
+ */
+ private Integer delFlag = 0;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision = 0;
+
+ /**
+ * 创建人
+ */
+ private String createdBy = "APP_USER";
+
+ /**
+ * 更新人
+ */
+ private String updatedBy = "APP_USER";
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniInfoFormDTO.java
new file mode 100644
index 0000000000..072877f958
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniInfoFormDTO.java
@@ -0,0 +1,76 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/14 15:20
+ */
+@Data
+public class MiniInfoFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 2970966756786695782L;
+
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 昵称
+ */
+ private String nickName;
+
+ /**
+ * 头像
+ */
+ private String headImg;
+
+ /**
+ * 小程序类型 默认为 0
+ */
+ private String serviceTypeInfo;
+
+ /**
+ * 小程序认证类型 小程序认证类型
+ */
+ private String verifyTypeInfo;
+
+ /**
+ * 原始 ID
+ */
+ private String userName;
+
+ /**
+ * 主体名称
+ */
+ private String principalName;
+
+ /**
+ * 账号介绍
+ */
+ private String signature;
+
+ /**
+ * 二维码图片的 URL
+ */
+ private String qrcodeUrl;
+
+ private Integer delFlag = 0;
+
+ private Integer revision = 0;
+
+ private String createdBy = "APP_USER";
+
+ private String updatedBy = "APP_USER";
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniNetworkInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniNetworkInfoFormDTO.java
new file mode 100644
index 0000000000..91a8e4f1e4
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniNetworkInfoFormDTO.java
@@ -0,0 +1,60 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/14 15:52
+ */
+@Data
+public class MiniNetworkInfoFormDTO implements Serializable {
+
+ private static final long serialVersionUID = -2171502778870475956L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 主表ID
+ */
+ private String primaryId;
+
+ /**
+ * 类型
+ */
+ private String networkType;
+
+ /**
+ * 域名 RequestDomain,WsRequestDomain,UploadDomain,DownloadDomain
+ */
+ private String url;
+
+ /**
+ * 删除状态
+ */
+ private Integer delFlag = 0;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision = 0;
+
+ /**
+ * 创建人
+ */
+ private String createdBy = "APP_USER";
+
+ /**
+ * 更新人
+ */
+ private String updatedBy = "APP_USER";
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PaInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PaInfoFormDTO.java
new file mode 100644
index 0000000000..d91c84cfa3
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PaInfoFormDTO.java
@@ -0,0 +1,95 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/14 15:27
+ */
+@Data
+public class PaInfoFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 2495498009170200556L;
+
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 昵称
+ */
+ private String nickName;
+
+ /**
+ * 头像
+ */
+ private String headImg;
+
+ /**
+ * 公众号类型 0:订阅号
+ 1:由历史老帐号升级后的订阅号
+ 2:服务号
+ */
+ private String serviceTypeInfo;
+
+ /**
+ * 公众号认证类型 -1:未认证
+ 0:微信认证
+ 1:新浪微博认证
+ 2:腾讯微博认证
+ 3:已资质认证通过但还未通过名称认证
+ 4:已资质认证通过、还未通过名称认证,但通过了新浪微博认证
+ 5:已资质认证通过、还未通过名称认证,但通过了腾讯微博认证
+ */
+ private String verifyTypeInfo;
+
+ /**
+ * 原始ID
+ */
+ private String userName;
+
+ /**
+ * 主体名称
+ */
+ private String principalName;
+
+ /**
+ * 公众号所设置的微信号,可能为空 公众号所设置的微信号,可能为空
+ */
+ private String alias;
+
+ /**
+ * 二维码图片的 URL
+ */
+ private String qrcodeUrl;
+
+ /**
+ * 删除状态 0:正常,1:删除
+ */
+ private Integer delFlag = 0;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision = 0;
+
+ /**
+ * 创建人
+ */
+ private String createdBy = "APP_USER";
+
+ /**
+ * 更新人
+ */
+ private String updatedBy = "APP_USER";
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PreAuthTokenFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PreAuthTokenFormDTO.java
index 0f07ee3528..532936c99d 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PreAuthTokenFormDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PreAuthTokenFormDTO.java
@@ -3,6 +3,7 @@ package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
+import java.util.Date;
/**
* @Author zxc
@@ -21,7 +22,7 @@ public class PreAuthTokenFormDTO implements Serializable {
/**
* 预授权码有效期 单位:s 最长 60*60*2
*/
- private Integer expiresIn;
+ private Date expiresInTime;
/**
* 删除状态 0:正常 1:删除
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthCodeResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthCodeResultDTO.java
new file mode 100644
index 0000000000..21eb773600
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthCodeResultDTO.java
@@ -0,0 +1,26 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/15 10:00
+ */
+@Data
+public class AuthCodeResultDTO implements Serializable {
+
+ private static final long serialVersionUID = 4642988014737245076L;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthorizationInfoResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthorizationInfoResultDTO.java
index ce31106941..1d20dc3aac 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthorizationInfoResultDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthorizationInfoResultDTO.java
@@ -29,7 +29,7 @@ public class AuthorizationInfoResultDTO implements Serializable {
/**
* authorizer_access_token 的有效期(在授权的公众号/小程序具备API权限时,才有此返回值),单位:秒
*/
- private Integer expires_in;
+ private String expires_in;
/**
* 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CreateOpenResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CreateOpenResultDTO.java
new file mode 100644
index 0000000000..1a7d67e1f9
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CreateOpenResultDTO.java
@@ -0,0 +1,36 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/13 16:17
+ */
+@Data
+public class CreateOpenResultDTO implements Serializable {
+
+ private static final long serialVersionUID = -7130231978776634403L;
+
+ private String id;
+
+ /**
+ * 所创建的开放平台帐号的 appid
+ */
+ private String openAppId;
+
+ /**
+ * 错误信息
+ */
+ private String errMsg;
+
+ /**
+ * 返回码
+ * 0:ok,
+ * -1:system error , 系统错误
+ * 40013:invalid appid , appid 无效
+ * 89000:account has bound open ,该公众号/小程序 已经绑定了开放平台帐号
+ */
+ private Integer errCode;
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerIdAndClientResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerIdAndClientResultDTO.java
new file mode 100644
index 0000000000..a802fb5de8
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerIdAndClientResultDTO.java
@@ -0,0 +1,25 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/15 15:44
+ */
+@Data
+public class CustomerIdAndClientResultDTO implements Serializable {
+
+ private static final long serialVersionUID = -7427184790539679353L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型
+ */
+ private String clientType;
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GoToAuthResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GoToAuthResultDTO.java
new file mode 100644
index 0000000000..5f2404efa8
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GoToAuthResultDTO.java
@@ -0,0 +1,45 @@
+package com.epmet.dto.result;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/10 15:55
+ */
+@Data
+public class GoToAuthResultDTO implements Serializable {
+
+ private static final long serialVersionUID = -8759961913652933215L;
+
+ /**
+ * 第三方AppId
+ */
+ @JsonIgnore
+ private String componentAppId;
+
+ /**
+ * 预授权码
+ */
+ @JsonIgnore
+ private String preAuthCode;
+
+ /**
+ * 回调地址【获取 授权码和过期时间】
+ */
+ @JsonIgnore
+ private String redirectUri;
+
+ /**
+ * 客户ID
+ */
+ @JsonIgnore
+ private String customerId;
+
+ /**
+ * 反参:拼好的url,包括回调地址
+ */
+ private String url;
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateAndAppIdResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateAndAppIdResultDTO.java
new file mode 100644
index 0000000000..96dc655981
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateAndAppIdResultDTO.java
@@ -0,0 +1,26 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/15 15:56
+ */
+@Data
+public class TemplateAndAppIdResultDTO implements Serializable {
+
+ private static final long serialVersionUID = -3875904833509300177L;
+
+ /**
+ * 模板ID
+ */
+ private String templateId;
+
+ /**
+ * 授权方AppId
+ */
+ private String authAppId;
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/WillOverDueResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/WillOverDueResultDTO.java
index b89826abda..666c73ff15 100644
--- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/WillOverDueResultDTO.java
+++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/WillOverDueResultDTO.java
@@ -33,5 +33,10 @@ public class WillOverDueResultDTO implements Serializable {
*/
private String customerId;
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
}
diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml
index 46d80d5185..8bef743d41 100644
--- a/epmet-module/epmet-third/epmet-third-server/pom.xml
+++ b/epmet-module/epmet-third/epmet-third-server/pom.xml
@@ -176,7 +176,7 @@
6379
123456
- true
+ false
122.152.200.70:8848
fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java
index 77bfbe8263..39bcec97d4 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java
@@ -16,7 +16,10 @@ public interface ModuleConstant {
String INFO_TYPE = "InfoType";
String TICKET_UNDERLINE_KEY = "component_verify_ticket";
String TICKET_KEY = "ComponentVerifyTicket";
+ String APP_ID = "AppId";
+ String AUTHORIZATION_CODE_HUMP = "AuthorizationCode";
String UNAUTHORIZED = "unauthorized";
+ String AUTHORIZED = "authorized";
String NULL_CHAR = "";
String SUCCESS = "success";
@@ -40,6 +43,40 @@ public interface ModuleConstant {
//授权回调URL 如下
String AUTH_CODE = "auth_code";
+ String ERR_CODE = "errcode";
+ String ERR_MSG = "errmsg";
+ String OPEN_APP_ID = "open_appid";
+ String LOW_APP_ID = "appid";
+
+ String CUSTOMER_ID = "customerId";
+ String CLIENT = "client";
+
+ //创建开放平台账号
+ String ACCESS_TOKEN = "access_token";
+
+ //获取并保存授权方账号基本信息 如下
+ String COMPONENT_APP_ID = "component_appid";
+ String AUTHORIZER_APP_ID = "authorizer_appid";
+ String AUTHORIZER_INFO = "authorizer_info";
+ String MINI_PROGRAM_INFO = "miniprograminfo";
+ String BUSINESS_INFO = "business_info";
+ String CATEGORIES = "categories";
+ String NETWORK = "network";
+
+ //代码审核结果推送 如下
+ String EVENT = "Event";
+ String WEAPP_AUDIT_SUCCESS = "weapp_audit_success"; //审核通过
+ String WEAPP_AUDIT_FAIL = "weapp_audit_fail"; //审核不通过
+ String WEAPP_AUDIT_DELAY = "weapp_audit_delay"; //审核延后
+ String DELAY = "delay";
+ String AUDIT_SUCCESS = "audit_success";
+ String AUDIT_FAILED = "audit_failed";
+
+ int FORTY_THOUSAND_AND_THIRTEEN = 40013;
+ int EIGHTY_NINE_THOUSAND = 89000;
+ int EIGHTY_NINE_THOUSAND_AND_ONE = 89001;
+ int EIGHTY_NINE_THOUSAND_AND_THREE = 89003;
+ int EIGHTY_NINE_THOUSAND_AND_FOUR = 89004;
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/TencentAuthTypeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/TencentAuthTypeConstant.java
new file mode 100644
index 0000000000..080b993fae
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/TencentAuthTypeConstant.java
@@ -0,0 +1,33 @@
+package com.epmet.constant;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/13 9:08
+ */
+public interface TencentAuthTypeConstant {
+
+ /**
+ * 公众号认证类型
+ */
+ String AUTH_MINUS_ONE = "未认证";
+ String AUTH_ZERO = "微信认证";
+ String AUTH_ONE = "新浪微博认证";
+ String AUTH_TWO = "腾讯微博认证";
+ String AUTH_THREE = "已资质认证通过但还未通过名称认证";
+ String AUTH_FOUR = "已资质认证通过、还未通过名称认证,但通过了新浪微博认证";
+ String AUTH_FIVE = "已资质认证通过、还未通过名称认证,但通过了腾讯微博认证";
+
+ /**
+ * 公众号类型
+ */
+ String ZERO = "订阅号";
+ String ONE = "由历史老帐号升级后的订阅号";
+ String TWO = "服务号";
+
+ /**
+ * 小程序认证类型
+ */
+ String MINI_AUTH_MINUS_ONE = "未认证";
+ String MINI_AUTH_ZERO = "微信认证";
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdApiConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdApiConstant.java
index 96c69002f3..5b05154cbc 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdApiConstant.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdApiConstant.java
@@ -7,7 +7,7 @@ package com.epmet.constant;
public interface ThirdApiConstant {
/**
- *
+ * 获取预授权码
*/
String API_CREATE_PREAUTHCODE_URL = "https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode";
@@ -23,4 +23,37 @@ public interface ThirdApiConstant {
String API_AUTHORIZER_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token";
+ /**
+ * 授权回调url
+ */
+ String API_REDIRECT_URL = "https://epmet-dev.elinkservice.cn/api/third/redirectauthcode";
+
+ /**
+ * 反参授权回调url
+ */
+ String API_RETURN_REDIRECT_URL = "https://epmet-dev.elinkservice.cn/api/third/redirectauthcode?client=%s&customerId=%s";
+
+ /**
+ * 授权注册页面扫码授权
+ * component_appid:第三方AppId
+ * pre_auth_code:预授权码
+ * redirect_uri:回调url(获取授权码)
+ */
+ String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s";
+
+ /**
+ * 创建开放平台帐号并绑定公众号/小程序
+ */
+ String API_CREATE_OPEN = "https://api.weixin.qq.com/cgi-bin/open/create";
+
+ /**
+ * 公众号/小程序绑定到开放平台帐号下
+ */
+ String API_BIND_OPEN = "https://api.weixin.qq.com/cgi-bin/open/bind?";
+
+ /**
+ * 获取授权方的帐号基本信息
+ */
+ String API_GET_AUTHORIZER_INFO = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info";
+
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdPlatformConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdPlatformConstant.java
index 09f8af7681..e86eafb02d 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdPlatformConstant.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdPlatformConstant.java
@@ -9,12 +9,12 @@ public interface ThirdPlatformConstant {
/**
* 第三方平台appId
*/
- String PLATFORM_APP_ID = "****************";
+// String PLATFORM_APP_ID = "****************";
/**
* 第三方平台 secret
*/
- String PLATFORM_APP_SECRET = "****************";
+// String PLATFORM_APP_SECRET = "****************";
/**
* 第三方平台 消息加解密Key
@@ -24,6 +24,6 @@ public interface ThirdPlatformConstant {
/**
* 第三方平台 消息校验Token
*/
- String PLATFORM_COMPONENT_TOKEN = "****************";
+// String PLATFORM_COMPONENT_TOKEN = "****************";
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRedisKeyConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRedisKeyConstant.java
index c4aab903d5..43e1e19f52 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRedisKeyConstant.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRedisKeyConstant.java
@@ -27,7 +27,12 @@ public interface ThirdRedisKeyConstant {
String ACCESS_TOKEN_REDIS_KEY = "epmet:wechartthird:componentaccesstoken";
/**
- * authorizer_refresh_token 刷新令牌,获取授权信息时得到
+ * authorizer_refresh_token 刷新令牌,获取授权信息时得到 第三方和微信交互使用的
+ */
+ String THIRD_AUTHORIZER_REFRESH_TOKEN_REDIS_KEY = "epmet:wechartthird:thirdauthorizerrefreshtoken";
+
+ /**
+ * 第三方 和 授权方交互使用的
*/
String AUTHORIZER_REFRESH_TOKEN_REDIS_KEY = "epmet:wechartthird:authorizerrefreshtoken";
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRunTimeInfoConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRunTimeInfoConstant.java
index 6ff00a3e80..2e0448a712 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRunTimeInfoConstant.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRunTimeInfoConstant.java
@@ -46,4 +46,38 @@ public interface ThirdRunTimeInfoConstant {
String END_GET_AUTH_INFO = "=====================结束获取【authorization_info】=====================";
+ String CREATE_AND_BIND_SUCCESS = "创建开放平台帐号并绑定公众号/小程序";
+
+ String BIND_SUCCESS = "绑定公众号/小程序到开放平台";
+
+ /**
+ * 对应错误码:-1
+ */
+ String SYSTEM_ERROR = "系统错误";
+
+ /**
+ * 对应错误码:40013
+ */
+ String INVALID_APP_ID = "appId 或 openAppId 无效";
+
+ /**
+ * 对应错误码:89000
+ */
+ String ACCOUNT_HAS_BOUND_OPEN = "该公众号/小程序 已经绑定了开放平台帐号";
+
+ /**
+ * 对应错误码:89001
+ */
+ String NOT_SAME_CONTRACTOR = "Authorizer 与开放平台帐号主体不相同";
+
+ /**
+ * 对应错误码:89003
+ */
+ String NOT_ALLOWED_OPERATE = "该开放平台帐号并非通过 api 创建,不允许操作";
+
+ /**
+ * 对应错误码:89004
+ */
+ String TO_LIMIT = "该开放平台帐号所绑定的公众号/小程序已达上限(100 个)";
+
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java
new file mode 100644
index 0000000000..45c8a65cb4
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java
@@ -0,0 +1,39 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.security.dto.TokenDto;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.dto.form.GoToAuthFormDTO;
+import com.epmet.dto.result.GoToAuthResultDTO;
+import com.epmet.service.AppLetAuthorizationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/10 15:48
+ */
+@RestController
+@RequestMapping("auth")
+public class AppLetAuthorizationController {
+
+ @Autowired
+ private AppLetAuthorizationService appLetAuthorizationService;
+
+ /**
+ * @Description 小程序点击“去授权”的时候
+ * @param tokenDto
+ * @author zxc
+ */
+ @PostMapping("gotoauth")
+ public Result goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO);
+ GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO);
+ return new Result().ok(goToAuthResultDTO);
+ }
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AuthRedirectController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AuthRedirectController.java
index dd462b2245..b1b89e380d 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AuthRedirectController.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AuthRedirectController.java
@@ -1,12 +1,10 @@
package com.epmet.controller;
-import com.epmet.commons.tools.annotation.LoginUser;
-import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.ComponentVerifyTicketService;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@@ -28,8 +26,9 @@ public class AuthRedirectController {
* @param
* @author zxc
*/
- public Result redirectUri(HttpServletRequest request, HttpServletResponse response, @LoginUser TokenDto tokenDto, @RequestParam("authAppId")String authAppId){
- componentVerifyTicketService.redirectUri(request,response,tokenDto,authAppId);
+ @GetMapping("redirect")
+ public Result redirectUri(HttpServletRequest request, HttpServletResponse response){
+ componentVerifyTicketService.redirectUri(request,response);
return new Result();
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/WeChatNotifyController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/WeChatNotifyController.java
index a63583e38c..27e1051b58 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/WeChatNotifyController.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/WeChatNotifyController.java
@@ -2,6 +2,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.ComponentVerifyTicketService;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.*;
* @Author zxc
* @CreateTime 2020/7/8 15:06
*/
+@Slf4j
@RestController
@RequestMapping("wechatthird")
public class WeChatNotifyController {
@@ -24,7 +26,9 @@ public class WeChatNotifyController {
*/
@PostMapping("componentaccesstoken")
public Result getComponentAccessToken() {
+ log.info("开始获取【component_access_token】......");
componentVerifyTicketService.getComponentAccessToken();
+ log.info("已成功获取到【component_access_token】......");
return new Result();
}
@@ -45,7 +49,9 @@ public class WeChatNotifyController {
*/
@PostMapping("refreshtoken")
public Result refreshToken(){
+ log.info("开始刷新/获取接口调用令牌......");
componentVerifyTicketService.refreshToken();
+ log.info("刷新/获取接口调用令牌......成功了");
return new Result();
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthCodeDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthCodeDao.java
index 9ff232bbb4..53bf395ea1 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthCodeDao.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthCodeDao.java
@@ -19,8 +19,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.AuthCodeFormDTO;
+import com.epmet.dto.result.AuthCodeResultDTO;
import com.epmet.entity.AuthCodeEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
/**
* 授权回调url反参表
@@ -31,6 +33,27 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface AuthCodeDao extends BaseDao {
+ /**
+ * @Description 插入 授权码
+ * @param formDTO
+ * @author zxc
+ */
void insertRedirectAuthCode(AuthCodeFormDTO formDTO);
+
+ /**
+ * @Description 根据authCode查询客户ID和客户端类型
+ * @param authCode
+ * @author zxc
+ */
+ AuthCodeResultDTO selectCustomerIdByAuthCode(@Param("authCode")String authCode);
+
+ /**
+ * @Description 回填 auth_code表 authAppId
+ * @param customerId
+ * @param clientType
+ * @param authAppId
+ * @author zxc
+ */
+ void updateAppId(@Param("customerId")String customerId,@Param("clientType")String clientType,@Param("authAppId")String authAppId);
}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizerRefreshTokenDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthResultRecordDao.java
similarity index 81%
rename from epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizerRefreshTokenDao.java
rename to epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthResultRecordDao.java
index 087e781c1a..ca98874003 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizerRefreshTokenDao.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthResultRecordDao.java
@@ -18,16 +18,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
-import com.epmet.entity.AuthorizerRefreshTokenEntity;
+import com.epmet.entity.AuthResultRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
- * 授权方的刷新令牌表
+ * 授权结果记录表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-08
+ * @since v1.0.0 2020-07-15
*/
@Mapper
-public interface AuthorizerRefreshTokenDao extends BaseDao {
+public interface AuthResultRecordDao extends BaseDao {
}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java
index 02539669af..4608b0a04a 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java
@@ -19,10 +19,14 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.AuthorizationInfoFormDTO;
+import com.epmet.dto.form.AuthorizerAccessTokenFormDTO;
+import com.epmet.dto.result.WillOverDueResultDTO;
import com.epmet.entity.AuthorizationInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
/**
* 授权信息表
*
@@ -44,6 +48,27 @@ public interface AuthorizationInfoDao extends BaseDao {
* @param customerId
* @author zxc
*/
- void updateOldAuthorizationInfo(@Param("customerId")String customerId);
+ void updateOldAuthorizationInfo(@Param("customerId")String customerId,@Param("clientType")String clientType);
+
+ /**
+ * @Description 查询即将过期的 authorizer_access_token
+ * @param
+ * @author zxc
+ */
+ List checkWillOverDue();
+
+ /**
+ * @Description 插入 authorizer_access_token
+ * @param refreshAccessToken
+ * @author zxc
+ */
+ void insertAuthorizerAccessToken(AuthorizerAccessTokenFormDTO refreshAccessToken);
+
+ /**
+ * @Description 逻辑删除 授权方的authorizer_access_token
+ * @param customerId
+ * @author zxc
+ */
+ void updateOldAuthorizerAccessToken(@Param("customerId")String customerId,@Param("clientType")String clientType);
}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BindingAccountDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BindingAccountDao.java
new file mode 100644
index 0000000000..4ea9771d2c
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BindingAccountDao.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.BindingAccountFormDTO;
+import com.epmet.entity.BindingAccountEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 公众号/小程序绑定开放平台帐号表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-13
+ */
+@Mapper
+public interface BindingAccountDao extends BaseDao {
+
+ /**
+ * @Description 插入 公众号/小程序绑定开放平台帐号表
+ * @param formDTO
+ * @author zxc
+ */
+ void insertBindingAccount(BindingAccountFormDTO formDTO);
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java
new file mode 100644
index 0000000000..622f257d7b
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.BusinessInfoFormDTO;
+import com.epmet.entity.BusinessInfoEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 功能开通状况表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-13
+ */
+@Mapper
+public interface BusinessInfoDao extends BaseDao {
+
+ /**
+ * @Description 功能开通信息插入
+ * @param businessInfoList
+ * @author zxc
+ */
+ void insertBusinessInfo(@Param("businessInfoList") List businessInfoList);
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditRecordDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditRecordDao.java
new file mode 100644
index 0000000000..1aca1dff12
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditRecordDao.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.CodeAuditRecordFormDTO;
+import com.epmet.entity.CodeAuditRecordEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 代码审核记录表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-15
+ */
+@Mapper
+public interface CodeAuditRecordDao extends BaseDao {
+
+ /**
+ * @Description 插入代码审核结果
+ * @param formDTO
+ * @author zxc
+ */
+ void insertCodeAuditRecord(CodeAuditRecordFormDTO formDTO);
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditResultDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditResultDao.java
index efbb43e81e..b9cba62dd4 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditResultDao.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditResultDao.java
@@ -20,14 +20,23 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.CodeAuditResultEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
/**
- * 代码审核j结果
+ * 代码审核结果
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-09
*/
@Mapper
public interface CodeAuditResultDao extends BaseDao {
-
+
+ /**
+ * @Description 更新 代码审核结果中的审核状态
+ * @param customerId
+ * @param codeCustomerId
+ * @author zxc
+ */
+ void updateAuditResult(@Param("customerId")String customerId,@Param("codeCustomerId")String codeCustomerId,@Param("codeResult")String codeResult);
+
}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java
index fe783081fd..5d7f60d4ae 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java
@@ -18,8 +18,11 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.CodeAuditRecordFormDTO;
+import com.epmet.dto.result.TemplateAndAppIdResultDTO;
import com.epmet.entity.CodeCustomerEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
/**
* 客户代码关联表
@@ -29,5 +32,20 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface CodeCustomerDao extends BaseDao {
-
+
+ /**
+ * @Description 根据客户id和客户端类型获取 代码模板ID和授权方AppId
+ * @param customerId
+ * @param clientType
+ * @author zxc
+ */
+ TemplateAndAppIdResultDTO selectTemplateAndAppId(@Param("customerId")String customerId,@Param("clientType")String clientType);
+
+ /**
+ * @Description 查询 code_customer 表ID
+ * @param codeAuditRecord
+ * @author zxc
+ */
+ String selectCodeCustomerId(CodeAuditRecordFormDTO codeAuditRecord);
+
}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java
index 4615c22728..7548335085 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java
@@ -22,6 +22,8 @@ import com.epmet.dto.form.ComponentAccessTokenFormDTO;
import com.epmet.entity.ComponentAccessTokenEntity;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* 第三方平台调用凭证
*
@@ -38,6 +40,25 @@ public interface ComponentAccessTokenDao extends BaseDao {
+ /**
+ * @Description 插入 票据【component_verify_ticket】
+ * @param formDTO
+ * @author zxc
+ */
void insertComponentVerifyTicket(ComponentVerifyTicketFormDTO formDTO);
+
+ /**
+ * @Description 逻辑删除 【component_verify_ticket】
+ * @param
+ * @author zxc
+ */
+ void updateOldComponentVerifyTicket();
}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerMpDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerMpDao.java
index 7b3db18170..c8609064e9 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerMpDao.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerMpDao.java
@@ -19,11 +19,13 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerMpDTO;
+import com.epmet.dto.form.AuthCodeFormDTO;
import com.epmet.entity.CustomerMpEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
+import org.apache.ibatis.annotations.Param;
/**
* 客户小程序关系表
@@ -49,4 +51,34 @@ public interface CustomerMpDao extends BaseDao {
* @Description 查询所有客户小程序的授权信息
**/
List selectAll();
+
+ /**
+ * @Description 查询授权的数量
+ * @param customerId
+ * @author zxc
+ */
+ Integer selectAuthCount(@Param("customerId")String customerId);
+
+ /**
+ * @Description 回填customer_mp的appId
+ * @param formDTO
+ * @author zxc
+ */
+ void updateAppIDByCustomerIdAndClient(AuthCodeFormDTO formDTO);
+
+ /**
+ * @Description 修改小程序授权的状态
+ * @param authAppId
+ * @author zxc
+ */
+ void updateAuthorizationFlag(@Param("authAppId")String authAppId);
+
+ /**
+ * @Description 根据 客户Id和授权方AppId查询clientType
+ * @param customerId
+ * @param authAppId
+ * @author zxc
+ */
+ String selectClientTypeByCustomerIdAndAuthId(@Param("customerId")String customerId,@Param("authAppId")String authAppId);
+
}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java
new file mode 100644
index 0000000000..e233f5372b
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.MiniCategoryInfoFormDTO;
+import com.epmet.entity.MiniCategoryInfoEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 小程序配置类目信息表 小程序配置类目信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-13
+ */
+@Mapper
+public interface MiniCategoryInfoDao extends BaseDao {
+
+ /**
+ * @Description 小程序配置的类目信息插入
+ * @param miniCategoryInfoList
+ * @author zxc
+ */
+ void insertCategoryInfo(@Param("miniCategoryInfoList") List miniCategoryInfoList);
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java
new file mode 100644
index 0000000000..26e7dbf7e8
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.MiniInfoFormDTO;
+import com.epmet.dto.result.CustomerIdAndClientResultDTO;
+import com.epmet.entity.MiniInfoEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 小程序信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-13
+ */
+@Mapper
+public interface MiniInfoDao extends BaseDao {
+
+ /**
+ * @Description 插入小程序信息
+ * @param formDTO
+ * @author zxc
+ */
+ void insertMiniInfo(MiniInfoFormDTO formDTO);
+
+ /**
+ * @Description 根据原始ID查询 customerId 和 clientType
+ * @param toUserName
+ * @author zxc
+ */
+ CustomerIdAndClientResultDTO selectCustomerIdAndClientByToUserName(@Param("toUserName")String toUserName);
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java
new file mode 100644
index 0000000000..361d4bb256
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.MiniNetworkInfoFormDTO;
+import com.epmet.entity.MiniNetworkInfoEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 小程序配置合法域名信息表 小程序配置合法域名信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-13
+ */
+@Mapper
+public interface MiniNetworkInfoDao extends BaseDao {
+
+ /**
+ * @Description 小程序配置的合法域名信息插入
+ * @param networkInfoList
+ * @author zxc
+ */
+ void insertNetworkInfo(@Param("networkInfoList") List networkInfoList);
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/RefreshAuthorizerAccessTokenDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenPlatformAccountDao.java
similarity index 54%
rename from epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/RefreshAuthorizerAccessTokenDao.java
rename to epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenPlatformAccountDao.java
index ecd62336d5..2ec5ef1588 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/RefreshAuthorizerAccessTokenDao.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenPlatformAccountDao.java
@@ -18,42 +18,34 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
-import com.epmet.dto.form.AuthorizerAccessTokenFormDTO;
-import com.epmet.dto.result.WillOverDueResultDTO;
-import com.epmet.entity.RefreshAuthorizerAccessTokenEntity;
+import com.epmet.dto.form.CreateOpenFormDTO;
+import com.epmet.dto.result.CreateOpenResultDTO;
+import com.epmet.entity.OpenPlatformAccountEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
-import java.util.List;
-
/**
- * 获取/刷新接口调用令牌记录表
+ * 开放平台账号表
+
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-08
+ * @since v1.0.0 2020-07-13
*/
@Mapper
-public interface RefreshAuthorizerAccessTokenDao extends BaseDao {
+public interface OpenPlatformAccountDao extends BaseDao {
/**
- * @Description 查询即将过期的 authorizer_access_token
- * @param
+ * @Description 插入开放平台账号
+ * @param coForm
* @author zxc
*/
- List checkWillOverDue();
+ void insertOpenPlatFormAccount(CreateOpenFormDTO coForm);
/**
- * @Description 插入 authorizer_access_token
- * @param refreshAccessToken
- * @author zxc
- */
- void insertAuthorizerAccessToken(AuthorizerAccessTokenFormDTO refreshAccessToken);
-
- /**
- * @Description 逻辑删除 授权方的authorizer_access_token
+ * @Description 根据客户Id查询已绑定开放平台的账号ID
* @param customerId
* @author zxc
*/
- void updateOldAuthorizerAccessToken(@Param("customerId")String customerId);
-
+ String selectOpenAppIdByCustomerId(@Param("customerId")String customerId);
+
}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaInfoDao.java
new file mode 100644
index 0000000000..f605e6a7d3
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaInfoDao.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.PaInfoFormDTO;
+import com.epmet.entity.PaInfoEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 公众号信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-13
+ */
+@Mapper
+public interface PaInfoDao extends BaseDao {
+
+ /**
+ * @Description 公众号信息插入
+ * @param formDTO
+ * @author zxc
+ */
+ void insertPaInfo(PaInfoFormDTO formDTO);
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthCodeEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthCodeEntity.java
index fd9d829d2c..3ab4b6607d 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthCodeEntity.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthCodeEntity.java
@@ -29,7 +29,7 @@ import java.util.Date;
* 授权回调url反参表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@@ -43,6 +43,11 @@ public class AuthCodeEntity extends BaseEpmetEntity {
*/
private String customerId;
+ /**
+ * resi:居民端,work:工作端
+ */
+ private String clientType;
+
/**
* 授权方APPID
*/
@@ -54,8 +59,8 @@ public class AuthCodeEntity extends BaseEpmetEntity {
private String authCode;
/**
- * 有效期 10min
+ * 到期时间
*/
- private Integer expiresIn;
+ private Date expiresInTime;
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthResultRecordEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthResultRecordEntity.java
new file mode 100644
index 0000000000..c9fd91b40f
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthResultRecordEntity.java
@@ -0,0 +1,86 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 授权结果记录表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-15
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("auth_result_record")
+public class AuthResultRecordEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 第三方平台AppId 第三方平台AppId
+ */
+ private String componentAppId;
+
+ /**
+ * 微信返回创建时间 微信返回创建时间
+ */
+ private Date wechatCreateTime;
+
+ /**
+ * 通知类型
+ */
+ private String infoType;
+
+ /**
+ * 授权方AppId
+ */
+ private String authorizerAppId;
+
+ /**
+ * 授权码(auth_code)
+ */
+ private String authorizationCode;
+
+ /**
+ * 授权码过期时间
+ */
+ private Date expiresInTime;
+
+ /**
+ * 预授权码
+ */
+ private String preAuthCode;
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthorizationInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthorizationInfoEntity.java
index f774abb2cf..372c8265b6 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthorizationInfoEntity.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthorizationInfoEntity.java
@@ -29,7 +29,7 @@ import java.util.Date;
* 授权信息表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@@ -49,14 +49,14 @@ public class AuthorizationInfoEntity extends BaseEpmetEntity {
private String authorizerAppid;
/**
- * 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值)
+ * 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值)【第三方和微信交互使用】
*/
private String authorizerAccessToken;
/**
- * authorizer_access_token 的有效期(在授权的公众号/小程序具备API权限时,才有此返回值),单位:秒
+ * 到期时间
*/
- private Integer expiresIn;
+ private Date expiresInTime;
/**
* 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/RefreshAuthorizerAccessTokenEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BindingAccountEntity.java
similarity index 72%
rename from epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/RefreshAuthorizerAccessTokenEntity.java
rename to epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BindingAccountEntity.java
index 0a5c9ddfe2..bf30343ad0 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/RefreshAuthorizerAccessTokenEntity.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BindingAccountEntity.java
@@ -26,41 +26,36 @@ import lombok.EqualsAndHashCode;
import java.util.Date;
/**
- * 获取/刷新接口调用令牌记录表
+ * 公众号/小程序绑定开放平台帐号表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
-@TableName("refresh_authorizer_access_token")
-public class RefreshAuthorizerAccessTokenEntity extends BaseEpmetEntity {
+@TableName("binding_account")
+public class BindingAccountEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
- * 授权方令牌
+ * 开放平台账号ID 开放平台账号ID
*/
- private String authorizerAccessToken;
+ private String openPlatformAccountId;
/**
- * 有效期,单位:秒
+ * 公众号/小程序APPID(授权方APPID) 授权方APPID
*/
- private Integer expiresIn;
+ private String authAppId;
/**
- * 刷新令牌
+ * 客户ID 客户ID
*/
- private String authorizerRefreshToken;
-
- /**
- * 授权方APPID
- */
- private String authAppid;
+ private String customerId;
/**
- * 客户ID
+ * 客户端 居民端:resi,工作端:work
*/
- private String customerId;
+ private String clientType;
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BusinessInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BusinessInfoEntity.java
new file mode 100644
index 0000000000..7f49030d68
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BusinessInfoEntity.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 功能开通状况表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-14
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("business_info")
+public class BusinessInfoEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 主表ID 主表ID
+ */
+ private String primaryId;
+
+ /**
+ * 功能类型 open_store:是否开通微信门店功能 open_scan:是否开通微信扫商品功能 open_pay:是否开通微信支付功能 open_card:是否开通微信卡券功能 open_shake:是否开通微信摇一摇功能
+ */
+ private String funcType;
+
+ /**
+ * 开通状态 0:未开通,1:已开通
+ */
+ private Integer openStatus;
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditRecordEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditRecordEntity.java
new file mode 100644
index 0000000000..2f75ae13cb
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditRecordEntity.java
@@ -0,0 +1,114 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 代码审核记录表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-15
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("code_audit_record")
+public class CodeAuditRecordEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 模板ID
+ */
+ private String templateId;
+
+ /**
+ * 客户端类型:resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 授权方AppId
+ */
+ private String authAppId;
+
+ /**
+ * 小程序的原始 ID
+ */
+ private String toUserName;
+
+ /**
+ * 发送方帐号(一个 OpenID,此时发送方是系统帐号)
+ */
+ private String fromUserName;
+
+ /**
+ * 消息创建时间 (整型),时间戳
+ */
+ private Date wechatCreateTime;
+
+ /**
+ * 消息类型 event
+ */
+ private String msgType;
+
+ /**
+ * 事件类型
+weapp_audit_success:审核通过,
+weapp_audit_fail:审核不通过,
+weapp_audit_delay:审核延后
+ */
+ private String event;
+
+ /**
+ * 审核成功时的时间戳
+ */
+ private Date succTime;
+
+ /**
+ * 审核不通过的时间戳
+ */
+ private Date failTime;
+
+ /**
+ * 审核延后时的时间戳
+ */
+ private Date delayTime;
+
+ /**
+ * 审核不通过的原因
+ */
+ private String reason;
+
+ /**
+ * 审核不通过的截图示例。用 | 分隔的 media_id 的列表,可通过获取永久素材接口拉取截图内容
+ */
+ private String screenShot;
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentAccessTokenEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentAccessTokenEntity.java
index 47ed337383..c2b35c1cd4 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentAccessTokenEntity.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentAccessTokenEntity.java
@@ -29,7 +29,7 @@ import java.util.Date;
* 第三方平台调用凭证
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@@ -44,8 +44,8 @@ public class ComponentAccessTokenEntity extends BaseEpmetEntity {
private String componentAccessToken;
/**
- * 令牌有效期 单位:s 最长 60*60*2
+ * 令牌到期时间
*/
- private Integer expiresIn;
+ private Date expiresInTime;
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentVerifyTicketEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentVerifyTicketEntity.java
index dd39c42496..f11ad037e9 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentVerifyTicketEntity.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentVerifyTicketEntity.java
@@ -29,7 +29,7 @@ import java.util.Date;
* 微信发送的ticket表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-08
+ * @since v1.0.0 2020-07-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/FuncInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/FuncInfoEntity.java
index fd32f8067f..409174b938 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/FuncInfoEntity.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/FuncInfoEntity.java
@@ -29,7 +29,7 @@ import java.util.Date;
* 授权给开发者的权限集列表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniCategoryInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniCategoryInfoEntity.java
new file mode 100644
index 0000000000..4ba976c442
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniCategoryInfoEntity.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 小程序配置类目信息表 小程序配置类目信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-14
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("mini_category_info")
+public class MiniCategoryInfoEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 主表ID
+ */
+ private String primaryId;
+
+ /**
+ * 类目排序 first , second
+ */
+ private String categorySort;
+
+ /**
+ * 类目名称 资讯,文娱......
+ */
+ private String categoryName;
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniInfoEntity.java
new file mode 100644
index 0000000000..b45f524a0b
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniInfoEntity.java
@@ -0,0 +1,91 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 小程序信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-14
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("mini_info")
+public class MiniInfoEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 昵称
+ */
+ private String nickName;
+
+ /**
+ * 头像
+ */
+ private String headImg;
+
+ /**
+ * 小程序类型 默认为 0
+ */
+ private String serviceTypeInfo;
+
+ /**
+ * 小程序认证类型 小程序认证类型
+ */
+ private String verifyTypeInfo;
+
+ /**
+ * 原始 ID
+ */
+ private String userName;
+
+ /**
+ * 主体名称
+ */
+ private String principalName;
+
+ /**
+ * 账号介绍
+ */
+ private String signature;
+
+ /**
+ * 二维码图片的 URL
+ */
+ private String qrcodeUrl;
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniNetworkInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniNetworkInfoEntity.java
new file mode 100644
index 0000000000..e873f52ecb
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniNetworkInfoEntity.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 小程序配置合法域名信息表 小程序配置合法域名信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-14
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("mini_network_info")
+public class MiniNetworkInfoEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 主表ID 主表ID
+ */
+ private String primaryId;
+
+ /**
+ * 类型
+ */
+ private String networkType;
+
+ /**
+ * 域名 RequestDomain,WsRequestDomain,UploadDomain,DownloadDomain
+ */
+ private String url;
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthorizerRefreshTokenEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenPlatformAccountEntity.java
similarity index 79%
rename from epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthorizerRefreshTokenEntity.java
rename to epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenPlatformAccountEntity.java
index 1f6d7127d4..892de984ac 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthorizerRefreshTokenEntity.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenPlatformAccountEntity.java
@@ -26,26 +26,27 @@ import lombok.EqualsAndHashCode;
import java.util.Date;
/**
- * 授权方的刷新令牌表
+ * 开放平台账号表
+
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
-@TableName("authorizer_refresh_token")
-public class AuthorizerRefreshTokenEntity extends BaseEpmetEntity {
+@TableName("open_platform_account")
+public class OpenPlatformAccountEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
- * 授权方的刷新令牌
+ * openId 所创建的开放平台帐号的 appid
*/
- private String authorizerRefreshToken;
+ private String openAppId;
/**
- * 授权方appid
+ * 客户ID 客户ID
*/
- private String authorizerAppid;
+ private String customerId;
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaInfoEntity.java
new file mode 100644
index 0000000000..7968591b02
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaInfoEntity.java
@@ -0,0 +1,99 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 公众号信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-14
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("pa_info")
+public class PaInfoEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 客户端类型 resi:居民端,work:工作端
+ */
+ private String clientType;
+
+ /**
+ * 昵称
+ */
+ private String nickName;
+
+ /**
+ * 头像
+ */
+ private String headImg;
+
+ /**
+ * 公众号类型 0:订阅号
+1:由历史老帐号升级后的订阅号
+2:服务号
+ */
+ private String serviceTypeInfo;
+
+ /**
+ * 公众号认证类型 -1:未认证
+0:微信认证
+1:新浪微博认证
+2:腾讯微博认证
+3:已资质认证通过但还未通过名称认证
+4:已资质认证通过、还未通过名称认证,但通过了新浪微博认证
+5:已资质认证通过、还未通过名称认证,但通过了腾讯微博认证
+ */
+ private String verifyTypeInfo;
+
+ /**
+ * 原始ID
+ */
+ private String userName;
+
+ /**
+ * 主体名称
+ */
+ private String principalName;
+
+ /**
+ * 公众号所设置的微信号,可能为空 公众号所设置的微信号,可能为空
+ */
+ private String alias;
+
+ /**
+ * 二维码图片的 URL
+ */
+ private String qrcodeUrl;
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PreAuthTokenEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PreAuthTokenEntity.java
index 9ccb82efe1..90ee22dd33 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PreAuthTokenEntity.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PreAuthTokenEntity.java
@@ -29,7 +29,7 @@ import java.util.Date;
* 预授权码历史记录表
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2020-07-09
+ * @since v1.0.0 2020-07-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@@ -44,8 +44,8 @@ public class PreAuthTokenEntity extends BaseEpmetEntity {
private String preAuthToken;
/**
- * 预授权码有效期 单位:s 最长 60*60*2
+ * 预授权码有效期
*/
- private Integer expiresIn;
+ private Date expiresInTime;
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/RedisThird.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/RedisThird.java
index 07324228de..de326be7d7 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/RedisThird.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/RedisThird.java
@@ -4,6 +4,7 @@ import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.constant.ModuleConstant;
import com.epmet.constant.ThirdRedisKeyConstant;
import com.epmet.dto.form.AuthCodeFormDTO;
+import com.epmet.dto.form.AuthorizationInfoFormDTO;
import com.epmet.dto.form.AuthorizerAccessTokenFormDTO;
import com.epmet.dto.result.AuthorizationInfoResultDTO;
import lombok.extern.slf4j.Slf4j;
@@ -37,15 +38,14 @@ public class RedisThird {
/**
* @Description 获取 component_verify_ticket
- * @param key
* @author zxc
*/
- public String getComponentVerifyTicket(String key){
+ public String getComponentVerifyTicket(){
return redisTemplate.opsForValue().get(ThirdRedisKeyConstant.TICKET_REDIS_KEY).toString();
}
/**
- * @Description 缓存 component_access_token 有效期:1小时59分钟 (官网有效期:2H)
+ * @Description 缓存 component_access_token 有效期: (官网有效期:2H)
* @param accessToken
* @author zxc
*/
@@ -56,38 +56,36 @@ public class RedisThird {
/**
* @Description 获取 component_access_token
- * @param key
* @author zxc
*/
- public String getComponentAccessToken(String key){
- return redisTemplate.opsForValue().get(ThirdRedisKeyConstant.ACCESS_TOKEN_REDIS_KEY+key).toString();
+ public String getComponentAccessToken(){
+ return redisTemplate.opsForValue().get(ThirdRedisKeyConstant.ACCESS_TOKEN_REDIS_KEY).toString();
}
/**
* @Description 缓存 pre_auth_code 有效期: (官方有效期 10分钟)
* @param authCode pre_auth_code 预授权码
- * @param expiresIn expires_in 有效期
* @author zxc
*/
- public void setPreAuthCode(String authCode,Integer expiresIn){
- redisUtils.set(ThirdRedisKeyConstant.PRE_AUTH_CODE_REDIS_KEY+ModuleConstant.PRE_AUTH_CODE,authCode,-1);
+ public void setPreAuthCode(String authCode){
+ redisUtils.set(ThirdRedisKeyConstant.PRE_AUTH_CODE_REDIS_KEY,authCode,-1);
}
/**
- * @Description 缓存 刷新令牌
+ * @Description 缓存 刷新令牌 【授权信息(不包括 授权给开发者的权限集列表)】
* (在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。
* 一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效
- * @param refreshAccessToken
+ * @param authInfoDTO
* @author zxc
*/
- public void setAuthorizerRefreshToken(AuthorizerAccessTokenFormDTO refreshAccessToken){
- String key = ThirdRedisKeyConstant.AUTHORIZER_REFRESH_TOKEN_REDIS_KEY + ThirdRedisKeyConstant.COLON + refreshAccessToken.getCustomerId()+ThirdRedisKeyConstant.COLON+refreshAccessToken.getAuthAppid();
- redisUtils.set(key,refreshAccessToken,-1);
+ public void setAuthorizerRefreshToken(AuthorizationInfoFormDTO authInfoDTO){
+ String key = ThirdRedisKeyConstant.AUTHORIZER_REFRESH_TOKEN_REDIS_KEY + ThirdRedisKeyConstant.COLON + authInfoDTO.getCustomerId()+ThirdRedisKeyConstant.COLON+authInfoDTO.getClientType();
+ redisUtils.set(key,authInfoDTO,-1);
}
/**
* @Description 获取刷新
- * @param key
+ * @param key = epmet:wechartthird:authorizerrefreshtoken:customerId:clientType
* @author zxc
*/
public String getAuthorizerRefreshToken(String key){
@@ -100,7 +98,7 @@ public class RedisThird {
* @author zxc
*/
public void setAuthCode(AuthCodeFormDTO formDTO){
- String key = ThirdRedisKeyConstant.AUTH_CODE_REDIS_KEY+ThirdRedisKeyConstant.COLON+formDTO.getCustomerId();
+ String key = ThirdRedisKeyConstant.AUTH_CODE_REDIS_KEY+ThirdRedisKeyConstant.COLON+formDTO.getCustomerId()+ThirdRedisKeyConstant.COLON+formDTO.getClientType();
redisUtils.set(key,formDTO,-1);
}
@@ -115,7 +113,7 @@ public class RedisThird {
}
/**
- * @Description 缓存授权信息
+ * @Description 缓存授权信息【完整的,包括 授权给开发者的权限集列表 】
* @param authInfo
* @author zxc
*/
@@ -123,4 +121,15 @@ public class RedisThird {
redisUtils.set(ThirdRedisKeyConstant.AUTH_INFO_REDIS_KEY,authInfo,-1);
}
+ /**
+ * @Description 缓存 刷新后的 授权方令牌 【authorizer_access_token】 和 刷新令牌 【authorizer_refresh_token】
+ * @param refreshAccessToken
+ * @param clientType
+ * @author zxc
+ */
+ /*public void setAuthorizerRefreshToken(AuthorizerAccessTokenFormDTO refreshAccessToken,String clientType){
+ String key = ThirdRedisKeyConstant.AUTHORIZER_REFRESH_TOKEN_REDIS_KEY + ThirdRedisKeyConstant.COLON + refreshAccessToken.getCustomerId()+ThirdRedisKeyConstant.COLON+clientType;
+ redisUtils.set(key,refreshAccessToken,-1);
+ }*/
+
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java
new file mode 100644
index 0000000000..30fa445a54
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java
@@ -0,0 +1,20 @@
+package com.epmet.service;
+
+import com.epmet.commons.tools.security.dto.TokenDto;
+import com.epmet.dto.form.GoToAuthFormDTO;
+import com.epmet.dto.result.GoToAuthResultDTO;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/10 15:52
+ */
+public interface AppLetAuthorizationService {
+
+ /**
+ * @Description 小程序点击“去授权”的时候
+ * @param tokenDto
+ * @author zxc
+ */
+ GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO);
+
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java
index a20ff2d1f4..2fb00e3322 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java
@@ -1,7 +1,5 @@
package com.epmet.service;
-import com.epmet.commons.tools.security.dto.TokenDto;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -29,7 +27,7 @@ public interface ComponentVerifyTicketService {
* @Description 每个预授权码有效期为 10 分钟。需要先获取令牌才能调用 获取预授权码
* @author zxc
*/
- void preAuthCode();
+ String preAuthCode();
/**
* @Description 获取/刷新接口调用令牌
@@ -43,6 +41,6 @@ public interface ComponentVerifyTicketService {
* @param
* @author zxc
*/
- void redirectUri(HttpServletRequest request, HttpServletResponse response, TokenDto tokenDto,String authAppId);
+ void redirectUri(HttpServletRequest request, HttpServletResponse response);
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java
new file mode 100644
index 0000000000..49d182479a
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java
@@ -0,0 +1,60 @@
+package com.epmet.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.epmet.commons.tools.security.dto.TokenDto;
+import com.epmet.commons.tools.utils.HttpClientManager;
+import com.epmet.constant.ModuleConstant;
+import com.epmet.constant.ThirdApiConstant;
+import com.epmet.dao.ComponentAccessTokenDao;
+import com.epmet.dao.PaCustomerAgencyDao;
+import com.epmet.dto.form.GoToAuthFormDTO;
+import com.epmet.dto.result.GoToAuthResultDTO;
+import com.epmet.redis.RedisThird;
+import com.epmet.service.AppLetAuthorizationService;
+import com.epmet.service.ComponentVerifyTicketService;
+import com.google.gson.JsonObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+/**
+ * @Author zxc
+ * @CreateTime 2020/7/10 15:52
+ */
+@Slf4j
+@Service
+public class AppLetAuthorizationServiceImpl implements AppLetAuthorizationService {
+
+ @Autowired
+ private PaCustomerAgencyDao paCustomerAgencyDao;
+ @Autowired
+ private ComponentVerifyTicketService componentVerifyTicketService;
+ @Autowired
+ private ComponentAccessTokenDao componentAccessTokenDao;
+ @Autowired
+ private RedisThird redisThird;
+ @Value("${third.platform.appId}")
+ private String componentAppId;
+
+ /**
+ * @Description 小程序点击“去授权”的时候
+ * @param tokenDto
+ * @author zxc
+ */
+ @Override
+ public GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO) {
+ GoToAuthResultDTO result = new GoToAuthResultDTO();
+ String userId = tokenDto.getUserId();
+ String customerId = paCustomerAgencyDao.getCustomerIdByUserId(userId);
+ //获取预授权码
+ String preAuthCode = componentVerifyTicketService.preAuthCode();
+ String redirectUrl = String.format(ThirdApiConstant.API_RETURN_REDIRECT_URL, formDTO.getClientType(), customerId);
+ String authUrl = String.format(ThirdApiConstant.API_AUTH_REGISTER_URL, componentAppId, preAuthCode, redirectUrl);
+ result.setUrl(authUrl);
+ return result;
+ }
+}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java
index cb13287289..38d4a12b86 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java
@@ -5,14 +5,15 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.client.config.utils.IOUtils;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
-import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.constant.ModuleConstant;
import com.epmet.constant.ThirdApiConstant;
import com.epmet.constant.ThirdRunTimeInfoConstant;
import com.epmet.dao.*;
import com.epmet.dto.form.*;
+import com.epmet.dto.result.AuthCodeResultDTO;
import com.epmet.dto.result.AuthorizationInfoResultDTO;
+import com.epmet.dto.result.CreateOpenResultDTO;
import com.epmet.dto.result.WillOverDueResultDTO;
import com.epmet.redis.RedisThird;
import com.epmet.service.ComponentVerifyTicketService;
@@ -22,7 +23,9 @@ import com.epmet.util.XmlUtil;
import com.github.pagehelper.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -31,9 +34,11 @@ import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
import java.util.*;
-import static com.epmet.constant.ThirdPlatformConstant.*;
import static com.epmet.constant.ThirdRunTimeInfoConstant.*;
/**
@@ -59,9 +64,30 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
@Autowired
private FuncInfoDao funcInfoDao;
@Autowired
- private PaCustomerAgencyDao paCustomerAgencyDao;
+ private CustomerMpDao customerMpDao;
@Autowired
- private RefreshAuthorizerAccessTokenDao refreshAuthorizerAccessTokenDao;
+ private PaInfoDao paInfoDao;
+ @Autowired
+ private OpenPlatformAccountDao openPlatformAccountDao;
+ @Autowired
+ private BindingAccountDao bindingAccountDao;
+ @Autowired
+ private MiniInfoDao miniInfoDao;
+ @Autowired
+ private MiniNetworkInfoDao miniNetworkInfoDao;
+ @Autowired
+ private MiniCategoryInfoDao miniCategoryInfoDao;
+ @Autowired
+ private BusinessInfoDao businessInfoDao;
+
+ @Value("${third.platform.appId}")
+ private String componentAppId;
+ @Value("${third.platform.appSecret}")
+ private String appSecret;
+ @Value("${third.platform.aesKey}")
+ private String aesKey;
+ @Value("${third.platform.token}")
+ private String token;
/**
* @Description 获得授权事件的票据
@@ -98,7 +124,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
if(StringUtil.isEmpty(encrypt)) {
msg = fromXML;
} else {
- wxcpt = new WXBizMsgCrypt(PLATFORM_COMPONENT_TOKEN,PLATFORM_AES_KEY, PLATFORM_APP_ID);
+ wxcpt = new WXBizMsgCrypt(token,aesKey, componentAppId);
// 解密消息
msg = wxcpt.decryptMsg(msgSignature, timeStamp, nonce, fromXML);
}
@@ -108,30 +134,49 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
String infotype = result.get(ModuleConstant.INFO_TYPE); //获取infotype,注:微信开放平台文档中标明固定为:"component_verify_ticket",但参考其他代码,还包含authorized???
log.info(infotype);
switch (infotype){
- case ModuleConstant.TICKET_UNDERLINE_KEY: //验证票据
+ case ModuleConstant.TICKET_UNDERLINE_KEY: //接收票据 【component_verify_ticket】
String ComponentVerifyTicket = result.get(ModuleConstant.TICKET_KEY);
// 缓存 ticket
redisThird.setComponentVerifyTicket(ComponentVerifyTicket);
// 存数据库
ComponentVerifyTicketFormDTO ticketFormDTO = new ComponentVerifyTicketFormDTO();
- ticketFormDTO.setAppid(PLATFORM_APP_ID);
+ ticketFormDTO.setComponentAppId(componentAppId);
ticketFormDTO.setComponentVerifyTicket(ComponentVerifyTicket);
+ //先逻辑删
+ ticketDao.updateOldComponentVerifyTicket();
ticketDao.insertComponentVerifyTicket(ticketFormDTO);
log.info(ModuleConstant.TICKET_UNDERLINE_KEY+":"+ComponentVerifyTicket);
break;
+ case ModuleConstant.AUTHORIZED: //授权成功
+ // 更改customer_mp 授权信息,appId,并绑定
+ String authAppId = result.get(ModuleConstant.APP_ID);
+ String authCode = result.get(ModuleConstant.AUTHORIZATION_CODE_HUMP);
+ AuthCodeResultDTO authCodeResultDTO = authCodeDao.selectCustomerIdByAuthCode(authCode);
+ String clientType = authCodeResultDTO.getClientType();
+ String customerId = authCodeResultDTO.getCustomerId();
+ this.updateCustomerMpAppIdAndCreateOpenPlatform(customerId,authAppId,clientType);
+ this.authInfoByAuthCode(authCode, customerId,clientType);
+ authCodeDao.updateAppId(customerId,clientType,authAppId);
+ this.saveAuthAccountInfo(customerId,authAppId,clientType);
+// customerMpDao.updateAuthorizationFlag(authAppId);
case ModuleConstant.UNAUTHORIZED://用户取消授权
- return ModuleConstant.NULL_CHAR;
+ return ModuleConstant.SUCCESS;
}
} catch (Exception e) {
log.error(e.getMessage());
- return ModuleConstant.NULL_CHAR;
+ return ModuleConstant.SUCCESS;
}
log.info(ThirdRunTimeInfoConstant.END_TICKET);
+ Integer tokenCount = componentAccessTokenDao.selectAccessTokenCount();
+ if (tokenCount == NumConstant.ZERO){
+ this.getComponentAccessToken();
+ }
return ModuleConstant.SUCCESS;
}
/**
- * @Description 定时获取 (令牌,component_access_token)
+ * @Description 定时获取 (令牌,component_access_token) 第三方与微信交互使用的component_access_token
+ * 每十分钟执行一次,判断是否有马上超时的(15分钟以内算马上超时)
* @param
* @author zxc
*/
@@ -140,35 +185,39 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
public void getComponentAccessToken() {
log.info(ThirdRunTimeInfoConstant.START_GET_COMPONENT_ACCESS_TOKEN);
Map reMap;
- try {
- // 核心定时器
- String componentVerifyTicket = redisThird.getComponentVerifyTicket(ModuleConstant.TICKET_UNDERLINE_KEY);
- JSONObject jsonObject = new JSONObject();
- jsonObject.put(ModuleConstant.COMPONENT_APPID, PLATFORM_APP_ID);
- jsonObject.put(ModuleConstant.COMPONENT_APPSECRET, PLATFORM_APP_SECRET);
- jsonObject.put(ModuleConstant.TICKET_UNDERLINE_KEY, componentVerifyTicket);
- String post = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_COMPONENT_TOKEN_URL, JSON.toJSONString(jsonObject)).getData();
- HashMap hashMap = JSON.parseObject(post, HashMap.class);
- String componentAccessToken = hashMap.get(ModuleConstant.COMPONENT_ACCESS_TOKEN);
- String expiresIn = hashMap.get(ModuleConstant.EXPIRES_IN);
- if (StringUtils.isNotEmpty(componentAccessToken)) {
- //令牌信息存DB
- ComponentAccessTokenFormDTO formDTO = new ComponentAccessTokenFormDTO();
- formDTO.setComponentAccessToken(componentAccessToken);
- formDTO.setExpiresIn(Integer.valueOf(expiresIn));
- //先逻辑删,在插入
- log.info(ThirdRunTimeInfoConstant.START_DELETE_COMPONENT_ACCESS_TOKEN);
- componentAccessTokenDao.updateOldComponentAccessToken();
- componentAccessTokenDao.insertComponentAccessToken(formDTO);
- //存缓存
- redisThird.setComponentAccessToken(componentAccessToken);
- } else {
- throw new RenException(ThirdRunTimeInfoConstant.FAILURE_ACCESS_TOKEN);
+ //距离超时时间小于15分钟的数量
+ Integer tokenCount = componentAccessTokenDao.selectWillOverTokenCount();
+ if (tokenCount > NumConstant.ZERO) {
+ try {
+ String componentVerifyTicket = redisThird.getComponentVerifyTicket();
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId);
+ jsonObject.put(ModuleConstant.COMPONENT_APPSECRET, appSecret);
+ jsonObject.put(ModuleConstant.TICKET_UNDERLINE_KEY, componentVerifyTicket);
+ String post = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_COMPONENT_TOKEN_URL, JSON.toJSONString(jsonObject)).getData();
+ HashMap hashMap = JSON.parseObject(post, HashMap.class);
+ String componentAccessToken = hashMap.get(ModuleConstant.COMPONENT_ACCESS_TOKEN);
+ String expiresIn = hashMap.get(ModuleConstant.EXPIRES_IN);
+ Date expiresInTime = this.countExpirationTime(expiresIn);
+ if (StringUtils.isNotEmpty(componentAccessToken)) {
+ //令牌信息存DB
+ ComponentAccessTokenFormDTO formDTO = new ComponentAccessTokenFormDTO();
+ formDTO.setComponentAccessToken(componentAccessToken);
+ formDTO.setExpiresInTime(expiresInTime);
+ //先逻辑删,在插入
+ log.info(ThirdRunTimeInfoConstant.START_DELETE_COMPONENT_ACCESS_TOKEN);
+ componentAccessTokenDao.updateOldComponentAccessToken();
+ componentAccessTokenDao.insertComponentAccessToken(formDTO);
+ //存缓存
+ redisThird.setComponentAccessToken(componentAccessToken);
+ } else {
+ throw new RenException(ThirdRunTimeInfoConstant.FAILURE_ACCESS_TOKEN);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
}
- } catch (Exception e) {
- e.printStackTrace();
+ log.info(ThirdRunTimeInfoConstant.SUCCESS_ACCESS_TOKEN);
}
- log.info(ThirdRunTimeInfoConstant.SUCCESS_ACCESS_TOKEN);
}
/**
@@ -178,28 +227,29 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
*/
@Transactional(rollbackFor = Exception.class)
@Override
- public void preAuthCode() {
+ public String preAuthCode() {
log.info(START_GET_PRE_AUTH_CODE);
+ String preAuthCode = "";
try {
- String accessToken = redisThird.getComponentAccessToken(ModuleConstant.COMPONENT_ACCESS_TOKEN);
+ String accessToken = redisThird.getComponentAccessToken();
JSONObject jsonObject = new JSONObject();
- jsonObject.put(ModuleConstant.COMPONENT_APPID, PLATFORM_APP_ID);
+ jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId);
String post = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_CREATE_PREAUTHCODE_URL + accessToken, JSON.toJSONString(jsonObject)).getData();
log.info(String.format(POST_RESULT,post));
HashMap hashMap = JSON.parseObject(post, HashMap.class);
- String preAuthCode = hashMap.get(ModuleConstant.PRE_AUTH_CODE);
+ preAuthCode = hashMap.get(ModuleConstant.PRE_AUTH_CODE);
String expiresIn = hashMap.get(ModuleConstant.EXPIRES_IN);
- int ex = Integer.valueOf(expiresIn) - NumConstant.SIXTY;
+ Date expiresInTime = this.countExpirationTime(expiresIn);
if (StringUtils.isNotEmpty(preAuthCode)) {
//预授权码 存DB
PreAuthTokenFormDTO formDTO = new PreAuthTokenFormDTO();
formDTO.setPreAuthToken(preAuthCode);
- formDTO.setExpiresIn(ex);
+ formDTO.setExpiresInTime(expiresInTime);
//先逻辑删除,在插入DB
preAuthTokenDao.updateOldPreAuthCode();
preAuthTokenDao.insertPreAuthToken(formDTO);
//预授权码 放入缓存
- redisThird.setPreAuthCode(preAuthCode,ex);
+ redisThird.setPreAuthCode(preAuthCode);
} else {
throw new RuntimeException(FAILURE_GET_PRE_AUTH_CODE);
}
@@ -207,6 +257,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
e.printStackTrace();
}
log.info(END_GET_PRE_AUTH_CODE);
+ return preAuthCode;
}
/**
@@ -214,40 +265,33 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
* @author zxc
*/
@Transactional(rollbackFor = Exception.class)
- public AuthorizationInfoResultDTO authInfoByAuthCode(String authCode,String authAppId,String customerId) {
+ public AuthorizationInfoResultDTO authInfoByAuthCode(String authCode,String customerId,String clientType) {
log.info(START_GET_AUTH_INFO);
AuthorizationInfoResultDTO authorizationInfoResultDTO = new AuthorizationInfoResultDTO();
// 获取令牌【component_access_token】
- String accessToken = redisThird.getComponentAccessToken(ModuleConstant.COMPONENT_ACCESS_TOKEN);
+ String accessToken = redisThird.getComponentAccessToken();
// 使用授权码获取授权信息
JSONObject jsonObject = new JSONObject();
- jsonObject.put(ModuleConstant.COMPONENT_APPID, PLATFORM_APP_ID);
+ jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId);
jsonObject.put(ModuleConstant.AUTHORIZATION_CODE, authCode);
String authInfo = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_QUERY_AUTH_URL + accessToken, JSON.toJSONString(jsonObject)).getData();
HashMap hashMap = JSON.parseObject(authInfo, HashMap.class);
Map map = hashMap.get(ModuleConstant.AUTHORIZATION_INFO);
authorizationInfoResultDTO = mapToEntity(map, AuthorizationInfoResultDTO.class);
+ String expiresIn = authorizationInfoResultDTO.getExpires_in();
+ Date expiresInTime = this.countExpirationTime(expiresIn);
//授权信息分为两张表,基础信息authorization_info,授权列表func_info
// 1. 基础信息
AuthorizationInfoFormDTO authInfoDTO = new AuthorizationInfoFormDTO();
authInfoDTO.setAuthorizerAppid(authorizationInfoResultDTO.getAuthorizer_appid());
authInfoDTO.setAuthorizerAccessToken(authorizationInfoResultDTO.getAuthorizer_access_token());
authInfoDTO.setAuthorizerRefreshToken(authorizationInfoResultDTO.getAuthorizer_refresh_token());
- authInfoDTO.setExpiresIn(Integer.valueOf(authorizationInfoResultDTO.getExpires_in()));
+ authInfoDTO.setExpiresInTime(expiresInTime);
authInfoDTO.setCustomerId(customerId);
+ authInfoDTO.setClientType(clientType);
//先逻辑删除,在插入
- authorizationInfoDao.updateOldAuthorizationInfo(customerId);
+ authorizationInfoDao.updateOldAuthorizationInfo(customerId,clientType);
authorizationInfoDao.insertAuthorizationInfo(authInfoDTO);
- // 获取/刷新接口调用令牌记录表 插入
- AuthorizerAccessTokenFormDTO refreshAccessToken = new AuthorizerAccessTokenFormDTO();
- refreshAccessToken.setAuthAppid(authAppId);
- refreshAccessToken.setCustomerId(customerId);
- refreshAccessToken.setAuthorizerAccessToken(authorizationInfoResultDTO.getAuthorizer_access_token());
- refreshAccessToken.setAuthorizerRefreshToken(authorizationInfoResultDTO.getAuthorizer_refresh_token());
- refreshAccessToken.setExpiresIn(Integer.valueOf(authorizationInfoResultDTO.getExpires_in()));
- //先逻辑删除,再插入
- refreshAuthorizerAccessTokenDao.updateOldAuthorizerAccessToken(customerId);
- refreshAuthorizerAccessTokenDao.insertAuthorizerAccessToken(refreshAccessToken);
// 2. 权限列表
log.info(START_INSERT_FUNC_INFO);
List funcInfos = new ArrayList<>();
@@ -270,7 +314,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
// 授权信息放入缓存
redisThird.setAuthInfo(authorizationInfoResultDTO);
//authorizer_refresh_token 放入缓存
- redisThird.setAuthorizerRefreshToken(refreshAccessToken);
+ redisThird.setAuthorizerRefreshToken(authInfoDTO);
log.info(END_GET_AUTH_INFO);
return authorizationInfoResultDTO;
}
@@ -283,14 +327,18 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
@Transactional(rollbackFor = Exception.class)
@Override
public void refreshToken() {
- List willOverDueResultDTOS = refreshAuthorizerAccessTokenDao.checkWillOverDue();
+ //查询 即将过期的 authorizer_access_token
+ List willOverDueResultDTOS = authorizationInfoDao.checkWillOverDue();
if (willOverDueResultDTOS.size() != NumConstant.ZERO && null != willOverDueResultDTOS){
willOverDueResultDTOS.forEach(willOverDueDTO -> {
+ String authAppId = willOverDueDTO.getAuthAppId();
+ String customerId = willOverDueDTO.getCustomerId();
+ String clientType = willOverDueDTO.getClientType();
JSONObject jsonObject = new JSONObject();
//授权方AppId
- jsonObject.put(ModuleConstant.AUTHORIZER_APPID,willOverDueDTO.getAuthAppId());
+ jsonObject.put(ModuleConstant.AUTHORIZER_APPID,authAppId);
//第三方平台AppId
- jsonObject.put(ModuleConstant.COMPONENT_APPID,PLATFORM_APP_ID);
+ jsonObject.put(ModuleConstant.COMPONENT_APPID,componentAppId);
jsonObject.put(ModuleConstant.AUTHORIZER_REFRESH_TOKEN,willOverDueDTO.getAuthorizerRefreshToken());
String data = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_AUTHORIZER_TOKEN_URL, JSON.toJSONString(jsonObject)).getData();
Map map = JSON.parseObject(data, HashMap.class);
@@ -298,56 +346,230 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
String authorizerAccessToken = map.get(ModuleConstant.AUTHORIZER_ACCESS_TOKEN).toString();
String expiresIn = map.get(ModuleConstant.EXPIRES_IN).toString();
String authorizerRefreshToken = map.get(ModuleConstant.AUTHORIZER_REFRESH_TOKEN).toString();
+ Date expiresInTime = this.countExpirationTime(expiresIn);
//更新DB
AuthorizerAccessTokenFormDTO formDTO = new AuthorizerAccessTokenFormDTO();
+ AuthorizationInfoFormDTO authorizationInfo = new AuthorizationInfoFormDTO();
+ BeanUtils.copyProperties(formDTO,authorizationInfo);
+ authorizationInfo.setAuthorizerAppid(authAppId);
formDTO.setAuthorizerAccessToken(authorizerAccessToken);
formDTO.setAuthorizerRefreshToken(authorizerRefreshToken);
- formDTO.setExpiresIn(Integer.valueOf(expiresIn));
- formDTO.setCustomerId(willOverDueDTO.getCustomerId());
- formDTO.setAuthAppid(willOverDueDTO.getAuthAppId());
+ formDTO.setExpiresInTime(expiresInTime);
+ formDTO.setCustomerId(customerId);
+ formDTO.setAuthAppid(authAppId);
//先逻辑删除,在插入
- refreshAuthorizerAccessTokenDao.updateOldAuthorizerAccessToken(willOverDueDTO.getCustomerId());
- refreshAuthorizerAccessTokenDao.insertAuthorizerAccessToken(formDTO);
+ authorizationInfoDao.updateOldAuthorizerAccessToken(willOverDueDTO.getCustomerId(),clientType);
+ authorizationInfoDao.insertAuthorizerAccessToken(formDTO);
//缓存 refreshAuthorizerAccessToken
- redisThird.setAuthorizerRefreshToken(formDTO);
+ redisThird.setAuthorizerRefreshToken(authorizationInfo);
});
}
}
/**
- * @Description 授权回调URL
+ * @Description 授权回调URL,回调时并获取授权信息
* @param
* @author zxc
*/
@Transactional(rollbackFor = Exception.class)
@Override
- public void redirectUri(HttpServletRequest request, HttpServletResponse response, TokenDto tokenDto,String authAppId) {
- String userId = tokenDto.getUserId();
- String customerId = paCustomerAgencyDao.getCustomerIdByUserId(userId);
+ public void redirectUri(HttpServletRequest request, HttpServletResponse response) {
try {
request.setCharacterEncoding(ModuleConstant.UTF8);
+ response.setCharacterEncoding(ModuleConstant.UTF8);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
- response.setCharacterEncoding(ModuleConstant.UTF8);
+ String customerId = request.getParameter(ModuleConstant.CUSTOMER_ID);
+ String client = request.getParameter(ModuleConstant.CLIENT);
String authCode = request.getParameter(ModuleConstant.AUTH_CODE);
String expiresIn = request.getParameter(ModuleConstant.EXPIRES_IN);
+ Date expiresInTime = this.countExpirationTime(expiresIn);
+// AuthorizationInfoResultDTO authorizationInfo = this.authInfoByAuthCode(authCode, customerId,client);
//authCode存数据库
AuthCodeFormDTO formDTO = new AuthCodeFormDTO();
formDTO.setAuthCode(authCode);
- formDTO.setExpiresIn(Integer.valueOf(expiresIn));
- formDTO.setAuthAppId(authAppId);
+ formDTO.setExpiresInTime(expiresInTime);
+ formDTO.setClientType(client);
+ //授权方AppId
+// formDTO.setAuthAppId(authorizationInfo.getAuthorizer_appid());
formDTO.setCustomerId(customerId);
+// this.updateCustomerMpAppIdAndCreateOpenPlatform(customerId,authorizationInfo.getAuthorizer_appid(),client);
authCodeDao.insertRedirectAuthCode(formDTO);
//authCode存缓存
redisThird.setAuthCode(formDTO);
- // 获取授权信息
- AuthorizationInfoResultDTO authorizationInfoResultDTO = this.authInfoByAuthCode(authCode, authAppId, customerId);
}
+ /**
+ * @Description 获取授权方的帐号基本信息并保存
+ * @param customerId
+ * @param authAppId
+ * @author zxc
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void saveAuthAccountInfo(String customerId, String authAppId,String clientType) {
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put(ModuleConstant.COMPONENT_APP_ID,componentAppId);
+ jsonObject.put(ModuleConstant.AUTHORIZER_APP_ID,authAppId);
+ String data = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_GET_AUTHORIZER_INFO, JSON.toJSONString(jsonObject)).getData();
+ Map map = JSON.parseObject(data, Map.class);
+ Map authorizerInfo = map.get(ModuleConstant.AUTHORIZER_INFO);
+ // 存在 “miniprograminfo” 字段为小程序,不存在为公众号
+ boolean keyExist = authorizerInfo.containsKey(ModuleConstant.MINI_PROGRAM_INFO);
+ if (keyExist == true){
+ MiniInfoFormDTO miniInfoFormDTO = this.mapToEntity(authorizerInfo, MiniInfoFormDTO.class);
+ miniInfoFormDTO.setCustomerId(customerId);
+ miniInfoFormDTO.setClientType(clientType);
+ //基础信息插入
+ miniInfoDao.insertMiniInfo(miniInfoFormDTO);
+ String primaryId = miniInfoFormDTO.getId();
+ //todo 功能的开通状况信息插入
+ List businessInfoList = new ArrayList<>();
+ Map businessInfo = (Map) authorizerInfo.get(ModuleConstant.BUSINESS_INFO);
+ businessInfo.forEach((key, value) -> {
+ BusinessInfoFormDTO businessInfoForm = new BusinessInfoFormDTO();
+ businessInfoForm.setCustomerId(customerId);
+ businessInfoForm.setClientType(clientType);
+ businessInfoForm.setFuncType(key.toString());
+ businessInfoForm.setOpenStatus(Integer.valueOf(value.toString()));
+ businessInfoForm.setPrimaryId(primaryId);
+ businessInfoList.add(businessInfoForm);
+ });
+ businessInfoDao.insertBusinessInfo(businessInfoList);
+ //todo 小程序配置的合法域名信息插入
+ Map miniProgramInfo = (Map) authorizerInfo.get(ModuleConstant.MINI_PROGRAM_INFO);
+ List networkInfoList = new ArrayList<>();
+ Map networkInfo = (Map) miniProgramInfo.get(ModuleConstant.NETWORK);
+ networkInfo.forEach((key,value) -> {
+ MiniNetworkInfoFormDTO miniNetworkInfoForm = new MiniNetworkInfoFormDTO();
+ miniNetworkInfoForm .setCustomerId(customerId);
+ miniNetworkInfoForm.setClientType(clientType);
+ miniNetworkInfoForm.setNetworkType(key.toString());
+ miniNetworkInfoForm.setUrl(value.toString());
+ miniNetworkInfoForm.setPrimaryId(primaryId);
+ networkInfoList.add(miniNetworkInfoForm);
+ });
+ miniNetworkInfoDao.insertNetworkInfo(networkInfoList);
+ //todo 小程序配置的类目信息插入
+ List categoryInfoList = new ArrayList<>();
+ List categories = (List) miniProgramInfo.get(ModuleConstant.CATEGORIES);
+ categories.forEach(category -> {
+ category.forEach((key,value) -> {
+ MiniCategoryInfoFormDTO categoryInfo = new MiniCategoryInfoFormDTO();
+ categoryInfo.setCustomerId(customerId);
+ categoryInfo.setClientType(clientType);
+ categoryInfo.setCategorySort(key.toString());
+ categoryInfo.setCategoryName(value.toString());
+ categoryInfo.setPrimaryId(primaryId);
+ categoryInfoList.add(categoryInfo);
+ });
+ });
+ miniCategoryInfoDao.insertCategoryInfo(categoryInfoList);
+ }else {
+ PaInfoFormDTO paInfoFormDTO = this.mapToEntity(authorizerInfo, PaInfoFormDTO.class);
+ //公众号基本信息插入
+ paInfoDao.insertPaInfo(paInfoFormDTO);
+ String primaryId = paInfoFormDTO.getId();
+ //todo 功能的开通状况信息插入
+ List businessInfoList = new ArrayList<>();
+ Map businessInfo = (Map) authorizerInfo.get(ModuleConstant.BUSINESS_INFO);
+ businessInfo.forEach((key, value) -> {
+ BusinessInfoFormDTO businessInfoForm = new BusinessInfoFormDTO();
+ businessInfoForm.setCustomerId(customerId);
+ businessInfoForm.setClientType(clientType);
+ businessInfoForm.setFuncType(key.toString());
+ businessInfoForm.setOpenStatus(Integer.valueOf(value.toString()));
+ businessInfoForm.setPrimaryId(primaryId);
+ businessInfoList.add(businessInfoForm);
+ });
+ businessInfoDao.insertBusinessInfo(businessInfoList);
+ }
+
+
+ }
+
+ /**
+ * @Description 1.创建开放平台账号并绑定 2.回填 customer_mp appId
+ * @param
+ * @author zxc
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void updateCustomerMpAppIdAndCreateOpenPlatform(String customerId,String authAppId,String clientType){
+ Integer notAuthCount = customerMpDao.selectAuthCount(customerId);
+ String openPlatformId = null;
+ if (notAuthCount==NumConstant.ZERO){
+ //没有任何一个小程序/公众号授权,【先创建,再绑定】
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put(ModuleConstant.APP_ID,authAppId);
+ String data = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_CREATE_OPEN, JSON.toJSONString(jsonObject)).getData();
+ Map map = JSON.parseObject(data, Map.class);
+ CreateOpenResultDTO createOpen = new CreateOpenResultDTO();
+ createOpen.setErrCode(Integer.valueOf(map.get(ModuleConstant.ERR_CODE)));
+ createOpen.setErrMsg(map.get(ModuleConstant.ERR_MSG));
+ createOpen.setOpenAppId(map.get(ModuleConstant.OPEN_APP_ID));
+ switch (createOpen.getErrCode()){
+ case NumConstant.ONE:
+ log.info(CREATE_AND_BIND_SUCCESS);
+ break;
+ case NumConstant.ONE_NEG:
+ throw new RenException(SYSTEM_ERROR);
+ case ModuleConstant.FORTY_THOUSAND_AND_THIRTEEN:
+ throw new RenException(INVALID_APP_ID);
+ case ModuleConstant.EIGHTY_NINE_THOUSAND:
+ throw new RenException(ACCOUNT_HAS_BOUND_OPEN);
+ }
+ CreateOpenFormDTO coForm = new CreateOpenFormDTO();
+ coForm.setOpenid(map.get(ModuleConstant.OPEN_APP_ID));
+ coForm.setCustomerId(customerId);
+ //插入 open_platform_account 表
+ openPlatformAccountDao.insertOpenPlatFormAccount(coForm);
+ openPlatformId = coForm.getId();
+ }else if (notAuthCount>NumConstant.ZERO){
+ String openAppId = openPlatformAccountDao.selectOpenAppIdByCustomerId(customerId);
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put(ModuleConstant.LOW_APP_ID,componentAppId);
+ jsonObject.put(ModuleConstant.OPEN_APP_ID,openAppId);
+ String data = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_BIND_OPEN, JSON.toJSONString(jsonObject)).getData();
+ Map map = JSON.parseObject(data, Map.class);
+ CreateOpenResultDTO createOpen = new CreateOpenResultDTO();
+ createOpen.setErrCode(Integer.valueOf(map.get(ModuleConstant.ERR_CODE)));
+ createOpen.setErrMsg(map.get(ModuleConstant.ERR_MSG));
+ switch (createOpen.getErrCode()){
+ case NumConstant.ONE:
+ log.info(BIND_SUCCESS);
+ break;
+ case NumConstant.ONE_NEG:
+ throw new RenException(SYSTEM_ERROR);
+ case ModuleConstant.FORTY_THOUSAND_AND_THIRTEEN:
+ throw new RenException(INVALID_APP_ID);
+ case ModuleConstant.EIGHTY_NINE_THOUSAND:
+ throw new RenException(ACCOUNT_HAS_BOUND_OPEN);
+ case ModuleConstant.EIGHTY_NINE_THOUSAND_AND_ONE:
+ throw new RenException(NOT_SAME_CONTRACTOR);
+ case ModuleConstant.EIGHTY_NINE_THOUSAND_AND_THREE:
+ throw new RenException(NOT_ALLOWED_OPERATE);
+ case ModuleConstant.EIGHTY_NINE_THOUSAND_AND_FOUR:
+ throw new RenException(TO_LIMIT);
+ }
+ }
+ AuthCodeFormDTO formDTO = new AuthCodeFormDTO();
+ formDTO.setClientType(clientType);
+ formDTO.setAuthAppId(authAppId);
+ formDTO.setCustomerId(customerId);
+ //回填customer_mp的appId 只需以上三个字段
+ customerMpDao.updateAppIDByCustomerIdAndClient(formDTO);
+ //插入 binding_account
+ BindingAccountFormDTO bindingAccount = new BindingAccountFormDTO();
+ bindingAccount.setOpenPlatformAccountId(openPlatformId);
+ bindingAccount.setAuthAppId(authAppId);
+ bindingAccount.setClientType(clientType);
+ bindingAccount.setCustomerId(customerId);
+ bindingAccountDao.insertBindingAccount(bindingAccount);
+ }
+
/**
* @Description map 转 Entity
* @param map
@@ -377,4 +599,17 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
}
return t;
}
+
+ /**
+ * @Description 转换过期时间
+ * @param expiresIn
+ * @author zxc
+ */
+ public Date countExpirationTime(String expiresIn){
+ long now = LocalDateTime.now().toEpochSecond(ZoneOffset.of(NumConstant.POSITIVE_EIGHT_STR));
+ long expiresInTime = now + Long.valueOf(expiresIn);
+ LocalDateTime localDateTime = Instant.ofEpochMilli(expiresInTime).atZone(ZoneOffset.ofHours(NumConstant.EIGHT)).toLocalDateTime();
+ Date date = Date.from(localDateTime.atZone(ZoneOffset.ofHours(NumConstant.EIGHT)).toInstant());
+ return date;
+ }
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java
index 1f9306de89..1db2652bfa 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java
@@ -1,19 +1,35 @@
package com.epmet.service.impl;
+import com.alibaba.nacos.client.config.utils.IOUtils;
+import com.epmet.constant.ModuleConstant;
+import com.epmet.constant.ThirdRunTimeInfoConstant;
+import com.epmet.dao.CodeAuditRecordDao;
+import com.epmet.dao.CodeAuditResultDao;
+import com.epmet.dao.CodeCustomerDao;
+import com.epmet.dao.MiniInfoDao;
+import com.epmet.dto.form.CodeAuditRecordFormDTO;
+import com.epmet.dto.result.CustomerIdAndClientResultDTO;
+import com.epmet.dto.result.TemplateAndAppIdResultDTO;
import com.epmet.exception.AesException;
import com.epmet.service.WarrantService;
+import com.epmet.util.WXBizMsgCrypt;
+import com.epmet.util.WXXmlToMapUtil;
+import com.epmet.util.XmlUtil;
+import com.github.pagehelper.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.dom4j.Document;
import org.dom4j.DocumentException;
-import org.dom4j.DocumentHelper;
-import org.dom4j.Element;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
/**
* @Author zxc
@@ -22,30 +38,92 @@ import java.io.IOException;
@Slf4j
@Service
public class WarrantServiceImpl implements WarrantService {
+
+ @Value("${third.platform.appId}")
+ private String componentAppId;
+ @Value("${third.platform.appSecret}")
+ private String appSecret;
+ @Value("${third.platform.aesKey}")
+ private String aesKey;
+ @Value("${third.platform.token}")
+ private String token;
+ @Autowired
+ private ComponentVerifyTicketServiceImpl componentVerifyTicketService;
+ @Autowired
+ private CodeAuditRecordDao codeAuditRecordDao;
+ @Autowired
+ private MiniInfoDao miniInfoDao;
+ @Autowired
+ private CodeCustomerDao codeCustomerDao;
+ @Autowired
+ private CodeAuditResultDao codeAuditResultDao;
+
+ /**
+ * @Description 1.保存代码审核结果 2.更新代码上传结果
+ * @param request
+ * @param appid
+ * @param response
+ * @author zxc
+ */
+ @Transactional(rollbackFor = Exception.class)
@Override
public void acceptMessageAndEvent(HttpServletRequest request, String appid, HttpServletResponse response)throws IOException, DocumentException, AesException {
- String msgSignature = request.getParameter("msg_signature");
- log.info("第三方平台全网发布-------------{appid}/callback-----------验证开始。。。。msg_signature=" + msgSignature);
+ request.setCharacterEncoding(ModuleConstant.UTF8);
+ String msgSignature = request.getParameter(ModuleConstant.MSG_SIGNATURE);
+ String timeStamp = request.getParameter(ModuleConstant.TIMESTAMP);
+ String nonce = request.getParameter(ModuleConstant.NONCE);
if (!StringUtils.isNotBlank(msgSignature)) {
return;// 微信推送给第三方开放平台的消息一定是加过密的,无消息加密无法解密消息
}
- StringBuilder sb =new StringBuilder();
- BufferedReader in = request.getReader();
- String line;
- while ((line = in.readLine()) !=null) {
- sb.append(line);
- }
- in.close();
+ InputStream inputStream;
+ String postData = null;
+ inputStream = request.getInputStream();
+ postData= IOUtils.toString(inputStream,ModuleConstant.UTF8);
+ //从XML中获取 标签内的密文文本
+ String encrypt = XmlUtil.toXml(postData);
+ log.info(String.format(ThirdRunTimeInfoConstant.ENCRYPT,encrypt));
+ //格式化密文文本,否则没有标签,会解密失败,参考官方的加解密代码JAVA版本
+ String format = " ";
+ String fromXML = String.format(format, encrypt);
- String xml = sb.toString();
- Document doc = DocumentHelper.parseText(xml);
- Element rootElt = doc.getRootElement();
- String toUserName = rootElt.elementText("ToUserName");
-
- //微信全网测试账号
-// if (StringUtils.equalsIgnoreCase(toUserName, APPID)) {
- log.info("全网发布接入检测消息反馈开始---------------APPID=" + appid +"------------------------toUserName=" + toUserName);
-// checkWeixinAllNetworkCheck(request, response, xml);
-// }
+ String msg = ""; //解密后的明文
+ WXBizMsgCrypt wxcpt;
+ if(StringUtil.isEmpty(encrypt)) {
+ msg = fromXML;
+ } else {
+ wxcpt = new WXBizMsgCrypt(token,aesKey, componentAppId);
+ // 解密消息
+ msg = wxcpt.decryptMsg(msgSignature, timeStamp, nonce, fromXML);
+ }
+ log.info(String.format(ThirdRunTimeInfoConstant.MSG,msg));
+ // 将xml转为map
+ Map result = WXXmlToMapUtil.multilayerXmlToMap(msg);
+ CodeAuditRecordFormDTO codeAuditRecord = componentVerifyTicketService.mapToEntity(result, CodeAuditRecordFormDTO.class);
+ String toUserName = codeAuditRecord.getToUserName();//小程序原始ID
+ CustomerIdAndClientResultDTO customerIdAndClientResultDTO = miniInfoDao.selectCustomerIdAndClientByToUserName(toUserName);
+ String clientType = customerIdAndClientResultDTO.getClientType();
+ String customerId = customerIdAndClientResultDTO.getCustomerId();
+ TemplateAndAppIdResultDTO templateAndAppId = codeCustomerDao.selectTemplateAndAppId(customerId, clientType);
+ String authAppId = templateAndAppId.getAuthAppId();
+ String templateId = templateAndAppId.getTemplateId();
+ codeAuditRecord.setClientType(clientType);
+ codeAuditRecord.setCustomerId(customerId);
+ codeAuditRecord.setAuthAppId(authAppId);
+ codeAuditRecord.setTemplateId(templateId);
+ //插入 代码审核 记录
+ codeAuditRecordDao.insertCodeAuditRecord(codeAuditRecord);
+ // 修改 code_audit_result 中的代码审核结果
+ String event = codeAuditRecord.getEvent();
+ String codeResult = null;
+ switch (event){
+ case ModuleConstant.WEAPP_AUDIT_SUCCESS:
+ codeResult = ModuleConstant.AUDIT_SUCCESS;
+ case ModuleConstant.WEAPP_AUDIT_FAIL:
+ codeResult = ModuleConstant.AUDIT_FAILED;
+ case ModuleConstant.WEAPP_AUDIT_DELAY:
+ codeResult = ModuleConstant.DELAY;
+ }
+ String codeCustomerId = codeCustomerDao.selectCodeCustomerId(codeAuditRecord);
+ codeAuditResultDao.updateAuditResult(customerId,codeCustomerId,codeResult);
}
}
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/WXXmlToMapUtil.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/WXXmlToMapUtil.java
index 856e2da291..e7b119ed20 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/WXXmlToMapUtil.java
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/WXXmlToMapUtil.java
@@ -37,7 +37,7 @@ public class WXXmlToMapUtil {
private static final Logger logger = LoggerFactory.getLogger(WXXmlToMapUtil.class);
/**
- * XML格式字符串转换为Map
+ * XML格式字符串转换为Map
*
* @param xml XML字符串
* @return XML数据转换后的Map
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml
index 7867f1f3da..a280e32b0d 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml
@@ -97,4 +97,11 @@ ribbon:
pagehelper:
helper-dialect: mysql
- reasonable: false
\ No newline at end of file
+ reasonable: false
+third:
+ platform:
+ appId: wx9681884b28ed7927
+ appSecret: xxx
+ aesKey: xxx
+ componentToken: xcsfdfdff
+ token: developerToken
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthCodeDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthCodeDao.xml
index 5fcd3c0db1..4d605df059 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthCodeDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthCodeDao.xml
@@ -3,28 +3,15 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- INSERT INTO auth_code ( ID, CUSTOMER_ID, AUTH_APPID, AUTH_CODE, EXPIRES_IN, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ INSERT INTO auth_code ( ID, CUSTOMER_ID, CLIENT_TYPE, AUTH_CODE, EXPIRES_IN_TIME, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES
(
REPLACE ( UUID(), '-', '' ),
#{customerId},
- #{authAppId},
+ #{clientType}
#{authCode},
- #{expiresIn},
+ #{expiresInTime},
#{delFlag},
#{createdBy},
NOW(),
@@ -33,4 +20,26 @@
)
+
+
+ UPDATE auth_code
+ SET auth_appid = #{authAppId}
+ WHERE
+ del_flag = 0
+ AND customer_id = #{customerId}
+ AND client_type = #{clientType}
+
+
+
+
+ SELECT
+ customer_id AS customerId,
+ client_type AS clientType
+ FROM
+ auth_code
+ WHERE
+ del_flag = 0
+ AND auth_code = #{authCode}
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthResultRecordDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthResultRecordDao.xml
new file mode 100644
index 0000000000..d0c2ba2654
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthResultRecordDao.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml
index 97929fa2d6..707b16d9cb 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml
@@ -3,31 +3,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- INSERT INTO authorization_info ( ID, CUSTOMER_ID, AUTHORIZER_APPID, AUTHORIZER_ACCESS_TOKEN, EXPIRES_IN, AUTHORIZER_REFRESH_TOKEN, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ INSERT INTO authorization_info ( ID, CUSTOMER_ID, AUTHORIZER_APPID, AUTHORIZER_ACCESS_TOKEN, EXPIRES_IN_TIME, AUTHORIZER_REFRESH_TOKEN, CLIENT_TYPE, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES
(
REPLACE ( UUID(), '-', '' ),
#{customerId},
#{authorizerAppid},
#{authorizerAccessToken},
- #{expiresIn},
+ #{expiresInTime},
#{authorizerRefreshToken},
+ #{clientType}
#{delFlag},
#{createdBy},
NOW(),
@@ -38,7 +25,48 @@
- update authorization_info set del_flag = 0 where customer_id = #{customerId}
+ update authorization_info set del_flag = 1 where customer_id = #{customerId} AND client_type = #{clientType}
+
+
+
+
+ SELECT
+ authorizer_access_token AS authorizerAccessToken,
+ authorizer_refresh_token AS authorizerRefreshToken,
+ authorizer_appid AS authAppId,
+ customer_id AS customerId,
+ client_type AS clientType
+ FROM
+ authorization_info
+ WHERE
+ del_flag = 0
+ AND (UNIX_TIMESTAMP(expires_in_time) - UNIX_TIMESTAMP(NOW())) 900
+ AND (UNIX_TIMESTAMP(expires_in_time) - UNIX_TIMESTAMP(NOW())) > 0
+
+
+
+
+ INSERT INTO authorization_info ( ID, AUTHORIZER_ACCESS_TOKEN, EXPIRES_IN_TIME, AUTHORIZER_REFRESH_TOKEN, AUTHORIZER_APPID, CUSTOMER_ID,CLIENT_TYPE, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ VALUES
+ (
+ REPLACE ( UUID(), '-', '' ),
+ #{authorizerAccessToken},
+ #{expiresInTime},
+ #{authorizerRefreshToken},
+ #{authAppid},
+ #{customerId},
+ #{clientType},
+ #{delFlag},
+ #{createdBy},
+ NOW(),
+ #{updatedBy},
+ NOW()
+ )
+
+
+
+
+ update authorization_info set del_flag = 1 where customer_id = #{customerId} AND client_type = #{clientType}
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizerRefreshTokenDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizerRefreshTokenDao.xml
index 6cfa1d6b86..a1a2f133d5 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizerRefreshTokenDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizerRefreshTokenDao.xml
@@ -3,16 +3,5 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BindingAccountDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BindingAccountDao.xml
new file mode 100644
index 0000000000..8547b41dcf
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BindingAccountDao.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+ INSERT INTO binding_account ( ID, OPEN_PLATFORM_ACCOUNT_ID, AUTH_APP_ID, CUSTOMER_ID, CLIENT_TYPE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ VALUES
+ (
+ REPLACE ( UUID(), '-', '' ),
+ #{openPlatformAccountId},
+ #{authAppId},
+ #{customerId},
+ #{clientType},
+ #{delFlag},
+ #{revision},
+ #{createDBy},
+ NOW(),
+ #{updatedBy},
+ NOW()
+ )
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BusinessInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BusinessInfoDao.xml
new file mode 100644
index 0000000000..ec69aa585a
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BusinessInfoDao.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+ INSERT INTO business_info ( ID, CUSTOMER_ID, CLIENT_TYPE, PRIMARY_ID, FUNC_TYPE, OPEN_STATUS, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ VALUES
+
+ (
+ REPLACE ( UUID(), '-', '' ),
+ #{business.customerId},
+ #{business.clientType},
+ #{business.primaryId},
+ #{business.funcType},
+ #{business.openStatus},
+ #{business.delFlag},
+ #{business.revision},
+ #{business.createdBy},
+ NOW(),
+ #{business.updatedBy},
+ NOW()
+ )
+
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditRecordDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditRecordDao.xml
new file mode 100644
index 0000000000..f0d102d0f4
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditRecordDao.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+ INSERT INTO code_audit_result ( ID, CUSTOMER_ID, TEMPLATE_ID, CLIENT_TYPE, AUTH_APP_ID, TO_USER_NAME, FROM_USER_NAME, WECHAT_CREATE_TIME,
+ MSG_TYPE, EVENT, SUCC_TIME, FAIL_TIME, DELAY_TIME, REASON, SCREEN_SHOT, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME)
+ VALUES
+ (
+ REPLACE ( UUID(), '-', '' ),
+ #{customerId},
+ #{templateId},
+ #{clientType},
+ #{authAppId},
+ #{toUserName},
+ #{fromUserName},
+ #{wechatCreateTime},
+ #{msgType},
+ #{event},
+ IFNULL(#{succTime},NULL),
+ IFNULL(#{failTime},NULL),
+ IFNULL(#{delayTime},NULL),
+ IFNULL(#{reason},NULL),
+ IFNULL(#{screenShot},NULL),
+ #{delFlag},
+ #{revision},
+ #{createdBy},
+ NOW(),
+ #{updatedBy},
+ NOW()
+ )
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditResultDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditResultDao.xml
index f393abeb44..888e90c40f 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditResultDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditResultDao.xml
@@ -3,20 +3,14 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ UPDATE code_audit_result
+ SET result = #{codeResult}
+ WHERE del_flag = '0'
+ AND customer_id = #{customerId}
+ AND template_id = #{templateId}
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml
index e6d65e78e4..a349160ef5 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml
@@ -3,25 +3,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ SELECT
+ template_id AS templateId,
+ app_id AS authAppId
+ FROM
+ code_customer
+ WHERE
+ del_flag = '0'
+ AND customer_id = #{customerId}
+ AND client_type = #{clientType}
+
+
+
+
+ SELECT
+ id AS id
+ FROM
+ code_customer
+ WHERE
+ del_flag = '0'
+ AND customer_id = #{customerId}
+ AND client_type = #{clientType}
+ AND app_id = #{authAppId}
+ AND template_id = #{templateId}
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml
index 7e294a150a..9a469a2073 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml
@@ -3,25 +3,14 @@
-
-
-
-
-
-
-
-
-
-
-
- INSERT INTO component_access_token ( ID, COMPONENT_ACCESS_TOKEN, EXPIRES_IN, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ INSERT INTO component_access_token ( ID, COMPONENT_ACCESS_TOKEN, EXPIRES_IN_TIME, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES
(
REPLACE ( UUID(), '-', '' ),
#{componentAccessToken},
- #{expiresIn},
+ #{expiresInTime},
#{delFlag},
#{createdBy},
NOW(),
@@ -30,8 +19,26 @@
)
+
update component_access_token set del_flag = 1
+
+
+ select count(id) from component_access_token
+
+
+
+
+ SELECT
+ COUNT(*)
+ FROM
+ refresh_authorizer_access_token
+ WHERE
+ del_flag = 0
+ AND (UNIX_TIMESTAMP(expires_in_time) - UNIX_TIMESTAMP(NOW())) 900
+ AND (UNIX_TIMESTAMP(expires_in_time) - UNIX_TIMESTAMP(NOW())) > 0
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentVerifyTicketDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentVerifyTicketDao.xml
index a6a0e15ffb..ba33593a48 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentVerifyTicketDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentVerifyTicketDao.xml
@@ -3,24 +3,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
- INSERT INTO component_verify_ticket ( ID, APPID, TYPE_INFO, COMPONENT_VERIFY_TICKET, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ INSERT INTO component_verify_ticket ( ID, COMPONENT_APP_ID, TYPE_INFO, COMPONENT_VERIFY_TICKET, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES
(
REPLACE ( UUID(), '-', '' ),
- #{appid},
+ #{componentAppId},
#{typeInfo},
#{componentVerifyTicket},
#{delFlag},
@@ -31,5 +20,10 @@
)
+
+
+ update component_verify_ticket set del_flag = 1
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml
index 97a62f99f1..6a8e5330bf 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml
@@ -18,6 +18,48 @@
ORDER BY
client ASC
+
+
+ SELECT
+ COUNT(*) AS notAuthCount
+ FROM
+ customer_mp
+ WHERE
+ del_flag = '0'
+ AND customer_id = #{customerId}
+ AND app_id NOT NULL
+ AND authorization_flag = 0
+
+
+
+
+ UPDATE customer_mp
+ SET app_id = #{authAppId},authorization_flag = 1
+ WHERE
+ customer_id = #{customerId}
+ AND del_flag = '0'
+ AND client = #{client}
+
+
+
+
+ UPDATE customer_mp
+ SET authorization_flag = 1
+ WHERE
+ app_id = #{authAppId}
+
+
+
+
+ SELECT
+ client_type AS clientType
+ FROM
+ customer_mp
+ WHERE
+ del_flag = '0'
+ AND customer_id = #{customerId}
+ AND app_id = #{authAppId}
+
SELECT
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/FuncInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/FuncInfoDao.xml
index 0982fcefd6..c3af697392 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/FuncInfoDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/FuncInfoDao.xml
@@ -3,19 +3,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml
new file mode 100644
index 0000000000..49aacc185b
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+ INSERT INTO mini_category_info ( ID, CUSTOMER_ID, CLIENT_TYPE, PRIMARY_ID, CATEGORY_SORT, CATEGORY_NAME, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ VALUES
+
+ (
+ REPLACE ( UUID(), '-', '' ),
+ #{category.customerId},
+ #{category.clientType},
+ #{category.primaryId},
+ #{category.categorySort},
+ #{category.categoryName},
+ #{category.delFlag},
+ #{category.revision},
+ #{category.createdBy},
+ NOW(),
+ #{category.updatedBy},
+ NOW()
+ )
+
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml
new file mode 100644
index 0000000000..c838415721
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+ SELECT LAST_INSERT_ID() AS id
+
+ INSERT INTO mini_info ( ID, CUSTOMER_ID, CLIENT_TYPE, NICK_NAME, HEAD_IMG, SERVICE_TYPE_INFO, VERIFY_TYPE_INFO, USER_NAME,
+ PRINCIPAL_NAME, SIGNATURE, QRCODE_URL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME)
+ VALUES
+ (
+ REPLACE ( UUID(), '-', '' ),
+ #{customerId},
+ #{clientType},
+ #{nickName},
+ #{headImg},
+ #{serviceTypeInfo},
+ #{verifyTypeInfo},
+ #{userName},
+ #{principalName},
+ #{signature},
+ #{qrcodeUrl},
+ #{delFlag},
+ #{revision},
+ #{createdBy},
+ NOW(),
+ #{updatedBy},
+ NOW()
+ )
+
+
+
+
+ SELECT
+ customer_id AS customerId,
+ client_type AS clientType
+ FROM
+ mini_info
+ WHERE
+ del_flag = 0
+ AND user_name = #{toUserName}
+ UNION ALL
+ SELECT
+ customer_id AS customerId,
+ client_type AS clientType
+ FROM
+ pa_info
+ WHERE
+ del_flag = 0
+ AND user_name = #{toUserName}
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniNetworkInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniNetworkInfoDao.xml
new file mode 100644
index 0000000000..e6dcc273ce
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniNetworkInfoDao.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+ INSERT INTO mini_network_info ( ID, PRIMARY_ID, CUSTOMER_ID, CLIENT_TYPE, NETWORK_TYPE, URL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ VALUES
+
+ (
+ REPLACE ( UUID(), '-', '' ),
+ #{network.primaryId},
+ #{network.customerId},
+ #{network.clientType},
+ #{network.networkType},
+ #{network.url},
+ #{network.delFlag},
+ #{network.revision},
+ #{network.createdBy},
+ NOW(),
+ #{network.updatedBy},
+ NOW()
+ )
+
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenFlatformAccountDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenFlatformAccountDao.xml
new file mode 100644
index 0000000000..efaa55adad
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenFlatformAccountDao.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+ SELECT LAST_INSERT_ID() AS id
+
+ INSERT INTO open_platform_account ( ID, OPEN_APP_ID, CUSTOMER_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ VALUES
+ (
+ REPLACE ( UUID(), '-', '' ),
+ #{openAppId},
+ #{customerId},
+ #{delFlag},
+ #{revision},
+ #{createdBy},
+ NOW(),
+ #{updatedBy},
+ NOW()
+ )
+
+
+
+
+ SELECT
+ open_app_id AS openAppId
+ FROM
+ open_flatform_account
+ WHERE
+ del_flag = 0
+ AND customer_id = #{customerId}
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerAgencyDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerAgencyDao.xml
index 486519d844..99181ddebe 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerAgencyDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerAgencyDao.xml
@@ -6,7 +6,7 @@
SELECT
- customer_id AS customerId
+ pca.customer_id AS customerId
FROM
pa_customer_agency pca
LEFT JOIN pa_customer_user_agency pcua ON pcua.agency_id = pca.id AND pcua.del_flag = '0'
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaInfoDao.xml
new file mode 100644
index 0000000000..8715fb65f0
--- /dev/null
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaInfoDao.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+ SELECT LAST_INSERT_ID() AS id
+
+ INSERT INTO pa_info ( ID, CUSTOMER_ID, CLIENT_TYPE, NICK_NAME, HEAD_IMG, SERVICE_TYPE_INFO, VERIFY_TYPE_INFO, USER_NAME,
+ PRINCIPAL_NAME, ALIAS, QRCODE_URL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME)
+ VALUES
+ (
+ REPLACE ( UUID(), '-', '' ),
+ #{customerId},
+ #{clientType},
+ #{nickName},
+ #{headImg},
+ #{serviceTypeInfo},
+ #{verifyTypeInfo},
+ #{userName},
+ #{principalName},
+ #{alias},
+ #{qrcodeUrl},
+ #{delFlag},
+ #{revision},
+ #{createdBy},
+ NOW(),
+ #{updatedBy},
+ NOW()
+ )
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PreAuthTokenDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PreAuthTokenDao.xml
index bac47ff2f3..319909947d 100644
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PreAuthTokenDao.xml
+++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PreAuthTokenDao.xml
@@ -16,12 +16,12 @@
- INSERT INTO pre_auth_token ( ID, PRE_AUTH_TOKEN, EXPIRES_IN, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
+ INSERT INTO pre_auth_token ( ID, PRE_AUTH_TOKEN, EXPIRES_IN_TIME, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES
(
REPLACE ( UUID(), '-', '' ),
#{preAuthToken},
- #{expiresIn},
+ #{expiresInTime},
#{delFlag},
#{createdBy},
NOW(),
diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/RefreshAuthorizerAccessTokenDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/RefreshAuthorizerAccessTokenDao.xml
deleted file mode 100644
index fbc94fa431..0000000000
--- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/RefreshAuthorizerAccessTokenDao.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SELECT
- authorizer_access_token AS authorizerAccessToken,
- authorizer_refresh_token AS authorizerRefreshToken,
- auth_appid AS authAppId,
- customer_id AS customerId
- FROM
- refresh_authorizer_access_token
- WHERE
- ( UNIX_TIMESTAMP( CREATED_TIME ) + EXPIRES_IN ) - UNIX_TIMESTAMP(NOW()) 10
- AND ( UNIX_TIMESTAMP( CREATED_TIME ) + EXPIRES_IN ) - UNIX_TIMESTAMP( NOW()) > 0
- AND del_flag = 0
-
-
-
- INSERT INTO refresh_authorizer_access_token ( ID, AUTHORIZER_ACCESS_TOKEN, EXPIRES_IN, AUTHORIZER_REFRESH_TOKEN, AUTH_APPID, CUSTOMER_ID, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
- VALUES
- (
- REPLACE ( UUID(), '-', '' ),
- #{authorizerAccessToken},
- #{expiresIn},
- #{authorizerRefreshToken},
- #{authAppid},
- #{customerId},
- #{delFlag},
- #{createdBy},
- NOW(),
- #{updatedBy},
- NOW()
- )
-
-
-
-
- update refresh_authorizer_access_token set del_flag = 0 where customer_id = #{customerId}
-
-
-
\ No newline at end of file