| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | |
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoService hongBaoService;
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | | /**
|
| | | * 订单列表
|
| | |
| | |
|
| | | try {
|
| | | if (slotTime != null) {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
| | | endTime= sd.format(new Date());
|
| | | startTime = convertDate(slotTime, endTime);
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
|
| | | endTime= sd.format(new Date());
|
| | | startTime = convertDate(slotTime, endTime);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (endTime != null && endTime.trim().length() > 0) {
|
| | | endTime += " 23:59:59";
|
| | | }
|
| | |
|
| | | try {
|
| | | long count = 0;
|
| | |
| | | int totalInvite = 0;
|
| | | long todayTotal = 0;
|
| | | BigDecimal todayMoney = null;
|
| | | |
| | |
|
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(page, uid, state, type, orderState,
|
| | |
| | | todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime);
|
| | |
|
| | | todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime);
|
| | | |
| | |
|
| | | // 统计有效的订单数量 、 失效订单数量 、维权订单数量
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type,
|
| | |
| | |
|
| | | try {
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | // 分享统计
|
| | | BigDecimal sharemoney = commonOrderService.countBonusOrderMoney(uid,2, dateType, null, null);
|
| | | Object shareCount = 0;
|
| | | BigDecimal sharemoney = new BigDecimal(0.00);
|
| | | Object inviteCount = 0;
|
| | | BigDecimal inviteMoney = new BigDecimal(0.00);
|
| | |
|
| | | data.put("shareCount", commonOrderService.countBonusOrderNumber(uid, 2, dateType, null, null));
|
| | | data.put("sharemoney", sharemoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | Map<String, Object> shareMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 2 , dateType, null, null);
|
| | | if (shareMap != null) {
|
| | | Object totalNum = shareMap.get("totalNum");
|
| | | if (totalNum != null) {
|
| | | shareCount = totalNum;
|
| | | }
|
| | | |
| | | Object totalmoney = shareMap.get("totalmoney");
|
| | | if (totalmoney != null) {
|
| | | sharemoney = (BigDecimal) totalmoney;
|
| | | }
|
| | | }
|
| | |
|
| | | // 邀请统计
|
| | | BigDecimal inviteMoney = commonOrderService.countBonusOrderMoney(uid,3, dateType, null, null);
|
| | | Map<String, Object> inviteMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 3 , dateType, null, null);
|
| | | if (inviteMap != null) {
|
| | | Object totalNum = inviteMap.get("totalNum");
|
| | | if (totalNum != null) {
|
| | | inviteCount = totalNum;
|
| | | }
|
| | | |
| | | Object totalmoney = inviteMap.get("totalmoney");
|
| | | if (totalmoney != null) {
|
| | | inviteMoney = (BigDecimal) totalmoney;
|
| | | }
|
| | | }
|
| | |
|
| | | data.put("inviteCount", commonOrderService.countBonusOrderNumber(uid, 3, dateType, null, null));
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("shareCount", shareCount);
|
| | | data.put("sharemoney", sharemoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("inviteCount", inviteCount);
|
| | | data.put("inviteMoney", inviteMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | data.put("showTiCheng", hongBaoService.getTotalTiChengCount(uid) > 0);
|
| | | |
| | | data.put("showTiCheng", hongBaoV2CountService.getTotalTiChengCount(uid) > 0);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | |
|
| | | switch (slotTime) {
|
| | | case 1: // 最近三天
|
| | | startTime = DateUtil.reduceDay(3, endTime);
|
| | | startTime = DateUtil.reduceDay(2, endTime);
|
| | | break;
|
| | | case 2: // 最近七天
|
| | | startTime = DateUtil.reduceDay(7, endTime);
|
| | | startTime = DateUtil.reduceDay(6, endTime);
|
| | | break;
|
| | | case 3: // 最近15天 (半月)
|
| | | startTime = DateUtil.reduceDay(15, endTime);
|
| | | startTime = DateUtil.reduceDay(14, endTime);
|
| | | break;
|
| | | case 4: // 最近三十天 (本月)
|
| | | startTime = DateUtil.reduceDay(30, endTime);
|
| | | startTime = DateUtil.reduceDay(29, endTime);
|
| | | break;
|
| | | case 5: // 最近九十天(近三月)
|
| | | startTime = DateUtil.reduceDay(3*30, endTime);
|
| | | startTime = DateUtil.reduceDay(3*30-1, endTime);
|
| | | break;
|
| | | case 6: // 最近一百八十天(近半年)
|
| | | startTime = DateUtil.reduceDay(6*30, endTime);
|
| | | startTime = DateUtil.reduceDay(6*30-1, endTime);
|
| | | break;
|
| | | default:
|
| | | break;
|