Authored by chenjian

门店skup接口加门店

@@ -710,16 +710,23 @@ public class ProductController { @@ -710,16 +710,23 @@ public class ProductController {
710 return productService.queryProductLeastFlashSalePrice(productId); 710 return productService.queryProductLeastFlashSalePrice(productId);
711 } 711 }
712 712
  713 + /**
  714 + * 门店UFO小程序扫码购买时调用
  715 + * @param skup
  716 + * @param storeId
  717 + * @return
  718 + */
713 @IgnoreSession 719 @IgnoreSession
714 @RequestMapping(params = "method=ufo.product.skup.detail") 720 @RequestMapping(params = "method=ufo.product.skup.detail")
715 - public ApiResponse querySkupDetailBySkup(@RequestParam(value = "skup") Integer skup) { 721 + public ApiResponse querySkupDetailBySkup(@RequestParam(value = "skup") Integer skup,
  722 + @RequestParam(value = "store_id", required = false) Integer storeId) {
716 if (null == skup) { 723 if (null == skup) {
717 LOG.info("in method=ufo.product.skup.detail skup Is Null"); 724 LOG.info("in method=ufo.product.skup.detail skup Is Null");
718 return new ApiResponse(400, "skup Is Null", null); 725 return new ApiResponse(400, "skup Is Null", null);
719 } 726 }
720 - LOG.info("in method=ufo.product.skup.detail skup={}", skup); 727 + LOG.info("in method=ufo.product.skup.detail skup={}, storeId={}", skup, storeId);
721 728
722 - SkupInfo skupInfo = productService.querySkupDetailBySkup(skup); 729 + SkupInfo skupInfo = productService.querySkupDetailBySkup(skup, storeId);
723 return new ApiResponse.ApiResponseBuilder().data(skupInfo).code(200).build(); 730 return new ApiResponse.ApiResponseBuilder().data(skupInfo).code(200).build();
724 } 731 }
725 732
@@ -83,7 +83,7 @@ public interface ProductService { @@ -83,7 +83,7 @@ public interface ProductService {
83 83
84 JSONObject querySaleCategoryDetailInfo(Integer id); 84 JSONObject querySaleCategoryDetailInfo(Integer id);
85 85
86 - SkupInfo querySkupDetailBySkup(int skup); 86 + SkupInfo querySkupDetailBySkup(Integer skup, Integer storeId);
87 87
88 /** 88 /**
89 * 获取门店显示屏 sku-p 详情 89 * 获取门店显示屏 sku-p 详情
@@ -16,6 +16,8 @@ import java.util.function.BinaryOperator; @@ -16,6 +16,8 @@ import java.util.function.BinaryOperator;
16 import java.util.function.Function; 16 import java.util.function.Function;
17 import java.util.stream.Collectors; 17 import java.util.stream.Collectors;
18 18
  19 +import com.yohobuy.ufo.model.response.store.StoreInfoBo;
  20 +import com.yohoufo.common.ApiResponse;
19 import com.yohoufo.dal.product.*; 21 import com.yohoufo.dal.product.*;
20 import com.yohoufo.dal.product.model.*; 22 import com.yohoufo.dal.product.model.*;
21 import org.apache.commons.collections.MapUtils; 23 import org.apache.commons.collections.MapUtils;
@@ -1182,7 +1184,7 @@ public class ProductServiceImpl implements ProductService { @@ -1182,7 +1184,7 @@ public class ProductServiceImpl implements ProductService {
1182 } 1184 }
1183 1185
1184 @Override 1186 @Override
1185 - public SkupInfo querySkupDetailBySkup(int skup) { 1187 + public SkupInfo querySkupDetailBySkup(Integer skup, Integer storeId) {
1186 1188
1187 StoragePrice skupDo = storagePriceMapper.selectBySkup(skup); 1189 StoragePrice skupDo = storagePriceMapper.selectBySkup(skup);
1188 1190
@@ -1207,6 +1209,13 @@ public class ProductServiceImpl implements ProductService { @@ -1207,6 +1209,13 @@ public class ProductServiceImpl implements ProductService {
1207 1209
1208 Pair<Integer, String> skupStatusPair = product.getShelveStatus() == 1 ? getSkupStatus(skupDo.getStatus()) : getSkupStatus(0); 1210 Pair<Integer, String> skupStatusPair = product.getShelveStatus() == 1 ? getSkupStatus(skupDo.getStatus()) : getSkupStatus(0);
1209 1211
  1212 + String storeName = "YOHO!STORE艾尚店";
  1213 + if (storeId != null && storeId > 0) {
  1214 + StoreInfoBo storeInfoBo = queryStoreInfo(storeId);
  1215 + if(storeInfoBo != null)
  1216 + storeName = storeInfoBo.getStoreName();
  1217 + }
  1218 +
1210 return SkupInfo.builder() 1219 return SkupInfo.builder()
1211 .productId(product.getId()) 1220 .productId(product.getId())
1212 .productName(product.getProductName()) 1221 .productName(product.getProductName())
@@ -1221,11 +1230,22 @@ public class ProductServiceImpl implements ProductService { @@ -1221,11 +1230,22 @@ public class ProductServiceImpl implements ProductService {
1221 .price(skupDo.getPrice()) 1230 .price(skupDo.getPrice())
1222 .status(skupStatusPair.getLeft()) 1231 .status(skupStatusPair.getLeft())
1223 .statusStr(skupStatusPair.getRight()) 1232 .statusStr(skupStatusPair.getRight())
1224 - .storeName("YOHO!STORE艾尚店") 1233 + .storeName(storeName)
1225 .build(); 1234 .build();
1226 1235
1227 } 1236 }
1228 1237
  1238 + //查询门店信息
  1239 + private StoreInfoBo queryStoreInfo(int storeId) {
  1240 + ApiResponse resp = ufoServiceCaller.call("ufo.store.queryStoreInfoById", ApiResponse.class, storeId);
  1241 + if (resp != null && resp.getCode()==200) {
  1242 + if (resp.getData() != null) {
  1243 + return (StoreInfoBo)resp.getData();
  1244 + }
  1245 + }
  1246 + return null;
  1247 + }
  1248 +
1229 /** 1249 /**
1230 * skup状态:0:已下架;1:可售;2:已售出 1250 * skup状态:0:已下架;1:可售;2:已售出
1231 * 1251 *