From 972d3bc71115ec977dccf835fbcd148da3bcc86c Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期二, 03 九月 2019 16:41:49 +0800 Subject: [PATCH] 统计可用的免单券数量-countUsableFreeCouponForBuy --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java | 47 ++++++++++++++++++++++++++--------------------- 1 files changed, 26 insertions(+), 21 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java index f31c8bc..b1b4406 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java @@ -110,17 +110,23 @@ */ @RequestMapping(value = "getorder", method = RequestMethod.POST) public void getOrder(AcceptData acceptData, Integer page, Long uid, Integer state, - @RequestParam("type") String type1, Integer orderState, String orderNo, String startTime, String endTime, - Integer slotTime, boolean needCount, Integer dateType, Integer goodsType, PrintWriter out) { + @RequestParam(name = "type",required = false) String type1, Integer orderState, String orderNo, String startTime, String endTime, + Integer slotTime, Boolean needCount, Integer dateType, Integer goodsType, PrintWriter out) { Integer type = null; - if (StringUtil.isNullOrEmpty(type1)) + if (StringUtil.isNullOrEmpty(type1)) { type = null; - + } else { + type = Integer.parseInt(type1); + } + if (uid == null) { out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�")); return; } + + if (needCount == null) + needCount = false; if (page == null || page < 1) { page = 1; @@ -141,14 +147,14 @@ orderState = 2; // 宸茬淮鏉� state = null; // 娓呯┖ } - + if (type != null && type == 0) { type = null; // 鎵�鏈夌被鍨嬭鍗� } - + if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) { goodsType = Constant.SOURCE_TYPE_TAOBAO; - } else if (goodsType != null && goodsType == 0) { + } else if (goodsType != null && goodsType == 0){ goodsType = null; // 鎵�鏈夊钩鍙拌鍗� } @@ -175,8 +181,8 @@ BigDecimal todayMoney = null; // 鏌ヨ鍒楄〃 - List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, type, orderState, - orderNo, startTime, endTime, dateType, goodsType); + List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, type, orderState, orderNo, + startTime, endTime, dateType, goodsType); if (list != null && list.size() > 0) { // 缁熻鎬绘暟 @@ -187,11 +193,9 @@ // 闇�瑕佺粺璁$瓫閫変俊鎭� 锛氭湭澶辨晥鐨勬�婚噾棰� 浠ュ強璁㈠崟 if (needCount && page == 1) { - todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime, - goodsType); + todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime, goodsType); - todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime, - goodsType); + todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime, goodsType); // 缁熻鏈夋晥鐨勮鍗曟暟閲� 銆� 澶辨晥璁㈠崟鏁伴噺 銆佺淮鏉冭鍗曟暟閲� Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type, startTime, @@ -300,8 +304,8 @@ Integer goodsType = null; // 鐗堟湰鍖哄垎 if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) { goodsType = Constant.SOURCE_TYPE_TAOBAO; - } - + } + /* 鎬昏鍗曠粺璁� */ Map<String, BigDecimal> countOrder = commonOrderService.countHistoryOrder(uid, null, goodsType); int self = 0; @@ -386,10 +390,10 @@ e.printStackTrace(); } } - + + /** * 缁熻鍚勪釜骞冲彴鏁版嵁 - * * @param acceptData * @param uid * @param goodsType @@ -407,7 +411,7 @@ out.print(JsonUtil.loadFalseResult(1, "骞冲彴绫诲瀷缂哄け鎴栦笉姝g‘")); return; } - + /* 浠婃棩璁㈠崟缁熻 */ Map<String, BigDecimal> countToday = commonOrderService.countHistoryOrder(uid, 1, goodsType); @@ -463,7 +467,8 @@ data.put("yesterday", yesterdaydata); out.print(JsonUtil.loadTrueResult(data)); } - + + /** * 缁熻濂栭噾 * @@ -485,11 +490,11 @@ BigDecimal sharemoney = new BigDecimal(0.00); Object inviteCount = 0; BigDecimal inviteMoney = new BigDecimal(0.00); - + Integer goodsType = null; // 鐗堟湰鍖哄垎 if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) { goodsType = Constant.SOURCE_TYPE_TAOBAO; - } + } Map<String, Object> shareMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 2, dateType, null, null, goodsType); -- Gitblit v1.8.0