|
|
@@ -9,7 +9,6 @@ import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.b2c.prod.commodity.dao.V_ProductPrivateDao;
|
|
|
import com.uas.platform.b2c.prod.commodity.model.V_ProductPrivate;
|
|
|
import com.uas.platform.b2c.prod.store.dao.StoreInDao;
|
|
|
-import com.uas.platform.b2c.prod.store.model.StoreIn;
|
|
|
import com.uas.platform.b2c.trade.vendor.model.VendorIntroduction;
|
|
|
import com.uas.platform.b2c.trade.vendor.service.VendorIntroductionService;
|
|
|
import com.uas.ps.core.util.CollectionUtils;
|
|
|
@@ -160,19 +159,14 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public org.springframework.data.domain.Page<Enterprise> getRecommendVendor(Pageable pageable) {
|
|
|
+ public Page<Enterprise> getRecommendVendor(Pageable pageable) {
|
|
|
if (pageable == null) {
|
|
|
return null;
|
|
|
}
|
|
|
- org.springframework.data.domain.Page<Enterprise> enterprisePage = enterpriseDao.findAll(pageable);
|
|
|
- for (Enterprise enterprise : enterprisePage.getContent()) {
|
|
|
- List<StoreIn> stores = storeInDao.findByEnUU(enterprise.getUu());
|
|
|
- if (!CollectionUtils.isEmpty(stores) && !StringUtils.isEmpty(stores.get(0).getLogoUrl())) {
|
|
|
- // 此处仅方便前端展示
|
|
|
- enterprise.setEnLogoUrl(stores.get(0).getLogoUrl());
|
|
|
- }
|
|
|
- }
|
|
|
- return enterprisePage;
|
|
|
+ String sql = "select en_uu uu,en_name enName,st_logo_url enLogoUrl,en_prodcount prodCount, en_mallvendorstatus enMallVendorStatus, en_saasstatus enSaasStatus from sec$enterprises right join store$info on st_enuu = en_uu " +
|
|
|
+ "where st_uuid is not null and st_status = 'OPENED' order by en_prodcount desc limit " + pageable.getPageNumber() * pageable.getPageSize() + "," + pageable.getPageSize();
|
|
|
+ List<Enterprise> enterprises = commonDao.query(sql, Enterprise.class);
|
|
|
+ return new Page<>(pageable.getPageNumber(), pageable.getPageSize(), enterprises, enterprises.size() * pageable.getPageNumber());
|
|
|
}
|
|
|
|
|
|
/**
|