فهرست منبع

Merge branch 'test'

# Conflicts:
#	jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java
zhaoxian 3 سال پیش
والد
کامیت
a3ee7caf81
19فایلهای تغییر یافته به همراه222 افزوده شده و 70 حذف شده
  1. 1 1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  2. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/service/ExternalLinkService.java
  3. 21 6
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/service/impl/ExternalLinkServiceImpl.java
  4. 23 30
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleGroupServiceImpl.java
  5. 3 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialCutFrameMapper.xml
  6. 4 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java
  7. 2 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/controller/AuditRejectedResubmitController.java
  8. 3 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/controller/DocumentLibraryController.java
  9. 7 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/mapper/AuditRejectedResubmitMapper.java
  10. 7 4
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/mapper/DocumentLibraryMapper.java
  11. 6 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/mapper/xml/AuditRejectedResubmitMapper.xml
  12. 8 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/mapper/xml/DocumentLibraryMapper.xml
  13. 94 13
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/service/impl/AuditRejectedResubmitServiceImpl.java
  14. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  15. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java
  16. 30 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  17. 3 1
      jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-dev.yml
  18. 2 0
      jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-prod.yml
  19. 3 0
      jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-test.yml

+ 1 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -226,7 +226,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/agent/**", "anon");
         filterChainDefinitionMap.put("/materialUse/**", "anon");
         filterChainDefinitionMap.put("/document/library/**", "anon");
-
+        filterChainDefinitionMap.put("/rejected/audit/**", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/service/ExternalLinkService.java

@@ -10,5 +10,5 @@ import java.math.BigDecimal;
  */
 public interface ExternalLinkService {
 
-    String editBytedancePlanCpaBidOrBudget(Long accountId, String adId, BigDecimal cpaBid, String adScheduleTime,Long budget);
+    Integer editBytedancePlanCpaBidOrBudget(Long accountId, String adId, BigDecimal cpaBid, String adScheduleTime,BigDecimal budget);
 }

+ 21 - 6
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/service/impl/ExternalLinkServiceImpl.java

@@ -3,7 +3,9 @@ package cn.com.ctop.alarm.modules.service.impl;
 import cn.com.ctop.alarm.modules.service.ExternalLinkService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.HttpUtils;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
@@ -15,14 +17,17 @@ import java.math.BigDecimal;
 @Service
 public class ExternalLinkServiceImpl implements ExternalLinkService {
     //修改头条CPABID出价,投放时间
-    private static final String URL_UPDATE_CPABID = "http://118.24.244.213:8808/bytedance-api/advertiser/bytedanceReportController/updateADCpaBid";
+//    private static final String URL_UPDATE_CPABID = "http://139.186.165.84:8808/bytedance-api/advertiser/bytedanceReportController/updateADCpaBid";
     //线上IP  http://118.24.244.213:8808/bytedance-api/advertiser/bytedanceReportController/updateADCpaBid
     //测试IP  http://139.186.165.84:8808/bytedance-api/advertiser/bytedanceReportController/updateADCpaBid
+    @Value("${rule.bytedanceUrl}")
+    private String URL_UPDATE_CPABID;
+
 
     @Override
-    public String editBytedancePlanCpaBidOrBudget(Long accountId, String adId, BigDecimal cpaBid, String adScheduleTime, Long budget) {
+    public Integer editBytedancePlanCpaBidOrBudget(Long accountId, String adId, BigDecimal cpaBid, String adScheduleTime, BigDecimal budget) {
         StringBuffer buf = new StringBuffer();
-        buf.append("?accountId=").append(accountId).append("&adId=").append(adId);
+        buf.append("bytedance-api/advertiser/bytedanceReportController/updateADCpaBid?accountId=").append(accountId).append("&adId=").append(adId);
         if (!Check.isNull(cpaBid)) {
             buf.append("&cpaBid=").append(cpaBid);
         }
@@ -32,10 +37,20 @@ public class ExternalLinkServiceImpl implements ExternalLinkService {
         if (!Check.isNull(budget)) {
             buf.append("&budget=").append(budget);
         }
-        log.info("调用微服务接口,修改头条计划出价、预算、投放时间段。。。。。。start");
-        HttpUtils.httpGet(URL_UPDATE_CPABID + buf.toString(), null, null);
+        log.info("调用微服务接口,修改头条计划出价、预算、投放时间段。。。。。。start-----ip入参:{}", URL_UPDATE_CPABID + buf.toString());
+        String result = HttpUtils.httpGet(URL_UPDATE_CPABID + buf.toString(), null, null);
         log.info("调用微服务接口,修改头条计划出价、预算、投放时间段。。。。。。end");
-        return null;
+        JSONObject jsonObject = JSONObject.parseObject(result);
+        Integer code = -1;
+        if (!Check.isNull(jsonObject)) {
+            code = jsonObject.getInteger("code");
+            if (code != 0) {
+                log.error("调用微服务接口,修改头条计划失败,入参={};-------------------message={}", buf.toString(), jsonObject.getString("message"));
+            }
+        } else {
+            log.error("调用微服务接口,修改头条计划失败,入参={};-------------------返回结果:{}", result);
+        }
+        return code;
     }
 
 

+ 23 - 30
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleGroupServiceImpl.java

@@ -446,7 +446,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
             } else if ("dayBudget".equals(cindicatorCode)) {
                 if ("cost".equals(indicatorCode)) {
                     //倍数计算, 转化成本 高于or低于当前倍数时,预警
-                    threshold = new BigDecimal(String.valueOf(byteDancePlan.getBudget())).multiply(new BigDecimal(threshold)).toString();
+                    othreshold = byteDancePlan.getBudget().multiply(new BigDecimal(threshold)).toString();
                 }
             } else {
                 othreshold = threshold;
@@ -522,25 +522,25 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                     if (("up".equals(operationType) && oldBid.compareTo(new BigDecimal(maxValue)) == 0) || ("down".equals(operationType) && oldBid.compareTo(new BigDecimal(minValue)) == 0)) {
                         continue;
                     }
-                    Long newBid = 0L;
+                    BigDecimal newBid = null;
                     if ("to".equals(operationType)) {
                         //金额直接赋值
                         if ("price".equals(operationValue)) {
-                            newBid = new BigDecimal(operationThreshold).longValue();
+                            newBid = new BigDecimal(operationThreshold);
                         } else {//百分比需计算
-                            newBid = new BigDecimal(operationThreshold).multiply(oldBid).longValue();
+                            newBid = new BigDecimal(operationThreshold).multiply(oldBid);
                         }
                     } else {
                         newBid = calculatedValue(oldBid, operationType, operationValue, operationThreshold, maxValue, minValue, 1);
                     }
                     //TODO
-                    String code = externalLinkService.editBytedancePlanCpaBidOrBudget(accountId, planId.toString(), new BigDecimal(newBid.toString()), null, null);
+                    Integer code = externalLinkService.editBytedancePlanCpaBidOrBudget(accountId, planId.toString(), newBid, null, null);
                     String message = "success";
-                    if (code.equals("")) {
+                    if (code == 0) {
                         alreadyOperatedList.add(obj);
                     } else {
                         message = "fail";
-                        log.error("(头条)规则引擎修改出价失败,accountId={},unitId={}", accountId, planId);
+                        log.error("(头条)规则引擎修改出价失败,accountId={},planId={}", accountId, planId);
                     }
                     recordEntity = getOperationRecordEntity(accountId, ruleGroup, maxValue, minValue, operate, null, planId, operationThreshold, oldBid.toString(), newBid.toString(), message, "头条");
                     //修改预算
@@ -549,37 +549,37 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                     if (("up".equals(operationType) && oldBudget.compareTo(new BigDecimal(maxValue)) == 0) || ("down".equals(operationType) && oldBudget.compareTo(new BigDecimal(minValue)) == 0)) {
                         continue;
                     }
-                    Long newBudget = 0L;
+                    BigDecimal newBudget = null;
                     if ("to".equals(operationType)) {
                         //金额直接赋值
                         if ("price".equals(operationValue)) {
-                            newBudget = new BigDecimal(operationThreshold).longValue();
+                            newBudget = new BigDecimal(operationThreshold);
                         } else {//百分比需计算
-                            newBudget = new BigDecimal(operationThreshold).multiply(oldBudget).longValue();
+                            newBudget = new BigDecimal(operationThreshold).multiply(oldBudget);
                         }
                     } else {
                         newBudget = calculatedValue(oldBudget, operationType, operationValue, operationThreshold, maxValue, minValue, 1);
                     }
                     //TODO
-                    String code = externalLinkService.editBytedancePlanCpaBidOrBudget(accountId, planId.toString(), null, null, newBudget);
+                    Integer code = externalLinkService.editBytedancePlanCpaBidOrBudget(accountId, planId.toString(), null, null, newBudget);
                     String message = "success";
-                    if (code.equals("")) {
+                    if (code == 0) {
                         alreadyOperatedList.add(obj);
                     } else {
                         message = "fail";
-                        log.error("(头条)规则引擎修改预算失败,accountId={},unitId={}", accountId, planId);
+                        log.error("(头条)规则引擎修改预算失败,accountId={},planId={}", accountId, planId);
                     }
                     recordEntity = getOperationRecordEntity(accountId, ruleGroup, maxValue, minValue, operate, null, planId, operationThreshold, oldBudget.toString(), newBudget.toString(), message, "头条");
                     //修改投放时间
                 } else if ("TIME".equals(operate) && !byteDancePlan.getScheduleTime().equals(operationThreshold)) {
                     //TODO
-                    String code = externalLinkService.editBytedancePlanCpaBidOrBudget(accountId, planId.toString(), null, operationThreshold, null);
+                    Integer code = externalLinkService.editBytedancePlanCpaBidOrBudget(accountId, planId.toString(), null, operationThreshold, null);
                     String message = "success";
-                    if (code.equals("")) {
+                    if (code == 0) {
                         alreadyOperatedList.add(obj);
                     } else {
                         message = "fail";
-                        log.error("规则引擎修改投放时间段失败,accountId={},unitId={}", accountId, planId);
+                        log.error("规则引擎修改投放时间段失败,accountId={},planId={}", accountId, planId);
                     }
                     recordEntity = getOperationRecordEntity(accountId, ruleGroup, maxValue, minValue, operate, null, planId, operationThreshold, byteDancePlan.getScheduleTime(), operationThreshold, message, "头条");
                 }
@@ -614,7 +614,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                             newBid = new BigDecimal(operationThreshold).multiply(oldBidDecimal).longValue();
                         }
                     } else {
-                        newBid = calculatedValue(oldBidDecimal, operationType, operationValue, operationThreshold, maxValue, minValue, 2);
+                        newBid = calculatedValue(oldBidDecimal, operationType, operationValue, operationThreshold, maxValue, minValue, 2).longValue();
                     }
                     JSONObject unitJson = new JSONObject();
                     unitJson.put("advertiser_id", accountId);
@@ -662,7 +662,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                             newBudget = new BigDecimal(operationThreshold).multiply(oldBudgetDecimal).longValue();
                         }
                     } else {
-                        newBudget = calculatedValue(oldBudgetDecimal, operationType, operationValue, operationThreshold, maxValue, minValue, 2);
+                        newBudget = calculatedValue(oldBudgetDecimal, operationType, operationValue, operationThreshold, maxValue, minValue, 2).longValue();
                     }
                     Map<String, Object> updateMap = kuaiShouUpdateService.updateUnitDayBudget(token.getAccessToken(), accountId, unitId, newBudget, "规则引擎修改预算");
                     BigDecimal divide = new BigDecimal(newBudget + "").divide(new BigDecimal("1000"));
@@ -792,7 +792,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
      * @return
      * @throws
      */
-    private static Long calculatedValue(BigDecimal goal, String operationType, String operationValue, String operationThreshold, String fmaxValue, String fminValue, Integer type) {
+    private static BigDecimal calculatedValue(BigDecimal goal, String operationType, String operationValue, String operationThreshold, String fmaxValue, String fminValue, Integer type) {
         BigDecimal threshold = new BigDecimal(operationThreshold);
         BigDecimal maxValue = new BigDecimal(fmaxValue);
         BigDecimal minValue = new BigDecimal(fminValue);
@@ -830,7 +830,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                     value = goal.multiply(threshold);
                 }
             }
-            return value.longValue();
+            return value;
         } else {
             goal = goal.divide(new BigDecimal("1000"));
             //操作金额
@@ -864,7 +864,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                     value = goal.multiply(threshold);
                 }
             }
-            return value.multiply(new BigDecimal("1000")).longValue();
+            return value.multiply(new BigDecimal("1000"));
         }
     }
 
@@ -1161,15 +1161,8 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
     private boolean groupThresholdFromIndicator(JSONObject thresholdJson, String operate) {
         if ("SEND".equals(operate) || "PAUSE".equals(operate)) {
             return false;
-        }
-        RuleBase base = ruleBaseMapper.selectById(thresholdJson.getLong("ruleId"));
-        String code = base.getIndicatorCode();
-        if ("BID".equals(operate)) {
-            return "charge".equals(code) || "cost".equals(code);
-        } else if ("BUDGET".equals(operate)) {
-            return "convertCost".equals(code);
-        } else if ("TIME".equals(operate)) {
-            return "scheduleTime".equals(code);
+        } else if ("BID".equals(operate) || "BUDGET".equals(operate) || "TIME".equals(operate)) {
+            return true;
         }
         return false;
     }

+ 3 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialCutFrameMapper.xml

@@ -50,7 +50,8 @@
 			photo_id = #{photoId}
 		LIMIT 1
 	    )
-        AND signature != (
+        AND signature !=
+        IFNULL((
 	SELECT
 		signature
 	FROM
@@ -58,7 +59,7 @@
 	WHERE
 		image_token = #{imageToken}
 	LIMIT 1
-        )
+        ),'')
         LIMIT 1
     </select>
 

+ 4 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java

@@ -224,7 +224,9 @@ public class KuaiShouCreative {
     private Integer creativeCategory;
     private String creativeTag;
 
-   /* private Integer submit_size;
+    private Integer submitSize;
 
-    private Integer resubmit;*/
+    private Integer resubmit;
+
+    private String copyWriterId;
 }

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/controller/AuditRejectedResubmitController.java

@@ -12,7 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
 import java.util.List;
 
 /**
- * @Description: 文档库管理
+ * @Description: 拒审重提
  * @Author: zzy
  * @Date: 2021-09-06
  * @Version: V1.0
@@ -25,7 +25,7 @@ public class AuditRejectedResubmitController {
     AuditRejectedResubmitService auditRejectedResubmitService;
 
     /**
-     * 创建文案
+     * 拒审重提
      *
      * @param
      * @return

+ 3 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/controller/DocumentLibraryController.java

@@ -39,9 +39,9 @@ public class DocumentLibraryController {
      * @return
      */
     @GetMapping("getDocumentList")
-    public Result getDocumentList(@RequestParam("accountIds") List<String> accountIds,@RequestParam("keywords") String keywords,
-                                  @RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate,
-                                  @RequestParam("status") String status,@RequestParam("pageNumber") int pageNumber,@RequestParam("pageSize") int pageSize) {
+    public Result getDocumentList(@RequestParam(value = "accountIds",required = false) List<String> accountIds,@RequestParam(value = "keywords",required = false) String keywords,
+                                  @RequestParam(value = "startDate",required = false) String startDate,@RequestParam(value = "endDate",required = false) String endDate,
+                                  @RequestParam(value = "status",required = false) String status,@RequestParam("pageNumber") int pageNumber,@RequestParam("pageSize") int pageSize) {
         return documentLibraryService.getDocumentList(accountIds, keywords,startDate,endDate,status,pageNumber,pageSize);
 
     }

+ 7 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/mapper/AuditRejectedResubmitMapper.java

@@ -4,13 +4,18 @@ import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 @Mapper
 public interface AuditRejectedResubmitMapper {
-    List<KuaiShouCreative> getCreativeList(@Param("status") int status,@Param("date") String date);
+    List<KuaiShouCreative> getCreativeList(@Param("status") int status, @Param("date") String date);
 
     List<String> getRejectThesaurusListByStatus(@Param("status") int status);
 
-    void updateCreativeResubmit(@Param("creativeId") String creativeId,@Param("status") int status);
+    void updateCreativeResubmit(@Param("creativeId") String creativeId, @Param("status") int status);
+
+    void updateCreativeResubmitSize(@Param("creativeId") Long creativeId,@Param("copyWriterId") String copyWriterId);
+
+    void saveCopyWriterCenter(@Param("copyWriterId") String copyWriterId, @Param("creativeId") String creativeId, @Param("date") Date date);
 }

+ 7 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/mapper/DocumentLibraryMapper.java

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 @Mapper
 public interface DocumentLibraryMapper {
@@ -14,11 +15,13 @@ public interface DocumentLibraryMapper {
 
     List<JSONObject> getDocumentLibraryList(@Param("list") List<String> list, @Param("keywords") String keywords, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("status") String status);
 
-    void updateStatus(@Param("copyWriterId")String copyWriterId, @Param("status")String status);
+    void updateStatus(@Param("copyWriterId") String copyWriterId, @Param("status") String status);
 
-    List<JSONObject> getRefusedList(@Param("copyWriterId")String copyWriterId);
+    List<JSONObject> getRefusedList(@Param("copyWriterId") String copyWriterId);
 
-    List<String> getAcoountId(@Param("copyWriterId")String copyWriterId);
+    List<String> getAcoountId(@Param("copyWriterId") String copyWriterId);
 
-    List<String> getDataByAccountId(@Param("accountId")String accountId, @Param("copyWriterId")String copyWriterId);
+    List<String> getDataByAccountId(@Param("accountId") String accountId, @Param("copyWriterId") String copyWriterId);
+
+    List<Map<String,String>> getDocumentByAccountId(@Param("accountId") String accountId, @Param("copyWriterId") String copyWriterId);
 }

+ 6 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/mapper/xml/AuditRejectedResubmitMapper.xml

@@ -18,5 +18,11 @@
         update ctop_kuaishou_creative set resubmit=#{status} where creative_id=#{creativeId}
     </update>
 
+    <update id="updateCreativeResubmitSize">
+        update ctop_kuaishou_creative set submit_size=submit_size+1,copy_writer_id=#{copyWriterId} where creative_id=#{creativeId}
+    </update>
 
+    <insert id="saveCopyWriterCenter">
+        replace into ctop_document_library_center (creative_id,copy_writer_id,create_time) values (#{creativeId},#{copyWriterId},#{date})
+    </insert>
 </mapper>

+ 8 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/mapper/xml/DocumentLibraryMapper.xml

@@ -10,7 +10,7 @@
 
 
     <select id="getDocumentLibraryList" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT t.copy_writer_id as 'copyWriterId',t.copy_writer,t.status,COUNT(t1.id) as 'relatedSize',COUNT(if(t2.status= 42 ,TRUE,NULL)) as 'refusedSize'  from
+        SELECT t.copy_writer_id as 'copyWriterId',t.copy_writer,t.status,COUNT(t1.creative_id) as 'relatedSize',COUNT(if(t2.status= 42 ,TRUE,NULL)) as 'refusedSize'  from
         (SELECT DISTINCT copy_writer_id,copy_writer,status,create_time from ctop_document_library
         <where>
             <if test="keywords !=null and keywords !=''">
@@ -56,4 +56,11 @@
         select id from ctop_document_library  where account_id=#{accountId} and copy_writer_id=#{copyWriterId}
      </select>
 
+    <select id="getDocumentByAccountId" resultType="Map">
+        select copy_writer_id as 'copyWriterId',copy_writer as 'copyWriter' from ctop_document_library  where account_id=#{accountId}
+        <if test="copyWriterId!=null and copyWriterId!=''">
+            and copy_writer_id !=#{copyWriterId}
+        </if>
+     </select>
+
 </mapper>

+ 94 - 13
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/service/impl/AuditRejectedResubmitServiceImpl.java

@@ -1,18 +1,26 @@
 package cn.com.ctop.kuaishou.modules.document.service.impl;
 
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.IMaterialCutFrameService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouImageGetService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouMaterialUploadService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouUpdateService;
 import cn.com.ctop.kuaishou.modules.document.mapper.AuditRejectedResubmitMapper;
+import cn.com.ctop.kuaishou.modules.document.mapper.DocumentLibraryMapper;
 import cn.com.ctop.kuaishou.modules.document.service.AuditRejectedResubmitService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 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;
+import java.util.*;
 
 /**
  * @Description: 拒审重提
@@ -27,6 +35,24 @@ public class AuditRejectedResubmitServiceImpl implements AuditRejectedResubmitSe
     @Autowired
     AuditRejectedResubmitMapper auditRejectedResubmitMapper;
 
+    @Autowired
+    private IMaterialCutFrameService cutFrameService;
+
+    @Autowired
+    private IKuaiShouImageGetService imageGetService;
+
+    @Autowired
+    private IKuaiShouMaterialUploadService uploadService;
+
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+
+    @Autowired
+    private IKuaiShouUpdateService updateService;
+
+    @Autowired
+    private DocumentLibraryMapper documentLibraryMapper;
+
     /**
      * 重新提交创意
      *
@@ -37,10 +63,13 @@ public class AuditRejectedResubmitServiceImpl implements AuditRejectedResubmitSe
     public Result resubmit() {
         Result result = new Result();
         List<KuaiShouCreative> creativeList = new ArrayList<>();
-        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        calendar.roll(Calendar.DAY_OF_YEAR, -1);
         try {
-            //creativeList = auditRejectedResubmitMapper.getCreativeList(42,formatter.format(new Date()));
-            creativeList = auditRejectedResubmitMapper.getCreativeList(42,null);
+            log.info(formatter.format(calendar.getTime()));
+            creativeList = auditRejectedResubmitMapper.getCreativeList(42, formatter.format(calendar.getTime()));
             //可重提词组
             List<String> submit = auditRejectedResubmitMapper.getRejectThesaurusListByStatus(0);
             //不可重提词组
@@ -51,16 +80,51 @@ public class AuditRejectedResubmitServiceImpl implements AuditRejectedResubmitSe
                 Boolean flag = isSubmit(strings, resubmit);
                 if (!flag) {
                     //不可重提
-                    log.info("修改为不可重提:{}",reviewDetail);
-                    auditRejectedResubmitMapper.updateCreativeResubmit(String.valueOf(obj.getCreativeId()),1);
+                    log.info("修改为不可重提:{}", reviewDetail);
+                    auditRejectedResubmitMapper.updateCreativeResubmit(String.valueOf(obj.getCreativeId()), 1);
                 } else {
                     Boolean flag2 = isNotSubmit(strings, submit);
-                    if(flag2){
+                    if (flag2) {
                         //重提
-                        log.info("进行重提:{}",reviewDetail);
-                    }else {
+                        log.info("进行重提:{}", reviewDetail);
+                        Integer submit_size = obj.getSubmitSize();
+                        if (submit_size < 2) {
+                            JSONObject updateJson = new JSONObject();
+                            updateJson.put("creativeId", obj.getCreativeId());
+                            //更换封面
+                            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");
+                                String imageToken = getImageToken(signature, obj.getAccountId(), oauthToken.getAccessToken(), url);
+                                if (!Check.isNull(imageToken)) {
+                                    updateJson.put("imageToken", imageToken);
+                                }
+                            }
+                            //更换文案
+                            List<Map<String, String>> documentByAccountId = documentLibraryMapper.getDocumentByAccountId(String.valueOf(obj.getAccountId()), obj.getCopyWriterId());
+                            if (!documentByAccountId.isEmpty()) {
+                                updateJson.put("description", documentByAccountId.get(0).get("copyWriter"));
+                            }
+                            Map<String, Object> creativeMap = updateService.updateCreative(oauthToken.getAccessToken(), obj.getAccountId(), updateJson);
+                            Integer code = (Integer) creativeMap.get("code");
+                            if (code == 0) {
+                                //修改重提次数和文案id
+                                auditRejectedResubmitMapper.updateCreativeResubmitSize(obj.getCreativeId(), documentByAccountId.get(0).get("copyWriterId"));
+                                //插入文案关联创意表信息
+                                auditRejectedResubmitMapper.saveCopyWriterCenter(documentByAccountId.get(0).get("copyWriterId"), String.valueOf(obj.getCreativeId()), new Date());
+                                log.info("拒审重提成功,accountId:{},creativeId:{}", obj.getAccountId(), obj.getCreativeId());
+                            } else {
+                                log.info("拒审重提失败,accountId:{},creativeId:{}", obj.getAccountId(), obj.getCreativeId());
+                            }
+                        } else {
+                            log.info("重提次数已达上限:accountId:{},creativeId:{}", obj.getAccountId(), obj.getCreativeId());
+                        }
+
+                    } else {
                         //手动重提
-                        log.info("手动重提:{}",reviewDetail);
+                        log.info("手动重提:{}", reviewDetail);
                     }
                 }
             });
@@ -117,4 +181,21 @@ public class AuditRejectedResubmitServiceImpl implements AuditRejectedResubmitSe
         }
         return true;
     }
+
+
+    private String getImageToken(String md5, Long accountId, String accessToken, String url) {
+        String imageToken = null;
+        QueryWrapper<KuaiShouImageGet> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId);
+        queryWrapper.eq("signature", md5);
+        queryWrapper.last("limit 1");
+        KuaiShouImageGet imageGet = imageGetService.getOne(queryWrapper);
+        if (!Check.isNull(imageGet)) {
+            imageToken = imageGet.getImageToken();
+        } else {
+            imageToken = uploadService.kuauiShouImageUpload(url, md5, accountId, accessToken);
+        }
+        return imageToken;
+
+    }
 }

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java

@@ -606,12 +606,12 @@ public class ProjectMemberController {
      * @return
      */
     @GetMapping(value = "/bytedanceProjectParticipateInList")
-    public Result<List<ProjectMember>> bytedanceProjectParticipateInList() {
+    public Result<List<ProjectMember>> bytedanceProjectParticipateInList(@RequestParam(required = false) String userId) {
         Result<List<ProjectMember>> result = new Result<>();
         List<Integer> mediaIds = new ArrayList<>();
         mediaIds.add(1);
         mediaIds.add(3);
-        List<ProjectMember> projectMemberList = projectMemberService.getProjects(mediaIds);
+        List<ProjectMember> projectMemberList = projectMemberService.getProjects(mediaIds,userId);
         if (projectMemberList == null) {
             result.error500("未找到对应实体");
         } else {

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java

@@ -26,6 +26,8 @@ public interface IProjectMemberService extends IService<ProjectMember> {
 
     List<ProjectMember> getProjects(List<Integer> mediaIds);
 
+    List<ProjectMember> getProjects(List<Integer> mediaIds,String userId);
+
     List<Map<String, Object>> getProjectAccountByUserId(String userId, String mediaType);
 
     ProjectMember getProjectByParams(Long targetProject, String userId);

+ 30 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java

@@ -96,6 +96,36 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
 
     //视频报表
     @Override
+    public List<ProjectMember> getProjects(List<Integer> mediaIds,String userId) {
+//        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//        String userId = sysUser.getId();
+        String roleCode = memberMapper.getRoleCodeByUserId(userId);
+        String companyId = memberMapper.getCompanyIdByUserId(userId);
+
+        //角色权限判断
+        List<ProjectMember> projectMemberList = null;
+        if ("plan".equals(roleCode) || "clip".equals(roleCode) || "shot".equals(roleCode) || "plane".equals(roleCode) || "planeLeader".equals(roleCode)) {
+            projectMemberList = memberMapper.designProjects(userId, mediaIds);
+        } else if ("designTeamLeader".equals(roleCode)) {
+            projectMemberList = memberMapper.designLeaderProjects(companyId, mediaIds);
+        } else if ("admin".equals(roleCode)) {
+            projectMemberList = memberMapper.adminProjects(mediaIds);
+        } else if ("operator".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
+            projectMemberList = memberMapper.designProjects(userId, mediaIds);
+        } else {
+            //如果以上角色都不是的话直接查询此角色所属项目
+            projectMemberList = memberMapper.designProjects(userId, mediaIds);
+        }
+
+        if (null == projectMemberList) {
+            projectMemberList = new ArrayList<>();
+        }
+
+        return projectMemberList;
+    }
+
+    //视频报表
+    @Override
     public List<ProjectMember> getProjects(List<Integer> mediaIds) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String userId = sysUser.getId();

+ 3 - 1
jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-dev.yml

@@ -265,4 +265,6 @@ ai:
     callback-unit-url: http://192.168.1.193:31012/ai_callback_add_group
     callback-creative-url: http://192.168.1.193:31012/ai_callback_add_creative
 xxl-job:
-  requestUrl: http://jiaoyangapi.shyouteng.com.cn
+  requestUrl: http://jiaoyangapi.shyouteng.com.cn
+rule:
+    bytedanceUrl: http://139.186.165.84:8808/

+ 2 - 0
jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-prod.yml

@@ -265,3 +265,5 @@ ai:
     callback-creative-url: http://139.186.27.96:31012/ai_callback_add_creative
 xxl-job:
   requestUrl: http://jiaoyangapi.shyouteng.com.cn
+rule:
+  bytedanceUrl: http://118.24.244.213:8808/

+ 3 - 0
jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-test.yml

@@ -273,3 +273,6 @@ elasticsearch:
   connection-request-timeout: 500
   max-connect-num: 100
   max-connect-per-route: 100
+
+rule:
+  bytedanceUrl: http://139.186.165.84:8808/