精准医疗基因、方剂

This commit is contained in:
wuchunlei
2025-06-04 17:09:45 +08:00
parent 8dfd150e2c
commit 6852c64984
10 changed files with 426 additions and 0 deletions

View File

@@ -0,0 +1,103 @@
package com.peanut.modules.master.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.peanut.common.utils.R;
import com.peanut.modules.common.entity.PrecisionMedicineGene;
import com.peanut.modules.common.entity.PrecisionMedicinePrescription;
import com.peanut.modules.common.service.PrecisionMedicineGeneService;
import com.peanut.modules.common.service.PrecisionMedicinePrescriptionService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
//精准医疗基因、方剂
@Slf4j
@RestController("masterPrecisionMedicine")
@RequestMapping("master/precisionMedicine")
public class PrecisionMedicineController {
@Autowired
private PrecisionMedicineGeneService geneService;
@Autowired
private PrecisionMedicinePrescriptionService prescriptionService;
//基因管理
@RequestMapping("/getGeneListByPage")
public R getGeneListByPage(@RequestBody Map<String,Object> params) {
LambdaQueryWrapper<PrecisionMedicineGene> wrapper = new LambdaQueryWrapper();
if (StringUtils.isNotEmpty(params.get("name").toString())) {
wrapper.like(PrecisionMedicineGene::getName,params.get("name"));
}
wrapper.orderByDesc(PrecisionMedicineGene::getCreateTime);
Page<PrecisionMedicineGene> page = geneService.page(new Page<>(
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())), wrapper);
return R.ok().put("result", page);
}
@RequestMapping("/getGeneById")
public R getGeneById(@RequestBody Map<String,Object> params) {
return R.ok().put("result", geneService.getById(params.get("id").toString()));
}
@RequestMapping("/saveGene")
public R saveMessage(@RequestBody PrecisionMedicineGene gene) {
geneService.save(gene);
return R.ok();
}
@RequestMapping("/updateGene")
public R updateGene(@RequestBody PrecisionMedicineGene gene) {
geneService.updateById(gene);
return R.ok();
}
@RequestMapping("/delGene")
public R delGene(@RequestBody Map<String,Object> params) {
geneService.removeById(params.get("id").toString());
return R.ok();
}
//方剂管理
@RequestMapping("/getPrescriptionListByPage")
public R getPrescriptionListByPage(@RequestBody Map<String,Object> params) {
LambdaQueryWrapper<PrecisionMedicinePrescription> wrapper = new LambdaQueryWrapper();
if (StringUtils.isNotEmpty(params.get("name").toString())) {
wrapper.like(PrecisionMedicinePrescription::getName,params.get("name"));
}
wrapper.orderByDesc(PrecisionMedicinePrescription::getCreateTime);
Page<PrecisionMedicinePrescription> page = prescriptionService.page(new Page<>(
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())), wrapper);
return R.ok().put("result", page);
}
@RequestMapping("/getPrescriptionById")
public R getPrescriptionById(@RequestBody Map<String,Object> params) {
return R.ok().put("result", prescriptionService.getById(params.get("id").toString()));
}
@RequestMapping("/savePrescription")
public R savePrescription(@RequestBody PrecisionMedicinePrescription prescription) {
prescriptionService.save(prescription);
return R.ok();
}
@RequestMapping("/updatePrescription")
public R updatePrescription(@RequestBody PrecisionMedicinePrescription prescription) {
prescriptionService.updateById(prescription);
return R.ok();
}
@RequestMapping("/delPrescription")
public R delPrescription(@RequestBody Map<String,Object> params) {
prescriptionService.removeById(params.get("id").toString());
return R.ok();
}
}