@@ -61,7 +61,9 @@ public class YgzCardUploadManager extends AbstractCommNioManager implements LogM | |||
// 调用nio接口 | |||
CardUploadNioResponse nioResponse = (CardUploadNioResponse) sendRequest(nioRequest, CardUploadNioResponse.class); | |||
// 处理返回值 | |||
if (nioResponse == null) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Nio接口返回值为空"); | |||
if (nioResponse == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Nio传输错误,返回值为空"); | |||
} | |||
// 成功 | |||
if (nioResponse.getStatusCode().equals("200")) { | |||
saveDaspOfflineData(request.toJson(), request.getCard().getCardId(), request.getOperation(), OfflineSendType.CARD_UPLOAD); | |||
@@ -98,8 +100,15 @@ public class YgzCardUploadManager extends AbstractCommNioManager implements LogM | |||
response.setSuccess(false); | |||
response.setMsg(errorMsg); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, errorMsg); | |||
} catch (ServiceHandleException e) { | |||
logger.error("YGZ业务校验失败:{}", e.getMessage()); | |||
if (request.isSync()) throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
YgzCardUploadResponse response = new YgzCardUploadResponse(); | |||
response.setSuccess(false); | |||
response.setMsg(e.getMessage()); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, e.getMessage()); | |||
} catch (Exception e) { | |||
if (request.isSync()) throw e; | |||
logger.error("YGZ系统异常:{}", e.getMessage()); | |||
throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
} | |||
} |
@@ -61,6 +61,9 @@ public class YgzObuUploadManager extends AbstractCommNioManager implements LogMa | |||
nioRequest.setInstallChannelId(agencyChannelMapperManager.mapChannelId(nioRequest.getInstallChannelId())); | |||
// 调用nio接口 | |||
ObuUploadNioResponse nioResponse = (ObuUploadNioResponse) sendRequest(nioRequest, ObuUploadNioResponse.class); | |||
if (nioResponse == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Nio传输错误,返回值为空"); | |||
} | |||
// 成功 | |||
if (nioResponse.getStatusCode().equals("200")) { | |||
saveDaspOfflineData(request.toJson(), request.getObu().getObuId(), request.getOperation(), OfflineSendType.OBU_UPLOAD); | |||
@@ -99,8 +102,15 @@ public class YgzObuUploadManager extends AbstractCommNioManager implements LogMa | |||
response.setSuccess(false); | |||
response.setMsg(errorMsg); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, errorMsg); | |||
} catch (ServiceHandleException e) { | |||
logger.error("YGZ业务校验失败:{}", e.getMessage()); | |||
if (request.isSync()) throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
YgzObuUploadResponse response = new YgzObuUploadResponse(); | |||
response.setSuccess(false); | |||
response.setMsg(e.getMessage()); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, e.getMessage()); | |||
} catch (Exception e) { | |||
if (request.isSync()) throw e; | |||
logger.error("YGZ系统异常:{}", e.getMessage()); | |||
throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
} | |||
} |
@@ -35,6 +35,9 @@ public class YgzUserUploadManager extends AbstractCommNioManager implements LogM | |||
nioRequest.setChannelId(agencyChannelMapperManager.mapChannelId(nioRequest.getChannelId())); | |||
// 调用nio接口 | |||
UserUploadNioResponse nioResponse = (UserUploadNioResponse) sendRequest(nioRequest, UserUploadNioResponse.class); | |||
if (nioResponse == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Nio传输错误,返回值为空"); | |||
} | |||
// 成功 | |||
if (nioResponse.getStatusCode().equals("200")) { | |||
saveDaspOfflineData(request.toJson(), request.getCustomer().getCustomerId(), request.getOperation(), OfflineSendType.USER_UPLOAD); | |||
@@ -48,7 +51,6 @@ public class YgzUserUploadManager extends AbstractCommNioManager implements LogM | |||
return serviceHandle(request); | |||
} | |||
if (errorMsg.contains("已存在") && request.getOperation() == Operation.ADD) {// 重发一次 | |||
// 更新时返回错误 用户不存在 需要上传新增用户 | |||
request.setOperation(Operation.UPDATE); | |||
return serviceHandle(request); | |||
} | |||
@@ -56,8 +58,15 @@ public class YgzUserUploadManager extends AbstractCommNioManager implements LogM | |||
response.setSuccess(false); | |||
response.setMsg(errorMsg); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, errorMsg); | |||
} catch (ServiceHandleException e) { | |||
logger.error("YGZ业务校验失败:{}", e.getMessage()); | |||
if (request.isSync()) throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
YgzUserUploadResponse response = new YgzUserUploadResponse(); | |||
response.setSuccess(false); | |||
response.setMsg(e.getMessage()); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, e.getMessage()); | |||
} catch (Exception e) { | |||
if (request.isSync()) throw e; | |||
logger.error("YGZ系统异常:{}", e.getMessage()); | |||
throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
} | |||
} |
@@ -9,10 +9,7 @@ import cn.com.taiji.core.entity.dict.ygz.Operation; | |||
import cn.com.taiji.core.entity.dict.ygz.QtkServiceType; | |||
import cn.com.taiji.core.entity.log.YgzInterfaceLog; | |||
import cn.com.taiji.core.manager.comm.LogManager; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzServiceCmd; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzUserUploadRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzVehicleUploadRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzVehicleUploadResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.*; | |||
import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkCustomerInfoRepo; | |||
import cn.com.taiji.ias.manager.ygz.nio.AbstractCommNioManager; | |||
@@ -46,6 +43,9 @@ public class YgzVehicleUploadManager extends AbstractCommNioManager implements L | |||
nioRequest.setChannelId(agencyChannelMapperManager.mapChannelId(nioRequest.getChannelId())); | |||
// 调用nio接口 | |||
VehicleUploadNioResponse nioResponse = (VehicleUploadNioResponse) sendRequest(nioRequest, VehicleUploadNioResponse.class); | |||
if (nioResponse == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Nio传输错误,返回值为空"); | |||
} | |||
// 成功 | |||
if (nioResponse.getStatusCode().equals("200")) { | |||
saveDaspOfflineData(request.toJson(), request.getVehicle().getVehicleId(), request.getOperation(), OfflineSendType.VEHICLE_UPLOAD); | |||
@@ -81,8 +81,15 @@ public class YgzVehicleUploadManager extends AbstractCommNioManager implements L | |||
response.setSuccess(false); | |||
response.setMsg(errorMsg); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, errorMsg); | |||
} catch (ServiceHandleException e) { | |||
logger.error("YGZ业务校验失败:{}", e.getMessage()); | |||
if (request.isSync()) throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
YgzVehicleUploadResponse response = new YgzVehicleUploadResponse(); | |||
response.setSuccess(false); | |||
response.setMsg(e.getMessage()); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, e.getMessage()); | |||
} catch (Exception e) { | |||
if (request.isSync()) throw e; | |||
logger.error("YGZ系统异常:{}", e.getMessage()); | |||
throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
} | |||
} |
@@ -6,6 +6,7 @@ import cn.com.taiji.core.entity.dict.basic.CardStatus; | |||
import cn.com.taiji.core.entity.dict.basic.DeviceVersion; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import cn.com.taiji.core.entity.dict.invw.InvDeviceStatus; | |||
import cn.com.taiji.core.entity.dict.issue.IssueOrderStatus; | |||
import cn.com.taiji.core.entity.dict.issue.IssueOrderStep; | |||
import cn.com.taiji.core.entity.invw.InvwCardDetails; | |||
import cn.com.taiji.core.entity.invw.InvwObuDetails; | |||
@@ -107,7 +108,8 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In | |||
} | |||
private void businessValidate(IssueOrderinfo orderInfo, InstApplyRequest req) throws ServiceHandleException { | |||
if (IssueOrderStep.ACTIVED == orderInfo.getOrderStep() && IssueOrderStatus.ACTIVE == orderInfo.getOrderStatus()) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("当前订单[" + orderInfo.getOrderNo() + "]已激活成功,请勿重复提交!"); | |||
if (IssueOrderStep.WAITING_ACTIVE != orderInfo.getOrderStep()) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("订单当前状态不可激活"); | |||
} | |||
@@ -195,12 +197,6 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In | |||
} else if (orderInfo.getPromotionModes() == 1 && !hasText(orderinfoExt.getInstallImgUrl())) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("线上模式需要上传设备安装照"); | |||
} | |||
// 线上模式渠道订单发货信息校验 | |||
if (orderInfo.getOrderSource() == SourceType.CHANNEL && orderInfo.getPromotionModes() == 1) { | |||
CsmsnConsignee csmsnConsignee = csmsnConsigneeRepo.findByObuId(orderInfo.getObuId()); | |||
if (csmsnConsignee == null) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("线上模式渠道需要上传发货信息"); | |||
} | |||
//渠道校验 | |||
if (SourceType.CHANNEL == orderInfo.getOrderSource()) { | |||
orderInfo.setCardId(req.getCardId());//渠道验证用,不做持久化 | |||
@@ -213,7 +209,12 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("渠道反馈不可激活:" + noticeResponse.getFailReason()); | |||
} | |||
} | |||
// 线上模式渠道订单发货信息校验 | |||
if (orderInfo.getOrderSource() == SourceType.CHANNEL && orderInfo.getPromotionModes() == 1) { | |||
CsmsnConsignee csmsnConsignee = csmsnConsigneeRepo.findByObuId(orderInfo.getObuId()); | |||
if (csmsnConsignee == null) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("线上模式渠道需要上传发货信息"); | |||
} | |||
} | |||
@Override |