| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getorder", method = RequestMethod.POST)
|
| | | public void getOrder(AcceptData acceptData, Long page, Long uid, Integer state, Integer type, String orderNo, |
| | | public void getOrder(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, String orderNo, |
| | | String startTime, String endTime, Integer slotTime, boolean needCount, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | |
| | | }
|
| | |
|
| | | if (page == null || page < 1) {
|
| | | page = 1L;
|
| | | page = 1;
|
| | | }
|
| | |
|
| | | if (state !=null && state == 0) {
|
| | |
| | | totalInvite = countOrder.get("totalInvite").intValue();
|
| | | }
|
| | |
|
| | | todayTotal = commonOrderService.countOrder(uid, 1);
|
| | | todayMoney = commonOrderService.countOrderMoney(uid, 1);
|
| | | todayTotal = commonOrderService.countOrder(uid, type, 1);
|
| | | todayMoney = commonOrderService.countOrderMoney(uid, type , 1); |
| | | }
|
| | |
|
| | | if (todayMoney == null) {
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 统计今日订单收入 以及订单数量
|
| | | * 统计奖金
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countToday", method = RequestMethod.POST)
|
| | | public void countToday(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | @RequestMapping(value = "countBonus", method = RequestMethod.POST)
|
| | | public void countBonus(AcceptData acceptData, Long uid, Integer dateType, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | long count = commonOrderService.countOrder(uid, 1);
|
| | | BigDecimal money = commonOrderService.countOrderMoney(uid, 1);
|
| | | |
| | | if (money == null) {
|
| | | money = new BigDecimal(0);
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("money", money);
|
| | | // 分享统计
|
| | | data.put("shareCount", commonOrderService.countOrder(uid, 2, dateType));
|
| | | data.put("sharemoney", commonOrderService.countOrderMoney(uid,2, dateType));
|
| | | // 邀请统计
|
| | | data.put("inviteCount", commonOrderService.countOrder(uid, 3, dateType));
|
| | | data.put("inviteMoney", commonOrderService.countOrderMoney(uid,3, dateType));
|
| | | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 奖金订单
|
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param uid
|
| | | * @param dateType 1-今日 2-昨天 3-本月 4-上个月 |
|
| | | * @param type 订单类型:1-返利订单 2-分享订单 3-邀请订单 |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getbonusorder", method = RequestMethod.POST)
|
| | | public void getBonusOrder(AcceptData acceptData, Integer page, Long uid, Integer dateType, |
| | | Integer type, PrintWriter out) {
|
| | | |
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (type == null || dateType == null ) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "传递参数缺失"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (page == null || page < 1) {
|
| | | page = 1;
|
| | | }
|
| | | |
| | | try {
|
| | | long count = 0;
|
| | | List<CommonOrderVO> list = commonOrderService.listBonusOrder(page, uid, type, dateType);
|
| | | |
| | | if (list != null && list.size() > 0) {
|
| | | count = commonOrderService.countOrder(uid, type, dateType);
|
| | | }
|
| | | |
| | | int totalValid = 0;
|
| | | int totalProces = 0;
|
| | | int totalInvite = 0;
|
| | | long todayTotal = 0;
|
| | | BigDecimal todayMoney = null;
|
| | | // 需要统计信息
|
| | | if (page == 1) {
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countBonusOrderByState(uid, type, dateType);
|
| | | |
| | | if (countOrder.get("totalValid") != null) {
|
| | | totalValid = countOrder.get("totalValid").intValue();
|
| | | } |
| | | |
| | | if (countOrder.get("totalProces") != null) {
|
| | | totalProces = countOrder.get("totalProces").intValue();
|
| | | } |
| | | |
| | | if (countOrder.get("totalInvite") != null) {
|
| | | totalInvite = countOrder.get("totalInvite").intValue();
|
| | | } |
| | | |
| | | todayTotal = commonOrderService.countOrder(uid, type, 1);
|
| | | todayMoney = commonOrderService.countOrderMoney(uid, type , 1); |
| | | }
|
| | | |
| | | if (todayMoney == null) {
|
| | | todayMoney = new BigDecimal(0);
|
| | | }
|
| | | |
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("result_list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | |
| | | data.put("todayTotal", todayTotal);
|
| | | data.put("todayMoney", todayMoney);
|
| | | data.put("totalValid", totalValid); // 有效数量
|
| | | data.put("totalProces", totalProces); // 维权数量
|
| | | data.put("totalInvite", totalInvite); // 失效数量
|
| | | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | |
| | | } catch(CommonOrderException e){
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "查询失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | /**
|
| | | * 时间转换
|