Showing
3 changed files
with
40 additions
and
14 deletions
@@ -15,9 +15,7 @@ import com.yohoufo.common.helper.ImageUrlAssist; | @@ -15,9 +15,7 @@ import com.yohoufo.common.helper.ImageUrlAssist; | ||
15 | import com.yohoufo.common.utils.AppVersion; | 15 | import com.yohoufo.common.utils.AppVersion; |
16 | import com.yohoufo.common.utils.DateUtil; | 16 | import com.yohoufo.common.utils.DateUtil; |
17 | import com.yohoufo.common.utils.StringUtil; | 17 | import com.yohoufo.common.utils.StringUtil; |
18 | -import com.yohoufo.dal.order.AppraiseOrderMapper; | ||
19 | -import com.yohoufo.dal.order.BuyerOrderMapper; | ||
20 | -import com.yohoufo.dal.order.DepositCodeMapper; | 18 | +import com.yohoufo.dal.order.*; |
21 | import com.yohoufo.dal.order.model.*; | 19 | import com.yohoufo.dal.order.model.*; |
22 | import org.apache.commons.collections.CollectionUtils; | 20 | import org.apache.commons.collections.CollectionUtils; |
23 | import org.apache.commons.lang3.StringUtils; | 21 | import org.apache.commons.lang3.StringUtils; |
@@ -50,6 +48,18 @@ public class DepositHelpService { | @@ -50,6 +48,18 @@ public class DepositHelpService { | ||
50 | @Autowired | 48 | @Autowired |
51 | private BuyerOrderMapper buyerOrderMapper; | 49 | private BuyerOrderMapper buyerOrderMapper; |
52 | 50 | ||
51 | + @Autowired | ||
52 | + private SellerOrderGoodsMapper sellerOrderGoodsMapper; | ||
53 | + | ||
54 | + @Autowired | ||
55 | + private ServiceOrderProcessor serviceOrderProcessor; | ||
56 | + | ||
57 | + @Autowired | ||
58 | + private AppraiseOrderGoodsMapper appraiseOrderGoodsMapper; | ||
59 | + | ||
60 | + @Autowired | ||
61 | + private AppraiseOrderStorageMapper appraiseOrderStorageMapper; | ||
62 | + | ||
53 | // 是否 24小时反馈时间 如果是则返回true | 63 | // 是否 24小时反馈时间 如果是则返回true |
54 | public boolean isFeedback(int depositRemainDay) { | 64 | public boolean isFeedback(int depositRemainDay) { |
55 | return -1 * DepositOrderComputeResp.FEEDBACK_DAY <= depositRemainDay && depositRemainDay <= 0; | 65 | return -1 * DepositOrderComputeResp.FEEDBACK_DAY <= depositRemainDay && depositRemainDay <= 0; |
@@ -273,4 +283,21 @@ public class DepositHelpService { | @@ -273,4 +283,21 @@ public class DepositHelpService { | ||
273 | 283 | ||
274 | return buyerGoodsMap; | 284 | return buyerGoodsMap; |
275 | } | 285 | } |
286 | + | ||
287 | + public SellerOrderGoods querySellerOrderGoods(StorageDeposit deposit) { | ||
288 | + if (serviceOrderProcessor.isGoodsServiceOrder(deposit.getOrderCode())) { | ||
289 | + List<AppraiseOrderGoods> appraiseOrderGoodses = appraiseOrderGoodsMapper.selectByOrderCode(deposit.getOrderCode()); | ||
290 | + | ||
291 | + AppraiseOrderStorage appraiseOrderStorage = appraiseOrderStorageMapper.selectByOrderCode(deposit.getOrderCode()); | ||
292 | + | ||
293 | + SellerOrderGoods sog = new SellerOrderGoods(); | ||
294 | + sog.setSizeName(null == appraiseOrderStorage ? "" : appraiseOrderStorage.getSizeName()); | ||
295 | + sog.setProductId(deposit.getProductId()); | ||
296 | + sog.setProductName(CollectionUtils.isEmpty(appraiseOrderGoodses) ? "" : appraiseOrderGoodses.get(0).getProductName()); | ||
297 | + return sog; | ||
298 | + } else { | ||
299 | + return Optional.ofNullable(deposit).map(StorageDeposit::getSkup) | ||
300 | + .map(sellerOrderGoodsMapper::selectByPrimaryKey).orElse(null); | ||
301 | + } | ||
302 | + } | ||
276 | } | 303 | } |
@@ -42,6 +42,9 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { | @@ -42,6 +42,9 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { | ||
42 | @Autowired | 42 | @Autowired |
43 | private SellerOrderGoodsMapper sellerOrderGoodsMapper; | 43 | private SellerOrderGoodsMapper sellerOrderGoodsMapper; |
44 | 44 | ||
45 | + @Autowired | ||
46 | + private DepositHelpService depositHelpService; | ||
47 | + | ||
45 | @Override | 48 | @Override |
46 | public boolean isTimeoutCancelStatus(OrderInfo orderInfo) { | 49 | public boolean isTimeoutCancelStatus(OrderInfo orderInfo) { |
47 | return false; | 50 | return false; |
@@ -174,8 +177,7 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { | @@ -174,8 +177,7 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { | ||
174 | try { | 177 | try { |
175 | logger.info("depositService.notify begin, orderInfo is {}", orderInfo); | 178 | logger.info("depositService.notify begin, orderInfo is {}", orderInfo); |
176 | StorageDeposit deposit = depositService.selectStorageDeposit(depositOrder.getUid(), depositOrder.getDepositCode()); | 179 | StorageDeposit deposit = depositService.selectStorageDeposit(depositOrder.getUid(), depositOrder.getDepositCode()); |
177 | - SellerOrderGoods psog = Optional.ofNullable(deposit).map(StorageDeposit::getSkup) | ||
178 | - .map(sellerOrderGoodsMapper::selectByPrimaryKey).orElse(null); | 180 | + SellerOrderGoods psog = depositHelpService.querySellerOrderGoods(deposit); |
179 | inBoxFacade.renewDepositNotify(deposit.getOwnerUid(), psog); // 续约成功后,发通知 | 181 | inBoxFacade.renewDepositNotify(deposit.getOwnerUid(), psog); // 续约成功后,发通知 |
180 | } catch (Exception e) { | 182 | } catch (Exception e) { |
181 | logger.error("depositService.notify find wrong, orderInfo is {}", orderInfo); | 183 | logger.error("depositService.notify find wrong, orderInfo is {}", orderInfo); |
@@ -195,8 +197,7 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { | @@ -195,8 +197,7 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { | ||
195 | logger.info("depositService.notify begin, orderInfo is {}", orderInfo); | 197 | logger.info("depositService.notify begin, orderInfo is {}", orderInfo); |
196 | 198 | ||
197 | StorageDeposit deposit = depositService.selectStorageDeposit(depositOrder.getUid(), depositOrder.getDepositCode()); | 199 | StorageDeposit deposit = depositService.selectStorageDeposit(depositOrder.getUid(), depositOrder.getDepositCode()); |
198 | - SellerOrderGoods psog = Optional.ofNullable(deposit).map(StorageDeposit::getSkup) | ||
199 | - .map(sellerOrderGoodsMapper::selectByPrimaryKey).orElse(null); | 200 | + SellerOrderGoods psog = depositHelpService.querySellerOrderGoods(deposit); |
200 | inBoxFacade.recallDepositNotify(deposit.getOwnerUid(), psog); // 更新待拣货状态成功后,发通知 | 201 | inBoxFacade.recallDepositNotify(deposit.getOwnerUid(), psog); // 更新待拣货状态成功后,发通知 |
201 | } catch (Exception e) { | 202 | } catch (Exception e) { |
202 | logger.error("depositService.notify find wrong, orderInfo is {}", orderInfo); | 203 | logger.error("depositService.notify find wrong, orderInfo is {}", orderInfo); |
@@ -525,20 +525,18 @@ public class DepositServiceImpl implements DepositService { | @@ -525,20 +525,18 @@ public class DepositServiceImpl implements DepositService { | ||
525 | .depositCode(storageDeposit.getDepositCode()) | 525 | .depositCode(storageDeposit.getDepositCode()) |
526 | .skup(storageDeposit.getSkup()) | 526 | .skup(storageDeposit.getSkup()) |
527 | .status(storageDeposit.getStatus()) | 527 | .status(storageDeposit.getStatus()) |
528 | - .ownerUid(storageDeposit.getOwnerUid()); | 528 | + .ownerUid(storageDeposit.getOwnerUid()) |
529 | + .orderCode(storageDeposit.getOrderCode()) | ||
530 | + .parentOrderCode(null == storageDeposit.getParentOrderCode() ? storageDeposit.getOrderCode() : storageDeposit.getParentOrderCode()); | ||
529 | 531 | ||
530 | if (DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode().equals(storageDeposit.getOutType())) { // 如果是寄存订单,寄回的商品,则需要查询状态 | 532 | if (DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode().equals(storageDeposit.getOutType())) { // 如果是寄存订单,寄回的商品,则需要查询状态 |
531 | Map<Long, List<String>> orderStatusStr = depositHelpService.queryAppraiseOrderStatusEx(storageDeposit.getOrderCode()); | 533 | Map<Long, List<String>> orderStatusStr = depositHelpService.queryAppraiseOrderStatusEx(storageDeposit.getOrderCode()); |
532 | 534 | ||
533 | depositDetailBoBuilder.depositStatusName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(0) : "") | 535 | depositDetailBoBuilder.depositStatusName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(0) : "") |
534 | - .depositDescName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(1) : "") | ||
535 | - .orderCode(storageDeposit.getOrderCode()) | ||
536 | - .parentOrderCode(storageDeposit.getParentOrderCode()); | 536 | + .depositDescName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(1) : ""); |
537 | } else { // 正常的买家订单召回 | 537 | } else { // 正常的买家订单召回 |
538 | depositDetailBoBuilder.depositStatusName(StorageDepositStatusEnum.getAppStatusNameByCode(storageDeposit.getStatus())) | 538 | depositDetailBoBuilder.depositStatusName(StorageDepositStatusEnum.getAppStatusNameByCode(storageDeposit.getStatus())) |
539 | - .depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus())) | ||
540 | - .orderCode(storageDeposit.getOrderCode()) | ||
541 | - .parentOrderCode(storageDeposit.getOrderCode()); | 539 | + .depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus())); |
542 | } | 540 | } |
543 | 541 | ||
544 | return depositDetailBoBuilder.build(); | 542 | return depositDetailBoBuilder.build(); |
-
Please register or login to post a comment