mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
新增白名单的时候,做唯一校验
This commit is contained in:
@@ -9,6 +9,7 @@ import com.jsowell.pile.domain.PileStationWhitelist;
|
||||
import com.jsowell.pile.mapper.PileStationWhitelistMapper;
|
||||
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||
import com.jsowell.pile.service.IPileStationWhitelistService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -67,6 +68,11 @@ public class PileStationWhitelistServiceImpl implements IPileStationWhitelistSer
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_MEMBER_NOT_FOUND_ERROR);
|
||||
}
|
||||
pileStationWhitelist.setMemberId(memberInfo.getMemberId());
|
||||
// 查询是否已经绑定过
|
||||
List<PileStationWhitelist> list = pileStationWhitelistMapper.selectPileStationWhitelistList(pileStationWhitelist);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
return 0;
|
||||
}
|
||||
return pileStationWhitelistMapper.insertPileStationWhitelist(pileStationWhitelist);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user