Browse Source

房东信息审核

develop
zhangyuan 3 years ago
parent
commit
87f1a12c04
  1. 10
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java
  2. 14
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java
  3. 12
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java
  4. 10
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java
  5. 22
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java
  6. 1
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java
  7. 51
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java
  8. 31
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml

10
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;
/**
* 头像列表
*/

14
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<PageData<RentTenantInfoDTO>>().ok(page);
}
@RequestMapping("landlord/page")
public Result<PageData<RentTenantInfoDTO>> page4Landlord(@RequestParam Map<String, Object> params) {
PageData<RentTenantInfoDTO> page = rentTenantInfoService.page4Landlord(params);
return new Result<PageData<RentTenantInfoDTO>>().ok(page);
}
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
public Result<RentTenantInfoDTO> 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) {

12
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<RentTenantInfoEntity> {
*/
void deletePhysical(Map<String, Object> params);
/**
* 查询房东列表
*
* @param params
* @return java.util.List<com.epmet.plugin.power.dto.rent.RentTenantInfoDTO>
* @author zhy
* @date 2022/5/5 13:57
*/
List<RentTenantInfoDTO> getLandlordList(Map<String, Object> params);
}

10
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
*/

22
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<RentTenantInfoEntity>
*/
PageData<RentTenantInfoDTO> page(Map<String, Object> params);
/**
* 房东分页
*
* @param params
* @return PageData<RentTenantInfoDTO>
* @author generator
* @date 2022-04-22
*/
PageData<RentTenantInfoDTO> page4Landlord(Map<String, Object> params);
/**
* 默认查询
*
@ -48,7 +58,7 @@ public interface RentTenantInfoService extends BaseService<RentTenantInfoEntity>
RentTenantInfoDTO get(String id);
/**
* 默认保存
* 默认保存-房东信息
*
* @param dto
* @return void
@ -57,6 +67,16 @@ public interface RentTenantInfoService extends BaseService<RentTenantInfoEntity>
*/
Result save(RentTenantInfoDTO dto);
/**
* 审核
*
* @param dto
* @return void
* @author generator
* @date 2022-04-22
*/
Result review(RentTenantInfoDTO dto);
/**
* 默认更新
*

1
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<RentContractInf
IPage<RentContractInfoDTO> page = getPage(params);
List<RentContractInfoDTO> list = baseDao.getContractInfoList(params);
return new PageData<>(list, page.getTotal());
}
@Override

51
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<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());

31
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml

@ -11,6 +11,7 @@
<result property="mobile" column="MOBILE"/>
<result property="yfzgx" column="YFZGX"/>
<result property="type" column="TYPE"/>
<result property="state" column="STATE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
@ -32,4 +33,34 @@
</if>
</where>
</delete>
<select id="getLandlordList" resultType="com.epmet.plugin.power.dto.rent.RentTenantInfoDTO">>
SELECT
ID,
NAME,
ID_CARD,
MOBILE,
YFZGX,
TYPE,
STATE,
CREATED_TIME,
UPDATED_TIME
FROM
pli_rent_tenant_info
WHERE
DEL_FLAG = '0'
AND TYPE = '0'
<if test="state != null and state != ''">
AND STATE = #{state}
</if>
<if test="name != null and name != ''">
AND NAME LIKE concat('%', #{name}, '%')
</if>
<if test="mobile != null and mobile != ''">
AND MOBILE LIKE concat('%', #{mobile}, '%')
</if>
<if test="idCard != null and idCard != ''">
AND ID_CARD LIKE concat('%', #{idCard}, '%')
</if>
</select>
</mapper>
Loading…
Cancel
Save