admin
2019-01-11 13ec337a0d24485d9f006cfd44ea5d69c00540f3
fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java
@@ -94,8 +94,11 @@
      
      try {
         long count = 0;
         int totalValid = 0;
         int totalProces = 0;
         int totalInvite = 0;
         long todayTotal = 0;
         BigDecimal todayMoney = new BigDecimal(0.00);
         BigDecimal todayMoney = null;
         
         // 查询列表
         List<CommonOrderVO> list = commonOrderService.getOrderByUid(page, uid, state, type, orderState,
@@ -109,26 +112,12 @@
         
         // 需要统计筛选信息 :未失效的总金额 以及订单
         if (needCount && page == 1) {
            Map<String, Object> countMap = commonOrderService.countMoneyGroupOrderNoByUid(uid, type,
                  orderNo, startTime, endTime, dateType);
            if (countMap != null) {
               BigDecimal totalMoney = (BigDecimal) countMap.get("totalMoney");
               if (totalMoney != null) {
                  todayMoney = totalMoney;// 当前查询所有订单已到账总金额
               }
               //当前查询所有已到账订单数量
               todayTotal  = (long) countMap.get("totalRow");
            }
         }
         int totalValid = 0;
         int totalProces = 0;
         int totalInvite = 0;
         // 需要统计信息
         if (needCount && page == 1) {
            todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime);
            todayTotal =  commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime);
            // 统计有效的订单数量 、 失效订单数量 、维权订单数量
            Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type, 
                  startTime, endTime, dateType);
            
@@ -144,7 +133,12 @@
               totalInvite = countOrder.get("totalInvite").intValue();
            }   
         }
         if (todayMoney == null) {
            todayMoney = new BigDecimal(0.00);
         }
         String helpUrl = configService.get("order_list_help");
         
         JSONObject data = new JSONObject();
@@ -204,7 +198,7 @@
         data.put("userInfo", userInfo);
         
         /* 总订单统计   */
         Map<String, BigDecimal> countOrder= commonOrderService.countOrderByHongBaoType(uid, null);
         Map<String, BigDecimal> countOrder= commonOrderService.countHistoryOrder(uid, null);
         int self = 0;
         if (countOrder.get("totalSelf") != null) {
            self = countOrder.get("totalSelf").intValue();
@@ -228,7 +222,7 @@
         data.put("invite", invite);
         
         /*  今日订单统计  */
         Map<String, BigDecimal> countToday= commonOrderService.countOrderByHongBaoType(uid, 1);
         Map<String, BigDecimal> countToday= commonOrderService.countHistoryOrder(uid, 1);
         
         int todaySelf = 0;
         if (countToday.get("totalSelf") != null) {
@@ -256,7 +250,7 @@
         data.put("today", todaydata);
         
         /*  昨日订单统计   */
         Map<String, BigDecimal> countYesterday= commonOrderService.countOrderByHongBaoType(uid, 2);
         Map<String, BigDecimal> countYesterday= commonOrderService.countHistoryOrder(uid, 2);
         int yesterdaySelf = 0;
         if (countYesterday.get("totalSelf") != null) {
            yesterdaySelf = countYesterday.get("totalSelf").intValue();
@@ -306,12 +300,15 @@
         
         JSONObject data = new JSONObject();
         // 分享统计
         BigDecimal sharemoney = commonOrderService.countOrderMoney(uid,2, dateType);
         data.put("shareCount", commonOrderService.countOrder(uid, 2, dateType));
         BigDecimal sharemoney = commonOrderService.countBonusOrderMoney(uid,2, dateType, null, null);
         data.put("shareCount", commonOrderService.countBonusOrderNumber(uid, 2, dateType, null, null));
         data.put("sharemoney", sharemoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
         // 邀请统计
         BigDecimal inviteMoney = commonOrderService.countOrderMoney(uid,3, dateType);
         data.put("inviteCount", commonOrderService.countOrder(uid, 3, dateType));
         BigDecimal inviteMoney = commonOrderService.countBonusOrderMoney(uid,3, dateType, null, null);
         data.put("inviteCount", commonOrderService.countBonusOrderNumber(uid, 3, dateType, null, null));
         data.put("inviteMoney", inviteMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
         
         data.put("showTiCheng", hongBaoService.getTotalTiChengCount(uid) > 0);