zjh
2024-12-10 da9cb628948b381015faf188283a90a3aa15ce62
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjAdviceController.java
@@ -25,6 +25,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jodd.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -194,6 +195,8 @@
    @GetMapping("/list")
    @ApiOperation(value = "体检建议列表查询")
    public AjaxResult list(@RequestParam(required = false) @ApiParam(value = "项目名") String proName,
                           @ApiParam(value = "标题") @RequestParam(required = false) String bt,
                           @ApiParam(value = "建议") @RequestParam(required = false) String nr,
                           @ApiParam(value = "页码数(默认1)") @RequestParam(defaultValue = "1") Integer page,
                           @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize) {
        Page<TjAdvice> page1 = new Page<>(page, pageSize);
@@ -205,16 +208,16 @@
            list = new ArrayList<>();
            wq.like(TjProject::getProName, proName);
            List<TjProject> projectList = tjProjectService.list(wq);
            if (null != projectList && projectList.size() > 0) {
            if (null != projectList && !projectList.isEmpty()) {
                for (TjProject project : projectList) {
                    LambdaQueryWrapper<TjAdvice> wqq = new LambdaQueryWrapper<>();
                    wqq.eq(TjAdvice::getProId, project.getProId());
                    IPage<TjAdvice> adviceList = tjAdviceService.page(page1, wqq);
                    if (null != adviceList.getRecords() && adviceList.getRecords().size() > 0) {
                    if (null != adviceList.getRecords() && !adviceList.getRecords().isEmpty()) {
                        for (TjAdvice record : adviceList.getRecords()) {
                            record.setProName(project.getProName());
                            String kjbq = record.getKjbq();
                            if(null !=kjbq && !kjbq.equals("")){
                            if(null !=kjbq && !kjbq.isEmpty()){
                                String[] split = kjbq.split(",");
                                record.setKjbqz(Arrays.asList(split));
                            }
@@ -228,9 +231,12 @@
            map.put("total", total);
            return AjaxResult.success(map);
        }
        Page<TjAdvice> page2 = tjAdviceService.page(page1);
        LambdaQueryWrapper<TjAdvice> wq=new LambdaQueryWrapper<>();
        if(!StringUtil.isBlank(bt)) wq.like(TjAdvice::getTitle,bt);
        if(!StringUtil.isBlank(nr)) wq.like(TjAdvice::getAdvice,nr);
        Page<TjAdvice> page2 = tjAdviceService.page(page1,wq);
        list = page2.getRecords();
        if (null != list && list.size() > 0) {
        if (null != list && !list.isEmpty()) {
            for (TjAdvice advice : list) {
                TjProject tjProject = tjProjectService.getById(advice.getProId());
                if (null != tjProject) {