|
@@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -75,9 +74,9 @@ public class FirstDeliveryValidController {
|
|
|
|
|
|
@GetMapping(value = "/projectData")
|
|
@GetMapping(value = "/projectData")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public Result<Object> projectData(String date,Integer pageSize,Integer pageNo) {
|
|
|
|
|
|
+ public Result<Object> projectData(String date, Integer pageSize, Integer pageNo) {
|
|
try {
|
|
try {
|
|
- return firstDeliveryValidService.projectData(date,pageSize,pageNo);
|
|
|
|
|
|
+ return firstDeliveryValidService.projectData(date, pageSize, pageNo);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
return Result.error("导入EXCEL失败," + e.getMessage());
|
|
return Result.error("导入EXCEL失败," + e.getMessage());
|
|
@@ -99,9 +98,9 @@ public class FirstDeliveryValidController {
|
|
|
|
|
|
@GetMapping(value = "/getTotalData")
|
|
@GetMapping(value = "/getTotalData")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public Result<Object> getTotalData(String date,Integer pageSize,Integer pageNo) {
|
|
|
|
|
|
+ public Result<Object> getTotalData(String date, Integer pageSize, Integer pageNo) {
|
|
try {
|
|
try {
|
|
- return firstDeliveryValidService.getTotalData(date,pageSize,pageNo);
|
|
|
|
|
|
+ return firstDeliveryValidService.getTotalData(date, pageSize, pageNo);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
return Result.error("导入EXCEL失败," + e.getMessage());
|
|
return Result.error("导入EXCEL失败," + e.getMessage());
|
|
@@ -122,10 +121,17 @@ public class FirstDeliveryValidController {
|
|
String year = split[0];
|
|
String year = split[0];
|
|
Integer month = Integer.valueOf(split[1]);
|
|
Integer month = Integer.valueOf(split[1]);
|
|
List<JSONObject> projectInfo = firstDeliveryValidService.getDataForProject(year, month.toString());
|
|
List<JSONObject> projectInfo = firstDeliveryValidService.getDataForProject(year, month.toString());
|
|
- List<JSONObject> clipInfo = firstDeliveryValidService.getDataForClip(year, month.toString());
|
|
|
|
|
|
+ //剪辑
|
|
|
|
+ List<JSONObject> clipInfo = firstDeliveryValidService.getDataForUserType(year, month.toString(), "clip_id");
|
|
|
|
+ //拍摄
|
|
|
|
+ List<JSONObject> shotInfo = firstDeliveryValidService.getDataForUserType(year, month.toString(), "shot_id");
|
|
|
|
+ //编导
|
|
|
|
+ List<JSONObject> planInfo = firstDeliveryValidService.getDataForUserType(year, month.toString(), "plan_id");
|
|
try {
|
|
try {
|
|
List<List<Object>> projectExcelList = new ArrayList<>();
|
|
List<List<Object>> projectExcelList = new ArrayList<>();
|
|
List<List<Object>> clipExcelList = new ArrayList<>();
|
|
List<List<Object>> clipExcelList = new ArrayList<>();
|
|
|
|
+ List<List<Object>> shotExcelList = new ArrayList<>();
|
|
|
|
+ List<List<Object>> planExcelList = new ArrayList<>();
|
|
if (!projectInfo.isEmpty()) {
|
|
if (!projectInfo.isEmpty()) {
|
|
projectInfo.forEach(data -> {
|
|
projectInfo.forEach(data -> {
|
|
List<Object> temp = new ArrayList<>();
|
|
List<Object> temp = new ArrayList<>();
|
|
@@ -146,30 +152,9 @@ public class FirstDeliveryValidController {
|
|
projectExcelList.add(temp);
|
|
projectExcelList.add(temp);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- if (!clipInfo.isEmpty()) {
|
|
|
|
- clipInfo.forEach(data -> {
|
|
|
|
- List<Object> temp = new ArrayList<>();
|
|
|
|
- temp.add(data.getString("projectName"));
|
|
|
|
- temp.add(data.getString("leaderName"));
|
|
|
|
- temp.add(data.getString("projectLeader"));
|
|
|
|
- temp.add(data.getString("clipName"));
|
|
|
|
- temp.add(data.getString("shotName"));
|
|
|
|
- temp.add(data.getString("planName"));
|
|
|
|
- temp.add(data.getString("designLeader"));
|
|
|
|
- temp.add(data.getString("rebateType"));
|
|
|
|
- temp.add(data.getString("settlement1l"));
|
|
|
|
- temp.add(data.getString("settlement2l"));
|
|
|
|
- temp.add(data.getBigDecimal("materialCount"));
|
|
|
|
- temp.add(data.getBigDecimal("validMaterials"));
|
|
|
|
- if (data.getBigDecimal("validRatioValue").compareTo(data.getBigDecimal("materialValidRatioValue")) < 0) {
|
|
|
|
- temp.add(data.getString("validRatio") + "-GREEN");
|
|
|
|
- } else {
|
|
|
|
- temp.add(data.getString("validRatio") + "-G");
|
|
|
|
- }
|
|
|
|
- temp.add(data.getString("materialValidRatio"));
|
|
|
|
- clipExcelList.add(temp);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ getExcelInfo(clipInfo, clipExcelList);
|
|
|
|
+ getExcelInfo(shotInfo, shotExcelList);
|
|
|
|
+ getExcelInfo(planInfo, planExcelList);
|
|
OutputStream os = response.getOutputStream();
|
|
OutputStream os = response.getOutputStream();
|
|
ExportExcelUtils eeu = new ExportExcelUtils();
|
|
ExportExcelUtils eeu = new ExportExcelUtils();
|
|
XSSFWorkbook workbook = new XSSFWorkbook();
|
|
XSSFWorkbook workbook = new XSSFWorkbook();
|
|
@@ -178,8 +163,10 @@ public class FirstDeliveryValidController {
|
|
String[] overtimeTitles = {"项目名称", "项目设计负责人", "项目运营负责人", "剪辑", "拍摄", "编导", "设计leader", "政策类型", "一级行业",
|
|
String[] overtimeTitles = {"项目名称", "项目设计负责人", "项目运营负责人", "剪辑", "拍摄", "编导", "设计leader", "政策类型", "一级行业",
|
|
"二级行业", "素材首投量", "有效素材首投量", "有效率", "媒体考核有效率"};
|
|
"二级行业", "素材首投量", "有效素材首投量", "有效率", "媒体考核有效率"};
|
|
eeu.exportExcelForFirstDelivery(workbook, 0, "分项目", titles, projectExcelList);
|
|
eeu.exportExcelForFirstDelivery(workbook, 0, "分项目", titles, projectExcelList);
|
|
- eeu.exportExcelForFirstDelivery(workbook, 1, "分设计", overtimeTitles, clipExcelList);
|
|
|
|
- HttpUtils.setResponseHeader(response, "clockIn.xlsx");
|
|
|
|
|
|
+ eeu.exportExcelForFirstDelivery(workbook, 1, "分剪辑", overtimeTitles, clipExcelList);
|
|
|
|
+ eeu.exportExcelForFirstDelivery(workbook, 2, "分拍摄", overtimeTitles, shotExcelList);
|
|
|
|
+ eeu.exportExcelForFirstDelivery(workbook, 3, "分编导", overtimeTitles, planExcelList);
|
|
|
|
+ HttpUtils.setResponseHeader(response, "data.xlsx");
|
|
workbook.write(os);
|
|
workbook.write(os);
|
|
os.flush();
|
|
os.flush();
|
|
os.close();
|
|
os.close();
|
|
@@ -188,4 +175,31 @@ public class FirstDeliveryValidController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void getExcelInfo(List<JSONObject> info, List<List<Object>> excelList) {
|
|
|
|
+ if (!info.isEmpty()) {
|
|
|
|
+ info.forEach(data -> {
|
|
|
|
+ List<Object> temp = new ArrayList<>();
|
|
|
|
+ temp.add(data.getString("projectName"));
|
|
|
|
+ temp.add(data.getString("leaderName"));
|
|
|
|
+ temp.add(data.getString("projectLeader"));
|
|
|
|
+ temp.add(data.getString("clipName"));
|
|
|
|
+ temp.add(data.getString("shotName"));
|
|
|
|
+ temp.add(data.getString("planName"));
|
|
|
|
+ temp.add(data.getString("designLeader"));
|
|
|
|
+ temp.add(data.getString("rebateType"));
|
|
|
|
+ temp.add(data.getString("settlement1l"));
|
|
|
|
+ temp.add(data.getString("settlement2l"));
|
|
|
|
+ temp.add(data.getBigDecimal("materialCount"));
|
|
|
|
+ temp.add(data.getBigDecimal("validMaterials"));
|
|
|
|
+ if (data.getBigDecimal("validRatioValue").compareTo(data.getBigDecimal("materialValidRatioValue")) < 0) {
|
|
|
|
+ temp.add(data.getString("validRatio") + "-GREEN");
|
|
|
|
+ } else {
|
|
|
|
+ temp.add(data.getString("validRatio") + "-G");
|
|
|
|
+ }
|
|
|
|
+ temp.add(data.getString("materialValidRatio"));
|
|
|
|
+ excelList.add(temp);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|