Commit fe7fb930 authored by 张永's avatar 张永

修改购物车查询

parent cbb45ef6
......@@ -87,7 +87,6 @@ public class CartQueryServiceImpl implements CartQueryService {
}
}
List<Map<String, Object>> wmsList = getWmsList(datas,shopNo);
Util.replaceKey(datas, ":", false, "sShopNO:shopNo", "sAgentContractNO:contractNo", "nGoodsID:goodsId",
"sGoodsDesc:goodsName", "nSaleQty:saleQty", "sPromoPaperNO:promoNo",
"sPromoActionTypeID:promoTypeId", "nMinSaleQty:minOrderQty", "sUnit:priceUnit",
......@@ -125,7 +124,60 @@ public class CartQueryServiceImpl implements CartQueryService {
rjx.set("promoData", Util.listToMM(promos, "promoNo"));
rjx.set("isOrnament", isOrnament);
rjx.set("isInvalid", isInvalid);
this.processPayAmount(rjx);
//this.processPayAmount(rjx);
List<Map<String, Object>> orderSumPayList = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> wmsSumPayList = new ArrayList<Map<String, Object>>();
try {
String sql = "exec up_B2BGetSumCart '" + shopNo + "',1 "; //计算汇总
orderSumPayList = jdbcTemplate.executeMutil(sql).getDatas().get(0); //按订单汇总的
wmsSumPayList = jdbcTemplate.executeMutil(sql).getDatas().get(1); //按仓库汇总
if(orderSumPayList != null && orderSumPayList.size()>0) {
Map<String,Object> orderSumPayMap = orderSumPayList.get(0);
String Status = orderSumPayMap.get("Status")+"";
if(Status.equals("0")) {
rjx.set("totalAmount", orderSumPayMap.get("TotalAmount"));
rjx.set("payAmount", orderSumPayMap.get("PayAmount"));
rjx.set("payPoint", orderSumPayMap.containsKey("PayPoint")?orderSumPayMap.get("PayPoint"):0);
rjx.set("totalSaleQty", orderSumPayMap.get("TotalSaleQty"));
rjx.set("totalCount", orderSumPayMap.get("TotalCount"));
rjx.set("totalSaleAmount", orderSumPayMap.get("TotalSaleAmount"));
rjx.set("totalDisAmount", orderSumPayMap.get("TotalDisAmount"));
}else {
String ErrorMsg = orderSumPayMap.get("ErrorMsg")+"";
Rjx errRjx = Rjx.json().set("IsValid", false).set("errormsg", ErrorMsg);
return errRjx;
}
}
List<Map<String, Object>> rjxWmsList = (List<Map<String, Object>>)rjx.get("wmsList");
if(wmsSumPayList != null && rjxWmsList != null && wmsSumPayList.size() >0 && rjxWmsList.size() >0) {
for(Map<String,Object> wmsMap :wmsSumPayList) {
String freightamount = wmsMap.get("TotalSaleQty")+"";
String discountAmount = wmsMap.get("TotalDisAmount")+"";
String totalAmount = wmsMap.get("PayAmount")+"";
String minOrderAmt = wmsMap.get("MinOrderAmount")+"";
String WarehouseNO = wmsMap.get("WarehouseNO")+"";
for(Map<String,Object> rjxWmsMap : rjxWmsList) {
String warehouseNo = rjxWmsMap.get("warehouseNo")+"";
if(WarehouseNO.equals(warehouseNo)) {
rjxWmsMap.put("totalAmount", totalAmount);
rjxWmsMap.put("freightAmount", freightamount);
rjxWmsMap.put("minOrderAmt", minOrderAmt);
rjxWmsMap.put("discountAmount", discountAmount);
break;
}
}
}
rjx.set("wmsList",rjxWmsList);
}
} catch (Exception e) {
e.printStackTrace();
}
return rjx;
}
......@@ -208,6 +260,7 @@ public class CartQueryServiceImpl implements CartQueryService {
private void processPayAmount(Rjx rjx) {
BigDecimal nNeedPayAmount = BigDecimal.ZERO;
BigDecimal nNeedPayPoint = BigDecimal.ZERO;
BigDecimal nTotalAmount = BigDecimal.ZERO;
......
......@@ -194,8 +194,8 @@ public class CartServiceImpl implements CartService {
String shopNO = params.get("shopNO")+"";
String terminal = params.get("terminal")+"";
Map<String, Object> queryMap = cartRedisService.query(orgNo, shopNO, terminal);
Map<String, Object> countMap = this.count(orgNo, shopNO);
queryMap.putAll(countMap);
/*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