|
@@ -0,0 +1,120 @@
|
|
|
|
+package cn.com.ctop.kuaishou.modules.document.service.impl;
|
|
|
|
+
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.document.mapper.AuditRejectedResubmitMapper;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.document.service.AuditRejectedResubmitService;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.jeecg.common.api.vo.Result;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Arrays;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @Description: 拒审重提
|
|
|
|
+ * @Author: zzy
|
|
|
|
+ * @Date: 2021-09-06
|
|
|
|
+ * @Version: V1.0
|
|
|
|
+ */
|
|
|
|
+@Service
|
|
|
|
+@Slf4j
|
|
|
|
+public class AuditRejectedResubmitServiceImpl implements AuditRejectedResubmitService {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ AuditRejectedResubmitMapper auditRejectedResubmitMapper;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 重新提交创意
|
|
|
|
+ *
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Result resubmit() {
|
|
|
|
+ Result result = new Result();
|
|
|
|
+ List<KuaiShouCreative> creativeList = new ArrayList<>();
|
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ try {
|
|
|
|
+ //creativeList = auditRejectedResubmitMapper.getCreativeList(42,formatter.format(new Date()));
|
|
|
|
+ creativeList = auditRejectedResubmitMapper.getCreativeList(42,null);
|
|
|
|
+ //可重提词组
|
|
|
|
+ List<String> submit = auditRejectedResubmitMapper.getRejectThesaurusListByStatus(0);
|
|
|
|
+ //不可重提词组
|
|
|
|
+ List<String> resubmit = auditRejectedResubmitMapper.getRejectThesaurusListByStatus(1);
|
|
|
|
+ creativeList.stream().forEach(obj -> {
|
|
|
|
+ String reviewDetail = obj.getReviewDetail();
|
|
|
|
+ List<String> strings = Arrays.asList(reviewDetail.split(";"));
|
|
|
|
+ Boolean flag = isSubmit(strings, resubmit);
|
|
|
|
+ if (!flag) {
|
|
|
|
+ //不可重提
|
|
|
|
+ log.info("修改为不可重提:{}",reviewDetail);
|
|
|
|
+ auditRejectedResubmitMapper.updateCreativeResubmit(String.valueOf(obj.getCreativeId()),1);
|
|
|
|
+ } else {
|
|
|
|
+ Boolean flag2 = isNotSubmit(strings, submit);
|
|
|
|
+ if(flag2){
|
|
|
|
+ //重提
|
|
|
|
+ log.info("进行重提:{}",reviewDetail);
|
|
|
|
+ }else {
|
|
|
|
+ //手动重提
|
|
|
|
+ log.info("手动重提:{}",reviewDetail);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ result.setSuccess(true);
|
|
|
|
+ result.success("重提创意成功");
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.info("重提创意错误:{}", e.toString());
|
|
|
|
+ result.error500("重提创意错误");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 判断不可重提
|
|
|
|
+ *
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Boolean isSubmit(List<String> reviewDetail, List<String> thesaurusList) {
|
|
|
|
+ Boolean flag = true;
|
|
|
|
+ if (reviewDetail != null && thesaurusList != null) {
|
|
|
|
+ for (String review : reviewDetail) {
|
|
|
|
+ for (String thesaurus : thesaurusList) {
|
|
|
|
+ if (review.contains(thesaurus)) {
|
|
|
|
+ flag = false;
|
|
|
|
+ return flag;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return flag;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 判断可重提
|
|
|
|
+ *
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Boolean isNotSubmit(List<String> reviewDetail, List<String> thesaurusList) {
|
|
|
|
+ if (reviewDetail != null && thesaurusList != null) {
|
|
|
|
+ for (String review : reviewDetail) {
|
|
|
|
+ Boolean flag = false;
|
|
|
|
+ for (String thesaurus : thesaurusList) {
|
|
|
|
+ if (review.contains(thesaurus)) {
|
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!flag) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+}
|