| | |
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.log.LogManager;
|
| | | import com.yeshi.fanli.log.LogType;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemCouponService;
|
| | |
| | | if (source != null) {
|
| | | listSource.add(source);
|
| | | }
|
| | | |
| | |
|
| | | return commonOrderMapper.listUserOrder(start, count, uid, state, type, orderState, orderNo, startTime, endTime,
|
| | | dateType, listSource);
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public List<CommonOrderVO> getOrderByUid(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, List<Integer> listSource)
|
| | | throws CommonOrderException, Exception {
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType,
|
| | | List<Integer> listSource) throws CommonOrderException, Exception {
|
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | | List<CommonOrderVO> listOrder = commonOrderMapper.listUserOrder((page - 1) * pageSize, pageSize, uid, state, type, |
| | | orderState, orderNo, startTime, endTime, dateType, listSource);
|
| | | List<CommonOrderVO> listOrder = commonOrderMapper.listUserOrder((page - 1) * pageSize, pageSize, uid, state,
|
| | | type, orderState, orderNo, startTime, endTime, dateType, listSource);
|
| | |
|
| | | // 订单信息为空
|
| | | if (listOrder == null || listOrder.size() == 0) {
|
| | |
| | | return;
|
| | |
|
| | | // 下单日期是否是符合上线日期
|
| | | long downOrderTime = thirdCreateTime.getTime(); |
| | | long downOrderTime = thirdCreateTime.getTime();
|
| | | long limitDate = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
|
| | | if (downOrderTime > limitDate) { |
| | | if (downOrderTime > limitDate) {
|
| | | // 2.1 开始新版
|
| | | rewardCounponLimitTime(order, accountTime);
|
| | | } else if (hasRewardCoupon) {
|
| | |
| | | return commonOrderMapper.listBySourceTypeAndOrderNo(sourceType, orderId);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public List<CommonOrderAddResultDTO> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrders, Long uid)
|
| | | throws CommonOrderException {
|
| | |
| | | TaoBaoGoodsBrief taoBaoGoods = null;
|
| | | try {
|
| | | taoBaoGoods = TaoKeApiUtil.getSimpleGoodsInfo(taoBaoOrder.getAuctionId());
|
| | | LogManager.getLogger(LogType.taobaoGoods).info(String.format("订单商品分类:%s#%s#%s",
|
| | | taoBaoGoods.getAuctionId(), taoBaoGoods.getRootCategoryName(), taoBaoGoods.getLeafName()));
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e, "AUCTIONID:" + taoBaoOrder.getAuctionId(), "");
|
| | | try {
|
| | | taoBaoGoods = TaoBaoUtil.getSimpleGoodsBrief(taoBaoOrder.getAuctionId());
|
| | | // 记录商品分类
|
| | |
|
| | | } catch (Exception e1) {
|
| | | CommonGoods commonGoods = commonGoodsService.getCommonGoodsByGoodsIdAndGoodsType(
|
| | | taoBaoOrder.getAuctionId(), Constant.SOURCE_TYPE_TAOBAO);
|
| | |
| | | return commonOrderList;
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public List<CommonOrderAddResultDTO> addPDDOrder(List<PDDOrder> pddOrderList, Long uid)
|
| | | throws CommonOrderException {
|
| | |
| | | return commonOrderList;
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public List<CommonOrderAddResultDTO> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException {
|
| | | List<CommonOrderAddResultDTO> commonOrderList = new ArrayList<>();
|
| | |
| | | *
|
| | | * @param commonOrder
|
| | | */
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private CommonOrderAddResultDTO addCommonOrder(CommonOrder commonOrder) throws CommonOrderException {
|
| | | // 判断商品是否存在
|
| | | if (commonOrder == null)
|
| | |
| | | public long count24HValidOrderByUid(Long uid, Date minTime) {
|
| | | return commonOrderMapper.count24HValidOrderByUid(uid, minTime);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public long countSearchOrderByUid(Long uid, List<ESOrder> list) {
|
| | | return commonOrderMapper.countSearchOrderByUid(uid, list);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<CommonOrderVO> searchOrderByUid (int page, int size, Long uid, List<ESOrder> list) throws Exception {
|
| | | List<CommonOrderVO> listVO = commonOrderMapper.searchOrderByUid((page-1) * size, size, uid, list);
|
| | | public List<CommonOrderVO> searchOrderByUid(int page, int size, Long uid, List<ESOrder> list) throws Exception {
|
| | | List<CommonOrderVO> listVO = commonOrderMapper.searchOrderByUid((page - 1) * size, size, uid, list);
|
| | |
|
| | | // 订单信息为空
|
| | | if (listVO == null || listVO.size() == 0) {
|
| | |
| | |
|
| | | // 数据加工重新组织
|
| | | orderVOFactoryNew(listVO, listGoods, uid);
|
| | | |
| | |
|
| | | return listVO;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 订单信息加工
|
| | | *
|
| | |
| | | * @param listGoods
|
| | | * @param uid
|
| | | */
|
| | | private void orderVOFactoryNew(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) throws Exception {
|
| | | private void orderVOFactoryNew(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid)
|
| | | throws Exception {
|
| | | List<String> listTB = new ArrayList<String>();
|
| | | List<String> listJD = new ArrayList<String>();
|
| | | List<String> listPDD = new ArrayList<String>();
|
| | |
| | | orderStateContent = "售后成功";
|
| | | WeiQuanInfo weiQuanInfo = new WeiQuanInfo();
|
| | | weiQuanInfo.setOldHongBao("¥" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | weiQuanInfo
|
| | | .setWqHongBao("售后:-¥" + weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | weiQuanInfo.setWqHongBao("售后:-¥" + weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | hongBao = MoneyBigDecimalUtil.sub(hongBao, weiQuanMoney);
|
| | | order.setWeiQuanInfo(weiQuanInfo);
|
| | | }
|
| | |
| | | signList.add(CommonOrder.TYPE_INVITE);
|
| | |
|
| | | // 超级会员补贴信息
|
| | | InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid,
|
| | | order.getOrderNo(), sourceType);
|
| | | InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid, order.getOrderNo(),
|
| | | sourceType);
|
| | | if (orderSubsidy != null) {
|
| | | ClientTextStyleVO subsidyInfo = new ClientTextStyleVO();
|
| | | subsidyInfo.setContent("(补贴¥" + orderSubsidy.getMoney() + ")");
|
| | |
| | | * @param list
|
| | | * @param signList
|
| | | */
|
| | | private void couponFactoryNew(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState, Integer hongBaoType,
|
| | | List<UserSystemCouponRecord> list, Long uid, boolean vip) throws Exception {
|
| | | private void couponFactoryNew(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState,
|
| | | Integer hongBaoType, List<UserSystemCouponRecord> list, Long uid, boolean vip) throws Exception {
|
| | | // 是否免单商品
|
| | | boolean freeOrder = false;
|
| | | // 是否奖励成功
|
| | |
| | | // 下单日期是否是符合上线日期
|
| | | long downOrderTime = thirdCreateTime.getTime();
|
| | | long limitDate = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
|
| | | if (downOrderTime > limitDate) {
|
| | | if (downOrderTime > limitDate) {
|
| | | // 2.1 开始新版
|
| | | rewardCounponLimitTime(order, accountTime);
|
| | | } else if (hasRewardCoupon) {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|