fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java
@@ -54,7 +54,7 @@ * @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) { @@ -63,7 +63,7 @@ } if (page == null || page < 1) { page = 1L; page = 1; } if (state !=null && state == 0) { @@ -114,8 +114,8 @@ 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) { @@ -259,13 +259,13 @@ } /** * 统计今日订单收入 以及订单数量 * 统计奖金 * @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, "用户未登录")); @@ -273,16 +273,15 @@ } 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) { @@ -292,6 +291,91 @@ } /** * 奖金订单 * @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(); } } /** * 时间转换 fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/CommonOrderMapper.java
@@ -49,22 +49,6 @@ */ Map<String, BigDecimal> countOrderByHongBaoType(@Param("uid") Long uid, @Param("day") Integer day); /** * 总订单 * @param uid * @return */ long countOrder(@Param("uid")Long uid, @Param("isToday")Integer isToday); /** * 总订单 * @param uid * @return */ BigDecimal countOrderMoney(@Param("uid")Long uid, @Param("isToday")Integer isToday); /** * 昨日总订单-根据红包类型 自购 邀请 分享 * @param uid @@ -72,4 +56,35 @@ */ Map<String, BigDecimal> countByUidAndOrderState(@Param("uid") Long uid, @Param("type") Integer type, @Param("startTime")String startTime, @Param("endTime")String endTime); /** * 奖金订单数量 * @param uid * @return */ long countBonusOrder(@Param("uid")Long uid, @Param("type") Integer type, @Param("day")Integer day); /** * 奖金统计 * @param uid * @return */ BigDecimal countBonusOrderMoney(@Param("uid")Long uid, @Param("type") Integer type, @Param("day")Integer day); /** * 奖金订单列表 * @param uid * @return */ List<CommonOrderVO> listBonusOrder(@Param("start") long start, @Param("count") int count, @Param("uid")Long uid, @Param("type") Integer type, @Param("day")Integer day); /** * 统计订单 根据订单状态 * @param uid * @return */ Map<String, BigDecimal> countBonusOrderByState(@Param("uid") Long uid, @Param("type") Integer type, @Param("day")Integer day); } fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
@@ -158,9 +158,9 @@ <if test="endTime != null"> AND <![CDATA[tc.co_create_time < #{endTime}]]> </if> GROUP BY tc.`co_order_no` GROUP BY tc.`co_order_no`,tc.co_source_type ORDER BY tc.co_create_time DESC LIMIT #{start},#{count} LIMIT ${start},${count} </select> <select id="countGroupOrderNoByUid" resultType="java.lang.Long"> @@ -243,32 +243,6 @@ )A </select> <select id="countOrder" resultType="java.lang.Long"> SELECT IFNULL(COUNT(DISTINCT tc.`co_order_no`,tc.`co_source_type`),0) FROM yeshi_ec_common_order tc LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE 1=1 <if test="uid != null"> AND th.`hb_uid` = ${uid} </if> <if test ="isToday == 1"> AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) </if> </select> <select id="countOrderMoney" resultType="java.lang.Long"> SELECT IFNULL(SUM(th.`hb_money`),0)AS totalmoney FROM yeshi_ec_common_order tc LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE th.`hb_uid` = ${uid} AND <![CDATA[tc.`co_state` <> 4]]> <if test ="isToday == 1"> AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) </if> GROUP BY tc.`co_order_no`,tc.`co_source_type` </select> <select id="countByUidAndOrderState" resultType="java.util.HashMap"> SELECT SUM(valid)AS totalValid, SUM(proces)AS totalProces ,SUM(Invalid)AS totalInvite FROM (SELECT IFNULL(COUNT(DISTINCT tc.`co_order_no`,tc.`co_source_type`),0) AS valid,0 AS proces,0 AS Invalid @@ -276,8 +250,14 @@ LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE th.`hb_uid` = #{uid} AND (tc.`co_state` = 1 OR tc.`co_state` = 2) <if test="type != null"> AND th.hb_type = #{type} <if test="type != null and type == 1"> <!-- 自购订单 --> AND (th.hb_type =1 or th.hb_type =2) </if> <if test="type != null and type == 2"> <!-- 分享订单 --> AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) </if> <if test="type != null and type == 3"> <!-- 邀请订单 --> AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) </if> <if test="startTime != null"> AND <![CDATA[tc.co_create_time >= #{startTime}]]> @@ -293,8 +273,14 @@ LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE th.`hb_uid` = #{uid} AND tc.`co_state` =3 <if test="type != null"> AND th.hb_type = #{type} <if test="type != null and type == 1"> <!-- 自购订单 --> AND (th.hb_type =1 or th.hb_type =2) </if> <if test="type != null and type == 2"> <!-- 分享订单 --> AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) </if> <if test="type != null and type == 3"> <!-- 邀请订单 --> AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) </if> <if test="startTime != null"> AND <![CDATA[tc.co_create_time >= #{startTime}]]> @@ -310,8 +296,14 @@ LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE th.`hb_uid`= #{uid} AND tc.`co_state` = 4 <if test="type != null"> AND th.hb_type = #{type} <if test="type != null and type == 1"> <!-- 自购订单 --> AND (th.hb_type =1 or th.hb_type =2) </if> <if test="type != null and type == 2"> <!-- 分享订单 --> AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) </if> <if test="type != null and type == 3"> <!-- 邀请订单 --> AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) </if> <if test="startTime != null"> AND <![CDATA[tc.co_create_time >= #{startTime}]]> @@ -322,4 +314,186 @@ )A </select> <select id="countBonusOrder" resultType="java.lang.Long"> SELECT COALESCE(COUNT(DISTINCT tc.`co_order_no`,tc.`co_source_type`),0) FROM yeshi_ec_common_order tc LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE 1=1 <if test="uid != null"> AND th.`hb_uid` = ${uid} </if> <if test="type != null and type == 1"> <!-- 自购订单 --> AND (th.hb_type =1 or th.hb_type =2) </if> <if test="type != null and type == 2"> <!-- 分享订单 --> AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) </if> <if test="type != null and type == 3"> <!-- 邀请订单 --> AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) </if> <if test ="day != null and day == 1"> <!-- 今天 --> AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) </if> <if test="day != null and day == 2"> <!-- 昨天 --> AND TO_DAYS(NOW()) - TO_DAYS(tc.`co_create_time`) = 1 </if> <if test="day != null and day == 3"> <!-- 本月 --> AND DATE_FORMAT(tc.`co_create_time`,'%Y%m') = DATE_FORMAT(CURDATE( ),'%Y%m') </if> <if test="day != null and day == 4"> <!-- 上月 --> AND ERIOD_DIFF( DATE_FORMAT( now( ), '%Y%m'), DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1 </if> </select> <select id="countBonusOrderMoney" resultType="java.math.BigDecimal"> SELECT COALESCE(SUM(th.`hb_money`),0)AS totalmoney FROM yeshi_ec_common_order tc LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE <![CDATA[tc.`co_state` <> 4]]> <if test="uid != null"> AND th.`hb_uid` = ${uid} </if> <if test="type != null and type == 1"> <!-- 自购订单 --> AND (th.hb_type =1 or th.hb_type =2) </if> <if test="type != null and type == 2"> <!-- 分享订单 --> AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) </if> <if test="type != null and type == 3"> <!-- 邀请订单 --> AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) </if> <if test ="day != null and day == 1"> <!-- 今天 --> AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) </if> <if test="day != null and day == 2"> <!-- 昨天 --> AND TO_DAYS(NOW()) - TO_DAYS(tc.`co_create_time`) = 1 </if> <if test="day != null and day == 3"> <!-- 本月 --> AND DATE_FORMAT(tc.`co_create_time`,'%Y%m') = DATE_FORMAT(CURDATE( ),'%Y%m') </if> <if test="day != null and day == 4"> <!-- 上月 --> AND ERIOD_DIFF( DATE_FORMAT( now( ), '%Y%m'), DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1 </if> </select> <select id="listBonusOrder" resultMap="ResultMap" > SELECT COALESCE(SUM(th.`hb_money`),0)AS totalMoney,tc.*,th.hb_state AS hongBaoState, th.hb_type AS hongBaoType, th.hb_get_time AS accountTime,th.hb_get_time AS accountTime,th.hb_pre_get_time AS preAccountTime FROM yeshi_ec_common_order tc LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE th.`hb_uid` = #{uid} <if test="type != null and type == 1"> <!-- 自购订单 --> AND (th.hb_type =1 or th.hb_type =2) </if> <if test="type != null and type == 2"> <!-- 分享订单 --> AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) </if> <if test="type != null and type == 3"> <!-- 邀请订单 --> AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) </if> <if test ="day != null and day == 1"> <!-- 今天 --> AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) </if> <if test="day != null and day == 2"> <!-- 昨天 --> AND TO_DAYS(NOW()) - TO_DAYS(tc.`co_create_time`) = 1 </if> <if test="day != null and day == 3"> <!-- 本月 --> AND DATE_FORMAT(tc.`co_create_time`,'%Y%m') = DATE_FORMAT(CURDATE( ),'%Y%m') </if> <if test="day != null and day == 4"> <!-- 上月 --> AND ERIOD_DIFF( DATE_FORMAT( now( ), '%Y%m'), DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1 </if> GROUP BY tc.`co_order_no`,tc.co_source_type ORDER BY tc.co_create_time DESC LIMIT ${start},${count} </select> <select id="countBonusOrderByState" resultType="java.util.HashMap"> SELECT SUM(valid)AS totalValid, SUM(proces)AS totalProces ,SUM(Invalid)AS totalInvite FROM (SELECT IFNULL(COUNT(DISTINCT tc.`co_order_no`,tc.`co_source_type`),0) AS valid,0 AS proces,0 AS Invalid FROM yeshi_ec_common_order tc LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE th.`hb_uid` = #{uid} AND (tc.`co_state` = 1 OR tc.`co_state` = 2) <if test="type != null and type == 1"> <!-- 自购订单 --> AND (th.hb_type =1 or th.hb_type =2) </if> <if test="type != null and type == 2"> <!-- 分享订单 --> AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) </if> <if test="type != null and type == 3"> <!-- 邀请订单 --> AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) </if> <if test ="day != null and day == 1"> <!-- 今天 --> AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) </if> <if test="day != null and day == 2"> <!-- 昨天 --> AND TO_DAYS(NOW()) - TO_DAYS(tc.`co_create_time`) = 1 </if> <if test="day != null and day == 3"> <!-- 本月 --> AND DATE_FORMAT(tc.`co_create_time`,'%Y%m') = DATE_FORMAT(CURDATE( ),'%Y%m') </if> <if test="day != null and day == 4"> <!-- 上月 --> AND ERIOD_DIFF( DATE_FORMAT( now( ), '%Y%m'), DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1 </if> UNION SELECT 0 AS valid,IFNULL(COUNT(DISTINCT tc.`co_order_no`,tc.`co_source_type`),0) AS proces,0 AS Invalid FROM yeshi_ec_common_order tc LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE th.`hb_uid` = #{uid} AND tc.`co_state` =3 <if test="type != null and type == 1"> <!-- 自购订单 --> AND (th.hb_type =1 or th.hb_type =2) </if> <if test="type != null and type == 2"> <!-- 分享订单 --> AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) </if> <if test="type != null and type == 3"> <!-- 邀请订单 --> AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) </if> <if test ="day != null and day == 1"> <!-- 今天 --> AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) </if> <if test="day != null and day == 2"> <!-- 昨天 --> AND TO_DAYS(NOW()) - TO_DAYS(tc.`co_create_time`) = 1 </if> <if test="day != null and day == 3"> <!-- 本月 --> AND DATE_FORMAT(tc.`co_create_time`,'%Y%m') = DATE_FORMAT(CURDATE( ),'%Y%m') </if> <if test="day != null and day == 4"> <!-- 上月 --> AND ERIOD_DIFF( DATE_FORMAT( now( ), '%Y%m'), DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1 </if> UNION SELECT 0 AS valid,0 AS proces,IFNULL(COUNT(DISTINCT tc.`co_order_no`,tc.`co_source_type`),0) AS Invalid FROM yeshi_ec_common_order tc LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR th.`hb_pid` = tr.`ho_hongbao_id` ) WHERE th.`hb_uid`= #{uid} AND tc.`co_state` = 4 <if test="type != null and type == 1"> <!-- 自购订单 --> AND (th.hb_type =1 or th.hb_type =2) </if> <if test="type != null and type == 2"> <!-- 分享订单 --> AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) </if> <if test="type != null and type == 3"> <!-- 邀请订单 --> AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) </if> <if test ="day != null and day == 1"> <!-- 今天 --> AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) </if> <if test="day != null and day == 2"> <!-- 昨天 --> AND TO_DAYS(NOW()) - TO_DAYS(tc.`co_create_time`) = 1 </if> <if test="day != null and day == 3"> <!-- 本月 --> AND DATE_FORMAT(tc.`co_create_time`,'%Y%m') = DATE_FORMAT(CURDATE( ),'%Y%m') </if> <if test="day != null and day == 4"> <!-- 上月 --> AND ERIOD_DIFF( DATE_FORMAT( now( ), '%Y%m'), DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1 </if> )A </select> </mapper> fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -79,7 +79,7 @@ } @Override public List<CommonOrderVO> getOrderByUid (Long page, Long uid, Integer state, Integer type, public List<CommonOrderVO> getOrderByUid (Integer page, Long uid, Integer state, Integer type, String orderNo, String startTime, String endTime) throws CommonOrderException { int pageSize = Constant.PAGE_SIZE; @@ -99,6 +99,67 @@ if (listGoods ==null || listGoods.size() == 0) { return listOrder; } // 数据加工重新组织 listDataFactory(listOrder, listGoods); return listOrder; } @Override public List<CommonOrderVO> listBonusOrder (Integer page, Long uid, Integer type,Integer day) throws CommonOrderException { int pageSize = Constant.PAGE_SIZE; List<CommonOrderVO> listOrder = commonOrderMapper.listBonusOrder((page - 1) * pageSize, pageSize, uid, type, day); // 订单信息为空 if (listOrder == null || listOrder.size() == 0) { listOrder = new ArrayList<CommonOrderVO>(); return listOrder; } // 商品信息 List<CommonOrderVO> listGoods = commonOrderMapper.listByOrderNoAndType(listOrder); // 订单商品为空 if (listGoods ==null || listGoods.size() == 0) { return listOrder; } // 数据加工重新组织 listDataFactory(listOrder, listGoods); return listOrder; } @Override public Map<String, BigDecimal> countOrderByHongBaoType(Long uid, Integer day) { return commonOrderMapper.countOrderByHongBaoType(uid, day); } @Override public long countOrder(Long uid,Integer type, Integer day) { return commonOrderMapper.countBonusOrder(uid, type, day); } @Override public BigDecimal countOrderMoney(Long uid, Integer type, Integer day) { return commonOrderMapper.countBonusOrderMoney(uid, type, day); } @Override public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime,String endTime) { return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime); } @Override public Map<String, BigDecimal> countBonusOrderByState(Long uid,Integer type, Integer day) { return commonOrderMapper.countBonusOrderByState(uid, type, day); } public void listDataFactory (List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods ) { /* 组合商品信息 */ for (CommonOrderVO commonOrder: listGoods) { @@ -221,13 +282,18 @@ order.setHongBaoTypePic(CommonOrder.TYPE_INVITE); } String hongBaoDate = ""; String hongBaoState_Str = ""; String hongbaoInfoFontColor = "#E5005C"; /* 红包状态 转换 */ String stateContent = ""; Integer orderHongBaoState = null; Integer hongBaoState = order.getHongBaoState(); if (HongBaoV2.STATE_KELINGQU == hongBaoState || HongBaoV2.STATE_BUKELINGQU == hongBaoState) { orderHongBaoState = 1; stateContent = "未到账"; hongBaoState_Str = "预估"; hongbaoInfoFontColor = "#888888"; @@ -238,6 +304,7 @@ } } else if (HongBaoV2.STATE_YILINGQU == hongBaoState) { orderHongBaoState = 3; stateContent = "已到账"; Date accountTime = order.getAccountTime(); @@ -247,18 +314,21 @@ } else if (HongBaoV2.STATE_BUFENSHIXIAO == hongBaoState) { stateContent = "部分失效"; orderHongBaoState = 3; Date accountTime = order.getAccountTime(); if (accountTime != null) { hongBaoDate = "到账时间" + formatday.format(accountTime); } } else if (HongBaoV2.STATE_SHIXIAO == hongBaoState) { orderHongBaoState = 4; stateContent = "已失效"; hongBaoDate = " "; } order.setHongBaoState(orderHongBaoState); order.setAccountState(stateContent); order.setHongBaoDate(hongBaoDate); if ("奖金".equals(hongbaoInfo) && hongBaoState_Str.trim().length() > 0) { hongbaoInfo = hongBaoState_Str + hongbaoInfo; } @@ -270,32 +340,7 @@ hongBaoMap.put("content", hongbaoInfo + " ¥" + hongBao); hongBaoMap.put("fontColor", hongbaoInfoFontColor); order.setHongBaoInfo(hongBaoMap); } return listOrder; } @Override public Map<String, BigDecimal> countOrderByHongBaoType(Long uid, Integer day) { return commonOrderMapper.countOrderByHongBaoType(uid, day); } @Override public long countOrder(Long uid, Integer isToday) { return commonOrderMapper.countOrder(uid, isToday); } @Override public BigDecimal countOrderMoney(Long uid, Integer isToday) { return commonOrderMapper.countOrderMoney(uid, isToday); } @Override public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime,String endTime) { return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime); } } fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderService.java
@@ -61,7 +61,7 @@ * @param type 到账状态 * @return */ public List<CommonOrderVO> getOrderByUid(Long page, Long uid, Integer state, Integer type, public List<CommonOrderVO> getOrderByUid(Integer page, Long uid, Integer state, Integer type, String orderNo, String startTime, String endTime) throws CommonOrderException; /** @@ -77,14 +77,14 @@ * @param uid * @return */ public long countOrder(Long uid, Integer isToday); public long countOrder(Long uid, Integer type, Integer isToday); /** * 统计订单 * @param uid * @return */ public BigDecimal countOrderMoney(Long uid, Integer isToday); public BigDecimal countOrderMoney(Long uid, Integer type, Integer isToday); /** * 根据条件统计 @@ -96,4 +96,17 @@ */ public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime); /** * 奖金列表统计 * @param page * @param uid * @param type * @param day * @return * @throws CommonOrderException */ public List<CommonOrderVO> listBonusOrder(Integer page, Long uid, Integer type, Integer day) throws CommonOrderException; public Map<String, BigDecimal> countBonusOrderByState(Long uid, Integer type, Integer day); } fanli/src/main/java/com/yeshi/fanli/vo/order/CommonOrderVO.java
@@ -34,9 +34,11 @@ private Integer hongBaoType; // 订单总预估奖金 private BigDecimal hongBao; // 红包状态 @Expose private Integer hongBaoState; // 到账时间 @Expose private String hongBaoDate;