prescript
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.PrescriptCategoryEntity;
|
||||
@@ -48,6 +49,18 @@ public class PrescriptController {
|
||||
return R.ok().put("prescript",prescript);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方剂文章详情
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/prescriptDetail")
|
||||
public R prescriptDetail(@RequestBody Map<String,Object> map){
|
||||
Integer integer = Integer.valueOf(map.get("prescriptId").toString());
|
||||
PrescriptEntity prescript = prescriptService.getById(integer);
|
||||
return R.ok().put("prescript",prescript);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加方剂文章
|
||||
* @param p
|
||||
@@ -71,7 +84,7 @@ public class PrescriptController {
|
||||
public R editPrescript(@RequestBody PrescriptEntity p){
|
||||
if(p.getImageList()!=null&&p.getImageList().size()>0){
|
||||
p.setImages(JSON.toJSONString(p.getImageList()));
|
||||
} else if (!p.getImages().equals("")&&(p.getImageList()==null||p.getImageList().size()==0)) {
|
||||
} else if (StringUtils.isNotBlank(p.getImages()) &&(p.getImageList()==null||p.getImageList().size()==0)) {
|
||||
p.setImages("");
|
||||
}
|
||||
prescriptService.updateById(p);
|
||||
@@ -114,15 +127,13 @@ public class PrescriptController {
|
||||
|
||||
/**
|
||||
* 获取方剂文章列表(经方)
|
||||
* @param map
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/prescriptListForJF")
|
||||
public R prescriptListForJF(@RequestBody Map<String,Object> map){
|
||||
Integer limit = Integer.valueOf(map.get("limit").toString());
|
||||
Integer page = Integer.valueOf(map.get("page").toString());
|
||||
Page<PrescriptEntity> prescriptListForJF = prescriptService.getPrescriptListForJF(limit, page);
|
||||
return R.ok().put("page",prescriptListForJF);
|
||||
public R prescriptListForJF(){
|
||||
List<PrescriptEntity> prescriptListForJF = prescriptService.getPrescriptListForJF();
|
||||
return R.ok().put("list",prescriptListForJF);
|
||||
}
|
||||
|
||||
private R getR(@RequestBody Map<String, Object> map) {
|
||||
|
||||
Reference in New Issue
Block a user