change tips of compute
Showing
8 changed files
with
141 additions
and
20 deletions
@@ -7,23 +7,75 @@ import com.yohoufo.common.utils.PriceFormater; | @@ -7,23 +7,75 @@ import com.yohoufo.common.utils.PriceFormater; | ||
7 | import com.yohoufo.order.model.dto.EarnestMoney; | 7 | import com.yohoufo.order.model.dto.EarnestMoney; |
8 | import com.yohoufo.order.model.dto.PlatformFeeDto; | 8 | import com.yohoufo.order.model.dto.PlatformFeeDto; |
9 | import com.yohoufo.order.model.dto.SellerOrderComputeResult; | 9 | import com.yohoufo.order.model.dto.SellerOrderComputeResult; |
10 | +import com.yohoufo.order.service.proxy.ResourcesProxyService; | ||
11 | +import org.apache.commons.lang3.StringUtils; | ||
10 | 12 | ||
11 | import java.math.BigDecimal; | 13 | import java.math.BigDecimal; |
14 | +import java.util.Map; | ||
12 | 15 | ||
13 | /** | 16 | /** |
14 | * Created by chenchao on 2018/9/20. | 17 | * Created by chenchao on 2018/9/20. |
15 | */ | 18 | */ |
16 | public final class SellerOrderConvertor { | 19 | public final class SellerOrderConvertor { |
17 | 20 | ||
18 | - public static SoldPrdComputeBo computeResult2SoldPrdComputeBo(SellerOrderComputeResult computeResult){ | 21 | + public static SoldPrdComputeBo pureComputeResult2SoldPrdComputeBo(SellerOrderComputeResult computeResult){ |
19 | //保证金(28-200(按照卖家发布商品的货款金额5%计算,最低28,封顶200)) | 22 | //保证金(28-200(按照卖家发布商品的货款金额5%计算,最低28,封顶200)) |
20 | EarnestMoney earnestMoneyDTO = computeResult.getEarnestMoney(); | 23 | EarnestMoney earnestMoneyDTO = computeResult.getEarnestMoney(); |
21 | BigDecimal earnestMoney = earnestMoneyDTO.getEarnestMoney(); | 24 | BigDecimal earnestMoney = earnestMoneyDTO.getEarnestMoney(); |
22 | PlatformFeeDto platformFeeDto = computeResult.getPlatformFee(); | 25 | PlatformFeeDto platformFeeDto = computeResult.getPlatformFee(); |
23 | BigDecimal income = computeResult.getIncome(); | 26 | BigDecimal income = computeResult.getIncome(); |
27 | + //service tips | ||
28 | + String serviceTipsDesc = null; | ||
29 | + String serviceTipsSummary = null; | ||
30 | + // | ||
31 | + String payPersent = computeResult.getServiceFeeRate() != null ? computeResult.getServiceFeeRate().getPayChannelPercent() : ""; | ||
32 | + PlatformFee platformFeeWrapper = PlatformFee.builder() | ||
33 | + .amount(buildSubtractFee(formatFee(platformFeeDto.getTotal()))) | ||
34 | + .appraiseFee(formatFee(platformFeeDto.getAppraiseFee())) | ||
35 | + .packageFee(formatFee(platformFeeDto.getPackageFee())) | ||
36 | + .serviceFee(formatFee(platformFeeDto.getServiceFee())) | ||
37 | + .payChannelPercentage(payPersent) | ||
38 | + .build(); | ||
39 | + // | ||
40 | + String incomeStr = formatFee(income); | ||
41 | + String earnestMoneyStr = formatFee(earnestMoney); | ||
42 | + String bankTransferFeeStr = formatFee(computeResult.getBankTransferfee()); | ||
43 | + // | ||
44 | + SoldPrdComputeBo computeBo = SoldPrdComputeBo.builder() | ||
45 | + .earnestMoney(earnestMoney.doubleValue()) | ||
46 | + .earnestMoneyStr(earnestMoneyStr) | ||
47 | + .platformFee(platformFeeWrapper) | ||
48 | + .bankTransferFee(buildSubtractFee(bankTransferFeeStr)) | ||
49 | + .income(incomeStr) | ||
50 | + .serviceTipsDesc(serviceTipsDesc) | ||
51 | + .serviceTipsSummary(serviceTipsSummary) | ||
52 | + .build(); | ||
53 | + return computeBo; | ||
54 | + | ||
55 | + } | ||
56 | + | ||
24 | 57 | ||
58 | + public static SoldPrdComputeBo computeResult2SoldPrdComputeBo(SellerOrderComputeResult computeResult, | ||
59 | + Map<String,String> tipsConfig){ | ||
60 | + //保证金(28-200(按照卖家发布商品的货款金额5%计算,最低28,封顶200)) | ||
61 | + EarnestMoney earnestMoneyDTO = computeResult.getEarnestMoney(); | ||
62 | + BigDecimal earnestMoney = earnestMoneyDTO.getEarnestMoney(); | ||
63 | + PlatformFeeDto platformFeeDto = computeResult.getPlatformFee(); | ||
64 | + BigDecimal income = computeResult.getIncome(); | ||
65 | + //service tips | ||
66 | + String serviceTipsDesc = null; | ||
67 | + String serviceTipsSummary = null; | ||
25 | // | 68 | // |
26 | String payPersent = computeResult.getServiceFeeRate() != null ? computeResult.getServiceFeeRate().getPayChannelPercent() : ""; | 69 | String payPersent = computeResult.getServiceFeeRate() != null ? computeResult.getServiceFeeRate().getPayChannelPercent() : ""; |
70 | + if (StringUtils.isNotBlank(payPersent)){ | ||
71 | + serviceTipsSummary = String.format("(%s)", payPersent); | ||
72 | + }else{ | ||
73 | + if(tipsConfig!=null){ | ||
74 | + serviceTipsDesc = tipsConfig.get(ResourcesProxyService.KEY_SERVICETIPSDESC); | ||
75 | + serviceTipsSummary = tipsConfig.get(ResourcesProxyService.KEY_SERVICETIPSSUMARY); | ||
76 | + } | ||
77 | + } | ||
78 | + | ||
27 | PlatformFee platformFeeWrapper = PlatformFee.builder() | 79 | PlatformFee platformFeeWrapper = PlatformFee.builder() |
28 | .amount(buildSubtractFee(formatFee(platformFeeDto.getTotal()))) | 80 | .amount(buildSubtractFee(formatFee(platformFeeDto.getTotal()))) |
29 | .appraiseFee(formatFee(platformFeeDto.getAppraiseFee())) | 81 | .appraiseFee(formatFee(platformFeeDto.getAppraiseFee())) |
@@ -35,12 +87,15 @@ public final class SellerOrderConvertor { | @@ -35,12 +87,15 @@ public final class SellerOrderConvertor { | ||
35 | String incomeStr = formatFee(income); | 87 | String incomeStr = formatFee(income); |
36 | String earnestMoneyStr = formatFee(earnestMoney); | 88 | String earnestMoneyStr = formatFee(earnestMoney); |
37 | String bankTransferFeeStr = formatFee(computeResult.getBankTransferfee()); | 89 | String bankTransferFeeStr = formatFee(computeResult.getBankTransferfee()); |
90 | + // | ||
38 | SoldPrdComputeBo computeBo = SoldPrdComputeBo.builder() | 91 | SoldPrdComputeBo computeBo = SoldPrdComputeBo.builder() |
39 | .earnestMoney(earnestMoney.doubleValue()) | 92 | .earnestMoney(earnestMoney.doubleValue()) |
40 | .earnestMoneyStr(earnestMoneyStr) | 93 | .earnestMoneyStr(earnestMoneyStr) |
41 | .platformFee(platformFeeWrapper) | 94 | .platformFee(platformFeeWrapper) |
42 | .bankTransferFee(buildSubtractFee(bankTransferFeeStr)) | 95 | .bankTransferFee(buildSubtractFee(bankTransferFeeStr)) |
43 | .income(incomeStr) | 96 | .income(incomeStr) |
97 | + .serviceTipsDesc(serviceTipsDesc) | ||
98 | + .serviceTipsSummary(serviceTipsSummary) | ||
44 | .build(); | 99 | .build(); |
45 | return computeBo; | 100 | return computeBo; |
46 | 101 |
@@ -218,7 +218,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | @@ -218,7 +218,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | ||
218 | SoldPrdComputeBo computeBo = null; | 218 | SoldPrdComputeBo computeBo = null; |
219 | if(metaIsPresent){ | 219 | if(metaIsPresent){ |
220 | SellerOrderComputeResult computeResult = JSONObject.parseObject(feeMeta.getMetaValue(), SellerOrderComputeResult.class); | 220 | SellerOrderComputeResult computeResult = JSONObject.parseObject(feeMeta.getMetaValue(), SellerOrderComputeResult.class); |
221 | - computeBo = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult); | 221 | + computeBo = SellerOrderConvertor.pureComputeResult2SoldPrdComputeBo(computeResult); |
222 | } | 222 | } |
223 | if(Objects.nonNull(computeBo)){ | 223 | if(Objects.nonNull(computeBo)){ |
224 | orderDetailInfo.setEarnestMoneyStr(computeBo.getEarnestMoneyStr()); | 224 | orderDetailInfo.setEarnestMoneyStr(computeBo.getEarnestMoneyStr()); |
@@ -41,6 +41,7 @@ import com.yohoufo.order.service.cache.CacheKeyBuilder; | @@ -41,6 +41,7 @@ import com.yohoufo.order.service.cache.CacheKeyBuilder; | ||
41 | import com.yohoufo.order.service.cache.OrderCacheService; | 41 | import com.yohoufo.order.service.cache.OrderCacheService; |
42 | import com.yohoufo.order.service.concurrent.ThreadPoolFactory; | 42 | import com.yohoufo.order.service.concurrent.ThreadPoolFactory; |
43 | import com.yohoufo.order.service.handler.*; | 43 | import com.yohoufo.order.service.handler.*; |
44 | +import com.yohoufo.order.service.proxy.ResourcesProxyService; | ||
44 | import com.yohoufo.order.service.seller.processor.*; | 45 | import com.yohoufo.order.service.seller.processor.*; |
45 | import com.yohoufo.order.service.impl.visitor.OffShelveCancelCase; | 46 | import com.yohoufo.order.service.impl.visitor.OffShelveCancelCase; |
46 | import com.yohoufo.order.service.impl.visitor.UserCancelCase; | 47 | import com.yohoufo.order.service.impl.visitor.UserCancelCase; |
@@ -164,6 +165,8 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic | @@ -164,6 +165,8 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic | ||
164 | @Autowired | 165 | @Autowired |
165 | private SellerBatchCancelPrepareProcessor sellerBatchCancelPrepareProcessor; | 166 | private SellerBatchCancelPrepareProcessor sellerBatchCancelPrepareProcessor; |
166 | 167 | ||
168 | + @Autowired | ||
169 | + private ResourcesProxyService resourcesProxyService; | ||
167 | 170 | ||
168 | 171 | ||
169 | private static final int MAX_DEAL = 10; | 172 | private static final int MAX_DEAL = 10; |
@@ -196,7 +199,8 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic | @@ -196,7 +199,8 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic | ||
196 | log.info("in computeChangePrice, req {}", req); | 199 | log.info("in computeChangePrice, req {}", req); |
197 | ChangePricePrepareDTO pcn = changePricePrepareProcessor.checkAndAcquire(req); | 200 | ChangePricePrepareDTO pcn = changePricePrepareProcessor.checkAndAcquire(req); |
198 | SellerOrderComputeResult computeResult = pcn.getComputeResult(); | 201 | SellerOrderComputeResult computeResult = pcn.getComputeResult(); |
199 | - SoldPrdComputeBo spc = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult); | 202 | + Map<String,String> tipsConfig = resourcesProxyService.getServiceTipsConfig(); |
203 | + SoldPrdComputeBo spc = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult, tipsConfig); | ||
200 | spc.setTips(pcn.getTips()); | 204 | spc.setTips(pcn.getTips()); |
201 | return spc; | 205 | return spc; |
202 | } | 206 | } |
@@ -205,7 +209,8 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic | @@ -205,7 +209,8 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic | ||
205 | log.info("in computeAdjustPrice, req {}", req); | 209 | log.info("in computeAdjustPrice, req {}", req); |
206 | ChangePricePrepareDTO pcn = adjustPricePrepareProcessor.checkAndAcquire(req); | 210 | ChangePricePrepareDTO pcn = adjustPricePrepareProcessor.checkAndAcquire(req); |
207 | SellerOrderComputeResult computeResult = pcn.getComputeResult(); | 211 | SellerOrderComputeResult computeResult = pcn.getComputeResult(); |
208 | - SoldPrdComputeBo spc = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult); | 212 | + Map<String,String> tipsConfig = resourcesProxyService.getServiceTipsConfig(); |
213 | + SoldPrdComputeBo spc = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult, tipsConfig); | ||
209 | spc.setTips(pcn.getTips()); | 214 | spc.setTips(pcn.getTips()); |
210 | return spc; | 215 | return spc; |
211 | } | 216 | } |
@@ -531,8 +536,8 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic | @@ -531,8 +536,8 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic | ||
531 | priceComputePrepareProcessor.checkNGetMergeEarnestMoney(uid, | 536 | priceComputePrepareProcessor.checkNGetMergeEarnestMoney(uid, |
532 | computeResult.getEarnestMoney().getEarnestMoney(), num, salePrice, isSuper); | 537 | computeResult.getEarnestMoney().getEarnestMoney(), num, salePrice, isSuper); |
533 | } | 538 | } |
534 | - | ||
535 | - SoldPrdComputeBo computeBo = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult); | 539 | + Map<String,String> tipsConfig = resourcesProxyService.getServiceTipsConfig(); |
540 | + SoldPrdComputeBo computeBo = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult, tipsConfig); | ||
536 | return computeBo; | 541 | return computeBo; |
537 | } | 542 | } |
538 | 543 |
1 | +package com.yohoufo.order.service.proxy; | ||
2 | + | ||
3 | +import com.yohoufo.common.caller.UfoServiceCaller; | ||
4 | +import org.springframework.beans.factory.annotation.Autowired; | ||
5 | + | ||
6 | +/** | ||
7 | + * Created by chao.chen on 2019/3/26. | ||
8 | + */ | ||
9 | +public class AbsProxyService { | ||
10 | + @Autowired | ||
11 | + UfoServiceCaller ufoServiceCaller; | ||
12 | +} |
@@ -27,13 +27,10 @@ import java.util.stream.Collectors; | @@ -27,13 +27,10 @@ import java.util.stream.Collectors; | ||
27 | * Created by jiexiang.wu on 2018/11/19. | 27 | * Created by jiexiang.wu on 2018/11/19. |
28 | */ | 28 | */ |
29 | @Service | 29 | @Service |
30 | -public class CouponProxyService implements Compensator { | 30 | +public class CouponProxyService extends AbsProxyService implements Compensator { |
31 | 31 | ||
32 | private final static Logger logger = LoggerUtils.getBuyerOrderLogger(); | 32 | private final static Logger logger = LoggerUtils.getBuyerOrderLogger(); |
33 | 33 | ||
34 | - @Autowired | ||
35 | - private UfoServiceCaller serviceCaller; | ||
36 | - | ||
37 | /** | 34 | /** |
38 | * 查询用户可以使用的券 | 35 | * 查询用户可以使用的券 |
39 | * | 36 | * |
@@ -43,7 +40,7 @@ public class CouponProxyService implements Compensator { | @@ -43,7 +40,7 @@ public class CouponProxyService implements Compensator { | ||
43 | public List<UserCouponsBo> getUserAvailableCoupons(int uid) { | 40 | public List<UserCouponsBo> getUserAvailableCoupons(int uid) { |
44 | logger.info("[{}] getUserAvailableCoupons", uid); | 41 | logger.info("[{}] getUserAvailableCoupons", uid); |
45 | //未使用的优惠券,包括还未生效的券 | 42 | //未使用的优惠券,包括还未生效的券 |
46 | - ApiResponse resp = serviceCaller.call("ufo.coupons.listNoUsed", uid); | 43 | + ApiResponse resp = ufoServiceCaller.call("ufo.coupons.listNoUsed", uid); |
47 | UserCouponsListBo result = getResultFromApiResponse(resp); | 44 | UserCouponsListBo result = getResultFromApiResponse(resp); |
48 | if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) { | 45 | if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) { |
49 | return Lists.newArrayList(); | 46 | return Lists.newArrayList(); |
@@ -56,7 +53,7 @@ public class CouponProxyService implements Compensator { | @@ -56,7 +53,7 @@ public class CouponProxyService implements Compensator { | ||
56 | public List<UserCouponsBo> checkAndGetCoupons(int uid, List<String> couponCodes) { | 53 | public List<UserCouponsBo> checkAndGetCoupons(int uid, List<String> couponCodes) { |
57 | logger.info("[{}] checkAndGetCoupons:{}", uid, couponCodes); | 54 | logger.info("[{}] checkAndGetCoupons:{}", uid, couponCodes); |
58 | //未使用的优惠券,包括还未生效的券 | 55 | //未使用的优惠券,包括还未生效的券 |
59 | - ApiResponse resp = serviceCaller.call("ufo.coupons.checkAndGet", uid, couponCodes); | 56 | + ApiResponse resp = ufoServiceCaller.call("ufo.coupons.checkAndGet", uid, couponCodes); |
60 | UserCouponsListBo result = getResultFromApiResponse(resp); | 57 | UserCouponsListBo result = getResultFromApiResponse(resp); |
61 | if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) { | 58 | if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) { |
62 | return Lists.newArrayList(); | 59 | return Lists.newArrayList(); |
@@ -76,7 +73,7 @@ public class CouponProxyService implements Compensator { | @@ -76,7 +73,7 @@ public class CouponProxyService implements Compensator { | ||
76 | public void orderUseCoupon(@TxCompensateArgs("uid") int uid, @TxCompensateArgs("orderCode") long orderCode, | 73 | public void orderUseCoupon(@TxCompensateArgs("uid") int uid, @TxCompensateArgs("orderCode") long orderCode, |
77 | @TxCompensateArgs("couponBo") CouponBo coupon) { | 74 | @TxCompensateArgs("couponBo") CouponBo coupon) { |
78 | logger.info("[{}] request to use coupon,couponBo is {}", orderCode, coupon); | 75 | logger.info("[{}] request to use coupon,couponBo is {}", orderCode, coupon); |
79 | - ApiResponse resp = serviceCaller.call("ufo.coupons.use", uid, orderCode, Lists.newArrayList(coupon.getCouponCode())); | 76 | + ApiResponse resp = ufoServiceCaller.call("ufo.coupons.use", uid, orderCode, Lists.newArrayList(coupon.getCouponCode())); |
80 | Boolean result = getResultFromApiResponse(resp); | 77 | Boolean result = getResultFromApiResponse(resp); |
81 | if (result == null || result.booleanValue() == false) { | 78 | if (result == null || result.booleanValue() == false) { |
82 | logger.warn("[{}] use couponBo fail,coupons is {}", orderCode, coupon); | 79 | logger.warn("[{}] use couponBo fail,coupons is {}", orderCode, coupon); |
@@ -95,7 +92,7 @@ public class CouponProxyService implements Compensator { | @@ -95,7 +92,7 @@ public class CouponProxyService implements Compensator { | ||
95 | */ | 92 | */ |
96 | public void orderCancelCoupon(int uid, long orderCode, CouponBo coupon) { | 93 | public void orderCancelCoupon(int uid, long orderCode, CouponBo coupon) { |
97 | logger.info("[{}] request to cancel coupon,couponBo is {}", orderCode, coupon); | 94 | logger.info("[{}] request to cancel coupon,couponBo is {}", orderCode, coupon); |
98 | - ApiResponse resp = serviceCaller.call("ufo.coupons.cancel", uid, orderCode, Lists.newArrayList(coupon.getCouponCode())); | 95 | + ApiResponse resp = ufoServiceCaller.call("ufo.coupons.cancel", uid, orderCode, Lists.newArrayList(coupon.getCouponCode())); |
99 | Boolean result = getResultFromApiResponse(resp); | 96 | Boolean result = getResultFromApiResponse(resp); |
100 | if (result == null || result.booleanValue() == false) { | 97 | if (result == null || result.booleanValue() == false) { |
101 | logger.warn("[{}] cancel coupon fail,couponBo is {}", orderCode, coupon); | 98 | logger.warn("[{}] cancel coupon fail,couponBo is {}", orderCode, coupon); |
@@ -29,17 +29,13 @@ import java.util.*; | @@ -29,17 +29,13 @@ import java.util.*; | ||
29 | * Created by chenchao on 2018/9/21. | 29 | * Created by chenchao on 2018/9/21. |
30 | */ | 30 | */ |
31 | @Service | 31 | @Service |
32 | -public class ProductProxyService { | 32 | +public class ProductProxyService extends AbsProxyService{ |
33 | 33 | ||
34 | final Logger logger = LoggerFactory.getLogger(getClass()); | 34 | final Logger logger = LoggerFactory.getLogger(getClass()); |
35 | 35 | ||
36 | private static final int isAdvace = 1; | 36 | private static final int isAdvace = 1; |
37 | 37 | ||
38 | 38 | ||
39 | - | ||
40 | - @Autowired | ||
41 | - private UfoServiceCaller ufoServiceCaller; | ||
42 | - | ||
43 | public final static String syncSkup = "ufo.product.createSkup"; | 39 | public final static String syncSkup = "ufo.product.createSkup"; |
44 | 40 | ||
45 | public final static String SYNC_SKUP_STATUS = "ufo.product.sellerUpdateStatus"; | 41 | public final static String SYNC_SKUP_STATUS = "ufo.product.sellerUpdateStatus"; |
1 | +package com.yohoufo.order.service.proxy; | ||
2 | + | ||
3 | +import com.yohoufo.common.ApiResponse; | ||
4 | +import org.slf4j.Logger; | ||
5 | +import org.slf4j.LoggerFactory; | ||
6 | +import org.springframework.stereotype.Service; | ||
7 | + | ||
8 | +import java.util.HashMap; | ||
9 | +import java.util.Map; | ||
10 | + | ||
11 | +/** | ||
12 | + * Created by chao.chen on 2019/3/26. | ||
13 | + */ | ||
14 | +@Service | ||
15 | +public class ResourcesProxyService extends AbsProxyService{ | ||
16 | + | ||
17 | + private final Logger logger = LoggerFactory.getLogger(getClass()); | ||
18 | + | ||
19 | + final static String configTypeList= "ufo.resource.configTypeList"; | ||
20 | + | ||
21 | + public static final String KEY_SERVICETIPSDESC = "serviceTipsDesc", | ||
22 | + KEY_SERVICETIPSSUMARY = "serviceTipsSumary"; | ||
23 | + | ||
24 | + static final String[] cloneKeys = new String[]{KEY_SERVICETIPSDESC, KEY_SERVICETIPSSUMARY}; | ||
25 | + | ||
26 | + | ||
27 | + public Map<String,String> getServiceTipsConfig(){ | ||
28 | + final String method = configTypeList; | ||
29 | + Map<String,String> data = new HashMap<>(); | ||
30 | + try { | ||
31 | + logger.info("in ResourcesProxyService getServiceTipsConfig call {}", method); | ||
32 | + ApiResponse resp = ufoServiceCaller.call(method); | ||
33 | + if (resp!= null){ | ||
34 | + Map<String,String> rd = (Map<String,String>)resp.getData(); | ||
35 | + for(String key : cloneKeys){ | ||
36 | + data.put(key, rd.get(key)); | ||
37 | + } | ||
38 | + | ||
39 | + } | ||
40 | + | ||
41 | + }catch (Exception ex){ | ||
42 | + logger.warn("getServiceTipsConfig call {} fail, use default config value", method); | ||
43 | + data.put(KEY_SERVICETIPSDESC, "活动期间平台服务费全免,何时收费,提前一个月另行通知"); | ||
44 | + } | ||
45 | + return data; | ||
46 | + } | ||
47 | + | ||
48 | +} |
@@ -20,6 +20,7 @@ import com.yohoufo.order.model.dto.ChangePricePrepareDTO; | @@ -20,6 +20,7 @@ import com.yohoufo.order.model.dto.ChangePricePrepareDTO; | ||
20 | import com.yohoufo.order.model.response.OrderSubmitResp; | 20 | import com.yohoufo.order.model.response.OrderSubmitResp; |
21 | import com.yohoufo.order.service.impl.SellerOrderCancelService; | 21 | import com.yohoufo.order.service.impl.SellerOrderCancelService; |
22 | import com.yohoufo.order.service.proxy.ProductProxyService; | 22 | import com.yohoufo.order.service.proxy.ProductProxyService; |
23 | +import com.yohoufo.order.service.proxy.ResourcesProxyService; | ||
23 | import com.yohoufo.order.service.seller.SellerChangePriceRecordService; | 24 | import com.yohoufo.order.service.seller.SellerChangePriceRecordService; |
24 | import com.yohoufo.order.service.seller.processor.NESChangePricePrepareProcessor; | 25 | import com.yohoufo.order.service.seller.processor.NESChangePricePrepareProcessor; |
25 | import com.yohoufo.order.service.seller.processor.NESChangePricePublishPrepareProcessor; | 26 | import com.yohoufo.order.service.seller.processor.NESChangePricePublishPrepareProcessor; |
@@ -31,6 +32,7 @@ import org.springframework.stereotype.Service; | @@ -31,6 +32,7 @@ import org.springframework.stereotype.Service; | ||
31 | 32 | ||
32 | import java.util.ArrayList; | 33 | import java.util.ArrayList; |
33 | import java.util.List; | 34 | import java.util.List; |
35 | +import java.util.Map; | ||
34 | import java.util.Objects; | 36 | import java.util.Objects; |
35 | import java.util.stream.Collectors; | 37 | import java.util.stream.Collectors; |
36 | 38 | ||
@@ -81,6 +83,9 @@ public class NotEntrySellerChangePriceService{ | @@ -81,6 +83,9 @@ public class NotEntrySellerChangePriceService{ | ||
81 | @Autowired | 83 | @Autowired |
82 | private ProductProxyService productProxyService; | 84 | private ProductProxyService productProxyService; |
83 | 85 | ||
86 | + @Autowired | ||
87 | + private ResourcesProxyService resourcesProxyService; | ||
88 | + | ||
84 | 89 | ||
85 | public boolean isChangePriceOrder(long orderCode){ | 90 | public boolean isChangePriceOrder(long orderCode){ |
86 | // | 91 | // |
@@ -88,6 +93,7 @@ public class NotEntrySellerChangePriceService{ | @@ -88,6 +93,7 @@ public class NotEntrySellerChangePriceService{ | ||
88 | return Objects.nonNull(scpr); | 93 | return Objects.nonNull(scpr); |
89 | } | 94 | } |
90 | 95 | ||
96 | + | ||
91 | /** | 97 | /** |
92 | * compute Change Price4 NES(Not Entry Seller) | 98 | * compute Change Price4 NES(Not Entry Seller) |
93 | * @param req | 99 | * @param req |
@@ -96,7 +102,9 @@ public class NotEntrySellerChangePriceService{ | @@ -96,7 +102,9 @@ public class NotEntrySellerChangePriceService{ | ||
96 | public SoldPrdComputeBo computeChangePrice(NESChangePriceReq req){ | 102 | public SoldPrdComputeBo computeChangePrice(NESChangePriceReq req){ |
97 | logger.info("in NotEntrySellerChangePriceService.computeChangePrice, req {}", req); | 103 | logger.info("in NotEntrySellerChangePriceService.computeChangePrice, req {}", req); |
98 | ChangePricePrepareDTO cppDto = nesChangePricePrepareProcessor.checkAndAcquire(req); | 104 | ChangePricePrepareDTO cppDto = nesChangePricePrepareProcessor.checkAndAcquire(req); |
99 | - SoldPrdComputeBo computeBo = SellerOrderConvertor.computeResult2SoldPrdComputeBo(cppDto.getComputeResult()); | 105 | + Map<String,String> tipsConfig = resourcesProxyService.getServiceTipsConfig(); |
106 | + SoldPrdComputeBo computeBo = SellerOrderConvertor.computeResult2SoldPrdComputeBo(cppDto.getComputeResult(), tipsConfig); | ||
107 | + | ||
100 | return computeBo; | 108 | return computeBo; |
101 | } | 109 | } |
102 | 110 |
-
Please register or login to post a comment