|
@@ -104,9 +104,14 @@ public class KuaiShouMaterialControer {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 历史素材
|
|
|
|
+ *
|
|
|
|
+ * @param requestJson
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
@PostMapping(value = "/getHistoryVideoList")
|
|
@PostMapping(value = "/getHistoryVideoList")
|
|
public JSONObject getHistoryVideoList(@RequestBody JSONObject requestJson) {
|
|
public JSONObject getHistoryVideoList(@RequestBody JSONObject requestJson) {
|
|
- System.err.println(requestJson);
|
|
|
|
JSONObject returnJson = new JSONObject();
|
|
JSONObject returnJson = new JSONObject();
|
|
try {
|
|
try {
|
|
if (Check.isNull(requestJson)) {
|
|
if (Check.isNull(requestJson)) {
|
|
@@ -116,8 +121,6 @@ public class KuaiShouMaterialControer {
|
|
if (Check.isNull(accountId)) {
|
|
if (Check.isNull(accountId)) {
|
|
throw new Exception("账户id不能为空");
|
|
throw new Exception("账户id不能为空");
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
String startDate = requestJson.getString("startDate");
|
|
String startDate = requestJson.getString("startDate");
|
|
if (Check.isNull(startDate)) {
|
|
if (Check.isNull(startDate)) {
|
|
throw new Exception("请输入开始查询时间");
|
|
throw new Exception("请输入开始查询时间");
|
|
@@ -127,17 +130,14 @@ public class KuaiShouMaterialControer {
|
|
if (Check.isNull(endDate)) {
|
|
if (Check.isNull(endDate)) {
|
|
throw new Exception("请输入结束查询时间");
|
|
throw new Exception("请输入结束查询时间");
|
|
}
|
|
}
|
|
-
|
|
|
|
Integer createCount = requestJson.getInteger("createCount");
|
|
Integer createCount = requestJson.getInteger("createCount");
|
|
if (Check.isNull(createCount) || createCount == 0) {
|
|
if (Check.isNull(createCount) || createCount == 0) {
|
|
throw new Exception("请输入最小关联数");
|
|
throw new Exception("请输入最小关联数");
|
|
}
|
|
}
|
|
-
|
|
|
|
Integer num = requestJson.getInteger("num");
|
|
Integer num = requestJson.getInteger("num");
|
|
if (Check.isNull(num) || num == 0) {
|
|
if (Check.isNull(num) || num == 0) {
|
|
throw new Exception("请输入查询条数");
|
|
throw new Exception("请输入查询条数");
|
|
}
|
|
}
|
|
-
|
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
requestMap.put("startTime", startDate);
|
|
requestMap.put("startTime", startDate);
|
|
requestMap.put("endTime", endDate);
|
|
requestMap.put("endTime", endDate);
|
|
@@ -174,6 +174,12 @@ public class KuaiShouMaterialControer {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 历史Top素材
|
|
|
|
+ *
|
|
|
|
+ * @param requestJson
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
@PostMapping(value = "/getHistoryTopVideoList")
|
|
@PostMapping(value = "/getHistoryTopVideoList")
|
|
public JSONObject getHistoryTopVideoList(@RequestBody JSONObject requestJson) {
|
|
public JSONObject getHistoryTopVideoList(@RequestBody JSONObject requestJson) {
|
|
JSONObject returnJson = new JSONObject();
|
|
JSONObject returnJson = new JSONObject();
|
|
@@ -185,35 +191,75 @@ public class KuaiShouMaterialControer {
|
|
if (Check.isNull(accountId)) {
|
|
if (Check.isNull(accountId)) {
|
|
throw new Exception("账户id不能为空");
|
|
throw new Exception("账户id不能为空");
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
- String startDate = requestJson.getString("startDate");
|
|
|
|
|
|
+ String startDate = requestJson.getString("startTime");
|
|
if (Check.isNull(startDate)) {
|
|
if (Check.isNull(startDate)) {
|
|
throw new Exception("请输入开始查询时间");
|
|
throw new Exception("请输入开始查询时间");
|
|
}
|
|
}
|
|
-
|
|
|
|
- String endDate = requestJson.getString("endDate");
|
|
|
|
|
|
+ String endDate = requestJson.getString("endTime");
|
|
if (Check.isNull(endDate)) {
|
|
if (Check.isNull(endDate)) {
|
|
throw new Exception("请输入结束查询时间");
|
|
throw new Exception("请输入结束查询时间");
|
|
}
|
|
}
|
|
-
|
|
|
|
- Integer createCount = requestJson.getInteger("createCount");
|
|
|
|
- if (Check.isNull(createCount) || createCount == 0) {
|
|
|
|
- throw new Exception("请输入最小关联数");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
Integer num = requestJson.getInteger("num");
|
|
Integer num = requestJson.getInteger("num");
|
|
if (Check.isNull(num) || num == 0) {
|
|
if (Check.isNull(num) || num == 0) {
|
|
throw new Exception("请输入查询条数");
|
|
throw new Exception("请输入查询条数");
|
|
}
|
|
}
|
|
-
|
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
- requestMap.put("startTime", startDate);
|
|
|
|
- requestMap.put("endTime", endDate);
|
|
|
|
|
|
+ requestMap.put("startDate", startDate);
|
|
|
|
+ requestMap.put("endDate", endDate);
|
|
requestMap.put("accountId", accountId);
|
|
requestMap.put("accountId", accountId);
|
|
requestMap.put("num", num);
|
|
requestMap.put("num", num);
|
|
- requestMap.put("createCount", createCount);
|
|
|
|
- List<JSONObject> materialList = relateCreativesService.getVideoListByMap(requestMap);
|
|
|
|
|
|
+ List<JSONObject> materialList = relateCreativesService.getHistoryTopVideoList(requestMap);
|
|
|
|
+ if (!Check.isNull(materialList)) {
|
|
|
|
+ for (int i = 0; i < materialList.size(); i++) {
|
|
|
|
+ JSONObject materialJson = materialList.get(i);
|
|
|
|
+ String signature = materialJson.getString("signature");
|
|
|
|
+ List<String> imageList = lastTimeService.getImageListByMd5(signature);
|
|
|
|
+ materialJson.put("imageList", imageList);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ returnJson.put("code", 0);
|
|
|
|
+ returnJson.put("message", "SUCCESS");
|
|
|
|
+ returnJson.put("data", materialList);
|
|
|
|
+ } else {
|
|
|
|
+ returnJson.put("code", -1);
|
|
|
|
+ returnJson.put("message", "暂未历史爆量素材");
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ returnJson.put("code", -1);
|
|
|
|
+ returnJson.put("message", e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ return returnJson;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 关联创意数为0素材
|
|
|
|
+ *
|
|
|
|
+ * @param requestJson
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping(value = "/getCreateZeroVideoList")
|
|
|
|
+ public JSONObject getHistoryCreateVideoList(@RequestBody JSONObject requestJson) {
|
|
|
|
+ JSONObject returnJson = new JSONObject();
|
|
|
|
+ try {
|
|
|
|
+ if (Check.isNull(requestJson)) {
|
|
|
|
+ throw new Exception("入参不能为空");
|
|
|
|
+ }
|
|
|
|
+ Long accountId = requestJson.getLong("accountId");
|
|
|
|
+ if (Check.isNull(accountId)) {
|
|
|
|
+ throw new Exception("账户id不能为空");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Integer videoCnt = requestJson.getInteger("videoCnt");
|
|
|
|
+ if (Check.isNull(videoCnt)) {
|
|
|
|
+ throw new Exception("请输入查询条数");
|
|
|
|
+ }
|
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
|
+ requestMap.put("accountId", accountId);
|
|
|
|
+ requestMap.put("creativeCount", 0);
|
|
|
|
+ requestMap.put("videoCnt", videoCnt);
|
|
|
|
+ List<JSONObject> materialList = relateCreativesService.getVideoZeroListByMap(requestMap);
|
|
if (!Check.isNull(materialList)) {
|
|
if (!Check.isNull(materialList)) {
|
|
for (int i = 0; i < materialList.size(); i++) {
|
|
for (int i = 0; i < materialList.size(); i++) {
|
|
JSONObject materialJson = materialList.get(i);
|
|
JSONObject materialJson = materialList.get(i);
|
|
@@ -232,7 +278,7 @@ public class KuaiShouMaterialControer {
|
|
returnJson.put("data", materialList);
|
|
returnJson.put("data", materialList);
|
|
} else {
|
|
} else {
|
|
returnJson.put("code", -1);
|
|
returnJson.put("code", -1);
|
|
- returnJson.put("message", "暂未新上素材");
|
|
|
|
|
|
+ returnJson.put("message", "暂未关联创意数为0素材");
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|