| | |
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory; |
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName; |
| | | import com.yeshi.fanli.util.suning.SuningApiUtil; |
| | | import com.yeshi.fanli.util.suning.SuningUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.util.user.UserLevelUtil; |
| | |
| | | |
| | | @Service |
| | | public class CommonOrderServiceImpl implements CommonOrderService { |
| | | |
| | | |
| | | @Resource |
| | | private CommonOrderMapper commonOrderMapper; |
| | |
| | | { |
| | | SuningGoodsInfo pddGoods = null; |
| | | // TODO 需要获取 |
| | | pddGoods = SuningApiUtil.getGoodsDetail(suningOrderInfo.getGoodsNum(), suningOrderInfo.getSellerCode()); |
| | | pddGoods = SuningApiUtil.getGoodsDetail(suningOrderInfo.getGoodsNum(), "00000000"); |
| | | if (pddGoods != null) { |
| | | cog = CommonOrderGoodsFactory.create(pddGoods); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public long countOrderList(Long uid, Integer state, Integer type, Integer orderState, String orderNo, |
| | | String startTime, String endTime, Integer dateType, List<Integer> listSource) |
| | | throws CommonOrderException { |
| | | String startTime, String endTime, Integer dateType, List<Integer> listSource) { |
| | | return commonOrderMapper.countOrderList(uid, state, type, orderState, orderNo, startTime, endTime, dateType, |
| | | listSource); |
| | | } |
| | |
| | | List<String> listTB = new ArrayList<String>(); |
| | | List<String> listJD = new ArrayList<String>(); |
| | | List<String> listPDD = new ArrayList<String>(); |
| | | List<String> listVIP = new ArrayList<String>(); |
| | | List<String> listSuNing = new ArrayList<String>(); |
| | | for (CommonOrderVO order : listOrder) { |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_YIJI |
| | |
| | | listJD.add(order.getOrderNo()); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) { |
| | | listPDD.add(order.getOrderNo()); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_VIP) { |
| | | listVIP.add(order.getOrderNo()); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_SUNING) { |
| | | listSuNing.add(order.getOrderNo()); |
| | | } |
| | | } |
| | | |
| | |
| | | if (listPDD.size() > 0) { |
| | | listRecordPDD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_PDD, listPDD); |
| | | } |
| | | |
| | | List<UserSystemCouponRecord> listRecordVIP = null; |
| | | if (listVIP.size() > 0) { |
| | | listRecordVIP = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_VIP, listVIP); |
| | | } |
| | | |
| | | List<UserSystemCouponRecord> listRecordSuNing = null; |
| | | if (listSuNing.size() > 0) { |
| | | listRecordSuNing = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_SUNING, listSuNing); |
| | | } |
| | | |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm"); |
| | | SimpleDateFormat formatday = new SimpleDateFormat("yyyy.MM.dd"); |
| | |
| | | Integer goodsType = commonGoodsVO.getGoodsType(); |
| | | if (goodsType != null & goodsType == Constant.SOURCE_TYPE_ELME) { |
| | | order.setOrderType(Constant.SOURCE_TYPE_ELME); // 饿了么订单 |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | commonGoodsVO.setGoodsId(SuningUtil.getConcatGoodsIId(commonGoodsVO.getShopId() +"", commonGoodsVO.getGoodsId())); |
| | | } |
| | | order.getListOrderGoods().add(commonGoodsVO); |
| | | } |
| | |
| | | couponUseFactory(order, listRecordJD); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) { |
| | | couponUseFactory(order, listRecordPDD); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_VIP) { |
| | | couponUseFactory(order, listRecordVIP); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_SUNING) { |
| | | couponUseFactory(order, listRecordSuNing); |
| | | } |
| | | } else if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) { |
| | | // 分享 |