Commit 86db4050fe9d5e3d22aa2d871f1820f262ab85b9
1 parent
0b2784e1ff
Exists in
master
and in
1 other branch
优化 保存患者感兴趣的科室json传参
Showing 1 changed file with 6 additions and 7 deletions
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/FavorController.java
View file @
86db405
| ... | ... | @@ -9,11 +9,10 @@ |
| 9 | 9 | import com.lyms.talkonlineweb.service.LymsHdepartService; |
| 10 | 10 | import org.springframework.beans.BeanUtils; |
| 11 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | -import org.springframework.web.bind.annotation.GetMapping; | |
| 13 | -import org.springframework.web.bind.annotation.PostMapping; | |
| 14 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 15 | -import org.springframework.web.bind.annotation.RestController; | |
| 12 | +import org.springframework.web.bind.annotation.*; | |
| 16 | 13 | |
| 14 | +import java.util.Map; | |
| 15 | + | |
| 17 | 16 | /** |
| 18 | 17 | * 患者感兴趣内容管理 |
| 19 | 18 | */ |
| 20 | 19 | |
| 21 | 20 | |
| ... | ... | @@ -33,17 +32,17 @@ |
| 33 | 32 | * @return |
| 34 | 33 | */ |
| 35 | 34 | @PostMapping("saveFavor") |
| 36 | - public BaseResponse saveFavor(String pid,String dpids){ | |
| 35 | + public BaseResponse saveFavor(@RequestBody Map<String,Object> param){ | |
| 37 | 36 | BaseResponse baseResponse=new BaseResponse(); |
| 38 | 37 | boolean f=false; |
| 39 | - String[] dpidArr=dpids.split(","); | |
| 38 | + String[] dpidArr=param.get("dpids").toString().split(","); | |
| 40 | 39 | |
| 41 | 40 | for (int i = 0; i < dpidArr.length; i++) { |
| 42 | 41 | LymsFavor favor =new LymsFavor(); |
| 43 | 42 | LymsHdepart depart=new LymsHdepart(); |
| 44 | 43 | depart=lymsHdepartService.getById(dpidArr[i]); |
| 45 | 44 | BeanUtils.copyProperties(depart,favor); |
| 46 | - favor.setIid(Integer.parseInt(pid)); | |
| 45 | + favor.setIid(Integer.parseInt(param.get("pid").toString())); | |
| 47 | 46 | f=lymsFavorService.saveOrUpdate(favor); |
| 48 | 47 | } |
| 49 | 48 |