Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

syh 4 anni fa
parent
commit
7b512ff7fb

+ 51 - 30
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouVideoGetController.java

@@ -82,41 +82,62 @@ public class KuaiShouVideoGetController {
 
 
     @GetMapping(value = "/getVideoList")
-    public PageInfo<KuaiShouVideoGetVo> getVideoList(Long accountId,
-                                                     String startDate,
-                                                     String endDate,
-                                                     String materialType,
-                                                     String channelType,
-                                                     String orderBy,
-                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                     HttpServletRequest req) {
+    public Result<PageInfo<KuaiShouVideoGetVo>> getVideoList(Long accountId,
+                                                             String startDate,
+                                                             String endDate,
+                                                             String materialType,
+                                                             String channelType,
+                                                             String orderBy,
+                                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                             HttpServletRequest req) {
 
 
-        List<KuaiShouVideoGetVo> list = new ArrayList<>();
-        PageHelper.startPage(pageNo, pageSize);
-        Map<String, Object> requestMap = new HashMap<>();
-        requestMap.put("accountId", accountId);
-        requestMap.put("orderBy", orderBy);
-        requestMap.put("materialType", materialType);
-        requestMap.put("channelType", channelType);
-        if (orderBy.equals("time")) {
-            if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
-                requestMap.put("startDate", startDate + " 00:00:00");
-                requestMap.put("endDate", endDate + " 59:59:59");
+        Result<PageInfo<KuaiShouVideoGetVo>> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("请传入账户id");
             }
-
-            list = kuaiShouVideoGetService.getVideoList(requestMap);
-
-        } else if (orderBy.equals("cost")) {
-            if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
-                requestMap.put("startDate", startDate);
-                requestMap.put("endDate", endDate);
+            if (Check.isNull(materialType)) {
+                throw new Exception("请传入素材类型");
+            }
+            if (Check.isNull(channelType)) {
+                throw new Exception("请传入素材渠道");
+            }
+            if (Check.isNull(orderBy)) {
+                throw new Exception("请传入排序方式");
+            }
+            List<KuaiShouVideoGetVo> list = new ArrayList<>();
+            PageHelper.startPage(pageNo, pageSize);
+            Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("accountId", accountId);
+            requestMap.put("orderBy", orderBy);
+            requestMap.put("materialType", materialType);
+            requestMap.put("channelType", channelType);
+            if (orderBy.equals("time")) {
+                if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
+                    requestMap.put("startDate", startDate + " 00:00:00");
+                    requestMap.put("endDate", endDate + " 59:59:59");
+                }
+                list = kuaiShouVideoGetService.getVideoList(requestMap);
+            } else if (orderBy.equals("cost")) {
+                if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
+                    requestMap.put("startDate", startDate);
+                    requestMap.put("endDate", endDate);
+                }
+                list = kuaiShouReportDailyMaterialService.getVideoList(requestMap);
             }
-            list = kuaiShouReportDailyMaterialService.getVideoList(requestMap);
+            PageInfo<KuaiShouVideoGetVo> pageInfo = new PageInfo<>(list);
+            result.setSuccess(true);
+            result.setResult(pageInfo);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
         }
-        PageInfo<KuaiShouVideoGetVo> pageInfo = new PageInfo<>(list);
-        return pageInfo;
+
+
+        return result;
 
     }
 

+ 70 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/vo/KuaiShouVideoGetVo.java

@@ -3,6 +3,7 @@ package cn.com.ctop.kuaishou.modules.batch.entity.vo;
 import io.swagger.annotations.ApiModelProperty;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 
 /**
@@ -12,7 +13,7 @@ import java.math.BigDecimal;
  * @Version: V1.0
  */
 
-public class KuaiShouVideoGetVo {
+public class KuaiShouVideoGetVo implements Serializable {
 
     private BigDecimal charge;
     private String statDate;
@@ -44,4 +45,72 @@ public class KuaiShouVideoGetVo {
     private Integer materialType;
 
 
+    public BigDecimal getCharge() {
+        return charge;
+    }
+
+    public void setCharge(BigDecimal charge) {
+        this.charge = charge;
+    }
+
+    public String getStatDate() {
+        return statDate;
+    }
+
+    public void setStatDate(String statDate) {
+        this.statDate = statDate;
+    }
+
+    public String getPhotoId() {
+        return photoId;
+    }
+
+    public void setPhotoId(String photoId) {
+        this.photoId = photoId;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getCoverUrl() {
+        return coverUrl;
+    }
+
+    public void setCoverUrl(String coverUrl) {
+        this.coverUrl = coverUrl;
+    }
+
+    public String getSignature() {
+        return signature;
+    }
+
+    public void setSignature(String signature) {
+        this.signature = signature;
+    }
+
+    public Integer getMaterialType() {
+        return materialType;
+    }
+
+    public void setMaterialType(Integer materialType) {
+        this.materialType = materialType;
+    }
+
+    @Override
+    public String toString() {
+        return "KuaiShouVideoGetVo{" +
+                "charge=" + charge +
+                ", statDate='" + statDate + '\'' +
+                ", photoId='" + photoId + '\'' +
+                ", url='" + url + '\'' +
+                ", coverUrl='" + coverUrl + '\'' +
+                ", signature='" + signature + '\'' +
+                ", materialType=" + materialType +
+                '}';
+    }
 }

+ 35 - 26
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml

@@ -147,32 +147,41 @@
     <select id="getVideoList" parameterType="java.util.Map"
             resultType="cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo">
 
-    SELECT
-    sum(t1.charge) as charge,
-	t1.photo_id AS photoId,
-	t1.photo_url AS url,
-	t1.cover_url AS coverUrl,
-	t1.signature AS signature,
-	t2.material_type AS materialType
-    FROM
-	ctop_kuaishou_report_daily_material t1
-    LEFT JOIN (
-	SELECT
-		material_type,
-		signature
-	FROM
-		ctop_kuaishou_video_get
-	WHERE
-		account_id = #{accountId} group by signature) t2
-		ON t1.signature = t2.signature
-	WHERE
-		t1.account_id = #{accountId}
-	AND t1.channel_type = #{channelType}
-	AND t2.material_type = #{materialType}
-	GROUP BY
-		signature
-	ORDER BY
-		sum(t1.charge) DESC
+        SELECT
+        sum(t1.charge) as 'charge',
+        t1.photo_id AS 'photoId',
+        t1.photo_url AS 'url',
+        t1.cover_url AS 'coverUrl',
+        t1.signature AS 'signature',
+        t2.material_type AS 'materialType'
+        FROM
+        ctop_kuaishou_report_daily_material t1
+        LEFT JOIN (
+        SELECT
+        material_type,
+        signature,
+        status
+        FROM
+        ctop_kuaishou_video_get
+        WHERE
+        account_id = #{accountId} group by signature) t2
+        ON t1.signature = t2.signature
+        WHERE
+        t1.account_id = #{accountId}
+        AND t1.channel_type = #{channelType}
+        AND t2.material_type = #{materialType}
+        AND t2.status = 0
+        <if test="startDate != null and startDate != '' ">
+            and t1.stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and t1.stat_date &lt;= #{endDate}
+        </if>
+
+        GROUP BY
+        signature
+        ORDER BY
+        sum(t1.charge) DESC
     </select>
 
 

+ 8 - 7
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml

@@ -36,16 +36,17 @@
     <select id="getVideoList" parameterType="java.util.Map"
             resultType="cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo">
         select
-        stat_date as statDate,
-        photo_id as photoId,
-        url as url,
-        cover_url as coverUrl,
-        signature as signature,
-        material_type as materialType
+        stat_date as 'statDate',
+        photo_id as 'photoId',
+        url as 'url',
+        cover_url as 'coverUrl',
+        signature as 'signature',
+        material_type as 'materialType'
         from ctop_kuaishou_video_get
         where account_id = #{accountId}
         and channel_type = #{channelType}
-        and material_type = ${materialType}
+        and material_type = #{materialType}
+        and status = 0
         <if test="startDate != null and startDate != '' ">
             and stat_date &gt;= #{startDate}
         </if>

+ 0 - 1
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatDepartmentServiceImpl.java

@@ -47,7 +47,6 @@ public class WechatDepartmentServiceImpl extends ServiceImpl<WechatDepartmentMap
             params.put("access_token", qywxAccessToken.get("accessToken"));
             String resultStr = HttpUtils.httpGetRequest(QYWxConstant.QYWX_DEPART_LIST, null, params);
             JSONObject resultJson = JSONObject.parseObject(resultStr);
-            System.err.println(resultJson);
             Integer errcode = resultJson.getInteger("errcode");
             if (errcode == 0) {
                 JSONArray department = resultJson.getJSONArray("department");

+ 0 - 2
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatNoListServiceImpl.java

@@ -74,10 +74,8 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
             StringBuffer buf = new StringBuffer();
             //批量获取审批单号 URL
             buf.append(QYWxConstant.APP_ROVAL_INFO).append("?access_token=").append(getToken());
-            System.err.println(buf.toString());
             String resultStr = HttpUtils.httpPostRequestTest(buf.toString(), params.toJSONString(), null);
             JSONObject resultJson = JSONObject.parseObject(resultStr);
-            System.err.println(resultJson);
             Integer errcode = resultJson.getInteger("errcode");
             if (errcode == 0) {
                 return resultJson;