Authored by mali

续约,召回短信通知

... ... @@ -15,9 +15,7 @@ import com.yohoufo.common.helper.ImageUrlAssist;
import com.yohoufo.common.utils.AppVersion;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.common.utils.StringUtil;
import com.yohoufo.dal.order.AppraiseOrderMapper;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.DepositCodeMapper;
import com.yohoufo.dal.order.*;
import com.yohoufo.dal.order.model.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
... ... @@ -50,6 +48,18 @@ public class DepositHelpService {
@Autowired
private BuyerOrderMapper buyerOrderMapper;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Autowired
private ServiceOrderProcessor serviceOrderProcessor;
@Autowired
private AppraiseOrderGoodsMapper appraiseOrderGoodsMapper;
@Autowired
private AppraiseOrderStorageMapper appraiseOrderStorageMapper;
// 是否 24小时反馈时间 如果是则返回true
public boolean isFeedback(int depositRemainDay) {
return -1 * DepositOrderComputeResp.FEEDBACK_DAY <= depositRemainDay && depositRemainDay <= 0;
... ... @@ -273,4 +283,21 @@ public class DepositHelpService {
return buyerGoodsMap;
}
public SellerOrderGoods querySellerOrderGoods(StorageDeposit deposit) {
if (serviceOrderProcessor.isGoodsServiceOrder(deposit.getOrderCode())) {
List<AppraiseOrderGoods> appraiseOrderGoodses = appraiseOrderGoodsMapper.selectByOrderCode(deposit.getOrderCode());
AppraiseOrderStorage appraiseOrderStorage = appraiseOrderStorageMapper.selectByOrderCode(deposit.getOrderCode());
SellerOrderGoods sog = new SellerOrderGoods();
sog.setSizeName(null == appraiseOrderStorage ? "" : appraiseOrderStorage.getSizeName());
sog.setProductId(deposit.getProductId());
sog.setProductName(CollectionUtils.isEmpty(appraiseOrderGoodses) ? "" : appraiseOrderGoodses.get(0).getProductName());
return sog;
} else {
return Optional.ofNullable(deposit).map(StorageDeposit::getSkup)
.map(sellerOrderGoodsMapper::selectByPrimaryKey).orElse(null);
}
}
}
... ...
... ... @@ -42,6 +42,9 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Autowired
private DepositHelpService depositHelpService;
@Override
public boolean isTimeoutCancelStatus(OrderInfo orderInfo) {
return false;
... ... @@ -174,8 +177,7 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
try {
logger.info("depositService.notify begin, orderInfo is {}", orderInfo);
StorageDeposit deposit = depositService.selectStorageDeposit(depositOrder.getUid(), depositOrder.getDepositCode());
SellerOrderGoods psog = Optional.ofNullable(deposit).map(StorageDeposit::getSkup)
.map(sellerOrderGoodsMapper::selectByPrimaryKey).orElse(null);
SellerOrderGoods psog = depositHelpService.querySellerOrderGoods(deposit);
inBoxFacade.renewDepositNotify(deposit.getOwnerUid(), psog); // 续约成功后,发通知
} catch (Exception e) {
logger.error("depositService.notify find wrong, orderInfo is {}", orderInfo);
... ... @@ -195,8 +197,7 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
logger.info("depositService.notify begin, orderInfo is {}", orderInfo);
StorageDeposit deposit = depositService.selectStorageDeposit(depositOrder.getUid(), depositOrder.getDepositCode());
SellerOrderGoods psog = Optional.ofNullable(deposit).map(StorageDeposit::getSkup)
.map(sellerOrderGoodsMapper::selectByPrimaryKey).orElse(null);
SellerOrderGoods psog = depositHelpService.querySellerOrderGoods(deposit);
inBoxFacade.recallDepositNotify(deposit.getOwnerUid(), psog); // 更新待拣货状态成功后,发通知
} catch (Exception e) {
logger.error("depositService.notify find wrong, orderInfo is {}", orderInfo);
... ...
... ... @@ -525,20 +525,18 @@ public class DepositServiceImpl implements DepositService {
.depositCode(storageDeposit.getDepositCode())
.skup(storageDeposit.getSkup())
.status(storageDeposit.getStatus())
.ownerUid(storageDeposit.getOwnerUid());
.ownerUid(storageDeposit.getOwnerUid())
.orderCode(storageDeposit.getOrderCode())
.parentOrderCode(null == storageDeposit.getParentOrderCode() ? storageDeposit.getOrderCode() : storageDeposit.getParentOrderCode());
if (DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode().equals(storageDeposit.getOutType())) { // 如果是寄存订单,寄回的商品,则需要查询状态
Map<Long, List<String>> orderStatusStr = depositHelpService.queryAppraiseOrderStatusEx(storageDeposit.getOrderCode());
depositDetailBoBuilder.depositStatusName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(0) : "")
.depositDescName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(1) : "")
.orderCode(storageDeposit.getOrderCode())
.parentOrderCode(storageDeposit.getParentOrderCode());
.depositDescName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(1) : "");
} else { // 正常的买家订单召回
depositDetailBoBuilder.depositStatusName(StorageDepositStatusEnum.getAppStatusNameByCode(storageDeposit.getStatus()))
.depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus()))
.orderCode(storageDeposit.getOrderCode())
.parentOrderCode(storageDeposit.getOrderCode());
.depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus()));
}
return depositDetailBoBuilder.build();
... ...