|
@@ -22,9 +22,7 @@ import java.time.Duration;
|
|
import java.time.Instant;
|
|
import java.time.Instant;
|
|
import java.time.ZoneId;
|
|
import java.time.ZoneId;
|
|
import java.time.ZonedDateTime;
|
|
import java.time.ZonedDateTime;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class OrderInfoService {
|
|
public class OrderInfoService {
|
|
@@ -310,4 +308,57 @@ public class OrderInfoService {
|
|
orderInfoDao.updateStatus(info);
|
|
orderInfoDao.updateStatus(info);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 服务数据
|
|
|
|
+ */
|
|
|
|
+ private Map<String, Object> countTotalFee(OrderInfo orderInfo) {
|
|
|
|
+ Map<String, BigDecimal> totalFee = orderInfoDao.countTotalFee(orderInfo);
|
|
|
|
+ Map<String, Integer> invoiceContractMap = orderInfoDao.countInvoiceContract(orderInfo);
|
|
|
|
+ Map<String, Object> m = new HashMap<>();
|
|
|
|
+ m.put("orders", totalFee.get("sumIds"));
|
|
|
|
+ m.put("totalFee", totalFee.get("sumTotalFee"));
|
|
|
|
+ m.put("contract", invoiceContractMap.get("contracts"));
|
|
|
|
+ m.put("invoice", invoiceContractMap.get("invoices"));
|
|
|
|
+ return m;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public Map<String, Object> count(long organizationId) {
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ OrderInfo o1 = new OrderInfo();
|
|
|
|
+ o1.setOrganizationId(organizationId);
|
|
|
|
+ map.put("organization", countTotalFee(o1));
|
|
|
|
+ OrderInfo o2 = new OrderInfo();
|
|
|
|
+ o2.setPayOrganizationId(organizationId);
|
|
|
|
+ map.put("payOrganization", countTotalFee(o2));
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 订单统计
|
|
|
|
+ */
|
|
|
|
+ public Map<String, Object> countOrder(long organizationId, String startTime, String endTime) {
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ OrderInfo o1 = new OrderInfo();
|
|
|
|
+ o1.setOrganizationId(organizationId);
|
|
|
|
+ map.put("organization", orderInfoDao.countOrder(o1, startTime, endTime));
|
|
|
|
+ OrderInfo o2 = new OrderInfo();
|
|
|
|
+ o2.setPayOrganizationId(organizationId);
|
|
|
|
+ map.put("payOrganization", orderInfoDao.countOrder(o2, startTime, endTime));
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 购买排行
|
|
|
|
+ */
|
|
|
|
+ public Map<String, Object> countPay(long organizationId) {
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ OrderInfo o1 = new OrderInfo();
|
|
|
|
+ o1.setOrganizationId(organizationId);
|
|
|
|
+ map.put("organization", orderInfoDao.countPay(o1));
|
|
|
|
+ OrderInfo o2 = new OrderInfo();
|
|
|
|
+ o2.setPayOrganizationId(organizationId);
|
|
|
|
+ map.put("payOrganization", orderInfoDao.countPay(o2));
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|