|
@@ -1,37 +1,34 @@
|
|
|
package org.jeecg.ctop.material.controller;
|
|
|
|
|
|
-import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
|
|
-import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.github.pagehelper.PageInfo;
|
|
|
-import com.google.gson.JsonObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.poi.hssf.usermodel.*;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFCell;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFFont;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
|
|
-import org.apache.poi.ss.usermodel.Workbook;
|
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.ctop.material.constants.Check;
|
|
|
import org.jeecg.ctop.material.entity.vo.KuaiShouOperateAccountVo;
|
|
|
-import org.jeecg.ctop.material.entity.vo.KuaiShouOperateGroupVo;
|
|
|
import org.jeecg.ctop.material.entity.vo.KuaiShouOperateProjectVo;
|
|
|
import org.jeecg.ctop.material.mapper.MaterialStareMapper;
|
|
|
import org.jeecg.ctop.material.service.MaterialStareService;
|
|
|
-import org.jeecg.ctop.material.service.impl.MaterialStareServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.BufferedOutputStream;
|
|
|
import java.io.OutputStream;
|
|
|
-import java.lang.reflect.Field;
|
|
|
import java.net.URLEncoder;
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
* 快手-运营数据盯盘-经理&个人
|
|
@@ -51,273 +48,243 @@ public class KuaiShouMaterialStareController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
- * @description:数据总览-快手
|
|
|
- *
|
|
|
* @param mediaType 媒体类型 1-头条 2-快手
|
|
|
- * @param type 查询类型 1-汇总 2-运营个人
|
|
|
+ * @param type 查询类型 1-汇总 2-运营个人
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param userId
|
|
|
+ * @description:数据总览-快手
|
|
|
* @author: zianY
|
|
|
* @time: 2022/2/15
|
|
|
*/
|
|
|
@GetMapping("/kuaiShousumData")
|
|
|
- public Result<JSONObject> kuaiShousumData(@RequestParam(name="mediaType") String mediaType,
|
|
|
- @RequestParam(name="type") String type,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="userId") String userId) {
|
|
|
+ public Result<JSONObject> kuaiShousumData(@RequestParam(name = "mediaType") String mediaType,
|
|
|
+ @RequestParam(name = "type") String type,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "userId") String userId) {
|
|
|
return materialStareService.kuaiShousumData(mediaType, type, startTime, endTime, userId);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
- * @description: 快手-运营组数据
|
|
|
- *
|
|
|
* @param mediaType 媒体类型 1-头条 2-快手
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param userId
|
|
|
+ * @description: 快手-运营组数据
|
|
|
* @return: org.jeecg.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
|
|
* @author: zianY
|
|
|
* @time: 2022/2/15
|
|
|
*/
|
|
|
@GetMapping("/kuaiShouOperateDateTotal")
|
|
|
- public Result<JSONObject> kuaiShouOperateDateTotal(@RequestParam(name="mediaType") String mediaType,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="userId") String userId) {
|
|
|
+ public Result<JSONObject> kuaiShouOperateDateTotal(@RequestParam(name = "mediaType") String mediaType,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "userId") String userId) {
|
|
|
|
|
|
return materialStareService.kuaiShouOperateDateTotal(mediaType, startTime, endTime, userId);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
- * @description: 运营数据详情
|
|
|
- *
|
|
|
* @param pageNum
|
|
|
* @param pageSize
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param userId
|
|
|
+ * @description: 运营数据详情
|
|
|
* @return: org.jeecg.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
|
|
* @author: zianY
|
|
|
* @time: 2022/2/16
|
|
|
*/
|
|
|
@GetMapping("/getKuaiShouOperateInfo")
|
|
|
- public Result<JSONObject> getKuaiShouOperateInfo(@RequestParam(name="pageNum",defaultValue = "1") Integer pageNum,
|
|
|
- @RequestParam(name="pageSize",defaultValue = "5") int pageSize,
|
|
|
- @RequestParam(name="mediaType") String mediaType,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="userId") String userId) {
|
|
|
- return materialStareService.getKuaiShouOperateInfo(pageNum, pageSize,mediaType,startTime, endTime, userId);
|
|
|
+ public Result<JSONObject> getKuaiShouOperateInfo(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "5") int pageSize,
|
|
|
+ @RequestParam(name = "mediaType") String mediaType,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "userId") String userId) {
|
|
|
+ return materialStareService.getKuaiShouOperateInfo(pageNum, pageSize, mediaType, startTime, endTime, userId);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/exportKuaiShouOperateInfo")
|
|
|
- public Result<JSONObject> exportKuaiShouOperateInfo(@RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="userId") String userId,
|
|
|
- @RequestParam(name="mediaType") String mediaType,
|
|
|
+ public Result<JSONObject> exportKuaiShouOperateInfo(@RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "userId") String userId,
|
|
|
+ @RequestParam(name = "mediaType") String mediaType,
|
|
|
HttpServletResponse response) {
|
|
|
- return materialStareService.exportKuaiShouOperateInfo(startTime, endTime, mediaType,userId,response);
|
|
|
+ return materialStareService.exportKuaiShouOperateInfo(startTime, endTime, mediaType, userId, response);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
- * @description:运营数据-项目列表
|
|
|
- *
|
|
|
* @param pageNum
|
|
|
* @param pageSize
|
|
|
* @param mediaType 媒体类型 1-头条 2-快手
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param userId
|
|
|
+ * @description:运营数据-项目列表
|
|
|
* @return: org.jeecg.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
|
|
* @author: zianY
|
|
|
* @time: 2022/2/17
|
|
|
*/
|
|
|
@GetMapping("/getKuaiShouOperateProjectInfo")
|
|
|
- public Result<JSONObject> getKuaiShouOperateProjectInfo(@RequestParam(name="pageNum",defaultValue = "1") Integer pageNum,
|
|
|
- @RequestParam(name="pageSize",defaultValue = "10") int pageSize,
|
|
|
- @RequestParam(name="mediaType",defaultValue = "2") String mediaType,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="userId") String userId) {
|
|
|
-
|
|
|
- return materialStareService.getKuaiShouOperateProjectInfo(pageNum, pageSize,mediaType,startTime, endTime, userId);
|
|
|
+ public Result<JSONObject> getKuaiShouOperateProjectInfo(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") int pageSize,
|
|
|
+ @RequestParam(name = "mediaType", defaultValue = "2") String mediaType,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "userId") String userId) {
|
|
|
+
|
|
|
+ return materialStareService.getKuaiShouOperateProjectInfo(pageNum, pageSize, mediaType, startTime, endTime, userId);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- *
|
|
|
- * @description:运营数据-账户列表
|
|
|
- *
|
|
|
* @param pageNum
|
|
|
* @param pageSize
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param projectId
|
|
|
* @param userId
|
|
|
+ * @description:运营数据-账户列表
|
|
|
* @return: org.jeecg.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
|
|
* @author: zianY
|
|
|
* @time: 2022/2/18
|
|
|
*/
|
|
|
@GetMapping("/getKuaiShouOperateAccountInfo")
|
|
|
- public Result<JSONObject> getKuaiShouOperateAccountInfo(@RequestParam(name="pageNum",defaultValue = "1") Integer pageNum,
|
|
|
- @RequestParam(name="pageSize",defaultValue = "1000") int pageSize,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="projectId",required = false) String projectId,
|
|
|
- @RequestParam(name="userId") String userId) {
|
|
|
+ public Result<JSONObject> getKuaiShouOperateAccountInfo(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "1000") int pageSize,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "projectId", required = false) String projectId,
|
|
|
+ @RequestParam(name = "userId") String userId) {
|
|
|
|
|
|
|
|
|
- return materialStareService.getKuaiShouOperateAccountInfo(pageNum, pageSize,startTime, endTime,projectId, userId);
|
|
|
+ return materialStareService.getKuaiShouOperateAccountInfo(pageNum, pageSize, startTime, endTime, projectId, userId);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
- * @description: 查询账户余额 以及 账户状态 和 消耗
|
|
|
- *
|
|
|
* @param accountId
|
|
|
+ * @description: 查询账户余额 以及 账户状态 和 消耗
|
|
|
* @return: org.jeecg.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
|
|
* @author: zianY
|
|
|
* @time: 2022/2/21 14:39
|
|
|
*/
|
|
|
@GetMapping("/getKuaiShouAccountInfo")
|
|
|
- public Result<JSONObject> getKuaiShouAccountInfo(@RequestParam(name="accountId") long accountId) {
|
|
|
+ public Result<JSONObject> getKuaiShouAccountInfo(@RequestParam(name = "accountId") long accountId) {
|
|
|
return materialStareService.getKuaiShouAccountInfo(accountId);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
- * @description: 账户 折线图 查询时间为当天查询时报;查询时间为多天 查询日报
|
|
|
- *
|
|
|
* @param accountId
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
+ * @description: 账户 折线图 查询时间为当天查询时报;查询时间为多天 查询日报
|
|
|
* @return: org.jeecg.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
|
|
* @author: zianY
|
|
|
* @time: 2022/2/21
|
|
|
*/
|
|
|
@GetMapping("/getKuaiShouAccountInfoBrokenLine")
|
|
|
- public Result<JSONObject> getKuaiShouAccountInfoBrokenLine(@RequestParam(name="accountId") long accountId,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="type") String type) {
|
|
|
- return materialStareService.getKuaiShouAccountInfoBrokenLine(accountId,startTime,endTime,type);
|
|
|
+ public Result<JSONObject> getKuaiShouAccountInfoBrokenLine(@RequestParam(name = "accountId") long accountId,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "type") String type) {
|
|
|
+ return materialStareService.getKuaiShouAccountInfoBrokenLine(accountId, startTime, endTime, type);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- *
|
|
|
- * @description: 快手 账户 素材上新-有效-爆款
|
|
|
- *
|
|
|
* @param accountId
|
|
|
* @param searchType searchType:查询类型 0-全部 1-上新 2-有效 3-爆款
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
+ * @description: 快手 账户 素材上新-有效-爆款
|
|
|
* @return: org.jeecg.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
|
|
* @author: zianY
|
|
|
* @time: 2022/2/21
|
|
|
*/
|
|
|
@GetMapping("/getKuaiShouAccountMaterialNewAndEffectAndFaddish")
|
|
|
- public Result<JSONObject> getKuaiShouAccountMaterialNewAndEffectAndFaddish(@RequestParam(name="accountId") long accountId,
|
|
|
- @RequestParam(name="searchType") String searchType,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="pageNum",defaultValue = "1") Integer pageNum,
|
|
|
- @RequestParam(name="pageSize",defaultValue = "10") Integer pageSize) {
|
|
|
- return materialStareService.getKuaiShouAccountMaterialNewAndEffectAndFaddish(accountId,searchType,startTime,endTime,pageNum,pageSize);
|
|
|
+ public Result<JSONObject> getKuaiShouAccountMaterialNewAndEffectAndFaddish(@RequestParam(name = "accountId") long accountId,
|
|
|
+ @RequestParam(name = "searchType") String searchType,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
+ return materialStareService.getKuaiShouAccountMaterialNewAndEffectAndFaddish(accountId, searchType, startTime, endTime, pageNum, pageSize);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- *
|
|
|
- * @description: 查询账户饼图数据信息 分版位;年龄;性别
|
|
|
- *
|
|
|
* @param accountId
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
- * @param type 查询类型 额。。。 查询选中的指标 --、 给前端组装数据格式 I didn't want to write
|
|
|
+ * @param type 查询类型 额。。。 查询选中的指标 --、 给前端组装数据格式 I didn't want to write
|
|
|
+ * @description: 查询账户饼图数据信息 分版位;年龄;性别
|
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
|
* @author: zianY
|
|
|
* @time: 2022/2/22
|
|
|
*/
|
|
|
@GetMapping("/getKuaiShouAccountPieChar")
|
|
|
- public Result getKuaiShouAccountPieChar(@RequestParam(name="accountId") long accountId,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="type") String type) {
|
|
|
- return materialStareService.getKuaiShouAccountPieChar(accountId,startTime,endTime,type);
|
|
|
+ public Result getKuaiShouAccountPieChar(@RequestParam(name = "accountId") long accountId,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "type") String type) {
|
|
|
+ return materialStareService.getKuaiShouAccountPieChar(accountId, startTime, endTime, type);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
- *
|
|
|
- * @description:数据总览-快手-运营个人
|
|
|
- *
|
|
|
* @param mediaType 媒体类型 1-头条 2-快手
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param userId
|
|
|
+ * @description:数据总览-快手-运营个人
|
|
|
* @author: zianY
|
|
|
* @time: 2022/2/15
|
|
|
*/
|
|
|
@GetMapping("/kuaiShousumDataPersonal")
|
|
|
- public Result<JSONObject> kuaiShousumDataPersonal(@RequestParam(name="mediaType",defaultValue = "2") String mediaType,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="userId") String userId) {
|
|
|
+ public Result<JSONObject> kuaiShousumDataPersonal(@RequestParam(name = "mediaType", defaultValue = "2") String mediaType,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "userId") String userId) {
|
|
|
return materialStareService.kuaiShousumDataPersonal(mediaType, startTime, endTime, userId);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
- * @description: 运营个人数据
|
|
|
- *
|
|
|
* @param mediaType 媒体类型 1-头条 2-快手
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param userId
|
|
|
+ * @description: 运营个人数据
|
|
|
* @return: org.jeecg.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
|
|
* @author: zianY
|
|
|
* @time: 2022/3/3
|
|
|
*/
|
|
|
@GetMapping("/kuaiShouOperateDateTotalPersonal")
|
|
|
- public Result<JSONObject> kuaiShouOperateDateTotalPersonal(@RequestParam(name="mediaType") String mediaType,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="userId") String userId) {
|
|
|
+ public Result<JSONObject> kuaiShouOperateDateTotalPersonal(@RequestParam(name = "mediaType") String mediaType,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "userId") String userId) {
|
|
|
|
|
|
return materialStareService.kuaiShouOperateDateTotalPersonal(mediaType, startTime, endTime, userId);
|
|
|
}
|
|
|
|
|
|
|
|
|
@GetMapping("/realTime/getUnitDateInfo")
|
|
|
- public Result<JSONObject> kuaiShouOperateDateTotalPersonal(@RequestParam(name="accountId") long accountId,
|
|
|
- @RequestParam(name="pageNum") Integer pageNum,
|
|
|
- @RequestParam(name="pageSize") Integer pageSize) {
|
|
|
+ public Result<JSONObject> kuaiShouOperateDateTotalPersonal(@RequestParam(name = "accountId") long accountId,
|
|
|
+ @RequestParam(name = "pageNum") Integer pageNum,
|
|
|
+ @RequestParam(name = "pageSize") Integer pageSize) {
|
|
|
|
|
|
return materialStareService.kuaiShouRealTimeUnitDateInfo(accountId, pageNum, pageSize);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 获取用户下级的项目以及账户信息
|
|
|
*
|
|
@@ -325,47 +292,43 @@ public class KuaiShouMaterialStareController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping(value = "/participateListByMediaIdAllSubordinate")
|
|
|
- public Result<List<JSONObject>> participateListByMediaIdAllSubordinate(@RequestParam(name="userId") String userId,
|
|
|
- @RequestParam(name="type") String type) {
|
|
|
+ public Result<List<JSONObject>> participateListByMediaIdAllSubordinate(@RequestParam(name = "userId") String userId,
|
|
|
+ @RequestParam(name = "type") String type) {
|
|
|
JSONObject requestJson = new JSONObject();
|
|
|
- requestJson.put("userId",userId);
|
|
|
- requestJson.put("type",type);
|
|
|
+ requestJson.put("userId", userId);
|
|
|
+ requestJson.put("type", type);
|
|
|
return materialStareService.participateListByMediaIdAllSubordinate(requestJson);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
//获取当前用户所属公司的所有下级
|
|
|
@GetMapping("/getCompanyAllSubordinateByUserId")
|
|
|
- public Result getCompanyAllSubordinateByUserId(@RequestParam(name="userId") String userId) {
|
|
|
- return materialStareService.getCompanyAllSubordinateByUserId(userId);
|
|
|
+ public Result getCompanyAllSubordinateByUserId(@RequestParam(name = "userId") String userId) {
|
|
|
+ return materialStareService.getCompanyAllSubordinateByUserId(userId);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
@GetMapping("/exportKuaiShouOperateProjectInfo")
|
|
|
public Result<JSONObject> exportKuaiShouOperateProjectInfo(
|
|
|
- @RequestParam(name="mediaType") String mediaType,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="userId") String userId,HttpServletResponse response) {
|
|
|
+ @RequestParam(name = "mediaType") String mediaType,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "userId") String userId, HttpServletResponse response) {
|
|
|
|
|
|
try {
|
|
|
+
|
|
|
//默认
|
|
|
- JSONObject jsonObject = materialStareMapper.getColumnInfo("e9ca23d68d884d4ebb19d07889727dae","3001");
|
|
|
- if (Check.isNull(jsonObject)){
|
|
|
+ JSONObject jsonObject = null;
|
|
|
+ if ("2".equals(mediaType)) {
|
|
|
+ jsonObject = materialStareMapper.getColumnInfo("e9ca23d68d884d4ebb19d07889727dae", "3001");
|
|
|
+ } else {
|
|
|
+ jsonObject = materialStareMapper.getColumnInfo("e9ca23d68d884d4ebb19d07889727dae", "3002");
|
|
|
+ }
|
|
|
+ if (Check.isNull(jsonObject)) {
|
|
|
return Result.errorMsg("暂无自定义列。");
|
|
|
}
|
|
|
JSONArray array = jsonObject.getJSONArray("json");
|
|
|
- //第一步创建workbook
|
|
|
+ //第一步创建workbook
|
|
|
HSSFWorkbook wb = new HSSFWorkbook();
|
|
|
//设置样式
|
|
|
HSSFCellStyle style = wb.createCellStyle();
|
|
@@ -377,50 +340,50 @@ public class KuaiShouMaterialStareController {
|
|
|
style.setFont(font);
|
|
|
//2:创建sheet 设置sheet名称
|
|
|
HSSFSheet sheet = wb.createSheet("项目数据");
|
|
|
- sheet.autoSizeColumn(0,true);
|
|
|
+ sheet.autoSizeColumn(0, true);
|
|
|
//3:添加 第一行单元格
|
|
|
HSSFRow row0 = sheet.createRow(0);
|
|
|
HSSFCell cell0 = row0.createCell(0);
|
|
|
//设置 第一行 表头
|
|
|
cell0.setCellValue("项目数据");
|
|
|
- CellRangeAddress region = new CellRangeAddress(0, 0, 0, array.size()-1);
|
|
|
+ CellRangeAddress region = new CellRangeAddress(0, 0, 0, array.size() - 1);
|
|
|
sheet.addMergedRegion(region);//合并行
|
|
|
cell0.setCellStyle(style);
|
|
|
//4:添加表头2行
|
|
|
HSSFRow row = sheet.createRow(1);
|
|
|
//5:创建第2行的单元格
|
|
|
- for (int i = 0;i < array.size(); i++) {
|
|
|
- JSONObject json = (JSONObject)array.get(i);
|
|
|
+ for (int i = 0; i < array.size(); i++) {
|
|
|
+ JSONObject json = (JSONObject) array.get(i);
|
|
|
HSSFCell cell = row.createCell(i); //第一个单元格
|
|
|
cell.setCellValue(json.getString("title")); //设定值
|
|
|
cell.setCellStyle(style); //内容居中
|
|
|
}
|
|
|
|
|
|
- List< KuaiShouOperateProjectVo > resultList = materialStareService.exportKuaiShouOperateProjectInfo(mediaType,startTime, endTime, userId);
|
|
|
+ List<KuaiShouOperateProjectVo> resultList = materialStareService.exportKuaiShouOperateProjectInfo(mediaType, startTime, endTime, userId);
|
|
|
|
|
|
for (int j = 0; j < resultList.size(); j++) {
|
|
|
KuaiShouOperateProjectVo projectVo = resultList.get(j);
|
|
|
//分版位
|
|
|
- if (!Check.isNull(projectVo.getAdSceneDate())){
|
|
|
+ if (!Check.isNull(projectVo.getAdSceneDate())) {
|
|
|
for (JSONObject jObj : projectVo.getAdSceneDate()) {
|
|
|
- String name = jObj.get("adSceneName")+"";
|
|
|
- if (name.contains("激励")){
|
|
|
- projectVo.setJiLishiPin(jObj.get("adSceneCost")+"");
|
|
|
+ String name = jObj.get("adSceneName") + "";
|
|
|
+ if (name.contains("激励")) {
|
|
|
+ projectVo.setJiLishiPin(jObj.get("adSceneCost") + "");
|
|
|
}
|
|
|
- if (name.contains("开屏")){
|
|
|
- projectVo.setKaiPing(jObj.get("adSceneCost")+"");
|
|
|
+ if (name.contains("开屏")) {
|
|
|
+ projectVo.setKaiPing(jObj.get("adSceneCost") + "");
|
|
|
}
|
|
|
- if (name.contains("搜索")){
|
|
|
- projectVo.setSouSuo(jObj.get("adSceneCost")+"");
|
|
|
+ if (name.contains("搜索")) {
|
|
|
+ projectVo.setSouSuo(jObj.get("adSceneCost") + "");
|
|
|
}
|
|
|
- if (name.contains("上下")){
|
|
|
- projectVo.setShangXiaHua(jObj.get("adSceneCost")+"");
|
|
|
+ if (name.contains("上下")) {
|
|
|
+ projectVo.setShangXiaHua(jObj.get("adSceneCost") + "");
|
|
|
}
|
|
|
- if (name.contains("联盟")){
|
|
|
- projectVo.setLianMeng(jObj.get("adSceneCost")+"");
|
|
|
+ if (name.contains("联盟")) {
|
|
|
+ projectVo.setLianMeng(jObj.get("adSceneCost") + "");
|
|
|
}
|
|
|
- if (name.contains("信息流")){
|
|
|
- projectVo.setXinxiLiu(jObj.get("adSceneCost")+"");
|
|
|
+ if (name.contains("信息流")) {
|
|
|
+ projectVo.setXinxiLiu(jObj.get("adSceneCost") + "");
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -430,11 +393,11 @@ public class KuaiShouMaterialStareController {
|
|
|
|
|
|
//创建行 (表头占0-1行 所以 从 2开始)
|
|
|
row = sheet.createRow(j + 2);
|
|
|
- for (int k =0;k < array.size();k++) {
|
|
|
- JSONObject json = (JSONObject)array.get(k);
|
|
|
+ for (int k = 0; k < array.size(); k++) {
|
|
|
+ JSONObject json = (JSONObject) array.get(k);
|
|
|
String fieldName = KuaiShouOperateProjectVo.class.getDeclaredField(json.getString("dataIndex")).getName();
|
|
|
project.get(fieldName);
|
|
|
- row.createCell(k).setCellValue(project.get(fieldName)+"");
|
|
|
+ row.createCell(k).setCellValue(project.get(fieldName) + "");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -451,26 +414,26 @@ public class KuaiShouMaterialStareController {
|
|
|
bufferedOutPut.close();
|
|
|
output.close();
|
|
|
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- return null;
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
@GetMapping("/exportKuaiShouOperateAccountInfo")
|
|
|
- public Result<JSONObject> exportKuaiShouOperateAccountInfo(@RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="projectId") String projectId,
|
|
|
- @RequestParam(name="userId") String userId,HttpServletResponse response) {
|
|
|
+ public Result<JSONObject> exportKuaiShouOperateAccountInfo(@RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "projectId") String projectId,
|
|
|
+ @RequestParam(name = "userId") String userId, HttpServletResponse response) {
|
|
|
|
|
|
try {
|
|
|
- JSONObject jsonObject = materialStareMapper.getColumnInfo(userId,"102");
|
|
|
- if (Check.isNull(jsonObject)){
|
|
|
+ JSONObject jsonObject = materialStareMapper.getColumnInfo(userId, "102");
|
|
|
+ if (Check.isNull(jsonObject)) {
|
|
|
return Result.errorMsg("暂无自定义列。");
|
|
|
}
|
|
|
JSONArray array = jsonObject.getJSONArray("json");
|
|
|
- //第一步创建workbook
|
|
|
+ //第一步创建workbook
|
|
|
HSSFWorkbook wb = new HSSFWorkbook();
|
|
|
//设置样式
|
|
|
HSSFCellStyle style = wb.createCellStyle();
|
|
@@ -482,27 +445,27 @@ public class KuaiShouMaterialStareController {
|
|
|
style.setFont(font);
|
|
|
//2:创建sheet 设置sheet名称
|
|
|
HSSFSheet sheet = wb.createSheet("账户数据");
|
|
|
- sheet.autoSizeColumn(0,true);
|
|
|
+ sheet.autoSizeColumn(0, true);
|
|
|
//3:添加 第一行单元格
|
|
|
HSSFRow row0 = sheet.createRow(0);
|
|
|
HSSFCell cell0 = row0.createCell(0);
|
|
|
//设置 第一行 表头
|
|
|
cell0.setCellValue("账户数据");
|
|
|
- CellRangeAddress region = new CellRangeAddress(0, 0, 0, array.size()-1);
|
|
|
+ CellRangeAddress region = new CellRangeAddress(0, 0, 0, array.size() - 1);
|
|
|
sheet.addMergedRegion(region);//合并行
|
|
|
cell0.setCellStyle(style);
|
|
|
//4:添加表头2行
|
|
|
HSSFRow row = sheet.createRow(1);
|
|
|
//5:创建第2行的单元格
|
|
|
- for (int i = 0;i < array.size(); i++) {
|
|
|
- JSONObject json = (JSONObject)array.get(i);
|
|
|
+ for (int i = 0; i < array.size(); i++) {
|
|
|
+ JSONObject json = (JSONObject) array.get(i);
|
|
|
HSSFCell cell = row.createCell(i); //第一个单元格
|
|
|
cell.setCellValue(json.getString("title")); //设定值
|
|
|
cell.setCellStyle(style); //内容居中
|
|
|
|
|
|
}
|
|
|
|
|
|
- List<KuaiShouOperateAccountVo> resultList = materialStareService.exportKuaiShouOperateAccountInfo(startTime, endTime, projectId,userId);
|
|
|
+ List<KuaiShouOperateAccountVo> resultList = materialStareService.exportKuaiShouOperateAccountInfo(startTime, endTime, projectId, userId);
|
|
|
|
|
|
for (int j = 0; j < resultList.size(); j++) {
|
|
|
KuaiShouOperateAccountVo accountVo = resultList.get(j);
|
|
@@ -510,8 +473,8 @@ public class KuaiShouMaterialStareController {
|
|
|
|
|
|
//创建行 (表头占0-1行 所以 从 2开始)
|
|
|
row = sheet.createRow(j + 2);
|
|
|
- for (int k =0;k < array.size();k++) {
|
|
|
- JSONObject json = (JSONObject)array.get(k);
|
|
|
+ for (int k = 0; k < array.size(); k++) {
|
|
|
+ JSONObject json = (JSONObject) array.get(k);
|
|
|
String fieldName = KuaiShouOperateAccountVo.class.getDeclaredField(json.getString("dataIndex")).getName();
|
|
|
account.get(fieldName);
|
|
|
row.createCell(k).setCellValue(account.get(fieldName).toString());
|
|
@@ -531,50 +494,45 @@ public class KuaiShouMaterialStareController {
|
|
|
bufferedOutPut.close();
|
|
|
output.close();
|
|
|
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- return null;
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 运营组列表数据
|
|
|
+ *
|
|
|
* @param pageNum
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getOperationGroupData")
|
|
|
public Result<JSONObject> getOperationGroupData(
|
|
|
- @RequestParam(name="userId") String userId,
|
|
|
- @RequestParam(name="mediaType") String mediaType,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,
|
|
|
- @RequestParam(name="pageNum",defaultValue = "1") Integer pageNum,
|
|
|
- @RequestParam(name="pageSize",defaultValue = "5") Integer pageSize) {
|
|
|
-
|
|
|
- return materialStareService.getOperationGroupData(userId,mediaType,startTime,endTime, pageNum, pageSize);
|
|
|
+ @RequestParam(name = "userId") String userId,
|
|
|
+ @RequestParam(name = "mediaType") String mediaType,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime,
|
|
|
+ @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "5") Integer pageSize) {
|
|
|
+
|
|
|
+ return materialStareService.getOperationGroupData(userId, mediaType, startTime, endTime, pageNum, pageSize);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 运营组列表数据-导出
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/exportOperationGroupData")
|
|
|
- public Result exportOperationGroupData(@RequestParam(name="userId") String userId,@RequestParam(name="mediaType") String mediaType,
|
|
|
- @RequestParam(name="startTime") String startTime,
|
|
|
- @RequestParam(name="endTime") String endTime,HttpServletResponse response) {
|
|
|
+ public Result exportOperationGroupData(@RequestParam(name = "userId") String userId, @RequestParam(name = "mediaType") String mediaType,
|
|
|
+ @RequestParam(name = "startTime") String startTime,
|
|
|
+ @RequestParam(name = "endTime") String endTime, HttpServletResponse response) {
|
|
|
|
|
|
- return materialStareService.exportOperationGroupData(userId,mediaType,startTime,endTime,response);
|
|
|
+ return materialStareService.exportOperationGroupData(userId, mediaType, startTime, endTime, response);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|