|
@@ -1,6 +1,7 @@
|
|
package com.nokia.tsl_data.controller;
|
|
package com.nokia.tsl_data.controller;
|
|
|
|
|
|
import com.nokia.common.http.vo.R;
|
|
import com.nokia.common.http.vo.R;
|
|
|
|
+import com.nokia.tsl_data.service.HighQualityDataService;
|
|
import com.nokia.tsl_data.service.TaskService;
|
|
import com.nokia.tsl_data.service.TaskService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -10,16 +11,18 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("tsl_data/report")
|
|
|
|
|
|
+@RequestMapping("tsl_data/")
|
|
public class ReportGenerateController {
|
|
public class ReportGenerateController {
|
|
|
|
|
|
private final TaskService taskService;
|
|
private final TaskService taskService;
|
|
|
|
+ private final HighQualityDataService highQualityDataService;
|
|
|
|
|
|
- public ReportGenerateController(TaskService taskService) {
|
|
|
|
|
|
+ public ReportGenerateController(TaskService taskService, HighQualityDataService highQualityDataService) {
|
|
this.taskService = taskService;
|
|
this.taskService = taskService;
|
|
|
|
+ this.highQualityDataService = highQualityDataService;
|
|
}
|
|
}
|
|
|
|
|
|
- @PostMapping("generate")
|
|
|
|
|
|
+ @PostMapping("report/generate")
|
|
public R generateReport(@RequestBody String day) {
|
|
public R generateReport(@RequestBody String day) {
|
|
try {
|
|
try {
|
|
taskService.generateReport(day);
|
|
taskService.generateReport(day);
|
|
@@ -30,4 +33,28 @@ public class ReportGenerateController {
|
|
return R.error().message(String.format("报表账期 %s 生成失败: %s", day, e.getMessage()));
|
|
return R.error().message(String.format("报表账期 %s 生成失败: %s", day, e.getMessage()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @PostMapping("highQualityData/generate")
|
|
|
|
+ public R generateHighQualityData(@RequestBody String day) {
|
|
|
|
+ try {
|
|
|
|
+ highQualityDataService.generateHighQualityData(day);
|
|
|
|
+ return R.ok().message(String.format("HighQualityData 账期 %s 生成成功", day));
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error(e.getMessage());
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return R.error().message(String.format("HighQualityData 账期 %s 生成失败: %s", day, e.getMessage()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PostMapping("highQualityData/delete")
|
|
|
|
+ public R deleteHighQualityData(@RequestBody String day) {
|
|
|
|
+ try {
|
|
|
|
+ highQualityDataService.deleteHighQualityData(day);
|
|
|
|
+ return R.ok().message(String.format("HighQualityData 账期 %s 生成成功", day));
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error(e.getMessage());
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return R.error().message(String.format("HighQualityData 账期 %s 生成失败: %s", day, e.getMessage()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|