diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java index e88d58e3f9..82867159cf 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java @@ -43,84 +43,100 @@ public class SubmitAuditFormDTO implements Serializable { /** * 用户生成内容场景(UGC)信息安全声明 */ - private List ugcDeclare; + private UgcDeclareBean ugcDeclare; @NoArgsConstructor @Data - private static class ItemListBean { + public static class ItemListBean { /** * 小程序的页面,可通过获取小程序的页面列表接口获得 */ + @SerializedName("address") private String address; /** * 小程序的标签,用空格分隔,标签至多 10 个,标签长度至多 20 */ + @SerializedName("tag") private String tag; /** * 一级类目名称 */ + @SerializedName("first_class") private String firstClass; /** * 二级类目名称 */ + @SerializedName("second_class") private String secondClass; /** * 三级类目名称 */ + @SerializedName("third_class") private String thirdClass; /** * 一级类目的 ID */ + @SerializedName("first_id") private String firstId; /** * 二级类目的 ID */ + @SerializedName("second_id") private String secondId; /** * 三级类目的 ID */ + @SerializedName("third_id") private String thirdId; /** * 小程序页面的标题,标题长度至多 32 */ + @SerializedName("title") private String title; } @NoArgsConstructor @Data - private static class PreviewInfoBean { + public static class PreviewInfoBean { /** * 录屏mediaid列表,可以通过提审素材上传接口获得 */ + @SerializedName("Video_id_list") private List videoIdList; /** * 截屏mediaid列表,可以通过提审素材上传接口获得 */ + @SerializedName("pic_id_list") private List picIdList; } @NoArgsConstructor @Data - private static class UgcDeclareBean { + public static class UgcDeclareBean { /** * UGC场景 0,不涉及用户生成内容, 1.用户资料,2.图片,3.视频,4.文本,5其他, 可多选,当scene填0时无需填写下列字段 */ + @SerializedName("scene") private List scene; /** * 当scene选其他时的说明,不超时256字 */ + @SerializedName("other_scene_desc") private String otherSceneDesc; /** * 内容安全机制 1.使用平台建议的内容安全API,2.使用其他的内容审核产品,3.通过人工审核把关,4.未做内容审核把关 */ + @SerializedName("method") private List method; /** * 是否有审核团队, 0.无,1.有,默认0 */ + @SerializedName("has_audit_team") private Integer hasAuditTeam; /** * 说明当前对UGC内容的审核机制,不超过256字 */ + @SerializedName("audit_desc") private String auditDesc; } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index da2474e2f9..8e18dadcbf 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -161,11 +161,11 @@ public class CodeServiceImpl implements CodeService { @Override public PageData uploadList(UploadListFormDTO formDTO) { - //获取小程序调用令牌 - AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); - if (null != authInfo) { - List auditingList = codeCustomerService.getAuditingCodeList(); + List auditingList = codeCustomerService.getAuditingCodeList(); + if (null != auditingList && auditingList.size() > NumConstant.ZERO) { auditingList.forEach(code -> { + //获取小程序调用令牌 + AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(code.getCustomerId(), code.getClientType()); //获取审核结果信息 CodeAuditResultDTO auditResult = codeAuditResultService.getAuditResultByCodeId(code.getId()); //调用微信API获取最新审核状态 @@ -182,10 +182,12 @@ public class CodeServiceImpl implements CodeService { code.setStatus(CodeConstant.AUDIT_FAILED); auditResult.setResult(CodeConstant.AUDIT_FAILED); auditResult.setReason(result.getReason()); + auditResult.setScreenShot(result.getScreenshot()); codeOperationHistoryService.updateDescribe(code.getId(), result.getReason()); } else if (result.getStatus() == NumConstant.FOUR) { code.setStatus(CodeConstant.DELAY); auditResult.setResult(CodeConstant.DELAY); + auditResult.setReason(result.getReason()); codeOperationHistoryService.updateDescribe(code.getId(), "审核延后"); } codeCustomerService.update(code); @@ -210,7 +212,13 @@ public class CodeServiceImpl implements CodeService { throw new RenException("未授权"); } //调用微信API上提交审核 - WxMaCodeSubmitAuditRequest request = ConvertUtils.sourceToTarget(formDTO, WxMaCodeSubmitAuditRequest.class); + WxMaCodeSubmitAuditRequest request = new WxMaCodeSubmitAuditRequest(); + request.setVersionDesc(formDTO.getVersionDesc()); + request.setFeedbackInfo(formDTO.getFeedbackInfo()); + request.setFeedbackStuff(formDTO.getFeedbackStuff()); + request.setItemList(formDTO.getItemList()); + request.setPreviewInfo(formDTO.getPreviewInfo()); + request.setUgcDeclare(formDTO.getUgcDeclare()); WxResult wxResult = wxMaCodeService.submitAudit(authInfo.getAuthorizerAccessToken(), request); if (!wxResult.success()) { saveOperation(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getId(), codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, @@ -374,6 +382,7 @@ public class CodeServiceImpl implements CodeService { @Override public String mediaUpload(MediaUploadFormDTO formDTO) { try { +// Result uploadDTOResult = ossFeignClient.upload(formDTO.getMedia()); File file = MultipartFileToFileUtils.multipartFileToFile(formDTO.getMedia()); //获取上传代码信息 CodeCustomerDTO codeCustomerDTO = codeCustomerService.get(formDTO.getCodeId()); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeSubmitAuditRequest.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeSubmitAuditRequest.java index c9fa07b8e4..1c63b9ed3a 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeSubmitAuditRequest.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeSubmitAuditRequest.java @@ -1,5 +1,6 @@ package com.epmet.wxapi.param; +import com.epmet.dto.form.SubmitAuditFormDTO; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; @@ -36,110 +37,16 @@ public class WxMaCodeSubmitAuditRequest implements Serializable { * 审核项列表(选填,至多填写 5 项) */ @SerializedName("item_list") - private List itemList; + private List itemList; /** * 预览信息(小程序页面截图和操作录屏) */ @SerializedName("preview_info") - private List previewInfo; + private List previewInfo; /** * 用户生成内容场景(UGC)信息安全声明 */ @SerializedName("ugc_declare") - private List ugcDeclare; + private SubmitAuditFormDTO.UgcDeclareBean ugcDeclare; - @NoArgsConstructor - @Data - private static class ItemListBean { - /** - * 小程序的页面,可通过获取小程序的页面列表接口获得 - */ - @SerializedName("address") - private String address; - /** - * 小程序的标签,用空格分隔,标签至多 10 个,标签长度至多 20 - */ - @SerializedName("tag") - private String tag; - /** - * 一级类目名称 - */ - @SerializedName("first_class") - private String firstClass; - /** - * 二级类目名称 - */ - @SerializedName("second_class") - private String secondClass; - /** - * 三级类目名称 - */ - @SerializedName("third_class") - private String thirdClass; - /** - * 一级类目的 ID - */ - @SerializedName("first_id") - private String firstId; - /** - * 二级类目的 ID - */ - @SerializedName("second_id") - private String secondId; - /** - * 三级类目的 ID - */ - @SerializedName("third_id") - private String thirdId; - /** - * 小程序页面的标题,标题长度至多 32 - */ - @SerializedName("title") - private String title; - } - - @NoArgsConstructor - @Data - private static class PreviewInfoBean { - /** - * 录屏mediaid列表,可以通过提审素材上传接口获得 - */ - @SerializedName("Video_id_list") - private List videoIdList; - /** - * 截屏mediaid列表,可以通过提审素材上传接口获得 - */ - @SerializedName("pic_id_list") - private List picIdList; - } - - @NoArgsConstructor - @Data - private static class UgcDeclareBean { - /** - * UGC场景 0,不涉及用户生成内容, 1.用户资料,2.图片,3.视频,4.文本,5其他, 可多选,当scene填0时无需填写下列字段 - */ - @SerializedName("scene") - private List scene; - /** - * 当scene选其他时的说明,不超时256字 - */ - @SerializedName("other_scene_desc") - private String otherSceneDesc; - /** - * 内容安全机制 1.使用平台建议的内容安全API,2.使用其他的内容审核产品,3.通过人工审核把关,4.未做内容审核把关 - */ - @SerializedName("method") - private List method; - /** - * 是否有审核团队, 0.无,1.有,默认0 - */ - @SerializedName("has_audit_team") - private Integer hasAuditTeam; - /** - * 说明当前对UGC内容的审核机制,不超过256字 - */ - @SerializedName("audit_desc") - private String auditDesc; - } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java index 3ffe8aa295..e0ae3823e5 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java @@ -10,12 +10,14 @@ import com.epmet.wxapi.result.*; import com.epmet.wxapi.service.WxMaCodeService; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.io.File; +import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; @@ -149,7 +151,7 @@ public class WxMaCodeServiceImpl implements WxMaCodeService { @Override public WxResult getAuditStatus(String accessToken, WxMaCodeAuditStatusReq request) { WxResult result = new WxResult<>(); - String url = WxMaCodeConstant.COMMIT_URL + "?" + "access_token=" + accessToken; + String url = WxMaCodeConstant.GET_AUDIT_STATUS_URL + "?" + "access_token=" + accessToken; Result statusResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); if (!statusResult.success()) { result.setErrorCode(statusResult.getCode()); @@ -209,6 +211,7 @@ public class WxMaCodeServiceImpl implements WxMaCodeService { return result; } Gson gson = new Gson(); + InputStream inputStream = gson.fromJson(statusResult.getData(), InputStream.class); WxMaNewsResult newsResult = gson.fromJson(statusResult.getData(), WxMaNewsResult.class); result.ok(newsResult); return result; diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeOperationHistoryDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeOperationHistoryDao.xml index 5e33c62878..66041c4ea0 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeOperationHistoryDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeOperationHistoryDao.xml @@ -19,7 +19,7 @@ UPDATE code_operation_history SET - `DESCRIPTION` = #{description} + `DESCRIPTION` = #{describe} WHERE CODE_ID = #{codeId} AND OPERATION = 'audit'