Authored by chenchao

add entry seller type

... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.controller;
import com.yohobuy.ufo.model.order.common.EntrySellerType;
import com.yohobuy.ufo.model.order.resp.EntryThreshold;
import com.yohobuy.ufo.model.order.resp.SellerResp;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.exception.GatewayException;
import com.yohoufo.order.model.request.ShoppingRequest;
... ... @@ -95,7 +96,7 @@ public class StoredSellerDepositController {
throw new GatewayException(400, "参数错误,uid不存在!");
}
Map<String,Boolean> map=storedSellerService.entryStatus(uid);
SellerResp map = storedSellerService.entryStatus(uid);
ApiResponse apiResponse = new ApiResponse();
apiResponse.setData(map);
return apiResponse;
... ...
package com.yohoufo.order.service;
import com.yohobuy.ufo.model.order.resp.SellerResp;
import com.yohoufo.dal.order.model.StoredSeller;
import java.util.Map;
... ... @@ -11,7 +12,7 @@ public interface IStoredSellerService {
boolean isStoredSeller(Integer uid);
Map<String,Boolean> entryStatus(Integer uid);
SellerResp entryStatus(Integer uid);
void addUserAsStoredSeller(Integer uid);
... ...
... ... @@ -4,6 +4,7 @@ import com.yoho.error.exception.ServiceException;
import com.yoho.tools.common.beans.ApiResponse;
import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum;
import com.yohobuy.ufo.model.order.common.EntrySellerType;
import com.yohobuy.ufo.model.order.resp.SellerResp;
import com.yohoufo.common.caller.UfoServiceCaller;
import com.yohoufo.dal.order.StoredSellerMapper;
import com.yohoufo.dal.order.model.StoredSeller;
... ... @@ -21,6 +22,7 @@ import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Service
public class StoreSellerServiceImpl implements IStoredSellerService {
... ... @@ -42,6 +44,9 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
@Value("${zhimacert.switch:true}")
private boolean zhiMaCertSwitch;
@Autowired
private SellerService sellerService;
/**
* 是否入驻商户
* @param uid
... ... @@ -58,7 +63,7 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
}
@Override
public Map<String,Boolean> entryStatus(Integer uid){
public SellerResp entryStatus(Integer uid){
logger.info("StoredSellerServiceImpl entryStatus uid is {} ",uid);
Boolean isZhiMaCert=false;
... ... @@ -92,11 +97,14 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
}
}
Map<String,Boolean> map=new HashMap<>();
map.put("isZhiMaCert",isZhiMaCert);
map.put("isStoredSeller",isStoredSeller);
map.put("storedBefore",storedBefore);
return map;
EntrySellerType entrySellerType = sellerService.getEntrySellerType(uid);
SellerResp sellerResp = new SellerResp();
sellerResp.setZhiMaCert(isZhiMaCert);
sellerResp.setStoredBefore(storedBefore);
sellerResp.setStoredSeller(isStoredSeller);
if(Objects.nonNull(entrySellerType))
sellerResp.setEntrySellerType(entrySellerType.getCode());
return sellerResp;
}
@Override
... ...