|
@ -21,21 +21,27 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.plugin.power.dto.rent.PliRentContractInfoLogDTO; |
|
|
import com.epmet.plugin.power.dto.rent.PliRentContractInfoLogDTO; |
|
|
import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; |
|
|
import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; |
|
|
|
|
|
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; |
|
|
import com.epmet.plugin.power.modules.rent.dao.PliRentContractInfoLogDao; |
|
|
import com.epmet.plugin.power.modules.rent.dao.PliRentContractInfoLogDao; |
|
|
import com.epmet.plugin.power.modules.rent.entity.PliRentContractInfoLogEntity; |
|
|
import com.epmet.plugin.power.modules.rent.entity.PliRentContractInfoLogEntity; |
|
|
|
|
|
import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; |
|
|
import com.epmet.plugin.power.modules.rent.redis.PliRentContractInfoLogRedis; |
|
|
import com.epmet.plugin.power.modules.rent.redis.PliRentContractInfoLogRedis; |
|
|
import com.epmet.plugin.power.modules.rent.service.PliRentContractInfoLogService; |
|
|
import com.epmet.plugin.power.modules.rent.service.PliRentContractInfoLogService; |
|
|
|
|
|
import com.epmet.plugin.power.modules.rent.service.RentContractFileService; |
|
|
|
|
|
import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
import java.util.Arrays; |
|
|
|
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@ -54,6 +60,12 @@ public class PliRentContractInfoLogServiceImpl extends BaseServiceImpl<PliRentCo |
|
|
@Autowired |
|
|
@Autowired |
|
|
private LoginUserUtil loginUserUtil; |
|
|
private LoginUserUtil loginUserUtil; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private RentTenantInfoService rentTenantInfoService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private RentContractFileService rentContractFileService; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<PliRentContractInfoLogDTO> page(Map<String, Object> params) { |
|
|
public PageData<PliRentContractInfoLogDTO> page(Map<String, Object> params) { |
|
|
// IPage<PliRentContractInfoLogEntity> page = baseDao.selectPage(
|
|
|
// IPage<PliRentContractInfoLogEntity> page = baseDao.selectPage(
|
|
@ -90,8 +102,31 @@ public class PliRentContractInfoLogServiceImpl extends BaseServiceImpl<PliRentCo |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PliRentContractInfoLogDTO get(String id) { |
|
|
public PliRentContractInfoLogDTO get(String id) { |
|
|
|
|
|
// PliRentContractInfoLogEntity entity = baseDao.selectById(id);
|
|
|
|
|
|
// return ConvertUtils.sourceToTarget(entity, PliRentContractInfoLogDTO.class);
|
|
|
PliRentContractInfoLogEntity entity = baseDao.selectById(id); |
|
|
PliRentContractInfoLogEntity entity = baseDao.selectById(id); |
|
|
return ConvertUtils.sourceToTarget(entity, PliRentContractInfoLogDTO.class); |
|
|
PliRentContractInfoLogDTO dto = ConvertUtils.sourceToTarget(entity, PliRentContractInfoLogDTO.class); |
|
|
|
|
|
|
|
|
|
|
|
// 取出租客信息
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>(4); |
|
|
|
|
|
params.put("contractId", id); |
|
|
|
|
|
List<RentTenantInfoDTO> tenantList = rentTenantInfoService.list(params); |
|
|
|
|
|
|
|
|
|
|
|
tenantList.forEach(item -> { |
|
|
|
|
|
// 租客信息补充照片信息
|
|
|
|
|
|
item.setImgList(rentContractFileService.listByRefAndType(item.getId(), NumConstant.ZERO_STR)); |
|
|
|
|
|
// 租客信息补充身份证照片信息
|
|
|
|
|
|
item.setIdCardImgList(rentContractFileService.listByRefAndType(item.getId(), NumConstant.TWO_STR)); |
|
|
|
|
|
}); |
|
|
|
|
|
dto.setTenantList(tenantList); |
|
|
|
|
|
dto.setTenantNum(tenantList.size()); |
|
|
|
|
|
|
|
|
|
|
|
// 取出合同文件信息
|
|
|
|
|
|
dto.setFileList(rentContractFileService.listByRefAndType(dto.getId(), NumConstant.ONE_STR)); |
|
|
|
|
|
dto.setAgencyImgList(rentContractFileService.listByRefAndType(dto.getId(), NumConstant.THREE_STR)); |
|
|
|
|
|
dto.setDocList(rentContractFileService.listByRefAndType(dto.getId(), NumConstant.FOUR_STR)); |
|
|
|
|
|
|
|
|
|
|
|
return dto; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|