|
|
@@ -21,6 +21,7 @@ import com.zhongshu.card.client.type.*;
|
|
|
import com.zhongshu.card.client.utils.DateUtils;
|
|
|
|
|
|
import com.zhongshu.card.client.type.school.CardState;
|
|
|
+import com.zhongshu.card.server.core.dao.payment.ProjectPaySettingDao;
|
|
|
import com.zhongshu.card.server.core.dao.school.CardInfoDao;
|
|
|
import com.zhongshu.card.server.core.dao.org.UserCountDao;
|
|
|
import com.zhongshu.card.server.core.dao.payment.ExpenseFlowDao;
|
|
|
@@ -32,6 +33,7 @@ import com.zhongshu.card.server.core.domain.org.Organization;
|
|
|
import com.zhongshu.card.server.core.domain.org.OrganizationRelation;
|
|
|
import com.zhongshu.card.server.core.domain.org.UserAccount;
|
|
|
import com.zhongshu.card.server.core.domain.payment.ExpenseFlow;
|
|
|
+import com.zhongshu.card.server.core.domain.payment.ProjectPaySetting;
|
|
|
import com.zhongshu.card.server.core.domain.school.CardInfo;
|
|
|
import com.zhongshu.card.server.core.domain.org.DeviceInfo;
|
|
|
import com.zhongshu.card.server.core.domain.school.DeviceBind;
|
|
|
@@ -108,6 +110,9 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
@Autowired
|
|
|
OperationLogsService operationLogsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ProjectPaySettingDao projectPaySettingDao;
|
|
|
+
|
|
|
/**
|
|
|
* 创建流水
|
|
|
*
|
|
|
@@ -132,7 +137,7 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
expenseFlow.setOrderNo(iotParam.getOrder());
|
|
|
// 卡片信息
|
|
|
expenseFlow.setCardNo(iotParam.getCardNo());
|
|
|
-
|
|
|
+ // 本地订单号
|
|
|
String paymentNo = NextNoUtil.getNextPaymentNo(null);
|
|
|
// 支付订单号
|
|
|
expenseFlow.setPaymentNo(paymentNo);
|
|
|
@@ -142,11 +147,8 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
|
|
|
String deviceId = iotParam.getDeviceId();
|
|
|
expenseFlow.setDeviceId(deviceId);
|
|
|
-
|
|
|
- expenseFlow.setOrderFromType(OrderFromType.Swipe);
|
|
|
- // 支付方式
|
|
|
- expenseFlow.setPaymentWay(iotParam.getPaymentType().getRemark());
|
|
|
- expenseFlow.setPaymentType(iotParam.getPaymentType());
|
|
|
+ // 支付来源
|
|
|
+ expenseFlow.setOrderFromType(iotParam.getOrderFromType());
|
|
|
expenseFlow.setParam(iotParam);
|
|
|
expenseFlow.setPaymentDeviceType(PaymentDeviceType.HxzConsumTransactions);
|
|
|
expenseFlow.setOrderType(OrderState.WAIT_PAYMENT);
|
|
|
@@ -323,7 +325,16 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- PaymentType paymentType = entity.getPaymentType();
|
|
|
+ // 确定项目的付款方式
|
|
|
+ ProjectPaySetting projectPaySetting = projectPaySettingDao.findTopByProjectOid(entity.getProjectOid());
|
|
|
+ if (ObjectUtils.isEmpty(projectPaySetting) || projectPaySetting.getChannelType() == null) {
|
|
|
+ entity.setVerifyError("项目为配置支付渠道");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ PaymentType paymentType = projectPaySetting.getChannelType();
|
|
|
+ entity.setPaymentType(paymentType);
|
|
|
+ entity.setPaymentWay(paymentType.getRemark());
|
|
|
+
|
|
|
// 刷卡支付 并且钱包支付
|
|
|
if (paymentType == PaymentType.UserWallet && entity.getOrderFromType() == OrderFromType.Swipe) {
|
|
|
CardInfo cardInfo = cardInfoDao.findByCode(entity.getCardNo());
|