|
@@ -70,10 +70,12 @@ public class AuditRejectedResubmitServiceImpl implements AuditRejectedResubmitSe
|
|
try {
|
|
try {
|
|
log.info(formatter.format(calendar.getTime()));
|
|
log.info(formatter.format(calendar.getTime()));
|
|
creativeList = auditRejectedResubmitMapper.getCreativeList(42, formatter.format(calendar.getTime()));
|
|
creativeList = auditRejectedResubmitMapper.getCreativeList(42, formatter.format(calendar.getTime()));
|
|
- //可重提词组
|
|
|
|
|
|
+ //可重提封面词组
|
|
List<String> submit = auditRejectedResubmitMapper.getRejectThesaurusListByStatus(0);
|
|
List<String> submit = auditRejectedResubmitMapper.getRejectThesaurusListByStatus(0);
|
|
|
|
+ //可重提广告语词组
|
|
|
|
+ List<String> submit2 = auditRejectedResubmitMapper.getRejectThesaurusListByStatus(1);
|
|
//不可重提词组
|
|
//不可重提词组
|
|
- List<String> resubmit = auditRejectedResubmitMapper.getRejectThesaurusListByStatus(1);
|
|
|
|
|
|
+ List<String> resubmit = auditRejectedResubmitMapper.getRejectThesaurusListByStatus(2);
|
|
creativeList.stream().forEach(obj -> {
|
|
creativeList.stream().forEach(obj -> {
|
|
String reviewDetail = obj.getReviewDetail();
|
|
String reviewDetail = obj.getReviewDetail();
|
|
List<String> strings = Arrays.asList(reviewDetail.split(";"));
|
|
List<String> strings = Arrays.asList(reviewDetail.split(";"));
|
|
@@ -83,30 +85,47 @@ public class AuditRejectedResubmitServiceImpl implements AuditRejectedResubmitSe
|
|
log.info("修改为不可重提:{}", reviewDetail);
|
|
log.info("修改为不可重提:{}", reviewDetail);
|
|
auditRejectedResubmitMapper.updateCreativeResubmit(String.valueOf(obj.getCreativeId()), 1);
|
|
auditRejectedResubmitMapper.updateCreativeResubmit(String.valueOf(obj.getCreativeId()), 1);
|
|
} else {
|
|
} else {
|
|
|
|
+ //判断是否封面重提
|
|
Boolean flag2 = isNotSubmit(strings, submit);
|
|
Boolean flag2 = isNotSubmit(strings, submit);
|
|
- if (flag2) {
|
|
|
|
- //重提
|
|
|
|
- log.info("进行重提:{}", reviewDetail);
|
|
|
|
|
|
+ //判断是否广告语重提
|
|
|
|
+ Boolean flag3 = isNotSubmit(strings, submit2);
|
|
|
|
+ JSONObject updateJson = new JSONObject();
|
|
|
|
+ if (flag2 || flag3) {
|
|
Integer submit_size = obj.getSubmitSize();
|
|
Integer submit_size = obj.getSubmitSize();
|
|
if (submit_size < 2) {
|
|
if (submit_size < 2) {
|
|
- String imageToken=null;
|
|
|
|
- List<Map<String, String>> documentByAccountId=null;
|
|
|
|
- JSONObject updateJson = new JSONObject();
|
|
|
|
|
|
+ //重提
|
|
|
|
+ log.info("进行重提:{}", reviewDetail);
|
|
|
|
+ String imageToken = null;
|
|
|
|
+ List<Map<String, String>> documentByAccountId = null;
|
|
updateJson.put("creativeId", obj.getCreativeId());
|
|
updateJson.put("creativeId", obj.getCreativeId());
|
|
- //更换封面
|
|
|
|
CtopOauthToken oauthToken = tokenService.getTokenByAccountId(obj.getAccountId());
|
|
CtopOauthToken oauthToken = tokenService.getTokenByAccountId(obj.getAccountId());
|
|
- JSONObject cutJson = cutFrameService.getCutFrameByVideoMd5(obj.getPhotoId(), obj.getImageToken());
|
|
|
|
- if (!Check.isNull(cutJson)) {
|
|
|
|
- String signature = cutJson.getString("signature");
|
|
|
|
- String url = cutJson.getString("url");
|
|
|
|
- imageToken = getImageToken(signature, obj.getAccountId(), oauthToken.getAccessToken(), url);
|
|
|
|
-
|
|
|
|
|
|
+ if (flag2) {
|
|
|
|
+ log.info("进行封面重提:{}", reviewDetail);
|
|
|
|
+ //更换封面
|
|
|
|
+ JSONObject cutJson = cutFrameService.getCutFrameByVideoMd5(obj.getPhotoId(), obj.getImageToken());
|
|
|
|
+ if (!Check.isNull(cutJson)) {
|
|
|
|
+ String signature = cutJson.getString("signature");
|
|
|
|
+ String url = cutJson.getString("url");
|
|
|
|
+ imageToken = getImageToken(signature, obj.getAccountId(), oauthToken.getAccessToken(), url);
|
|
|
|
+ if (imageToken != null) {
|
|
|
|
+ updateJson.put("imageToken", imageToken);
|
|
|
|
+ } else {
|
|
|
|
+ log.info("未查询到封面:accountId:{},creativeId:{}", obj.getAccountId(), obj.getCreativeId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- //更换文案
|
|
|
|
- documentByAccountId = documentLibraryMapper.getDocumentByAccountId(String.valueOf(obj.getAccountId()), obj.getCopyWriterId());
|
|
|
|
- if(!Check.isNull(imageToken)&&documentByAccountId!=null&&documentByAccountId.size()>0){
|
|
|
|
- updateJson.put("imageToken", imageToken);
|
|
|
|
- updateJson.put("description", documentByAccountId.get(0).get("copyWriter"));
|
|
|
|
|
|
+ if (flag3) {
|
|
|
|
+ //重提
|
|
|
|
+ log.info("进行广告语重提:{}", reviewDetail);
|
|
|
|
+ //更换文案
|
|
|
|
+ documentByAccountId = documentLibraryMapper.getDocumentByAccountId(String.valueOf(obj.getAccountId()), obj.getCopyWriterId());
|
|
|
|
+ if (documentByAccountId != null && documentByAccountId.size() > 0) {
|
|
|
|
+ updateJson.put("description", documentByAccountId.get(0).get("copyWriter"));
|
|
|
|
+ } else {
|
|
|
|
+ log.info("未查询到广告语:accountId:{},creativeId:{}", obj.getAccountId(), obj.getCreativeId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (imageToken != null || documentByAccountId.size() > 0) {
|
|
Map<String, Object> creativeMap = updateService.updateCreative(oauthToken.getAccessToken(), obj.getAccountId(), updateJson);
|
|
Map<String, Object> creativeMap = updateService.updateCreative(oauthToken.getAccessToken(), obj.getAccountId(), updateJson);
|
|
Integer code = (Integer) creativeMap.get("code");
|
|
Integer code = (Integer) creativeMap.get("code");
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
@@ -120,10 +139,7 @@ public class AuditRejectedResubmitServiceImpl implements AuditRejectedResubmitSe
|
|
} else {
|
|
} else {
|
|
log.info("拒审重提失败,accountId:{},creativeId:{}", obj.getAccountId(), obj.getCreativeId());
|
|
log.info("拒审重提失败,accountId:{},creativeId:{}", obj.getAccountId(), obj.getCreativeId());
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
- log.info("未查询到更换数据,accountId:{},creativeId:{},imageToken:{},description:{}",obj.getAccountId(), obj.getCreativeId(),imageToken,documentByAccountId);
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
log.info("重提次数已达上限:accountId:{},creativeId:{}", obj.getAccountId(), obj.getCreativeId());
|
|
log.info("重提次数已达上限:accountId:{},creativeId:{}", obj.getAccountId(), obj.getCreativeId());
|
|
}
|
|
}
|