Authored by chenchao

add entry seller type

@@ -2,6 +2,7 @@ package com.yohoufo.order.controller; @@ -2,6 +2,7 @@ package com.yohoufo.order.controller;
2 2
3 import com.yohobuy.ufo.model.order.common.EntrySellerType; 3 import com.yohobuy.ufo.model.order.common.EntrySellerType;
4 import com.yohobuy.ufo.model.order.resp.EntryThreshold; 4 import com.yohobuy.ufo.model.order.resp.EntryThreshold;
  5 +import com.yohobuy.ufo.model.order.resp.SellerResp;
5 import com.yohoufo.common.ApiResponse; 6 import com.yohoufo.common.ApiResponse;
6 import com.yohoufo.common.exception.GatewayException; 7 import com.yohoufo.common.exception.GatewayException;
7 import com.yohoufo.order.model.request.ShoppingRequest; 8 import com.yohoufo.order.model.request.ShoppingRequest;
@@ -95,7 +96,7 @@ public class StoredSellerDepositController { @@ -95,7 +96,7 @@ public class StoredSellerDepositController {
95 throw new GatewayException(400, "参数错误,uid不存在!"); 96 throw new GatewayException(400, "参数错误,uid不存在!");
96 } 97 }
97 98
98 - Map<String,Boolean> map=storedSellerService.entryStatus(uid); 99 + SellerResp map = storedSellerService.entryStatus(uid);
99 ApiResponse apiResponse = new ApiResponse(); 100 ApiResponse apiResponse = new ApiResponse();
100 apiResponse.setData(map); 101 apiResponse.setData(map);
101 return apiResponse; 102 return apiResponse;
1 package com.yohoufo.order.service; 1 package com.yohoufo.order.service;
2 2
  3 +import com.yohobuy.ufo.model.order.resp.SellerResp;
3 import com.yohoufo.dal.order.model.StoredSeller; 4 import com.yohoufo.dal.order.model.StoredSeller;
4 5
5 import java.util.Map; 6 import java.util.Map;
@@ -11,7 +12,7 @@ public interface IStoredSellerService { @@ -11,7 +12,7 @@ public interface IStoredSellerService {
11 12
12 boolean isStoredSeller(Integer uid); 13 boolean isStoredSeller(Integer uid);
13 14
14 - Map<String,Boolean> entryStatus(Integer uid); 15 + SellerResp entryStatus(Integer uid);
15 16
16 void addUserAsStoredSeller(Integer uid); 17 void addUserAsStoredSeller(Integer uid);
17 18
@@ -4,6 +4,7 @@ import com.yoho.error.exception.ServiceException; @@ -4,6 +4,7 @@ import com.yoho.error.exception.ServiceException;
4 import com.yoho.tools.common.beans.ApiResponse; 4 import com.yoho.tools.common.beans.ApiResponse;
5 import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum; 5 import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum;
6 import com.yohobuy.ufo.model.order.common.EntrySellerType; 6 import com.yohobuy.ufo.model.order.common.EntrySellerType;
  7 +import com.yohobuy.ufo.model.order.resp.SellerResp;
7 import com.yohoufo.common.caller.UfoServiceCaller; 8 import com.yohoufo.common.caller.UfoServiceCaller;
8 import com.yohoufo.dal.order.StoredSellerMapper; 9 import com.yohoufo.dal.order.StoredSellerMapper;
9 import com.yohoufo.dal.order.model.StoredSeller; 10 import com.yohoufo.dal.order.model.StoredSeller;
@@ -21,6 +22,7 @@ import java.time.LocalDateTime; @@ -21,6 +22,7 @@ import java.time.LocalDateTime;
21 import java.time.ZoneOffset; 22 import java.time.ZoneOffset;
22 import java.util.HashMap; 23 import java.util.HashMap;
23 import java.util.Map; 24 import java.util.Map;
  25 +import java.util.Objects;
24 26
25 @Service 27 @Service
26 public class StoreSellerServiceImpl implements IStoredSellerService { 28 public class StoreSellerServiceImpl implements IStoredSellerService {
@@ -42,6 +44,9 @@ public class StoreSellerServiceImpl implements IStoredSellerService { @@ -42,6 +44,9 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
42 @Value("${zhimacert.switch:true}") 44 @Value("${zhimacert.switch:true}")
43 private boolean zhiMaCertSwitch; 45 private boolean zhiMaCertSwitch;
44 46
  47 + @Autowired
  48 + private SellerService sellerService;
  49 +
45 /** 50 /**
46 * 是否入驻商户 51 * 是否入驻商户
47 * @param uid 52 * @param uid
@@ -58,7 +63,7 @@ public class StoreSellerServiceImpl implements IStoredSellerService { @@ -58,7 +63,7 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
58 } 63 }
59 64
60 @Override 65 @Override
61 - public Map<String,Boolean> entryStatus(Integer uid){ 66 + public SellerResp entryStatus(Integer uid){
62 logger.info("StoredSellerServiceImpl entryStatus uid is {} ",uid); 67 logger.info("StoredSellerServiceImpl entryStatus uid is {} ",uid);
63 Boolean isZhiMaCert=false; 68 Boolean isZhiMaCert=false;
64 69
@@ -92,11 +97,14 @@ public class StoreSellerServiceImpl implements IStoredSellerService { @@ -92,11 +97,14 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
92 } 97 }
93 } 98 }
94 99
95 - Map<String,Boolean> map=new HashMap<>();  
96 - map.put("isZhiMaCert",isZhiMaCert);  
97 - map.put("isStoredSeller",isStoredSeller);  
98 - map.put("storedBefore",storedBefore);  
99 - return map; 100 + EntrySellerType entrySellerType = sellerService.getEntrySellerType(uid);
  101 + SellerResp sellerResp = new SellerResp();
  102 + sellerResp.setZhiMaCert(isZhiMaCert);
  103 + sellerResp.setStoredBefore(storedBefore);
  104 + sellerResp.setStoredSeller(isStoredSeller);
  105 + if(Objects.nonNull(entrySellerType))
  106 + sellerResp.setEntrySellerType(entrySellerType.getCode());
  107 + return sellerResp;
100 } 108 }
101 109
102 @Override 110 @Override