| | |
| | | |
| | | @GetMapping("/getKjTjAdviceKjbqBySex") |
| | | @ApiOperation(value = "根据体检人性别和是否为总检查询体检建议接口") |
| | | public AjaxResult getKjTjAdviceKjbqBySex(@RequestParam String sex, @RequestParam @ApiParam(value = "1常规医生 0总检") String isZj, |
| | | public AjaxResult getKjTjAdviceKjbqBySex(@RequestParam @ApiParam(value = "1常规医生 0总检") String isZj, |
| | | @RequestParam(required = false) @ApiParam(value ="建议内容") String jynr, |
| | | @RequestParam(required = false) @ApiParam(value ="建议标题") String jybt, |
| | | @ApiParam(value = "页码数(默认1)") @RequestParam(defaultValue = "1") Integer page, |
| | |
| | | |
| | | @GetMapping("/getCyTjAdviceKjbqBySex") |
| | | @ApiOperation(value = "根据当前登录人id获取常用建议") |
| | | public AjaxResult getCyTjAdviceKjbqBySex(@RequestParam(required = false) String sex, @RequestParam @ApiParam(value = "用户id 传当前登录人") Long userId, |
| | | public AjaxResult getCyTjAdviceKjbqBySex( @RequestParam @ApiParam(value = "用户id 传当前登录人") Long userId, |
| | | @ApiParam(value = "页码数(默认1)") @RequestParam(defaultValue = "1") Integer page, |
| | | @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize) { |
| | | @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize, |
| | | @RequestParam(required = false) String nr) { |
| | | LambdaQueryWrapper<TjUserAdvice> wq0 = new LambdaQueryWrapper<>(); |
| | | if(!SecurityUtils.isAdmin(userId)) wq0.eq(TjUserAdvice::getUserId, userId); |
| | | if(!SecurityUtils.isAdmin(userId)) |
| | | wq0.eq(TjUserAdvice::getUserId, userId); |
| | | List<TjUserAdvice> list = userAdviceService.list(wq0); |
| | | List<TjAdvice> kjbqPage = new ArrayList<>(); |
| | | Map<String,Object> map = new HashMap<>(); |
| | |
| | | kjbqPage.add(advice1); |
| | | } |
| | | } |
| | | List<TjAdvice> adviceList = kjbqPage.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | List<TjAdvice> adviceList =null; |
| | | if(StringUtil.isNotBlank( nr)){ |
| | | adviceList = kjbqPage.stream().filter(kjbq -> StringUtil.isNotBlank(kjbq.getTitle()) && kjbq.getTitle().contains(nr)) |
| | | .skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | }else { |
| | | adviceList = kjbqPage.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | } |
| | | map.put("total", kjbqPage.size()); |
| | | map.put("records", adviceList); |
| | | return AjaxResult.success(map); |