|
|
|
@@ -1297,7 +1297,7 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
@Override |
|
|
|
public Map<String, Object> queryOrderSummary(String tenantId) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
queryMerchantCount(tenantId, result); |
|
|
|
queryOrderCount(tenantId, result); |
|
|
|
queryOrderSummary(tenantId, result); |
|
|
|
return result; |
|
|
|
} |
|
|
|
@@ -1409,6 +1409,57 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void queryOrderCount(String tenantId, Map<String, Object> result) { |
|
|
|
String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); |
|
|
|
//总数 |
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
String thirtyTime = DateUtils.getTimeBefore(29, new Date()); |
|
|
|
params.put("startdate", thirtyTime + " 00:00:00"); |
|
|
|
params.put("enddate", systemTime + " 23:59:59"); |
|
|
|
params.put("order_status", "1"); |
|
|
|
Long allPayOrderCount = wxOrderMapper.queryOrderForCount(params); |
|
|
|
params.put("order_status", "4"); |
|
|
|
Long allRefundOrderCount = wxOrderMapper.queryOrderForCount(params); |
|
|
|
result.put("allRefundOrderCount", allRefundOrderCount); |
|
|
|
Long allOrderSummary = allPayOrderCount - allRefundOrderCount; |
|
|
|
result.put("allOrderCount", allPayOrderCount); |
|
|
|
//今日 |
|
|
|
params.put("startdate", systemTime + " 00:00:00"); |
|
|
|
params.put("enddate", systemTime + " 23:59:59"); |
|
|
|
Long todayOrderCount = wxOrderMapper.queryOrderForCount(params); |
|
|
|
result.put("todayOrderCount", todayOrderCount); |
|
|
|
//昨日 |
|
|
|
String yesterday = DateUtils.getTimeBefore(1, new Date()); |
|
|
|
params.put("startdate", yesterday + " 00:00:00"); |
|
|
|
params.put("enddate", yesterday + " 23:59:59"); |
|
|
|
Long yesterdayOrderCount = wxOrderMapper.queryOrderForCount(params); |
|
|
|
result.put("yesterdayOrderCount", yesterdayOrderCount); |
|
|
|
//上周 |
|
|
|
String lastweek = DateUtils.getTimeBefore(7, new Date()); |
|
|
|
params.put("startdate", lastweek + " 00:00:00"); |
|
|
|
params.put("enddate", lastweek + " 23:59:59"); |
|
|
|
Long lastweekOrderCount = wxOrderMapper.queryOrderForCount(params); |
|
|
|
|
|
|
|
result.put("lastweekOrderCount", lastweekOrderCount); |
|
|
|
//订单数日环比 |
|
|
|
if (yesterdayOrderCount > 0) { |
|
|
|
double hbd = (double) (yesterdayOrderCount - yesterdayOrderCount) / yesterdayOrderCount * 100; |
|
|
|
double hb = new BigDecimal(hbd).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
result.put("increasedPercentCount", hb + "%"); |
|
|
|
} else { |
|
|
|
result.put("increasedPercentCount", "--"); |
|
|
|
} |
|
|
|
//订单数周同比 |
|
|
|
if (lastweekOrderCount > 0) { |
|
|
|
double hbd = (double) (yesterdayOrderCount - lastweekOrderCount) / lastweekOrderCount * 100; |
|
|
|
double hb = new BigDecimal(hbd).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
result.put("increasedPercentWeekCount", hb + "%"); |
|
|
|
} else { |
|
|
|
result.put("increasedPercentWeekCount", "--"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 砍价 |
|
|
|
*/ |
|
|
|
|