|
@ -3,11 +3,13 @@ package com.epmet.plugin.power.modules.rent.service.impl; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
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.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.dto.form.IcHouseAddFormDTO; |
|
|
import com.epmet.plugin.power.modules.rent.dao.RentHouseDao; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
import com.epmet.plugin.power.dto.rent.RentHouseDTO; |
|
|
import com.epmet.plugin.power.dto.rent.RentHouseDTO; |
|
|
|
|
|
import com.epmet.plugin.power.modules.rent.dao.RentHouseDao; |
|
|
import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; |
|
|
import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; |
|
|
import com.epmet.plugin.power.modules.rent.redis.RentHouseRedis; |
|
|
import com.epmet.plugin.power.modules.rent.redis.RentHouseRedis; |
|
|
import com.epmet.plugin.power.modules.rent.service.RentHouseService; |
|
|
import com.epmet.plugin.power.modules.rent.service.RentHouseService; |
|
@ -32,6 +34,9 @@ public class RentHouseServiceImpl extends BaseServiceImpl<RentHouseDao, RentHous |
|
|
@Autowired |
|
|
@Autowired |
|
|
private RentHouseRedis rentHouseRedis; |
|
|
private RentHouseRedis rentHouseRedis; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<RentHouseDTO> page(Map<String, Object> params) { |
|
|
public PageData<RentHouseDTO> page(Map<String, Object> params) { |
|
|
IPage<RentHouseEntity> page = baseDao.selectPage( |
|
|
IPage<RentHouseEntity> page = baseDao.selectPage( |
|
@ -48,11 +53,33 @@ public class RentHouseServiceImpl extends BaseServiceImpl<RentHouseDao, RentHous |
|
|
return ConvertUtils.sourceToTarget(entityList, RentHouseDTO.class); |
|
|
return ConvertUtils.sourceToTarget(entityList, RentHouseDTO.class); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private QueryWrapper<RentHouseEntity> getWrapper(Map<String, Object> params){ |
|
|
private QueryWrapper<RentHouseEntity> getWrapper(Map<String, Object> params) { |
|
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
String gridId = (String) params.get("gridId"); |
|
|
|
|
|
String villageId = (String) params.get("villageId"); |
|
|
|
|
|
String buildId = (String) params.get("buildId"); |
|
|
|
|
|
String unitId = (String) params.get("unitId"); |
|
|
|
|
|
String homeId = (String) params.get("homeId"); |
|
|
|
|
|
String ownerName = (String) params.get("ownerName"); |
|
|
|
|
|
String ownerPhone = (String) params.get("ownerPhone"); |
|
|
|
|
|
String ownerIdCard = (String) params.get("ownerIdCard"); |
|
|
|
|
|
String rentFlag = (String) params.get("rentFlag"); |
|
|
|
|
|
String startTime = (String) params.get("startTime"); |
|
|
|
|
|
String endTime = (String) params.get("endTime"); |
|
|
|
|
|
|
|
|
QueryWrapper<RentHouseEntity> wrapper = new QueryWrapper<>(); |
|
|
QueryWrapper<RentHouseEntity> wrapper = new QueryWrapper<>(); |
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(villageId), "VILLAGE_ID", villageId); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(buildId), "BUILD_ID", buildId); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(unitId), "UNIT_ID", unitId); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(homeId), "HOME_ID", homeId); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(ownerName), "OWNER_NAME", ownerName); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(ownerPhone), "OWNER_PHONE", ownerPhone); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(ownerIdCard), "OWNER_ID_CARD", ownerIdCard); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(rentFlag), "RENT_FLAG", rentFlag); |
|
|
|
|
|
wrapper.ge(StringUtils.isNotBlank(startTime), "PURCHASE_DATE", startTime); |
|
|
|
|
|
wrapper.le(StringUtils.isNotBlank(endTime), "PURCHASE_DATE", endTime); |
|
|
|
|
|
|
|
|
return wrapper; |
|
|
return wrapper; |
|
|
} |
|
|
} |
|
@ -68,6 +95,12 @@ public class RentHouseServiceImpl extends BaseServiceImpl<RentHouseDao, RentHous |
|
|
public void save(RentHouseDTO dto) { |
|
|
public void save(RentHouseDTO dto) { |
|
|
RentHouseEntity entity = ConvertUtils.sourceToTarget(dto, RentHouseEntity.class); |
|
|
RentHouseEntity entity = ConvertUtils.sourceToTarget(dto, RentHouseEntity.class); |
|
|
insert(entity); |
|
|
insert(entity); |
|
|
|
|
|
|
|
|
|
|
|
// 更新房屋的租赁状态
|
|
|
|
|
|
if (dto.getFlag() == "123") { |
|
|
|
|
|
IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(dto, IcHouseAddFormDTO.class); |
|
|
|
|
|
govOrgOpenFeignClient.houseUpdate(formDTO); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|