Browse Source

原文显示控制

rengb 3 years ago
parent
commit
d15637b3d7

+ 45 - 0
kernel/src/main/java/com/lantone/qc/kernel/web/controller/PageShowController.java

@@ -0,0 +1,45 @@
+package com.lantone.qc.kernel.web.controller;
+
+import com.lantone.qc.dbanaly.lt.entity.MedicalRecordContent;
+import com.lantone.qc.dbanaly.lt.service.MedicalRecordContentService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/12/17 14:05
+ */
+@Slf4j
+@Api(value = "文书页面显示控制", tags = { "文书页面显示控制" })
+@RestController
+@RequestMapping(value = "pageShow")
+public class PageShowController {
+
+    @Autowired
+    private MedicalRecordContentService medicalRecordContentService;
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "dataType", value = "文书数据类型,html或者xml", required = true, paramType = "path", dataType = "String"),
+            @ApiImplicitParam(name = "recId", value = "文书记录编号", required = true, paramType = "path", dataType = "String")
+    })
+    @GetMapping("/dataShow/{dataType}/{recId}")
+    public String dataShow(@PathVariable("recId") String recId, @PathVariable("dataType") String dataType) {
+        MedicalRecordContent medicalRecordContent = medicalRecordContentService.getById(recId);
+        if (dataType.equals("html")) {
+            return medicalRecordContent.getHtmlText();
+        } else if (dataType.equals("xml")) {
+            return medicalRecordContent.getXmlText();
+        } else {
+            return medicalRecordContent.getContentText();
+        }
+    }
+
+}