mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-05 18:40:14 +08:00
新增白名单的时候,做唯一校验
This commit is contained in:
@@ -13,7 +13,6 @@ import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
import com.jsowell.common.util.sign.MD5Util;
|
||||
import com.jsowell.netty.factory.YKCOperateFactory;
|
||||
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
||||
import com.jsowell.pile.domain.PileAuthCard;
|
||||
@@ -186,11 +185,11 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
||||
// 通过vin码查询数据库绑定用户信息
|
||||
MemberPlateNumberRelation plateInfo = memberPlateNumberRelationService.getMemberPlateInfoByVinCode(vinCode);
|
||||
if (plateInfo == null) {
|
||||
throw new BusinessException("", "未查到绑定用户信息");
|
||||
throw new BusinessException("", vinCode + "未查到绑定用户信息");
|
||||
}
|
||||
if (!StringUtils.equals("1", plateInfo.getVinStatus())) {
|
||||
// 1- 正常使用
|
||||
throw new BusinessException("", "vin状态不正确");
|
||||
throw new BusinessException("", vinCode + "vin状态不正确");
|
||||
}
|
||||
// vin码生成订单 vin启动充电
|
||||
GenerateOrderDTO dto = new GenerateOrderDTO();
|
||||
|
||||
@@ -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