Merge remote-tracking branch 'origin/test6.9.10' into test6.9.10
Showing
7 changed files
with
81 additions
and
27 deletions
1 | package com.yohoufo.order.controller; | 1 | package com.yohoufo.order.controller; |
2 | 2 | ||
3 | import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder; | 3 | import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder; |
4 | +import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO; | ||
4 | import com.yohoufo.common.ApiResponse; | 5 | import com.yohoufo.common.ApiResponse; |
5 | import com.yohoufo.common.annotation.IgnoreSession; | 6 | import com.yohoufo.common.annotation.IgnoreSession; |
6 | import com.yohoufo.common.annotation.IgnoreSignature; | 7 | import com.yohoufo.common.annotation.IgnoreSignature; |
@@ -9,8 +10,11 @@ import com.yohoufo.common.lock.RedisLock; | @@ -9,8 +10,11 @@ import com.yohoufo.common.lock.RedisLock; | ||
9 | import com.yohoufo.common.lock.RedisLockFactory; | 10 | import com.yohoufo.common.lock.RedisLockFactory; |
10 | import com.yohoufo.common.utils.ExecutorServiceUtils; | 11 | import com.yohoufo.common.utils.ExecutorServiceUtils; |
11 | import com.yohoufo.order.model.request.TransferMoneyRequest; | 12 | import com.yohoufo.order.model.request.TransferMoneyRequest; |
13 | +import com.yohoufo.order.service.IPaymentService; | ||
14 | +import com.yohoufo.order.service.impl.PaymentServiceImpl; | ||
12 | import com.yohoufo.order.service.impl.TransferService; | 15 | import com.yohoufo.order.service.impl.TransferService; |
13 | import com.yohoufo.order.utils.NamedThreadFactory; | 16 | import com.yohoufo.order.utils.NamedThreadFactory; |
17 | +import lombok.Data; | ||
14 | import lombok.extern.slf4j.Slf4j; | 18 | import lombok.extern.slf4j.Slf4j; |
15 | import org.apache.commons.lang3.RandomUtils; | 19 | import org.apache.commons.lang3.RandomUtils; |
16 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -19,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | @@ -19,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | ||
19 | import org.springframework.web.bind.annotation.RequestParam; | 23 | import org.springframework.web.bind.annotation.RequestParam; |
20 | import org.springframework.web.bind.annotation.RestController; | 24 | import org.springframework.web.bind.annotation.RestController; |
21 | 25 | ||
26 | +import java.math.BigDecimal; | ||
22 | import java.util.UUID; | 27 | import java.util.UUID; |
23 | import java.util.concurrent.ArrayBlockingQueue; | 28 | import java.util.concurrent.ArrayBlockingQueue; |
24 | import java.util.concurrent.ExecutorService; | 29 | import java.util.concurrent.ExecutorService; |
@@ -35,6 +40,9 @@ public class OrderHelpController { | @@ -35,6 +40,9 @@ public class OrderHelpController { | ||
35 | private TransferService transferService; | 40 | private TransferService transferService; |
36 | 41 | ||
37 | @Autowired | 42 | @Autowired |
43 | + private PaymentServiceImpl paymentService; | ||
44 | + | ||
45 | + @Autowired | ||
38 | private RedisLockFactory redisLockFactory; | 46 | private RedisLockFactory redisLockFactory; |
39 | 47 | ||
40 | /** | 48 | /** |
@@ -57,6 +65,28 @@ public class OrderHelpController { | @@ -57,6 +65,28 @@ public class OrderHelpController { | ||
57 | @IgnoreSession | 65 | @IgnoreSession |
58 | @IgnoreSignature | 66 | @IgnoreSignature |
59 | @InnerApi | 67 | @InnerApi |
68 | + @RequestMapping(value = "/transAllEarnest") | ||
69 | + public ApiResponse transAllEarnest(@RequestBody TransferAllEarnestRequest req) { | ||
70 | + return new ApiResponse.ApiResponseBuilder() | ||
71 | + .code(200) | ||
72 | + .message(paymentService.transAllEarnest(req.getOrderCode(), req.getUid(), req.getAmount(), req.getAliPayAccount()) ? "ok" : "ko") | ||
73 | + .build(); | ||
74 | + } | ||
75 | + | ||
76 | + @Data | ||
77 | + public static class TransferAllEarnestRequest { | ||
78 | + long orderCode; | ||
79 | + Integer uid; | ||
80 | + BigDecimal amount; | ||
81 | + AuthorizeResultRespVO aliPayAccount; | ||
82 | + } | ||
83 | + | ||
84 | + /** | ||
85 | + * 转账 | ||
86 | + */ | ||
87 | + @IgnoreSession | ||
88 | + @IgnoreSignature | ||
89 | + @InnerApi | ||
60 | @RequestMapping(value = "/lock") | 90 | @RequestMapping(value = "/lock") |
61 | public ApiResponse lock(String key, @RequestParam(required = false, defaultValue = "100") int taskNum) { | 91 | public ApiResponse lock(String key, @RequestParam(required = false, defaultValue = "100") int taskNum) { |
62 | ExecutorService executorService = new ThreadPoolExecutor(5, 10, | 92 | ExecutorService executorService = new ThreadPoolExecutor(5, 10, |
@@ -22,7 +22,7 @@ public class AppraiseExpressStageBuilder { | @@ -22,7 +22,7 @@ public class AppraiseExpressStageBuilder { | ||
22 | /** | 22 | /** |
23 | * 平台确认收货 | 23 | * 平台确认收货 |
24 | * | 24 | * |
25 | - * 1卖家发货 == 2平台鉴定 点亮1 | 25 | + * 1卖家发货 == 2平台鉴定 点亮2 |
26 | */ | 26 | */ |
27 | private static final int DEPOSIT_PLATFORM_RECEIPT = 11; | 27 | private static final int DEPOSIT_PLATFORM_RECEIPT = 11; |
28 | 28 |
@@ -16,6 +16,7 @@ import java.util.stream.Collectors; | @@ -16,6 +16,7 @@ import java.util.stream.Collectors; | ||
16 | 16 | ||
17 | import javax.annotation.Resource; | 17 | import javax.annotation.Resource; |
18 | 18 | ||
19 | +import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum; | ||
19 | import com.yohobuy.ufo.model.order.common.*; | 20 | import com.yohobuy.ufo.model.order.common.*; |
20 | import com.yohoufo.dal.order.*; | 21 | import com.yohoufo.dal.order.*; |
21 | import com.yohoufo.dal.order.model.*; | 22 | import com.yohoufo.dal.order.model.*; |
@@ -504,9 +505,9 @@ public class AppraiseService { | @@ -504,9 +505,9 @@ public class AppraiseService { | ||
504 | return apiResponse; | 505 | return apiResponse; |
505 | } | 506 | } |
506 | 507 | ||
507 | - // 1.瑕疵,鉴定为假,虚假发货,质检不通过取消 | 508 | + // 1.鉴定为假,质检不通过 |
508 | List<Integer> APPRAISE_FAIL_STATUS_CODE = Lists.newArrayList(AppraiseOrderStatus.CHECKING_FAKE.getCode(), | 509 | List<Integer> APPRAISE_FAIL_STATUS_CODE = Lists.newArrayList(AppraiseOrderStatus.CHECKING_FAKE.getCode(), |
509 | - AppraiseOrderStatus.SHAM_SEND_OUT.getCode(), AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode()); | 510 | + AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode()); |
510 | 511 | ||
511 | // 2.无法鉴定 | 512 | // 2.无法鉴定 |
512 | List<Integer> CANNOT_APPRAISE_STATUS_CODE = Lists.newArrayList( | 513 | List<Integer> CANNOT_APPRAISE_STATUS_CODE = Lists.newArrayList( |
@@ -588,9 +589,21 @@ public class AppraiseService { | @@ -588,9 +589,21 @@ public class AppraiseService { | ||
588 | 589 | ||
589 | // 子订单对应商品 1:1 | 590 | // 子订单对应商品 1:1 |
590 | AppraiseOrderGoods oneAppraiseOrderGood = appraiseOrderGoods.get(0); | 591 | AppraiseOrderGoods oneAppraiseOrderGood = appraiseOrderGoods.get(0); |
591 | - inBoxFacade.sendInboxSmsWhenAppraiseFinished(uid, oneAppraiseOrderGood.getProductName(), | ||
592 | - oneAppraiseOrderGood.getProductCode(), | ||
593 | - wayBillCode); | 592 | + |
593 | + if (APPRAISE_FAIL_STATUS_CODE.contains(appraiseOrder.getStatus()) | ||
594 | + || APPRAISE_SUCCESS_STATUS_CODE.contains(appraiseOrder.getStatus())){ | ||
595 | + inBoxFacade.sendInboxSmsWhenAppraiseFinished(InboxBusinessTypeEnum.INBOX_DELIVERY_APPRAISE_FINISHED, | ||
596 | + InboxBusinessTypeEnum.SMS_DELIVERY_APPRAISE_FINISHED, | ||
597 | + uid, oneAppraiseOrderGood.getProductName(), | ||
598 | + oneAppraiseOrderGood.getProductCode(), | ||
599 | + wayBillCode); | ||
600 | + }else if(CANNOT_APPRAISE_STATUS_CODE.contains(appraiseOrder.getStatus())){ | ||
601 | + inBoxFacade.sendInboxSmsWhenAppraiseFinished(InboxBusinessTypeEnum.INBOX_DELIVERY_CANNOT_APPRAISE, | ||
602 | + InboxBusinessTypeEnum.SMS_DELIVERY_CANNOT_APPRAISE, | ||
603 | + uid, oneAppraiseOrderGood.getProductName(), | ||
604 | + oneAppraiseOrderGood.getProductCode(), | ||
605 | + wayBillCode); | ||
606 | + } | ||
594 | } | 607 | } |
595 | 608 | ||
596 | if (appraiseOrder.getAttributes() == OrderAttributes.DEPOSITE.getCode()) { // 鉴定寄存的订单,需要同步修改寄存表的状态 | 609 | if (appraiseOrder.getAttributes() == OrderAttributes.DEPOSITE.getCode()) { // 鉴定寄存的订单,需要同步修改寄存表的状态 |
@@ -1741,13 +1754,14 @@ public class AppraiseService { | @@ -1741,13 +1754,14 @@ public class AppraiseService { | ||
1741 | List<Integer> skupList = buyerOrderGoodses.stream().map(BuyerOrderGoods::getSkup).collect(Collectors.toList()); | 1754 | List<Integer> skupList = buyerOrderGoodses.stream().map(BuyerOrderGoods::getSkup).collect(Collectors.toList()); |
1742 | 1755 | ||
1743 | sellerOrderGoodsMapper.updateDeptNoBySkups(skupList, appraiseExpressInfoBo.getDepotNum()); | 1756 | sellerOrderGoodsMapper.updateDeptNoBySkups(skupList, appraiseExpressInfoBo.getDepotNum()); |
1744 | - expressRecordMapper.updateDeptNoByOrder(orderCodeList, EnumExpressType.EXPRESS_TYPE_1.getCode(), appraiseExpressInfoBo.getDepotNum()); | ||
1745 | 1757 | ||
1746 | productProxyService.setBatchDepotNum(skupList, appraiseExpressInfoBo.getDepotNum()); | 1758 | productProxyService.setBatchDepotNum(skupList, appraiseExpressInfoBo.getDepotNum()); |
1747 | } | 1759 | } |
1748 | 1760 | ||
1749 | // 更新鉴定订单的鉴定室 | 1761 | // 更新鉴定订单的鉴定室 |
1750 | appraiseOrderGoodsMapper.updateBatchDepotNo(orderCodeList, appraiseExpressInfoBo.getDepotNum()); | 1762 | appraiseOrderGoodsMapper.updateBatchDepotNo(orderCodeList, appraiseExpressInfoBo.getDepotNum()); |
1763 | + | ||
1764 | + expressRecordMapper.updateDeptNoByOrder(orderCodeList, EnumExpressType.EXPRESS_TYPE_1.getCode(), appraiseExpressInfoBo.getDepotNum()); | ||
1751 | } | 1765 | } |
1752 | } | 1766 | } |
1753 | 1767 |
@@ -546,7 +546,9 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -546,7 +546,9 @@ public class PaymentServiceImpl implements IPaymentService { | ||
546 | @Database(ForceMaster = true) | 546 | @Database(ForceMaster = true) |
547 | public boolean transAllEarnest(long orderCode, Integer uid, BigDecimal amount, | 547 | public boolean transAllEarnest(long orderCode, Integer uid, BigDecimal amount, |
548 | AuthorizeResultRespVO aliPayAccount) { | 548 | AuthorizeResultRespVO aliPayAccount) { |
549 | - logger.info("退还商家所有保证金,转账开始,orderCode = {}, uid={}, amount={}, alipayAccount={}", orderCode, uid, amount, aliPayAccount); | 549 | + |
550 | + String logTag = String.format("transfer all earnest {}-{}", orderCode, uid); | ||
551 | + logger.info("{}, amount is {} and alipay account is {}", logTag, amount, aliPayAccount); | ||
550 | 552 | ||
551 | int now = (int) (System.currentTimeMillis() / 1000); | 553 | int now = (int) (System.currentTimeMillis() / 1000); |
552 | // 查看是否已经有转账记录 | 554 | // 查看是否已经有转账记录 |
@@ -563,6 +565,7 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -563,6 +565,7 @@ public class PaymentServiceImpl implements IPaymentService { | ||
563 | TradeBills record = new TradeBills(); | 565 | TradeBills record = new TradeBills(); |
564 | record.setUid(uid); | 566 | record.setUid(uid); |
565 | record.setOrderCode(orderCode); | 567 | record.setOrderCode(orderCode); |
568 | + record.setPaidOrderCode(0L); | ||
566 | record.setUserType(2); | 569 | record.setUserType(2); |
567 | record.setPayType(1); | 570 | record.setPayType(1); |
568 | record.setTradeType(1); | 571 | record.setTradeType(1); |
@@ -574,7 +577,7 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -574,7 +577,7 @@ public class PaymentServiceImpl implements IPaymentService { | ||
574 | 577 | ||
575 | 578 | ||
576 | if (amount == null || amount.compareTo(new BigDecimal("0.1")) < 0) { | 579 | if (amount == null || amount.compareTo(new BigDecimal("0.1")) < 0) { |
577 | - logger.warn("transAllEarnestErr transferMon计算费用结果为 {}, 小于0.1或为null", amount); | 580 | + logger.warn("{}, amount {} less 0.1 or null", logTag, amount); |
578 | alarm("转账金额小于0.1或为null", "ufo.order.transAllEarnest", "退还商家入驻所有金额,订单号:" + orderCode + "操作类型(" + 6 + ")计算金额结果为" + amount); | 581 | alarm("转账金额小于0.1或为null", "ufo.order.transAllEarnest", "退还商家入驻所有金额,订单号:" + orderCode + "操作类型(" + 6 + ")计算金额结果为" + amount); |
579 | record.setTradeStatus(BillTradeStatus.AMOUNT_IS_ILLEGAL.getCode()); | 582 | record.setTradeStatus(BillTradeStatus.AMOUNT_IS_ILLEGAL.getCode()); |
580 | addTradeBills(record); | 583 | addTradeBills(record); |
@@ -582,20 +585,20 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -582,20 +585,20 @@ public class PaymentServiceImpl implements IPaymentService { | ||
582 | } | 585 | } |
583 | 586 | ||
584 | if (StringUtils.isBlank(aliPayAccount.getAlipayAccount()) && StringUtils.isBlank(aliPayAccount.getAlipayId())) { | 587 | if (StringUtils.isBlank(aliPayAccount.getAlipayAccount()) && StringUtils.isBlank(aliPayAccount.getAlipayId())) { |
585 | - logger.warn("transAllEarnestErr uid {} 支付宝账号不合法", account); | 588 | + logger.warn("{}, alipay account is not exist", logTag); |
586 | record.setTradeStatus(BillTradeStatus.NOT_EXIST_ALIPAY_ACCOUNT.getCode()); | 589 | record.setTradeStatus(BillTradeStatus.NOT_EXIST_ALIPAY_ACCOUNT.getCode()); |
587 | addTradeBills(record); | 590 | addTradeBills(record); |
588 | throw new ServiceException(400, "uid[" + uid + "]支付宝账号不合法"); | 591 | throw new ServiceException(400, "uid[" + uid + "]支付宝账号不合法"); |
589 | } | 592 | } |
590 | 593 | ||
591 | - logger.info("transAllEarnest参数检查成功!"); | 594 | + logger.info("{}, data check ok.", logTag); |
592 | tradeBillsMapper.insert(record); | 595 | tradeBillsMapper.insert(record); |
593 | // 转账 | 596 | // 转账 |
594 | JSONObject jsonObject = null; | 597 | JSONObject jsonObject = null; |
595 | boolean exceedMillionAndSuccess = false; | 598 | boolean exceedMillionAndSuccess = false; |
596 | transfer.setUpdateTime(now); | 599 | transfer.setUpdateTime(now); |
597 | try { | 600 | try { |
598 | - logger.info("transAllEarnest开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", orderCode, account, amount); | 601 | + logger.info("{}, transfer start", logTag); |
599 | shoppingRiskWatchDog.checkAlipayBlackUser(aliPayAccount.getUid(), aliPayAccount); | 602 | shoppingRiskWatchDog.checkAlipayBlackUser(aliPayAccount.getUid(), aliPayAccount); |
600 | if (alipayTransferChancelSelector.isTransferWithAlipayExceedMillionTransfer()) { | 603 | if (alipayTransferChancelSelector.isTransferWithAlipayExceedMillionTransfer()) { |
601 | transfer.setInterfaceType(2); | 604 | transfer.setInterfaceType(2); |
@@ -615,7 +618,7 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -615,7 +618,7 @@ public class PaymentServiceImpl implements IPaymentService { | ||
615 | ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); | 618 | ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); |
616 | jsonObject = alipayService.transferMoney(Long.toString(orderCode), aliPayAccount.getAlipayId(), aliPayAccount.getAlipayAccount(), amount); | 619 | jsonObject = alipayService.transferMoney(Long.toString(orderCode), aliPayAccount.getAlipayId(), aliPayAccount.getAlipayAccount(), amount); |
617 | if (jsonObject == null) { | 620 | if (jsonObject == null) { |
618 | - logger.warn("transAllEarnestErr 转账失败 , orderCode is {}", orderCode); | 621 | + logger.warn("{}, transfer fail.", logTag); |
619 | transfer.setStatus(3); | 622 | transfer.setStatus(3); |
620 | throw new ServiceException(500, "转账失败:阿里接口返回null"); | 623 | throw new ServiceException(500, "转账失败:阿里接口返回null"); |
621 | } | 624 | } |
@@ -627,7 +630,7 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -627,7 +630,7 @@ public class PaymentServiceImpl implements IPaymentService { | ||
627 | && (code = jsonObject.getInteger("code")) == 10000 | 630 | && (code = jsonObject.getInteger("code")) == 10000 |
628 | && jsonObject.containsKey("order_id") | 631 | && jsonObject.containsKey("order_id") |
629 | && StringUtils.isNotBlank(orderId = jsonObject.getString("order_id"))) { | 632 | && StringUtils.isNotBlank(orderId = jsonObject.getString("order_id"))) { |
630 | - logger.info("转账成功,targeAccount is {}, amount is {}", account, amount); | 633 | + logger.info("{}, transfer success, account is {}, amount is {}", logTag, account, amount); |
631 | transfer.setAlipayTradeId(orderId); | 634 | transfer.setAlipayTradeId(orderId); |
632 | transfer.setStatus(1); | 635 | transfer.setStatus(1); |
633 | return true; | 636 | return true; |
@@ -644,16 +647,15 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -644,16 +647,15 @@ public class PaymentServiceImpl implements IPaymentService { | ||
644 | return true; | 647 | return true; |
645 | } | 648 | } |
646 | } else { | 649 | } else { |
647 | - logger.warn("transAllEarnestErr 返回code或者order_id不是成功状态,code={}, orderId={}", code, orderId); | 650 | + logger.warn("{}, transfer fail, return_code is {} and return_order_id is {}", logTag, code, orderId); |
648 | throw new ServiceException(500, "转账失败:code或者order_id不是成功状态"); | 651 | throw new ServiceException(500, "转账失败:code或者order_id不是成功状态"); |
649 | } | 652 | } |
650 | } catch (Exception e) { | 653 | } catch (Exception e) { |
651 | - logger.warn("transAllEarnestErr 转账失败 , orderCode is {}, msg is {}", orderCode, e.getMessage()); | 654 | + logger.warn("{}, transfer fail", logTag, e); |
652 | String alarmMsg = "订单号:" + orderCode + ",操作类型(商家退出入驻退保证金),msg=" + e.getMessage(); | 655 | String alarmMsg = "订单号:" + orderCode + ",操作类型(商家退出入驻退保证金),msg=" + e.getMessage(); |
653 | if (jsonObject != null) { | 656 | if (jsonObject != null) { |
654 | alarmMsg += ",阿里返回DETAIL=" + jsonObject.toJSONString(); | 657 | alarmMsg += ",阿里返回DETAIL=" + jsonObject.toJSONString(); |
655 | } | 658 | } |
656 | - logger.info("transAllEarnestErr 转账失败 , alarmMsg is {}", alarmMsg); | ||
657 | alarm("转账失败", "ufo.order.transAllEarnest", alarmMsg); | 659 | alarm("转账失败", "ufo.order.transAllEarnest", alarmMsg); |
658 | transfer.setStatus(3); | 660 | transfer.setStatus(3); |
659 | if (e instanceof ServiceException) { | 661 | if (e instanceof ServiceException) { |
@@ -663,17 +665,17 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -663,17 +665,17 @@ public class PaymentServiceImpl implements IPaymentService { | ||
663 | } | 665 | } |
664 | } finally { | 666 | } finally { |
665 | if (exceedMillionAndSuccess) { | 667 | if (exceedMillionAndSuccess) { |
666 | - logger.info("transferMon exceedMillion,转账结束,等待回调 orderCode is {}!", orderCode); | 668 | + logger.info("{}, transfer exceed million waiting...", logTag); |
667 | return true; | 669 | return true; |
668 | } | 670 | } |
669 | - logger.info("transAllEarnest最后更新状态 status= {}", transfer.getStatus()); | 671 | + logger.info("{}, transfer end update status to {}", logTag, transfer.getStatus()); |
670 | transfer.setUpdateTime(now); | 672 | transfer.setUpdateTime(now); |
671 | ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); | 673 | ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); |
672 | // 100:成功;201:没有支付宝账号;202:金额不合法;299:转账失败 | 674 | // 100:成功;201:没有支付宝账号;202:金额不合法;299:转账失败 |
673 | BillTradeStatus bts = transfer.getStatus() == 1 ? BillTradeStatus.SUCCESS : BillTradeStatus.TRANSFER_FAIL; | 675 | BillTradeStatus bts = transfer.getStatus() == 1 ? BillTradeStatus.SUCCESS : BillTradeStatus.TRANSFER_FAIL; |
674 | record.setTradeStatus(bts.getCode()); | 676 | record.setTradeStatus(bts.getCode()); |
675 | tradeBillsMapper.updateSelectiveByPrimaryKey(record); | 677 | tradeBillsMapper.updateSelectiveByPrimaryKey(record); |
676 | - logger.info("transAllEarnest最后更新状态完成,转账结束, orderCode is {}!", orderCode); | 678 | + logger.info("{}, transfer end update status to {} ok", logTag, transfer.getStatus()); |
677 | } | 679 | } |
678 | } | 680 | } |
679 | 681 | ||
@@ -1364,6 +1366,7 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -1364,6 +1366,7 @@ public class PaymentServiceImpl implements IPaymentService { | ||
1364 | TradeBills record = new TradeBills(); | 1366 | TradeBills record = new TradeBills(); |
1365 | record.setUid(targetUid); | 1367 | record.setUid(targetUid); |
1366 | record.setOrderCode(buyerOrderCode); | 1368 | record.setOrderCode(buyerOrderCode); |
1369 | + record.setPaidOrderCode(0L); | ||
1367 | record.setUserType(targetUserType.getCode()); | 1370 | record.setUserType(targetUserType.getCode()); |
1368 | record.setPayType(1); | 1371 | record.setPayType(1); |
1369 | // 如果[全部货款->卖家],否则[补偿款->卖家或买家] 2:货款;3:补偿款 | 1372 | // 如果[全部货款->卖家],否则[补偿款->卖家或买家] 2:货款;3:补偿款 |
@@ -110,6 +110,7 @@ public class TradeBillsService { | @@ -110,6 +110,7 @@ public class TradeBillsService { | ||
110 | TradeBills record = new TradeBills(); | 110 | TradeBills record = new TradeBills(); |
111 | record.setUid(uid); | 111 | record.setUid(uid); |
112 | record.setOrderCode(orderCode); | 112 | record.setOrderCode(orderCode); |
113 | + record.setPaidOrderCode(0L); | ||
113 | record.setUserType(2);// 1:买家uid; 2:卖家uid | 114 | record.setUserType(2);// 1:买家uid; 2:卖家uid |
114 | record.setPayType(payType);// 1:支付宝; 2:微信 | 115 | record.setPayType(payType);// 1:支付宝; 2:微信 |
115 | record.setTradeType(1);//1:保证金;2:货款;3:补偿款 | 116 | record.setTradeType(1);//1:保证金;2:货款;3:补偿款 |
@@ -162,6 +163,7 @@ public class TradeBillsService { | @@ -162,6 +163,7 @@ public class TradeBillsService { | ||
162 | TradeBills record = new TradeBills(); | 163 | TradeBills record = new TradeBills(); |
163 | record.setUid(uid); | 164 | record.setUid(uid); |
164 | record.setOrderCode(orderCode); | 165 | record.setOrderCode(orderCode); |
166 | + record.setPaidOrderCode(0L); | ||
165 | record.setUserType(1);// 1:买家uid; 2:卖家uid | 167 | record.setUserType(1);// 1:买家uid; 2:卖家uid |
166 | record.setPayType(payType);// 1:支付宝; 2:微信 | 168 | record.setPayType(payType);// 1:支付宝; 2:微信 |
167 | record.setTradeType(2);//1:保证金;2:货款;3:补偿款 | 169 | record.setTradeType(2);//1:保证金;2:货款;3:补偿款 |
@@ -244,6 +246,7 @@ public class TradeBillsService { | @@ -244,6 +246,7 @@ public class TradeBillsService { | ||
244 | TradeBills record = new TradeBills(); | 246 | TradeBills record = new TradeBills(); |
245 | record.setUid(uid); | 247 | record.setUid(uid); |
246 | record.setOrderCode(orderCode); | 248 | record.setOrderCode(orderCode); |
249 | + record.setPaidOrderCode(0L); | ||
247 | record.setUserType(1);// 1:买家uid; 2:卖家uid | 250 | record.setUserType(1);// 1:买家uid; 2:卖家uid |
248 | record.setPayType(payType);// 1:支付宝; 2:微信 | 251 | record.setPayType(payType);// 1:支付宝; 2:微信 |
249 | record.setTradeType(2);//1:保证金;2:货款;3:补偿款 | 252 | record.setTradeType(2);//1:保证金;2:货款;3:补偿款 |
@@ -283,6 +286,7 @@ public class TradeBillsService { | @@ -283,6 +286,7 @@ public class TradeBillsService { | ||
283 | TradeBills record = new TradeBills(); | 286 | TradeBills record = new TradeBills(); |
284 | record.setUid(uid); | 287 | record.setUid(uid); |
285 | record.setOrderCode(orderCode); | 288 | record.setOrderCode(orderCode); |
289 | + record.setPaidOrderCode(0L); | ||
286 | record.setUserType(2);// 1:买家uid; 2:卖家uid | 290 | record.setUserType(2);// 1:买家uid; 2:卖家uid |
287 | record.setPayType(payType);// 1:支付宝; 2:微信 | 291 | record.setPayType(payType);// 1:支付宝; 2:微信 |
288 | record.setTradeType(1);//1:保证金;2:货款;3:补偿款 | 292 | record.setTradeType(1);//1:保证金;2:货款;3:补偿款 |
@@ -309,6 +313,7 @@ public class TradeBillsService { | @@ -309,6 +313,7 @@ public class TradeBillsService { | ||
309 | TradeBills record = new TradeBills(); | 313 | TradeBills record = new TradeBills(); |
310 | record.setUid(uid); | 314 | record.setUid(uid); |
311 | record.setOrderCode(orderCode); | 315 | record.setOrderCode(orderCode); |
316 | + record.setPaidOrderCode(0L); | ||
312 | record.setUserType(2);// 1:买家uid; 2:卖家uid | 317 | record.setUserType(2);// 1:买家uid; 2:卖家uid |
313 | record.setPayType(payType);// 1:支付宝; 2:微信 | 318 | record.setPayType(payType);// 1:支付宝; 2:微信 |
314 | record.setTradeType(1);//1:保证金;2:货款;3:补偿款 | 319 | record.setTradeType(1);//1:保证金;2:货款;3:补偿款 |
@@ -339,12 +339,13 @@ public class InBoxFacade extends BaseNoticeFacade{ | @@ -339,12 +339,13 @@ public class InBoxFacade extends BaseNoticeFacade{ | ||
339 | * @param productCode | 339 | * @param productCode |
340 | * @param wayBillCode | 340 | * @param wayBillCode |
341 | */ | 341 | */ |
342 | - public void sendInboxSmsWhenAppraiseFinished(int uid, String prdName, String productCode,String wayBillCode){ | 342 | + public void sendInboxSmsWhenAppraiseFinished(InboxBusinessTypeEnum inbox, InboxBusinessTypeEnum sms, |
343 | + int uid, String prdName, String productCode,String wayBillCode){ | ||
343 | 344 | ||
344 | try { | 345 | try { |
345 | executorService.execute(() -> { | 346 | executorService.execute(() -> { |
346 | String params = buildParams(prdName, productCode); | 347 | String params = buildParams(prdName, productCode); |
347 | - InboxReqVO req = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.INBOX_DELIVERY_APPRAISE_FINISHED); | 348 | + InboxReqVO req = buildInboxReqVO(uid, params, inbox); |
348 | 349 | ||
349 | InBoxResponse resp = inBoxSDK.addInbox(req); | 350 | InBoxResponse resp = inBoxSDK.addInbox(req); |
350 | log.info("record sendInboxSmsWhenAppraiseFinished inbox msg, uid {}, prdName {}, wayBillCode {}, resp {}", uid, prdName, wayBillCode, resp); | 351 | log.info("record sendInboxSmsWhenAppraiseFinished inbox msg, uid {}, prdName {}, wayBillCode {}, resp {}", uid, prdName, wayBillCode, resp); |
@@ -356,7 +357,7 @@ public class InBoxFacade extends BaseNoticeFacade{ | @@ -356,7 +357,7 @@ public class InBoxFacade extends BaseNoticeFacade{ | ||
356 | return; | 357 | return; |
357 | } | 358 | } |
358 | List<String> mobileList = Arrays.asList(phone); | 359 | List<String> mobileList = Arrays.asList(phone); |
359 | - String content = getReplacedContent(InboxBusinessTypeEnum.SMS_DELIVERY_APPRAISE_FINISHED.getContent(), prdName ,productCode,wayBillCode); | 360 | + String content = getReplacedContent(sms.getContent(), prdName ,productCode,wayBillCode); |
360 | sendSmsService.smsSendByMobile(content, mobileList); | 361 | sendSmsService.smsSendByMobile(content, mobileList); |
361 | log.info("sendInboxSmsWhenAppraiseFinished sms content {}, mobileList {}", content, mobileList); | 362 | log.info("sendInboxSmsWhenAppraiseFinished sms content {}, mobileList {}", content, mobileList); |
362 | }); | 363 | }); |
@@ -8,7 +8,7 @@ import java.util.stream.Collectors; | @@ -8,7 +8,7 @@ import java.util.stream.Collectors; | ||
8 | import javax.annotation.Resource; | 8 | import javax.annotation.Resource; |
9 | 9 | ||
10 | import com.sun.org.apache.xpath.internal.operations.Bool; | 10 | import com.sun.org.apache.xpath.internal.operations.Bool; |
11 | -import com.yoho.tools.common.beans.ApiResponse; | 11 | +import com.yohoufo.common.ApiResponse; |
12 | import com.yohobuy.ufo.model.order.common.OrderCodeType; | 12 | import com.yohobuy.ufo.model.order.common.OrderCodeType; |
13 | import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO; | 13 | import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO; |
14 | import com.yohoufo.common.caller.UfoServiceCaller; | 14 | import com.yohoufo.common.caller.UfoServiceCaller; |
@@ -822,14 +822,15 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ | @@ -822,14 +822,15 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ | ||
822 | Map<String, Object> resultMap = new HashMap<>(); | 822 | Map<String, Object> resultMap = new HashMap<>(); |
823 | if (isServiceOrder(orderCode)) { | 823 | if (isServiceOrder(orderCode)) { |
824 | AppraiseOrder order = appraiseOrderMapper.selectByOrderCode(orderCode); | 824 | AppraiseOrder order = appraiseOrderMapper.selectByOrderCode(orderCode); |
825 | + resultMap.put("status", order.getStatus()); | ||
825 | AppraiseOrderGoods goods = appraiseOrderGoodsMapper.selectOneByOrderCode(orderCode); | 826 | AppraiseOrderGoods goods = appraiseOrderGoodsMapper.selectOneByOrderCode(orderCode); |
826 | AppraiseOrderStorage storage = appraiseOrderStorageMapper.selectByOrderCode(orderCode); | 827 | AppraiseOrderStorage storage = appraiseOrderStorageMapper.selectByOrderCode(orderCode); |
827 | resultMap.put("image", goods == null ? "" : ImageUrlAssist.getAllProductPicUrl(goods.getImageUrl(), "goodsimg", "center", "d2hpdGU=")); | 828 | resultMap.put("image", goods == null ? "" : ImageUrlAssist.getAllProductPicUrl(goods.getImageUrl(), "goodsimg", "center", "d2hpdGU=")); |
828 | resultMap.put("productId", goods == null ? "" : goods.getProductId()); | 829 | resultMap.put("productId", goods == null ? "" : goods.getProductId()); |
829 | resultMap.put("productName", goods == null ? "" : goods.getProductName()); | 830 | resultMap.put("productName", goods == null ? "" : goods.getProductName()); |
830 | resultMap.put("productCode", goods == null ? "" : goods.getProductCode()); | 831 | resultMap.put("productCode", goods == null ? "" : goods.getProductCode()); |
831 | - resultMap.put("size", storage == null ? "" : storage.getSizeName()); | ||
832 | - resultMap.put("color", storage == null ? "" : storage.getColorName()); | 832 | + resultMap.put("size", storage == null ? "-" : storage.getSizeName()); |
833 | + resultMap.put("color", storage == null ? "-" : storage.getColorName()); | ||
833 | resultMap.put("uid", order == null ? "" : order.getUid()); | 834 | resultMap.put("uid", order == null ? "" : order.getUid()); |
834 | } else { | 835 | } else { |
835 | BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); | 836 | BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); |
@@ -860,7 +861,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ | @@ -860,7 +861,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ | ||
860 | } | 861 | } |
861 | 862 | ||
862 | private boolean isServiceOrder(long orderCode) { | 863 | private boolean isServiceOrder(long orderCode) { |
863 | - ApiResponse<Boolean> resp = ufoServiceCaller.call("ufo.order.isServiceOrder", ApiResponse.class, orderCode); | 864 | + ApiResponse resp = ufoServiceCaller.call("ufo.order.isServiceOrder", ApiResponse.class, orderCode); |
864 | if (resp != null) { | 865 | if (resp != null) { |
865 | return (Boolean) resp.getData(); | 866 | return (Boolean) resp.getData(); |
866 | } | 867 | } |
-
Please register or login to post a comment