|
|
@ -250,7 +250,7 @@ public class OrderSelectionActivity extends AppCompatActivity { |
|
|
|
* 执行订单核销 |
|
|
|
*/ |
|
|
|
private void performOrderVerification(OrderVerificationData.OrderItem order) { |
|
|
|
LogManager.logInfo(TAG, "开始执行订单核销: " + order.getOrder_no()); |
|
|
|
LogManager.logInfo(TAG, "执行订单核销: " + order.getOrder_no()); |
|
|
|
|
|
|
|
// 停止倒计时 |
|
|
|
stopCountdown(); |
|
|
@ -265,14 +265,8 @@ public class OrderSelectionActivity extends AppCompatActivity { |
|
|
|
|
|
|
|
// 获取订单ID和核销码 |
|
|
|
String orderId = order.getOrder_no(); |
|
|
|
String verifyCode = order.getVerificationCode(); |
|
|
|
|
|
|
|
if (verifyCode == null || verifyCode.isEmpty()) { |
|
|
|
// 如果没有直接的验证码,尝试从v_code字段获取 |
|
|
|
if (order.getV_code() != null && !order.getV_code().isEmpty()) { |
|
|
|
verifyCode = order.getV_code().get(0); |
|
|
|
} |
|
|
|
} |
|
|
|
// 将verifyCode声明为final,避免lambda表达式中的问题 |
|
|
|
final String verifyCode = getVerificationCode(order); |
|
|
|
|
|
|
|
if (verifyCode == null || verifyCode.isEmpty()) { |
|
|
|
LogManager.logError(TAG, "未找到有效的核销码"); |
|
|
@ -439,6 +433,24 @@ public class OrderSelectionActivity extends AppCompatActivity { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取订单的核销码 |
|
|
|
* @param order 订单项 |
|
|
|
* @return 核销码字符串 |
|
|
|
*/ |
|
|
|
private String getVerificationCode(OrderVerificationData.OrderItem order) { |
|
|
|
String verifyCode = order.getVerificationCode(); |
|
|
|
|
|
|
|
if (verifyCode == null || verifyCode.isEmpty()) { |
|
|
|
// 如果没有直接的验证码,尝试从v_code字段获取 |
|
|
|
if (order.getV_code() != null && !order.getV_code().isEmpty()) { |
|
|
|
verifyCode = order.getV_code().get(0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return verifyCode; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 开始倒计时 |
|
|
|
*/ |
|
|
|
private void startCountdown() { |
|
|
|