Commit 9e13d548 authored by zhangyong's avatar zhangyong
parents 305840d1 616cda9d
......@@ -85,21 +85,21 @@ public class BrandController {
Map<String,List> pinMap=new HashMap<>();
for(Map<String,Object> item:listMap) {
String first=((String)item.get("PinyinCode")).substring(0, 1).toUpperCase();
Map<String,String> BrandList=new HashMap<>();
BrandList.put("BrandNO", (String)item.get("BrandNO"));
BrandList.put("BrandName", (String)item.get("BrandName"));
BrandList.put("ImgPath", (String)item.get("ImgPath"));
Map<String,String> BrandMap=new HashMap<>();
BrandMap.put("BrandNO", (String)item.get("BrandNO"));
BrandMap.put("BrandName", (String)item.get("BrandName"));
BrandMap.put("ImgPath", (String)item.get("ImgPath"));
if(first.matches(reg)) {
if(pinMap.containsKey(first)) {
pinMap.get(first).add(BrandList);
pinMap.get(first).add(BrandMap);
}else {
pinMap.put(first, new ArrayList() {{add(BrandList);}});
pinMap.put(first, new ArrayList<Map>() {{add(BrandMap);}});
}
}else {
if(pinMap.containsKey("#")) {
pinMap.get("#").add(BrandList);
pinMap.get("#").add(BrandMap);
}else {
pinMap.put("#", new ArrayList() {{add(BrandList);}});
pinMap.put("#", new ArrayList<Map>(){{add(BrandMap);}});
}
}
......@@ -109,7 +109,8 @@ public class BrandController {
for (Entry<String, List> entry : pinMap.entrySet()) {
Map<String,Object> returnMap=new HashMap<>();
returnMap.put("PyCode", entry.getKey());
returnMap.put("BrandList", entry.getValue());
returnMap.put("BrandList", entry.getValue().toArray());
returnList.add(returnMap);
}
return Rjx.jsonOk().set("list", returnList).toJson();
}
......
......@@ -51,7 +51,7 @@ public class BrandServiceImpl implements BrandService {
@Override
public List<Map<String, Object>> getHotSaleBrands(Map<String, Object> map) {
List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
String sql="SELECT "// TOP 20
String sql="SELECT TOP 20 "//
+ "BrandNO = b.sBrandID, "
+ "BrandName = b.sBrandName, "
+ "ImgPath = b.sLogoUrl, "
......@@ -63,7 +63,7 @@ public class BrandServiceImpl implements BrandService {
+ "and a.nGoodsID = acg.nGoodsID "
+ "WHERE acg.sOrgNO = ? "
+ "GROUP BY b.sBrandID, b.sBrandName, b.sLogoUrl "
+ "ORDER BY sum(a.nSaleQty) DESC limit 0,20 ";
+ "ORDER BY sum(a.nSaleQty) DESC ";//limit 0,20
String OrgNO=(String) map.get("OrgNO");
listMap=jdbcTemplate.queryForList(sql, OrgNO);
return listMap;
......
......@@ -51,7 +51,7 @@ public class GoodsServiceImpl implements GoodsService {
@Override
public List<Map<String, Object>> getHotSaleGoods(Map<String, Object> map) {
List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
String sql="SELECT " // TOP 20
String sql="SELECT TOP 20" //
+"GoodsID = a.nGoodsID, "
+"GoodsNO = g.sGoodsNO, "
+"GoodsName = g.sGoodsDesc, "
......@@ -69,7 +69,7 @@ public class GoodsServiceImpl implements GoodsService {
+"WHERE acg.sOrgNO = ? "
+"GROUP BY a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, "
+"acg.nSalePrice, acg.nMinSaleQty, acg.nSaleUnits,acg.sUnit, acg.nMarketPrice, acg.sMarketUnit "
+"ORDER BY sum(a.nSaleQty) DESC limit 0,20";
+"ORDER BY sum(a.nSaleQty) DESC ";//limit 0,20
String OrgNO=(String) map.get("OrgNO");
listMap=jdbcTemplate.queryForList(sql, OrgNO);
return listMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment