| | |
| | | } |
| | | Map<Long, Boolean> vipUserMap = userVIPInfoService.listByUids(needSelectVIPUidList); |
| | | |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | for (CommonOrderVO order : listOrder) { |
| | | |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) { |
| | | Integer urank = order.getUrank(); |
| | | if (urank != null) { |
| | | String levelName = UserLevelUtil.getLevelName(urank); |
| | | if (!StringUtil.isNullOrEmpty(levelName)) { |
| | | order.setOrderDesc(levelName); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | // 设置是否为vip订单 |
| | | for (CommonOrderVO order : listOrder) { |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) { |
| | | if (vipUserMap.get(Long.parseLong(order.getUserId())) != null |
| | | && vipUserMap.get(Long.parseLong(order.getUserId())) == true) |
| | | order.setVipOrder(true); |
| | | else |
| | | order.setVipOrder(false); |
| | | } else |
| | | // 设置是否为vip订单 |
| | | for (CommonOrderVO order : listOrder) { |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) { |
| | | if (vipUserMap.get(Long.parseLong(order.getUserId())) != null |
| | | && vipUserMap.get(Long.parseLong(order.getUserId())) == true) |
| | | order.setVipOrder(true); |
| | | else |
| | | order.setVipOrder(false); |
| | | } else |
| | | order.setVipOrder(false); |
| | | |
| | | if (order.isVipOrder()) |
| | | order.setVipOrderDesc("订单来源:由超级会员的粉丝产生"); |
| | | } |
| | | if (order.isVipOrder()) |
| | | order.setVipOrderDesc("订单来源:由超级会员的粉丝产生"); |
| | | } |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm"); |
| | |
| | | boolean vip = userVIPInfoService.isVIP(uid); |
| | | // 是否存在奖励券 |
| | | boolean hasRewardCoupon = userSystemCouponService.getValidRebateCoupon(uid); |
| | | long nowTime = java.lang.System.currentTimeMillis(); |
| | | for (CommonOrderVO order : listOrder) { |
| | | String orderNo = order.getOrderNo(); |
| | | Integer sourceType = order.getSourceType(); |
| | | Integer hongBaoType = order.getHongBaoType(); |
| | | |
| | | BigDecimal totalPay = new BigDecimal(0); |
| | | BigDecimal totalActual = new BigDecimal(0); |
| | | // 商品信息组合 |
| | | for (CommonOrderVO commonOrder : listGoods) { |
| | | CommonOrderGoods goods = commonOrder.getCommonOrderGoods(); |
| | |
| | | } |
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement); |
| | | |
| | | totalPay = MoneyBigDecimalUtil.add(totalPay, totalSettlement); |
| | | |
| | | // 商品价格 |
| | | BigDecimal actualPrice = commonGoodsVO.getActualPrice(); |
| | | if (actualPrice != null) { |
| | | Integer totalCount = commonOrder.getTotalCount(); |
| | | totalActual = MoneyBigDecimalUtil.add(totalActual, |
| | | MoneyBigDecimalUtil.mul(new BigDecimal(totalCount), actualPrice)); |
| | | } |
| | | |
| | | // 邀请订单信息保护 |
| | | if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType |
| | |
| | | Date thirdCreateTime = order.getThirdCreateTime(); |
| | | order.setDownTime("下单时间:" + format.format(thirdCreateTime)); |
| | | order.setObtainTime(thirdCreateTime.getTime()); |
| | | |
| | | // 2.1分享订单和返利订单实付金额大于或者小于券后价的时候,订单页面 只显示3天 下单时间开始 |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | if (HongBaoV2.TYPE_SHARE_YIJI == hongBaoType |
| | | && DateUtil.plusDayDate(3, thirdCreateTime).getTime() > nowTime |
| | | && totalPay.compareTo(totalActual) != 0) { |
| | | order.setFanliDesc("由实付金额*返利比计算而来"); |
| | | order.setFanliDescLink(configService.get(ConfigKeyEnum.shareOrderRebateDescLink.getKey())); |
| | | } |
| | | } |
| | | |
| | | Date settleTime = order.getSettleTime(); |
| | | if (settleTime != null) { |
| | |
| | | if (!Constant.IS_TEST) { |
| | | // 统计结算金额 |
| | | BigDecimal settlement = new BigDecimal("0"); |
| | | CommonOrder firstOrder = null; |
| | | for (CommonOrderAddResultDTO dto : resultList) |
| | | if (dto.getCommonOrder().getSettlement() != null) |
| | | if (dto.getCommonOrder().getSettlement() != null) { |
| | | settlement = settlement.add(dto.getCommonOrder().getSettlement()); |
| | | CommonOrder firstOrder=resultList.get(0).getCommonOrder(); |
| | | OrderConfirmMQMsg mqMsg = new OrderConfirmMQMsg(firstOrder.getOrderNo(), |
| | | firstOrder.getSourceType(), settlement, firstOrder.getUserInfo().getId(), |
| | | new Date()); |
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderConfirm, mqMsg); |
| | | orderProducer.send(msg); |
| | | if (firstOrder == null) |
| | | firstOrder = dto.getCommonOrder(); |
| | | } |
| | | if (firstOrder != null) { |
| | | Date placeDate = firstOrder.getThirdCreateTime(); |
| | | OrderConfirmMQMsg mqMsg = new OrderConfirmMQMsg(firstOrder.getOrderNo(), firstOrder.getSourceType(), |
| | | settlement, firstOrder.getUserInfo().getId(), placeDate, new Date()); |
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderConfirm, |
| | | mqMsg); |
| | | orderProducer.send(msg); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) |
| | | needSelectVIPUidList.add(Long.parseLong(order.getUserId())); |
| | | } |
| | | Map<Long, Boolean> vipUserMap = userVIPInfoService.listByUids(needSelectVIPUidList); |
| | | |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | for (CommonOrderVO order : listOrder) { |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) { |
| | | Integer urank = order.getUrank(); |
| | | if (urank != null) { |
| | | String levelName = UserLevelUtil.getLevelName(urank); |
| | | if (!StringUtil.isNullOrEmpty(levelName)) { |
| | | order.setOrderDesc(levelName); |
| | | } |
| | | for (CommonOrderVO order : listOrder) { |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) { |
| | | Integer urank = order.getUrank(); |
| | | if (urank != null) { |
| | | String levelName = UserLevelUtil.getLevelName(urank); |
| | | if (!StringUtil.isNullOrEmpty(levelName)) { |
| | | order.setOrderDesc("订单来源:" + levelName); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } else { |
| | | // 设置是否为vip订单 |
| | | for (CommonOrderVO order : listOrder) { |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) { |
| | | if (vipUserMap.get(Long.parseLong(order.getUserId())) != null |
| | | && vipUserMap.get(Long.parseLong(order.getUserId())) == true) |
| | | order.setVipOrder(true); |
| | | else |
| | | order.setVipOrder(false); |
| | | } else |
| | | order.setVipOrder(false); |
| | | |
| | | if (order.isVipOrder()) |
| | | order.setVipOrderDesc("订单来源:由超级会员的粉丝产生"); |
| | | } |
| | | } |
| | | |
| | |
| | | // 是否存在奖励券 |
| | | boolean hasRewardCoupon = userSystemCouponService.getValidRebateCoupon(uid); |
| | | |
| | | long nowTime = java.lang.System.currentTimeMillis(); |
| | | for (CommonOrderVO order : listOrder) { |
| | | String orderNo = order.getOrderNo(); |
| | | Integer sourceType = order.getSourceType(); |
| | | Integer hongBaoType = order.getHongBaoType(); |
| | | |
| | | BigDecimal totalPay = new BigDecimal(0); |
| | | BigDecimal totalActual = new BigDecimal(0); |
| | | |
| | | // 商品信息组合 |
| | | for (CommonOrderVO commonOrder : listGoods) { |
| | |
| | | } |
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement); |
| | | |
| | | totalPay = MoneyBigDecimalUtil.add(totalPay, totalSettlement); |
| | | |
| | | // 商品价格 |
| | | BigDecimal actualPrice = commonGoodsVO.getActualPrice(); |
| | | if (actualPrice != null) { |
| | | Integer totalCount = commonOrder.getTotalCount(); |
| | | totalActual = MoneyBigDecimalUtil.add(totalActual, |
| | | MoneyBigDecimalUtil.mul(new BigDecimal(totalCount), actualPrice)); |
| | | } |
| | | |
| | | // 邀请订单信息保护 |
| | | if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType |
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType |
| | |
| | | order.setOrderType(2); |
| | | } |
| | | } |
| | | |
| | | Integer goodsType = commonGoodsVO.getGoodsType(); |
| | | if (goodsType != null & goodsType == 6) { |
| | | order.setOrderType(5); // 饿了么订单 |
| | | } |
| | | |
| | | order.getListOrderGoods().add(commonGoodsVO); |
| | | } |
| | |
| | | if (thirdCreateTime != null) { |
| | | order.setDownTime("下单时间:" + format.format(thirdCreateTime)); |
| | | order.setObtainTime(thirdCreateTime.getTime()); |
| | | } |
| | | |
| | | // 2.1分享订单和返利订单实付金额大于或者小于券后价的时候,订单页面 只显示3天 下单时间开始 |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType |
| | | && DateUtil.plusDayDate(3, thirdCreateTime).getTime() > nowTime |
| | | && totalPay.compareTo(totalActual) != 0) { |
| | | order.setFanliDesc("由实付金额*返利比计算而来"); |
| | | order.setFanliDescLink(configService.get(ConfigKeyEnum.shareOrderRebateDescLink.getKey())); |
| | | } |
| | | } |
| | | |
| | | Date settleTime = order.getSettleTime(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // 2.1显示返利说明连接> |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | if (CommonOrder.STATE_SX != orderState && thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME)) { |
| | | String rebateLink = configService.get(ConfigKeyEnum.orderRebateDescLink.getKey()); |
| | | order.setRebateLink(rebateLink + "?orderNo=" + orderNo +"&sourceType=" + sourceType); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | BigDecimal hongBao = order.getHongBao(); |
| | | if (hongBao == null) { |
| | | hongBao = new BigDecimal(0); |