ソースを参照

Merge branch 'V2.0.1' into test

zhaoxian 3 年 前
コミット
4d536c4dbc

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoVideoServiceImpl.java

@@ -94,8 +94,8 @@ public class AiKuaishouAccountAutoVideoServiceImpl extends ServiceImpl<AiKuaisho
             param.put("advertiser_id", token.getAccountId());
             param.put("page_size", pageSize);
             param.put("page", page);
-//            param.put("start_date", date);
-//            param.put("end_date", date);
+            param.put("start_date", date);
+            param.put("end_date", date);
             String result = HttpUtils.httpPostRequest(url, param, headers);
             JSONObject resultJson = JSONObject.parseObject(result);
             if (Check.isNull(resultJson)) {

+ 5 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java

@@ -372,6 +372,8 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
             List<KuaiShouAppInfo> appInfos = new ArrayList<>();
             List<KuaiShouSchedule> schedules = new ArrayList<>();
             List<KuaiShouGroupTarget> targets = new ArrayList<>();
+            //TODO
+            log.info("---最高出价={},优化目标集={},转化目标map={},深度转化目标map={}",maxBid,bidTypeStr,ocpxTypeStr,deepTypeStr);
             for (int i = 0; i < details.size(); i++) {
                 JSONObject detail = JSONObject.parseObject(details.get(i).toString());
                 if (!Check.isNull(detail)) {
@@ -397,6 +399,9 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
                     Integer status = detail.getInteger("status");
                     //投放状态
                     Integer putStatus = detail.getInteger("put_status");
+                    //TODO
+                    log.info("---({})优化目标={},优化出价={}",unitId,bidType,bid);
+                    log.info("---putStatus={},转化目标={},转化目标出价={},深度转化目标={},深度转化目标出价={}",putStatus,ocpxActionType,cpaBid,deepConversionType,deepConversionBid);
                     if (putStatus == 1 && status != 15) { // 组状态为 投放中的 and 广告组状态为非暂停
                         Boolean typeFalg = true;
                         Boolean bidFalg = true;

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouUpdateServiceImpl.java

@@ -381,10 +381,10 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
                         deleteMap.put("account_id", advertiserId);
                         deleteMap.put("unit_id", unitId);
                         groupMapper.deleteByMap(deleteMap);
+                        log.info("删除成功,accountId:{}。unitId:{}", advertiserId, unitId);
                     } else {
                         groupService.getGroupByUnitId(token, advertiserId, unitId);
                     }
-                    log.info("删除成功,accountId:{}。unitId:{}", advertiserId, unitId);
                 } else {
                     log.error("修改广告组状态失败,advertiserId:{},unitId:{},返回信息:{}", advertiserId, unitId, resultJson);
                     returnMap.put("code", -1);

+ 9 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -1380,20 +1380,25 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     //转化目标
                     if (!Check.isNull(ocpxActionType) && ocpxActionType != 0) {
                         //!=0是设置过转化目标
-                        if (ocpxActionType == 2 && (dayBudget == 0 || dayBudget > 500 * 1000)) {
-                            // 转化目标为2行为数,并且预算大于500 或者不限,则关停
-                            typeFalg = false;
-                        } else if (!Check.isNullMap(ocpxMap)) {
+                        if (!Check.isNullMap(ocpxMap)) {
                             Long ocpxBid = ocpxMap.get(ocpxActionType);
                             if (Check.isNull(ocpxBid)) {
+                                if (ocpxActionType == 2 && dayBudget != 0 && dayBudget <= 500 * 1000) {
+                                    // 转化目标为2行为数,并且预算小于等于500且不是不限,则允许启动
+                                    typeFalg = true;
+                                }else{
                                 //通过key未获取值,说明不包含该目标,进行关停
                                 typeFalg = false;
+                                }
                             } else {
                                 if (cpaBid > ocpxBid) {
                                     //组转化出价 大于 项目设置最大转化出价,则关停
                                     bidFalg = false;
                                 }
                             }
+                        }else if (ocpxActionType == 2 && (dayBudget == 0 || dayBudget > 500 * 1000)) {
+                            // 转化目标为2行为数,并且预算大于500 或者不限,则关停
+                            typeFalg = false;
                         }
                     }
 

+ 3 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/WarningOperationServiceImpl.java

@@ -68,7 +68,7 @@ public class WarningOperationServiceImpl implements IWarningOperationService {
         warningOperationLog.setUserId(userId);
         warningOperationLog.setWarningType(1);
         warningOperationLogService.save(warningOperationLog);
-        log.info("暂停组成功,accountId:{},unitId:{}", advertiserId, unitId);
+        log.info("出价方式预警,暂停组成功,accountId:{},unitId:{}", advertiserId, unitId);
         try {
             String text = messageTemplate.getKuaiShouBidTypeMessage(projectName, advertiserId, unitId, unit_name);
 
@@ -97,6 +97,7 @@ public class WarningOperationServiceImpl implements IWarningOperationService {
         try {
             String text = messageTemplate.getKuaiShouBidMessage(projectName, advertiserId, unitId, unit_name);
             sendMessageService.sendMessage(userId, text);
+
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -111,6 +112,7 @@ public class WarningOperationServiceImpl implements IWarningOperationService {
         warningOperationLog.setUserId(userId);
         warningOperationLog.setWarningType(2);
         warningOperationLogService.save(warningOperationLog);
+        log.info("出价过高预警,暂停组成功,accountId:{},unitId:{}", advertiserId, unitId);
 
     }
 }