|
|
@ -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<RentBlacklistDao, |
|
|
|
return ConvertUtils.sourceToTarget(entityList, RentBlacklistDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<RentBlacklistEntity> getWrapper(Map<String, Object> 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<RentBlacklistEntity> getWrapper(Map<String, Object> 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<RentBlacklistEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
@ -76,6 +78,12 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl<RentBlacklistDao, |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void save(RentBlacklistDTO dto) { |
|
|
|
Map<String, Object> 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); |
|
|
|
} |
|
|
|