@@ -18,7 +18,7 @@ import java.time.LocalDateTime; | |||
@Entity | |||
@Table(name = "log_ygz_interface_log") | |||
public class YgzInterfaceLog extends AbstractInterfaceLog { | |||
@Column(name = "unique_id") | |||
@Column(name = "UNIQUE_ID") | |||
private String uniqueId; | |||
@Column(name = "UPDATE_TIME") | |||
private LocalDateTime updateTime; | |||
@@ -28,7 +28,7 @@ public class YgzInterfaceLog extends AbstractInterfaceLog { | |||
@Column(name = "SOURCE") | |||
@Enumerated(EnumType.STRING) | |||
private DataSourceEnum source; | |||
@Column(name = "DATA_SOURCE") | |||
@Column(name = "OPERATION") | |||
@Enumerated(EnumType.STRING) | |||
private Operation operation; | |||
@Column(name = "RESEND_TIMES") |
@@ -34,6 +34,8 @@ public class MyCommHandleManager extends AbstractCommHandleManager { | |||
private OcrServiceHandler ocrServiceHandler; | |||
@Autowired | |||
private IssueServiceHandler issueServiceHandler; | |||
@Autowired | |||
private YgzServiceHandler ygzServiceHandler; | |||
public MyCommHandleManager() { | |||
super(IasServiceSystem.ISSUES); | |||
@@ -50,6 +52,7 @@ public class MyCommHandleManager extends AbstractCommHandleManager { | |||
registerJsonService(validServiceHandler); | |||
registerJsonService(ocrServiceHandler); | |||
registerJsonService(issueServiceHandler); | |||
registerJsonService(ygzServiceHandler); | |||
} | |||
@Override |
@@ -50,9 +50,9 @@ public abstract class AbstractCallBackManager extends AbstractCommManager implem | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("未找到处理模块,请联系管理员"); | |||
logger.info("执行在线激活命令第{}步",request.getStepNo()); | |||
InstCallBackResponse response = cmdHandler.doHandle(request, vo); | |||
response.setStepNo(nextStep(vo, request)).setTransOrderId(request.getTransOrderId()); | |||
//写缓存 | |||
writeCache(cmdHandler.getOrderVo()); | |||
response.setStepNo(nextStep(vo, request)).setTransOrderId(request.getTransOrderId()); | |||
return onSuccess(request, response, InssInterfaceLog.class, System.currentTimeMillis() - begin); | |||
} catch (Exception e) { | |||
logger.error("激活异常", e); |
@@ -22,10 +22,7 @@ public class InstCard0019WriteHandler extends AbstractCommandHandler { | |||
vo.setCmdType("CARD"); | |||
vo.setRandomCode(toRandomCode(cmdResultsStr)); | |||
vo.setFileBytes(file0019Init()); | |||
vo.setValidCard(true); | |||
vo.setValidOrder(true); | |||
vo.setSaveCard(true); | |||
vo.setSaveOrder(true); | |||
return vo; | |||
} catch (ManagerException e) { | |||
logger.error("获取nextCos错误", e); |
@@ -19,10 +19,6 @@ public class InstObuActiveHandler extends AbstractCommandHandler { | |||
IssueOrderVO handleInternal(IssueOrderVO vo, String cmdResultsStr) throws ServiceHandleException { | |||
vo.setCmdType("OBU"); | |||
vo.setRandomCode(toRandomCode(cmdResultsStr)); | |||
vo.setValidObu(true); | |||
vo.setValidOrder(true); | |||
vo.setSaveObu(true); | |||
vo.setSaveOrder(true); | |||
return vo; | |||
} | |||
@@ -33,13 +33,16 @@ public class InstObuSystemInfoWriteHandler extends AbstractCommandHandler { | |||
try { | |||
IssueOrderinfo orderInfo = orderinfoRepo.findByOrderNo(vo.getOrderId()); | |||
// 如果OBU已经发行,跳过OBU发行 | |||
if (orderInfo.getObuStatus() == ObuStatus.ZC) return vo.setObuStatus(orderInfo.getObuStatus()); | |||
if (orderInfo.getObuStatus() == ObuStatus.ZC) { | |||
copyProperties(orderInfo, vo); | |||
return vo.setObuStatus(orderInfo.getObuStatus()); | |||
} | |||
SystemInfoFile systemInfo = toSystemInfo(cmdResultsStr); | |||
vo.setRandomCode(toRandomCode(cmdResultsStr)); | |||
LocalDate enableTime = LocalDate.now(); | |||
LocalDate expireTime = LocalDate.now().plusYears(10L); | |||
vo.setCardEnableTime(enableTime.atTime(0, 0, 0)); | |||
vo.setCardExpireTime(expireTime.atTime(0, 0, 0)); | |||
vo.setObuEnableTime(enableTime.atTime(0, 0, 0)); | |||
vo.setObuExpireTime(expireTime.atTime(0, 0, 0)); | |||
handleFile(vo, systemInfo); | |||
vo.setFileBytes(systemInfo.getFileContent()); | |||
vo.setObuId(systemInfo.getObuId()); | |||
@@ -71,8 +74,8 @@ public class InstObuSystemInfoWriteHandler extends AbstractCommandHandler { | |||
private void handleFile(IssueOrderVO vo, SystemInfoFile systemInfo) throws ServiceHandleException, FormatException { | |||
systemInfo.setEnableTime(vo.getCardEnableTime().format(DateTimeFormatter.ofPattern("yyyyMMdd"))); | |||
systemInfo.setExpireTime(vo.getCardExpireTime().format(DateTimeFormatter.ofPattern("yyyyMMdd"))); | |||
systemInfo.setEnableTime(vo.getObuEnableTime().format(DateTimeFormatter.ofPattern("yyyyMMdd"))); | |||
systemInfo.setExpireTime(vo.getObuExpireTime().format(DateTimeFormatter.ofPattern("yyyyMMdd"))); | |||
} | |||
@@ -125,6 +125,7 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { | |||
cmdHandlers.put(16, instObuVehicleInfoWriteHandler); | |||
cmdHandlers.put(17, instObuRandomReadHandler); | |||
cmdHandlers.put(18, instObuActiveHandler); | |||
cmdHandlers.put(19, instObuRandomReadHandler); | |||
} | |||
@Override | |||
@@ -199,7 +200,12 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该车辆不属于该用户!"); | |||
if (vehicleInfo.getType() == null) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该车辆收费车型为空,请补全车辆信息!"); | |||
// 校验卡签版本是否一致 | |||
//库存检测 | |||
cardDetails = cardDetailsRepo.findBy(vo.getCardId()); | |||
if (cardDetails == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("当前卡不在库存中"); | |||
} | |||
//库存检测 | |||
obuDetails = obuDetailsRepo.findBy(vo.getObuId()); | |||
if (obuDetails == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("当前签不在库存中"); | |||
@@ -213,6 +219,17 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { | |||
@Override | |||
Integer nextStep(IssueOrderVO vo, InstCallBackRequest request) { | |||
if (request.getStepNo() == 8) { | |||
vo.setValidCard(true); | |||
vo.setValidOrder(true); | |||
vo.setSaveCard(true); | |||
vo.setSaveOrder(true); | |||
} else if (request.getStepNo() == 18) { | |||
vo.setValidObu(true); | |||
vo.setValidOrder(true); | |||
vo.setSaveObu(true); | |||
vo.setSaveOrder(true); | |||
} | |||
if (vo.getChargeMoney() == null) | |||
return request.getStepNo() + 1; | |||
else if (vo.getChargeMoney() > 0 && request.getStepNo() == 10) | |||
@@ -223,7 +240,7 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { | |||
return 13; | |||
else if (request.getStepNo() == 11 || request.getStepNo() == 12) | |||
return 9; | |||
else if (request.getStepNo() == 18) | |||
else if (request.getStepNo() == 19) | |||
return 100; | |||
else | |||
return request.getStepNo() + 1; | |||
@@ -233,6 +250,9 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { | |||
@Override | |||
void saveData(IssueOrderVO vo) throws ServiceHandleException { | |||
IssueOrderinfo orderInfo = orderInfoRepo.findByOrderNo(vo.getOrderId()); | |||
if (vo.isSaveOrder()) { | |||
saveOrderInfo(vo, orderInfo); | |||
} | |||
if (vo.isSaveCard()) { | |||
QtkCardInfo cardInfo = saveCardInfo(vo, orderInfo); | |||
//如果是储值卡 则在开卡确认业务成功后 加入初始化卡账存储业务 | |||
@@ -270,9 +290,6 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { | |||
jsonPostRepeat(handleCard(vo.getCardId())); | |||
jsonPostRepeat(handleObu(obuInfo)); | |||
} | |||
if (vo.isSaveOrder()) { | |||
saveOrderInfo(vo, orderInfo); | |||
} | |||
} | |||
private YgzUserUploadRequest handleUser() { | |||
@@ -413,9 +430,9 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { | |||
private QtkObuInfo saveObuInfo(IssueOrderVO vo, IssueOrderinfo orderInfo) { | |||
QtkObuInfo obuInfo = new QtkObuInfo(); | |||
obuInfo.setObuId(vo.getObuId()); | |||
obuInfo.setObuVersion(DeviceVersion.getVersion(vo.getObuVersion())); | |||
obuInfo.setObuStatus(ObuStatus.ZC); | |||
obuInfo.setInsertTime(LocalDateTime.now()); | |||
obuInfo.setObuStatusChangeTime(LocalDateTime.now()); | |||
obuInfo.setCustomerId(customerInfo.getCustomerId()); | |||
obuInfo.setVehicleId(vehicleInfo.getVehicleId()); | |||
obuInfo.setRegisteredType(orderInfo.getPromotionModes()); | |||
@@ -424,7 +441,6 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { | |||
obuInfo.setChannelId(orderInfo.getChannelId()); | |||
obuInfo.setDeviceType(orderInfo.getDeviceType()); | |||
obuInfo.setRegisteredTime(LocalDateTime.now()); | |||
obuInfo.setUpdateTime(LocalDateTime.now()); | |||
obuInfo.setObuBrand(obuDetails.getBrand()); | |||
obuInfo.setObuNetId(vo.getObuId().substring(0, 4)); | |||
obuInfo.setObuStatusChangeTime(LocalDateTime.now()); |