|  |  |  | 
|---|
|  |  |  | package com.ruoyi.system.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.ruoyi.common.basic.PageInfo; | 
|---|
|  |  |  | import com.ruoyi.common.constant.DictConstants; | 
|---|
|  |  |  | import com.ruoyi.common.utils.DictUtils; | 
|---|
|  |  |  | import com.ruoyi.system.mapper.TCheckAcceptRecordMapper; | 
|---|
|  |  |  | import com.ruoyi.system.mapper.TContractMapper; | 
|---|
|  |  |  | import com.ruoyi.system.mapper.THouseMapper; | 
|---|
|  |  |  | import com.ruoyi.system.model.TCheckAcceptRecord; | 
|---|
|  |  |  | import com.ruoyi.system.model.TContract; | 
|---|
|  |  |  | import com.ruoyi.system.model.THouse; | 
|---|
|  |  |  | import com.ruoyi.system.query.TCheckAcceptRecordAppletQuery; | 
|---|
|  |  |  | import com.ruoyi.system.query.TCheckAcceptRecordQuery; | 
|---|
|  |  |  | import com.ruoyi.system.service.TCheckAcceptRecordService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
|---|
|  |  |  | import com.ruoyi.system.vo.SysUserVO; | 
|---|
|  |  |  | import com.ruoyi.system.vo.TCheckAcceptRecordVO; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * <p> | 
|---|
|  |  |  | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | public class TCheckAcceptRecordServiceImpl extends ServiceImpl<TCheckAcceptRecordMapper, TCheckAcceptRecord> implements TCheckAcceptRecordService { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private TContractMapper contractMapper; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private THouseMapper houseMapper; | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public PageInfo<TCheckAcceptRecordVO> pageList(TCheckAcceptRecordQuery query) { | 
|---|
|  |  |  | PageInfo<TCheckAcceptRecordVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); | 
|---|
|  |  |  | List<TCheckAcceptRecordVO> list = this.baseMapper.pageList(query,pageInfo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | list.forEach(item -> { | 
|---|
|  |  |  | item.setCleanSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,item.getCleanSituation())); | 
|---|
|  |  |  | item.setOverallSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,item.getOverallSituation())); | 
|---|
|  |  |  | item.setDeviceSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,item.getDeviceSituation())); | 
|---|
|  |  |  | item.setFurnitureSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,item.getFurnitureSituation())); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | pageInfo.setRecords(list); | 
|---|
|  |  |  | return pageInfo; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public PageInfo<TCheckAcceptRecordVO> pageListApplet(TCheckAcceptRecordAppletQuery query) { | 
|---|
|  |  |  | List<TContract> tContracts = contractMapper.selectList(null); | 
|---|
|  |  |  | List<THouse> tHouses = houseMapper.selectList(null); | 
|---|
|  |  |  | PageInfo<TCheckAcceptRecordVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); | 
|---|
|  |  |  | List<TCheckAcceptRecordVO> list = this.baseMapper.pageListApplet(query,pageInfo); | 
|---|
|  |  |  | list.forEach(item -> { | 
|---|
|  |  |  | item.setCleanSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,item.getCleanSituation())); | 
|---|
|  |  |  | item.setOverallSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,item.getOverallSituation())); | 
|---|
|  |  |  | item.setDeviceSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,item.getDeviceSituation())); | 
|---|
|  |  |  | item.setFurnitureSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,item.getFurnitureSituation())); | 
|---|
|  |  |  | item.setContract(tContracts.stream().filter(contract -> contract.getId().equals(item.getContractId())).findFirst().orElse(null)); | 
|---|
|  |  |  | item.setHouse(tHouses.stream().filter(house -> house.getId().equals(item.getHouseId())).findFirst().orElse(null)); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | pageInfo.setRecords(list); | 
|---|
|  |  |  | return pageInfo; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|