| | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.service.inter.order.pdd.PDDOrderService; |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Service |
| | | public class CommonOrderServiceImpl implements CommonOrderService { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger(CommonOrderService.class); |
| | | |
| | | |
| | | @Resource |
| | | private CommonOrderMapper commonOrderMapper; |
| | |
| | | // 判断所有的订单状态 |
| | | int invalidCount = 0; |
| | | for (TaoBaoOrder tb : taoBaoOrders) { |
| | | if ("订单失效" .equalsIgnoreCase(tb.getOrderState())) { |
| | | if ("订单失效".equalsIgnoreCase(tb.getOrderState())) { |
| | | invalidCount++; |
| | | } |
| | | } |
| | |
| | | CommonOrder newCommonOrder = CommonOrderFactory.create(taoBaoOrder); |
| | | CommonOrderGoods cog = new CommonOrderGoods(); |
| | | |
| | | if ("饿了么" .equalsIgnoreCase(taoBaoOrder.getOrderType())) { |
| | | if ("饿了么".equalsIgnoreCase(taoBaoOrder.getOrderType())) { |
| | | cog.setGoodsId(taoBaoOrder.getTradeId() + ""); |
| | | cog.setGoodsType(Constant.SOURCE_TYPE_ELME); |
| | | TaoBaoOrderGoods goods = taoBaoOrderGoodsMapper.selectByTradeId(taoBaoOrder.getTradeId()); |
| | |
| | | taoBaoGoods.getRootCategoryName(), taoBaoGoods.getLeafName())); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | LogHelper.errorDetailInfo(e, "AUCTIONID:" + taoBaoOrder.getAuctionId(), ""); |
| | | logger.warn("淘宝商品下架:{}", taoBaoOrder.getAuctionId(), e); |
| | | try { |
| | | taoBaoGoods = TaoBaoUtil.getSimpleGoodsBrief(taoBaoOrder.getAuctionId()); |
| | | // 记录商品分类 |
| | | |
| | | } catch (Exception e1) { |
| | | CommonGoods commonGoods = commonGoodsService.getCommonGoodsByGoodsIdAndGoodsType( |
| | | taoBaoOrder.getAuctionId(), Constant.SOURCE_TYPE_TAOBAO); |
| | |
| | | // 判断所有的订单状态 |
| | | int invalidCount = 0; |
| | | for (SuningOrderInfo order : suningOrderList) { |
| | | if ("退款" .equalsIgnoreCase(order.getOrderLineStatusDesc()) |
| | | || "订单已取消" .equalsIgnoreCase(order.getOrderLineStatusDesc())) { |
| | | if ("退款".equalsIgnoreCase(order.getOrderLineStatusDesc()) |
| | | || "订单已取消".equalsIgnoreCase(order.getOrderLineStatusDesc())) { |
| | | invalidCount++; |
| | | } |
| | | } |
| | |
| | | return commonOrderMapper.listByGoodsIdAndUidAndMinThirdCreateTime(goodsId, uid, minThirdCreateTime, 0, 1000); |
| | | } |
| | | |
| | | @Override |
| | | public List<CommonOrder> listPayStateOrder(int sourceType, Date minThirdCreateTime, Date maxThirdCreateTime) { |
| | | CommonOrderMapper.DaoQuery daoQuery = new CommonOrderMapper.DaoQuery(); |
| | | daoQuery.minThirdCreateTime = minThirdCreateTime; |
| | | daoQuery.maxThirdCreateTime = maxThirdCreateTime; |
| | | daoQuery.state = CommonOrder.STATE_FK; |
| | | daoQuery.sourceType = sourceType; |
| | | daoQuery.sortList = Arrays.asList(new String[]{"co_third_create_time ASC"}); |
| | | return commonOrderMapper.list(daoQuery, 0, 200); |
| | | } |
| | | |
| | | } |