| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.order.TaoBaoOrderVO;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/order")
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 淘宝订单
|
| | | * 查询所有用户订单列表
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | |
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getTBOrder")
|
| | | public void getTBOrder(String callback, Integer pageIndex, Integer keyType,
|
| | | String key, Integer state, String startTime, String endTime, PrintWriter out) {
|
| | | @RequestMapping(value = "getUserOrderList")
|
| | | public void getUserOrderList(String callback, Integer pageIndex, Integer pageSize, Integer keyType,
|
| | | String key, Integer state, Integer type, Integer orderState, String startTime, String endTime, |
| | | PrintWriter out) {
|
| | |
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | if (state != null && state == 0) {
|
| | | state = null;// 所有状态
|
| | | }
|
| | |
|
| | | if (type != null && type == 0) {
|
| | | type = null; // 所有类型订单
|
| | | }
|
| | |
|
| | | if (endTime != null && endTime.trim().length() > 0) {
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | |
| | | long count = 0;
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | | List<TaoBaoOrderVO> listVO = null;
|
| | | |
| | | if (key != null && key.trim().length() > 0 && keyType == 2) {
|
| | | |
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.listQueryByUid((pageIndex - 1) * pageSize, pageSize , |
| | | Long.parseLong(key), state, null, null, null, startTime, endTime, null);
|
| | | |
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | // 统计总数
|
| | | count = commonOrderService.countQueryByUid(Long.parseLong(key), state, null, null, null, startTime, endTime, null);
|
| | | |
| | | } else {
|
| | | |
| | | List<TaoBaoOrderVO> listQuery = taoBaoOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, key, startTime, endTime, state);
|
| | | |
| | | if (listQuery == null || listQuery.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | count= taoBaoOrderService.countQuery(key, startTime, endTime, state);
|
| | | |
| | | }
|
| | |
|
| | | |
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, |
| | | keyType, key, state, type, orderState, startTime, endTime);
|
| | | |
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | // 统计总数
|
| | | count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime);
|
| | | }
|
| | |
|
| | | 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("pe", pe);
|
| | | data.put("result_list", listVO);
|
| | | data.put("result_list", list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 查询订单列表用户uid
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param uid
|
| | | * @param state
|
| | | * @param type
|
| | | * @param orderState
|
| | | * @param orderNo
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHistoryOrder")
|
| | | public void getHistoryOrder(String callback, Integer pageIndex, Integer pageSize, Long uid, Integer state, Integer type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, PrintWriter out) {
|
| | |
| | | package com.yeshi.fanli.controller.admin;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.text.DateFormat;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.util.Base64Utils;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.admin.ReslutOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.service.inter.count.TaoBaoOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.order.TaoBaoOrderVO;
|
| | |
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/taoBaoOrder")
|
| | |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, |
| | | @Param("day") Integer day); |
| | | |
| | | |
| | | /** |
| | | * 订单列表查询 |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @param state |
| | | * @param type |
| | | * @param orderState |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<CommonOrderVO> listQuery(@Param("start") long start, @Param("count") int count, |
| | | @Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state, |
| | | @Param("type") Integer type, @Param("orderState") Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 统计 |
| | | */ |
| | | long countQuery(@Param("keyType") Integer keyType, @Param("key") String key, |
| | | @Param("state") Integer state, @Param("type") Integer type, @Param("orderState")Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.entity.admin.ReslutOrder; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder; |
| | | import com.yeshi.fanli.vo.order.TaoBaoOrderVO; |
| | | |
| | | public interface TaoBaoOrderMapper { |
| | | |
| | |
| | | // 根据订单号删除数据 |
| | | int deleteByOrderId(String orderId); |
| | | |
| | | |
| | | List<ReslutOrder> queryJoinHongBao(@Param("start") int start, @Param("count") int count, @Param("key") String key, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, |
| | | @Param("type")Integer type,@Param("days") Integer days); |
| | | |
| | | int countQueryJoinHongBao( @Param("key") String key,@Param("startTime") String startTime, |
| | | @Param("endTime") String endTime, @Param("type")Integer type,@Param("days") Integer days); |
| | | |
| | | /** |
| | | * 统计--订单类型区分 |
| | |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | |
| | | List<TaoBaoOrderVO> listQuery(@Param("start")long start, @Param("count") int count, @Param("key") String key, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("state")Integer state); |
| | | |
| | | long countQuery(@Param("key") String key, @Param("startTime") String startTime,@Param("endTime") String endTime, |
| | | @Param("state")Integer state); |
| | | |
| | | } |
| | |
| | | <result column="totalCount" property="totalCount" jdbcType="INTEGER" /> |
| | | <result column="totalSettlement" property="totalSettlement" jdbcType="DECIMAL" /> |
| | | <result column="totalPayment" property="totalPayment" jdbcType="DECIMAL" /> |
| | | |
| | | |
| | | <result column="userId" property="userId" jdbcType="VARCHAR" /> |
| | | <result column="userName" property="userName" jdbcType="VARCHAR" /> |
| | | <result column="userPortrait" property="userPortrait" jdbcType="VARCHAR" /> |
| | | |
| | | <result column="levelOneId" property="levelOneId" jdbcType="VARCHAR" /> |
| | | <result column="levelOneMoney" property="levelOneMoney" jdbcType="VARCHAR" /> |
| | | <result column="levelTwoId" property="levelTwoId" jdbcType="VARCHAR" /> |
| | | <result column="levelTwoMoney" property="levelTwoMoney" jdbcType="VARCHAR" /> |
| | | |
| | | <association property="userInfo" column="co_uid" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap"> |
| | |
| | | </association> |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_state_whole_order,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_order_by,co_create_time,co_update_time |
| | | </sql> |
| | |
| | | )A |
| | | </select> |
| | | |
| | | |
| | | <select id="listQuery" resultMap="ResultMap"> |
| | | |
| | | SELECT A.*,u.id AS userId,u.`nick_name` AS userName,u.`portrait` AS userPortrait, |
| | | pv2.`hb_uid` AS levelOneId,pv2.`hb_money` AS levelOneMoney, |
| | | ppv2.`hb_uid` AS levelTwoId,ppv2.`hb_money` AS levelTwoMoney |
| | | |
| | | FROM (SELECT hb.hb_id,hb.hb_uid,hb.`hb_money` AS totalMoney, |
| | | hb.hb_state AS hongBaoState, |
| | | hb.`hb_type` AS hongBaoType, |
| | | hb.`hb_get_time` AS accountTime, |
| | | hb.`hb_pre_get_time` AS preAccountTime, |
| | | co.*,cog.* |
| | | FROM yeshi_ec_hongbao_order ho |
| | | |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE 1=1 |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | )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` |
| | | LEFT JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= co.`co_order_goods_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE"/> <!-- 订单状态 --> |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time <= #{endTime}]]> |
| | | </if> |
| | | |
| | | <if test="key != null and key != '' "> |
| | | <if test="keyType == 1 "> |
| | | AND co.co_order_no like '%${key}%' |
| | | </if> |
| | | <if test="keyType == 1 "> |
| | | AND hb.hb_uid like '%${key}%' |
| | | </if> |
| | | </if> |
| | | |
| | | ORDER BY co.co_third_create_time DESC |
| | | LIMIT ${start},${count} |
| | | ) A |
| | | LEFT JOIN yeshi_ec_user u ON u.id = A.hb_uid |
| | | LEFT JOIN yeshi_ec_hongbao_v2 pv2 ON pv2.`hb_pid` = A.hb_id |
| | | LEFT JOIN yeshi_ec_hongbao_v2 ppv2 ON ppv2.`hb_pid` = A.hb_id |
| | | |
| | | </select> |
| | | |
| | | <select id="countQuery" resultType="java.lang.Long"> |
| | | SELECT count(ho.ho_id) |
| | | FROM yeshi_ec_hongbao_order ho |
| | | |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE 1=1 |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | )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` |
| | | LEFT JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= co.`co_order_goods_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE"/> <!-- 订单状态 --> |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time <= #{endTime}]]> |
| | | </if> |
| | | |
| | | <if test="key != null and key != '' "> |
| | | <if test="keyType == 1 "> |
| | | AND co.co_order_no like '%${key}%' |
| | | </if> |
| | | <if test="keyType == 1 "> |
| | | AND hb.hb_uid like '%${key}%' |
| | | </if> |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="to_orderby" property="orderBy" jdbcType="INTEGER" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="VoResultMap" type="com.yeshi.fanli.vo.order.TaoBaoOrderVO"> |
| | | <id column="to_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="to_create_time" property="createTime" jdbcType="VARCHAR" /> |
| | | <result column="to_click_time" property="clickTime" jdbcType="VARCHAR" /> |
| | | <result column="to_title" property="title" jdbcType="VARCHAR" /> |
| | | <result column="to_auction_id" property="auctionId" jdbcType="BIGINT" /> |
| | | <result column="to_manager_wangwang" property="managerWangWang" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_shop" property="shop" jdbcType="VARCHAR" /> |
| | | <result column="to_count" property="count" jdbcType="INTEGER" /> |
| | | <result column="to_price" property="price" jdbcType="DECIMAL" /> |
| | | <result column="to_order_state" property="orderState" jdbcType="VARCHAR" /> |
| | | <result column="to_order_type" property="orderType" jdbcType="VARCHAR" /> |
| | | <result column="to_iratio" property="iRatio" jdbcType="DECIMAL" /> |
| | | <result column="to_sratio" property="sRatio" jdbcType="DECIMAL" /> |
| | | <result column="to_payment" property="payment" jdbcType="DECIMAL" /> |
| | | <result column="to_estimate" property="estimate" jdbcType="DECIMAL" /> |
| | | <result column="to_settlement" property="settlement" jdbcType="DECIMAL" /> |
| | | <result column="to_eIncome" property="eIncome" jdbcType="DECIMAL" /> |
| | | <result column="to_settlement_time" property="settlementTime" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_tk_rate" property="tkRate" jdbcType="DECIMAL" /> |
| | | <result column="to_tk_money" property="tkMoney" jdbcType="DECIMAL" /> |
| | | <result column="to_technology_support_percent" property="technologySupportPercent" |
| | | jdbcType="DECIMAL" /> |
| | | <result column="to_subsidy_ratio" property="subsidyRatio" |
| | | jdbcType="DECIMAL" /> |
| | | <result column="to_subsidy" property="subsidy" jdbcType="DECIMAL" /> |
| | | <result column="to_subsidy_type" property="subsidyType" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_transaction_platform" property="transactionPlatform" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_third_service" property="thirdService" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_order_id" property="orderId" jdbcType="VARCHAR" /> |
| | | <result column="to_class_name" property="className" jdbcType="VARCHAR" /> |
| | | <result column="to_source_media_id" property="sourceMediaId" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_source_media_name" property="sourceMediaName" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_ad_position_id" property="adPositionId" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_ad_position_name" property="adPositionName" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_latest_updatetime" property="latestUpdateTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | |
| | | <result column="to_orderby" property="orderBy" jdbcType="INTEGER" /> |
| | | <result column="picture" property="picture" jdbcType="VARCHAR" /> |
| | | <result column="userId" property="userId" jdbcType="VARCHAR" /> |
| | | <result column="userName" property="userName" jdbcType="VARCHAR" /> |
| | | <result column="userPortrait" property="userPortrait" jdbcType="VARCHAR" /> |
| | | <result column="userMoney" property="userMoney" jdbcType="VARCHAR" /> |
| | | <result column="userMoneyState" property="userMoneyState" jdbcType="VARCHAR" /> |
| | | <result column="userMoneyDate" property="userMoneyDate" jdbcType="VARCHAR" /> |
| | | <result column="userHongBaoType" property="userHongBaoType" jdbcType="VARCHAR" /> |
| | | |
| | | <result column="levelOneId" property="levelOneId" jdbcType="VARCHAR" /> |
| | | <result column="levelOneMoney" property="levelOneMoney" jdbcType="VARCHAR" /> |
| | | <result column="levelTwoId" property="levelTwoId" jdbcType="VARCHAR" /> |
| | | <result column="levelTwoMoney" property="levelTwoMoney" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">to_id,to_create_time,to_click_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby |
| | | </sql> |
| | |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <select id="queryJoinHongBao" resultMap="ResultMapExtral"> |
| | | |
| | | SELECT * |
| | | FROM (SELECT DISTINCT(to_id)AS id,hb.uid FROM `yeshi_ec_taobao_order` td |
| | | LEFT JOIN `yeshi_ec_hongbao` hb ON td.`to_order_id`= hb.`order_id` |
| | | |
| | | WHERE hb.`version` = 2 AND hb.`type` IN (1,2,20) |
| | | |
| | | <if test='key != null and key != ""'> |
| | | AND (td.`to_order_id` like '%${key}%' OR hb.uid like '%${key}%') |
| | | </if> |
| | | |
| | | <if test="days != null"> |
| | | <![CDATA[ AND DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= td.`to_create_time` ]]> |
| | | </if> |
| | | |
| | | <if test='startTime != null and startTime != ""'> |
| | | <![CDATA[AND td.to_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test='endTime != null and endTime != ""'> |
| | | <![CDATA[AND td.to_create_time < #{endTime}]]> |
| | | </if> |
| | | |
| | | <if test='type == 1'> |
| | | AND (td.`to_order_state` = '订单结算' or td.`to_order_state` = '订单成功') |
| | | </if> |
| | | <if test='type == 2'> |
| | | AND td.`to_order_state` = '订单付款' |
| | | </if> |
| | | <if test='type == 3'> |
| | | AND td.`to_order_state` = '订单失效' |
| | | </if> |
| | | |
| | | ORDER BY td.`to_create_time` DESC LIMIT ${start},${count} )A |
| | | LEFT JOIN |
| | | yeshi_ec_taobao_order tt ON A.id = tt.to_id |
| | | |
| | | </select> |
| | | |
| | | <select id="countQueryJoinHongBao" resultType="java.lang.Integer"> |
| | | SELECT count(tt.to_id) FROM (SELECT DISTINCT(to_id)AS id FROM |
| | | `yeshi_ec_taobao_order` td |
| | | LEFT JOIN `yeshi_ec_hongbao` hb ON |
| | | td.`to_order_id`= hb.`order_id` |
| | | WHERE hb.`version` = 2 AND hb.`type` IN |
| | | (1,2,20) |
| | | <if test='key != null and key != ""'> |
| | | AND (td.`to_order_id` like '%${key}%' OR hb.uid like |
| | | '%${key}%') |
| | | </if> |
| | | |
| | | <if test="days != null"> |
| | | <![CDATA[ AND DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= td.`to_create_time` ]]> |
| | | </if> |
| | | |
| | | <if test='startTime != null and startTime != ""'> |
| | | <![CDATA[ |
| | | AND to_create_time >= #{startTime} |
| | | ]]> |
| | | </if> |
| | | |
| | | <if test='endTime != null and endTime != ""'> |
| | | <![CDATA[ |
| | | AND to_create_time < #{endTime} |
| | | ]]> |
| | | </if> |
| | | |
| | | <if test='type == 1'> |
| | | AND (td.`to_order_state` = '订单结算' or td.`to_order_state` = |
| | | '订单成功') |
| | | </if> |
| | | <if test='type == 2'> |
| | | AND td.`to_order_state` = '订单付款' |
| | | </if> |
| | | <if test='type == 3'> |
| | | AND td.`to_order_state` = '订单失效' |
| | | </if> |
| | | )A LEFT JOIN yeshi_ec_taobao_order tt ON A.id = tt.to_id |
| | | </select> |
| | | <select id="countByOdrerType" resultType="java.util.HashMap"> |
| | | SELECT COUNT(to_id)AS |
| | | countTotal ,IFNULL(SUM(CASE WHEN `to_order_state` = '订单结算' THEN 1 WHEN |
| | |
| | | ORDER BY t.`to_create_time` |
| | | </select> |
| | | |
| | | |
| | | <select id="listQuery" resultMap="VoResultMap"> |
| | | SELECT * FROM `yeshi_ec_taobao_order` tb |
| | | WHERE 1=1 |
| | | <!-- 搜索条件 --> |
| | | <if test='key != null and key != ""'> |
| | | AND tb.`to_order_id` like '%${key}%' <!-- 订单号 --> |
| | | </if> |
| | | |
| | | <if test='startTime != null and startTime != ""'> |
| | | <![CDATA[AND DATE_FORMAT(tb.to_create_time,'%Y-%m-%d') >= #{startTime}]]> |
| | | |
| | | </if> |
| | | <if test='endTime != null and endTime != ""'> |
| | | <![CDATA[AND DATE_FORMAT(tb.to_create_time,'%Y-%m-%d') <= #{endTime}]]> |
| | | </if> |
| | | |
| | | <if test='state == 1'> |
| | | AND tb.`to_order_state` = '订单付款' |
| | | </if> |
| | | <if test='state == 2'> |
| | | AND (tb.`to_order_state` = '订单结算' or tb.`to_order_state` = '订单成功') |
| | | </if> |
| | | <if test='state == 3'> |
| | | AND tb.`to_order_state` = '订单失效' |
| | | </if> |
| | | ORDER BY tb.`to_create_time` DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countQuery" resultType="java.lang.Long"> |
| | | SELECT IFNULL(count(tb.to_id),0) |
| | | FROM `yeshi_ec_taobao_order` tb |
| | | WHERE 1=1 |
| | | <!-- 搜索条件 --> |
| | | <if test='key != null and key != ""'> |
| | | AND tb.`to_order_id` like '%${key}%' <!-- 订单号 --> |
| | | </if> |
| | | |
| | | <if test='startTime != null and startTime != ""'> |
| | | <![CDATA[AND DATE_FORMAT(tb.to_create_time,'%Y-%m-%d') >= #{startTime}]]> |
| | | |
| | | </if> |
| | | <if test='endTime != null and endTime != ""'> |
| | | <![CDATA[AND DATE_FORMAT(tb.to_create_time,'%Y-%m-%d') <= #{endTime}]]> |
| | | </if> |
| | | |
| | | <if test='state == 1'> |
| | | AND tb.`to_order_state` = '订单付款' |
| | | </if> |
| | | <if test='state == 2'> |
| | | AND (tb.`to_order_state` = '订单结算' or tb.`to_order_state` = '订单成功') |
| | | </if> |
| | | <if test='state == 3'> |
| | | AND tb.`to_order_state` = '订单失效' |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | @Override
|
| | | public List<CommonOrderVO> listQuery(long start, int count, Integer keyType, String key, Integer state, |
| | | Integer type, Integer orderState, String startTime, String endTime) throws CommonOrderException {
|
| | | |
| | | |
| | | List<CommonOrderVO> list = commonOrderMapper.listQuery(start, count,keyType, key, state, type, |
| | | orderState, startTime, endTime);
|
| | | |
| | | |
| | | if (list == null) {
|
| | | list = new ArrayList<CommonOrderVO>();
|
| | | }
|
| | | |
| | | if (list.size() == 0) {
|
| | | return list;
|
| | | }
|
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
| | | for (CommonOrderVO order : list) {
|
| | | |
| | | // 下单时间
|
| | | Date thirdCreateTime = order.getThirdCreateTime();
|
| | | if (thirdCreateTime != null) {
|
| | | order.setDownTime(format.format(thirdCreateTime));
|
| | | }
|
| | | // 收货时间
|
| | | Date settleTime = order.getSettleTime();
|
| | | if (settleTime != null) {
|
| | | order.setReceiveTime(format.format(settleTime));
|
| | | }
|
| | | |
| | | // 到账时间
|
| | | Date accountTime = order.getAccountTime();
|
| | | if (accountTime != null) {
|
| | | order.setHongBaoDate(format.format(accountTime));
|
| | | }
|
| | | |
| | | BigDecimal settlement = order.getSettlement();
|
| | | if (settlement != null && settlement.compareTo(new BigDecimal(0)) > 0) {
|
| | | order.setPayment(settlement); // 实际付款金额
|
| | | }
|
| | |
|
| | | /* 订单返利类型 转换 */
|
| | | Integer hongBaoType = order.getHongBaoType();
|
| | | if (HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) {
|
| | | // 自购
|
| | | order.setHongBaoType(1);
|
| | | } else if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) {
|
| | | // 分享
|
| | | order.setHongBaoType(2);
|
| | | } else if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
|
| | | // 邀请
|
| | | order.setHongBaoType(3);
|
| | | }
|
| | |
|
| | | Integer hongBaoState = order.getHongBaoState();
|
| | | if (HongBaoV2.STATE_KELINGQU == hongBaoState || HongBaoV2.STATE_BUKELINGQU == hongBaoState) {
|
| | | // 未到账
|
| | | order.setHongBaoState(1);
|
| | |
|
| | | } else if (HongBaoV2.STATE_YILINGQU == hongBaoState) {
|
| | | // 已到账
|
| | | order.setHongBaoState(2);
|
| | |
|
| | | } else if (HongBaoV2.STATE_SHIXIAO == hongBaoState) {
|
| | | // 已失效
|
| | | order.setHongBaoState(3);
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | return list;
|
| | | |
| | | }
|
| | |
|
| | | @Override
|
| | | public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
|
| | | String startTime, String endTime) throws CommonOrderException {
|
| | | return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime);
|
| | | }
|
| | | |
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
|
| | | import com.yeshi.fanli.entity.admin.ReslutOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.vo.order.TaoBaoOrderVO;
|
| | |
|
| | | @Service
|
| | | public class TaoBaoOrderServiceImpl implements TaoBaoOrderService {
|
| | |
| | | return taoBaoOrderMapper.selectTaoBaoOrderByOrderId(orderId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ReslutOrder> queryJoinHongBao(int start, int count, String key, String startTime, String endTime,
|
| | | Integer type, Integer days) throws Exception {
|
| | | return taoBaoOrderMapper.queryJoinHongBao(start, count, key, startTime, endTime, type, days);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int countQueryJoinHongBao(String key, String startTime, String endTime, Integer type, Integer days)
|
| | | throws Exception {
|
| | | return taoBaoOrderMapper.countQueryJoinHongBao(key, startTime, endTime, type, days);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public double countEstimate(String date) throws Exception {
|
| | | return taoBaoOrderMapper.countEstimate(date);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoOrder> getStateByOrderIdAndPayment(String orderId, String payment) throws Exception {
|
| | | return taoBaoOrderMapper.getStateByOrderIdAndPayment(orderId, payment);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<TaoBaoOrderVO> listQuery(int start, int count, String key, |
| | | String startTime, String endTime, Integer state) throws Exception {
|
| | | |
| | | List<TaoBaoOrderVO> listData = taoBaoOrderMapper.listQuery(start, count, key, startTime, endTime, state);
|
| | | |
| | | for (TaoBaoOrderVO taoBaoOrderVO : listData) {
|
| | | |
| | | String orderState = taoBaoOrderVO.getOrderState();
|
| | | if ("订单付款".equals(orderState)) {
|
| | | taoBaoOrderVO.setOrderState("1");
|
| | | }else if ("订单结算".equals(orderState) || "订单成功".equals(orderState)) {
|
| | | taoBaoOrderVO.setOrderState("2");
|
| | | } else if ("订单失效".equals(orderState)) {
|
| | | taoBaoOrderVO.setOrderState("3");
|
| | | }
|
| | | }
|
| | | |
| | | return listData;
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countQuery(String key, String startTime, String endTime, |
| | | Integer state) throws Exception {
|
| | | return taoBaoOrderMapper.countQuery(key, startTime, endTime, state);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | public long countQueryByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo, String startTime,
|
| | | String endTime, Integer dateType) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 查询所有用户订单 |
| | | * @param start
|
| | | * @param count
|
| | | * @param keyType
|
| | | * @param key
|
| | | * @param state
|
| | | * @param type
|
| | | * @param orderState
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | |
| | | public List<CommonOrderVO> listQuery(long start, int count, Integer keyType, String key, Integer state, Integer type,
|
| | | Integer orderState, String startTime, String endTime) throws CommonOrderException;
|
| | |
|
| | | public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState, String startTime,
|
| | | String endTime) throws CommonOrderException;
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.admin.ReslutOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.vo.order.TaoBaoOrderVO;
|
| | |
|
| | | /**
|
| | | * 淘宝订单服务
|
| | |
| | | public List<TaoBaoOrder> getTaoBaoOrderByOrderId(String orderId);
|
| | |
|
| | |
|
| | | |
| | | /**
|
| | | * 查询订单--关联红包
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param type
|
| | | * @param days
|
| | | * @return
|
| | | */
|
| | | public List<ReslutOrder> queryJoinHongBao(int start, int count, String key, String startTime, String endTime, Integer type, Integer days) throws Exception;
|
| | |
|
| | | public int countQueryJoinHongBao(String key, String startTime, String endTime, Integer type, Integer days) throws Exception;
|
| | | |
| | | |
| | | /**
|
| | | * 统计当日预估收益
|
| | | * @param date 2018-09-01
|
| | | * @return
|
| | | */
|
| | | public double countEstimate(String date) throws Exception;
|
| | |
|
| | | |
| | | /**
|
| | | * 根据订单号、金额查询订单状态
|
| | | * @param orderId
|
| | | * @param payment
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<TaoBaoOrder> getStateByOrderIdAndPayment(String orderId, String payment) throws Exception;
|
| | |
|
| | | |
| | | /**
|
| | | * 后端查询商品列表
|
| | | * @param start
|
| | | * @param count
|
| | | * @param keyType
|
| | | * @param key
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param state
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<TaoBaoOrderVO> listQuery(int start, int count, String key, String startTime, String endTime,
|
| | | Integer state) throws Exception;
|
| | |
|
| | | public long countQuery(String key, String startTime, String endTime, Integer state) throws Exception;
|
| | |
|
| | | }
|
| | |
| | | @Expose
|
| | | private List<CommonOrderGoodsVO> listOrderGoods = new ArrayList<CommonOrderGoodsVO>();
|
| | |
|
| | | |
| | | // 直接收益人-ID
|
| | | private String userId;
|
| | | // 直接收益人-昵称
|
| | | private String userName;
|
| | | // 直接收益人-头像
|
| | | private String userPortrait; // 头像
|
| | | |
| | | // 一级收益人-ID
|
| | | private String levelOneId;
|
| | | // 一级收益人-金额
|
| | | private String levelOneMoney;
|
| | |
|
| | | // 二级收益人-ID
|
| | | private String levelTwoId;
|
| | | // 二级收益人-金额
|
| | | private String levelTwoMoney;
|
| | | |
| | | |
| | | |
| | | public Date getAccountTime() {
|
| | | return accountTime;
|
| | | }
|
| | |
| | | this.totalPayment = totalPayment;
|
| | | }
|
| | |
|
| | | |
| | | public String getLevelOneId() {
|
| | | return levelOneId;
|
| | | }
|
| | |
|
| | | public void setLevelOneId(String levelOneId) {
|
| | | this.levelOneId = levelOneId;
|
| | | }
|
| | |
|
| | | public String getLevelOneMoney() {
|
| | | return levelOneMoney;
|
| | | }
|
| | |
|
| | | public void setLevelOneMoney(String levelOneMoney) {
|
| | | this.levelOneMoney = levelOneMoney;
|
| | | }
|
| | |
|
| | | public String getLevelTwoId() {
|
| | | return levelTwoId;
|
| | | }
|
| | |
|
| | | public void setLevelTwoId(String levelTwoId) {
|
| | | this.levelTwoId = levelTwoId;
|
| | | }
|
| | |
|
| | | public String getLevelTwoMoney() {
|
| | | return levelTwoMoney;
|
| | | }
|
| | |
|
| | | public void setLevelTwoMoney(String levelTwoMoney) {
|
| | | this.levelTwoMoney = levelTwoMoney;
|
| | | }
|
| | |
|
| | | public String getUserId() {
|
| | | return userId;
|
| | | }
|
| | |
|
| | | public void setUserId(String userId) {
|
| | | this.userId = userId;
|
| | | }
|
| | |
|
| | | public String getUserName() {
|
| | | return userName;
|
| | | }
|
| | |
|
| | | public void setUserName(String userName) {
|
| | | this.userName = userName;
|
| | | }
|
| | |
|
| | | public String getUserPortrait() {
|
| | | return userPortrait;
|
| | | }
|
| | |
|
| | | public void setUserPortrait(String userPortrait) {
|
| | | this.userPortrait = userPortrait;
|
| | | }
|
| | |
|
| | | }
|