|
@@ -0,0 +1,46 @@
|
|
|
+package com.zjugis.report.serviceApi;
|
|
|
+
|
|
|
+import com.zjugis.framework.workflow.model.BaseController;
|
|
|
+import com.zjugis.framework.workflow.spring.resovler.ParamModel;
|
|
|
+import com.zjugis.report.service.ReportService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 报表测试api
|
|
|
+ */
|
|
|
+
|
|
|
+@RestController
|
|
|
+public class ReportServiceApiController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private ReportService reportService;
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public String getReportByIds(String reportIds) {
|
|
|
+ try {
|
|
|
+ String[] reportIdArr = reportIds.split(",");
|
|
|
+ return ok(reportService.findByIdList(Arrays.asList(reportIdArr)));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return error(e.getMessage(), BaseController.ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 根据报表标识查询
|
|
|
+ *
|
|
|
+ * @param marks
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping
|
|
|
+ public String getReportByMarks(@ParamModel List<String> marks) {
|
|
|
+ try {
|
|
|
+ return ok(reportService.findByMarks(marks));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return error(e.getMessage(), ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|