songyh 4 lat temu
rodzic
commit
c92a68a312
17 zmienionych plików z 341 dodań i 170 usunięć
  1. 0 1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/es/JeecgElasticsearchTemplate.java
  2. 19 53
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/dockapi/Marketing.java
  3. 2 0
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/mapper/ByteDanceAdvertisePlanMapper.java
  4. 5 0
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/mapper/xml/ByteDanceAdvertisePlanMapper.xml
  5. 3 0
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/IAiBytedanceAdvertiserStrategyService.java
  6. 2 0
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/IByteDanceAdvertisePlanService.java
  7. 2 0
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/IBytedanceImageInfoService.java
  8. 205 87
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/AiBytedanceAdvertiserStrategyServiceImpl.java
  9. 8 4
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/ByteDanceAdvertisePlanServiceImpl.java
  10. 14 2
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/BytedanceImageInfoServiceImpl.java
  11. 3 0
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/service/IFileInfoService.java
  12. 47 3
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/service/impl/FileInfoServiceImpl.java
  13. 2 0
      jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/utils/StatusCode.java
  14. 20 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/bytedance/advertise/controller/AiBytedanceAdvertiserStrategyController.java
  15. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/SmsSendMsgHandle.java
  16. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/WxSendMsgHandle.java
  17. 9 13
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/websocket/WebSocket.java

+ 0 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/es/JeecgElasticsearchTemplate.java

@@ -324,7 +324,6 @@ public class JeecgElasticsearchTemplate {
             return "created".equals(result) || "updated".equals(result);
         } catch (Exception e) {
             log.error(e.getMessage() + "\n-- url: " + url + "\n-- data: " + data.toJSONString());
-            //TODO 打印接口返回异常json
             return false;
         }
     }

+ 19 - 53
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/dockapi/Marketing.java

@@ -2,11 +2,11 @@ package org.jeecg.modules.bytedance.advertise.dockapi;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.google.gson.JsonObject;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.HttpEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.jeecg.common.api.vo.Result;
@@ -21,12 +21,14 @@ import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
 import org.jeecg.modules.bytedance.common.utils.Check;
 import org.jeecg.modules.bytedance.common.utils.HttpUtils;
 import org.jeecg.modules.bytedance.common.utils.PropertiesUtils;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
+
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.net.URI;
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 头条-巨量引擎API 接口
@@ -318,55 +320,13 @@ public class Marketing {
      * 创建广告创意
      * @param
      * @param adId 广告计划id
-     * @param strategy 创意入参
+     * @param params 创意入参
      * @return
      */
-    public static Result creativeCreate(CtopOauthToken token, Long adId, AiBytedanceAdvertiserStrategy strategy) {
-        JSONObject params = new JSONObject();
-
-        //广告主ID
-        params.put("advertiser_id", token.getAccountId());
-        //广告计划ID
-        params.put("ad_id", adId);
-        //广告 投放位置 三选一
-        //广告位置(按媒体指定位置)
-        params.put("inventory_type", strategy.getCreativeInventoryType());
-        //优选广告位,0表示不使用优选,1表示使用
-        params.put("smart_inventory", strategy.getCreativeSmartInventory());
-        //场景广告位
-        params.put("scene_inventory", strategy.getCreativeSceneInventory());
-
-        //展示(监测链接)
-        params.put("track_url", strategy.getCreativeTrackUrl());
-        //点击(监测链接)
-        params.put("action_track_url", strategy.getCreativeActionTrackUrl());
-        //创意方式,当值为"STATIC_ASSEMBLE"表示程序化创意,其他情况不传字段
-        params.put("creative_material_mode", strategy.getCreativeMaterialMode());
-        //标题信息
-        params.put("image_list", "");
-        //行动号召
-        params.put("action_text", strategy.getCreativeCallToAction());
-        //是否使用智能优选,true为使用,false为不使用
-        params.put("enable_personal_action", strategy.getCreativeEnablePersonalAction());
-        //卡片标题
-        params.put("product_description", strategy.getCreativeProductDescription());
-        //推广卖点 长度6-9个字,最多可填10个卖点
-        params.put("product_selling_points", strategy.getCreativeProductSellingPoints());
-        //来源
-        params.put("source", strategy.getCreativeSource());
-        //创意分类
-        params.put("third_industry_id", strategy.getCreativeThirdIndustryId());
-        //创意标签 创意标签。最多20个标签,且每个标签长度不超过10个字符
-        params.put("ad_keywords", strategy.getCreativeAdKeywords());
-        JSONObject result = HttpUtils.bytedancePostRequest(token.getAccessToken(),
+    public static JSONObject creativeCreate(CtopOauthToken token, Long adId, JSONObject params) {
+        return HttpUtils.bytedancePostRequest(token.getAccessToken(),
                 urlPath + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_create_v2"),
                 params);
-        Integer code = result.getInteger("code");
-        String message = result.getString("message");
-        if (null == code || code != 0) {
-            return Result.error("广告计划("+adId+"):创建创意信息异常--->>>"+message);
-        }
-        return Result.successMsg("广告计划("+adId+"):"+"创意创建成功",result.get("data"));
     }
 
 
@@ -979,11 +939,10 @@ public class Marketing {
     /**
      *  上传平台 图片
      * @param token
-     * @param advertiserId 广告主id
      * @param imageUrl 图片url
      * @return
      */
-    public static JSONObject imageUpload(CtopOauthToken token, String advertiserId, String imageUrl) {
+    public static JSONObject imageUpload(CtopOauthToken token, String imageUrl) {
         // 请求地址
         String url = urlPath + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_file_image_ad");
         // 构造请求
@@ -991,7 +950,7 @@ public class Marketing {
         httpPost.setHeader("Access-Token", token.getAccessToken());
         MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create();
         // 其他参数
-        entityBuilder.addTextBody("advertiser_id", advertiserId);
+        entityBuilder.addTextBody("advertiser_id", token.getAccountId().toString());
         entityBuilder.addTextBody("upload_type", BytedanceConstant.UPLOAD_TYPE_BY_URL);
         entityBuilder.addTextBody("image_url", imageUrl);
 
@@ -1031,6 +990,13 @@ public class Marketing {
     }
 
 
-
-
+    public static JSONObject getSuggestImageId(CtopOauthToken token, String vid) {
+        // 请求地址
+        String url = "https://ad.oceanengine.com/open_api/2/tools/video_cover/suggest/";
+        // 请求参数
+        JSONObject data = new JSONObject();
+        data.put("advertiser_id", token.getAccountId());
+        data.put("video_id", vid);
+        return HttpUtils.bytedanceGetRequest(token.getAccessToken(),url,data);
+    }
 }

+ 2 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/mapper/ByteDanceAdvertisePlanMapper.java

@@ -18,4 +18,6 @@ public interface ByteDanceAdvertisePlanMapper extends BaseMapper<ByteDanceAdvert
     List<String> selectWarningGroup(@Param("accountId") Long accountId, @Param("maxBid") BigDecimal maxBid);
 
     List<String> selectWarningCpaBid(@Param("accountId") Long accountId, @Param("maxCpaBid") BigDecimal maxCpaBid);
+
+    int queryTodayBuiltCount(Long accountId, String date);
 }

+ 5 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/mapper/xml/ByteDanceAdvertisePlanMapper.xml

@@ -20,6 +20,11 @@
    and deep_cpabid &gt; #{maxCpaBid}
    and toutiao_status = 'AD_STATUS_DELIVERY_OK'
     </select>
+    <select id="queryTodayBuiltCount" resultType="java.lang.Integer">
+        SELECT count(1) FROM ctop_bytedance_advertise_plan
+        WHERE account_id = #{accountId}
+          AND LOCATE(#{date}, ad_create_time)
+    </select>
 
 
 </mapper>

+ 3 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/IAiBytedanceAdvertiserStrategyService.java

@@ -94,4 +94,7 @@ public interface IAiBytedanceAdvertiserStrategyService extends IService<AiByteda
      */
     Result<AiBytedanceAdvertiserStrategy> addBytedanceStrategy(AiBytedanceAdvertiserStrategy aiBytedanceAdvertiserStrategy);
 
+    AiBytedanceAdvertiserStrategy getByAccountId(Long accountId,Integer status);
+
+    void customCreativeSupplement(AiBytedanceAdvertiserStrategy strategy, Integer hour);
 }

+ 2 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/IByteDanceAdvertisePlanService.java

@@ -35,4 +35,6 @@ public interface IByteDanceAdvertisePlanService extends IService<ByteDanceAdvert
     List<String> selectWarningCpaBid(Long accountId, BigDecimal maxCapBid);
 
     List<ByteDanceAdvertisePlan> getAllPlans(Long accountId,String createDate);
+
+    int queryToDayBuiltCount(Long accountId);
 }

+ 2 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/IBytedanceImageInfoService.java

@@ -15,4 +15,6 @@ public interface IBytedanceImageInfoService extends IService<BytedanceImageInfo>
     void replaceBatch(List<BytedanceImageInfo> videoInfoList);
 
     void updateType();
+
+    BytedanceImageInfo getByParams(String imageCode);
 }

+ 205 - 87
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/AiBytedanceAdvertiserStrategyServiceImpl.java

@@ -3,10 +3,9 @@ package org.jeecg.modules.bytedance.advertise.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.formula.functions.T;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.bytedance.advertise.dockapi.Marketing;
@@ -20,27 +19,17 @@ import org.jeecg.modules.bytedance.advertise.vo.IndustryVo;
 import org.jeecg.modules.bytedance.advertise.vo.PlanSearchVo;
 import org.jeecg.modules.bytedance.common.constant.BytedanceConstant;
 import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
-import org.jeecg.modules.bytedance.common.entity.MaterialInfo;
 import org.jeecg.modules.bytedance.common.entity.MaterialImageInfo;
+import org.jeecg.modules.bytedance.common.entity.MaterialInfo;
 import org.jeecg.modules.bytedance.common.entity.UserAllocation;
-import org.jeecg.modules.bytedance.common.service.ICtopOauthTokenService;
-import org.jeecg.modules.bytedance.common.service.IMaterialImageInfoService;
-import org.jeecg.modules.bytedance.common.service.IMaterialInfoService;
-import org.jeecg.modules.bytedance.common.service.IUserAllocationService;
-import org.jeecg.modules.bytedance.common.utils.Check;
+import org.jeecg.modules.bytedance.common.service.*;
 import org.jeecg.modules.bytedance.common.utils.Check;
 import org.jeecg.modules.bytedance.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.spi.LocaleServiceProvider;
-import java.util.stream.Collectors;
+import java.util.*;
 
 /**
  * 头条智能投放账户配置信息表
@@ -51,18 +40,28 @@ import java.util.stream.Collectors;
 @Service
 @Slf4j
 public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiBytedanceAdvertiserStrategyMapper, AiBytedanceAdvertiserStrategy> implements IAiBytedanceAdvertiserStrategyService {
-
     @Autowired
-    private ICtopOauthTokenService tokenService;
-
+    private IBytedanceVideoSlogenInfoService slogenInfoService;
+    @Autowired
+    private IFileInfoService fileInfoService;
     @Resource
     private AiBytedanceAdvertiserStrategyMapper aiBytedanceAdvertiserStrategyMapper;
     @Autowired
-    private IUserAllocationService userAllocationService;
-
+    private ICtopOauthTokenService tokenService;
     @Autowired
     private IMaterialImageInfoService materialImageInfoService;
-
+    @Autowired
+    private IUserAllocationService userAllocationService;
+    @Autowired
+    private IBytedanceImageInfoService bytedanceImageInfoService;
+    @Autowired
+    private IMaterialInfoService materialInfoService;
+    @Autowired
+    private IByteDanceCampaignService campaignService;
+    @Autowired
+    private IAiBytedanceAdDplinkInfoService adDplinkInfoService;
+    @Autowired
+    private IByteDanceVideoInfoService videoInfoService;
 
     @Override
     public Long createCreative(AiBytedanceAdvertiserStrategy strategy,Integer createType, Long videoCnt) {
@@ -88,25 +87,12 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
             log.info("获取视频素材为空=>accountId:{}", token.getAccountId());
             return videoCnt;
         }
-        //
         /**
          * 1:创建组
          * 查询当前账户排列到的dp链接标识号
-         *
          */
-        Long dpIndex ;
-        AiBytedanceAdDplinkInfo adDplinkInfo = adDplinkInfoService.getlatestDpLinkInfo(strategy.getId(),strategy.getAccountId(),1);
-        if(null == adDplinkInfo){
-            dpIndex = strategy.getDpLinkStartIndex();
-        }else{
-            dpIndex = adDplinkInfo.getDpLinkIndex()+1;
-        }
-        if(dpIndex>strategy.getDpLinkEndIndex()){
-            log.info("此账户策略创建结束=>账户id:{};策略id:{}", token.getAccountId(),strategy.getId());
-            return 0L;
-        }
         //根据dpLink获取组名称
-        String campaignName = getCampaignName(dpIndex,strategy);
+        String campaignName = getCampaignName(strategy);
         Long campaignId = getCampaignId(strategy,campaignName,token);
         if(null == campaignId){
             return videoCnt;
@@ -115,7 +101,20 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
             /**
              * 2:创建计划
              */
-            //1:应用直达链接
+            Long dpIndex ;
+            AiBytedanceAdDplinkInfo adDplinkInfo = adDplinkInfoService.getlatestDpLinkInfo(strategy.getId(),strategy.getAccountId(),1);
+            if(null == adDplinkInfo){
+                adDplinkInfo = new AiBytedanceAdDplinkInfo();
+                adDplinkInfo.setDpLinkIndex(strategy.getDpLinkStartIndex());
+            }else{
+                adDplinkInfo.setId(null);
+                adDplinkInfo.setDpLinkIndex(adDplinkInfo.getDpLinkIndex()+1);
+            }
+            dpIndex = strategy.getDpLinkStartIndex();
+            if(dpIndex>strategy.getDpLinkEndIndex()){
+                log.info("此账户策略创建结束=>账户id:{};策略id:{}", token.getAccountId(),strategy.getId());
+                return 0L;
+            }
             strategy.setAdOpenUrl(strategy.getAdOpenUrl().replace("{{dp链接下标}}",dpIndex.toString()));
             String dplinkCode = StringUtils.getParamFromUrl(strategy.getAdOpenUrl(),"bc_fl_src");
             String adName = getAdName(strategy,dplinkCode,video);
@@ -124,13 +123,27 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
             if(null == adId){
                 continue;
             }
+            adDplinkInfo.setAdId(adId);
+            adDplinkInfo.setAccountId(strategy.getAccountId());
+            adDplinkInfo.setStatus(1);
+            adDplinkInfo.setStratrgyId(strategy.getId());
+            adDplinkInfoService.save(adDplinkInfo);
             //3:创建创意
             JSONObject creativeParams = getCreativeParams(strategy,adId,video,token);
-
+            JSONObject creativeObject =  Marketing.creativeCreate(token,adId,creativeParams);
+            if(null!=creativeObject.getInteger("code")&&creativeObject.getInteger("code")!=0){
+                String message = creativeObject.getString("message");
+                //创建创意失败
+                log.info("创意创建失败:message==>{}",message);
+                continue;
+            }
+            videoCnt --;
+            if(videoCnt<=0){
+                return 0L;
+            }
         }
         return videoCnt;
     }
-
     private JSONObject getCreativeParams(AiBytedanceAdvertiserStrategy strategy, Long adId,ByteDanceVideoInfo videoInfo,CtopOauthToken token) {
         JSONObject params = new JSONObject();
         params.put("advertiser_id",strategy.getAccountId());
@@ -253,15 +266,105 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
 //            params.put("ad_download_status",adDownloadStatus);
 //        }
         //商品推广卡片
-
+        String imageCode = strategy.getCreativeProductImageCode();
+        if(!Check.isNull(imageCode)){
+            //1:根据imageCode获取图片id
+            JSONObject promotionCard = new JSONObject();
+            String iconImageId = getBytedanceImageIdByCode(imageCode,strategy,token);
+            if(!Check.isNull(iconImageId)){
+                promotionCard.put("product_image_id",iconImageId);
+            }
+            String productSellingPoints = strategy.getCreativeProductSellingPoints();
+            if(!Check.isNull(productSellingPoints)){
+                JSONArray pointArray = JSON.parseArray(productSellingPoints);
+                if(null!=pointArray&&pointArray.size()>0){
+                    promotionCard.put("product_selling_points",pointArray);
+                }
+            }
+            String productDescription = strategy.getCreativeProductDescription();
+            if(Check.isNull(productDescription)){
+                promotionCard.put("product_description",productDescription);
+            }
+            Boolean enableStorePack = strategy.getCreativeEnablePersonalAction();
+            if(null!=enableStorePack){
+                promotionCard.put("enable_store_pack",enableStorePack);
+            }
+            String callToAction = strategy.getCreativeCallToAction();
+            if(!Check.isNull(callToAction)){
+                promotionCard.put("call_to_action",callToAction);
+            }
+            Boolean enablePersonalAction = strategy.getCreativeEnablePersonalAction();
+            if(null!=enablePersonalAction){
+                promotionCard.put("enable_personal_action",enablePersonalAction);
+            }
+            params.put("promotion_card",promotionCard);
+        }
+        //行业类别
+        String thirdIndustryId = strategy.getCreativeThirdIndustryId();
+        if(!Check.isNull(thirdIndustryId)){
+            params.put("third_industry_id",thirdIndustryId);
+        }
+        String adKeywords = strategy.getCreativeAdKeywords();
+        if(!Check.isNull(adKeywords)){
+            String [] keywords = adKeywords.split(",");
+            if(keywords.length>0){
+                JSONArray adkeywordsArray = new JSONArray();
+                for(int i=0;i<keywords.length;i++){
+                    adkeywordsArray.add(keywords[i]);
+                }
+                params.put("ad_keywords",adkeywordsArray);
+            }
+        }
+        String trackUrl = strategy.getCreativeTrackUrl();
+        if(!Check.isNull(trackUrl)){
+            params.put("track_url",trackUrl);
+        }
+        String actionTrackUrl = strategy.getCreativeActionTrackUrl();
+        if(!Check.isNull(actionTrackUrl)){
+            params.put("action_track_url",actionTrackUrl);
+        }
+        String videoPlayEffectiveTrackUrl = strategy.getCreativeVideoPlayEffectiveTrackUrl();
+        if(!Check.isNull(videoPlayEffectiveTrackUrl)){
+            params.put("video_play_effective_track_url",videoPlayEffectiveTrackUrl);
+        }
+//        String videoPlayDoneTrackUrl = strategy.getCreativeVideoPlayDoneTrackUrl();
+//        if(!Check.isNull(videoPlayDoneTrackUrl)){
+//            params.put("video_play_done_track_url",videoPlayDoneTrackUrl);
+//        }
+        String videoPlayTrackUrl = strategy.getCreativeVideoPlayTrackUrl();
+        if(!Check.isNull(videoPlayTrackUrl)){
+            params.put("video_play_track_url",videoPlayTrackUrl);
+        }
         return params;
 
     }
 
-    @Autowired
-    private IBytedanceVideoSlogenInfoService slogenInfoService;
-    private String getSuggestImageId(CtopOauthToken token, String vid) {
+    private String getBytedanceImageIdByCode(String imageCode, AiBytedanceAdvertiserStrategy strategy,CtopOauthToken token) {
+        //1:根据code获取图片信息
+        BytedanceImageInfo bytedanceImageInfo = bytedanceImageInfoService.getByParams(imageCode);
+        if(null!=bytedanceImageInfo){
+            return bytedanceImageInfo.getId();
+        }
+        //2:根据code查询图片素材信息
+        MaterialImageInfo imageInfo = materialImageInfoService.getByCode(imageCode);
+        if(null ==  imageInfo){
+            return null;
+        }
+        Map<String, Object> result = fileInfoService.uploadImageToBytedance(token.getAccountId().toString(),imageInfo.getUrl());
+        Integer code = (Integer) result.get("code");
+        if(null == code||code!=0){
+            return null;
+        }
+        BytedanceImageInfo info  = (BytedanceImageInfo)result.get("data");
+        if(null != info&&null!=info.getId()){
+            return info.getId();
+        }
         return null;
+        //图片上传头条巨量后台
+    }
+
+    private String getSuggestImageId(CtopOauthToken token, String vid) {
+        return fileInfoService.getSuggestImageId(token,vid);
     }
 
     private Long createAdInfo(CtopOauthToken token, AiBytedanceAdvertiserStrategy strategy, JSONObject adParams) {
@@ -597,11 +700,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         return adName;
     }
 
-    @Autowired
-    private IMaterialInfoService materialInfoService;
 
-    @Autowired
-    private IByteDanceCampaignService campaignService;
     private Long getCampaignId(AiBytedanceAdvertiserStrategy strategy, String campaignName,CtopOauthToken token) {
         ByteDanceCampaign campaign = campaignService.getOneByParams(strategy.getAccountId(),campaignName);
         if(null != campaign){
@@ -630,15 +729,10 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         return (Long)campaignData.getResult();
     }
 
-    private String getCampaignName(Long dpIndex, AiBytedanceAdvertiserStrategy strategy) {
-        Long unitCreativeNum = strategy.getCampaignAdCnt();
-        return null;
+    private String getCampaignName(AiBytedanceAdvertiserStrategy strategy) {
+        String campaignName = strategy.getCampaignName();
+        return campaignName+"-("+strategy.getDpLinkStartIndex()+"/"+strategy.getDpLinkEndIndex()+")";
     }
-
-    @Autowired
-    private IAiBytedanceAdDplinkInfoService adDplinkInfoService;
-    @Autowired
-    private IByteDanceVideoInfoService videoInfoService;
     private List<ByteDanceVideoInfo> getVideoInfoByCreateType(Long projectId,AiBytedanceAdvertiserStrategy strategy, String startTime, String endTime, Integer createType, Long videoCnt) {
         //1:上新素材 2:跑量素材 3:遗漏素材 4:打捞素材
         if(createType == 1||createType == 3){
@@ -652,11 +746,6 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         }
         return null;
     }
-
-    public static void main(String[] args) {
-        String url = "taobaolite://m.ltao.com/open/index.html?action=ali.open.nav&module=h5&bootImage=0&source=toutiao&packageName=com.taobao.litetao&h5Url=https%3A%2F%2Fpages.tmall.com%2Fwow%2Fz%2Fsale%2FdynamicSolution%2Fsfbthp%3FdisableNav%3DYES%26wh_kangarooprefetch%3Dtrue%26needLogin%3Dtrue&bc_fl_src=sf_jrtt_huichuangzh_ptbt_{{dp链接下标}}&backurl=__back_url__";
-        System.out.println(StringUtils.getParamFromUrl(url,"bc_fl_src"));
-    }
     /**
      *  修改状态 (0开-1关)
      * @param
@@ -707,7 +796,6 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
             if (!"200".equals(updResult.getCode())){
                 return Result.error(updResult.getMessage());
             }*/
-            // 修改 预算 TODO
             priceList.forEach(map-> {
                 aiBytedanceAdvertiserStrategyMapper.updBudgetById(updAdStaOrCpaOrBudget.getId(),updAdStaOrCpaOrBudget.getBudget());
             });
@@ -719,12 +807,11 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
 
     /**
      *
-     * @description: 获取行业类别
-     *
+     * 获取行业类别
      * @param accountId 广告主id
      * @param type 行业类别
-     * @return: org.jeecg.common.api.vo.Result
-     * @author: zianY
+     * @return org.jeecg.common.api.vo.Result
+     * @author zianY
      */
     public Result getIndustryList(String accountId,String type) throws Exception {
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
@@ -732,12 +819,8 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
             log.info("token获取失败=>accountId:{}", token.getAccountId());
             return Result.error("token获取失败====>>>>accountId:"+token.getAccountId());
         }
-        // 获取行业列表
-        Result industryList = Marketing.getToolIndustryList(token,type);
-        log.error("行业列表=======>>>>>>>>>>>", industryList.getResult());
-        return Result.successMsg("获取行业列表成功。", industryList.getResult());
         // api 获取行业列表
-        Result listResult = marketing.getToolIndustryList(token,type);
+        Result listResult = Marketing.getToolIndustryList(token,type);
         List<Map<String,Object>> industryListMap = (List<Map<String,Object>>) listResult.getResult();
         // list map 数据格式 转 list entity 数据格式
         List<IndustryVo> industryList = Check.convertListMap2ListBean(industryListMap,IndustryVo.class);
@@ -804,7 +887,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
             return Result.error("token获取失败====>>>>accountId:"+token.getAccountId());
         }
         // 获取广告组
-        Result industryList = marketing.getCampaignGroupList(token,accountId,adGroupSearchVoList,pageNo,pageSize);
+        Result industryList = Marketing.getCampaignGroupList(token,accountId,adGroupSearchVoList,pageNo,pageSize);
         log.error("获取广告组=======>>>>>>>>>>>", industryList.getResult());
         return Result.successMsg("获取广告组成功。", industryList.getResult());
     }
@@ -813,25 +896,25 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
 
     /**
      *
-     * @description: 获取广告计划
+     * @description 获取广告计划
      *
      * @param accountId 广告主id
      * @param adGroupSearchVoList
-     * @param pageNo
-     * @param pageSize
-     * @return: org.jeecg.common.api.vo.Result
-     * @author: zianY
+     * @param pageNo 页数
+     * @param pageSize 每页条数
+     * @return org.jeecg.common.api.vo.Result
+     * @author zianY
      */
     public Result getCampaignPlan(String accountId, List<PlanSearchVo> adGroupSearchVoList, Integer pageNo, Integer pageSize) {
 
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
         if (null == token) {
-            log.info("token获取失败=>accountId:{}", token.getAccountId());
-            return Result.error("token获取失败====>>>>accountId:"+token.getAccountId());
+            log.info("token获取失败=>accountId:{}", accountId);
+            return Result.error("token获取失败====>>>>accountId:"+accountId );
         }
         // 获取计划
-        Result industryList = marketing.getPlanList(token,adGroupSearchVoList,pageNo,pageSize);
-        log.error("获取广告计划=======>>>>>>>>>>>", industryList.getResult());
+        Result industryList = Marketing.getPlanList(token,adGroupSearchVoList,pageNo,pageSize);
+        log.error("获取广告计划=======>>>>>>>>>>>{}", industryList.getResult());
         return Result.successMsg("获取广告计划成功。", industryList.getResult());
     }
 
@@ -902,9 +985,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
             log.info("token获取失败=>accountId:{}", token.getAccountId());
             return Result.error("token获取失败====>>>>accountId:"+token.getAccountId());
         }
-        Result resultCampaign = Marketing.getToolConvertQuery(token,adConvertQueryVo);
-        return Result.successMsg("查询广告计划可用转化目标成功。", resultCampaign.getResult());
-        return marketing.getToolConvertQuery(token,adConvertQueryVo);
+        return Marketing.getToolConvertQuery(token,adConvertQueryVo);
     }
 
 
@@ -920,11 +1001,11 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
     public Result addBytedanceStrategy(AiBytedanceAdvertiserStrategy aiBytedanceAdvertiserStrategy) {
         // 数据入库 string[] 转 string
         //商品卖点
-        aiBytedanceAdvertiserStrategy.setCreativeProductSellingPoints(StringUtils.join(aiBytedanceAdvertiserStrategy.getProductSellingPoints(), ","));
+        aiBytedanceAdvertiserStrategy.setCreativeProductSellingPoints(org.apache.commons.lang3.StringUtils.join(aiBytedanceAdvertiserStrategy.getProductSellingPoints(), ","));
         //广告位置
-        aiBytedanceAdvertiserStrategy.setCreativeInventoryType(StringUtils.join(aiBytedanceAdvertiserStrategy.getCreativeInventoryTypes(), ","));
+        aiBytedanceAdvertiserStrategy.setCreativeInventoryType(org.apache.commons.lang3.StringUtils.join(aiBytedanceAdvertiserStrategy.getCreativeInventoryTypes(), ","));
         //创意标签
-        aiBytedanceAdvertiserStrategy.setCreativeAdKeywords(StringUtils.join(aiBytedanceAdvertiserStrategy.getAdKeywords(), ","));
+        aiBytedanceAdvertiserStrategy.setCreativeAdKeywords(org.apache.commons.lang3.StringUtils.join(aiBytedanceAdvertiserStrategy.getAdKeywords(), ","));
 
         //添加素材信息
         MaterialImageInfo imageInfo = new MaterialImageInfo();
@@ -936,9 +1017,46 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         return Result.successMsg("新增成功。",aiBytedanceAdvertiserStrategy);
     }
 
+    @Override
+    public AiBytedanceAdvertiserStrategy getByAccountId(Long accountId,Integer status) {
+        QueryWrapper<AiBytedanceAdvertiserStrategy> queryWrapper = new QueryWrapper<>();
+        if(null!=accountId){
+            queryWrapper.eq("account_id",accountId);
+        }
+        if(null!=status){
+            queryWrapper.eq("status",status);
+        }
+        queryWrapper.orderByDesc("id").last("limit 1");
+        return this.getOne(queryWrapper);
+    }
 
-
-
+    @Autowired
+    private IByteDanceAdvertisePlanService planService;
+    @Override
+    public void customCreativeSupplement(AiBytedanceAdvertiserStrategy strategy, Integer hour) {
+        Long customUnitCnt = strategy.getCampaignAdCnt()*strategy.getCampaignCnt();
+        Long unitNum = customUnitCnt * hour / 15;
+        log.info("{}当前时间内需要创建计划总数:{}", strategy.getAccountId(), unitNum);
+        //查询当前账户创建自定义类型计划数量
+        int unitCreateCnt = planService.queryToDayBuiltCount(strategy.getAccountId());
+        log.info("{}截止目前创建组总数:{}", strategy.getAccountId(), unitCreateCnt);
+        long remindCnt = unitNum - unitCreateCnt;
+        if (remindCnt >= 1) {
+            log.info("{}计划创建不足,剩余需要创建个数{},使用历史遗漏素材创建", strategy.getAccountId(), remindCnt);
+            //优先创建历史遗漏素材
+            remindCnt = this.createCreative(strategy, 3, remindCnt);
+        }
+        if (remindCnt >= 1) {
+            log.info("{}计划创建不足,剩余需要创建个数{},使用高质量素材创建", strategy.getAccountId(), remindCnt);
+            //高质量素材
+            remindCnt = this.createCreative(strategy, 2, remindCnt);
+        }
+        if (remindCnt >= 1) {
+            //历史打捞素材
+            log.info("{}计划创建不足,剩余需要创建个数{},使用历史打捞素材创建", strategy.getAccountId(), remindCnt);
+            this.createCreative(strategy, 4, remindCnt);
+        }
+    }
 
 
 }

+ 8 - 4
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/ByteDanceAdvertisePlanServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.bytedance.advertise.service.impl;
 
+import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -16,10 +17,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Slf4j
 @Service
@@ -210,6 +208,12 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         return this.list(queryWrapper);
     }
 
+    @Override
+    public int queryToDayBuiltCount(Long accountId) {
+        String date = DateUtil.formatDate(new Date());
+        return byteDanceAdvertisePlanMapper.queryTodayBuiltCount(accountId, date);
+    }
+
     private Map<String, Object> queryAdByAdId(CtopOauthToken token, Long accountId, List<Long> adId){
 
         Map<String, String> headers = new HashMap<>();

+ 14 - 2
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/BytedanceImageInfoServiceImpl.java

@@ -1,12 +1,14 @@
 package org.jeecg.modules.bytedance.advertise.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.bytedance.advertise.entity.BytedanceImageInfo;
 import org.jeecg.modules.bytedance.advertise.mapper.BytedanceImageInfoMapper;
 import org.jeecg.modules.bytedance.advertise.service.IBytedanceImageInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.jeecg.modules.bytedance.common.utils.Check;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.List;
 
 /**
@@ -17,7 +19,7 @@ import java.util.List;
  */
 @Service
 public class BytedanceImageInfoServiceImpl extends ServiceImpl<BytedanceImageInfoMapper, BytedanceImageInfo> implements IBytedanceImageInfoService {
-    @Autowired
+    @Resource
     private BytedanceImageInfoMapper imageInfoMapper;
     @Override
     public void replaceBatch(List<BytedanceImageInfo> videoInfoList) {
@@ -29,4 +31,14 @@ public class BytedanceImageInfoServiceImpl extends ServiceImpl<BytedanceImageInf
         imageInfoMapper.updateImageVerticalType();
         imageInfoMapper.updateImageHorizonType();
     }
+
+    @Override
+    public BytedanceImageInfo getByParams(String imageCode) {
+        QueryWrapper<BytedanceImageInfo> queryWrapper = new QueryWrapper<>();
+        if(!Check.isNull(imageCode)){
+            queryWrapper.eq("signature",imageCode);
+        }
+        queryWrapper.orderByDesc("image_create_time").last("limit 1");
+        return this.getOne(queryWrapper);
+    }
 }

+ 3 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/service/IFileInfoService.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.bytedance.common.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
 import org.jeecg.modules.bytedance.common.entity.FileInfo;
 
 import java.util.Map;
@@ -21,4 +22,6 @@ public interface IFileInfoService extends IService<FileInfo> {
      * @return
      */
     Map<String, Object> uploadImageToBytedance(String accountId, String imageFileId);
+
+    String getSuggestImageId(CtopOauthToken token, String vid);
 }

+ 47 - 3
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/service/impl/FileInfoServiceImpl.java

@@ -1,14 +1,19 @@
 package org.jeecg.modules.bytedance.common.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.modules.bytedance.advertise.dockapi.Marketing;
+import org.jeecg.modules.bytedance.advertise.entity.BytedanceImageInfo;
+import org.jeecg.modules.bytedance.advertise.service.IBytedanceImageInfoService;
 import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
 import org.jeecg.modules.bytedance.common.entity.FileInfo;
 import org.jeecg.modules.bytedance.common.mapper.FileInfoMapper;
 import org.jeecg.modules.bytedance.common.service.ICtopOauthTokenService;
 import org.jeecg.modules.bytedance.common.service.IFileInfoService;
+import org.jeecg.modules.bytedance.common.utils.ResultMapUtils;
+import org.jeecg.modules.bytedance.common.utils.StatusCode;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
@@ -43,16 +48,55 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
         Map<String, Object> resultMap = new HashMap<>();
         try {
             CtopOauthToken token = ctopOauthTokenService.getOauthTokenByAccountId(accountId);
-            JSONObject jsonObject = Marketing.imageUpload(token, String.valueOf(token.getAccountId()), imageUrl);
-            log.info("头条上传图片素材返回信息:{},accountId:{}", jsonObject, accountId);
+            JSONObject result = Marketing.imageUpload(token, imageUrl);
+            if(null == result){
+                ResultMapUtils.setResultMap(resultMap, StatusCode.BYTEDANCE_IMAGE_UPLOAD_ERROR);
+                return resultMap;
+            }
+            Integer code = result.getInteger("code");
+            String message = result.getString("message");
+            if(code!=0){
+                resultMap.put("message",message);
+                resultMap.put("code",code);
+                resultMap.put("success",false);
+                return resultMap;
+            }
+            JSONObject data = result.getJSONObject("data");
+            BytedanceImageInfo imageInfo = new BytedanceImageInfo(data,token);
+            bytedanceImageInfoService.saveOrUpdate(imageInfo);
+            resultMap.put("data",imageInfo);
+            ResultMapUtils.setResultMap(resultMap,StatusCode.COMMON_SUCCESS);
+            return resultMap;
         } catch (Exception e) {
             log.error("头条上传图片文件失败,accountId:{}", accountId);
             log.error(e.getMessage(), e);
+            ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SERVER_ERROR);
+            return resultMap;
         }
+    }
+
+    @Override
+    public String getSuggestImageId(CtopOauthToken token, String vid) {
+        String result = null;
+        for(int i=0;i<3;i++){
+            JSONObject resultObject = Marketing.getSuggestImageId(token, vid);
+            if(null!=resultObject||null!=resultObject.getInteger("code")||0!=resultObject.getInteger("code")){
+                continue;
+            }
+            JSONObject data = resultObject.getJSONObject("data");
+            String status = data.getString("status");
+            if(null!=status&&status.equals("SUCCESS")){
+                JSONArray array  = data.getJSONArray("list");
+                JSONObject imageInfo = array.getJSONObject(0);
+                return imageInfo.getString("id");
+            }
+        }
+        return result;
 
-        return resultMap;
     }
 
+    @Autowired
+    private IBytedanceImageInfoService bytedanceImageInfoService;
 
 
 }

+ 2 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/utils/StatusCode.java

@@ -64,6 +64,8 @@ public enum StatusCode {
     KUAISHOU_AI_STRATEGY_HAS_NOT_EXIST("账户策略未配置或者已经被关闭",-6001,false),
     KUAISHOU_AI_STRATEGY_HAS_NO_HISTORY_MATERIAL("历史素材不存在",-6002,false),
 
+    BYTEDANCE_IMAGE_UPLOAD_ERROR("头条图片素材上传异常",-7001,false),
+
     KUAISHOU_CRAWLER_APP_SUCCESS("爬虫运行正常", 0, true),
     KUAISHOU_CRAWLER_APP_TASK_END("爬虫任务运行结束", 1, true),
     KUAISHOU_CRAWLER_APP_JOB_StART("任务开始执行开始", 0, true),

+ 20 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/bytedance/advertise/controller/AiBytedanceAdvertiserStrategyController.java

@@ -3,13 +3,12 @@ package org.jeecg.modules.bytedance.advertise.controller;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.bytedance.advertise.entity.AiBytedanceAdvertiserStrategy;
 import org.jeecg.modules.bytedance.advertise.entity.RuleDataAccount;
 import org.jeecg.modules.bytedance.advertise.entity.UpdAdStaOrCpaOrBudget;
@@ -21,15 +20,18 @@ import org.jeecg.modules.bytedance.advertise.vo.PlanSearchVo;
 import org.jeecg.modules.bytedance.common.constant.BytedanceConstant;
 import org.jeecg.modules.bytedance.common.entity.MaterialImageInfo;
 import org.jeecg.modules.bytedance.common.service.IMaterialImageInfoService;
-import org.jeecg.modules.bytedance.common.service.impl.MaterialImageInfoServiceImpl;
 import org.jeecg.modules.bytedance.common.utils.Check;
+import org.jeecg.modules.bytedance.common.utils.ResultMapUtils;
+import org.jeecg.modules.bytedance.common.utils.StatusCode;
 import org.jeecg.modules.system.service.ISysRoleService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 头条智能投放账户配置信息表
@@ -296,6 +298,19 @@ public class AiBytedanceAdvertiserStrategyController {
 		}
 	}
 
+	@GetMapping("testCreateCreativeLimit")
+	public Map<String, Object> testCreateCreativeLimit(Long accountId, Integer hour) {
+		Map<String, Object> result = new HashMap<>();
+		AiBytedanceAdvertiserStrategy strategy = aiBytedanceAdvertiserStrategyService.getByAccountId(accountId,1);
+		if (strategy == null) {
+			ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+			return result;
+		}
+		aiBytedanceAdvertiserStrategyService.customCreativeSupplement(strategy, hour);
+		ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+		return result;
+	}
+
 
 
 

+ 0 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/SmsSendMsgHandle.java

@@ -8,7 +8,6 @@ public class SmsSendMsgHandle implements ISendMsgHandle {
 
 	@Override
 	public void SendMsg(String es_receiver, String es_title, String es_content) {
-		// TODO Auto-generated method stub
 		log.info("发短信");
 	}
 

+ 0 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/WxSendMsgHandle.java

@@ -7,7 +7,6 @@ public class WxSendMsgHandle implements ISendMsgHandle {
 
 	@Override
 	public void SendMsg(String es_receiver, String es_title, String es_content) {
-		// TODO Auto-generated method stub
 		log.info("发微信消息模板");
 	}
 

+ 9 - 13
jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/websocket/WebSocket.java

@@ -1,8 +1,11 @@
 package org.jeecg.modules.message.websocket;
 
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArraySet;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.base.BaseMap;
+import org.jeecg.common.constant.WebsocketConst;
+import org.jeecg.common.modules.redis.client.JeecgRedisClient;
+import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
 import javax.websocket.OnClose;
@@ -11,15 +14,9 @@ import javax.websocket.OnOpen;
 import javax.websocket.Session;
 import javax.websocket.server.PathParam;
 import javax.websocket.server.ServerEndpoint;
-
-import org.jeecg.common.base.BaseMap;
-import org.jeecg.common.constant.WebsocketConst;
-import org.jeecg.common.modules.redis.client.JeecgRedisClient;
-import org.springframework.stereotype.Component;
-
-import com.alibaba.fastjson.JSONObject;
-
-import lombok.extern.slf4j.Slf4j;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CopyOnWriteArraySet;
 
 /**
  * @Author scott
@@ -102,7 +99,6 @@ public class WebSocket {
 
     @OnMessage
     public void onMessage(String message) {
-        //todo 现在有个定时任务刷,应该去掉
         log.debug("【websocket消息】收到客户端消息:" + message);
         JSONObject obj = new JSONObject();
         //业务类型