| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.DictConstants; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.TContractMapper; |
| | | import com.ruoyi.system.mapper.THouseMapper; |
| | |
| | | import com.ruoyi.system.query.THouseQuery; |
| | | import com.ruoyi.system.query.TUserHistoryQuery; |
| | | import com.ruoyi.system.service.THouseService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.HouseVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private TContractMapper contractMapper; |
| | | @Override |
| | | public PageInfo<THouse> houseList(THouseQuery query) { |
| | | //查询当前登录用户所属部门 |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | query.setBusinessDeptId(businessDeptId); |
| | | PageInfo<THouse> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<THouse> list = this.baseMapper.houseList(query,pageInfo); |
| | | List<TContract> tContracts = contractMapper.selectList(new LambdaQueryWrapper<TContract>() |
| | | .eq(TContract::getStatus, 4) |
| | | .in(TContract::getStatus, Arrays.asList(4,6,7)) |
| | | .le(TContract::getStartTime, LocalDateTime.now()) |
| | | .ge(TContract::getEndTime, LocalDateTime.now())); |
| | | for (THouse tHouse : list) { |
| | |
| | | if (tContract!=null){ |
| | | tHouse.setTenantType(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_PAY_TYPE,tContract.getPayType())); |
| | | // tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,"2")); |
| | | tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,"2")); |
| | | |
| | | }else{ |
| | | // tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,tHouse.getLeaseStatus())); |
| | | if (tHouse.getLeaseStatus().equals("3")){ |
| | | tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,tHouse.getLeaseStatus())); |
| | | }else{ |
| | | tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,"1")); |
| | | |
| | | } |
| | | } |
| | | tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,tHouse.getLeaseStatus())); |
| | | |
| | | } |
| | | pageInfo.setRecords(list); |
| | |
| | | List<HouseVO> list = this.baseMapper.userHistoryList(query,pageInfo); |
| | | for (HouseVO houseVO : list) { |
| | | houseVO.setTenantAttributes(StringUtils.isNotEmpty(houseVO.getTenantAttributes())?DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_ATTRIBUTE,houseVO.getTenantAttributes()):""); |
| | | houseVO.setProductType(StringUtils.isNotEmpty(houseVO.getTenantType())?DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_TYPE,houseVO.getTenantType()):""); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | /** |
| | | * 获取本季度已出租面积 |
| | | * |
| | | * @param businessDeptId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Double getRentedArea(String businessDeptId) { |
| | | return baseMapper.getRentedArea(businessDeptId); |
| | | } |
| | | } |