|
|
@@ -9,6 +9,8 @@ import com.uas.platform.b2c.core.constant.IntegerConstant;
|
|
|
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;
|
|
|
@@ -39,6 +41,9 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
|
|
|
@Autowired
|
|
|
private EnterpriseDao enterpriseDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StoreInDao storeInDao;
|
|
|
+
|
|
|
/**
|
|
|
* 类目
|
|
|
*/
|
|
|
@@ -159,7 +164,15 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
|
|
|
if (pageable == null) {
|
|
|
return null;
|
|
|
}
|
|
|
- return enterpriseDao.findAll(pageable);
|
|
|
+ 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;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -176,7 +189,7 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
|
|
|
// 查询所有符合条件的enUU的语句,按待售物料数量排序
|
|
|
String enUUSql = getEnUUGroupByEnUUOrderByCount(enUU, enterpriseCondition, productCondition);
|
|
|
// 获取企业sql
|
|
|
- enterpriseSql.append("select en.en_uu enUU, en.en_name enName, en.en_shortname enShortname, en.en_address enAddress, en.en_tel enTel, " +
|
|
|
+ enterpriseSql.append("select en.en_uu enUU, en.en_name enName, en.en_shortname enShortname, st.st_logo_url storeLogoUrl, en.en_logurl enLogoUrl, en.en_address enAddress, en.en_tel enTel, " +
|
|
|
" en.en_email enEmail, en.en_corporation enCorporation, en.en_businesscode enBusinesscode, en.en_industry enIndustry, en.en_Businessscope enBusinessScope " +
|
|
|
",st.st_uuid,st.st_status from sec$enterprises en left join store$info st on st.st_enuu = en.en_uu right join (").append(enUUSql)
|
|
|
.append(" ) a on en.en_uu = a.en_uu order by en.en_weight desc, counts desc");
|
|
|
@@ -202,7 +215,7 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
|
|
|
private List<VendorIntroduction> getEnterpriseWithoutProductCondition(Long enUU, String enterpriseCondition, int page, int size) {
|
|
|
StringBuilder enterpriseSql = new StringBuilder();
|
|
|
// 获取企业sql
|
|
|
- enterpriseSql.append("select en.en_uu enUU, en.en_name enName, en.en_shortname enShortname, en.en_address enAddress, en.en_tel enTel, " +
|
|
|
+ enterpriseSql.append("select en.en_uu enUU, en.en_name enName, en.en_shortname enShortname, st.st_logo_url storeLogoUrl, en.en_logurl enLogoUrl, en.en_address enAddress, en.en_tel enTel, " +
|
|
|
"en.en_email enEmail, en.en_corporation enCorporation, en.en_businesscode enBusinesscode, en.en_industry enIndustry, en.en_Businessscope enBusinessScope " +
|
|
|
",st.st_enuu,st.st_status from sec$enterprises en left join store$info st on st.st_enuu = en.en_uu where en_name not like '%测试%' and en_name not like '%test%' " +
|
|
|
"and (length(en_businesscode) > 12 or en_name like '%香港%' or en_name like '%HONG KONG%' or en_area like '%香港%') and " +
|