Authored by chaogeng

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

... ... @@ -5,6 +5,7 @@ import com.yohobuy.ufo.model.order.constants.OrderConstant;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;
... ... @@ -67,6 +68,9 @@ public class BuyerOrder {
@Getter@Setter
private int bidType;
@Getter@Setter
private Integer businessClient;
public Integer getOriginalStatus() {
return originalStatus;
}
... ...
... ... @@ -131,7 +131,8 @@ public class BuyerBidController {
@RequestParam(name = "price") String price,
@RequestParam(name = "time_limit_id") int time_limit_id,
@RequestParam(name = "channelNo", required = false) String channelNo,
@RequestParam(name = "client_type", required = false) String clientType) {
@RequestParam(name = "client_type", required = false) String clientType,
@RequestParam(name = "business_client", required = false)String businessClient) {
logger.info("in ufo.buyer.bid.publish, uid:{},storage_id:{},address_id:{},price:{}, time_limit_id:{}", uid, storage_id, address_id, price, time_limit_id);
... ... @@ -145,6 +146,7 @@ public class BuyerBidController {
.day(bidTimeLimit.getDays())
.channelNo(channelNo)
.clientType(clientType)
.businessClient(businessClient)
.build();
BidPublishResponse response = buyerBidPublishService.publish(req);
return new ApiResponse.ApiResponseBuilder().code(200).data(response).message("ok").build();
... ... @@ -208,12 +210,14 @@ public class BuyerBidController {
@RequestParam(name = "orderCode") long orderCode,
@RequestParam(name = "price") String price,
@RequestParam(name = "channelNo", required = false) String channelNo,
@RequestParam(name = "client_type", required = false) String clientType) {
@RequestParam(name = "client_type", required = false) String clientType,
@RequestParam(name = "business_client", required = false)String businessClient) {
logger.info("in ufo.buyer.bid.changePrice, uid:{},orderCode:{},price:{}", uid, orderCode, price);
BuyerBidChangePriceRequest req = BuyerBidChangePriceRequest.builder().uid(uid).orderCode(orderCode)
.price(priceComputePrepareProcessor.checkAndAcquireSalePrice(price, SkupType.IN_STOCK))
.channelNo(channelNo)
.clientType(clientType)
.businessClient(businessClient)
.build();
BidPublishResponse response = buyerBidPriceService.changePrice(req);
... ...
... ... @@ -140,7 +140,8 @@ public class ShoppingController {
@RequestParam(name = "activity_type", required = false, defaultValue = "0") int activityType,
@RequestParam(name="depositRequirement", required = false, defaultValue = OrderConstant.N_STR)String depositRequirement,
@RequestParam(name="promotionId", required = false)Integer promotionId,
@RequestParam(name = "client_type", required = false) String clientType){
@RequestParam(name = "client_type", required = false) String clientType,
@RequestParam(name="business_client", required = false)String businessClient){
if(StringUtils.isBlank(channelNo)){
channelNo = "2919";
}
... ... @@ -154,6 +155,7 @@ public class ShoppingController {
.userActivityId(userActivityId).activityType(activityTypeEnum)
.depositRequirement(depositRequirement)
.promotionId(promotionId)
.businessClient(businessClient)
.build();
logger.info("in ufo.order.submit, req {}", request);
OrderSubmitResponse submitResponse = buyerOrderService.submit(request);
... ...
... ... @@ -19,7 +19,7 @@ public class OfflineOrderBuilderFactory extends OrderBuilderFactory {
Function<SkupType, Integer> deliveryWayFunc,
SellerOrderGoods psog,
ChargeContext chargeContext) {
return super.create(uid, orderCode, channelNo, clientType, userAddressPair, goodsPrepareData, this::getDeliveryWayCode, psog, chargeContext);
return super.create(uid, orderCode, channelNo, clientType, userAddressPair, goodsPrepareData, this::getDeliveryWayCode, psog, chargeContext, null);
}
... ...
package com.yohoufo.order.model;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.constants.BusinessClientEnum;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
... ... @@ -16,6 +17,7 @@ import com.yohoufo.order.model.bo.CouponBo;
import com.yohoufo.order.model.bo.CouponBoList;
import com.yohoufo.order.model.dto.OrderBuilder;
import com.yohoufo.order.service.impl.ShoppingServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import java.math.BigDecimal;
... ... @@ -30,11 +32,18 @@ public class OrderBuilderFactory {
ShoppingServiceImpl.GoodsPrepareData goodsPrepareData,
Function<SkupType, Integer> deliveryWayFunc,
SellerOrderGoods psog,
ChargeContext chargeContext) {
ChargeContext chargeContext,
String businessClient) {
//算费结果
ChargeResult chargeResult = chargeContext.getChargeResult();
ChargeGoods chargeGoods = chargeContext.getChargeGoods();
SkupType skupType = chargeGoods.getSkupType();
Integer businessClientCode = null;
if (StringUtils.isNotBlank(businessClient)){
if(OrderConstant.BusinessClient.TAOBAO_FLEAMARKET.equalsIgnoreCase(businessClient)) {
businessClientCode = BusinessClientEnum.TAOBAO_FLEAMARKET_CLIENT.getCode();
}
}
return OrderBuilder.builder()
.uid(uid)
... ... @@ -60,6 +69,7 @@ public class OrderBuilderFactory {
.depositFee(buildDepositFee(chargeGoods))
.promotionCutAmount(chargeResult.getPromotionCutAmount())
.useableFullPromotionList(chargeGoods.getUseableFullPromotionList())
.businessClient(businessClientCode)
.build();
}
... ...
... ... @@ -29,7 +29,7 @@ public class OrderBuilder {
int paymentType;
int deliverWay;
String channelNo;
Integer businessClient;
/**
* 实付金额
*/
... ...
... ... @@ -22,6 +22,7 @@ public class BuyerBidChangePriceRequest {
//-------------- 非必要参数 -----------
private String channelNo;
private String clientType;
private String businessClient;
//----------------非必要参数-------------
}
... ...
... ... @@ -39,6 +39,7 @@ public class BuyerBidPublishRequest {
//-------------- 非必要参数 -----------
private String channelNo;
private String clientType;
private String businessClient;
//----------------非必要参数-------------
... ...
... ... @@ -76,4 +76,8 @@ public class ShoppingRequest {
* 促销
*/
private Integer promotionId;
/**
* business_client: 'h5/xianyu',
*/
private String businessClient;
}
... ...
... ... @@ -117,6 +117,7 @@ public class BuyerBidPriceService {
.price(context.newPrice)
.skupType(context.sellerOrderGoods.getAttributes())
.userAddressPair(context.userAddressPair)
.businessClient(request.getBusinessClient())
.build();
BidPublishResult bidPublishResult = buyerBidPublishService.bidPublish(req);
try {
... ...
... ... @@ -281,7 +281,8 @@ public class BuyerBidPublishService {
new ShoppingServiceImpl.GoodsPrepareData(),
DeliveryWayUtils::findDeliveryWayCodeBySkupType,
newSellerOrderGoods(skup, goodsInfo.getProductId(), bidPrice.getPrice()),
chargeContext);
chargeContext,
request.getBusinessClient());
//求购 定金
BidOrderMetaBo bidOrderMetaBo = BidOrderMetaBo.builder().depositAmount(deposit.getAmount()).day(request.getDay()).build();
... ...
... ... @@ -463,7 +463,8 @@ public class ShoppingServiceImpl implements IShoppingService {
userAddressPair,
goodsPrepareData,
DeliveryWayUtils::findDeliveryWayCodeBySkupType,
psog, chargeContext);
psog, chargeContext,
shoppingRequest.getBusinessClient());
submitResult = ordeCreationService.doSubmitOrder(orderBuilder);
}finally {
... ...