浏览代码

拒审重提BUG解决

zhouzeyu@c-top.com.cn 3 年之前
父节点
当前提交
200acf2d5e

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

@@ -19,7 +19,11 @@
     </update>
 
     <update id="updateCreativeResubmitSize">
-        update ctop_kuaishou_creative set submit_size=submit_size+1,copy_writer_id=#{copyWriterId} where creative_id=#{creativeId}
+        update ctop_kuaishou_creative set submit_size=submit_size+1
+        <if test="copyWriterId !=null and copyWriterId!=''">
+            ,copy_writer_id=#{copyWriterId}
+        </if>
+        where creative_id=#{creativeId}
     </update>
 
     <insert id="saveCopyWriterCenter">

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

@@ -104,16 +104,18 @@ public class AuditRejectedResubmitServiceImpl implements AuditRejectedResubmitSe
                             }
                             //更换文案
                             List<Map<String, String>> documentByAccountId = documentLibraryMapper.getDocumentByAccountId(String.valueOf(obj.getAccountId()), obj.getCopyWriterId());
-                            if (!documentByAccountId.isEmpty()) {
+                            if (!documentByAccountId.isEmpty() && documentByAccountId.size() > 0) {
                                 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.updateCreativeResubmitSize(obj.getCreativeId(), documentByAccountId != null && documentByAccountId.size() > 0 ? documentByAccountId.get(0).get("copyWriterId") : null);
                                 //插入文案关联创意表信息
-                                auditRejectedResubmitMapper.saveCopyWriterCenter(documentByAccountId.get(0).get("copyWriterId"), String.valueOf(obj.getCreativeId()), new Date());
+                                if (!documentByAccountId.isEmpty() && documentByAccountId.size() > 0) {
+                                    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());