方剂增加药
穴位增加脉络
This commit is contained in:
@@ -0,0 +1,126 @@
|
|||||||
|
package com.peanut.modules.book.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.peanut.common.utils.R;
|
||||||
|
import com.peanut.modules.book.entity.MedicinalDrug;
|
||||||
|
import com.peanut.modules.book.entity.MedicinalMaterials;
|
||||||
|
import com.peanut.modules.book.service.MedicinalDrugService;
|
||||||
|
import com.peanut.modules.book.service.MedicinalMaterialsService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.jsoup.Jsoup;
|
||||||
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.jsoup.select.Elements;
|
||||||
|
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
|
||||||
|
@RequestMapping("book/materials")
|
||||||
|
public class MedicinalMaterialsController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MedicinalMaterialsService materialsService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MedicinalDrugService drugService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取中药材列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getMaterialsList")
|
||||||
|
public R getMaterialsList(@RequestBody Map params){
|
||||||
|
MPJLambdaWrapper<MedicinalMaterials> wrapper = new MPJLambdaWrapper();
|
||||||
|
if (params.containsKey("name")&&StringUtils.isNotEmpty(params.get("name").toString())){
|
||||||
|
wrapper.and(StringUtils.isNotEmpty(params.get("name").toString()),t->t.like(MedicinalMaterials::getName,params.get("name")).or().like(MedicinalMaterials::getOthername,params.get("name")));
|
||||||
|
}
|
||||||
|
if (params.containsKey("type")&&StringUtils.isNotEmpty(params.get("type").toString())){
|
||||||
|
wrapper.like(MedicinalMaterials::getType,params.get("type"));
|
||||||
|
}
|
||||||
|
if (params.containsKey("taste")&&StringUtils.isNotEmpty(params.get("taste").toString())){
|
||||||
|
wrapper.like(MedicinalMaterials::getProperty,params.get("taste"));
|
||||||
|
}
|
||||||
|
if (params.containsKey("property")&&StringUtils.isNotEmpty(params.get("property").toString())){
|
||||||
|
wrapper.like(MedicinalMaterials::getProperty,params.get("property"));
|
||||||
|
}
|
||||||
|
if (params.containsKey("tropism")&&StringUtils.isNotEmpty(params.get("tropism").toString())){
|
||||||
|
wrapper.like(MedicinalMaterials::getProperty,params.get("tropism"));
|
||||||
|
}
|
||||||
|
wrapper.orderByAsc(MedicinalMaterials::getSort);
|
||||||
|
Page<MedicinalMaterials> page = materialsService.page(new Page<>(
|
||||||
|
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
|
return R.ok().put("result", page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(path = "/getMaterials")
|
||||||
|
public R getMaterials(String id) {
|
||||||
|
return R.ok().put("result", materialsService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(path = "/saveOrUpdateMaterials")
|
||||||
|
public R saveOrUpdateMaterials(@RequestBody MedicinalMaterials materials) {
|
||||||
|
materialsService.saveOrUpdate(materials);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(path = "/delMaterials")
|
||||||
|
public R delMaterials(String id) {
|
||||||
|
materialsService.removeById(id);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取药品列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getDrugList")
|
||||||
|
public R getDrugList(@RequestBody Map params){
|
||||||
|
MPJLambdaWrapper<MedicinalDrug> wrapper = new MPJLambdaWrapper();
|
||||||
|
if (params.containsKey("name")&&StringUtils.isNotEmpty(params.get("name").toString())){
|
||||||
|
wrapper.and(StringUtils.isNotEmpty(params.get("name").toString()),
|
||||||
|
t->t.like(MedicinalDrug::getName,params.get("name"))
|
||||||
|
.or().like(MedicinalDrug::getEnglishName,params.get("name"))
|
||||||
|
.or().like(MedicinalDrug::getPinyinName,params.get("name")));
|
||||||
|
}
|
||||||
|
if (params.containsKey("kind")&&StringUtils.isNotEmpty(params.get("kind").toString())){
|
||||||
|
wrapper.like(MedicinalDrug::getKind,params.get("kind"));
|
||||||
|
}
|
||||||
|
if (params.containsKey("prescriptionType")&&StringUtils.isNotEmpty(params.get("prescriptionType").toString())){
|
||||||
|
wrapper.like(MedicinalDrug::getPrescriptionType,params.get("prescriptionType"));
|
||||||
|
}
|
||||||
|
if (params.containsKey("insuranceType")&&StringUtils.isNotEmpty(params.get("insuranceType").toString())){
|
||||||
|
wrapper.like(MedicinalDrug::getInsuranceType,params.get("insuranceType"));
|
||||||
|
}
|
||||||
|
if (params.containsKey("type")&&StringUtils.isNotEmpty(params.get("type").toString())){
|
||||||
|
wrapper.like(MedicinalDrug::getType,params.get("type"));
|
||||||
|
}
|
||||||
|
wrapper.orderByAsc(MedicinalDrug::getSort);
|
||||||
|
Page<MedicinalDrug> page = drugService.page(new Page<>(
|
||||||
|
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
|
return R.ok().put("result", page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(path = "/getDrug")
|
||||||
|
public R getDrug(String id) {
|
||||||
|
return R.ok().put("result", drugService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(path = "/saveOrUpdateDrug")
|
||||||
|
public R saveOrUpdateDrug(@RequestBody MedicinalDrug drug) {
|
||||||
|
drugService.saveOrUpdate(drug);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(path = "/delDrug")
|
||||||
|
public R delDrug(String id) {
|
||||||
|
drugService.removeById(id);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.peanut.modules.book.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.peanut.common.utils.R;
|
||||||
|
import com.peanut.modules.book.entity.Meridians;
|
||||||
|
import com.peanut.modules.book.service.MeridiansService;
|
||||||
|
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
|
||||||
|
@RequestMapping("book/meridians")
|
||||||
|
public class MeridiansController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MeridiansService meridiansService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取经络列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getMeridiansList")
|
||||||
|
public R getMeridiansList(@RequestBody Map params){
|
||||||
|
MPJLambdaWrapper<Meridians> wrapper = new MPJLambdaWrapper();
|
||||||
|
wrapper.orderByAsc(Meridians::getSort);
|
||||||
|
Page<Meridians> page = meridiansService.page(new Page<>(
|
||||||
|
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
|
return R.ok().put("result", page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(path = "/getMeridians")
|
||||||
|
public R getMeridians(String id) {
|
||||||
|
return R.ok().put("result", meridiansService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(path = "/saveOrUpdateMeridians")
|
||||||
|
public R saveOrUpdateMeridians(@RequestBody Meridians meridians) {
|
||||||
|
meridiansService.saveOrUpdate(meridians);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(path = "/delMeridians")
|
||||||
|
public R delMeridians(String id) {
|
||||||
|
meridiansService.removeById(id);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.book.dao;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.peanut.modules.book.entity.MedicinalDrug;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface MedicinalDrugDao extends MPJBaseMapper<MedicinalDrug> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.book.dao;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.peanut.modules.book.entity.MedicinalMaterials;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface MedicinalMaterialsDao extends MPJBaseMapper<MedicinalMaterials> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.book.dao;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.peanut.modules.book.entity.Meridians;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface MeridiansDao extends MPJBaseMapper<Meridians> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.peanut.modules.book.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("medicinal_drug")
|
||||||
|
public class MedicinalDrug {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 英文名称
|
||||||
|
*/
|
||||||
|
private String englishName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 汉语拼音
|
||||||
|
*/
|
||||||
|
private String pinyinName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品品类
|
||||||
|
*/
|
||||||
|
private String kind;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处方类型
|
||||||
|
*/
|
||||||
|
private String prescriptionType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保类型
|
||||||
|
*/
|
||||||
|
private String insuranceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0中药1西药
|
||||||
|
*/
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细信息
|
||||||
|
*/
|
||||||
|
private String information;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.peanut.modules.book.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("medicinal_materials")
|
||||||
|
public class MedicinalMaterials {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
private String img;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拉丁名
|
||||||
|
*/
|
||||||
|
private String latinname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 别名
|
||||||
|
*/
|
||||||
|
private String othername;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 味
|
||||||
|
*/
|
||||||
|
private String taste;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性
|
||||||
|
*/
|
||||||
|
private String property;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归
|
||||||
|
*/
|
||||||
|
private String tropism;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细信息
|
||||||
|
*/
|
||||||
|
private String information;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
48
src/main/java/com/peanut/modules/book/entity/Meridians.java
Normal file
48
src/main/java/com/peanut/modules/book/entity/Meridians.java
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
package com.peanut.modules.book.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("meridians")
|
||||||
|
public class Meridians {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
private String img;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 歌
|
||||||
|
*/
|
||||||
|
private String song;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细信息
|
||||||
|
*/
|
||||||
|
private String information;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.book.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.book.entity.MedicinalDrug;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public interface MedicinalDrugService extends IService<MedicinalDrug> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.book.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.book.entity.MedicinalMaterials;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public interface MedicinalMaterialsService extends IService<MedicinalMaterials> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.book.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.book.entity.Meridians;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public interface MeridiansService extends IService<Meridians> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.peanut.modules.book.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.modules.book.dao.MedicinalDrugDao;
|
||||||
|
import com.peanut.modules.book.entity.MedicinalDrug;
|
||||||
|
import com.peanut.modules.book.service.MedicinalDrugService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MedicinalDrugServiceImpl extends ServiceImpl<MedicinalDrugDao, MedicinalDrug> implements MedicinalDrugService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.peanut.modules.book.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.modules.book.dao.MedicinalMaterialsDao;
|
||||||
|
import com.peanut.modules.book.entity.MedicinalMaterials;
|
||||||
|
import com.peanut.modules.book.service.MedicinalMaterialsService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MedicinalMaterialsServiceImpl extends ServiceImpl<MedicinalMaterialsDao, MedicinalMaterials> implements MedicinalMaterialsService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.peanut.modules.book.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.modules.book.dao.MeridiansDao;
|
||||||
|
import com.peanut.modules.book.entity.Meridians;
|
||||||
|
import com.peanut.modules.book.service.MeridiansService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MeridiansServiceImpl extends ServiceImpl<MeridiansDao, Meridians> implements MeridiansService {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user