ソースを参照

Report第三方接口添加

ljy121 1 年間 前
コミット
f546f19c00

+ 46 - 0
zjugis-report/src/main/java/com/zjugis/report/serviceApi/ReportServiceApiController.java

@@ -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);
+		}
+	}
+}