Commit 66443abd authored by Quxl's avatar Quxl

x

parent 394245b5
......@@ -40,8 +40,8 @@ public class CartController {
@RequestMapping(value = "/getCartCount",method=RequestMethod.GET)
public String cartQuery(String orgNo, String shopNo) {
Integer count = cartService.count(orgNo, shopNo);
return Rjx.jsonOk().set("count", count).toJson();
Map<String, Object> map = cartService.count(orgNo, shopNo);
return Rjx.jsonOk().set("count", map.get("totalCount")).set("qty", map.get("totalSaleQty")).toJson();
}
......
......@@ -14,7 +14,7 @@ public interface CartService {
public String query (Map<String,Object> params);
public Integer count(String orgNo, String shopNO);
public Map<String, Object> count(String orgNo, String shopNO);
public void clear(String orgNo, String shopNo);
}
......@@ -92,8 +92,8 @@ public class CartServiceImpl implements CartService {
* @return: Integer
* @throws
*/
public Integer count(String orgNo, String shopNO) {
return jdbcTemplate.queryForInt("select count(1) from V_Cart where sOrgNO = '" + orgNo + "' and sShopNO = '" + shopNO + "'");
public Map<String, Object> count(String orgNo, String shopNO) {
return jdbcTemplate.queryForMap("select count(nSaleQty) totalCount , sum(nSaleQty) totalSaleQty from V_Cart where sOrgNO = '" + orgNo + "' and sShopNO = '" + shopNO + "'");
}
......@@ -179,8 +179,9 @@ public class CartServiceImpl implements CartService {
String orgNo = (String)params.get("orgNo");
String shopNO = params.get("shopNO")+"";
String terminal = params.get("terminal")+"";
Map<String, Object> queryMap = cartRedisService.querySync(orgNo, shopNO, terminal);
Map<String, Object> countMap = this.count(orgNo, shopNO);
queryMap.putAll(countMap);
return Rjx.jsonOk().setData(queryMap).toJson();
}
......
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