Merge remote-tracking branch 'origin/div' into div
| | |
| | | if(list == null)
|
| | | list = new ArrayList<>();
|
| | |
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("pe", pe);
|
| | | data.put("list", list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
| | | 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);
|
| | |
|
| | | /**
|
| | | * 奖金订单数量
|
| | |
| | | <if test="type == 1">AND d.`td_money`<![CDATA[>]]> 0</if>
|
| | | <if test="type == 2">AND d.`td_money`<![CDATA[<]]> 0</if>
|
| | | GROUP BY d.`td_uid`
|
| | | ORDER BY goldCoin <if test="type = 1">DESC</if>
|
| | | ORDER BY goldCoin <if test="type == 1">DESC</if>
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | |
| | | 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
|
| | |
| | | <result column="sc_expiry_day" property="expiryDay" jdbcType="INTEGER"/>
|
| | | <result column="sc_rule" property="rule" jdbcType="VARCHAR"/>
|
| | | <result column="sc_remark" property="remark" jdbcType="VARCHAR"/>
|
| | | <result column="sc_receive_count" property="receiveCount" jdbcType="INTEGER"/>
|
| | | <result column="sc_state" property="state" jdbcType="INTEGER"/>
|
| | | <result column="sc_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="sc_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | |
| | | }
|
| | |
|
| | | @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) {
|
| | |
| | | }
|
| | | } else if (tokenType == TokenTypeEnum.taoLiJin) {
|
| | | type = 12;
|
| | | UserTaoLiJinGiveRecord giveRecord = userTaoLiJinGiveRecordService
|
| | | .selectByPrimaryKey(Long.parseLong(identify));
|
| | | if (giveRecord == null || giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_OVERDUE) {
|
| | | |
| | | UserTaoLiJinGiveRecord giveRecord = userTaoLiJinGiveRecordService.selectByPrimaryKey(Long.parseLong(identify));
|
| | | if (giveRecord == null)
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | |
| | | BigDecimal amount = giveRecord.getAmount();
|
| | | num = Integer.parseInt(amount.setScale(0).toString());
|
| | | |
| | | if(giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_OVERDUE) {
|
| | | tips.add("哎呀,推广红包已失效了!");
|
| | | } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_RECEIVE) {
|
| | | tips.add("哎呀,推广红包已被领取了!");
|
| | | } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_INIT) {
|
| | | if (uid == null || uid <= 0)
|
| | | throw new TokenRecordException(1001, "温馨提示,[推广红包]需要登录后领取");
|
| | |
|
| | | state = true;
|
| | | BigDecimal amount = giveRecord.getAmount();
|
| | | num = Integer.parseInt(amount.setScale(0).toString());
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送者的一级队员;");
|
| | |
| | |
|
| | | // 订单列表
|
| | | jumpLink.put("state", "2"); // 已收货
|
| | | jumpLink.put("showNav", false); // 不显示上方统计信息
|
| | | jumpLink.put("type", "1"); // 返利订单
|
| | | jumpLink.put("title", "返利订单"); // 标题名
|
| | | jumpLink.put("goodsType", "0"); // 订单来源
|
| | |
| | | * @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);
|
| | |
|
| | | /**
|
| | | * 根据订单号与订单类型查询订单
|