| | |
| | | type = null; // 所有类型订单
|
| | | }
|
| | |
|
| | | Integer tempState = state;
|
| | | // 转换状态
|
| | | if (state != null && orderState != null && (orderState == 2|| orderState == 3)) {
|
| | | state = null; // 清空
|
| | | }
|
| | | |
| | | if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | } else if (goodsType != null && goodsType == 0){
|
| | |
| | |
|
| | | try {
|
| | | long count = 0;
|
| | | int totalValid = 0;
|
| | | int totalProces = 0;
|
| | | int totalInvite = 0;
|
| | | long totalValid = 0;
|
| | | long totalProces = 0;
|
| | | long totalInvite = 0;
|
| | | long todayTotal = 0;
|
| | | BigDecimal todayMoney = null;
|
| | |
|
| | |
| | |
|
| | | todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime, goodsType);
|
| | |
|
| | | // 统计有效的订单数量 、 失效订单数量 、维权订单数量
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type, startTime,
|
| | | endTime, dateType, goodsType);
|
| | |
|
| | | 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();
|
| | | }
|
| | | // 有效订单
|
| | | totalValid = commonOrderService.countUserOrderToApp(uid, type, startTime,
|
| | | endTime, dateType, goodsType, tempState, 1);
|
| | | |
| | | // 维权订单
|
| | | totalProces = commonOrderService.countUserOrderToApp(uid, type, startTime,
|
| | | endTime, dateType, goodsType, null, 2);
|
| | | |
| | | // 失效订单
|
| | | totalInvite = commonOrderService.countUserOrderToApp(uid, type, startTime,
|
| | | endTime, dateType, goodsType, null, 3);
|
| | | }
|
| | |
|
| | | if (todayMoney == null) {
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | Map<String, BigDecimal> countByUidAndOrderState(@Param("uid") Long uid, @Param("type") Integer type,
|
| | | long countUserOrderToApp(@Param("uid") Long uid, @Param("type") Integer type,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day,
|
| | | @Param("source") Integer source);
|
| | | @Param("source") Integer source,@Param("state") Integer state, @Param("stateOrder") Integer stateOrder);
|
| | |
|
| | | /**
|
| | | * 奖金订单数量
|
| | |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)SX )A
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="countUserOrderToApp" resultType="Long">
|
| | | <!-- 有效订单 -->
|
| | | SELECT IFNULL(COUNT(ho_id),0) FROM
|
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN |
| | | ( SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`=${uid}
|
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" />
|
| | | <if test="state != null and state == 1">
|
| | | <!-- 未到账 -->
|
| | | AND (v2.hb_state = 1 or v2.hb_state = 2)
|
| | | </if>
|
| | | <if test="state != null and state == 2">
|
| | | <!-- 已到账 -->
|
| | | AND v2.hb_state = 3
|
| | | </if>
|
| | | <if test="state != null and state == 3">
|
| | | <!-- 红包已失效 -->
|
| | | AND v2.hb_state =4 |
| | | </if>
|
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id`
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL <![CDATA[AND co.`co_state` <> 3]]>
|
| | | <if test="stateOrder == 1"> <!-- 有效订单 -->
|
| | | AND (co.`co_state_whole_order` =1 OR co.`co_state_whole_order` = 2)
|
| | | </if>
|
| | | <if test="stateOrder == 2"> <!-- 维权订单 -->
|
| | | AND co.`co_state` = 3
|
| | | </if>
|
| | | <if test="stateOrder == 3"> <!-- 失效订单 -->
|
| | | AND co.`co_state_whole_order` = 3
|
| | | </if>
|
| | | <!-- 订单时间 -->
|
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`
|
| | | )A
|
| | | </select>
|
| | | |
| | | <!-- |
| | | <select id="countByUidAndOrderState" resultType="java.util.HashMap">
|
| | | SELECT SUM(A.valid)AS totalValid, SUM(A.proces)AS
|
| | | totalProces,SUM(A.Invalid)AS totalInvite FROM (
|
| | | <!-- 有效订单 -->
|
| | | 有效订单
|
| | | SELECT IFNULL(COUNT(ho_id),0) AS valid,0 AS proces,0 AS Invalid FROM
|
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
|
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid}
|
| | |
| | | WHERE hb.hb_id IS NOT NULL <![CDATA[AND co.`co_state` <> 3]]>
|
| | | AND (co.`co_state_whole_order` =1 OR co.`co_state_whole_order` = 2)
|
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
|
| | | <!-- 订单来源 -->
|
| | | 订单来源
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX
|
| | |
|
| | | UNION ALL
|
| | |
|
| | | <!-- 维权订单 -->
|
| | | 维权订单
|
| | | SELECT 0 AS valid,IFNULL(COUNT(ho_id),0) AS proces,0 AS Invalid FROM
|
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
|
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid}
|
| | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL AND co.`co_state` = 3
|
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
|
| | | <!-- 订单来源 -->
|
| | | 订单来源
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ
|
| | |
|
| | | UNION ALL
|
| | |
|
| | | <!-- 失效订单 -->
|
| | | 失效订单
|
| | | SELECT 0 AS valid,0 AS proces,IFNULL(COUNT(ho_id),0) AS Invalid FROM
|
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
|
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid}
|
| | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL AND co.`co_state_whole_order` = 3
|
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
|
| | | <!-- 订单来源 -->
|
| | | 订单来源
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)SX )A
|
| | | </select>
|
| | | </select> -->
|
| | | <select id="countBonusOrderNumber" resultType="java.lang.Long">
|
| | | <!-- 奖金统计:订单数量 -->
|
| | | SELECT IFNULL(COUNT(ho_id),0) FROM (SELECT ho.`ho_id` FROM
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime,
|
| | | Integer day, Integer source) {
|
| | | return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime, day, source);
|
| | | public Long countUserOrderToApp(Long uid, Integer type, String startTime, String endTime,
|
| | | Integer day, Integer source, Integer state, Integer stateOrder) {
|
| | | return commonOrderMapper.countUserOrderToApp(uid, type, startTime, endTime, day, source, state, stateOrder);
|
| | | }
|
| | |
|
| | | private BigDecimal getWeiQuanMoney(List<TaoBaoWeiQuanOrder> listWQ, int sourceType, Long uid) {
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime,
|
| | | Integer day, Integer source);
|
| | | public Long countUserOrderToApp(Long uid, Integer type, String startTime, String endTime,
|
| | | Integer day, Integer source, Integer state, Integer stateOrder);
|
| | |
|
| | | /**
|
| | | * 根据订单号与订单类型查询订单
|