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; @@ -5,6 +5,7 @@ import com.yohobuy.ufo.model.order.constants.OrderConstant;
5 import lombok.Getter; 5 import lombok.Getter;
6 import lombok.Setter; 6 import lombok.Setter;
7 import lombok.ToString; 7 import lombok.ToString;
  8 +import org.springframework.web.bind.annotation.RequestParam;
8 9
9 import java.math.BigDecimal; 10 import java.math.BigDecimal;
10 11
@@ -67,6 +68,9 @@ public class BuyerOrder { @@ -67,6 +68,9 @@ public class BuyerOrder {
67 @Getter@Setter 68 @Getter@Setter
68 private int bidType; 69 private int bidType;
69 70
  71 + @Getter@Setter
  72 + private Integer businessClient;
  73 +
70 public Integer getOriginalStatus() { 74 public Integer getOriginalStatus() {
71 return originalStatus; 75 return originalStatus;
72 } 76 }
@@ -131,7 +131,8 @@ public class BuyerBidController { @@ -131,7 +131,8 @@ public class BuyerBidController {
131 @RequestParam(name = "price") String price, 131 @RequestParam(name = "price") String price,
132 @RequestParam(name = "time_limit_id") int time_limit_id, 132 @RequestParam(name = "time_limit_id") int time_limit_id,
133 @RequestParam(name = "channelNo", required = false) String channelNo, 133 @RequestParam(name = "channelNo", required = false) String channelNo,
134 - @RequestParam(name = "client_type", required = false) String clientType) { 134 + @RequestParam(name = "client_type", required = false) String clientType,
  135 + @RequestParam(name = "business_client", required = false)String businessClient) {
135 136
136 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); 137 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);
137 138
@@ -145,6 +146,7 @@ public class BuyerBidController { @@ -145,6 +146,7 @@ public class BuyerBidController {
145 .day(bidTimeLimit.getDays()) 146 .day(bidTimeLimit.getDays())
146 .channelNo(channelNo) 147 .channelNo(channelNo)
147 .clientType(clientType) 148 .clientType(clientType)
  149 + .businessClient(businessClient)
148 .build(); 150 .build();
149 BidPublishResponse response = buyerBidPublishService.publish(req); 151 BidPublishResponse response = buyerBidPublishService.publish(req);
150 return new ApiResponse.ApiResponseBuilder().code(200).data(response).message("ok").build(); 152 return new ApiResponse.ApiResponseBuilder().code(200).data(response).message("ok").build();
@@ -208,12 +210,14 @@ public class BuyerBidController { @@ -208,12 +210,14 @@ public class BuyerBidController {
208 @RequestParam(name = "orderCode") long orderCode, 210 @RequestParam(name = "orderCode") long orderCode,
209 @RequestParam(name = "price") String price, 211 @RequestParam(name = "price") String price,
210 @RequestParam(name = "channelNo", required = false) String channelNo, 212 @RequestParam(name = "channelNo", required = false) String channelNo,
211 - @RequestParam(name = "client_type", required = false) String clientType) { 213 + @RequestParam(name = "client_type", required = false) String clientType,
  214 + @RequestParam(name = "business_client", required = false)String businessClient) {
212 logger.info("in ufo.buyer.bid.changePrice, uid:{},orderCode:{},price:{}", uid, orderCode, price); 215 logger.info("in ufo.buyer.bid.changePrice, uid:{},orderCode:{},price:{}", uid, orderCode, price);
213 BuyerBidChangePriceRequest req = BuyerBidChangePriceRequest.builder().uid(uid).orderCode(orderCode) 216 BuyerBidChangePriceRequest req = BuyerBidChangePriceRequest.builder().uid(uid).orderCode(orderCode)
214 .price(priceComputePrepareProcessor.checkAndAcquireSalePrice(price, SkupType.IN_STOCK)) 217 .price(priceComputePrepareProcessor.checkAndAcquireSalePrice(price, SkupType.IN_STOCK))
215 .channelNo(channelNo) 218 .channelNo(channelNo)
216 .clientType(clientType) 219 .clientType(clientType)
  220 + .businessClient(businessClient)
217 .build(); 221 .build();
218 222
219 BidPublishResponse response = buyerBidPriceService.changePrice(req); 223 BidPublishResponse response = buyerBidPriceService.changePrice(req);
@@ -140,7 +140,8 @@ public class ShoppingController { @@ -140,7 +140,8 @@ public class ShoppingController {
140 @RequestParam(name = "activity_type", required = false, defaultValue = "0") int activityType, 140 @RequestParam(name = "activity_type", required = false, defaultValue = "0") int activityType,
141 @RequestParam(name="depositRequirement", required = false, defaultValue = OrderConstant.N_STR)String depositRequirement, 141 @RequestParam(name="depositRequirement", required = false, defaultValue = OrderConstant.N_STR)String depositRequirement,
142 @RequestParam(name="promotionId", required = false)Integer promotionId, 142 @RequestParam(name="promotionId", required = false)Integer promotionId,
143 - @RequestParam(name = "client_type", required = false) String clientType){ 143 + @RequestParam(name = "client_type", required = false) String clientType,
  144 + @RequestParam(name="business_client", required = false)String businessClient){
144 if(StringUtils.isBlank(channelNo)){ 145 if(StringUtils.isBlank(channelNo)){
145 channelNo = "2919"; 146 channelNo = "2919";
146 } 147 }
@@ -154,6 +155,7 @@ public class ShoppingController { @@ -154,6 +155,7 @@ public class ShoppingController {
154 .userActivityId(userActivityId).activityType(activityTypeEnum) 155 .userActivityId(userActivityId).activityType(activityTypeEnum)
155 .depositRequirement(depositRequirement) 156 .depositRequirement(depositRequirement)
156 .promotionId(promotionId) 157 .promotionId(promotionId)
  158 + .businessClient(businessClient)
157 .build(); 159 .build();
158 logger.info("in ufo.order.submit, req {}", request); 160 logger.info("in ufo.order.submit, req {}", request);
159 OrderSubmitResponse submitResponse = buyerOrderService.submit(request); 161 OrderSubmitResponse submitResponse = buyerOrderService.submit(request);
@@ -19,7 +19,7 @@ public class OfflineOrderBuilderFactory extends OrderBuilderFactory { @@ -19,7 +19,7 @@ public class OfflineOrderBuilderFactory extends OrderBuilderFactory {
19 Function<SkupType, Integer> deliveryWayFunc, 19 Function<SkupType, Integer> deliveryWayFunc,
20 SellerOrderGoods psog, 20 SellerOrderGoods psog,
21 ChargeContext chargeContext) { 21 ChargeContext chargeContext) {
22 - return super.create(uid, orderCode, channelNo, clientType, userAddressPair, goodsPrepareData, this::getDeliveryWayCode, psog, chargeContext); 22 + return super.create(uid, orderCode, channelNo, clientType, userAddressPair, goodsPrepareData, this::getDeliveryWayCode, psog, chargeContext, null);
23 } 23 }
24 24
25 25
1 package com.yohoufo.order.model; 1 package com.yohoufo.order.model;
2 2
3 import com.yohobuy.ufo.model.order.common.OrderAttributes; 3 import com.yohobuy.ufo.model.order.common.OrderAttributes;
  4 +import com.yohobuy.ufo.model.order.constants.BusinessClientEnum;
4 import com.yohobuy.ufo.model.order.constants.OrderConstant; 5 import com.yohobuy.ufo.model.order.constants.OrderConstant;
5 import com.yohobuy.ufo.model.order.constants.SkupType; 6 import com.yohobuy.ufo.model.order.constants.SkupType;
6 import com.yohobuy.ufo.model.order.vo.AddressInfo; 7 import com.yohobuy.ufo.model.order.vo.AddressInfo;
@@ -16,6 +17,7 @@ import com.yohoufo.order.model.bo.CouponBo; @@ -16,6 +17,7 @@ import com.yohoufo.order.model.bo.CouponBo;
16 import com.yohoufo.order.model.bo.CouponBoList; 17 import com.yohoufo.order.model.bo.CouponBoList;
17 import com.yohoufo.order.model.dto.OrderBuilder; 18 import com.yohoufo.order.model.dto.OrderBuilder;
18 import com.yohoufo.order.service.impl.ShoppingServiceImpl; 19 import com.yohoufo.order.service.impl.ShoppingServiceImpl;
  20 +import org.apache.commons.lang3.StringUtils;
19 import org.apache.commons.lang3.tuple.Pair; 21 import org.apache.commons.lang3.tuple.Pair;
20 22
21 import java.math.BigDecimal; 23 import java.math.BigDecimal;
@@ -30,11 +32,18 @@ public class OrderBuilderFactory { @@ -30,11 +32,18 @@ public class OrderBuilderFactory {
30 ShoppingServiceImpl.GoodsPrepareData goodsPrepareData, 32 ShoppingServiceImpl.GoodsPrepareData goodsPrepareData,
31 Function<SkupType, Integer> deliveryWayFunc, 33 Function<SkupType, Integer> deliveryWayFunc,
32 SellerOrderGoods psog, 34 SellerOrderGoods psog,
33 - ChargeContext chargeContext) { 35 + ChargeContext chargeContext,
  36 + String businessClient) {
34 //算费结果 37 //算费结果
35 ChargeResult chargeResult = chargeContext.getChargeResult(); 38 ChargeResult chargeResult = chargeContext.getChargeResult();
36 ChargeGoods chargeGoods = chargeContext.getChargeGoods(); 39 ChargeGoods chargeGoods = chargeContext.getChargeGoods();
37 SkupType skupType = chargeGoods.getSkupType(); 40 SkupType skupType = chargeGoods.getSkupType();
  41 + Integer businessClientCode = null;
  42 + if (StringUtils.isNotBlank(businessClient)){
  43 + if(OrderConstant.BusinessClient.TAOBAO_FLEAMARKET.equalsIgnoreCase(businessClient)) {
  44 + businessClientCode = BusinessClientEnum.TAOBAO_FLEAMARKET_CLIENT.getCode();
  45 + }
  46 + }
38 47
39 return OrderBuilder.builder() 48 return OrderBuilder.builder()
40 .uid(uid) 49 .uid(uid)
@@ -60,6 +69,7 @@ public class OrderBuilderFactory { @@ -60,6 +69,7 @@ public class OrderBuilderFactory {
60 .depositFee(buildDepositFee(chargeGoods)) 69 .depositFee(buildDepositFee(chargeGoods))
61 .promotionCutAmount(chargeResult.getPromotionCutAmount()) 70 .promotionCutAmount(chargeResult.getPromotionCutAmount())
62 .useableFullPromotionList(chargeGoods.getUseableFullPromotionList()) 71 .useableFullPromotionList(chargeGoods.getUseableFullPromotionList())
  72 + .businessClient(businessClientCode)
63 .build(); 73 .build();
64 } 74 }
65 75
@@ -29,7 +29,7 @@ public class OrderBuilder { @@ -29,7 +29,7 @@ public class OrderBuilder {
29 int paymentType; 29 int paymentType;
30 int deliverWay; 30 int deliverWay;
31 String channelNo; 31 String channelNo;
32 - 32 + Integer businessClient;
33 /** 33 /**
34 * 实付金额 34 * 实付金额
35 */ 35 */
@@ -22,6 +22,7 @@ public class BuyerBidChangePriceRequest { @@ -22,6 +22,7 @@ public class BuyerBidChangePriceRequest {
22 //-------------- 非必要参数 ----------- 22 //-------------- 非必要参数 -----------
23 private String channelNo; 23 private String channelNo;
24 private String clientType; 24 private String clientType;
  25 + private String businessClient;
25 26
26 //----------------非必要参数------------- 27 //----------------非必要参数-------------
27 } 28 }
@@ -39,6 +39,7 @@ public class BuyerBidPublishRequest { @@ -39,6 +39,7 @@ public class BuyerBidPublishRequest {
39 //-------------- 非必要参数 ----------- 39 //-------------- 非必要参数 -----------
40 private String channelNo; 40 private String channelNo;
41 private String clientType; 41 private String clientType;
  42 + private String businessClient;
42 43
43 //----------------非必要参数------------- 44 //----------------非必要参数-------------
44 45
@@ -76,4 +76,8 @@ public class ShoppingRequest { @@ -76,4 +76,8 @@ public class ShoppingRequest {
76 * 促销 76 * 促销
77 */ 77 */
78 private Integer promotionId; 78 private Integer promotionId;
  79 + /**
  80 + * business_client: 'h5/xianyu',
  81 + */
  82 + private String businessClient;
79 } 83 }
@@ -117,6 +117,7 @@ public class BuyerBidPriceService { @@ -117,6 +117,7 @@ public class BuyerBidPriceService {
117 .price(context.newPrice) 117 .price(context.newPrice)
118 .skupType(context.sellerOrderGoods.getAttributes()) 118 .skupType(context.sellerOrderGoods.getAttributes())
119 .userAddressPair(context.userAddressPair) 119 .userAddressPair(context.userAddressPair)
  120 + .businessClient(request.getBusinessClient())
120 .build(); 121 .build();
121 BidPublishResult bidPublishResult = buyerBidPublishService.bidPublish(req); 122 BidPublishResult bidPublishResult = buyerBidPublishService.bidPublish(req);
122 try { 123 try {
@@ -281,7 +281,8 @@ public class BuyerBidPublishService { @@ -281,7 +281,8 @@ public class BuyerBidPublishService {
281 new ShoppingServiceImpl.GoodsPrepareData(), 281 new ShoppingServiceImpl.GoodsPrepareData(),
282 DeliveryWayUtils::findDeliveryWayCodeBySkupType, 282 DeliveryWayUtils::findDeliveryWayCodeBySkupType,
283 newSellerOrderGoods(skup, goodsInfo.getProductId(), bidPrice.getPrice()), 283 newSellerOrderGoods(skup, goodsInfo.getProductId(), bidPrice.getPrice()),
284 - chargeContext); 284 + chargeContext,
  285 + request.getBusinessClient());
285 //求购 定金 286 //求购 定金
286 BidOrderMetaBo bidOrderMetaBo = BidOrderMetaBo.builder().depositAmount(deposit.getAmount()).day(request.getDay()).build(); 287 BidOrderMetaBo bidOrderMetaBo = BidOrderMetaBo.builder().depositAmount(deposit.getAmount()).day(request.getDay()).build();
287 288
@@ -463,7 +463,8 @@ public class ShoppingServiceImpl implements IShoppingService { @@ -463,7 +463,8 @@ public class ShoppingServiceImpl implements IShoppingService {
463 userAddressPair, 463 userAddressPair,
464 goodsPrepareData, 464 goodsPrepareData,
465 DeliveryWayUtils::findDeliveryWayCodeBySkupType, 465 DeliveryWayUtils::findDeliveryWayCodeBySkupType,
466 - psog, chargeContext); 466 + psog, chargeContext,
  467 + shoppingRequest.getBusinessClient());
467 468
468 submitResult = ordeCreationService.doSubmitOrder(orderBuilder); 469 submitResult = ordeCreationService.doSubmitOrder(orderBuilder);
469 }finally { 470 }finally {