yumeng 5 vuotta sitten
vanhempi
commit
63ad9343de

+ 39 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/MaterialRefuseController.java

@@ -0,0 +1,39 @@
+package cn.com.ctop.kuaishou.modules.batch.controller;
+
+import cn.com.ctop.kuaishou.modules.batch.service.IMaterialRefuseService;
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/MaterialRefuse")
+public class MaterialRefuseController {
+    @Autowired
+    private IMaterialRefuseService materialRefuseService;
+
+
+    @PostMapping(value = "/getRefuseCreative")
+    public Map<String, Object> getRefuseCreative(@RequestBody JSONObject jsonObject) {
+        Map<String, Object> map = new HashMap<>();
+        try {
+            List<JSONObject> list = materialRefuseService.getRefuseCreative(jsonObject.getLong("accountId"));
+            map.put("code", 0);
+            map.put("data", list);
+        } catch (Exception e) {
+            map.put("code", -1);
+            e.printStackTrace();
+        }
+
+
+        return map;
+    }
+
+
+}

+ 9 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/MaterialRefuseMapper.java

@@ -0,0 +1,9 @@
+package cn.com.ctop.kuaishou.modules.batch.mapper;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+
+public interface MaterialRefuseMapper {
+    List<JSONObject> selectRefuseCreativeByAccountId(Long accountId);
+}

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

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.MaterialRefuseMapper">
+
+    <select id="selectRefuseCreativeByAccountId" resultType="com.alibaba.fastjson.JSONObject">
+        select
+         t1.account_id accountId,
+         t1.campaign_id campaignId,
+         t1.unit_id unitId,
+         t1.creative_id creativeId,
+         t1.creative_name creativeName,
+         t2.url videoUrl,
+         t1.cover_url coverUrl,
+         t1.review_detail reviewDetail,
+         t1.description description
+    from
+        ctop_kuaishou_creative t1
+       left join ctop_kuaishou_video_get t2
+       on t1.account_id = t2.account_id
+       and t1.photo_id = t2.photo_id
+       where  t1.account_id = #{accountId}
+       and status = 42
+    </select>
+
+
+</mapper>

+ 10 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IMaterialRefuseService.java

@@ -0,0 +1,10 @@
+package cn.com.ctop.kuaishou.modules.batch.service;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface IMaterialRefuseService {
+    List<JSONObject> getRefuseCreative(@Param("accountId") Long accountId);
+}

+ 24 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/MaterialRefuseServiceImpl.java

@@ -0,0 +1,24 @@
+package cn.com.ctop.kuaishou.modules.batch.service.impl;
+
+import cn.com.ctop.kuaishou.modules.batch.mapper.MaterialRefuseMapper;
+import cn.com.ctop.kuaishou.modules.batch.service.IMaterialRefuseService;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Slf4j
+@Service
+public class MaterialRefuseServiceImpl implements IMaterialRefuseService {
+    @Autowired
+    private MaterialRefuseMapper materialRefuseMapper;
+
+
+    @Override
+    public List<JSONObject> getRefuseCreative(Long accountId) {
+        List<JSONObject> refuseCreativeList = materialRefuseMapper.selectRefuseCreativeByAccountId(accountId);
+        return refuseCreativeList;
+    }
+}