| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanDrawBackService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponRecordService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyDebtService userMoneyDebtService;
|
| | |
|
| | | @Resource
|
| | | private UserSystemCouponRecordService userSystemCouponRecordService;
|
| | |
|
| | | /**
|
| | | * 统计历史订单-淘宝订单
|
| | |
| | | * @param 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,
|
| | | Integer sourceType, PrintWriter out) {
|
| | | public void getUserOrderList(String callback, Integer pageIndex, Integer pageSize, Integer keyType, String key,
|
| | | Integer state, Integer type, Integer orderState, String startTime, String endTime, Integer sourceType,
|
| | | PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | |
| | | List<CommonOrderVO> list = commonOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, keyType, key,
|
| | | state, type, orderState, startTime, endTime, sourceType);
|
| | |
|
| | | // 统计总数
|
| | | long count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime, sourceType);
|
| | | // 统计总数
|
| | | long count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime,
|
| | | sourceType);
|
| | |
|
| | | // 查询是否维权
|
| | | for (CommonOrderVO order : list) {
|
| | |
| | | UserMoneyDebtTypeEnum.order, hongBaoOrder.getHongBaoV2().getId());
|
| | | if (debt != null && debt.getLeftMoney().compareTo(new BigDecimal(0)) > 0) {
|
| | | order.setWeiQuanBackMoney(
|
| | | new BigDecimal(0).subtract(debt.getLeftMoney()).toString());//未扣除
|
| | | new BigDecimal(0).subtract(debt.getLeftMoney()).toString());// 未扣除
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getTrackAccuracyRate")
|
| | | public void getTrackAccuracyRate(String callback, Integer dateType, String year, String startTime, String endTime,int sourceType,
|
| | | PrintWriter out) {
|
| | | public void getTrackAccuracyRate(String callback, Integer dateType, String year, String startTime, String endTime,
|
| | | int sourceType, PrintWriter out) {
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | |
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | List<Map<String, Object>> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime,
|
| | | endTime,sourceType);
|
| | | endTime, sourceType);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
| | | @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, @Param("source")Integer source); |
| | | |
| | | |
| | | /** |
| | | * 订单列表查询(不包含子订单) |
| | | * @param start |
| | | * @param count |
| | | * @param keyType |
| | | * @param key |
| | | * @param state |
| | | * @param type |
| | | * @param orderState |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param source |
| | | * @return |
| | | */ |
| | | List<CommonOrderVO> listQueryWithNoChild(@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, @Param("source")Integer source); |
| | | |
| | | /** |
| | | * 统计 |
| | |
| | | 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, @Param("source")Integer source); |
| | | |
| | | long countQueryWithNoChild(@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, @Param("source")Integer source); |
| | | |
| | | /** |
| | | * 根据来源类型与订单号查询列表 |
| | |
| | | BasicDBObject fieldsObject = new BasicDBObject();
|
| | | fieldsObject.put("auctionId", 1);
|
| | | Query query = new Query();
|
| | | Criteria ca = Criteria.where("updatetime").lt(date);
|
| | | // 时区问题,需加8小时
|
| | | Criteria ca = Criteria.where("updatetime").lt(new Date(date.getTime() + 1000 * 60 * 60 * 8L));
|
| | | query.skip(start);
|
| | | query.limit(count);
|
| | | query.addCriteria(ca);
|
| | |
| | | package com.yeshi.fanli.job;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | | import com.yeshi.fanli.entity.taobao.ShareHotGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.ActivityException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityService;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | /**
|
| | | * 淘宝商品更细
|
| | |
| | | return;
|
| | | brandClassShopService.updateShopGoods();
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | List<TaoBaoOrder> orders = map.get(key);
|
| | | String redisKey = "addorderqueue-" + key;
|
| | | String redisKey = "addorderqueue-" + TaoBaoOrderUtil.getOrderDataHashCode(orders);;
|
| | | // redis做频率限制
|
| | | try {
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(redisKey))) {
|
| | |
| | | ORDER BY co.co_third_create_time DESC LIMIT ${start},${count} ) A LEFT |
| | | JOIN yeshi_ec_user u ON u.id = A.hb_uid |
| | | </select> |
| | | |
| | | |
| | | <select id="listQueryWithNoChild" resultMap="ThreeResultMap"> |
| | | SELECT A.*,u.id AS userId,u.`nick_name` AS userName,u.`portrait` AS |
| | | userPortrait 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.* 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_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | )hb ON hb.hb_id=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 |
| | | <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 = ${key}</if> |
| | | <if test="keyType == 2 ">AND hb.hb_uid = ${key}</if> |
| | | </if> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</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 |
| | | </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 |
| | |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | </select> |
| | | |
| | | |
| | | <select id="countQueryWithNoChild" 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_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | )hb ON hb.hb_id=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 |
| | | <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 = ${key}</if> |
| | | <if test="keyType == 2 ">AND hb.hb_uid = ${key}</if> |
| | | </if> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getCouponHongbaoByOrderNo" resultMap="ResultMap"> |
| | | SELECT COALESCE(SUM(IF(hb.hb_type=1,hb.`hb_money`,0)),0)AS totalMoney, |
| | | COALESCE(SUM(IF(hb.hb_type=10,hb.`hb_money`,0)),0)AS couponMoney, |
New file |
| | |
| | | package com.yeshi.fanli.service.impl.brand;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.entity.brand.BrandClassShop;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassShopGoodsService;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | |
|
| | | @Service
|
| | | public class BrandClassShopGoodsServiceImpl implements BrandClassShopGoodsService {
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | @Resource
|
| | | private BrandClassShopService brandClassShopService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> listBrandShopGoods(Long sellerId, int page, int count) {
|
| | |
|
| | | return taoBaoGoodsBriefService.listByShopId((page - 1) * count, count, sellerId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countBrandShopGoods(Long sellerId) {
|
| | | return taoBaoGoodsBriefService.countByShopId(sellerId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void startUpdateGoods() {
|
| | | long count = brandClassShopService.countQuery(null, null, BrandClassShop.STATE_VALID);
|
| | | int page = (int) (count % 100 == 0 ? count / 100 : count / 100 + 1);
|
| | |
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<BrandClassShop> shopList = brandClassShopService.listQuery(i * 100, 100, null, null,
|
| | | BrandClassShop.STATE_VALID);
|
| | | // 每个品牌最多更新100个商品
|
| | | if (shopList != null)
|
| | | for (BrandClassShop shop : shopList) {
|
| | | Long sellerId = shop.getShop().getId();
|
| | | List<TaoBaoGoodsBrief> goodsList = listBrandShopGoods(sellerId, 1, 100);
|
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(goodsList);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | Integer type, Integer orderState, String startTime, String endTime, Integer source)
|
| | | throws CommonOrderException {
|
| | |
|
| | | List<CommonOrderVO> list = commonOrderMapper.listQuery(start, count, keyType, key, state, type, orderState,
|
| | | startTime, endTime, source);
|
| | | List<CommonOrderVO> list = null;
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(key) || keyType == 1) {// 搜索框无值或者按订单号搜索时都只搜索主订单
|
| | | list = commonOrderMapper.listQueryWithNoChild(start, count, keyType, key, state, type, orderState,
|
| | | startTime, endTime, source);
|
| | | } else
|
| | | list = commonOrderMapper.listQuery(start, count, keyType, key, state, type, orderState, startTime, endTime,
|
| | | source);
|
| | |
|
| | | if (list == null) {
|
| | | list = new ArrayList<CommonOrderVO>();
|
| | |
| | | @Override
|
| | | public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
|
| | | String startTime, String endTime, Integer source) throws CommonOrderException {
|
| | | return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime, source);
|
| | | if (StringUtil.isNullOrEmpty(key) || keyType == 1) {// 搜索框无值或者按订单号搜索时都只搜索主订单
|
| | | return commonOrderMapper.countQueryWithNoChild(keyType, key, state, type, orderState, startTime, endTime,
|
| | | source);
|
| | | } else
|
| | | return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime, source);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | return commonOrderMapper.listBySourceTypeAndStateAndThirdCrateTime(sourceType, state, minTime, maxTime,
|
| | | (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsUpdateException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityService;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> filterTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList) {
|
| | | public List<TaoBaoGoodsBrief> filterImportantTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList) {
|
| | | Map<Long, TaoBaoGoodsBrief> finalMap = new HashMap<>();
|
| | | // 原始数据全覆盖
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | |
| | | List<TaoBaoGoodsBrief> mList = taoBaoGoodsUpdateDao.listByAuctionIds(auctionIds);
|
| | | if (mList != null)
|
| | | for (TaoBaoGoodsBrief goods : mList) {
|
| | | finalMap.put(goods.getAuctionId(), goods);
|
| | | if (goods.getUpdatetime().getTime() > System.currentTimeMillis() - 1000 * 60 * 60 * 24L)// 在1天内更新的数据才参与过滤
|
| | | finalMap.put(goods.getAuctionId(), goods);
|
| | | }
|
| | |
|
| | | List<TaoBaoGoodsBrief> finalList = new ArrayList<>();
|
| | | for (TaoBaoGoodsBrief goods : goodsList)
|
| | | finalList.add(finalMap.get(goods.getAuctionId()));
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | TaoBaoGoodsBrief newGoods = finalMap.get(goods.getAuctionId());
|
| | | // 过滤价格,返利比例,券信息
|
| | | goods.setZkPrice(newGoods.getZkPrice());
|
| | | goods.setTkRate(newGoods.getTkRate());
|
| | | goods.setCouponAmount(goods.getCouponAmount());
|
| | | goods.setCouponActivityId(newGoods.getCouponActivityId());
|
| | | goods.setCouponEffectiveEndTime(newGoods.getCouponEffectiveEndTime());
|
| | | goods.setCouponEffectiveStartTime(newGoods.getCouponEffectiveStartTime());
|
| | | goods.setCouponStartFee(newGoods.getCouponStartFee());
|
| | | goods.setCouponTotalCount(newGoods.getCouponTotalCount());
|
| | | goods.setCouponLeftCount(newGoods.getCouponLeftCount());
|
| | |
|
| | | finalList.add(goods);
|
| | | }
|
| | | return finalList;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int listAndRemoveByMaxUpdateTime(Date maxTime, int page, int pageSize) {
|
| | | return taoBaoGoodsUpdateDao.listAndRemoveByMaxUpdateTime(maxTime, (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByMaxUpdateTime(Date maxTime) {
|
| | | return taoBaoGoodsUpdateDao.countByMaxUpdateTime(maxTime);
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.taobao;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | | import java.util.HashSet;
|
| | | import java.util.Iterator;
|
| | |
| | | @Resource
|
| | | private TaoBaoOrderTradeMapMapper taoBaoOrderTradeMapMapper;
|
| | |
|
| | | /**
|
| | | * 获取订单的哈希值
|
| | | * |
| | | * @param list
|
| | | * @return
|
| | | */
|
| | |
|
| | | @Override
|
| | | public void addTaoBaoOrderList(List<TaoBaoOrder> list) {
|
| | | if (list == null || list.size() == 0)
|
| | |
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String orderId = its.next();
|
| | | String key = "addorder-" + orderId;
|
| | | String key = "addorder-" + TaoBaoOrderUtil.getOrderDataHashCode(map.get(orderId));
|
| | | // redis做频率限制
|
| | | try {
|
| | | if (Constant.IS_OUTNET) {
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.brand;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
|
| | | /**
|
| | | * 品牌店铺商品服务
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface BrandClassShopGoodsService {
|
| | |
|
| | | /**
|
| | | * 总的品牌店铺商品列表
|
| | | * |
| | | * @param page
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public List<TaoBaoGoodsBrief> listBrandShopGoods(Long sellerId, int page, int count);
|
| | |
|
| | | /**
|
| | | * 总的品牌店铺商品数量
|
| | | * |
| | | * @return
|
| | | */
|
| | | public long countBrandShopGoods(Long sellerId);
|
| | |
|
| | | /**
|
| | | * 更新品牌商品的数据
|
| | | */
|
| | | public void startUpdateGoods();
|
| | |
|
| | | }
|
| | |
| | |
|
| | | public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
|
| | | String startTime, String endTime, Integer source) throws CommonOrderException;
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询订单
|
| | | *
|
| | |
| | | package com.yeshi.fanli.service.inter.taobao;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | * @param goodsList
|
| | | * @return
|
| | | */
|
| | | public List<TaoBaoGoodsBrief> filterTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList);
|
| | | public List<TaoBaoGoodsBrief> filterImportantTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList);
|
| | |
|
| | | /**
|
| | | * 根据最大的更新时间移除
|
| | | * |
| | | * @param maxTime
|
| | | * @return
|
| | | */
|
| | | public int listAndRemoveByMaxUpdateTime(Date maxTime,int page,int pageSize);
|
| | |
|
| | | /**
|
| | | * 根据最大更新时间计算
|
| | | * @param maxTime
|
| | | * @return
|
| | | */
|
| | | public long countByMaxUpdateTime(Date maxTime);
|
| | |
|
| | | }
|
| | |
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | try {
|
| | | long startTime = System.currentTimeMillis();
|
| | | TaoBaoGoodsBrief goods = TaoKeApiUtil.searchGoodsDetail(map.get(key));
|
| | | // 更新一条数据需要的时间
|
| | | taoBaoGoodsUpdateService.updateTaoBaoGoods(goods);
|
| | | long time = System.currentTimeMillis() - startTime;
|
| | | LogHelper.test("淘宝重要商品库更新时间:" + time);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | // 自购立减PID
|
| | | public static TaoKeAppInfo ownBuyApp = new TaoKeAppInfo("24937414", "0457746e24622a6c8c7924288550af5f",
|
| | | "mm_133239778_45820106_699710614");
|
| | | |
| | | public static TaoKeAppInfo[] ownBuyApps=new TaoKeAppInfo[]{
|
| | | new TaoKeAppInfo("27759529", "2c0ecd37cf53eff0439a386c4eba2772","mm_472550068_628200329_109272850337"),
|
| | | new TaoKeAppInfo("27743325", "527a23554f71557d7b786bc479fcd5fe","mm_472720008_629400173_109272950312"),
|
| | | new TaoKeAppInfo("27770097", "fd896b718e2b0a833f0b7524cb83d092","mm_474720121_631000170_109273750171"),
|
| | | new TaoKeAppInfo("27762518", "2b2077798b7f8c5c94d337ac69d86a83","mm_474970057_635750171_109272950316"),
|
| | | new TaoKeAppInfo("27757101", "47921196e59a7999637269f486865096","mm_476760152_635550267_109272750381"),
|
| | | };
|
| | |
|
| | | public static BigDecimal OWN_BUY_WITHOUT_FANLI_RATE = new BigDecimal(70);// 自购立减的比例
|
| | |
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.Iterator;
|
| | |
| | | return commonOrder;
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取一组订单的hash值
|
| | | * |
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | public static String getOrderDataHashCode(List<TaoBaoOrder> list) {
|
| | | List<TaoBaoOrder> orderList = new ArrayList<>();
|
| | | orderList.addAll(list);
|
| | | Comparator<TaoBaoOrder> orderCM = new Comparator<TaoBaoOrder>() {
|
| | |
|
| | | @Override
|
| | | public int compare(TaoBaoOrder o1, TaoBaoOrder o2) {
|
| | | return Long.parseLong(o1.getTradeId()) - Long.parseLong(o2.getTradeId()) > 0 ? 1 : -1;
|
| | | }
|
| | | };
|
| | | Collections.sort(orderList, orderCM);
|
| | | String sts = "";
|
| | | for (TaoBaoOrder order : orderList) {
|
| | | sts += order.getTradeId();
|
| | | }
|
| | | return StringUtil.Md5(sts);
|
| | | }
|
| | | }
|