|
@@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
@@ -127,7 +128,6 @@ public class KuaiShouVideoGetController {
|
|
|
if (Check.isNull(orderBy)) {
|
|
|
throw new Exception("请传入排序方式");
|
|
|
}
|
|
|
-
|
|
|
List<KuaiShouVideoGetVo> list = new ArrayList<>();
|
|
|
PageHelper.startPage(pageNo, pageSize);
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
@@ -167,6 +167,140 @@ public class KuaiShouVideoGetController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/getBatchV2VideoList")
|
|
|
+ public Result<PageInfo<KuaiShouVideoGetVo>> getBatchV2VideoList(Long accountId,
|
|
|
+ String startDate,
|
|
|
+ String endDate,
|
|
|
+ String signatures,
|
|
|
+ Long photoId,
|
|
|
+ String photoName,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Result<PageInfo<KuaiShouVideoGetVo>> result = new Result<>();
|
|
|
+ try {
|
|
|
+ if (Check.isNull(accountId)) {
|
|
|
+ throw new Exception("请传入账户id");
|
|
|
+ }
|
|
|
+ PageHelper.startPage(pageNo, pageSize);
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ requestMap.put("accountId", accountId);
|
|
|
+
|
|
|
+ if (!Check.isNull(signatures)) {
|
|
|
+ String[] signatureArray = signatures.split(",");
|
|
|
+ requestMap.put("signatureList", signatureArray);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
|
|
|
+ requestMap.put("startDate", startDate);
|
|
|
+ requestMap.put("endDate", endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Check.isNull(photoId)) {
|
|
|
+ requestMap.put("photoId", photoId);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Check.isNull(photoName)) {
|
|
|
+ requestMap.put("photoName", photoName);
|
|
|
+ }
|
|
|
+ List<KuaiShouVideoGetVo> list = kuaiShouReportDailyMaterialService.getBatchV2VideoList(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());
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping(value = "/getVideoListByCostType")
|
|
|
+ public Result<PageInfo<KuaiShouVideoGetVo>> getBatchV2VideoList(Long accountId,
|
|
|
+ Long photoId,
|
|
|
+ String photoName,
|
|
|
+ Integer costType,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Result<PageInfo<KuaiShouVideoGetVo>> result = new Result<>();
|
|
|
+ try {
|
|
|
+ if (Check.isNull(accountId)) {
|
|
|
+ throw new Exception("请传入账户id");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Check.isNull(costType)) {
|
|
|
+ throw new Exception("请传入数据类型");
|
|
|
+ }
|
|
|
+
|
|
|
+ PageHelper.startPage(pageNo, pageSize);
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ requestMap.put("accountId", accountId);
|
|
|
+
|
|
|
+ if (!Check.isNull(photoId)) {
|
|
|
+ requestMap.put("photoId", photoId);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Check.isNull(photoName)) {
|
|
|
+ requestMap.put("photoName", photoName);
|
|
|
+ }
|
|
|
+ List<KuaiShouVideoGetVo> list = new ArrayList<>();
|
|
|
+ if (costType == 1) { // 昨日数据
|
|
|
+ String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
+ String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
|
|
|
+ Integer date = Integer.valueOf(anotherDay.replace("-", ""));
|
|
|
+ requestMap.put("date", date);
|
|
|
+ list = kuaiShouReportDailyMaterialService.getYesterdayVideo(requestMap);
|
|
|
+ } else if (costType == 2) { // 近七天
|
|
|
+ list = kuaiShouReportDailyMaterialService.get7dayVideo(requestMap);
|
|
|
+ } else if (costType == 3) { // 近14天
|
|
|
+ list = kuaiShouReportDailyMaterialService.get14dayVideo(requestMap);
|
|
|
+ } else if (costType == 4) { // 近30天
|
|
|
+ list = kuaiShouReportDailyMaterialService.get30dayVideo(requestMap);
|
|
|
+ } else if (costType == 5) { // 近3个月
|
|
|
+ String endMonth = DateUtils.getNowDate("yyyy-MM");
|
|
|
+ String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
+ String startMonthStr = DateUtils.addMonth(nowDate, -2);
|
|
|
+ String startMonth = DateUtils.formatDate(startMonthStr, "yyyy-MM");
|
|
|
+ requestMap.put("startMonth", Integer.valueOf(startMonth.replace("-", "")));
|
|
|
+ requestMap.put("endMonth", Integer.valueOf(endMonth.replace("-", "")));
|
|
|
+ kuaiShouReportDailyMaterialService.get3MonthVideo(requestMap);
|
|
|
+ } else if (costType == 6) { // 近6个月
|
|
|
+ String endMonth = DateUtils.getNowDate("yyyy-MM");
|
|
|
+ String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
+ String startMonthStr = DateUtils.addMonth(nowDate, -5);
|
|
|
+ String startMonth = DateUtils.formatDate(startMonthStr, "yyyy-MM");
|
|
|
+ requestMap.put("startMonth", Integer.valueOf(startMonth.replace("-", "")));
|
|
|
+ requestMap.put("endMonth", Integer.valueOf(endMonth.replace("-", "")));
|
|
|
+ kuaiShouReportDailyMaterialService.get3MonthVideo(requestMap);
|
|
|
+ } else if (costType == 7) { // 近12个月
|
|
|
+ String endMonth = DateUtils.getNowDate("yyyy-MM");
|
|
|
+ String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
+ String startMonthStr = DateUtils.addMonth(nowDate, -11);
|
|
|
+ String startMonth = DateUtils.formatDate(startMonthStr, "yyyy-MM");
|
|
|
+ requestMap.put("startMonth", Integer.valueOf(startMonth.replace("-", "")));
|
|
|
+ requestMap.put("endMonth", Integer.valueOf(endMonth.replace("-", "")));
|
|
|
+ kuaiShouReportDailyMaterialService.get3MonthVideo(requestMap);
|
|
|
+ } else if (costType == 8) { // 全部
|
|
|
+ kuaiShouReportDailyMaterialService.get3MonthVideo(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());
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public static Map<String, Object> parseJSON2Map(String jsonStr) {
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
JSONObject json = JSONObject.parseObject(jsonStr);
|