Authored by tanling

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

... ... @@ -230,7 +230,7 @@ public class DepositHelpService {
case CHECKING_FAKE:
return "您的商品鉴定未通过,保证金已扣除,平台将在1-3个工作日内到付寄回,请留意物流动态";
case QUALITY_CHECK_FAKE:
return "商品质检未通过,保证金已赔付给买家,平台将在1-3个工作日内到付寄回,请留意物流动态";
return "商品质检未通过,保证金已退还,平台将在1-3个工作日内到付寄回,请留意物流动态";
default:
return "";
}
... ...
... ... @@ -1041,7 +1041,8 @@ public class InBoxFacade extends BaseNoticeFacade{
public void sellerDepositOrderNotice(int uid,long orderCode, AppraiseOrderStatus targetStatus, boolean isParent){
log.info("enter sellerDepositOrderNotice uid {} orderCode {} targetStatus {}", uid, orderCode, targetStatus);
log.info("enter sellerDepositOrderNotice uid {} orderCode {} targetStatus {} isParent {}",
uid, orderCode, targetStatus, isParent);
try {
//
InboxBusinessTypeEnum inboxType = null;
... ...
... ... @@ -24,6 +24,7 @@ import com.yohoufo.order.convert.ProductConvertor;
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
import com.yohoufo.order.service.impl.AbsOrderViewService;
import com.yohoufo.order.utils.LoggerUtils;
import com.yohoufo.order.utils.SellerGoodsHelper;
import lombok.Builder;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
... ... @@ -188,11 +189,25 @@ public class SellerDepositOrderListService extends AbsOrderViewService {
AppraiseOrderStatus appraiseOrderStatus = AppraiseOrderStatus.getByCode(pao.getStatus());
OrderAttributes oa = OrderAttributes.getOrderAttributes(pao.getAttributes());
String refundEarnestMoney = ordersPayRefund == null? null : ordersPayRefund.getAmount().toPlainString();
boolean notRefund = ordersPayRefund == null;
String refundEarnestMoney = notRefund ? null : ordersPayRefund.getAmount().toPlainString();
switch (appraiseOrderStatus){
case CHECKING_FAKE:
if (notRefund){
refundEarnestMoney = BigDecimal.ZERO.toPlainString();
}
break;
case JUDGE_PASS_WAIT_WAREHOUSE:
if (notRefund){
refundEarnestMoney = BigDecimal.ZERO.toPlainString();
}
break;
}
GoodsVo goods = GoodsVo.builder()
.productName(paog.getProductName())
.imgUrl(ImageUrlAssist.getProductFullPicUrlWithDefaultSetting(paog.getImageUrl()))
.sizeName(paos.getSizeName())
.sizeName(SellerGoodsHelper.appendSizeCNUnit(paos.getSizeName()))
.build();
DepositOrderInStorePrdListResp resp = DepositOrderInStorePrdListResp.builder()
.earnestMoney(BigDecimalHelper.halfUp(pao.getAmount()).toPlainString())
... ... @@ -294,7 +309,7 @@ public class SellerDepositOrderListService extends AbsOrderViewService {
}
Integer storageNum;
BigDecimal emOfSku = socr.getEarnestMoney().getEarnestMoney().multiply(new BigDecimal(storageNum=aos.getNum()));
GoodsVo goodsVo = GoodsVo.builder().sizeName(aos.getSizeName()).num(storageNum)
GoodsVo goodsVo = GoodsVo.builder().sizeName(SellerGoodsHelper.appendSizeCNUnit(aos.getSizeName())).num(storageNum)
.earnestMoney(BigDecimalHelper.formatNumber(emOfSku, BigDecimalHelper.FORMAT_TWOBITAFTERPOINT)).build();
goodsList.add(goodsVo);
}
... ...
... ... @@ -462,12 +462,17 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
//
Long orderCode = appraiseOrder.getOrderCode();
Long parentOrderCode;
Long paidOrderCode;
boolean isParent = Objects.isNull(parentOrderCode=appraiseOrder.getParentOrderCode());
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SHAM_SEND_OUT;
AppraiseOrderStatus expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
if(isParent){
triggerStatusChangeByParentCode(parentOrderCode, targetOrderStatus, expectedStatus);
logger.info("shamDeliver isParent orderCode {} ", orderCode);
paidOrderCode = orderCode;
triggerStatusChangeByParentCode(orderCode, targetOrderStatus, expectedStatus);
}else {
logger.info("shamDeliver is not Parent orderCode {} ", orderCode);
paidOrderCode = parentOrderCode;
//no parent
triggerStatusConsistencyCheck(orderCode);
}
... ... @@ -479,7 +484,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
.loadUser(appraiseOrder.getUid())
.loadActionCase(SellerWalletDetail.Type.SELLER_SHAM_SEND_OUT)
.loadRefundAction(payRefundService::refund)
.loadOrder(appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode(), appraiseOrder.getPayment(), appraiseOrder.getAmount())
.loadOrder(orderCode, paidOrderCode, appraiseOrder.getPayment(), appraiseOrder.getAmount())
.refund();
return rows;
}
... ...
... ... @@ -4,6 +4,7 @@ import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.constants.RegionEnum;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.util.HashMap;
... ... @@ -104,4 +105,10 @@ public final class SellerGoodsHelper {
}
public static String appendSizeCNUnit(String sizeName){
if (StringUtils.isBlank(sizeName)){
return sizeName;
}
return new StringBuilder(sizeName).append("码").toString();
}
}
... ...
... ... @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yohobuy.ufo.model.order.bo.AppraiseOrderBo;
import com.yohoufo.order.BaseWebTest;
import com.yohoufo.order.event.OrderCancelEvent;
import com.yohoufo.order.service.impl.ServiceOrderProcessor;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -13,6 +14,9 @@ public class SellerDepositOrderServiceTest extends BaseWebTest {
@Autowired
private SellerDepositOrderService sellerDepositOrderService;
@Autowired
private ServiceOrderProcessor serviceOrderProcessor;
@Test
public void testGetSubOrderStatistic(){
//sub 36378862305176
... ... @@ -29,4 +33,12 @@ public class SellerDepositOrderServiceTest extends BaseWebTest {
sellerDepositOrderService.cancelByTimeout(orderCancelEvent);
}
@Test
public void testshamDeliver(){
long orderCode = 36380351864658L;
ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.isAppraiseOrder(orderCode);
sellerDepositOrderService.shamDeliver(existenceNode.getAppraiseOrder());
}
}
... ...