|
|
@ -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); |
|
|
@ -415,7 +420,8 @@ public class CodeServiceImpl implements CodeService { |
|
|
|
throw new RenException("未授权"); |
|
|
|
} |
|
|
|
//获取审核结果信息
|
|
|
|
List<CodeAuditResultDTO> codeAuditResultList = codeAuditResultService.getAuditFailedList(formDTO.getCodeId()); |
|
|
|
List<CodeAuditResultDTO> codeAuditResultList = codeAuditResultService.getAuditFailedList(codeCustomerDTO.getCustomerId(), |
|
|
|
codeCustomerDTO.getClientType()); |
|
|
|
codeAuditResultList.forEach(dto -> { |
|
|
|
ReasonResultDTO result = new ReasonResultDTO(); |
|
|
|
result.setReason(dto.getReason()); |
|
|
@ -447,6 +453,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 +570,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); |
|
|
|