Merge remote-tracking branch 'origin/master'
Conflicts:
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/CommonOrderMapper.java
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | | |
| | | @Resource
|
| | | private HongBaoService hongBaoService;
|
| | |
|
| | | /**
|
| | | * 订åå表
|
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param uid
|
| | | * @param state ç¶æï¼1-æªå°è´¦ 3-å·²å°è´¦ 4-已失æ
|
| | | * @param state ç¶æï¼1-æªå°è´¦ 2-å·²å°è´¦ 3-已失æ
|
| | | * @param type ç±»åï¼1-è¿å©è®¢å 2-å享订å 3-é请订å
|
| | | * @param orderNo 订åå· |
| | | * @param orderState 1ææè®¢å 2 ç»´æè®¢å 3失æè®¢å
|
| | | * @param orderNo 订åå· |
| | | * @param startTime èµ·å§æ¶é´
|
| | | * @param endTime ç»ææ¶é´
|
| | | * @param slotTime æ¶é´æ®µï¼1-æè¿ä¸å¤© 2-æè¿ä¸å¤© 3æè¿åæ 4æ¬æ 5è¿ä¸æ 6è¿åå¹´
|
| | | * @param dateType 1-仿¥ 2-æ¨å¤© 3-æ¬æ 4-ä¸ä¸ªæ |
|
| | | * @param needCount
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getorder", method = RequestMethod.POST)
|
| | | public void getOrder(AcceptData acceptData, Long page, Long uid, Integer state, Integer type, String orderNo, |
| | | String startTime, String endTime, Integer slotTime, boolean needCount, PrintWriter out) {
|
| | | public void getOrder(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, |
| | | Integer orderState,String orderNo, String startTime, String endTime, Integer slotTime,
|
| | | boolean needCount, Integer dateType, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "ç¨æ·æªç»å½"));
|
| | |
| | | }
|
| | |
|
| | | if (page == null || page < 1) {
|
| | | page = 1L;
|
| | | page = 1;
|
| | | }
|
| | |
|
| | | if (state !=null && state == 0) {
|
| | |
| | |
|
| | | try {
|
| | | long count = 0;
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(page, uid, state, type, orderNo,
|
| | | startTime, endTime);
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(page, uid, state, type, orderState, orderNo,
|
| | | startTime, endTime, dateType);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | count = commonOrderService.countGroupOrderNoByUid(uid, state, type, orderNo, startTime, endTime);
|
| | | count = commonOrderService.countGroupOrderNoByUid(uid, state, type, orderState, orderNo, startTime, endTime, dateType);
|
| | | }
|
| | |
|
| | | int totalValid = 0;
|
| | |
| | | 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) {
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * ç»è®¡ä»æ¥è®¢åæ¶å
¥ 以åè®¢åæ°é
|
| | | * ç»è®¡å¥é
|
| | | * @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, "ç¨æ·æªç»å½"));
|
| | |
| | | }
|
| | |
|
| | | 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);
|
| | | // å享ç»è®¡
|
| | | BigDecimal sharemoney = commonOrderService.countOrderMoney(uid,2, dateType);
|
| | | data.put("shareCount", commonOrderService.countOrder(uid, 2, dateType));
|
| | | data.put("sharemoney", sharemoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | // é请ç»è®¡
|
| | | BigDecimal inviteMoney = commonOrderService.countOrderMoney(uid,3, dateType);
|
| | | data.put("inviteCount", commonOrderService.countOrder(uid, 3, dateType));
|
| | | data.put("inviteMoney", inviteMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | data.put("showTiCheng", hongBaoService.getTotalTiChengCount(uid) > 0);
|
| | | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "è·åä¿¡æ¯å¤±è´¥"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | |
|
| | |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | |
| | | List<CommonOrderVO> listGroupOrderNoByUid(@Param("start") long start, @Param("count") int count, |
| | | @Param("uid") Long uid, @Param("state") Integer state, @Param("type") Integer type, |
| | | @Param("orderNo") String orderNo, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | @Param("orderState") Integer orderState, @Param("orderNo") String orderNo, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day); |
| | | |
| | | /** |
| | | * ç»è®¡ç¨æ·è®¢å 并订åå·åç» |
| | |
| | | * @return |
| | | */ |
| | | long countGroupOrderNoByUid(@Param("uid") Long uid, @Param("state") Integer state, @Param("type") Integer type, |
| | | @Param("orderNo") String orderNo, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | @Param("orderState") Integer orderState, @Param("orderNo") String orderNo, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day); |
| | | |
| | | /** |
| | | * æ ¹æ®è®¢åå·ã订åç±»åæ¥è¯¢åå |
| | |
| | | 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 |
| | | * @return |
| | | */ |
| | | Map<String, BigDecimal> countByUidAndOrderState(@Param("uid") Long uid, @Param("type") Integer type, |
| | | |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * æ ¹æ®è®¢åå·å订åç±»åæ¥è¯¢æ°é |
| | | * å¥éè®¢åæ°é |
| | | * |
| | | * @param orderNO |
| | | * @param orderType |
| | | * @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); |
| | | |
| | | |
| | | int countByOrderNOAndOrderType(@Param("orderNO") String orderNO, @Param("orderType") int orderType); |
| | | |
| | | } |
| | |
| | | |
| | | </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_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_create_time,co_update_time |
| | | <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_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,cog_create_time,cog_update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_common_order where co_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="countByOrderNOAndOrderType" resultType="java.lang.Integer"> |
| | | select |
| | | count(co_id) from yeshi_ec_common_order where co_order_no=#{orderNO} |
| | | and co_source_type=#{orderType} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_common_order where co_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.CommonOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_order |
| | | (co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_create_time,co_update_time) |
| | | (co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,cog_create_time,cog_update_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{sourcePosition,jdbcType=VARCHAR},#{commonOrderGoods.id,jdbcType=BIGINT},#{count,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{estimate,jdbcType=DECIMAL},#{eIncome,jdbcType=DECIMAL},#{payment,jdbcType=DECIMAL},#{settlement,jdbcType=DECIMAL},#{thirdCreateTime,jdbcType=TIMESTAMP},#{settleTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | |
| | | <if test="settlement != null">co_settlement,</if> |
| | | <if test="thirdCreateTime != null">co_third_create_time,</if> |
| | | <if test="settleTime != null">co_settle_time,</if> |
| | | <if test="createTime != null">co_create_time,</if> |
| | | <if test="updateTime != null">co_update_time,</if> |
| | | <if test="createTime != null">cog_create_time,</if> |
| | | <if test="updateTime != null">cog_update_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | #{payment,jdbcType=DECIMAL},co_settlement = |
| | | #{settlement,jdbcType=DECIMAL},co_third_create_time = |
| | | #{thirdCreateTime,jdbcType=TIMESTAMP},co_settle_time = |
| | | #{settleTime,jdbcType=TIMESTAMP},co_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},co_update_time = |
| | | #{settleTime,jdbcType=TIMESTAMP},cog_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},cog_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where co_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.CommonOrder"> |
| | |
| | | <if test="thirdCreateTime != null">co_third_create_time=#{thirdCreateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="settleTime != null">co_settle_time=#{settleTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">co_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">co_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">cog_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">cog_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where co_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | 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="state != null"> |
| | | AND th.hb_state = #{state} |
| | | <if test="state != null and state == 1"> <!-- æªå°è´¦ --> |
| | | AND (th.hb_state = 1 or th.hb_state = 2) |
| | | </if> |
| | | <if test="state != null and state == 2"> <!-- å·²å°è´¦ --> |
| | | AND th.hb_state = 3 |
| | | </if> |
| | | <if test="state != null and state == 3"> <!-- 红å
已失æ --> |
| | | AND th.hb_state =4 |
| | | </if> |
| | | <if test="type != null and type == 1"> <!-- èªè´è®¢å --> |
| | | AND (th.hb_type =1 or th.hb_type =2) |
| | |
| | | <if test="orderNo != null"> |
| | | AND tc.co_order_no = #{orderNo} |
| | | </if> |
| | | <if test="orderState != null and orderState == 1"> |
| | | AND (tc.co_state = 1 or tc.co_state = 2) <!-- ææè®¢å --> |
| | | </if> |
| | | <if test="orderState != null and orderState == 2"> |
| | | AND tc.co_state = 3 <!-- ç»´æè®¢å --> |
| | | </if> |
| | | <if test="orderState != null and orderState == 3"> |
| | | AND tc.co_state = 4 <!-- 失æè®¢å --> |
| | | </if> |
| | | <if test="startTime != null"> |
| | | AND <![CDATA[tc.co_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test="endTime != null"> |
| | | AND <![CDATA[tc.co_create_time < #{endTime}]]> |
| | | </if> |
| | | GROUP BY tc.`co_order_no` |
| | | <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 PERIOD_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} |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | |
| | | <select id="countByOrderNOAndOrderType" resultType="java.lang.Integer"> |
| | | select count(co_id) from yeshi_ec_common_order where co_order_no=#{orderNO} and co_source_type=#{orderType} |
| | | </select> |
| | | |
| | | |
| | | <select id="countGroupOrderNoByUid" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(DISTINCT tc.`co_order_no`,tc.`co_source_type`),0) |
| | |
| | | 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="state != null"> |
| | | AND th.hb_state = #{state} |
| | | <if test="state != null and state == 1"> <!-- æªå°è´¦ --> |
| | | AND (th.hb_state = 1 or th.hb_state = 2) |
| | | </if> |
| | | <if test="state != null and state == 2"> <!-- å·²å°è´¦ --> |
| | | AND th.hb_state = 3 |
| | | </if> |
| | | <if test="state != null and state == 3"> <!-- 红å
已失æ --> |
| | | AND th.hb_state =4 |
| | | </if> |
| | | <if test="type != null and type == 1"> <!-- èªè´è®¢å --> |
| | | AND (th.hb_type =1 or th.hb_type =2) |
| | |
| | | <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="orderState != null and orderState = 1"> |
| | | AND (tc.co_state = 1 or tc.co_state = 2) <!-- ææè®¢å --> |
| | | </if> |
| | | <if test="orderState != null and orderState = 2"> |
| | | AND tc.co_state = 3 <!-- ç»´æè®¢å --> |
| | | </if> |
| | | <if test="orderState != null and orderState = 3"> |
| | | AND tc.co_state = 4 <!-- 失æè®¢å --> |
| | | </if> |
| | | |
| | | <if test="orderNo != null"> |
| | | AND tc.co_order_no = #{orderNo} |
| | | </if> |
| | |
| | | </if> |
| | | <if test="endTime != null"> |
| | | AND <![CDATA[tc.co_create_time < #{endTime}]]> |
| | | </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 PERIOD_DIFF( DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1 |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | totalSettlement,COALESCE(SUM(tc.`co_count`),0)AS |
| | | totalCount,tc.`co_source_type`,tc.`co_order_no`,tg.* |
| | | FROM yeshi_ec_common_order_goods tg |
| | | LEFT JOIN yeshi_ec_common_order tc ON tc.`co_order_goods_id` = tg.`co_id` |
| | | LEFT JOIN yeshi_ec_common_order tc ON tc.`co_order_goods_id` = tg.`cog_id` |
| | | WHERE |
| | | <foreach collection="list" item="item" separator=" OR "> |
| | | (tc.`co_source_type` = #{item.sourceType,jdbcType=INTEGER} AND |
| | |
| | | )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 |
| | |
| | | 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}]]> |
| | |
| | | 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}]]> |
| | |
| | | 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}]]> |
| | |
| | | )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 PERIOD_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 PERIOD_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="orderState != null and orderState == 1"> |
| | | AND (tc.co_state = 1 or tc.co_state = 2) <!-- ææè®¢å --> |
| | | </if> |
| | | <if test="orderState != null and orderState == 2"> |
| | | AND tc.co_state = 3 <!-- ç»´æè®¢å --> |
| | | </if> |
| | | <if test="orderState != null and orderState == 3"> |
| | | AND tc.co_state = 4 <!-- 失æè®¢å --> |
| | | </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 PERIOD_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> |
| | | |
| | | </mapper> |
| | |
| | | orderId = hb.getOrderId();
|
| | |
|
| | | int count = commonOrderMapper.countByOrderNOAndOrderType(orderId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | |
| | |
|
| | | // å·²ç»æå
¥è®¢å
|
| | | if (count > 0)
|
| | |
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.HashMap;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state,
|
| | | Integer type, String orderNo, String startTime,String endTime) throws CommonOrderException{
|
| | | return commonOrderMapper.listGroupOrderNoByUid(start, count, uid, state, type, orderNo, startTime, endTime);
|
| | | Integer type,Integer orderState, String orderNo, String startTime,String endTime, |
| | | Integer dateType) throws CommonOrderException{
|
| | | return commonOrderMapper.listGroupOrderNoByUid(start, count, uid, state, type, orderState,
|
| | | orderNo, startTime, endTime, dateType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countGroupOrderNoByUid(Long uid,Integer state, Integer type, String orderNo,
|
| | | String startTime,String endTime) throws CommonOrderException{
|
| | | return commonOrderMapper.countGroupOrderNoByUid(uid, state, type, orderNo, startTime, endTime);
|
| | | public long countGroupOrderNoByUid(Long uid,Integer state, Integer type, Integer orderState, |
| | | String orderNo, String startTime,String endTime, Integer dateType) throws CommonOrderException{
|
| | | return commonOrderMapper.countGroupOrderNoByUid(uid, state, type, orderState, orderNo,
|
| | | startTime, endTime, dateType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<CommonOrderVO> getOrderByUid (Long page, Long uid, Integer state, Integer type,
|
| | | String orderNo, String startTime, String endTime) throws CommonOrderException {
|
| | | public List<CommonOrderVO> getOrderByUid (Integer page, Long uid, Integer state, Integer type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException {
|
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | List<CommonOrderVO> listOrder = listGroupOrderNoByUid((page - 1) * pageSize, pageSize, uid,
|
| | | state, type, orderNo, startTime, endTime);
|
| | | state, type, orderState, orderNo, startTime, endTime, dateType);
|
| | |
|
| | | // 订åä¿¡æ¯ä¸ºç©º
|
| | | if (listOrder == null || listOrder.size() == 0) {
|
| | |
| | | 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);
|
| | | }
|
| | | |
| | | public void listDataFactory (List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods ) {
|
| | |
|
| | | /* ç»åååä¿¡æ¯ */
|
| | | for (CommonOrderVO commonOrder: listGoods) {
|
| | |
| | | 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";
|
| | |
| | | }
|
| | |
|
| | | } else if (HongBaoV2.STATE_YILINGQU == hongBaoState) {
|
| | | orderHongBaoState = 3;
|
| | | stateContent = "å·²å°è´¦";
|
| | |
|
| | | Date accountTime = order.getAccountTime();
|
| | |
| | |
|
| | | } 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;
|
| | | }
|
| | |
| | | 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);
|
| | | }
|
| | | }
|
| | |
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state, Integer type,
|
| | | String orderNo, String startTime, String endTime) throws CommonOrderException;
|
| | | public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state,
|
| | | Integer type,Integer orderState,String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * ç»è®¡æ¥è¯¢
|
| | |
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | long countGroupOrderNoByUid(Long uid, Integer state, Integer type, String orderNo, String startTime, String endTime)
|
| | | throws CommonOrderException;
|
| | | long countGroupOrderNoByUid(Long uid, Integer state, Integer type,Integer orderState,
|
| | | String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * ç§»å¨æ®µè®¢åå表
|
| | |
| | | * @param type å°è´¦ç¶æ
|
| | | * @return
|
| | | */
|
| | | public List<CommonOrderVO> getOrderByUid(Long page, Long uid, Integer state, Integer type,
|
| | | String orderNo, String startTime, String endTime) throws CommonOrderException;
|
| | | public List<CommonOrderVO> getOrderByUid(Integer page, Long uid, Integer state, Integer type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * ç»è®¡è®¢å-æ ¹æ®çº¢å
ç±»å èªè´ é请 å享
|
| | |
| | | * @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);
|
| | |
|
| | | /**
|
| | | * æ ¹æ®æ¡ä»¶ç»è®¡
|
| | |
| | |
|
| | | public class Constant {
|
| | | public static boolean IS_TASK = false;
|
| | |
|
| | | // å¤ç½ç¯å¢
|
| | | public static boolean IS_OUTNET = false;
|
| | |
|
| | |
| | | public static final String MYLIKE = "mylike";
|
| | | public static final String MYDYNAMIC = "mydynamic";
|
| | |
|
| | | // æ¥æº
|
| | | public static final int SOURCE_TYPE_TAOBAO = 1;
|
| | | public static final int SOURCE_TYPE_JD = 2;
|
| | |
|
| | | public static WXGZConfig wxGZConfig;
|
| | |
|
| | | // çä¿¡éªè¯ç é
ç½®
|
| | |
| | | private Integer hongBaoType;
|
| | | // è®¢åæ»é¢ä¼°å¥é
|
| | | private BigDecimal hongBao;
|
| | | |
| | | |
| | | // 红å
ç¶æ
|
| | | @Expose
|
| | | private Integer hongBaoState;
|
| | | |
| | | // å°è´¦æ¶é´
|
| | | @Expose
|
| | | private String hongBaoDate;
|
| | |
| | | #druid.password=Yeshi2016@
|
| | |
|
| | | #å¤ç½æ¬å°æµè¯
|
| | | #druid.url=jdbc:mysql://gz-cdb-r13d0yi9.sql.tencentcdb.com:62929/ec_quan_test
|
| | | #druid.url=jdbc:mysql://gz-cdb-r13d0yi9.sql.tencentcdb.com:62929/ec_quan
|
| | | #druid.username=root
|
| | | #druid.password=Yeshi2016@
|
| | |
|
| | |
| | | package org.fanli;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.util.List;
|
| | |
|
| | | import org.junit.Ignore;
|
| | | import org.junit.Test;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.exception.HttpException;
|
| | |
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.util.FileUtil;
|
| | | import com.yeshi.fanli.util.ImageUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.entity.common.ImageInfo;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | @Ignore
|
| | | public class TBImgTest {
|
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | |
|
| | | try {
|
| | | InputStream img = ImageUtil.drawGoodsShareImg(
|
| | | HttpUtil.downLoadImg(
|
| | | "https://wwc.alicdn.com/avatar/getAvatar.do?userId=1889722423&width=160&height=160&type=sns"),
|
| | | HttpUtil.downLoadImg(
|
| | | "https://wwc.alicdn.com/avatar/getAvatar.do?userId=1889722423&width=160&height=160&type=sns"),
|
| | | TaoKeApiUtil.searchGoodsDetail(559888327092L));
|
| | | try {
|
| | | FileUtil.saveAsFile(img, "D:/test.png");
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | |
| | | } catch (HttpException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | List<ImageInfo> list = TaoBaoUtil.getTBDetailImageWithSize(565204406588L);
|
| | | for (ImageInfo info : list)
|
| | | System.out.println(info.getPicture());
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package org.fanli;
|
| | |
|
| | | import java.io.File;
|
| | | import java.io.FileInputStream;
|
| | | import java.io.FileNotFoundException;
|
| | | import java.util.List;
|
| | |
|
| | | import org.junit.Ignore;
|
| | | import org.junit.Test;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsUpdateException;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.util.BeanUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | @Ignore
|
| | | //@Ignore
|
| | | public class TaoKeTest {
|
| | |
|
| | | @Test
|
| | |
| | |
|
| | | @Test
|
| | | public void test3() {
|
| | | System.out.println("æµè¯åå¹¶222");
|
| | | TaoBaoGoodsUpdateService taoBaoGoodsUpdateService = BeanUtil.getBean(TaoBaoGoodsUpdateService.class);
|
| | | try {
|
| | | taoBaoGoodsUpdateService.updateTaoBaoGoods(TaoKeApiUtil.searchGoodsDetail(571566226590L));
|
| | | } catch (TaobaoGoodsUpdateException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test4() {
|
| | |
|
| | | TaoBaoOrderService taoBaoOrderService = BeanUtil.getBean(TaoBaoOrderService.class);
|
| | | try {
|
| | | List<TaoBaoOrder> list = TaoBaoOrderUtil.parseOrder(
|
| | | new FileInputStream(new File("C:/Users/Administrator/Desktop/æ·å®è®¢å/2018.1.10-2018-03-12 (2).xls")));
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | // if (TimeUtil.convertToTimeTemp(list.get(i).getCreateTime(), "yyyy-MM-dd HH:mm:ss") > 1522339200000l) {
|
| | | // list.remove(i);
|
| | | // i--;
|
| | | // }
|
| | | }
|
| | |
|
| | | taoBaoOrderService.addTaoBaoOrderList(list);
|
| | | System.out.println(list);
|
| | | } catch (FileNotFoundException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|