|
|
@ -56,6 +56,13 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao |
|
|
|
return getPageData(page, RentTenantInfoDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<RentTenantInfoDTO> page4Landlord(Map<String, Object> params) { |
|
|
|
IPage<RentTenantInfoDTO> page = getPage(params); |
|
|
|
List<RentTenantInfoDTO> list = baseDao.getLandlordList(params); |
|
|
|
return new PageData<>(list, page.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<RentTenantInfoDTO> list(Map<String, Object> params) { |
|
|
|
List<RentTenantInfoEntity> entityList = baseDao.selectList(getWrapper(params)); |
|
|
@ -89,17 +96,19 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao |
|
|
|
public Result save(RentTenantInfoDTO dto) { |
|
|
|
Map<String, Object> params = new HashMap<>(4); |
|
|
|
params.put("idCard", dto.getIdCard()); |
|
|
|
params.put("state", NumConstant.ONE_STR); |
|
|
|
if (!list(params).isEmpty()) { |
|
|
|
return new Result().error("用户已存在"); |
|
|
|
return new Result().error("用户已通过审核"); |
|
|
|
} |
|
|
|
|
|
|
|
List<IcResiUserAttachmentDTO> images = new ArrayList<>(); |
|
|
|
// List<IcResiUserAttachmentDTO> images = new ArrayList<>();
|
|
|
|
// 处理头像
|
|
|
|
if (null == dto.getImgList() || dto.getImgList().isEmpty()) { |
|
|
|
return new Result().error("照片不能为空"); |
|
|
|
} else { |
|
|
|
RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); |
|
|
|
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
entity.setState(NumConstant.ZERO_STR); |
|
|
|
insert(entity); |
|
|
|
|
|
|
|
List<RentContractFileEntity> imgList = ConvertUtils.sourceToTarget(dto.getImgList(), RentContractFileEntity.class); |
|
|
@ -112,12 +121,44 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao |
|
|
|
IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO(); |
|
|
|
image.setAttachmentUrl(img.getFileUrl()); |
|
|
|
image.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
images.add(image); |
|
|
|
// images.add(image);
|
|
|
|
}); |
|
|
|
rentContractFileService.insertBatch(imgList); |
|
|
|
|
|
|
|
// 如果是房东信息立马去更新照片
|
|
|
|
if (NumConstant.ZERO_STR.equals(dto.getType())) { |
|
|
|
// // 如果是房东信息立马去更新照片
|
|
|
|
// if (NumConstant.ZERO_STR.equals(dto.getType())) {
|
|
|
|
// RentTenantFormDTO formDTO = new RentTenantFormDTO();
|
|
|
|
// formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
|
|
|
|
// formDTO.setIdCard(dto.getIdCard());
|
|
|
|
// formDTO.setImages(images);
|
|
|
|
// formDTO.setType(dto.getType());
|
|
|
|
// epmetUserOpenFeignClient.updateImage(formDTO);
|
|
|
|
// }
|
|
|
|
} |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result review(RentTenantInfoDTO dto) { |
|
|
|
Map<String, Object> params = new HashMap<>(4); |
|
|
|
params.put("idCard", dto.getIdCard()); |
|
|
|
params.put("state", NumConstant.ONE_STR); |
|
|
|
if (!list(params).isEmpty()) { |
|
|
|
return new Result().error("用户已通过审核"); |
|
|
|
} |
|
|
|
|
|
|
|
List<IcResiUserAttachmentDTO> images = new ArrayList<>(); |
|
|
|
// 处理头像
|
|
|
|
if (null == dto.getImgList() || dto.getImgList().isEmpty()) { |
|
|
|
return new Result().error("照片不能为空"); |
|
|
|
} else { |
|
|
|
RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); |
|
|
|
updateById(entity); |
|
|
|
|
|
|
|
// 如果是房东信息通过了审核,立马去更新照片
|
|
|
|
if (NumConstant.ZERO_STR.equals(dto.getType()) && NumConstant.ONE_STR.equals(dto.getState())) { |
|
|
|
RentTenantFormDTO formDTO = new RentTenantFormDTO(); |
|
|
|
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
formDTO.setIdCard(dto.getIdCard()); |
|
|
|