Commit 90acc23e authored by 张永's avatar 张永

1

parent a1259093
......@@ -49,6 +49,31 @@ public class CartQueryServiceImpl implements CartQueryService {
throw new ReflectException("Query the shopping cart parameter error:"
+ Rjx.json().set("terminal", terminal).set("shopNo", shopNo).jsonValue());
}
List<Map<String, Object>> orderSumPayList = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> wmsSumPayList = new ArrayList<Map<String, Object>>();
Map<String,Object> orderSumPayMap = new HashMap<String,Object>(); //订单汇总
try {
String sql = "exec up_B2BGetSumCart '" + shopNo + "',1 ";
List<List<Map<String, Object>>> cartList = jdbcTemplate.executeMutil(sql).getDatas();
orderSumPayList = cartList.get(0); //按订单汇总的
if(orderSumPayList != null && orderSumPayList.size()>0) {
orderSumPayMap = orderSumPayList.get(0);
String Status = orderSumPayMap.get("Status")+"";
if(!Status.equals("0")) { //它错,就全错。
String ErrorMsg = orderSumPayMap.get("ErrorMsg")+"";
Rjx errRjx = Rjx.json().set("IsValid", false).set("errormsg", ErrorMsg);
return errRjx;
}
}
wmsSumPayList = cartList.get(1); //按仓库汇总
} catch (Exception e1) {
e1.printStackTrace();
}
List<Map<String, Object>> datas = this.getGoodsList(orgNo, shopNo, terminal);
System.out.println("datas: " + GsonUtil.toJson(datas));
Set<String> chooseGroups = new HashSet<String>();
......@@ -126,32 +151,21 @@ public class CartQueryServiceImpl implements CartQueryService {
rjx.set("isInvalid", isInvalid);
//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); //按订单汇总的
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("TotalSaleAmount")); //没写错,韩 旭让写的
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;
}
try {
if(!orderSumPayMap.isEmpty()) { //重新设置汇总金额
rjx.set("totalAmount", orderSumPayMap.get("TotalSaleAmount")); //没写错,韩 旭让写的
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"));
}
wmsSumPayList = jdbcTemplate.executeMutil(sql).getDatas().get(1); //按仓库汇总
List<Map<String, Object>> rjxWmsList = (List<Map<String, Object>>)rjx.get("wmsList");
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) {
Object freightamount = wmsMap.get("TotalSaleQty");
......
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