Authored by chenchao

add build

... ... @@ -155,9 +155,13 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
@Autowired
private SellerService sellerService;
@Autowired
private SpecialTimeConfigReader specialTimeConfigReader;
@Autowired
private SellerOrderService sellerOrderService;
private static String EXPRESS_MQ_SEND = "third.logistics.logistics_data";
//物流文案设置
... ... @@ -394,6 +398,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
//保存物流信息+更新订单状态;
//本阶段的物流类型和订单状态
//TODO 如果使用了卖家优惠券,处理券
String couponCode = req.getCouponCode();
boolean selectCoupon = StringUtils.isNoneBlank(couponCode);
Integer expressType = expressTypeEnum.getCode();
int updateOrderCnt = 0;
Supplier<String> sellerMobileSupplier;
... ... @@ -414,7 +421,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
//非(现货寄存订单+使用寄存商品发货)
updateOrderCnt = processBuyerOrderOfNotInstockDepositUsingDepositGoods(preparedData, dscNode, req4Log);
}
if(selectCoupon && updateOrderCnt>0){
sellerOrderService.submitWithCoupon(couponCode, req.getBusinessClient(), preparedData);
}
break;
case GOODS_SERVICE:
IGoodsService goodsService = serviceOrderProcessor.findGoodsServiceInstance(orderCode);
... ...
... ... @@ -48,6 +48,7 @@ import com.yohoufo.order.service.impl.visitor.UserCancelCase;
import com.yohoufo.order.service.proxy.*;
import com.yohoufo.order.service.seller.SellerAuthCheckService;
import com.yohoufo.order.service.seller.SellerOrderCancelService;
import com.yohoufo.order.service.seller.support.SellerOrderContextFactory;
import com.yohoufo.order.service.seller.trade.SellerOrderComputeService;
import com.yohoufo.order.service.seller.SkupBatchService;
import com.yohoufo.order.service.seller.orderMeta.SellerFeeService;
... ... @@ -994,9 +995,24 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic
public void submitWithCoupon(SellerOrderRelatedBuyerOrderContext sorboc){
SellerOrderChargeParam chargeParam = sorboc.getChargeParam();
chargeParam.setChargeStage(SellerOrderChargeParam.SUBMIT);
public void submitWithCoupon(String couponCode,
String businessClient,
BuyerOrderAssistant.PreparedData preparedData){
SellerOrderGoods psog = preparedData.getSellerOrderGoods();
SellerOrderChargeParam chargeParam = SellerOrderChargeParam.builder()
.chargeStage(SellerOrderChargeParam.SUBMIT).build();
Supplier<SellerOrderComputeResult> computeResultSupplier = ()->sellerFeeService.getSellerOrderComputeResult(psog.getUid(), psog.getId());
SellerOrderRelatedBuyerOrderContext sorboc = SellerOrderContextFactory.builder()
.uid(psog.getUid())
.couponCode(couponCode).businessClient(businessClient)
.chargeParam(chargeParam)
.computeResultSupplier(computeResultSupplier)
.sellerOrderGoods(psog)
.build().buildSellerOrderRelatedBuyerOrderContext();
sellerOrderComputeService.compute(sorboc);
//TODO how to keep atomic,rollback when fail
... ... @@ -1006,7 +1022,6 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic
CouponBoList couponBoList = CouponSupport.buildOrderCouponBoList(computeResult.getCouponPayResultList());
SellerOrderGoods psog = sorboc.getSkupInfo();
SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(psog.getId());
... ...
package com.yohoufo.order.service.seller.support;
import com.yohobuy.ufo.model.order.bo.SellerOrderChargeParam;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.model.SellerOrderRelatedBuyerOrderContext;
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
import lombok.Builder;
import lombok.Data;
import java.util.function.Supplier;
@Data
@Builder
public class SellerOrderContextFactory {
private Supplier<SellerOrderComputeResult> computeResultSupplier;
private int uid;
private String businessClient;
private String couponCode;
private SellerOrderGoods sellerOrderGoods;
private SellerOrderChargeParam chargeParam;
public SellerOrderRelatedBuyerOrderContext buildSellerOrderRelatedBuyerOrderContext(){
SellerOrderRelatedBuyerOrderContext sorboc = new SellerOrderRelatedBuyerOrderContext();
sorboc.setUid(uid);
sorboc.setBusinessClient(businessClient);
sorboc.setCouponCode(couponCode);
sorboc.setSkupInfo(sellerOrderGoods);
//sorboc.setAutoRecommended(autoRecommended);
sorboc.setChargeParam(chargeParam);
sorboc.setSellerOrderComputeResult(computeResultSupplier.get());
return sorboc;
}
}
... ...