| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ltkj.common.annotation.Excel; |
| | | import com.ltkj.common.utils.StringUtils; |
| | | import com.ltkj.common.utils.poi.ExcelUtil; |
| | | import com.ltkj.framework.config.UserHoder; |
| | | import com.ltkj.hosp.domain.TjAdvice; |
| | |
| | | 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.*; |
| | |
| | | @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize) { |
| | | LambdaQueryWrapper<TjAdviceKjbq> wq = new LambdaQueryWrapper<>(); |
| | | Page<TjAdviceKjbq> page1 = new Page<>(page, pageSize); |
| | | if (null != userId && !userId.equals("")) { |
| | | if (null != userId && !StringUtils.isBlank(userId)) { |
| | | wq.eq(TjAdviceKjbq::getUserId, userId); |
| | | } |
| | | if (null != qyzt) { |
| | | wq.eq(TjAdviceKjbq::getQyzt, qyzt); |
| | | } |
| | | Page<TjAdviceKjbq> kjbqPage = kjbqService.page(page1, wq); |
| | | if (null != kjbqPage.getRecords() && kjbqPage.getRecords().size() > 0) { |
| | | if (null != kjbqPage.getRecords() && !kjbqPage.getRecords().isEmpty()) { |
| | | for (TjAdviceKjbq record : kjbqPage.getRecords()) { |
| | | if (null != record.getUserId()) { |
| | | record.setUserName(userService.getById(record.getUserId()).getNickName()); |
| | |
| | | @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); |
| | |
| | | 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)); |
| | | } |
| | |
| | | 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) { |