|
|
@@ -3,8 +3,10 @@ package com.uas.platform.b2c.prod.product.brand.service.impl;
|
|
|
import com.uas.platform.b2c.core.utils.PinyinUtils;
|
|
|
import com.uas.platform.b2c.prod.product.brand.dao.BrandDao;
|
|
|
import com.uas.platform.b2c.prod.product.brand.dao.BrandInfoDao;
|
|
|
+import com.uas.platform.b2c.prod.product.brand.dao.BrandMostSimpleInfoDao;
|
|
|
import com.uas.platform.b2c.prod.product.brand.modal.Brand;
|
|
|
import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
|
|
|
+import com.uas.platform.b2c.prod.product.brand.modal.BrandMostSimpleInfo;
|
|
|
import com.uas.platform.b2c.prod.product.brand.modal.BrandVersion;
|
|
|
import com.uas.platform.b2c.prod.product.brand.service.BrandService;
|
|
|
import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
|
|
|
@@ -44,6 +46,9 @@ public class BrandServiceImpl implements BrandService {
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BrandMostSimpleInfoDao brandMostSimpleInfoDao;
|
|
|
+
|
|
|
@Override
|
|
|
public List<Brand> init(List<Brand> brands) {
|
|
|
return brandDao.save(brands);
|
|
|
@@ -95,17 +100,17 @@ public class BrandServiceImpl implements BrandService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, List<BrandInfo>> getInitialSimpleInfo(String keyword) {
|
|
|
- Map<String, List<BrandInfo>> map = new HashMap<String, List<BrandInfo>>();
|
|
|
+ public Map<String, List<BrandMostSimpleInfo>> getInitialSimpleInfo(String keyword) {
|
|
|
+ Map<String, List<BrandMostSimpleInfo>> map = new HashMap<String, List<BrandMostSimpleInfo>>();
|
|
|
if ("0~9".equals(keyword)) {
|
|
|
String[] initals = new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
|
|
|
- List<BrandInfo> brandInfos = brandInfoDao.findInInitals(initals);
|
|
|
+ List<BrandMostSimpleInfo> brandInfos = brandMostSimpleInfoDao.findInInitals(initals);
|
|
|
map.put(keyword, brandInfos);
|
|
|
} else {
|
|
|
char[] initals = keyword.toCharArray();
|
|
|
for (char inital : initals) {
|
|
|
String str = String.valueOf(inital).toUpperCase();
|
|
|
- List<BrandInfo> brandInfos = brandInfoDao.findInInitals(new String[]{str});
|
|
|
+ List<BrandMostSimpleInfo> brandInfos = brandMostSimpleInfoDao.findInInitals(new String[]{str});
|
|
|
map.put(str, brandInfos);
|
|
|
}
|
|
|
}
|