diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java index e7ffb7b..14a5eb1 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java @@ -58,6 +58,16 @@ public class RentTenantInfoDTO implements Serializable { @NotBlank(message = "人员类型不能为空") private String type; + /** + * 审核状态 0:未审核 1:已审核(房东审核使用) + */ + private String state; + + /** + * 审核-原因 + */ + private String reason; + /** * 头像列表 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java index 7fdd761..082e14e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -39,6 +39,12 @@ public class RentTenantInfoController { return new Result>().ok(page); } + @RequestMapping("landlord/page") + public Result> page4Landlord(@RequestParam Map params) { + PageData page = rentTenantInfoService.page4Landlord(params); + return new Result>().ok(page); + } + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) public Result get(@PathVariable("id") String id) { RentTenantInfoDTO data = rentTenantInfoService.get(id); @@ -53,6 +59,14 @@ public class RentTenantInfoController { return rentTenantInfoService.save(dto); } + @NoRepeatSubmit + @PostMapping("landlord/review") + public Result review(@RequestBody RentTenantInfoDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return rentTenantInfoService.review(dto); + } + @NoRepeatSubmit @PostMapping("update") public Result update(@RequestBody RentTenantInfoDTO dto) { diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java index 29cc2c7..443b2b7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java @@ -1,9 +1,11 @@ package com.epmet.plugin.power.modules.rent.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; import java.util.Map; /** @@ -25,4 +27,14 @@ public interface RentTenantInfoDao extends BaseDao { */ void deletePhysical(Map params); + /** + * 查询房东列表 + * + * @param params + * @return java.util.List + * @author zhy + * @date 2022/5/5 13:57 + */ + List getLandlordList(Map params); + } \ 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/RentTenantInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java index 5aec950..4f7e9e0 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java @@ -54,6 +54,16 @@ public class RentTenantInfoEntity extends BaseEpmetEntity { */ private String type; + /** + * 审核状态 0:未审核 1:已审核(房东审核使用) + */ + private String state; + + /** + * 审核-原因 + */ + private String reason; + /** * 客户ID */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java index bbe0401..8d548d4 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java @@ -27,6 +27,16 @@ public interface RentTenantInfoService extends BaseService */ PageData page(Map params); + /** + * 房东分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-04-22 + */ + PageData page4Landlord(Map params); + /** * 默认查询 * @@ -48,7 +58,7 @@ public interface RentTenantInfoService extends BaseService RentTenantInfoDTO get(String id); /** - * 默认保存 + * 默认保存-房东信息 * * @param dto * @return void @@ -57,6 +67,16 @@ public interface RentTenantInfoService extends BaseService */ Result save(RentTenantInfoDTO dto); + /** + * 审核 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + Result review(RentTenantInfoDTO dto); + /** * 默认更新 * 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 6db1756..e90f359 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 @@ -69,7 +69,6 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl page = getPage(params); List list = baseDao.getContractInfoList(params); return new PageData<>(list, page.getTotal()); - } @Override diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java index 80eb329..05700f3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java @@ -56,6 +56,13 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl page4Landlord(Map params) { + IPage page = getPage(params); + List list = baseDao.getLandlordList(params); + return new PageData<>(list, page.getTotal()); + } + @Override public List list(Map params) { List entityList = baseDao.selectList(getWrapper(params)); @@ -89,17 +96,19 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl 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 images = new ArrayList<>(); +// List 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 imgList = ConvertUtils.sourceToTarget(dto.getImgList(), RentContractFileEntity.class); @@ -112,12 +121,44 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(4); + params.put("idCard", dto.getIdCard()); + params.put("state", NumConstant.ONE_STR); + if (!list(params).isEmpty()) { + return new Result().error("用户已通过审核"); + } + + List 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()); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml index 08f588a..48dfab1 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml @@ -11,6 +11,7 @@ + @@ -32,4 +33,34 @@ + + \ No newline at end of file