Showing
9 changed files
with
248 additions
and
56 deletions
@@ -61,6 +61,9 @@ public class BuyerOrder { | @@ -61,6 +61,9 @@ public class BuyerOrder { | ||
61 | @Getter@Setter | 61 | @Getter@Setter |
62 | private Integer activityType;//活动类型:0:普通,18:砍价 | 62 | private Integer activityType;//活动类型:0:普通,18:砍价 |
63 | 63 | ||
64 | + @Getter@Setter | ||
65 | + private Integer businessClient; | ||
66 | + | ||
64 | public Integer getOriginalStatus() { | 67 | public Integer getOriginalStatus() { |
65 | return originalStatus; | 68 | return originalStatus; |
66 | } | 69 | } |
@@ -24,11 +24,12 @@ | @@ -24,11 +24,12 @@ | ||
24 | <result column="seller_delivery_deal" jdbcType="INTEGER" property="sellerDeliveryDeal" /> | 24 | <result column="seller_delivery_deal" jdbcType="INTEGER" property="sellerDeliveryDeal" /> |
25 | <result column="seller_delivery_deal_again" jdbcType="INTEGER" property="sellerDeliveryDealAgain" /> | 25 | <result column="seller_delivery_deal_again" jdbcType="INTEGER" property="sellerDeliveryDealAgain" /> |
26 | <result column="activity_type" jdbcType="INTEGER" property="activityType" /> | 26 | <result column="activity_type" jdbcType="INTEGER" property="activityType" /> |
27 | + <result column="business_client" jdbcType="INTEGER" property="businessClient" /> | ||
27 | </resultMap> | 28 | </resultMap> |
28 | <sql id="Base_Column_List"> | 29 | <sql id="Base_Column_List"> |
29 | id, uid, order_code, seller_uid, client_type, payment, payment_type, is_cancel, amount, | 30 | id, uid, order_code, seller_uid, client_type, payment, payment_type, is_cancel, amount, |
30 | ship_fee, status, create_time, update_time, buyer_order_status, seller_order_status, channel_no, attributes,platform_delivery_status, | 31 | ship_fee, status, create_time, update_time, buyer_order_status, seller_order_status, channel_no, attributes,platform_delivery_status, |
31 | - seller_delivery_status,seller_delivery_deal,seller_delivery_deal_again,activity_type | 32 | + seller_delivery_status,seller_delivery_deal,seller_delivery_deal_again,activity_type, business_client |
32 | </sql> | 33 | </sql> |
33 | 34 | ||
34 | 35 | ||
@@ -143,7 +144,7 @@ | @@ -143,7 +144,7 @@ | ||
143 | is_cancel, amount, ship_fee, | 144 | is_cancel, amount, ship_fee, |
144 | status, create_time, update_time, | 145 | status, create_time, update_time, |
145 | buyer_order_status, seller_order_status, channel_no, attributes,platform_delivery_status, | 146 | buyer_order_status, seller_order_status, channel_no, attributes,platform_delivery_status, |
146 | - seller_delivery_status,seller_delivery_deal,seller_delivery_deal_again,activity_type) | 147 | + seller_delivery_status,seller_delivery_deal,seller_delivery_deal_again,activity_type,business_client) |
147 | values (#{uid,jdbcType=INTEGER}, #{orderCode,jdbcType=BIGINT}, #{sellerUid,jdbcType=INTEGER}, | 148 | values (#{uid,jdbcType=INTEGER}, #{orderCode,jdbcType=BIGINT}, #{sellerUid,jdbcType=INTEGER}, |
148 | #{clientType,jdbcType=INTEGER}, #{payment,jdbcType=INTEGER}, #{paymentType,jdbcType=TINYINT}, | 149 | #{clientType,jdbcType=INTEGER}, #{payment,jdbcType=INTEGER}, #{paymentType,jdbcType=TINYINT}, |
149 | #{isCancel,jdbcType=TINYINT}, #{amount,jdbcType=DECIMAL}, #{shipFee,jdbcType=DECIMAL}, | 150 | #{isCancel,jdbcType=TINYINT}, #{amount,jdbcType=DECIMAL}, #{shipFee,jdbcType=DECIMAL}, |
@@ -151,7 +152,8 @@ | @@ -151,7 +152,8 @@ | ||
151 | #{buyerOrderStatus,jdbcType=INTEGER}, #{sellerOrderStatus,jdbcType=INTEGER}, #{channelNo,jdbcType=VARCHAR}, | 152 | #{buyerOrderStatus,jdbcType=INTEGER}, #{sellerOrderStatus,jdbcType=INTEGER}, #{channelNo,jdbcType=VARCHAR}, |
152 | #{attributes,jdbcType=INTEGER},#{platformDeliveryStatus,jdbcType=INTEGER}, | 153 | #{attributes,jdbcType=INTEGER},#{platformDeliveryStatus,jdbcType=INTEGER}, |
153 | #{sellerDeliveryStatus,jdbcType=INTEGER},#{sellerDeliveryDeal,jdbcType=INTEGER}, | 154 | #{sellerDeliveryStatus,jdbcType=INTEGER},#{sellerDeliveryDeal,jdbcType=INTEGER}, |
154 | - #{sellerDeliveryDealAgain,jdbcType=INTEGER},#{activityType,jdbcType=INTEGER}) | 155 | + #{sellerDeliveryDealAgain,jdbcType=INTEGER},#{activityType,jdbcType=INTEGER}, |
156 | + #{businessClient,jdbcType=INTEGER}) | ||
155 | </insert> | 157 | </insert> |
156 | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yohoufo.dal.order.model.BuyerOrder" useGeneratedKeys="true"> | 158 | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yohoufo.dal.order.model.BuyerOrder" useGeneratedKeys="true"> |
157 | insert into buyer_order | 159 | insert into buyer_order |
@@ -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, defaultValue = "ufo")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); |
1 | +package com.yohoufo.order.model; | ||
2 | + | ||
3 | +import com.yohobuy.ufo.model.order.common.OrderAttributes; | ||
4 | +import com.yohobuy.ufo.model.order.constants.BusinessClientEnum; | ||
5 | +import com.yohobuy.ufo.model.order.constants.OrderConstant; | ||
6 | +import com.yohobuy.ufo.model.order.constants.SkupType; | ||
7 | +import com.yohobuy.ufo.model.order.vo.AddressInfo; | ||
8 | +import com.yohobuy.ufo.model.promotion.constant.CouponTypeEnum; | ||
9 | +import com.yohoufo.dal.order.model.SellerOrderGoods; | ||
10 | +import com.yohoufo.order.charge.ChargeContext; | ||
11 | +import com.yohoufo.order.charge.model.ChargeGoods; | ||
12 | +import com.yohoufo.order.charge.model.ChargeResult; | ||
13 | +import com.yohoufo.order.charge.model.SingleFeeDetail; | ||
14 | +import com.yohoufo.order.model.bo.ActivityBo; | ||
15 | +import com.yohoufo.order.model.bo.AmountDetailBo; | ||
16 | +import com.yohoufo.order.model.bo.CouponBo; | ||
17 | +import com.yohoufo.order.model.bo.CouponBoList; | ||
18 | +import com.yohoufo.order.model.dto.OrderBuilder; | ||
19 | +import com.yohoufo.order.service.impl.ShoppingServiceImpl; | ||
20 | +import org.apache.commons.lang3.StringUtils; | ||
21 | +import org.apache.commons.lang3.tuple.Pair; | ||
22 | + | ||
23 | +import java.math.BigDecimal; | ||
24 | +import java.util.Objects; | ||
25 | +import java.util.function.Function; | ||
26 | +import java.util.stream.Collectors; | ||
27 | + | ||
28 | +public class OrderBuilderFactory { | ||
29 | + | ||
30 | + public OrderBuilder create(int uid, long orderCode, String channelNo, String clientType, | ||
31 | + Pair<AddressInfo, AddressInfo> userAddressPair, | ||
32 | + ShoppingServiceImpl.GoodsPrepareData goodsPrepareData, | ||
33 | + Function<SkupType, Integer> deliveryWayFunc, | ||
34 | + SellerOrderGoods psog, | ||
35 | + ChargeContext chargeContext, | ||
36 | + String businessClient) { | ||
37 | + //算费结果 | ||
38 | + ChargeResult chargeResult = chargeContext.getChargeResult(); | ||
39 | + ChargeGoods chargeGoods = chargeContext.getChargeGoods(); | ||
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 | + } | ||
47 | + | ||
48 | + return OrderBuilder.builder() | ||
49 | + .uid(uid) | ||
50 | + .skup(psog.getId()) | ||
51 | + .depositCode(goodsPrepareData.getDepositCode()) | ||
52 | + .orderCode(orderCode) | ||
53 | + .productId(psog.getProductId()) | ||
54 | + .paymentType(OrderConstant.PAYMENT_ONLINE) | ||
55 | + .deliverWay(deliveryWayFunc.apply(skupType)) | ||
56 | + .channelNo(channelNo) | ||
57 | + .amount(BigDecimal.valueOf(chargeResult.getFinalAmount())) | ||
58 | + .shipFee(BigDecimal.valueOf(chargeResult.getFinalShippingAmount())) | ||
59 | + .couponBoList(buildOrderCouponBoList(chargeResult)) | ||
60 | + .hiddenAddressInfo(userAddressPair.getRight()) | ||
61 | + .addressInfo(userAddressPair.getLeft()) | ||
62 | + .clientType(clientType) | ||
63 | + .attributes(buildOrderAttribute(psog, chargeGoods.isDepositRequirement()).getCode()) | ||
64 | + .originalAttributes(psog.getAttributes()) | ||
65 | + .sellerOrderGoods(psog) | ||
66 | + .activityBo(buildOrderActivityBo(chargeResult)) | ||
67 | + .amountDetailBo(buildOrderAmountDetailBo(chargeResult)) | ||
68 | + .tariffFee(chargeResult.getTariffFee()) | ||
69 | + .depositFee(buildDepositFee(chargeGoods)) | ||
70 | + .promotionCutAmount(chargeResult.getPromotionCutAmount()) | ||
71 | + .useableFullPromotionList(chargeGoods.getUseableFullPromotionList()) | ||
72 | + .businessClient(businessClientCode) | ||
73 | + .build(); | ||
74 | + } | ||
75 | + | ||
76 | + /** | ||
77 | + * 获取订单attribute属性 | ||
78 | + * | ||
79 | + * @return | ||
80 | + */ | ||
81 | + protected OrderAttributes buildOrderAttribute(SellerOrderGoods skup, boolean isDepositRequirement) { | ||
82 | + if (isDepositRequirement) { | ||
83 | + return OrderAttributes.DEPOSITE; | ||
84 | + } | ||
85 | + OrderAttributes orderAttributes = OrderAttributes.getOrderAttributes(skup.getAttributes()); | ||
86 | + return orderAttributes; | ||
87 | + } | ||
88 | + | ||
89 | + /** | ||
90 | + * 活动优惠 | ||
91 | + * | ||
92 | + * @param chargeResult | ||
93 | + * @return | ||
94 | + */ | ||
95 | + protected ActivityBo buildOrderActivityBo(ChargeResult chargeResult) { | ||
96 | + return ActivityBo.builder().activityType(chargeResult.getActivityCutResult().getActivityType()) | ||
97 | + .userActivityId(chargeResult.getActivityCutResult().getUserActivityId()) | ||
98 | + //以计算结果为准 | ||
99 | + .activityCutAmount(BigDecimal.valueOf(chargeResult.getActivityCutResult().getActivityCutAmount())) | ||
100 | + .build(); | ||
101 | + } | ||
102 | + | ||
103 | + /** | ||
104 | + * 优惠券支付结果 | ||
105 | + * | ||
106 | + * @param chargeResult | ||
107 | + * @return | ||
108 | + */ | ||
109 | + protected CouponBoList buildOrderCouponBoList(ChargeResult chargeResult) { | ||
110 | + return CouponBoList.builder().couponBos(chargeResult.getCouponPayResultList().getCouponPayResults().stream() | ||
111 | + .map(couponPayResult -> CouponBo.builder() | ||
112 | + .couponCode(couponPayResult.getCouponCode()) | ||
113 | + .couponType(couponPayResult.getCouponType()) | ||
114 | + .couponAmount(BigDecimal.valueOf(couponPayResult.getCouponAmount())) | ||
115 | + .build() | ||
116 | + ) | ||
117 | + .collect(Collectors.toList()) | ||
118 | + ).build(); | ||
119 | + } | ||
120 | + | ||
121 | + /** | ||
122 | + * 订单金额明细 | ||
123 | + * @param chargeResult | ||
124 | + * @return | ||
125 | + */ | ||
126 | + protected AmountDetailBo buildOrderAmountDetailBo(ChargeResult chargeResult) { | ||
127 | + //订单金额明细 | ||
128 | + final AmountDetailBo amountDetailBo = new AmountDetailBo(); | ||
129 | + //商品金额 | ||
130 | + amountDetailBo.setGoodsAmount(chargeResult.getGoodsAmount()); | ||
131 | + //运费原价 | ||
132 | + amountDetailBo.setShippingAmount(chargeResult.getShippingAmount()); | ||
133 | + //活动金额 | ||
134 | + amountDetailBo.setActivityCutAmount(chargeResult.getActivityCutResult().getActivityCutAmount()); | ||
135 | + | ||
136 | + //税费 | ||
137 | + SingleFeeDetail tariffFee; | ||
138 | + if (Objects.nonNull(tariffFee = chargeResult.getTariffFee())) { | ||
139 | + amountDetailBo.setTariffRate(tariffFee.getRate()); | ||
140 | + amountDetailBo.setTariffAmount(tariffFee.getAmount()); | ||
141 | + amountDetailBo.setTariffCutAmount(tariffFee.getCutAmount()); | ||
142 | + } | ||
143 | + SingleFeeDetail shipFeeDetail; | ||
144 | + if (Objects.nonNull(shipFeeDetail = chargeResult.getShipFeeDetail())){ | ||
145 | + amountDetailBo.setShippingActivityCutAmount(shipFeeDetail.getCutAmount()); | ||
146 | + } | ||
147 | + | ||
148 | + SingleFeeDetail depositFee; | ||
149 | + if (Objects.nonNull(depositFee=chargeResult.getDepositFee())){ | ||
150 | + amountDetailBo.setDepositAmount(depositFee.getAmount()); | ||
151 | + } | ||
152 | + | ||
153 | + SingleFeeDetail quickDeliveFee = chargeResult.getQuickDeliverServiceFee(); | ||
154 | + if (Objects.nonNull(quickDeliveFee)){ | ||
155 | + amountDetailBo.setQuickDeliveServiceAmount(quickDeliveFee.getAmount()); | ||
156 | + } | ||
157 | + //活动券减免金额 | ||
158 | + chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.ACTIVITY_COUPON.getCode()). | ||
159 | + ifPresent(tempPayResult -> amountDetailBo.setCouponCutAmount(tempPayResult.getCouponAmount())); | ||
160 | + | ||
161 | + //运费券减免金额 | ||
162 | + chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.SHIPPING_COUPON.getCode()). | ||
163 | + ifPresent(tempPayResult -> amountDetailBo.setShippingCouponCutAmount(tempPayResult.getCouponAmount())); | ||
164 | + | ||
165 | + amountDetailBo.setPromotionCutAmount(chargeResult.getPromotionCutAmount()); | ||
166 | + return amountDetailBo; | ||
167 | + } | ||
168 | + | ||
169 | + private SingleFeeDetail buildDepositFee(ChargeGoods chargeGoods){ | ||
170 | + BigDecimal qdsf = chargeGoods.getQuickDeliverServiceFee(); | ||
171 | + BigDecimal smf = chargeGoods.getStorageManagementFee(); | ||
172 | + double amount = 0D; | ||
173 | + if (Objects.nonNull(qdsf)){ | ||
174 | + amount = qdsf.doubleValue(); | ||
175 | + } | ||
176 | + if (Objects.nonNull(smf)){ | ||
177 | + amount = smf.doubleValue(); | ||
178 | + } | ||
179 | + SingleFeeDetail sfd = SingleFeeDetail.builder().amount(amount).build(); | ||
180 | + return sfd; | ||
181 | + } | ||
182 | + | ||
183 | +} |
@@ -31,6 +31,7 @@ import com.yohoufo.order.constants.CouponConstants; | @@ -31,6 +31,7 @@ import com.yohoufo.order.constants.CouponConstants; | ||
31 | import com.yohoufo.order.event.BuyerCancelEvent; | 31 | import com.yohoufo.order.event.BuyerCancelEvent; |
32 | import com.yohoufo.order.event.ErpBuyerOrderEvent; | 32 | import com.yohoufo.order.event.ErpBuyerOrderEvent; |
33 | import com.yohoufo.order.event.NotPaidNoticeEvent; | 33 | import com.yohoufo.order.event.NotPaidNoticeEvent; |
34 | +import com.yohoufo.order.model.OrderBuilderFactory; | ||
34 | import com.yohoufo.order.model.bo.ActivityBo; | 35 | import com.yohoufo.order.model.bo.ActivityBo; |
35 | import com.yohoufo.order.model.bo.AmountDetailBo; | 36 | import com.yohoufo.order.model.bo.AmountDetailBo; |
36 | import com.yohoufo.order.model.bo.CouponBo; | 37 | import com.yohoufo.order.model.bo.CouponBo; |
@@ -620,31 +621,14 @@ public class ShoppingServiceImpl implements IShoppingService { | @@ -620,31 +621,14 @@ public class ShoppingServiceImpl implements IShoppingService { | ||
620 | 621 | ||
621 | // 减库存,skup更新成不可售,入库 | 622 | // 减库存,skup更新成不可售,入库 |
622 | //BigDecimal shipFee = new BigDecimal(delivery_way_sf_cost); | 623 | //BigDecimal shipFee = new BigDecimal(delivery_way_sf_cost); |
623 | - orderBuilder = OrderBuilder.builder() | ||
624 | - .uid(uid) | ||
625 | - .skup(shoppingRequest.getSkup()) | ||
626 | - .depositCode(goodsPrepareData.getDepositCode()) | ||
627 | - .orderCode(orderCode) | ||
628 | - .productId(psog.getProductId()) | ||
629 | - .paymentType(OrderConstant.PAYMENT_ONLINE) | ||
630 | - .deliverWay(buildDeliveryWay(skupType)) | ||
631 | - .channelNo(shoppingRequest.getChannelNo()) | ||
632 | - .amount(BigDecimal.valueOf(chargeResult.getFinalAmount())) | ||
633 | - .shipFee(BigDecimal.valueOf(chargeResult.getFinalShippingAmount())) | ||
634 | - .couponBoList(buildOrderCouponBoList(chargeResult)) | ||
635 | - .hiddenAddressInfo(userAddressPair.getRight()) | ||
636 | - .addressInfo(userAddressPair.getLeft()) | ||
637 | - .clientType(shoppingRequest.getClientType()) | ||
638 | - .attributes(buildOrderAttribute(psog, chargeGoods.isDepositRequirement()).getCode()) | ||
639 | - .originalAttributes(psog.getAttributes()) | ||
640 | - .sellerOrderGoods(psog) | ||
641 | - .activityBo(buildOrderActivityBo(chargeResult)) | ||
642 | - .amountDetailBo(buildOrderAmountDetailBo(chargeResult)) | ||
643 | - .tariffFee(chargeResult.getTariffFee()) | ||
644 | - .depositFee(buildDepositFee(chargeGoods)) | ||
645 | - .promotionCutAmount(chargeResult.getPromotionCutAmount()) | ||
646 | - .useableFullPromotionList(chargeGoods.getUseableFullPromotionList()) | ||
647 | - .build(); | 624 | + orderBuilder = getOrderBuilderFactory().create(uid, orderCode, shoppingRequest.getChannelNo(), |
625 | + shoppingRequest.getClientType(), | ||
626 | + userAddressPair, | ||
627 | + goodsPrepareData, | ||
628 | + DeliveryWayUtils::findDeliveryWayCodeBySkupType, | ||
629 | + psog, chargeContext, | ||
630 | + shoppingRequest.getBusinessClient()); | ||
631 | + | ||
648 | 632 | ||
649 | submitResult = ordeCreationService.doSubmitOrder(orderBuilder); | 633 | submitResult = ordeCreationService.doSubmitOrder(orderBuilder); |
650 | }finally { | 634 | }finally { |
@@ -901,32 +885,10 @@ public class ShoppingServiceImpl implements IShoppingService { | @@ -901,32 +885,10 @@ public class ShoppingServiceImpl implements IShoppingService { | ||
901 | } | 885 | } |
902 | 886 | ||
903 | protected int buildDeliveryWay(SkupType skupType) { | 887 | protected int buildDeliveryWay(SkupType skupType) { |
904 | - DeliveryWayEnum deliveryWay ; | ||
905 | - if (skupType==null){ | ||
906 | - deliveryWay = DeliveryWayEnum.SF; | ||
907 | - }else{ | ||
908 | - SkupTypeCodeSupport.CodeNode codeNode = SkupTypeCodeSupport.explain(skupType.getCode()); | ||
909 | - | ||
910 | - RegionEnum regionEnum = RegionEnum.getByCode(codeNode.getRegion()); | ||
911 | - if (regionEnum == null){ | ||
912 | - deliveryWay = DeliveryWayEnum.SF; | ||
913 | - }else{ | ||
914 | - switch (regionEnum){ | ||
915 | - case HONGKONG: | ||
916 | - deliveryWay = DeliveryWayEnum.OVERSEAS_HONGHONG; | ||
917 | - break; | ||
918 | - case MAINLAND: | ||
919 | - default: | ||
920 | - deliveryWay = DeliveryWayEnum.SF; | ||
921 | - break; | ||
922 | - | ||
923 | - } | ||
924 | - } | ||
925 | - | ||
926 | - | ||
927 | - } | ||
928 | - | ||
929 | - return deliveryWay.getCode(); | 888 | + return DeliveryWayUtils.findDeliveryWayCodeBySkupType(skupType); |
930 | } | 889 | } |
931 | 890 | ||
891 | + protected OrderBuilderFactory getOrderBuilderFactory() { | ||
892 | + return new OrderBuilderFactory(); | ||
893 | + } | ||
932 | } | 894 | } |
@@ -313,6 +313,7 @@ public class SubmitOrderServiceImpl implements ISubmitOrderService { | @@ -313,6 +313,7 @@ public class SubmitOrderServiceImpl implements ISubmitOrderService { | ||
313 | buyerOrder.setSellerDeliveryDealAgain(0); | 313 | buyerOrder.setSellerDeliveryDealAgain(0); |
314 | //活动类型 | 314 | //活动类型 |
315 | buyerOrder.setActivityType(orderBuilder.getActivityBo().getActivityType()); | 315 | buyerOrder.setActivityType(orderBuilder.getActivityBo().getActivityType()); |
316 | + buyerOrder.setBusinessClient(orderBuilder.getBusinessClient()); | ||
316 | buyerOrderMapper.insert(buyerOrder); | 317 | buyerOrderMapper.insert(buyerOrder); |
317 | return buyerOrder; | 318 | return buyerOrder; |
318 | } | 319 | } |
1 | +package com.yohoufo.order.utils; | ||
2 | + | ||
3 | +import com.yohobuy.ufo.model.order.constants.DeliveryWayEnum; | ||
4 | +import com.yohobuy.ufo.model.order.constants.RegionEnum; | ||
5 | +import com.yohobuy.ufo.model.order.constants.SkupType; | ||
6 | +import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport; | ||
7 | + | ||
8 | +public class DeliveryWayUtils { | ||
9 | + | ||
10 | + public static int findDeliveryWayCodeBySkupType(SkupType skupType) { | ||
11 | + DeliveryWayEnum deliveryWay; | ||
12 | + if (skupType == null) { | ||
13 | + deliveryWay = DeliveryWayEnum.SF; | ||
14 | + } else { | ||
15 | + SkupTypeCodeSupport.CodeNode codeNode = SkupTypeCodeSupport.explain(skupType.getCode()); | ||
16 | + | ||
17 | + RegionEnum regionEnum = RegionEnum.getByCode(codeNode.getRegion()); | ||
18 | + if (regionEnum == null) { | ||
19 | + deliveryWay = DeliveryWayEnum.SF; | ||
20 | + } else { | ||
21 | + switch (regionEnum) { | ||
22 | + case HONGKONG: | ||
23 | + deliveryWay = DeliveryWayEnum.OVERSEAS_HONGHONG; | ||
24 | + break; | ||
25 | + case MAINLAND: | ||
26 | + default: | ||
27 | + deliveryWay = DeliveryWayEnum.SF; | ||
28 | + break; | ||
29 | + } | ||
30 | + } | ||
31 | + } | ||
32 | + return deliveryWay.getCode(); | ||
33 | + } | ||
34 | +} |
-
Please register or login to post a comment