Browse Source

Merge branches 'dev' and 'dev_heart' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_heart

master
wangchao 5 years ago
parent
commit
99c721b6b0
  1. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  2. 2
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  3. 16
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java
  4. 1
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeCommonFormDTO.java
  5. 21
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/DomainResultDTO.java
  6. 8
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/ReasonResultDTO.java
  7. 4
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/UploadListResultDTO.java
  8. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  9. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  10. 12
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java
  11. 10
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java
  12. 18
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java
  13. 75
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java
  14. 33
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaModifyDomainResult.java
  15. 27
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaSetWebviewDomainResult.java
  16. 6
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java
  17. 28
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java
  18. 4
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml
  19. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  20. 2
      epmet-user/epmet-user-server/pom.xml

2
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-heart-server:
container_name: epmet-heart-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.48
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.50
ports:
- "8111:8111"
network_mode: host # 使用现有网络

2
epmet-module/epmet-heart/epmet-heart-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.48</version>
<version>0.0.50</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart</artifactId>

16
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java

@ -68,9 +68,23 @@ public class CodeAuditResultDTO implements Serializable {
*/
private String screenShot;
/**
* 素材地址
*/
private String screenShotUrl;
/**
/**
* 反馈内容
*/
private String feedbackInfo;
/**
* 反馈素材
*/
private String feedbackStuff;
/**
* 乐观锁
*/
private Integer revision;

1
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeCommonFormDTO.java

@ -20,6 +20,7 @@ public class CodeCommonFormDTO implements Serializable {
* 代码ID
*/
private String codeId;
private String clientType;
private String grayPercentage;
private String path;
private Integer page = 1;

21
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/DomainResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/8/13 16:02
*/
@Data
public class DomainResultDTO implements Serializable {
private static final long serialVersionUID = -2534293858061449973L;
private List<String> requestDomain;
private List<String> wsRequestDomain;
private List<String> uploadDomain;
private List<String> downloadDomain;
private List<String> webViewDomain;
}

8
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/ReasonResultDTO.java

@ -23,6 +23,14 @@ public class ReasonResultDTO implements Serializable {
* 失败的小程序截图url
*/
private List<String> screenshotUrl;
/**
* 反馈内容至多 200
*/
private String feedbackInfo;
/**
* 反馈素材
*/
private String feedbackStuff;
/**
* 提交审核时间
*/

4
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/UploadListResultDTO.java

@ -27,6 +27,10 @@ public class UploadListResultDTO implements Serializable {
* 客户名
*/
private String customerName;
/**
* 小程序名
*/
private String miniName;
/**
* 居民端resi 工作端work
*/

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-third-server:
container_name: epmet-third-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.124
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.125
ports:
- "8110:8110"
network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.124</version>
<version>0.0.125</version>
<parent>
<groupId>com.epmet</groupId>

12
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java

@ -208,6 +208,18 @@ public class CodeController {
return new Result<>();
}
@PostMapping("setdomains")
public Result setDomains(@RequestBody CodeCommonFormDTO formDTO) {
codeService.setDomains(formDTO);
return new Result<>();
}
@PostMapping("getdomain")
public Result<DomainResultDTO> getDomains(@RequestBody CodeCommonFormDTO formDTO) {
DomainResultDTO result = codeService.getDomains(formDTO);
return new Result<DomainResultDTO>().ok(result);
}
@PostMapping("customers")
public Result<PageData> getCustomerList(@RequestBody UploadListFormDTO formDTO) {
PageData pageData = codeService.getCustomerList(formDTO);

10
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java

@ -70,5 +70,15 @@ public class CodeAuditResultEntity extends BaseEpmetEntity {
private String screenShotUrl;
/**
* 反馈内容
*/
private String feedbackInfo;
/**
* 反馈素材
*/
private String feedbackStuff;
}

18
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java

@ -154,6 +154,24 @@ public interface CodeService {
*/
void setDomain(String customerId);
/**
* 设置服务器域名和业务域名
* @author zhaoqifeng
* @date 2020/8/6 15:34
* @param formDTO
* @return int
*/
void setDomains(CodeCommonFormDTO formDTO);
/**
* 获取服务器域名和业务域名
* @author zhaoqifeng
* @date 2020/8/6 15:34
* @param formDTO
* @return DomainResultDTO
*/
DomainResultDTO getDomains(CodeCommonFormDTO formDTO);
/**
* 已初始化客户列表
* @author zhaoqifeng

75
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java

@ -269,12 +269,14 @@ public class CodeServiceImpl implements CodeService {
}
//调用微信API上提交审核
WxMaCodeSubmitAuditRequest request = new WxMaCodeSubmitAuditRequest();
request.setVersionDesc(formDTO.getVersionDesc());
if(StringUtils.isBlank(formDTO.getFeedbackInfo())) {
request.setVersionDesc(formDTO.getVersionDesc());
request.setItemList(formDTO.getItemList());
request.setPreviewInfo(formDTO.getPreviewInfo());
request.setUgcDeclare(formDTO.getUgcDeclare());
}
request.setFeedbackInfo(formDTO.getFeedbackInfo());
request.setFeedbackStuff(formDTO.getFeedbackStuff());
request.setItemList(formDTO.getItemList());
request.setPreviewInfo(formDTO.getPreviewInfo());
request.setUgcDeclare(formDTO.getUgcDeclare());
WxResult<String> wxResult = wxMaCodeService.submitAudit(authInfo.getAuthorizerAccessToken(), request);
if (!wxResult.success()) {
saveOperation(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType(), codeCustomerDTO.getId(),
@ -303,6 +305,9 @@ public class CodeServiceImpl implements CodeService {
codeAuditResultDTO.setResult(CodeConstant.AUDITING);
codeAuditResultService.save(codeAuditResultDTO);
} else {
codeAuditResultDTO.setFeedbackInfo(formDTO.getFeedbackInfo());
codeAuditResultDTO.setFeedbackStuff(formDTO.getFeedbackStuff());
codeAuditResultService.update(codeAuditResultDTO);
codeAuditResultService.deleteById(codeAuditResultDTO.getId());
codeAuditResultDTO = new CodeAuditResultDTO();
codeAuditResultDTO.setCustomerId(codeCustomerDTO.getCustomerId());
@ -388,7 +393,7 @@ public class CodeServiceImpl implements CodeService {
throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg());
}
//将之前上传信息删除
codeCustomerService.deleteCode(formDTO.getCustomerId(), codeCustomerDTO.getClientType());
codeCustomerService.deleteCode(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType());
//更新代码表状态
codeCustomerDTO.setStatus(CodeConstant.RELEASE_SUCCESS);
@ -447,6 +452,8 @@ public class CodeServiceImpl implements CodeService {
codeAuditResultService.update(dto);
}
result.setScreenshotUrl(urlList);
result.setFeedbackInfo(dto.getFeedbackInfo());
result.setFeedbackStuff(dto.getFeedbackStuff());
} else {
String[] url = dto.getScreenShotUrl().split("[|]");
List<String> urlList = new ArrayList<>(url.length);
@ -562,18 +569,64 @@ public class CodeServiceImpl implements CodeService {
}
authInfoList.forEach(authInfo -> {
//设置服务器域名
WxResult wxResult = wxMaCodeService.modifyDomain(authInfo.getAuthorizerAccessToken());
if (!wxResult.success()) {
throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg());
WxResult<WxMaModifyDomainResult> modifyDomain = wxMaCodeService.modifyDomain(authInfo.getAuthorizerAccessToken(), "set");
if (!modifyDomain.success()) {
throw new RenException(modifyDomain.getErrorCode(), modifyDomain.getErrorMsg());
}
//设置业务域名
wxResult = wxMaCodeService.setWebviewDomain(authInfo.getAuthorizerAccessToken());
if (!wxResult.success()) {
throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg());
WxResult<WxMaSetWebviewDomainResult> setWebviewDomain = wxMaCodeService.setWebviewDomain(authInfo.getAuthorizerAccessToken(), "set");
if (!setWebviewDomain.success()) {
throw new RenException(setWebviewDomain.getErrorCode(), setWebviewDomain.getErrorMsg());
}
});
}
@Override
public void setDomains(CodeCommonFormDTO formDTO) {
//获取小程序调用令牌
AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType());
if (null == authInfo) {
throw new RenException("未授权");
}
//设置服务器域名
WxResult<WxMaModifyDomainResult> wxResult = wxMaCodeService.modifyDomain(authInfo.getAuthorizerAccessToken(), "set");
if (!wxResult.success()) {
throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg());
}
//设置业务域名
WxResult<WxMaSetWebviewDomainResult> setWebviewDomain = wxMaCodeService.setWebviewDomain(authInfo.getAuthorizerAccessToken(), "set");
if (!setWebviewDomain.success()) {
throw new RenException(setWebviewDomain.getErrorCode(), setWebviewDomain.getErrorMsg());
}
}
@Override
public DomainResultDTO getDomains(CodeCommonFormDTO formDTO) {
DomainResultDTO resultDTO = new DomainResultDTO();
//获取小程序调用令牌
AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType());
if (null == authInfo) {
throw new RenException("未授权");
}
//设置服务器域名
WxResult<WxMaModifyDomainResult> wxResult = wxMaCodeService.modifyDomain(authInfo.getAuthorizerAccessToken(), "get");
if (!wxResult.success()) {
throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg());
}
resultDTO.setDownloadDomain(wxResult.getData().getDownloadDomain());
resultDTO.setRequestDomain(wxResult.getData().getRequestDomain());
resultDTO.setUploadDomain(wxResult.getData().getUploadDomain());
resultDTO.setWsRequestDomain(wxResult.getData().getWsRequestDomain());
//设置业务域名
WxResult<WxMaSetWebviewDomainResult> setWebviewDomain = wxMaCodeService.setWebviewDomain(authInfo.getAuthorizerAccessToken(), "get");
if (!setWebviewDomain.success()) {
throw new RenException(setWebviewDomain.getErrorCode(), setWebviewDomain.getErrorMsg());
}
resultDTO.setWebViewDomain(setWebviewDomain.getData().getWebViewDomain());
return resultDTO;
}
@Override
public PageData getCustomerList(UploadListFormDTO formDTO) {
return paCustomerService.getCustomerList(formDTO);

33
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaModifyDomainResult.java

@ -0,0 +1,33 @@
package com.epmet.wxapi.result;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/8/13 15:46
*/
@NoArgsConstructor
@Data
public class WxMaModifyDomainResult implements Serializable {
private static final long serialVersionUID = 8602059705480008729L;
/**
* errcode : 0
*/
private Integer errcode;
private String errmsg;
@SerializedName("requestdomain")
private List<String> requestDomain;
@SerializedName("wsrequestdomain")
private List<String> wsRequestDomain;
@SerializedName("uploaddomain")
private List<String> uploadDomain;
@SerializedName("downloaddomain")
private List<String> downloadDomain;
}

27
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaSetWebviewDomainResult.java

@ -0,0 +1,27 @@
package com.epmet.wxapi.result;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/8/13 15:53
*/
@NoArgsConstructor
@Data
public class WxMaSetWebviewDomainResult implements Serializable {
private static final long serialVersionUID = -5871654910653283111L;
/**
* errcode : 0
*/
private Integer errcode;
private String errmsg;
@SerializedName("webviewdomain")
private List<String> webViewDomain;
}

6
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java

@ -123,21 +123,23 @@ public interface WxMaCodeService {
* 设置服务器域名
*
* @param accessToken
* @param action
* @return com.epmet.wxapi.result.WxResult
* @author zhaoqifeng
* @date 2020/7/16 17:21
*/
WxResult modifyDomain(String accessToken);
WxResult<WxMaModifyDomainResult> modifyDomain(String accessToken, String action);
/**
* 设置业务域名
*
* @param accessToken
* @param action
* @return com.epmet.wxapi.result.WxResult
* @author zhaoqifeng
* @date 2020/7/16 17:22
*/
WxResult setWebviewDomain(String accessToken);
WxResult<WxMaSetWebviewDomainResult> setWebviewDomain(String accessToken, String action);
/**
* 上传临时素材

28
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java

@ -231,11 +231,11 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
}
@Override
public WxResult modifyDomain(String accessToken) {
WxResult result = new WxResult();
public WxResult<WxMaModifyDomainResult> modifyDomain(String accessToken, String action) {
WxResult<WxMaModifyDomainResult> result = new WxResult<>();
String url = WxMaCodeConstant.MODIFY_DOMAIN_URL + "?" + "access_token=" + accessToken;
WxMaModifyDomainReq request = new WxMaModifyDomainReq();
request.setAction("set");
request.setAction(action);
request.setRequestDomain(wxMaDomainDTO.getRequestDomain());
request.setUploadDomain(wxMaDomainDTO.getUploadDomain());
request.setWsRequestDomain(wxMaDomainDTO.getWsRequestDomain());
@ -246,18 +246,20 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
result.setErrorMsg(modifyResult.getMsg());
return result;
}
JSONObject jsonObject = JSONObject.parseObject(modifyResult.getData());
result.setErrorCode(jsonObject.getInteger(ERR_CODE));
result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE)));
Gson gson = new Gson();
WxMaModifyDomainResult domainResult = gson.fromJson(modifyResult.getData(), WxMaModifyDomainResult.class);
result.setErrorCode(domainResult.getErrcode());
result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(domainResult.getErrcode()));
result.setData(domainResult);
return result;
}
@Override
public WxResult setWebviewDomain(String accessToken) {
WxResult result = new WxResult();
public WxResult<WxMaSetWebviewDomainResult> setWebviewDomain(String accessToken, String action) {
WxResult<WxMaSetWebviewDomainResult> result = new WxResult<>();
String url = WxMaCodeConstant.SET_WEBVIEW_DOMAIN_URL + "?" + "access_token=" + accessToken;
WxMaSetWebviewDomainReq request = new WxMaSetWebviewDomainReq();
request.setAction("set");
request.setAction(action);
request.setWebViewDomain(wxMaDomainDTO.getWebviewDomain());
Result<String> modifyResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request));
if (!modifyResult.success()) {
@ -265,9 +267,11 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
result.setErrorMsg(modifyResult.getMsg());
return result;
}
JSONObject jsonObject = JSONObject.parseObject(modifyResult.getData());
result.setErrorCode(jsonObject.getInteger(ERR_CODE));
result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE)));
Gson gson = new Gson();
WxMaSetWebviewDomainResult domainResult = gson.fromJson(modifyResult.getData(), WxMaSetWebviewDomainResult.class);
result.setErrorCode(domainResult.getErrcode());
result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(domainResult.getErrcode()));
result.setData(domainResult);
return result;
}

4
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml

@ -83,11 +83,15 @@
</select>
<select id="selectInitCustomerList" resultType="com.epmet.dto.result.UploadListResultDTO" parameterType="com.epmet.dto.form.UploadListFormDTO">
SELECT pc.ID AS "customerId",
mi.NICK_NAME AS "miniName",
pc.CUSTOMER_NAME,
ai.CLIENT_TYPE,
ai.AUTHORIZER_APPID AS "appId"
FROM pa_customer pc
INNER JOIN authorization_info ai ON pc.ID = ai.CUSTOMER_ID AND ai.DEL_FLAG = 0
INNER JOIN mini_info mi ON ai.CUSTOMER_ID = mi.CUSTOMER_ID
AND ai.CLIENT_TYPE = mi.CLIENT_TYPE
AND mi.DEL_FLAG = 0
WHERE pc.DEL_FLAG = 0
AND pc.SOURCE = #{source}
AND pc.IS_INITIALIZE = 1

2
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.114
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.115
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.114</version>
<version>0.3.115</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-user</artifactId>

Loading…
Cancel
Save