|
@@ -385,7 +385,15 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -385,7 +385,15 @@ public class PaymentServiceImpl implements IPaymentService { |
385
|
}
|
385
|
}
|
386
|
|
386
|
|
387
|
|
387
|
|
388
|
-
|
388
|
+ /**
|
|
|
389
|
+ * <pre>
|
|
|
390
|
+ * 1:鉴定通过(货款-->卖家);
|
|
|
391
|
+ * 2:鉴定不通过(保证金 --> 买家);
|
|
|
392
|
+ * 3:有买家时卖家不卖了(保证金 --> 买家)
|
|
|
393
|
+ * </pre>
|
|
|
394
|
+ *
|
|
|
395
|
+ * @param request 请求
|
|
|
396
|
+ */
|
389
|
public void transferMon(TransferMoneyRequest request){
|
397
|
public void transferMon(TransferMoneyRequest request){
|
390
|
logger.info("transferMon转账开始,request = {}", request);
|
398
|
logger.info("transferMon转账开始,request = {}", request);
|
391
|
|
399
|
|
|
@@ -419,7 +427,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -419,7 +427,7 @@ public class PaymentServiceImpl implements IPaymentService { |
419
|
throw new ServiceException(ServiceError.ORDER_NULL);
|
427
|
throw new ServiceException(ServiceError.ORDER_NULL);
|
420
|
}
|
428
|
}
|
421
|
|
429
|
|
422
|
- // 查看是否已经有记录
|
430
|
+ // 查看是否已经有转账记录
|
423
|
OrdersPayTransfer exist = ordersPayTransferMapper.selectByBuyerOrderCode(buyerOrderCode);
|
431
|
OrdersPayTransfer exist = ordersPayTransferMapper.selectByBuyerOrderCode(buyerOrderCode);
|
424
|
if (exist != null) {
|
432
|
if (exist != null) {
|
425
|
logger.warn("getOrderInfo order not exist, orderCode is {}", buyerOrderCode);
|
433
|
logger.warn("getOrderInfo order not exist, orderCode is {}", buyerOrderCode);
|
|
@@ -527,19 +535,40 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -527,19 +535,40 @@ public class PaymentServiceImpl implements IPaymentService { |
527
|
}
|
535
|
}
|
528
|
|
536
|
|
529
|
// 支付保证金流水记录
|
537
|
// 支付保证金流水记录
|
530
|
- public void addPayEnsureRecord(Integer uid, Long orderCode, Integer payType, BigDecimal amount) {
|
538
|
+ public void addPayEnsureRecord(Integer uid, Integer skup, Long orderCode, Integer payType, BigDecimal amount) {
|
|
|
539
|
+ // 增加流水记录
|
|
|
540
|
+ TradeBills record = new TradeBills();
|
|
|
541
|
+ try {
|
|
|
542
|
+ record.setUid(uid);
|
|
|
543
|
+ record.setOrderCode(orderCode);
|
|
|
544
|
+ record.setUserType(2);// 1:买家uid; 2:卖家uid
|
|
|
545
|
+ record.setPayType(payType);// 1:支付宝; 2:微信
|
|
|
546
|
+ record.setTradeType(1);//1:保证金;2:货款;3:补偿款
|
|
|
547
|
+ record.setIncomeOutcome(2);// 1:用户收入; 2:用户支出
|
|
|
548
|
+ record.setAmount(amount);
|
|
|
549
|
+ record.setSystemAmount(amount.multiply(new BigDecimal("-1")));// 有货收入
|
|
|
550
|
+ record.setTradeStatus(0);//0:订单未完结;1:订单完结
|
|
|
551
|
+ record.setCreateTime((int) (System.currentTimeMillis() / 1000));
|
|
|
552
|
+ tradeBillsMapper.insert(record);
|
|
|
553
|
+ } catch (Exception e) {
|
|
|
554
|
+ logger.error("记录交易到数据库出错 err={}, rec = {}", e.getMessage(), record);
|
|
|
555
|
+ }
|
|
|
556
|
+ }
|
|
|
557
|
+
|
|
|
558
|
+ // 支付货款流水记录
|
|
|
559
|
+ public void addPayBuyRecord(Integer uid, Long orderCode, Integer payType, BigDecimal amount) {
|
531
|
// 增加流水记录
|
560
|
// 增加流水记录
|
532
|
TradeBills record = new TradeBills();
|
561
|
TradeBills record = new TradeBills();
|
533
|
try {
|
562
|
try {
|
534
|
record.setUid(uid);
|
563
|
record.setUid(uid);
|
535
|
record.setOrderCode(orderCode);
|
564
|
record.setOrderCode(orderCode);
|
536
|
- record.setUserType(2);
|
|
|
537
|
- record.setPayType(payType);
|
|
|
538
|
- record.setTradeType(1);
|
|
|
539
|
- record.setIncomeOutcome(2);
|
565
|
+ record.setUserType(1);// 1:买家uid; 2:卖家uid
|
|
|
566
|
+ record.setPayType(payType);// 1:支付宝; 2:微信
|
|
|
567
|
+ record.setTradeType(2);//1:保证金;2:货款;3:补偿款
|
|
|
568
|
+ record.setIncomeOutcome(2);// 1:用户收入; 2:用户支出
|
540
|
record.setAmount(amount);
|
569
|
record.setAmount(amount);
|
541
|
- record.setSystemAmount(amount.multiply(new BigDecimal("-1")));
|
|
|
542
|
- record.setTradeStatus(0);
|
570
|
+ record.setSystemAmount(amount.multiply(new BigDecimal("-1")));// 有货收入
|
|
|
571
|
+ record.setTradeStatus(0);//0:订单未完结;1:订单完结
|
543
|
record.setCreateTime((int) (System.currentTimeMillis() / 1000));
|
572
|
record.setCreateTime((int) (System.currentTimeMillis() / 1000));
|
544
|
tradeBillsMapper.insert(record);
|
573
|
tradeBillsMapper.insert(record);
|
545
|
} catch (Exception e) {
|
574
|
} catch (Exception e) {
|