|
|
@@ -8,6 +8,7 @@ import com.github.microservice.models.hxz.*;
|
|
|
import com.github.microservice.models.type.OrderFromType;
|
|
|
import com.github.microservice.models.type.PaymentDeviceType;
|
|
|
import com.github.microservice.models.type.PaymentType;
|
|
|
+import com.github.microservice.types.OrderState;
|
|
|
import com.zhongshu.card.client.model.operLogs.OperationLogsAddParam;
|
|
|
import com.zhongshu.card.client.model.payment.*;
|
|
|
import com.zhongshu.card.client.model.payment.statistic.BusinessMainStatisticModel;
|
|
|
@@ -148,7 +149,7 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
expenseFlow.setPaymentType(iotParam.getPaymentType());
|
|
|
expenseFlow.setParam(iotParam);
|
|
|
expenseFlow.setPaymentDeviceType(PaymentDeviceType.HxzConsumTransactions);
|
|
|
- expenseFlow.setOrderType(OrderType.WAIT_PAYMENT);
|
|
|
+ expenseFlow.setOrderType(OrderState.WAIT_PAYMENT);
|
|
|
|
|
|
// 验证参数、填充数据
|
|
|
commonVerifyExpenseFlow(expenseFlow);
|
|
|
@@ -193,7 +194,7 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
entity.setPaymentStatus(msg);
|
|
|
entity.setIsPaySuccess(Boolean.TRUE);
|
|
|
entity.setPayRemark(msg);
|
|
|
- entity.setOrderType(OrderType.HAVE_PAID);
|
|
|
+ entity.setOrderType(OrderState.HAVE_PAID);
|
|
|
logsAddParam.setMessageType(MessageType.Info);
|
|
|
logsAddParam.setLevel(LogsLevel.Low);
|
|
|
logsAddParam.setContent(msg);
|
|
|
@@ -205,7 +206,7 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
entity.setPaymentStatus(msg);
|
|
|
entity.setIsPaySuccess(Boolean.FALSE);
|
|
|
entity.setPayRemark(msg);
|
|
|
- entity.setOrderType(OrderType.PAID_ERROR);
|
|
|
+ entity.setOrderType(OrderState.PAID_ERROR);
|
|
|
logsAddParam.setMessageType(MessageType.Warn);
|
|
|
logsAddParam.setLevel(LogsLevel.Low);
|
|
|
logsAddParam.setContent(msg);
|
|
|
@@ -683,6 +684,21 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
return ResultContent.buildSuccess(model);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据订单号查询订单信息
|
|
|
+ *
|
|
|
+ * @param paymentNo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public ResultContent<ExpenseFlowModel> getDetailByPaymentNo(String paymentNo) {
|
|
|
+ ExpenseFlow entity = expenseFlowDao.findTopByPaymentNo(paymentNo);
|
|
|
+ if (ObjectUtils.isEmpty(entity)) {
|
|
|
+ return ResultContent.buildSuccess(String.format(ResultMessage.DATA_NOT_EXIST, paymentNo));
|
|
|
+ }
|
|
|
+ ExpenseFlowModel model = toModel(entity);
|
|
|
+ return ResultContent.buildSuccess(model);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 商家端用户退款
|
|
|
*
|
|
|
@@ -694,7 +710,7 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
if (ObjectUtils.isEmpty(expenseFlow)) {
|
|
|
return ResultContent.buildSuccess(String.format(ResultMessage.DATA_NOT_EXIST, param.getId()));
|
|
|
}
|
|
|
- if (expenseFlow.getOrderType() == OrderType.HAVE_PAID) {
|
|
|
+ if (expenseFlow.getOrderType() == OrderState.HAVE_PAID) {
|
|
|
return ResultContent.buildFail(String.format("订单状态不是已支付状态,不能退款"));
|
|
|
}
|
|
|
// 调用支付中心退款
|
|
|
@@ -717,7 +733,7 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
// 退款人
|
|
|
expenseFlow.setRefundUserId(getCurrentUserId());
|
|
|
expenseFlow.setRefundAMount(expenseFlow.getPayAmount());
|
|
|
- expenseFlow.setOrderType(OrderType.REFUNDED);
|
|
|
+ expenseFlow.setOrderType(OrderState.REFUNDED);
|
|
|
expenseFlow.setRefundState(RefundState.Refunded);
|
|
|
expenseFlow.setRefuseRemark("退款成功");
|
|
|
expenseFlowDao.save(expenseFlow);
|