|
|
@@ -113,7 +113,7 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("卡已使用或已报损"); |
|
|
|
} |
|
|
|
InvwWarehouse cardWarehouse = warehouseRepo.findByCode(cardDetail.getStoreCode()); |
|
|
|
if (cardWarehouse == null){ |
|
|
|
if (cardWarehouse == null) { |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("卡仓库不存在!"); |
|
|
|
} else if (EnableStatus.ENABLE != cardWarehouse.getStatus()) { |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException(cardWarehouse.getName() + "仓库已禁用:" + cardDetail.getStoreCode()); |
|
|
@@ -132,9 +132,9 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("OBU已使用或已报损"); |
|
|
|
} |
|
|
|
InvwWarehouse obuWarehouse = warehouseRepo.findByCode(obuDetail.getStoreCode()); |
|
|
|
if (obuWarehouse == null){ |
|
|
|
if (obuWarehouse == null) { |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("仓库不存在!"); |
|
|
|
}else if ( EnableStatus.ENABLE != obuWarehouse.getStatus()) { |
|
|
|
} else if (EnableStatus.ENABLE != obuWarehouse.getStatus()) { |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException(obuWarehouse.getName() + "仓库已禁用:" + obuDetail.getStoreCode()); |
|
|
|
} else if (obuWarehouse.getIsCheck() != null && obuWarehouse.getIsCheck() == 1 |
|
|
|
&& !obuWarehouse.getAgencyId().equals(orderInfo.getAgencyId())) { |
|
|
@@ -146,6 +146,23 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In |
|
|
|
if (cardVersion != obuVersion) { |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("卡和OBU版本不一致"); |
|
|
|
} |
|
|
|
|
|
|
|
// 卡类型校验 |
|
|
|
String realCardTypeStr = req.getCardId().substring(8, 10); |
|
|
|
switch (orderInfo.getCardType()) { |
|
|
|
case CHARGE_CARD: |
|
|
|
case PRE_CHARGE_CARD: |
|
|
|
if (!realCardTypeStr.equals("23")) |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("申请卡类型与设备实际卡类型不一致"); |
|
|
|
break; |
|
|
|
case STORED_VALUE_CARD: |
|
|
|
if (!realCardTypeStr.equals("22")) |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("申请卡类型与设备实际卡类型不一致"); |
|
|
|
break; |
|
|
|
default: |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("未知卡类型"); |
|
|
|
} |
|
|
|
|
|
|
|
//渠道校验 |
|
|
|
if (SourceType.CHANNEL == orderInfo.getOrderSource()) { |
|
|
|
AtsChannelNoticeResponse noticeResponse = qdCallUtil.callBackQd(orderInfo, ""); |