From 73ca308db4ae3d214780f7e614bc87c61e8deda4 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Sun, 24 Apr 2022 17:31:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9F=A5=E8=AF=A2=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E9=BB=91=E5=90=8D=E5=8D=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/rent/RentBlacklistDTO.java | 3 +++ .../power/dto/rent/RentContractInfoDTO.java | 4 ++++ .../modules/rent/dao/RentContractInfoDao.java | 15 ++++++++++++- .../impl/RentBlacklistServiceImpl.java | 22 +++++++++++++------ .../impl/RentContractInfoServiceImpl.java | 10 ++++----- .../mapper/rent/RentContractInfoDao.xml | 10 ++++++++- 6 files changed, 49 insertions(+), 15 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java index 0c55a06..8c98b7b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java @@ -4,6 +4,8 @@ import java.io.Serializable; import java.util.Date; import lombok.Data; +import javax.validation.constraints.NotBlank; + /** * 黑名单表 @@ -34,6 +36,7 @@ public class RentBlacklistDTO implements Serializable { /** * 身份证 */ + @NotBlank(message = "身份证不能为空") private String idCard; /** diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java index fa79a92..eafdb9c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java @@ -197,4 +197,8 @@ public class RentContractInfoDTO implements Serializable { @NotEmpty private List fileList; + /** + * 是否黑名单 + */ + private String isBlack; } \ 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/dao/RentContractInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractInfoDao.java index 5627f0e..52eb08e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractInfoDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractInfoDao.java @@ -1,9 +1,13 @@ package com.epmet.plugin.power.modules.rent.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; +import java.util.Map; + /** * 合同表 * @@ -12,5 +16,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface RentContractInfoDao extends BaseDao { - + + /** + * 获取合同列表 + * + * @param params + * @return java.util.List + * @author zhy + * @date 2022/4/24 17:18 + */ + List getContractInfoList(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/service/impl/RentBlacklistServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java index 1272ce8..e27c9e5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java @@ -3,6 +3,7 @@ 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; @@ -17,6 +18,7 @@ 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; @@ -48,13 +50,13 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - String name = (String)params.get("name"); - String idCard = (String)params.get("idCard"); - String mobile = (String)params.get("mobile"); - String startTime = (String)params.get("startTime"); - String endTime = (String)params.get("endTime"); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String name = (String) params.get("name"); + String idCard = (String) params.get("idCard"); + String mobile = (String) params.get("mobile"); + String startTime = (String) params.get("startTime"); + String endTime = (String) params.get("endTime"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -76,6 +78,12 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl params = new HashMap<>(4); + params.put("idCard", dto.getIdCard()); + if (!list(params).isEmpty()) { + throw new EpmetException("该人员已经在黑名单"); + } + RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class); insert(entity); } 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 a98971b..894bd92 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 @@ -6,7 +6,6 @@ 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.utils.ConvertUtils; import com.epmet.plugin.power.dto.rent.RentContractFileDTO; @@ -50,11 +49,10 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, RentContractInfoDTO.class); + IPage 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/resources/mapper/rent/RentContractInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml index af402ab..6d550e2 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml @@ -33,5 +33,13 @@ - + \ No newline at end of file