| | |
| | | package com.ruoyi.doublePrevention.service.baseService.impl;
|
| | |
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | | import com.github.pagehelper.Page;
|
| | | import com.github.pagehelper.PageHelper;
|
| | | import com.ruoyi.common.exception.BusinessException;
|
| | | import com.ruoyi.common.utils.BeanCopyUtils;
|
| | | import com.ruoyi.doublePrevention.entity.RiskOldInfo;
|
| | | import com.ruoyi.doublePrevention.entity.dto.req.RiskOldInfoQueryReqDTO;
|
| | | import com.ruoyi.doublePrevention.entity.dto.resp.RiskOldInfoQueryRespDTO;
|
| | | import com.ruoyi.doublePrevention.repository.RiskOldInfoRepository;
|
| | | import com.ruoyi.doublePrevention.service.baseService.RiskOldInfoService;
|
| | | import com.ruoyi.doublePrevention.vo.ResultVO;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.util.ObjectUtils;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | @Service
|
| | | public class RiskOldInfoServiceImpl implements RiskOldInfoService {
|
| | |
|
| | | @Autowired
|
| | | private RiskOldInfoRepository repository;
|
| | |
|
| | |
|
| | | @Override
|
| | | public ResultVO<RiskOldInfoQueryRespDTO> selectOldRiskInfoPage(RiskOldInfoQueryReqDTO queryReqDTO) {
|
| | |
|
| | | ResultVO resultVO = new ResultVO<>();
|
| | |
|
| | | if (ObjectUtils.isEmpty(queryReqDTO.getPageSize())){
|
| | | throw new BusinessException("分页信息不能为空");
|
| | | }
|
| | | if (ObjectUtils.isEmpty(queryReqDTO.getPageNum())){
|
| | | throw new BusinessException("分页信息不能为空");
|
| | | }
|
| | |
|
| | | if (queryReqDTO.getReportPeople() == "" ){
|
| | | queryReqDTO.setReportPeople(null);
|
| | | }
|
| | | if (queryReqDTO.getFindPeople() == "" ){
|
| | | queryReqDTO.setFindPeople(null);
|
| | | }
|
| | | if (queryReqDTO.getAcceptPeople() == "" ){
|
| | | queryReqDTO.setAcceptPeople(null);
|
| | | }
|
| | | if (queryReqDTO.getRiskLevel() == "" ){
|
| | | queryReqDTO.setRiskLevel(null);
|
| | | }
|
| | | if (queryReqDTO.getRiskDep() == "" ){
|
| | | queryReqDTO.setRiskDep(null);
|
| | | }
|
| | | if (queryReqDTO.getMajor() == "" ){
|
| | | queryReqDTO.setMajor(null);
|
| | | }
|
| | |
|
| | | Integer pageIndex = queryReqDTO.getPageNum();
|
| | | Integer pageSize = queryReqDTO.getPageSize();
|
| | |
|
| | | Page<RiskOldInfo> page = PageHelper.startPage(pageIndex, pageSize);
|
| | |
|
| | | List<RiskOldInfo> riskOldInfo = repository.selectOldRiskInfoPage(queryReqDTO);
|
| | | List<RiskOldInfo> result = page.getResult();
|
| | |
|
| | | resultVO.setData(result);
|
| | | resultVO.setCount((int) page.getTotal());
|
| | | resultVO.setPageNum(page.getPageNum());
|
| | | resultVO.setPageSize(page.getPageSize());
|
| | |
|
| | | return resultVO;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | package com.ruoyi.doublePrevention.service.baseService.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.ruoyi.common.exception.BusinessException; |
| | | import com.ruoyi.common.utils.BeanCopyUtils; |
| | | import com.ruoyi.doublePrevention.entity.RiskOldInfo; |
| | | import com.ruoyi.doublePrevention.entity.dto.req.RiskOldInfoQueryReqDTO; |
| | | import com.ruoyi.doublePrevention.entity.dto.resp.RiskOldInfoQueryRespDTO; |
| | | import com.ruoyi.doublePrevention.repository.RiskOldInfoRepository; |
| | | import com.ruoyi.doublePrevention.service.baseService.RiskOldInfoService; |
| | | import com.ruoyi.doublePrevention.vo.ResultVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class RiskOldInfoServiceImpl implements RiskOldInfoService { |
| | | |
| | | @Autowired |
| | | private RiskOldInfoRepository repository; |
| | | |
| | | |
| | | @Override |
| | | public ResultVO<RiskOldInfoQueryRespDTO> selectOldRiskInfoPage(RiskOldInfoQueryReqDTO queryReqDTO) { |
| | | |
| | | ResultVO resultVO = new ResultVO<>(); |
| | | |
| | | if (ObjectUtils.isEmpty(queryReqDTO.getPageSize())){ |
| | | throw new BusinessException("分页信息不能为空"); |
| | | } |
| | | if (ObjectUtils.isEmpty(queryReqDTO.getPageNum())){ |
| | | throw new BusinessException("分页信息不能为空"); |
| | | } |
| | | |
| | | if (queryReqDTO.getReportPeople() == "" ){ |
| | | queryReqDTO.setReportPeople(null); |
| | | } |
| | | if (queryReqDTO.getFindPeople() == "" ){ |
| | | queryReqDTO.setFindPeople(null); |
| | | } |
| | | if (queryReqDTO.getAcceptPeople() == "" ){ |
| | | queryReqDTO.setAcceptPeople(null); |
| | | } |
| | | if (queryReqDTO.getRiskLevel() == "" ){ |
| | | queryReqDTO.setRiskLevel(null); |
| | | } |
| | | if (queryReqDTO.getRiskDep() == "" ){ |
| | | queryReqDTO.setRiskDep(null); |
| | | } |
| | | if (queryReqDTO.getMajor() == "" ){ |
| | | queryReqDTO.setMajor(null); |
| | | } |
| | | |
| | | Integer pageIndex = queryReqDTO.getPageNum(); |
| | | Integer pageSize = queryReqDTO.getPageSize(); |
| | | |
| | | Page<RiskOldInfo> page = PageHelper.startPage(pageIndex, pageSize); |
| | | |
| | | List<RiskOldInfo> riskOldInfo = repository.selectOldRiskInfoPage(queryReqDTO); |
| | | List<RiskOldInfo> result = page.getResult(); |
| | | |
| | | resultVO.setData(result); |
| | | resultVO.setCount((int) page.getTotal()); |
| | | resultVO.setPageNum(page.getPageNum()); |
| | | resultVO.setPageSize(page.getPageSize()); |
| | | |
| | | return resultVO; |
| | | } |
| | | |
| | | |
| | | } |