Преглед на файлове

批量2.0添加程序化

zhaoxian преди 3 години
родител
ревизия
83244abb63

+ 3 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouGroupTemplateController.java

@@ -110,16 +110,14 @@ public class KuaiShouGroupTemplateController {
      * @return
      */
     @GetMapping(value = "/getApiCreateCount")
-    public Result<Integer> getApiCreateCount(Long accountId) {
-        Result<Integer> result = new Result<>();
+    public Result<Object> getApiCreateCount(Long accountId) {
+        Result<Object> result = new Result<>();
         try {
             if (Check.isNull(accountId)) {
                 throw new Exception("accountId参数不能为空");
             }
             String date = DateUtils.getNowDate("yyyy-MM-dd");
-            Integer count = kuaiShouGroupTemplateService.getApiCreateCount(accountId, date);
-            result.setSuccess(true);
-            result.setResult(count);
+            return kuaiShouGroupTemplateService.getApiCreateCount(accountId, date);
         } catch (Exception e) {
             e.printStackTrace();
             result.setSuccess(false);

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouGroupTemplateMapper.java

@@ -18,9 +18,9 @@ public interface KuaiShouGroupTemplateMapper extends BaseMapper<KuaiShouGroupTem
 
     JSONObject getMd5ByPhotoId(@Param("photoId") String photoId);
 
-    List<JSONObject> getImageListByMd5(@Param("md5") String md5,@Param("imageCount") Integer imageCount);
+    List<JSONObject> getImageListByMd5(@Param("md5") String md5, @Param("imageCount") Integer imageCount);
 
-    Integer getApiCreateCount(@Param("accountId") Long accountId, @Param("date") String date);
+    Integer getApiCreateCount(@Param("accountId") Long accountId, @Param("date") String date, @Param("unitType") Integer unitType);
 
     JSONObject getUrlByPhotoId(@Param("photoId") String photoId);
 

+ 6 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupTemplateMapper.xml

@@ -31,11 +31,12 @@
 
 
     <select id="getApiCreateCount" resultType="java.lang.Integer">
-    select count(1)
-    from
-    ctop_kuaishou_creative
-    where  account_id = #{accountId}
-    and DATE_FORMAT(creative_create_time,'%Y-%m-%d') = #{date}
+        select count(1)
+        from
+            ctop_kuaishou_group
+        where  account_id = #{accountId}
+          and unit_type = #{unitType}
+          and DATE_FORMAT(group_create_time,'%Y-%m-%d') =  #{date}
     </select>
 
     <select id="getUrlByPhotoId" resultType="com.alibaba.fastjson.JSONObject">

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

@@ -3,6 +3,7 @@ package cn.com.ctop.kuaishou.modules.batch.service;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroupTemplate;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
 
 import java.util.List;
 
@@ -24,7 +25,7 @@ public interface IKuaiShouGroupTemplateService extends IService<KuaiShouGroupTem
      * @param accountId
      * @return
      */
-    Integer getApiCreateCount(Long accountId, String date);
+    Result<Object> getApiCreateCount(Long accountId, String date);
 
     /**
      * 通过photoId 获取 url

+ 11 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupTemplateServiceImpl.java

@@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.Lists;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -603,8 +604,16 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
      * @return
      */
     @Override
-    public Integer getApiCreateCount(Long accountId, String date) {
-        return groupTemplateMapper.getApiCreateCount(accountId, date);
+    public Result<Object> getApiCreateCount(Long accountId, String date) {
+        //自定义
+        Integer ctmCount = groupTemplateMapper.getApiCreateCount(accountId, date, 4);
+        //程序化
+        Integer pgdCount = groupTemplateMapper.getApiCreateCount(accountId, date, 7);
+        JSONObject obj = new JSONObject();
+        obj.put("ctmCount", ctmCount);
+        obj.put("pgdCount", pgdCount);
+        return Result.ok(obj);
+
     }
 
     /**