Browse Source

修改异常类为renexception

dev_power_axis
zhangyuan 3 years ago
parent
commit
5f5ebde53e
  1. 10
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java
  2. 8
      epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml
  3. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java
  4. 10
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java
  5. 28
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java
  6. 8
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java
  7. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java

10
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java

@ -25,6 +25,16 @@ public class RentContractInfoDTO implements Serializable {
*/
private String id;
/**
* 社区ID
*/
private String communityId;
/**
* 社区
*/
private String communityName;
/**
* 网格ID
*/

8
epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml

@ -20,6 +20,12 @@
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-plugins-common</artifactId>
@ -187,7 +193,7 @@
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip>192.168.43.168</nacos.ip>
<nacos.ip>192.168.43.26</nacos.ip>
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>

2
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java

@ -63,7 +63,7 @@ public class RentBlacklistController {
return new Result();
}
@PostMapping("delete")
@DeleteMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");

10
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java

@ -21,6 +21,16 @@ public class RentContractInfoEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 社区ID
*/
private String communityId;
/**
* 社区
*/
private String communityName;
/**
* 网格ID
*/

28
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java

@ -3,11 +3,17 @@ 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.exception.EpmetException;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.RentTenantDataFormDTO;
import com.epmet.dto.result.RentTenantDataResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.plugin.power.modules.rent.dao.RentBlacklistDao;
import com.epmet.plugin.power.dto.rent.RentBlacklistDTO;
import com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity;
@ -18,10 +24,7 @@ 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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 黑名单表
@ -35,6 +38,9 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl<RentBlacklistDao,
@Autowired
private RentBlacklistRedis rentBlacklistRedis;
@Autowired
private EpmetUserOpenFeignClient client;
@Autowired
LoginUserUtil loginUserUtil;
@ -82,12 +88,20 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl<RentBlacklistDao,
@Override
@Transactional(rollbackFor = Exception.class)
public void save(RentBlacklistDTO dto) {
RentTenantDataFormDTO formDTO = new RentTenantDataFormDTO();
formDTO.setUserId(dto.getUserId());
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
Result<RentTenantDataResultDTO> result = client.tenantData(formDTO);
dto.setIdCard(result.getData().getIdCard());
dto.setMobile(result.getData().getMobile());
Map<String, Object> params = new HashMap<>(4);
params.put("idCard", dto.getIdCard());
if (!list(params).isEmpty()) {
throw new EpmetException("该人员已经在黑名单");
throw new RenException("该人员已经在黑名单");
}
dto.setJoinDate(DateUtils.format(new Date()));
RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class);
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
insert(entity);
@ -96,8 +110,10 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl<RentBlacklistDao,
@Override
@Transactional(rollbackFor = Exception.class)
public void update(RentBlacklistDTO dto) {
dto.setRemoveReason(DateUtils.format(new Date()));
RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class);
updateById(entity);
baseDao.deleteBatchIds(Collections.singletonList(entity.getId()));
}
@Override

8
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java

@ -5,7 +5,7 @@ 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.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -184,7 +184,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
rentContractFileService.deletePhysical(params);
if (dto.getTenantList().isEmpty()) {
throw new EpmetException("租客不能为空");
throw new RenException("租客不能为空");
} else {
List<RentTenantInfoEntity> tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class);
tenantList.forEach(tenant -> {
@ -202,7 +202,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
// 处理租客头像
dto.getTenantList().forEach(tenant -> {
if (tenant.getImgList().isEmpty()) {
throw new EpmetException("租客照片不能为空");
throw new RenException("租客照片不能为空");
} else {
List<RentContractFileEntity> imgList = ConvertUtils.sourceToTarget(tenant.getImgList(), RentContractFileEntity.class);
imgList.forEach(img -> {
@ -216,7 +216,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
}
if (dto.getFileList().isEmpty()) {
throw new EpmetException("合同附件不能为空");
throw new RenException("合同附件不能为空");
} else {
List<RentContractFileEntity> fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class);
fileList.forEach(item -> {

4
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java

@ -5,7 +5,7 @@ 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.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -83,7 +83,7 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao
public void save(RentTenantInfoDTO dto) {
// 处理头像
if (dto.getImgList().isEmpty()) {
throw new EpmetException("照片不能为空");
throw new RenException("照片不能为空");
} else {
RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class);
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());

Loading…
Cancel
Save