|
@@ -106,7 +106,7 @@ public class PageServiceImpl implements PageService {
|
|
|
*/
|
|
|
@Override
|
|
|
@Cacheable(value = "insCommodityData", key = "#pageId+'-'+#userId+'-'+#source", unless = "#result == null")
|
|
|
- public ResponseJson<Map<String, Object>> getClassifyData(Integer pageId, Integer userId, Integer source,Integer flag) {
|
|
|
+ public ResponseJson<Map<String, Object>> getClassifyData(Integer pageId, Integer userId, Integer source, Integer flag) {
|
|
|
source = source == null ? 1 : source;
|
|
|
Map<String, Object> map = new HashMap<>(3);
|
|
|
Integer typeSort = pageMapper.getPageTypeSort(pageId);
|
|
@@ -117,7 +117,7 @@ public class PageServiceImpl implements PageService {
|
|
|
setFloorLinkType(floorContent);
|
|
|
floor.setFloorContent(floorContent);
|
|
|
List<FloorImageVo> floorImageList = pageMapper.getFloorImageByCentreId(floor.getId(), source);
|
|
|
- setFloorImageProduct(userId, floorImageList, source,flag);
|
|
|
+ setFloorImageProduct(userId, floorImageList, source, flag);
|
|
|
floor.setFloorImageList(floorImageList);
|
|
|
}
|
|
|
map.put("typeSort", typeSort);
|
|
@@ -134,7 +134,7 @@ public class PageServiceImpl implements PageService {
|
|
|
*/
|
|
|
@Cacheable(value = "getHomeCommodityData", key = "#userId +'-'+ #source", unless = "#result == null")
|
|
|
@Override
|
|
|
- public ResponseJson<Map<String, Object>> getHomeData(Integer userId, Integer source,Integer flag) {
|
|
|
+ public ResponseJson<Map<String, Object>> getHomeData(Integer userId, Integer source, Integer flag) {
|
|
|
Map<String, Object> map = new HashMap<>(2);
|
|
|
//楼层管理
|
|
|
source = source == null ? 1 : source;
|
|
@@ -150,7 +150,7 @@ public class PageServiceImpl implements PageService {
|
|
|
floorIterator.remove();
|
|
|
continue;
|
|
|
}
|
|
|
- setFloorImageProduct(userId, floorImageList, source,flag);
|
|
|
+ setFloorImageProduct(userId, floorImageList, source, flag);
|
|
|
floor.setFloorImageList(floorImageList);
|
|
|
}
|
|
|
map.put("homePageFloor", homePageFloor);
|
|
@@ -352,7 +352,7 @@ public class PageServiceImpl implements PageService {
|
|
|
*/
|
|
|
@Cacheable(value = "getPageBeautyData", key = "#userId +'-'+ #pageId +'-'+ #source", unless = "#result == null")
|
|
|
@Override
|
|
|
- public ResponseJson<Map<String, Object>> getPageBeautyData(Integer pageId, Integer userId, Integer source,Integer flag) {
|
|
|
+ public ResponseJson<Map<String, Object>> getPageBeautyData(Integer pageId, Integer userId, Integer source, Integer flag) {
|
|
|
if (pageId == null) {
|
|
|
return ResponseJson.error("参数异常: 页面id不能为空!", null);
|
|
|
}
|
|
@@ -375,7 +375,7 @@ public class PageServiceImpl implements PageService {
|
|
|
} else {
|
|
|
setFloorLinkType(floorContent);
|
|
|
List<FloorImageVo> floorImageList = pageMapper.getFloorImageByCentreId(floor.getId(), source);
|
|
|
- setFloorImageProduct(userId, floorImageList, source,flag);
|
|
|
+ setFloorImageProduct(userId, floorImageList, source, flag);
|
|
|
floor.setFloorImageList(floorImageList);
|
|
|
String templateTypeStr = floorContent.getTemplateType();
|
|
|
if (StringUtils.isNotEmpty(templateTypeStr)) {
|
|
@@ -634,7 +634,7 @@ public class PageServiceImpl implements PageService {
|
|
|
double price = product.getPrice() != null ? product.getPrice() : 0d;
|
|
|
double costPrice = product.getCostPrice() != null ? product.getCostPrice() : 0d;
|
|
|
double discountPrice = product.getDiscountPrice() != null ? product.getDiscountPrice() : 0d;
|
|
|
- Integer costFlag = product.getCostCheckFlag();
|
|
|
+ Integer costFlag = product.getCostCheckFlag() != null ? product.getCostCheckFlag() : 1;
|
|
|
// 成本大于等于复购价 或 复购价大于机构价
|
|
|
boolean state = (costFlag == 1 && MathUtil.compare(costPrice, discountPrice) >= 0) || MathUtil.compare(discountPrice, price) > 0;
|
|
|
product.setRepurchasePriceState(state);
|
|
@@ -1145,13 +1145,13 @@ public class PageServiceImpl implements PageService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseJson<Map<String, Object>> getSvipProductPage(Integer userId, Integer source, Integer pageNum, Integer pageSize,Integer flag) {
|
|
|
+ public ResponseJson<Map<String, Object>> getSvipProductPage(Integer userId, Integer source, Integer pageNum, Integer pageSize, Integer flag) {
|
|
|
Map<String, Object> svipProductPageData = new HashMap<>(2);
|
|
|
String adsImage = pageMapper.getSvipProductAdsImage(userId, source);
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
List<ProductItemVo> svipProductList = pageMapper.getSvipProductList();
|
|
|
svipProductList.forEach(svipProduct -> {
|
|
|
- priceUtilService.setProductDetails(userId, svipProduct,flag);
|
|
|
+ priceUtilService.setProductDetails(userId, svipProduct, flag);
|
|
|
svipProduct.setImage(ImageUtils.getImageURL("product", svipProduct.getImage(), 0, domain));
|
|
|
});
|
|
|
PaginationVo<ProductItemVo> svipProductPage = new PaginationVo<>(svipProductList);
|
|
@@ -1172,4 +1172,26 @@ public class PageServiceImpl implements PageService {
|
|
|
product.setMainImage(ImageUtils.getImageURL("product", product.getMainImage(), 0, domain));
|
|
|
return ResponseJson.success(product);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseJson<AuthProductVo> getAuthProductDetails(Integer productId) {
|
|
|
+ AuthProductVo authProduct = pageMapper.getAuthProductByProductId(productId);
|
|
|
+ if (null == authProduct) {
|
|
|
+ return ResponseJson.error("商品不存在", null);
|
|
|
+ }
|
|
|
+ // 代理声明文件
|
|
|
+ if (null != authProduct.getStatementType() && authProduct.getStatementType() == 4) {
|
|
|
+ StatementFileVo statementFile = pageMapper.getStatementFile(authProduct.getAuthUserId(), authProduct.getBrandId());
|
|
|
+ OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
|
|
|
+ // 设置URL过期时间为1个小时
|
|
|
+ Date expiration = new Date(System.currentTimeMillis() + 3600L * 1000);
|
|
|
+ String url = ossClient.generatePresignedUrl(bucketName, active + "/authFile/" + statementFile.getOssName(), expiration).toString();
|
|
|
+ statementFile.setUrl(url);
|
|
|
+ ossClient.shutdown();
|
|
|
+ authProduct.setStatementFile(statementFile);
|
|
|
+ }
|
|
|
+ // 商品参数
|
|
|
+ authProduct.setParamList(pageMapper.getAuthProductParams(productId));
|
|
|
+ return ResponseJson.success(authProduct);
|
|
|
+ }
|
|
|
}
|