prescript
This commit is contained in:
@@ -59,7 +59,7 @@ public class PrescriptController {
|
||||
*/
|
||||
@RequestMapping("/addPrescript")
|
||||
public R addPrescript(@RequestBody PrescriptEntity p){
|
||||
if(p.getImages()!=null&&p.getImageList().size()>0){
|
||||
if(p.getImageList()!=null&&p.getImageList().size()>0){
|
||||
p.setImages(JSON.toJSONString(p.getImageList()));
|
||||
}
|
||||
prescriptService.save(p);
|
||||
@@ -73,7 +73,7 @@ public class PrescriptController {
|
||||
*/
|
||||
@RequestMapping("/editPrescript")
|
||||
public R editPrescript(@RequestBody PrescriptEntity p){
|
||||
if(p.getImages()!=null&&p.getImageList().size()>0){
|
||||
if(p.getImageList()!=null&&p.getImageList().size()>0){
|
||||
p.setImages(JSON.toJSONString(p.getImageList()));
|
||||
}
|
||||
prescriptService.updateById(p);
|
||||
@@ -92,6 +92,18 @@ public class PrescriptController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方剂分类列表
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/prescriptCategoryList")
|
||||
public R prescriptCategoryList(@RequestBody Map<String,Object> map){
|
||||
Integer id = Integer.valueOf(map.get("categoryId").toString());
|
||||
List<PrescriptCategoryEntity> categoryByPid = prescriptCategoryService.getCategoryByPid(id);
|
||||
return R.ok().put("list",categoryByPid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取方剂分类列表
|
||||
|
||||
@@ -10,4 +10,6 @@ public interface PrescriptCategoryService extends IService<PrescriptCategoryEnti
|
||||
List<PrescriptCategoryEntity> getPrescriptCategoryList();
|
||||
|
||||
boolean delPrescriptCategory(Integer prescriptCategoryId);
|
||||
|
||||
List<PrescriptCategoryEntity> getCategoryByPid(Integer pid);
|
||||
}
|
||||
|
||||
@@ -47,4 +47,13 @@ public class PrescriptCategoryServiceImpl extends ServiceImpl<PrescriptCategoryD
|
||||
removeById(prescriptCategoryId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrescriptCategoryEntity> getCategoryByPid(Integer pid) {
|
||||
LambdaQueryWrapper<PrescriptCategoryEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PrescriptCategoryEntity::getPid,pid);
|
||||
wrapper.orderByDesc(PrescriptCategoryEntity::getSort);
|
||||
List<PrescriptCategoryEntity> list = list(wrapper);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user