From 41ff99cedb97a6caaa4dd40ca3efeb5541bc22c3 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Wed, 11 May 2022 09:20:06 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=A7=9F=E6=88=BF?= =?UTF-8?q?=E5=90=88=E5=90=8C=E4=BF=AE=E6=94=B9=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentContractInfoServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 94d1de1..79d7d0b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -242,12 +242,12 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); long idCardNum = tenantList.stream().map(RentTenantInfoEntity::getIdCard).collect(Collectors.toList()).stream().distinct().count(); if (tenantList.size() != idCardNum) { - return new Result().error("租客身份证重复"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"租客身份证重复"); } tenantList.forEach(tenant -> { @@ -279,7 +279,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); fileList.forEach(item -> { From fa9129860cdc6196026a4c9090f5b99da45a31a8 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 11 May 2022 10:35:57 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B4=AD=E6=88=BF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/rent/RentHouseDTO.java | 190 ++++++++++++++++++ .../rent/controller/RentHouseController.java | 82 ++++++++ .../power/modules/rent/dao/RentHouseDao.java | 16 ++ .../modules/rent/entity/RentHouseEntity.java | 160 +++++++++++++++ .../modules/rent/excel/RentHouseExcel.java | 121 +++++++++++ .../modules/rent/redis/RentHouseRedis.java | 30 +++ .../rent/service/RentHouseService.java | 78 +++++++ .../service/impl/RentHouseServiceImpl.java | 87 ++++++++ .../resources/mapper/rent/RentHouseDao.xml | 44 ++++ 9 files changed, 808 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentHouseService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentHouseDao.xml diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java new file mode 100644 index 0000000..9074d52 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java @@ -0,0 +1,190 @@ +package com.epmet.plugin.power.dto.rent; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@Data +public class RentHouseDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 房屋主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id + */ + private String buildingUnitId; + + /** + * 房屋名字后台插入时生成 + */ + private String houseName; + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType; + + /** + * 存储字典value + */ + private String purpose; + + /** + * 1:出租 0:自住 2:闲置 + */ + private Integer rentFlag; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证号 + */ + private String ownerIdCard; + + /** + * 排序 + */ + private BigDecimal sort; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 社区ID + */ + private String communityId; + + /** + * 社区 + */ + private String communityName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 + */ + private String gridName; + + /** + * 房屋小区ID + */ + private String villageId; + + /** + * 房屋小区 + */ + private String villageName; + + /** + * 楼号ID + */ + private String buildId; + + /** + * 楼号 + */ + private String buildName; + + /** + * 单元ID + */ + private String unitId; + + /** + * 单元 + */ + private String unitName; + + /** + * 房屋ID + */ + private String homeId; + + /** + * 房屋 + */ + private String homeName; + + /** + * 购房日期 + */ + private String purchaseDate; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java new file mode 100644 index 0000000..bf9481d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.rent.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.plugin.power.dto.rent.RentHouseDTO; +import com.epmet.plugin.power.modules.rent.excel.RentHouseExcel; +import com.epmet.plugin.power.modules.rent.service.RentHouseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@RestController +@RequestMapping("rentHouse") +public class RentHouseController { + + @Autowired + private RentHouseService rentHouseService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = rentHouseService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + RentHouseDTO data = rentHouseService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody RentHouseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + rentHouseService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody RentHouseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + rentHouseService.update(dto); + return new Result(); + } + + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + rentHouseService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = rentHouseService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, RentHouseExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java new file mode 100644 index 0000000..2975d72 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.rent.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@Mapper +public interface RentHouseDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java new file mode 100644 index 0000000..9a465d3 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java @@ -0,0 +1,160 @@ +package com.epmet.plugin.power.modules.rent.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_rent_house") +public class RentHouseEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id + */ + private String buildingUnitId; + + /** + * 房屋名字后台插入时生成 + */ + private String houseName; + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType; + + /** + * 存储字典value + */ + private String purpose; + + /** + * 1:出租 0:自住 2:闲置 + */ + private Integer rentFlag; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证号 + */ + private String ownerIdCard; + + /** + * 排序 + */ + private BigDecimal sort; + + /** + * 社区ID + */ + private String communityId; + + /** + * 社区 + */ + private String communityName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 + */ + private String gridName; + + /** + * 房屋小区ID + */ + private String villageId; + + /** + * 房屋小区 + */ + private String villageName; + + /** + * 楼号ID + */ + private String buildId; + + /** + * 楼号 + */ + private String buildName; + + /** + * 单元ID + */ + private String unitId; + + /** + * 单元 + */ + private String unitName; + + /** + * 房屋ID + */ + private String homeId; + + /** + * 房屋 + */ + private String homeName; + + /** + * 购房日期 + */ + private String purchaseDate; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java new file mode 100644 index 0000000..41aead0 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java @@ -0,0 +1,121 @@ +package com.epmet.plugin.power.modules.rent.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@Data +public class RentHouseExcel { + + @Excel(name = "房屋主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "小区id") + private String neighborHoodId; + + @Excel(name = "片区id,neighbor_hood_part.id,可为空。") + private String partId; + + @Excel(name = "所属楼栋id") + private String buildingId; + + @Excel(name = "所属单元id") + private String buildingUnitId; + + @Excel(name = "房屋名字后台插入时生成") + private String houseName; + + @Excel(name = "门牌号") + private String doorName; + + @Excel(name = "房屋类型,1楼房,2平房,3别墅") + private String houseType; + + @Excel(name = "存储字典value") + private String purpose; + + @Excel(name = "1:出租 0:自住 2:闲置") + private Integer rentFlag; + + @Excel(name = "房主姓名") + private String ownerName; + + @Excel(name = "房主电话") + private String ownerPhone; + + @Excel(name = "房主身份证号") + private String ownerIdCard; + + @Excel(name = "排序") + private BigDecimal sort; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "社区ID") + private String communityId; + + @Excel(name = "社区") + private String communityName; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "网格") + private String gridName; + + @Excel(name = "房屋小区ID") + private String villageId; + + @Excel(name = "房屋小区") + private String villageName; + + @Excel(name = "楼号ID") + private String buildId; + + @Excel(name = "楼号") + private String buildName; + + @Excel(name = "单元ID") + private String unitId; + + @Excel(name = "单元") + private String unitName; + + @Excel(name = "房屋ID") + private String homeId; + + @Excel(name = "房屋") + private String homeName; + + @Excel(name = "购房日期") + private String purchaseDate; + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java new file mode 100644 index 0000000..4165a7e --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.rent.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@Component +public class RentHouseRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentHouseService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentHouseService.java new file mode 100644 index 0000000..27caab0 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentHouseService.java @@ -0,0 +1,78 @@ +package com.epmet.plugin.power.modules.rent.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.rent.RentHouseDTO; +import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; + +import java.util.List; +import java.util.Map; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +public interface RentHouseService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-11 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return RentHouseDTO + * @author generator + * @date 2022-05-11 + */ + RentHouseDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-11 + */ + void save(RentHouseDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-11 + */ + void update(RentHouseDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-11 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java new file mode 100644 index 0000000..e4cef4d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java @@ -0,0 +1,87 @@ +package com.epmet.plugin.power.modules.rent.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.plugin.power.modules.rent.dao.RentHouseDao; +import com.epmet.plugin.power.dto.rent.RentHouseDTO; +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.service.RentHouseService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@Service +public class RentHouseServiceImpl extends BaseServiceImpl implements RentHouseService { + + @Autowired + private RentHouseRedis rentHouseRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, RentHouseDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, RentHouseDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public RentHouseDTO get(String id) { + RentHouseEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RentHouseDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(RentHouseDTO dto) { + RentHouseEntity entity = ConvertUtils.sourceToTarget(dto, RentHouseEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(RentHouseDTO dto) { + RentHouseEntity entity = ConvertUtils.sourceToTarget(dto, RentHouseEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentHouseDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentHouseDao.xml new file mode 100644 index 0000000..af389c5 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentHouseDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 9cc8cb2452a0d8721955493e9f699c6d5c42ad62 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 11 May 2022 13:37:35 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E5=90=88=E5=90=8C?= =?UTF-8?q?=E7=AD=BE=E8=AE=A2=E6=9B=B4=E6=96=B0=E6=88=BF=E5=B1=8B=E7=8A=B6?= =?UTF-8?q?=E6=80=81=EF=BC=8C=E6=88=BF=E5=B1=8B=E8=B4=AD=E4=B9=B0=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=88=BF=E5=B1=8B=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/rent/RentHouseDTO.java | 5 +++ .../impl/RentContractInfoServiceImpl.java | 16 ++++++-- .../service/impl/RentHouseServiceImpl.java | 41 +++++++++++++++++-- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java index 9074d52..de045e1 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java @@ -187,4 +187,9 @@ public class RentHouseDTO implements Serializable { */ private String purchaseDate; + /** + * 是否更新 + */ + private String flag; + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 79d7d0b..97f41ae 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -13,8 +13,10 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.IdCardNoValidatorUtils; import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.IcHouseDTO; import com.epmet.dto.IcResiUserAttachmentDTO; import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.IcHouseAddFormDTO; import com.epmet.dto.form.RentTenantFormDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; @@ -162,7 +164,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl houseInfo = govOrgOpenFeignClient.get(dto.getHomeId()); + IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(houseInfo.getData(), IcHouseAddFormDTO.class); + formDTO.setRentFlag(NumConstant.ONE); + govOrgOpenFeignClient.houseUpdate(formDTO); } } @@ -242,12 +250,12 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); long idCardNum = tenantList.stream().map(RentTenantInfoEntity::getIdCard).collect(Collectors.toList()).stream().distinct().count(); if (tenantList.size() != idCardNum) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"租客身份证重复"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客身份证重复"); } tenantList.forEach(tenant -> { @@ -279,7 +287,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); fileList.forEach(item -> { diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java index e4cef4d..2a355f6 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java @@ -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.metadata.IPage; 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.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.plugin.power.modules.rent.dao.RentHouseDao; +import com.epmet.dto.form.IcHouseAddFormDTO; +import com.epmet.feign.GovOrgOpenFeignClient; 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.redis.RentHouseRedis; import com.epmet.plugin.power.modules.rent.service.RentHouseService; @@ -32,6 +34,9 @@ public class RentHouseServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -48,11 +53,33 @@ public class RentHouseServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + 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 wrapper = new QueryWrapper<>(); 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; } @@ -68,6 +95,12 @@ public class RentHouseServiceImpl extends BaseServiceImpl Date: Wed, 11 May 2022 15:16:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E6=88=BF=E5=B1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/rent/RentHouseDTO.java | 2 +- .../modules/rent/excel/RentHouseExcel.java | 98 +++---------------- .../service/impl/RentHouseServiceImpl.java | 2 +- 3 files changed, 13 insertions(+), 89 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java index de045e1..34008cb 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java @@ -190,6 +190,6 @@ public class RentHouseDTO implements Serializable { /** * 是否更新 */ - private String flag; + private Boolean needUpdate; } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java index 41aead0..bea060e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java @@ -3,9 +3,6 @@ package com.epmet.plugin.power.modules.rent.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import lombok.Data; -import java.math.BigDecimal; -import java.util.Date; - /** * 房屋信息 * @@ -15,37 +12,25 @@ import java.util.Date; @Data public class RentHouseExcel { - @Excel(name = "房屋主键") - private String id; - - @Excel(name = "客户id") - private String customerId; - - @Excel(name = "小区id") - private String neighborHoodId; - - @Excel(name = "片区id,neighbor_hood_part.id,可为空。") - private String partId; - - @Excel(name = "所属楼栋id") - private String buildingId; + @Excel(name = "所属小区") + private String villageName; - @Excel(name = "所属单元id") - private String buildingUnitId; + @Excel(name = "所属楼栋") + private String buildName; - @Excel(name = "房屋名字后台插入时生成") - private String houseName; + @Excel(name = "单元号") + private String unitName; @Excel(name = "门牌号") - private String doorName; + private String homeName; - @Excel(name = "房屋类型,1楼房,2平房,3别墅") + @Excel(name = "类型", replace = {"楼房_1", "平房_2", "别墅_3"}) private String houseType; - @Excel(name = "存储字典value") + @Excel(name = "用途", replace = {"住宅_1", "商业_2", "办公_3", "工业_4", "仓储_5", "商住混用_6", "其他_7"}) private String purpose; - @Excel(name = "1:出租 0:自住 2:闲置") + @Excel(name = "房屋状态", replace = {"出租_1", "闲置_2", "自住_0"}) private Integer rentFlag; @Excel(name = "房主姓名") @@ -54,68 +39,7 @@ public class RentHouseExcel { @Excel(name = "房主电话") private String ownerPhone; - @Excel(name = "房主身份证号") + @Excel(name = "房主身份证") private String ownerIdCard; - @Excel(name = "排序") - private BigDecimal sort; - - @Excel(name = "删除标识 0未删除、1已删除") - private String delFlag; - - @Excel(name = "乐观锁") - private Integer revision; - - @Excel(name = "创建人") - private String createdBy; - - @Excel(name = "创建时间") - private Date createdTime; - - @Excel(name = "更新人") - private String updatedBy; - - @Excel(name = "更新时间") - private Date updatedTime; - - @Excel(name = "社区ID") - private String communityId; - - @Excel(name = "社区") - private String communityName; - - @Excel(name = "网格ID") - private String gridId; - - @Excel(name = "网格") - private String gridName; - - @Excel(name = "房屋小区ID") - private String villageId; - - @Excel(name = "房屋小区") - private String villageName; - - @Excel(name = "楼号ID") - private String buildId; - - @Excel(name = "楼号") - private String buildName; - - @Excel(name = "单元ID") - private String unitId; - - @Excel(name = "单元") - private String unitName; - - @Excel(name = "房屋ID") - private String homeId; - - @Excel(name = "房屋") - private String homeName; - - @Excel(name = "购房日期") - private String purchaseDate; - - } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java index 2a355f6..d945038 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java @@ -97,7 +97,7 @@ public class RentHouseServiceImpl extends BaseServiceImpl