Authored by tanling

Merge branch 'test6.9.10' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.10

... ... @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.yoho.message.sdk.common.model.SendMessageRspBo;
import com.yoho.message.sdk.service.ufo.IUFOSendService;
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
import com.yohobuy.ufo.model.order.bo.DepositOrderStatisticInfo;
import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
import com.yohobuy.ufo.model.order.common.SuperEnterStageLevel;
import com.yohobuy.ufo.model.order.vo.GoodsVo;
... ... @@ -18,6 +19,7 @@ import com.yohoufo.inboxclient.model.InBoxResponse;
import com.yohoufo.inboxclient.model.InboxReqVO;
import com.yohoufo.inboxclient.sdk.InBoxSDK;
import com.yohoufo.order.service.impl.function.BuyerNoticeSender;
import com.yohoufo.order.service.seller.deposit.SellerDepositOrderService;
import com.yohoufo.order.utils.NamedThreadFactory;
import com.yohoufo.order.utils.PaymentHelper;
import lombok.NonNull;
... ... @@ -77,6 +79,9 @@ public class InBoxFacade extends BaseNoticeFacade{
@Autowired
private BuyerNoticeFacade buyerNoticeFacade;
@Autowired
private SellerDepositOrderService sellerDepositOrderService;
@Override
public Logger getLogger() {
return log;
... ... @@ -1032,6 +1037,8 @@ public class InBoxFacade extends BaseNoticeFacade{
.build();
}
public void sellerDepositOrderNotice(int uid,long orderCode, AppraiseOrderStatus targetStatus){
log.info("enter sellerDepositOrderNotice uid {} orderCode {} targetStatus {}", uid, orderCode, targetStatus);
try {
... ... @@ -1111,11 +1118,15 @@ public class InBoxFacade extends BaseNoticeFacade{
break;
case FINISH:
//订单编号{},申请{}件,实收{}件,鉴定通过{}件,鉴定为假{}件,无法鉴定{}件,鉴定瑕疵{}件
DepositOrderStatisticInfo statisticInfo = sellerDepositOrderService.getAppraiseProgress(uid, orderCode);
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_FINISH_APPRAISE_SUMMARY;
inboxParams = new Object[]{orderCode};
inboxParams = new Object[]{orderCode, statisticInfo.getApplyTotal(), statisticInfo.getReceiveTotal(),
statisticInfo.getPassNum(), statisticInfo.getFakeNum(), statisticInfo.getUnsureNum(),
statisticInfo.getFlawNum()};
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_DEPOSIT_ORDER_FINISH_APPRAISE_SUMMARY;
smsParams = new Object[]{orderCode};
smsParams = inboxParams;
break;
}
... ...
package com.yohoufo.order.service.seller.deposit;
import com.google.common.collect.Lists;
import com.yohobuy.ufo.model.order.bo.DepositOrderStatisticInfo;
import com.yohobuy.ufo.model.order.bo.TimeoutBo;
import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
... ... @@ -54,6 +55,9 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService {
@Autowired
private IExpressInfoService expressInfoService;
@Autowired
private SellerDepositOrderService sellerDepositOrderService;
private static final List<Integer> showEXpressInfoStatusList = Lists.newArrayList(AppraiseOrderStatus.SELLER_SEND_OUT.getCode(),
AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(),
... ... @@ -76,6 +80,10 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService {
AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()
);
private static final List<Integer> showAppraiseProgress = Lists.newArrayList(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(),
AppraiseOrderStatus.FINISH.getCode()
);
private static final List<Integer> addressUpgradableStatusList = Lists.newArrayList(AppraiseOrderStatus.HAS_PAYED.getCode());
... ... @@ -107,6 +115,11 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService {
if (showUserAddressStatusList.contains(pao.getStatus())){
userAddress = appraiseOrderMetaService.getHidderUserAddress(orderCode);
}
DepositOrderStatisticInfo orderStatisticInfo = null;
if (showAppraiseProgress.contains(pao.getStatus())){
orderStatisticInfo = sellerDepositOrderService.getAppraiseProgress(uid, orderCode);
}
boolean addressUpgradable = addressUpgradableStatusList.contains(pao.getStatus());
SellerDepositOrderPrdListReq sknListReq = SellerDepositOrderPrdListReq.builder()
.orderCode(orderCode)
... ... @@ -125,6 +138,7 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService {
.addressUpgradable(addressUpgradable)
.buttons(aos.detailButtons(oa))
.lastExpressInfoDetail(expressInfoService.getLastExpressInfoDetail(pao))
.appraiseProgress(orderStatisticInfo)
.build()
;
}
... ...
... ... @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.AppraiseOrderBo;
import com.yohobuy.ufo.model.order.bo.DepositOrderStatisticInfo;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
... ... @@ -53,6 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
... ... @@ -594,17 +596,77 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
public List<AppraiseOrderBo> getSubOrderStatistic(long orderCode){
List<AppraiseOrder> paoList = buildSubOrderStatisticList(orderCode);
return paoList.parallelStream().map(pao->AppraiseOrderBo.builder()
.parentOrderCode(pao.getParentOrderCode())
.orderCode(orderCode).status(pao.getStatus()).statusCnt(pao.getStatusCnt()).build())
.collect(Collectors.toList());
}
private List<AppraiseOrder> buildSubOrderStatisticList(long orderCode){
AppraiseOrder appraiseOrder = appraiseOrderMapper.selectByOrderCode(orderCode);
if (Objects.isNull(appraiseOrder)){
logger.warn("in getSubOrderStatistic selectByOrderCode null, orderCode {}", orderCode);
return null;
return new ArrayList<>(0);
}
long occ = appraiseOrder.getParentOrderCode()==null ? orderCode : appraiseOrder.getParentOrderCode();
List<AppraiseOrder> paoList = appraiseOrderMapper.selectSubOrderStatistic(occ);
logger.info("getSubOrderStatistic orderCode {} ParentOrderCode {} AppraiseOrder list {}", orderCode, occ, paoList);
return paoList.parallelStream().map(pao->AppraiseOrderBo.builder()
.parentOrderCode(pao.getParentOrderCode())
.orderCode(orderCode).status(pao.getStatus()).statusCnt(pao.getStatusCnt()).build())
.collect(Collectors.toList());
return paoList;
}
public DepositOrderStatisticInfo getAppraiseProgress(int uid, long orderCode){
List<AppraiseOrder> paoList = buildSubOrderStatisticList(orderCode);
//申请
int applyTotal = 0;
int shamNum = 0;
//鉴定为假
Integer fakeNum = 0;
//无法鉴定
Integer unsureNum = 0;
//鉴定通过
Integer passNum = 0;
//鉴定瑕疵
Integer flawNum = 0;
int waitingAppraiseNum = 0;
for (AppraiseOrder pao : paoList){
int cnt = pao.getStatusCnt();
AppraiseOrderStatus orderStatus = AppraiseOrderStatus.getByCode(pao.getStatus());
switch (orderStatus){
case SHAM_SEND_OUT:
shamNum = cnt;
break;
case PLATFORM_APPRAISE_UNSURE:
unsureNum = cnt;
break;
case JUDGE_PASS:
passNum = cnt;
break;
case CHECKING_FAKE:
fakeNum = cnt;
break;
case QUALITY_CHECK_FAKE:
flawNum = cnt;
break;
case PLATFORM_RECEIVE:
waitingAppraiseNum = cnt;
break;
}
applyTotal += cnt;
}
//实收
Integer receiveTotal = applyTotal - shamNum;
DepositOrderStatisticInfo dosi = DepositOrderStatisticInfo.builder()
.applyTotal(applyTotal)
.unsureNum(unsureNum)
.passNum(passNum)
.fakeNum(fakeNum)
.flawNum(flawNum)
.receiveTotal(receiveTotal)
.waitingAppraiseNum(waitingAppraiseNum)
.build();
return dosi;
}
}
... ...