Commit b33ba441 authored by 黄毅's avatar 黄毅

1

parent e732219a
...@@ -36,8 +36,6 @@ public class GoodsController { ...@@ -36,8 +36,6 @@ public class GoodsController {
@ApiImplicitParam(paramType = "query", name = "UserNO", dataType = "String", required = false, value = "用户编号", defaultValue = ""), @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 = "CompNO", dataType = "String", required = true, value = "组件编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = false, value = "语言", defaultValue = "936"), @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) @RequestMapping(value = "/thinkLike",method=RequestMethod.GET)
public String thinkLike(HttpServletRequest request) { public String thinkLike(HttpServletRequest request) {
...@@ -54,8 +52,8 @@ public class GoodsController { ...@@ -54,8 +52,8 @@ public class GoodsController {
userNO = "nouserNO"; userNO = "nouserNO";
} }
String langId = request.getParameter("LangID"); String langId = request.getParameter("LangID");
String index = request.getParameter("index"); String index = "20";
String limit = request.getParameter("limit"); String limit = "1";
if(!StringUtil.isNotEmpty(orgNO,compNO,limit,index)) { if(!StringUtil.isNotEmpty(orgNO,compNO,limit,index)) {
return Rjx.json().setCode(-1).setMessage("参数缺失").toJson(); return Rjx.json().setCode(-1).setMessage("参数缺失").toJson();
...@@ -69,6 +67,7 @@ public class GoodsController { ...@@ -69,6 +67,7 @@ public class GoodsController {
Page page = new Page(); Page page = new Page();
page.setIndex(Long.valueOf(index)); page.setIndex(Long.valueOf(index));
page.setLimit(Long.valueOf(limit)); page.setLimit(Long.valueOf(limit));
page.setLimitKey("SaleQty desc");
List<Map<String, Object>> detailList = goodsService.listThinkLike(param, page); List<Map<String, Object>> detailList = goodsService.listThinkLike(param, page);
return Rjx.jsonOk().set("list", detailList).setPage(page).toString(); return Rjx.jsonOk().set("list", detailList).setPage(page).toString();
......
...@@ -35,7 +35,7 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -35,7 +35,7 @@ public class GoodsServiceImpl implements GoodsService {
Date date = new Date(cal.getTime().getTime()); Date date = new Date(cal.getTime().getTime());
String beginDate = DateUtil.format(date); String beginDate = DateUtil.format(date);
String endDate = DateUtil.format(new 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 " + " 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 "; + " join tAgentContractGoods acg on a.sAgentContractNO = acg.sAgentContractNO and a.nGoodsID = acg.nGoodsID ";
if(!userNO.equals("nouserNO")&&!StringUtil.isEmpty(userNO)) { if(!userNO.equals("nouserNO")&&!StringUtil.isEmpty(userNO)) {
...@@ -44,8 +44,7 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -44,8 +44,7 @@ public class GoodsServiceImpl implements GoodsService {
}else { }else {
sql += " where acg.sOrgNO = '" + orgNO + "' and a.dTradeDate >= '" + beginDate + "' and a.dTradeDate < '" + endDate +"'"; 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 " sql += " group by a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, acg.nSalePrice, acg.sSpec, acg.sUnit, acg.nMinSaleQty, acg.nSaleUnits, acg.nMarketPrice, acg.sMarketUnit";
+ " sum(a.nSaleQty) desc";
return jdbcTemplate.limit(sql, page); return jdbcTemplate.limit(sql, page);
} }
......
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