Commit 934abb6c authored by chang20170705's avatar chang20170705
parents 00cdc83f 672e70b2
......@@ -60,10 +60,11 @@ public class BrandController {
Page page = new Page();
page.setIndex(Long.valueOf(index));
page.setLimit(Long.valueOf(limit));
page.setLimitKey("BannerID asc");
page.setLimitKey("BannerID desc");
List<Map<String, Object>> detailList = brandService.listBanner(param, page);
return Rjx.jsonOk().set("list", detailList).setPage(page).toString();
// return Rjx.jsonOk().set("list", detailList).setPage(page).toString();
return Rjx.jsonOk().set("list", detailList).toString();
}
@ApiOperation("品牌列表接口按首字母")
......
......@@ -36,8 +36,6 @@ public class GoodsController {
@ApiImplicitParam(paramType = "query", name = "UserNO", dataType = "String", required = false, value = "用户编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "CompNO", dataType = "String", required = true, value = "组件编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = false, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "index", dataType = "int", required = true, value = "页码", defaultValue = "1"),
@ApiImplicitParam(paramType = "query", name = "limit", dataType = "int", required = true, value = "每页显示数", defaultValue = "10"),
})
@RequestMapping(value = "/thinkLike",method=RequestMethod.GET)
public String thinkLike(HttpServletRequest request) {
......@@ -54,8 +52,8 @@ public class GoodsController {
userNO = "nouserNO";
}
String langId = request.getParameter("LangID");
String index = request.getParameter("index");
String limit = request.getParameter("limit");
String index = "20";
String limit = "1";
if(!StringUtil.isNotEmpty(orgNO,compNO,limit,index)) {
return Rjx.json().setCode(-1).setMessage("参数缺失").toJson();
......@@ -69,6 +67,7 @@ public class GoodsController {
Page page = new Page();
page.setIndex(Long.valueOf(index));
page.setLimit(Long.valueOf(limit));
page.setLimitKey("SaleQty desc");
List<Map<String, Object>> detailList = goodsService.listThinkLike(param, page);
return Rjx.jsonOk().set("list", detailList).setPage(page).toString();
......
......@@ -35,7 +35,7 @@ public class GoodsServiceImpl implements GoodsService {
Date date = new Date(cal.getTime().getTime());
String beginDate = DateUtil.format(date);
String endDate = DateUtil.format(new Date());
String sql = "select TOP 20 a.nGoodsID GoodsID, g.sGoodsNO GoodsNO, g.sGoodsDesc GoodsName, acg.nSalePrice Price, acg.sSpec Spec, acg.sUnit Unit, acg.nMinSaleQty MinQty, "
String sql = "select a.nGoodsID GoodsID, g.sGoodsNO GoodsNO, g.sGoodsDesc GoodsName, acg.nSalePrice Price, acg.sSpec Spec, acg.sUnit Unit, acg.nMinSaleQty MinQty, "
+ " acg.nSaleUnits SaleUnit, acg.nMarketPrice MarketPrice, sum(a.nSaleQty) SaleQty from tAgentGoodsDailyOnline a join tGoods g on a.nGoodsID = g.nGoodsID "
+ " join tAgentContractGoods acg on a.sAgentContractNO = acg.sAgentContractNO and a.nGoodsID = acg.nGoodsID ";
if(!userNO.equals("nouserNO")&&!StringUtil.isEmpty(userNO)) {
......@@ -44,8 +44,7 @@ public class GoodsServiceImpl implements GoodsService {
}else {
sql += " where acg.sOrgNO = '" + orgNO + "' and a.dTradeDate >= '" + beginDate + "' and a.dTradeDate < '" + endDate +"'";
}
sql += " group by a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, acg.nSalePrice, acg.sSpec, acg.sUnit, acg.nMinSaleQty, acg.nSaleUnits, acg.nMarketPrice, acg.sMarketUnit order by "
+ " sum(a.nSaleQty) desc";
sql += " group by a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, acg.nSalePrice, acg.sSpec, acg.sUnit, acg.nMinSaleQty, acg.nSaleUnits, acg.nMarketPrice, acg.sMarketUnit";
return jdbcTemplate.limit(sql, page);
}
......
......@@ -23,9 +23,9 @@ spring.datasource.timeBetweenEvictionRunsMillis=3600000
spring.redis.database=0
spring.redis.host=ossip.cn
spring.redis.host=10.10.0.15
spring.redis.port=6379
spring.redis.password=@8UiMqvDtNgv
spring.redis.password=
spring.redis.timeout=2000
spring.redis.pool.max-active=20
spring.redis.pool.max-wait=2000
......
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