|
|
@@ -404,7 +404,7 @@ public class IssueOrderQueryManageImpl extends AbstractManagewManager implements |
|
|
|
String openId = findOpenIdByToken(reqDto.getAccessToken());//操作人openId |
|
|
|
String msg = "";//日志信息 |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
if (RechangeStatus.SUCCESS.equals(rechange.getRechangeStatus())) { |
|
|
|
if (RechangeStatus.SUCCESS.equals(reqDto.getRechangeStatus())) { |
|
|
|
msg = "发行换货申请审核通过"; |
|
|
|
//校验卡、obu |
|
|
|
CarObuDetails result = checkSendCardObu(reqDto.getNewCardId(), reqDto.getNewObuId()); |
|
|
@@ -430,6 +430,7 @@ public class IssueOrderQueryManageImpl extends AbstractManagewManager implements |
|
|
|
issueOrderPost.setInfo(reqDto.getInfo()); |
|
|
|
issueOrderinfoPostRepo.persist(issueOrderPost); |
|
|
|
order.setOrderStep(IssueOrderStep.WAITING_RECEIVE); |
|
|
|
order.setShippingStatus(ShippingStatus.WAIT_RECEIVING); |
|
|
|
rechange.setAuditInfo(reqDto.getInfo()); |
|
|
|
rechange.setPostId(issueOrderPost.getId()); |
|
|
|
}else{ |
|
|
@@ -439,6 +440,7 @@ public class IssueOrderQueryManageImpl extends AbstractManagewManager implements |
|
|
|
issueOrderPost.setCardId(reqDto.getNewCardId()); |
|
|
|
issueOrderinfoPostRepo.merge(issueOrderPost); |
|
|
|
order.setOrderStep(IssueOrderStep.WAITING_ACTIVE); |
|
|
|
order.setShippingStatus(ShippingStatus.NONE); |
|
|
|
rechange.setAuditInfo(reqDto.getInfo()+",系统判断:无需发货"); |
|
|
|
} |
|
|
|
rechange.setRechangeStatus(RechangeStatus.SUCCESS); |
|
|
@@ -451,8 +453,9 @@ public class IssueOrderQueryManageImpl extends AbstractManagewManager implements |
|
|
|
invwObuDetailsRepo.merge(result.getObuDetails()); |
|
|
|
} else { |
|
|
|
msg = "发行换货申请审核失败"; |
|
|
|
//订单状态要变更 |
|
|
|
//订单状态要变更(恢复原状态) |
|
|
|
order.setOrderStep(IssueOrderStep.WAITING_ACTIVE); |
|
|
|
// order.setShippingStatus(ShippingStatus.RECEIVED); |
|
|
|
//变更更换表 |
|
|
|
rechange.setRechangeStatus(RechangeStatus.FAIL); |
|
|
|
rechange.setAuditInfo(reqDto.getInfo()); |
|
|
@@ -472,15 +475,17 @@ public class IssueOrderQueryManageImpl extends AbstractManagewManager implements |
|
|
|
* @throws ManagerException |
|
|
|
*/ |
|
|
|
private CarObuDetails checkSendCardObu(String card, String obuId) throws ManagerException { |
|
|
|
// 查询卡 |
|
|
|
// 查询卡 临时代码 |
|
|
|
// InvwCardDetails cardDetails = invwCardDetailsRepo.findByCardIdAndStatus(card, InvDeviceStatus.NEW); |
|
|
|
InvwCardDetails cardDetails = invwCardDetailsRepo.findByCardId(card); |
|
|
|
if (cardDetails == null) { |
|
|
|
throw new ManagerException("当前ETC卡未入库,请先入库"); |
|
|
|
throw new ManagerException("当前ETC卡不在库存中"); |
|
|
|
} |
|
|
|
// 查询签 |
|
|
|
// 查询签 临时 |
|
|
|
// InvwObuDetails obuDetails = invwObuDetailsRepo.findByObuIdAndStatus(obuId,InvDeviceStatus.NEW); |
|
|
|
InvwObuDetails obuDetails = invwObuDetailsRepo.findByObuId(obuId); |
|
|
|
if (obuDetails == null) { |
|
|
|
throw new ManagerException("当前OBU未入库,请先入库"); |
|
|
|
throw new ManagerException("当前OBU不在库存中"); |
|
|
|
} |
|
|
|
// 校验卡签版本号一致 |
|
|
|
if (!Objects.equals(cardDetails.getVersion(), obuDetails.getVersion())) { |