Showing
4 changed files
with
32 additions
and
0 deletions
1 | package com.yohoufo.order.controller; | 1 | package com.yohoufo.order.controller; |
2 | 2 | ||
3 | +import com.yoho.core.config.ConfigReader; | ||
3 | import com.yohoufo.common.ApiResponse; | 4 | import com.yohoufo.common.ApiResponse; |
4 | import com.yohoufo.order.model.InviteSettlementListVO; | 5 | import com.yohoufo.order.model.InviteSettlementListVO; |
6 | +import com.yohoufo.order.service.IStoredSellerService; | ||
5 | import com.yohoufo.order.service.InviterService; | 7 | import com.yohoufo.order.service.InviterService; |
6 | import lombok.extern.slf4j.Slf4j; | 8 | import lombok.extern.slf4j.Slf4j; |
7 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
8 | import org.springframework.web.bind.annotation.RequestMapping; | 10 | import org.springframework.web.bind.annotation.RequestMapping; |
9 | import org.springframework.web.bind.annotation.RequestParam; | 11 | import org.springframework.web.bind.annotation.RequestParam; |
12 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
10 | import org.springframework.web.bind.annotation.RestController; | 13 | import org.springframework.web.bind.annotation.RestController; |
11 | 14 | ||
12 | /** | 15 | /** |
@@ -20,6 +23,12 @@ public class InviterController { | @@ -20,6 +23,12 @@ public class InviterController { | ||
20 | @Autowired | 23 | @Autowired |
21 | private InviterService inviterService; | 24 | private InviterService inviterService; |
22 | 25 | ||
26 | + @Autowired | ||
27 | + private ConfigReader configReader; | ||
28 | + | ||
29 | + @Autowired | ||
30 | + private IStoredSellerService storedSellerService; | ||
31 | + | ||
23 | /** | 32 | /** |
24 | * 我的收款记录 | 33 | * 我的收款记录 |
25 | * | 34 | * |
@@ -39,4 +48,15 @@ public class InviterController { | @@ -39,4 +48,15 @@ public class InviterController { | ||
39 | return new ApiResponse.ApiResponseBuilder().code(200).message("ok").build(); | 48 | return new ApiResponse.ApiResponseBuilder().code(200).message("ok").build(); |
40 | } | 49 | } |
41 | 50 | ||
51 | + @RequestMapping(params = "method=ufo.invite.isSupportBeenInvited") | ||
52 | + @ResponseBody | ||
53 | + public ApiResponse isSupportInvite(@RequestParam(name = "uid") Integer uid) { | ||
54 | + boolean isSupportInvite = false; | ||
55 | + if (configReader.getBoolean("ufo.invite.isSupportBeenInvited", true)) { | ||
56 | + boolean userIsInHistory = storedSellerService.isStoredSellerInHistory(uid); | ||
57 | + isSupportInvite = !userIsInHistory; | ||
58 | + } | ||
59 | + return new ApiResponse.ApiResponseBuilder().code(200).data(isSupportInvite).message("ok").build(); | ||
60 | + } | ||
61 | + | ||
42 | } | 62 | } |
@@ -14,6 +14,8 @@ public interface IStoredSellerService { | @@ -14,6 +14,8 @@ public interface IStoredSellerService { | ||
14 | 14 | ||
15 | boolean isStoredSeller(Integer uid); | 15 | boolean isStoredSeller(Integer uid); |
16 | 16 | ||
17 | + boolean isStoredSellerInHistory(Integer uid); | ||
18 | + | ||
17 | SellerResp entryStatus(Integer uid); | 19 | SellerResp entryStatus(Integer uid); |
18 | 20 | ||
19 | void addUserAsStoredSeller(Integer uid, EntrySellerType entrySellerType, SellerLevelFuncBo sellerLevelFuncBo); | 21 | void addUserAsStoredSeller(Integer uid, EntrySellerType entrySellerType, SellerLevelFuncBo sellerLevelFuncBo); |
@@ -26,4 +28,5 @@ public interface IStoredSellerService { | @@ -26,4 +28,5 @@ public interface IStoredSellerService { | ||
26 | int disableSpecialSuper(Integer uid); | 28 | int disableSpecialSuper(Integer uid); |
27 | 29 | ||
28 | int removeStoredSeller(Integer uid); | 30 | int removeStoredSeller(Integer uid); |
31 | + | ||
29 | } | 32 | } |
@@ -8,8 +8,10 @@ import com.yohobuy.ufo.model.order.common.EntrySellerType; | @@ -8,8 +8,10 @@ import com.yohobuy.ufo.model.order.common.EntrySellerType; | ||
8 | import com.yohobuy.ufo.model.order.resp.SellerResp; | 8 | import com.yohobuy.ufo.model.order.resp.SellerResp; |
9 | import com.yohoufo.common.caller.UfoServiceCaller; | 9 | import com.yohoufo.common.caller.UfoServiceCaller; |
10 | import com.yohoufo.common.utils.DateUtil; | 10 | import com.yohoufo.common.utils.DateUtil; |
11 | +import com.yohoufo.dal.order.SellerWalletMapper; | ||
11 | import com.yohoufo.dal.order.StoredSellerMapper; | 12 | import com.yohoufo.dal.order.StoredSellerMapper; |
12 | import com.yohoufo.dal.order.SuperEntrySellerMapper; | 13 | import com.yohoufo.dal.order.SuperEntrySellerMapper; |
14 | +import com.yohoufo.dal.order.model.SellerWallet; | ||
13 | import com.yohoufo.dal.order.model.StoredSeller; | 15 | import com.yohoufo.dal.order.model.StoredSeller; |
14 | import com.yohoufo.dal.order.model.SuperEntrySeller; | 16 | import com.yohoufo.dal.order.model.SuperEntrySeller; |
15 | import com.yohoufo.dal.user.model.ZhiMaCert; | 17 | import com.yohoufo.dal.user.model.ZhiMaCert; |
@@ -27,6 +29,7 @@ import org.springframework.stereotype.Service; | @@ -27,6 +29,7 @@ import org.springframework.stereotype.Service; | ||
27 | import java.time.LocalDateTime; | 29 | import java.time.LocalDateTime; |
28 | import java.time.ZoneOffset; | 30 | import java.time.ZoneOffset; |
29 | import java.util.Objects; | 31 | import java.util.Objects; |
32 | +import java.util.Optional; | ||
30 | 33 | ||
31 | @Service | 34 | @Service |
32 | public class StoreSellerServiceImpl implements IStoredSellerService { | 35 | public class StoreSellerServiceImpl implements IStoredSellerService { |
@@ -73,6 +76,11 @@ public class StoreSellerServiceImpl implements IStoredSellerService { | @@ -73,6 +76,11 @@ public class StoreSellerServiceImpl implements IStoredSellerService { | ||
73 | } | 76 | } |
74 | 77 | ||
75 | @Override | 78 | @Override |
79 | + public boolean isStoredSellerInHistory(Integer uid) { | ||
80 | + return Objects.nonNull(storedSellerMapper.selectByUid(uid)); | ||
81 | + } | ||
82 | + | ||
83 | + @Override | ||
76 | public SellerResp entryStatus(Integer uid){ | 84 | public SellerResp entryStatus(Integer uid){ |
77 | logger.info("StoredSellerServiceImpl entryStatus uid is {} ",uid); | 85 | logger.info("StoredSellerServiceImpl entryStatus uid is {} ",uid); |
78 | Boolean isZhiMaCert=false; | 86 | Boolean isZhiMaCert=false; |
@@ -23,4 +23,5 @@ ufo.order.sellerDeliverNewOnlineTime = 1548756000 | @@ -23,4 +23,5 @@ ufo.order.sellerDeliverNewOnlineTime = 1548756000 | ||
23 | ufo.order.sellerDeliverNewOnlineTimeEx = 1550127600 | 23 | ufo.order.sellerDeliverNewOnlineTimeEx = 1550127600 |
24 | ufo.product.productLimitInfo=10009017,10008631,10008633,10008635,10008637,10008639,10008641,10008643,10008645,10008647,10008649,10008651,10008653,10008655,10008657,10008659,10008661,10008663,10008665,10008667,10008669,10008671,10008673,10008675,10008677,10008679,10008681,10008683,10008685,10008687,10008689,10008691,10008693,10008695,10008697,10008699,10008701,10008703,10008705,10008707,10008709,10008711,10008715,10008717,10008719,10008721,10008723,10008725,10008727,10008729,10008731,10008733,10008735,10008737,10008739,10008741,10008743,10008745,10008747,10008749,10008751,10008753,10008755,10008757,10008759,10008761,10008763,10008765,10008767,10008769,10008771,10008773,10008775,10008777,10008779,10008781,10008783,10008785,10008787,10009013,10009015,10009021,10009023,10009025,10009027,10009029,10009031,10009033,10009035,10009037,10009039,10009041,10009043,10009045,10009047,10008789,10008791,10008793,10008795,10008797,10008799,10008801,10008803,10008805,10008807,10008809,10008811,10008813,10008815,10008817,10008819,10008821,10008823,10008825,10008827,10008829,10008831,10008833,10008835,10008837,10008839,10008841,10008843,10008845,10008847,10008849,10008851,10008853,10008855,10008857,10008859,10008861,10008863,10008865,10008867,10008869,10008871,10008873,10008875,10008885,10008887,10008889,10008891,10008893,10008895,10008897,10008899,10008901,10008903,10008905,10008907,10008909,10008911,10008913,10008921,10008923,10008929,10008931,10008933,10008935,10008937,10008939,10008941,10008943,10008945,10008947,10008949,10008951,10008953,10008955,10008957,10008959,10008961,10008963,10008965,10008967,10008969,10008971,10008973,10008975,10008977,10008979,10008981,10008983,10008985,10008987,10008989,10008991,10008993,10008995,10008997,10008999,10009001,10009003,10009005,10009007,10009019,10009049,10009051,10009053,10009055,10009057,10009061,10009063,10009065,10009067 | 24 | ufo.product.productLimitInfo=10009017,10008631,10008633,10008635,10008637,10008639,10008641,10008643,10008645,10008647,10008649,10008651,10008653,10008655,10008657,10008659,10008661,10008663,10008665,10008667,10008669,10008671,10008673,10008675,10008677,10008679,10008681,10008683,10008685,10008687,10008689,10008691,10008693,10008695,10008697,10008699,10008701,10008703,10008705,10008707,10008709,10008711,10008715,10008717,10008719,10008721,10008723,10008725,10008727,10008729,10008731,10008733,10008735,10008737,10008739,10008741,10008743,10008745,10008747,10008749,10008751,10008753,10008755,10008757,10008759,10008761,10008763,10008765,10008767,10008769,10008771,10008773,10008775,10008777,10008779,10008781,10008783,10008785,10008787,10009013,10009015,10009021,10009023,10009025,10009027,10009029,10009031,10009033,10009035,10009037,10009039,10009041,10009043,10009045,10009047,10008789,10008791,10008793,10008795,10008797,10008799,10008801,10008803,10008805,10008807,10008809,10008811,10008813,10008815,10008817,10008819,10008821,10008823,10008825,10008827,10008829,10008831,10008833,10008835,10008837,10008839,10008841,10008843,10008845,10008847,10008849,10008851,10008853,10008855,10008857,10008859,10008861,10008863,10008865,10008867,10008869,10008871,10008873,10008875,10008885,10008887,10008889,10008891,10008893,10008895,10008897,10008899,10008901,10008903,10008905,10008907,10008909,10008911,10008913,10008921,10008923,10008929,10008931,10008933,10008935,10008937,10008939,10008941,10008943,10008945,10008947,10008949,10008951,10008953,10008955,10008957,10008959,10008961,10008963,10008965,10008967,10008969,10008971,10008973,10008975,10008977,10008979,10008981,10008983,10008985,10008987,10008989,10008991,10008993,10008995,10008997,10008999,10009001,10009003,10009005,10009007,10009019,10009049,10009051,10009053,10009055,10009057,10009061,10009063,10009065,10009067 |
25 | ufo.seller.rejoinMaxTimes=1 | 25 | ufo.seller.rejoinMaxTimes=1 |
26 | +ufo.invite.isSupportBeenInvited=true | ||
26 | 27 |
-
Please register or login to post a comment