Merge branch 'test6.8.5' of http://git.yoho.cn/ufo/yohoufo-fore into test6.8.5
Showing
7 changed files
with
139 additions
and
49 deletions
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <result column="status" jdbcType="SMALLINT" property="status" /> | 12 | <result column="status" jdbcType="SMALLINT" property="status" /> |
13 | </resultMap> | 13 | </resultMap> |
14 | <sql id="Base_Column_List"> | 14 | <sql id="Base_Column_List"> |
15 | - id, uid, order_code, pre_enter_type, enter_type, create_time, update_time, status | 15 | + id, uid, order_code, pre_enter_type, enter_type, create_time, update_time, `status` |
16 | </sql> | 16 | </sql> |
17 | <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | 17 | <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> |
18 | select | 18 | select |
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | and enter_type = #{enterType,jdbcType=INTEGER} | 33 | and enter_type = #{enterType,jdbcType=INTEGER} |
34 | </if> | 34 | </if> |
35 | <if test="preEnterType != null"> | 35 | <if test="preEnterType != null"> |
36 | - pre_enter_type = #{preEnterType,jdbcType=INTEGER} | 36 | + and pre_enter_type = #{preEnterType,jdbcType=INTEGER} |
37 | </if> | 37 | </if> |
38 | </select> | 38 | </select> |
39 | <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | 39 | <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> |
@@ -746,6 +746,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | @@ -746,6 +746,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | ||
746 | && sellerType == EntrySellerType.SUPER_ENTRY) { | 746 | && sellerType == EntrySellerType.SUPER_ENTRY) { |
747 | // 升级超级卖家:并发期间 处罚保证金 retry | 747 | // 升级超级卖家:并发期间 处罚保证金 retry |
748 | if (availAmount == null) { | 748 | if (availAmount == null) { |
749 | + logger.info("{}修改钱包表余额,升级超级卖家:并发期间 处罚保证金 retry,bean={}", message, sw); | ||
749 | availAmount = lockAmount; | 750 | availAmount = lockAmount; |
750 | lockAmount = null; | 751 | lockAmount = null; |
751 | sw.setAmount(availAmount); | 752 | sw.setAmount(availAmount); |
@@ -358,38 +358,57 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -358,38 +358,57 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
358 | } | 358 | } |
359 | 359 | ||
360 | ExpressInfoRespBo expressInfoRespBo = new ExpressInfoRespBo(); | 360 | ExpressInfoRespBo expressInfoRespBo = new ExpressInfoRespBo(); |
361 | + expressInfoRespBo.setExpressInfoDetailList(Lists.newArrayList()); | ||
362 | + expressInfoRespBo.setJudgeExpressInfoDetailList(Lists.newArrayList()); | ||
363 | + expressInfoRespBo.setSupplementExpressInfoDetailList(Lists.newArrayList()); | ||
361 | 364 | ||
365 | + List<Integer> expressTypeList = getCurrentExpressType4ExpressRecord(buyerOrder.getStatus(), actor); | ||
366 | + LOGGER.info("queryExpressDetailInfo getExpressType expressTypeList result = {}, uid={}, orderCode = {},actor = {} ",expressTypeList,uid, orderCode,actor); | ||
367 | + if(CollectionUtils.isEmpty(expressTypeList)){ | ||
368 | + LOGGER.info("queryExpressDetailInfo getExpressType expressTypeList return empty result = {}, uid={}, orderCode = {},actor = {} ",expressTypeList,uid, orderCode,actor); | ||
369 | + return expressInfoRespBo; | ||
370 | + } | ||
362 | 371 | ||
363 | - Integer expressType = getCurrentExpressType4ExpressRecord(buyerOrder.getStatus(), actor); | ||
364 | - LOGGER.info("queryExpressDetailInfo getExpressType expressType result = {}, uid={}, orderCode = {},actor = {} ",expressType,uid, orderCode,actor); | ||
365 | //1.物流单号信息 | 372 | //1.物流单号信息 |
366 | - constructWayBillInfo(orderCode,expressType,expressInfoRespBo); | ||
367 | - | ||
368 | - //2.设定最近一个阶段的物流 | ||
369 | - expressInfoRespBo.setExpressInfoDetailList(Lists.newArrayList()); | ||
370 | - List<ExpressInfo> expressInfoList = getExpressInfoListByStage(actor, orderCode, expressType); | ||
371 | - constructExpressInfo(actor,expressInfoList, expressInfoRespBo.getExpressInfoDetailList()); | 373 | + constructWayBillInfo(orderCode,expressTypeList,expressInfoRespBo); |
374 | + | ||
375 | + // 构造物流信息 | ||
376 | + if(expressTypeList.size()==1){ | ||
377 | + //设定最近一个阶段的物流 | ||
378 | + List<ExpressInfo> expressInfoList = getExpressInfoListByStage(actor, orderCode, expressTypeList.get(0)); | ||
379 | + constructExpressInfo(actor,expressInfoList, expressInfoRespBo.getExpressInfoDetailList()); | ||
380 | + }else if(expressTypeList.size()==2){ | ||
381 | + if(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode().intValue()==expressTypeList.get(0)){ | ||
382 | + //设定鉴定的物流调拨信息 | ||
383 | + List<ExpressInfo> judgeExpressInfoList=getExpressInfoListByStage(actor, orderCode, EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode()); | ||
384 | + constructExpressInfo(actor,judgeExpressInfoList, expressInfoRespBo.getJudgeExpressInfoDetailList()); | ||
385 | + | ||
386 | + //获取上一阶段的辅助物流信息 | ||
387 | + constructSupplementExpress( actor,orderCode,expressTypeList.get(0),expressInfoRespBo); | ||
388 | + }else{ | ||
389 | + //设定最近一个阶段的物流 | ||
390 | + List<ExpressInfo> expressInfoList = getExpressInfoListByStage(actor, orderCode, expressTypeList.get(0)); | ||
391 | + constructExpressInfo(actor,expressInfoList, expressInfoRespBo.getExpressInfoDetailList()); | ||
392 | + | ||
393 | + //获取上一阶段的辅助物流信息 | ||
394 | + constructSupplementExpress( actor,orderCode,expressTypeList.get(0),expressInfoRespBo); | ||
395 | + } | ||
396 | + }else if(expressTypeList.size()==3){ | ||
397 | + //设定最近一个阶段的物流 | ||
398 | + List<ExpressInfo> expressInfoList = getExpressInfoListByStage(actor, orderCode, expressTypeList.get(0)); | ||
399 | + constructExpressInfo(actor,expressInfoList, expressInfoRespBo.getExpressInfoDetailList()); | ||
372 | 400 | ||
373 | - //3.设定鉴定的物流调拨信息 | ||
374 | - expressInfoRespBo.setJudgeExpressInfoDetailList(Lists.newArrayList()); | ||
375 | - List<ExpressInfo> judgeExpressInfoList=getExpressInfoListByStage(actor, orderCode, EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode()); | ||
376 | - constructExpressInfo(actor,judgeExpressInfoList, expressInfoRespBo.getJudgeExpressInfoDetailList()); | 401 | + //设定鉴定的物流调拨信息 |
402 | + List<ExpressInfo> judgeExpressInfoList=getExpressInfoListByStage(actor, orderCode, EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode()); | ||
403 | + constructExpressInfo(actor,judgeExpressInfoList, expressInfoRespBo.getJudgeExpressInfoDetailList()); | ||
377 | 404 | ||
378 | - //4.获取上一阶段的辅助物流信息 | ||
379 | - List<ExpressInfoDetail> supplementExpressInfoDetailList = Lists.newArrayList(); | ||
380 | - expressInfoRespBo.setSupplementExpressInfoDetailList(supplementExpressInfoDetailList); | ||
381 | - constructSupplementExpress( actor,orderCode,expressType,expressInfoRespBo); | 405 | + //获取上一阶段的辅助物流信息 |
406 | + constructSupplementExpress( actor,orderCode,expressTypeList.get(0),expressInfoRespBo); | ||
407 | + } | ||
382 | 408 | ||
383 | //5.设定三个阶段的信息 | 409 | //5.设定三个阶段的信息 |
384 | buildExpressStage(buyerOrder.getStatus(), expressInfoRespBo); | 410 | buildExpressStage(buyerOrder.getStatus(), expressInfoRespBo); |
385 | 411 | ||
386 | - //6.根据状态重设expressType | ||
387 | - if(Objects.equals(OrderStatus.PLATFORM_RECEIVE.getCode(),buyerOrder.getStatus()) | ||
388 | - ||Objects.equals(OrderStatus.PLATFORM_CHECKING.getCode(),buyerOrder.getStatus()) | ||
389 | - ){ | ||
390 | - expressInfoRespBo.setExpressType(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode().byteValue()); | ||
391 | - } | ||
392 | - | ||
393 | LOGGER.info("queryExpressDetailInfo result = {}", JSON.toJSONString(expressInfoRespBo)); | 412 | LOGGER.info("queryExpressDetailInfo result = {}", JSON.toJSONString(expressInfoRespBo)); |
394 | return expressInfoRespBo; | 413 | return expressInfoRespBo; |
395 | } | 414 | } |
@@ -414,7 +433,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -414,7 +433,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
414 | } | 433 | } |
415 | 434 | ||
416 | private void constructSupplementExpress(TabType actor,Long orderCode,Integer expressType,ExpressInfoRespBo expressInfoRespBo){ | 435 | private void constructSupplementExpress(TabType actor,Long orderCode,Integer expressType,ExpressInfoRespBo expressInfoRespBo){ |
417 | - if(EnumExpressType.EXPRESS_TYPE_2.getCode().intValue()==expressType.intValue()){ | 436 | + if(EnumExpressType.EXPRESS_TYPE_2.getCode().intValue()==expressType.intValue() |
437 | + ||EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode().intValue()==expressType.intValue()){ | ||
418 | //买家这个时候需要看卖家的物流 | 438 | //买家这个时候需要看卖家的物流 |
419 | //设置物流提示头信息 | 439 | //设置物流提示头信息 |
420 | if(StringUtils.isBlank(expressInfoRespBo.getExpressSender())){ | 440 | if(StringUtils.isBlank(expressInfoRespBo.getExpressSender())){ |
@@ -429,7 +449,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -429,7 +449,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
429 | //如果还没有新的物流信息,卖家显示上一个阶段的物流 | 449 | //如果还没有新的物流信息,卖家显示上一个阶段的物流 |
430 | if(StringUtils.isBlank(expressInfoRespBo.getExpressSender())){ | 450 | if(StringUtils.isBlank(expressInfoRespBo.getExpressSender())){ |
431 | //物流单号信息 | 451 | //物流单号信息 |
432 | - constructWayBillInfo(orderCode,EnumExpressType.EXPRESS_TYPE_1.getCode(),expressInfoRespBo); | 452 | + constructWayBillInfo(orderCode,Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode()),expressInfoRespBo); |
433 | } | 453 | } |
434 | List<ExpressInfo> previousExpressInfoList = getExpressInfoListByStage(actor,orderCode, EnumExpressType.EXPRESS_TYPE_1.getCode()); | 454 | List<ExpressInfo> previousExpressInfoList = getExpressInfoListByStage(actor,orderCode, EnumExpressType.EXPRESS_TYPE_1.getCode()); |
435 | constructExpressInfo(actor,previousExpressInfoList, expressInfoRespBo.getSupplementExpressInfoDetailList()); | 455 | constructExpressInfo(actor,previousExpressInfoList, expressInfoRespBo.getSupplementExpressInfoDetailList()); |
@@ -438,14 +458,22 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -438,14 +458,22 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
438 | } | 458 | } |
439 | 459 | ||
440 | //物流单号信息 | 460 | //物流单号信息 |
441 | - private void constructWayBillInfo(Long orderCode,Integer expressType,ExpressInfoRespBo expressInfoRespBo){ | 461 | + private void constructWayBillInfo(Long orderCode,List<Integer> expressTypeList,ExpressInfoRespBo expressInfoRespBo){ |
462 | + Integer expressType = 0; | ||
463 | + for(Integer i:expressTypeList){ | ||
464 | + if(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode().equals(i)){ | ||
465 | + continue; | ||
466 | + } | ||
467 | + expressType = i; | ||
468 | + break; //循环一次 ,取最近的一个 | ||
469 | + } | ||
442 | ExpressRecord expressRecord = expressRecordMapper.selectByOrderCodeAndExpressType(orderCode,expressType); | 470 | ExpressRecord expressRecord = expressRecordMapper.selectByOrderCodeAndExpressType(orderCode,expressType); |
443 | if(expressRecord!=null){ | 471 | if(expressRecord!=null){ |
444 | expressInfoRespBo.setExpressInfoDetailList(new ArrayList<>()); | 472 | expressInfoRespBo.setExpressInfoDetailList(new ArrayList<>()); |
445 | // 快递单号 | 473 | // 快递单号 |
446 | expressInfoRespBo.setWayBillCode(expressRecord.getWaybillCode()); | 474 | expressInfoRespBo.setWayBillCode(expressRecord.getWaybillCode()); |
447 | //物流类型 | 475 | //物流类型 |
448 | - expressInfoRespBo.setExpressType(expressRecord.getExpressType()); | 476 | + expressInfoRespBo.setExpressType(expressTypeList.get(0).byteValue()); |
449 | //物流发货方 | 477 | //物流发货方 |
450 | expressInfoRespBo.setExpressSender(getSenderName(expressInfoRespBo.getExpressType().intValue())); | 478 | expressInfoRespBo.setExpressSender(getSenderName(expressInfoRespBo.getExpressType().intValue())); |
451 | // 快递公司名称 | 479 | // 快递公司名称 |
@@ -458,36 +486,37 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -458,36 +486,37 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
458 | * orderCode 一定是买家订单号 | 486 | * orderCode 一定是买家订单号 |
459 | * @return | 487 | * @return |
460 | */ | 488 | */ |
461 | - private Integer getCurrentExpressType4ExpressRecord(Integer status, TabType actor) { | 489 | + private List<Integer> getCurrentExpressType4ExpressRecord(Integer status, TabType actor) { |
462 | if(null==actor){ | 490 | if(null==actor){ |
463 | if(OrderStatus.SELLER_SEND_OUT.getCode()==status | 491 | if(OrderStatus.SELLER_SEND_OUT.getCode()==status |
464 | - ||OrderStatus.PLATFORM_RECEIVE.getCode()==status | ||
465 | - ||OrderStatus.PLATFORM_CHECKING.getCode()==status | ||
466 | ){ | 492 | ){ |
467 | - return EnumExpressType.EXPRESS_TYPE_1.getCode(); | 493 | + return Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode()); |
494 | + }else if(OrderStatus.PLATFORM_RECEIVE.getCode()==status | ||
495 | + ||OrderStatus.PLATFORM_CHECKING.getCode()==status){ | ||
496 | + return Arrays.asList(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode()); | ||
468 | }else if(OrderStatus.WAITING_RECEIVE.getCode()==status||OrderStatus.DONE.getCode()==status){ | 497 | }else if(OrderStatus.WAITING_RECEIVE.getCode()==status||OrderStatus.DONE.getCode()==status){ |
469 | //4 和 5 状态有问题 ,买家查看物流是没问题的,卖家查看物流有问题啊. | 498 | //4 和 5 状态有问题 ,买家查看物流是没问题的,卖家查看物流有问题啊. |
470 | - return EnumExpressType.EXPRESS_TYPE_2.getCode(); | 499 | + return Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode()); |
471 | }else if(OrderStatus.CHECKING_FAKE.getCode()==status){ | 500 | }else if(OrderStatus.CHECKING_FAKE.getCode()==status){ |
472 | - return EnumExpressType.EXPRESS_TYPE_3.getCode(); | 501 | + return Arrays.asList(EnumExpressType.EXPRESS_TYPE_3.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode()); |
473 | }else if(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()==status){ | 502 | }else if(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()==status){ |
474 | - return EnumExpressType.EXPRESS_TYPE_REBACK.getCode(); | 503 | + return Arrays.asList(EnumExpressType.EXPRESS_TYPE_REBACK.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode()); |
475 | } | 504 | } |
476 | }else { | 505 | }else { |
477 | switch (actor){ | 506 | switch (actor){ |
478 | case BUY: | 507 | case BUY: |
479 | - return EnumExpressType.EXPRESS_TYPE_2.getCode(); | 508 | + return getExpressType4Buyer(status); |
480 | case SELL: | 509 | case SELL: |
481 | - return getCurrentExpressType4ExpressRecordAndSeller(status); | 510 | + return getExpressTypes4Seller(status); |
482 | default: | 511 | default: |
483 | - return 0; | 512 | + return null; |
484 | } | 513 | } |
485 | } | 514 | } |
486 | - return 0; | 515 | + return null; |
487 | 516 | ||
488 | } | 517 | } |
489 | 518 | ||
490 | - private Integer getCurrentExpressType4ExpressRecordAndSeller(Integer status){ | 519 | + /* private Integer getCurrentExpressType4ExpressRecordAndSeller(Integer status){ |
491 | 520 | ||
492 | Integer type ; | 521 | Integer type ; |
493 | if (Objects.equals(OrderStatus.CHECKING_FAKE.getCode(), status)){ | 522 | if (Objects.equals(OrderStatus.CHECKING_FAKE.getCode(), status)){ |
@@ -498,7 +527,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -498,7 +527,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
498 | type = EnumExpressType.EXPRESS_TYPE_1.getCode(); | 527 | type = EnumExpressType.EXPRESS_TYPE_1.getCode(); |
499 | } | 528 | } |
500 | return type; | 529 | return type; |
501 | - } | 530 | + }*/ |
502 | 531 | ||
503 | 532 | ||
504 | /** | 533 | /** |
@@ -10,10 +10,12 @@ import com.yohobuy.ufo.model.order.resp.EntryThreshold; | @@ -10,10 +10,12 @@ import com.yohobuy.ufo.model.order.resp.EntryThreshold; | ||
10 | import com.yohoufo.common.exception.UfoServiceException; | 10 | import com.yohoufo.common.exception.UfoServiceException; |
11 | import com.yohoufo.common.utils.DateUtil; | 11 | import com.yohoufo.common.utils.DateUtil; |
12 | import com.yohoufo.dal.order.SellerEnterApplyMapper; | 12 | import com.yohoufo.dal.order.SellerEnterApplyMapper; |
13 | +import com.yohoufo.dal.order.StoredSellerMapper; | ||
13 | import com.yohoufo.dal.order.model.SellerEnterApply; | 14 | import com.yohoufo.dal.order.model.SellerEnterApply; |
14 | import com.yohoufo.dal.order.model.StoredSeller; | 15 | import com.yohoufo.dal.order.model.StoredSeller; |
15 | import com.yohoufo.order.constants.SellerConfig; | 16 | import com.yohoufo.order.constants.SellerConfig; |
16 | import com.yohoufo.order.service.IStoredSellerService; | 17 | import com.yohoufo.order.service.IStoredSellerService; |
18 | +import com.yohoufo.order.service.proxy.ProductProxyService; | ||
17 | import com.yohoufo.order.utils.LoggerUtils; | 19 | import com.yohoufo.order.utils.LoggerUtils; |
18 | import org.apache.commons.collections.CollectionUtils; | 20 | import org.apache.commons.collections.CollectionUtils; |
19 | import org.slf4j.Logger; | 21 | import org.slf4j.Logger; |
@@ -45,6 +47,9 @@ public class SellerEnterApplyService { | @@ -45,6 +47,9 @@ public class SellerEnterApplyService { | ||
45 | @Autowired | 47 | @Autowired |
46 | private SellerFuncService sellerFuncService; | 48 | private SellerFuncService sellerFuncService; |
47 | 49 | ||
50 | + @Autowired | ||
51 | + private StoredSellerMapper storedSellerMapper; | ||
52 | + | ||
48 | /** | 53 | /** |
49 | * 申请成为超级卖家 | 54 | * 申请成为超级卖家 |
50 | * 对于未支付的某一种身份申请做订单号替换 | 55 | * 对于未支付的某一种身份申请做订单号替换 |
@@ -61,7 +66,7 @@ public class SellerEnterApplyService { | @@ -61,7 +66,7 @@ public class SellerEnterApplyService { | ||
61 | logger.warn("in applySuperEntry uid {} orderCode {} targetEST is null", uid, orderCode); | 66 | logger.warn("in applySuperEntry uid {} orderCode {} targetEST is null", uid, orderCode); |
62 | throw new UfoServiceException(400, "EntrySellerType is null"); | 67 | throw new UfoServiceException(400, "EntrySellerType is null"); |
63 | } | 68 | } |
64 | - SellerService.SellerWrapper sellerWrapper = new SellerService().new SellerWrapper(uid).buildBase(); | 69 | + SellerService.SellerWrapper sellerWrapper = new SellerService().new SellerWrapper(uid).storedSellerDataSource(storedSellerMapper::selectByUid).buildBase(); |
65 | SellerBo sellerBo = sellerWrapper.build(); | 70 | SellerBo sellerBo = sellerWrapper.build(); |
66 | 71 | ||
67 | EntrySellerType currentEST = sellerBo.getEntrySellerType(); | 72 | EntrySellerType currentEST = sellerBo.getEntrySellerType(); |
@@ -174,7 +179,8 @@ public class SellerEnterApplyService { | @@ -174,7 +179,8 @@ public class SellerEnterApplyService { | ||
174 | logger.warn("in upgradeLevel one orderCode mapped multiple apply,uid {} orderCode {}", uid, orderCode); | 179 | logger.warn("in upgradeLevel one orderCode mapped multiple apply,uid {} orderCode {}", uid, orderCode); |
175 | } | 180 | } |
176 | //卖家包装类 | 181 | //卖家包装类 |
177 | - SellerService.SellerWrapper sellerWrapper = new SellerService().new SellerWrapper(uid).buildBase(); | 182 | + SellerService.SellerWrapper sellerWrapper = new SellerService().new SellerWrapper(uid) |
183 | + .storedSellerDataSource(storedSellerMapper::selectByUid).buildBase(); | ||
178 | upgradeLevel(sellerWrapper, orderCode, left, seaList); | 184 | upgradeLevel(sellerWrapper, orderCode, left, seaList); |
179 | } | 185 | } |
180 | 186 | ||
@@ -248,6 +254,27 @@ public class SellerEnterApplyService { | @@ -248,6 +254,27 @@ public class SellerEnterApplyService { | ||
248 | if (!noStoredSeller && isMatchedET && levelNeedUpgrade) { | 254 | if (!noStoredSeller && isMatchedET && levelNeedUpgrade) { |
249 | SellerLevelFuncBo slfb = sellerFuncService.getSellerLevelFunc(targetEst.getCode(), level); | 255 | SellerLevelFuncBo slfb = sellerFuncService.getSellerLevelFunc(targetEst.getCode(), level); |
250 | storedSellerService.updateEnterSeller(uid, targetEst, slfb); | 256 | storedSellerService.updateEnterSeller(uid, targetEst, slfb); |
257 | + processWithLevel(currentLevel, level, uid); | ||
258 | + } | ||
259 | + } | ||
260 | + } | ||
261 | + | ||
262 | + @Autowired | ||
263 | + private ProductProxyService productProxyService; | ||
264 | + | ||
265 | + public void processWithLevel(Integer currentLevel, Integer targetLevel, Integer uid){ | ||
266 | + logger.info("processWithLevel currentLevel {} targetLevel {} uid {}",currentLevel, targetLevel, uid); | ||
267 | + if (SellerConfig.ENTER_TYPE_DEFAULT_LEVEL == currentLevel){ | ||
268 | + if(targetLevel == SuperEnterStageLevel.FULL.getCode() | ||
269 | + ||targetLevel == SuperEnterStageLevel.PARTITION.getCode()){ | ||
270 | + productProxyService.cancelHiddenGoods(uid); | ||
271 | + } | ||
272 | + } | ||
273 | + | ||
274 | + if (SellerConfig.ENTER_TYPE_DEFAULT_LEVEL == targetLevel) { | ||
275 | + if (currentLevel == SuperEnterStageLevel.FULL.getCode() | ||
276 | + || currentLevel == SuperEnterStageLevel.PARTITION.getCode()) { | ||
277 | + productProxyService.hiddenGoods(uid); | ||
251 | } | 278 | } |
252 | } | 279 | } |
253 | } | 280 | } |
@@ -33,6 +33,8 @@ import java.util.HashMap; | @@ -33,6 +33,8 @@ import java.util.HashMap; | ||
33 | import java.util.List; | 33 | import java.util.List; |
34 | import java.util.Map; | 34 | import java.util.Map; |
35 | import java.util.Objects; | 35 | import java.util.Objects; |
36 | +import java.util.function.Consumer; | ||
37 | +import java.util.function.Function; | ||
36 | import java.util.stream.Collectors; | 38 | import java.util.stream.Collectors; |
37 | 39 | ||
38 | /** | 40 | /** |
@@ -142,12 +144,19 @@ public class SellerService { | @@ -142,12 +144,19 @@ public class SellerService { | ||
142 | StoredSeller storedSeller; | 144 | StoredSeller storedSeller; |
143 | @Getter | 145 | @Getter |
144 | Integer uid; | 146 | Integer uid; |
147 | + | ||
148 | + Function<Integer,StoredSeller> storedSellerFunc; | ||
149 | + | ||
145 | SellerBo sellerBo = new SellerBo(); | 150 | SellerBo sellerBo = new SellerBo(); |
146 | 151 | ||
147 | SellerWrapper(int uid){ | 152 | SellerWrapper(int uid){ |
148 | this.uid = uid; | 153 | this.uid = uid; |
149 | this.sellerBo.setUid(uid); | 154 | this.sellerBo.setUid(uid); |
150 | } | 155 | } |
156 | + SellerWrapper storedSellerDataSource(Function<Integer,StoredSeller> storedSellerFunc){ | ||
157 | + this.storedSellerFunc = storedSellerFunc; | ||
158 | + return this; | ||
159 | + } | ||
151 | 160 | ||
152 | SellerWrapper buildBase(){ | 161 | SellerWrapper buildBase(){ |
153 | logger.info("buildBase uid {}", uid); | 162 | logger.info("buildBase uid {}", uid); |
@@ -158,7 +167,7 @@ public class SellerService { | @@ -158,7 +167,7 @@ public class SellerService { | ||
158 | 167 | ||
159 | EntrySellerType est = null; | 168 | EntrySellerType est = null; |
160 | //case 1 : not entry | 169 | //case 1 : not entry |
161 | - this.storedSeller = storedSellerMapper.selectByUid(uid); | 170 | + this.storedSeller = storedSellerFunc.apply(uid);//storedSellerMapper.selectByUid(uid); |
162 | if (Objects.isNull(storedSeller)){ | 171 | if (Objects.isNull(storedSeller)){ |
163 | est = EntrySellerType.NOT_ENTRY; | 172 | est = EntrySellerType.NOT_ENTRY; |
164 | logger.info("buildBase storedSeller is null uid {} entryType {}", | 173 | logger.info("buildBase storedSeller is null uid {} entryType {}", |
@@ -227,7 +236,7 @@ public class SellerService { | @@ -227,7 +236,7 @@ public class SellerService { | ||
227 | */ | 236 | */ |
228 | public EntrySellerType getEntrySellerType(int uid){ | 237 | public EntrySellerType getEntrySellerType(int uid){ |
229 | logger.info("getEntrySellerType uid {}", uid); | 238 | logger.info("getEntrySellerType uid {}", uid); |
230 | - SellerBo sellerBo = new SellerWrapper(uid).buildBase().build(); | 239 | + SellerBo sellerBo = new SellerWrapper(uid).storedSellerDataSource(storedSellerMapper::selectByUid).buildBase().build(); |
231 | EntrySellerType est = sellerBo.getEntrySellerType(); | 240 | EntrySellerType est = sellerBo.getEntrySellerType(); |
232 | logger.info("getEntrySellerType uid {} EntrySellerType {}", uid, est); | 241 | logger.info("getEntrySellerType uid {} EntrySellerType {}", uid, est); |
233 | return est; | 242 | return est; |
@@ -263,7 +272,7 @@ public class SellerService { | @@ -263,7 +272,7 @@ public class SellerService { | ||
263 | 272 | ||
264 | public Boolean applySuperEnter(Integer uid){ | 273 | public Boolean applySuperEnter(Integer uid){ |
265 | SellerService.SellerWrapper sellerWrapper = new SellerService() | 274 | SellerService.SellerWrapper sellerWrapper = new SellerService() |
266 | - .new SellerWrapper(uid).buildBase(); | 275 | + .new SellerWrapper(uid).storedSellerDataSource(storedSellerMapper::selectByUid).buildBase(); |
267 | SellerBo sellerBo = sellerWrapper.build(); | 276 | SellerBo sellerBo = sellerWrapper.build(); |
268 | EntrySellerType currentEST = sellerBo.getEntrySellerType(); | 277 | EntrySellerType currentEST = sellerBo.getEntrySellerType(); |
269 | EntrySellerType targetEST = EntrySellerType.SUPER_ENTRY; | 278 | EntrySellerType targetEST = EntrySellerType.SUPER_ENTRY; |
@@ -22,8 +22,6 @@ import org.springframework.stereotype.Service; | @@ -22,8 +22,6 @@ import org.springframework.stereotype.Service; | ||
22 | 22 | ||
23 | import java.time.LocalDateTime; | 23 | import java.time.LocalDateTime; |
24 | import java.time.ZoneOffset; | 24 | import java.time.ZoneOffset; |
25 | -import java.util.HashMap; | ||
26 | -import java.util.Map; | ||
27 | import java.util.Objects; | 25 | import java.util.Objects; |
28 | 26 | ||
29 | @Service | 27 | @Service |
@@ -321,5 +321,31 @@ public class ProductProxyService { | @@ -321,5 +321,31 @@ public class ProductProxyService { | ||
321 | return (null == resp || null == resp.getData())? false : (boolean)resp.getData(); | 321 | return (null == resp || null == resp.getData())? false : (boolean)resp.getData(); |
322 | } | 322 | } |
323 | 323 | ||
324 | + private final static String hideSellerAllSkup = "ufo.product.hideSellerAllSkup", | ||
325 | + showSellerAllSkup = "ufo.product.showSellerAllSkup"; | ||
326 | + | ||
327 | + public boolean hiddenGoods(Integer uid){ | ||
328 | + logger.info("begin in {} uid {}", hideSellerAllSkup, uid); | ||
329 | + ApiResponse resp = null; | ||
330 | + try { | ||
331 | + resp = ufoServiceCaller.call(hideSellerAllSkup, uid); | ||
332 | + } catch (Exception e) { | ||
333 | + logger.warn("in {} call fail uid {}", hideSellerAllSkup, uid, e); | ||
334 | + } | ||
335 | + logger.info("finish {} -> uid {}", hideSellerAllSkup, uid); | ||
336 | + return (null == resp || null == resp.getData())? false : (boolean)resp.getData(); | ||
337 | + } | ||
338 | + | ||
339 | + public boolean cancelHiddenGoods(Integer uid){ | ||
340 | + logger.info("begin in {} uid {}", showSellerAllSkup, uid); | ||
341 | + ApiResponse resp = null; | ||
342 | + try { | ||
343 | + resp = ufoServiceCaller.call(showSellerAllSkup, uid); | ||
344 | + }catch (Exception ex){ | ||
345 | + logger.warn("in {} call fail uid {}", showSellerAllSkup, uid, ex); | ||
346 | + } | ||
347 | + logger.info("finish {} -> uid {}", showSellerAllSkup, uid); | ||
348 | + return (null == resp || null == resp.getData())? false : (boolean)resp.getData(); | ||
349 | + } | ||
324 | 350 | ||
325 | } | 351 | } |
-
Please register or login to post a comment