|
@@ -0,0 +1,132 @@
|
|
|
+package com.zdqz.sample.controller;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import com.zdqz.common.annotation.Log;
|
|
|
+import com.zdqz.common.core.controller.BaseController;
|
|
|
+import com.zdqz.common.core.domain.AjaxResult;
|
|
|
+import com.zdqz.common.core.page.TableDataInfo;
|
|
|
+import com.zdqz.common.enums.BusinessType;
|
|
|
+import com.zdqz.common.utils.poi.ExcelUtil;
|
|
|
+import com.zdqz.sample.domain.SampleExperiment;
|
|
|
+import com.zdqz.sample.service.ISampleExperimentService;
|
|
|
+
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 解读管理Controller
|
|
|
+ *
|
|
|
+ * @author 攻心小虫
|
|
|
+ * @date 2025-06-05
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/sample/sampleExperiment")
|
|
|
+@Api(value="实验解读接口",tags="实验解读接口标签")
|
|
|
+public class SampleExperimentController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private ISampleExperimentService sampleExperimentService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询解读管理列表
|
|
|
+ */
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperation("获取列表,增加了字段输出")
|
|
|
+ @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:list')")
|
|
|
+ public TableDataInfo list(SampleExperiment sampleExperiment) {
|
|
|
+ startPage();
|
|
|
+ List<SampleExperiment> list = sampleExperimentService.selectSampleExperimentList(sampleExperiment);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出解读管理列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:export')")
|
|
|
+ @Log(title = "解读管理", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, SampleExperiment sampleExperiment) {
|
|
|
+ List<SampleExperiment> list = sampleExperimentService.selectSampleExperimentList(sampleExperiment);
|
|
|
+ ExcelUtil<SampleExperiment> util = new ExcelUtil<SampleExperiment>(SampleExperiment.class);
|
|
|
+ util.exportExcel(response, list, "解读管理数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取解读管理详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
+ return success(sampleExperimentService.selectSampleExperimentById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增解读管理
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:add')")
|
|
|
+ @Log(title = "解读管理", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody SampleExperiment sampleExperiment) {
|
|
|
+ return toAjax(sampleExperimentService.insertSampleExperiment(sampleExperiment));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改解读管理
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:edit')")
|
|
|
+ @Log(title = "解读管理", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody SampleExperiment sampleExperiment) {
|
|
|
+ return toAjax(sampleExperimentService.updateSampleExperiment(sampleExperiment));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除解读管理
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:remove')")
|
|
|
+ @Log(title = "解读管理", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
+ return toAjax(sampleExperimentService.deleteSampleExperimentByIds(ids));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("拉取解读数据")
|
|
|
+ @PostMapping("/readData/{id}")
|
|
|
+ @Log(title = "拉取解读数据", businessType = BusinessType.UPDATE)
|
|
|
+ @ApiImplicitParam(name = "id", value = "实验编号", required = true, dataType = "int", paramType = "path", dataTypeClass = Long.class)
|
|
|
+ public AjaxResult readData(@PathVariable("id") Long id) {
|
|
|
+ try {
|
|
|
+ sampleExperimentService.readData(id);
|
|
|
+ return success();
|
|
|
+ }catch(Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("生成文档")
|
|
|
+ @PostMapping("/readData/{id}")
|
|
|
+ @Log(title = "生成文档", businessType = BusinessType.UPDATE)
|
|
|
+ @ApiImplicitParam(name = "id", value = "实验编号", required = true, dataType = "int", paramType = "path", dataTypeClass = Long.class)
|
|
|
+ public AjaxResult generator(@PathVariable("id") Long id) {
|
|
|
+ try {
|
|
|
+ sampleExperimentService.generator(id);
|
|
|
+ return success();
|
|
|
+ }catch(Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|