|
|
@@ -2,6 +2,7 @@ package com.uas.platform.b2c.prod.product.common.api;
|
|
|
|
|
|
import com.uas.platform.b2c.prod.product.common.model.CommonCount;
|
|
|
import com.uas.platform.b2c.prod.product.common.service.CommonCountService;
|
|
|
+import com.uas.platform.b2c.trade.vendor.service.VendorIntroductionService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
@@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -24,6 +26,9 @@ public class CommonCountController {
|
|
|
@Autowired
|
|
|
private CommonCountService commonCountService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private VendorIntroductionService vendorIntroductionService;
|
|
|
+
|
|
|
/**
|
|
|
* 获取已激活的通用计数器
|
|
|
* @return
|
|
|
@@ -73,4 +78,24 @@ public class CommonCountController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取B2C首页悬浮框的计数器
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(method = RequestMethod.GET)
|
|
|
+ public List<CommonCount> findActivedCount() {
|
|
|
+ List<CommonCount> commonCounts = new ArrayList<>();
|
|
|
+ List<CommonCount> indexCounts = commonCountService.findByStatus((short) 1, "b2c_index" );
|
|
|
+ List<CommonCount> bannerCounts = commonCountService.findByStatus((short) 1, "mall_home_banner" );
|
|
|
+ Integer enCount = vendorIntroductionService.getVendorCount();
|
|
|
+ commonCounts.addAll(indexCounts);
|
|
|
+ commonCounts.addAll(bannerCounts);
|
|
|
+ CommonCount commonCount = new CommonCount();
|
|
|
+ commonCount.setItem("供应商数量");
|
|
|
+ commonCount.setCount(Double.valueOf(enCount));
|
|
|
+ commonCount.setUsedFor("b2c_index");
|
|
|
+ commonCounts.add(commonCount);
|
|
|
+ return commonCounts;
|
|
|
+ }
|
|
|
+
|
|
|
}
|