zhaowenxuan
2025-02-11 b4ac803e1554f70e556d94a1313d6944e5fc0e6f
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjAdviceController.java
@@ -117,6 +117,7 @@
    @ApiOperation(value = "根据体检人性别和是否为总检查询体检建议接口")
    public AjaxResult getKjTjAdviceKjbqBySex(@RequestParam String sex, @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,
                                             @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize) {
        LambdaQueryWrapper<TjAdvice> wq = new LambdaQueryWrapper<>();
@@ -124,6 +125,7 @@
//        wq.eq(TjAdvice::getAdSex, sex).or().isNull(TjAdvice::getAdSex);
        wq.eq(TjAdvice::getIsZj, isZj);
        if(StringUtil.isNotBlank(jynr)) wq.like(TjAdvice::getAdvice,jynr);
        if(StringUtil.isNotBlank(jybt)) wq.like(TjAdvice::getTitle,jybt);
        wq.and(i -> i.eq(TjAdvice::getAdSex, sex).or().isNull(TjAdvice::getAdSex));
        Page<TjAdvice> kjbqPage = tjAdviceService.page(page1, wq);
        return AjaxResult.success(kjbqPage);
@@ -142,7 +144,7 @@
            LambdaQueryWrapper<TjUserAdvice> wq0 = new LambdaQueryWrapper<>();
            wq0.eq(TjUserAdvice::getUserId, userId);
            List<TjUserAdvice> list = userAdviceService.list(wq0);
            if (null != list && list.size() > 0) {
            if (null != list && !list.isEmpty()) {
                List<Long> longs = list.stream().map(TjUserAdvice::getAdviceId).collect(Collectors.toList());
                wq.in(TjAdvice::getId,longs);
                wq.last("and (ad_sex=1 OR ad_sex=2)");