| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.service.manger.order.TeamRewardManager;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Propagation;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoV2AddManager hongBaoV2AddManager;
|
| | |
|
| | | @Resource
|
| | | private TeamRewardManager teamRewardManager;
|
| | |
|
| | | /**
|
| | | * 是否是分享订单
|
| | |
| | | new Date(TimeUtil.convertToTimeTemp(orderList.get(0).getSettlementTime(), "yyyy-MM-dd HH:mm:ss")));
|
| | |
|
| | | // 处理维权成功但是已到账的订单
|
| | | if (order.getJieSuanTime().getTime() > TimeUtil.convertToTimeTemp("2019-01-01", "yyyy-MM-dd")) {// 结算时间在2月1号的开始处理已到账但是维权的
|
| | | if (order.getJieSuanTime().getTime() > TimeUtil.convertToTimeTemp("2019-01-01", "yyyy-MM-dd")) {// 结算时间在1月1号的开始处理已到账但是维权的
|
| | | CommonOrder commonOrder = commonOrderService.selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO,
|
| | | order.getOrderItemId());
|
| | | if (commonOrder != null && !StringUtil.isNullOrEmpty(commonOrder.getTradeId())) {
|
| | |
| | | try {
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanFanli(order.getOrderId(), true);
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanShare(order.getOrderId());
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanInvite(order.getOrderId());
|
| | | } catch (TaoBaoWeiQuanException e) {
|
| | | teamRewardManager.weiQuan(order.getOrderId(), Constant.SOURCE_TYPE_TAOBAO, order.getOrderItemId());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "到账后处理维权扣款出错", "订单号:" + order.getOrderId());
|
| | | } catch (Exception e1) {
|
| | |
| | | }
|
| | | }
|
| | | } else {
|
| | | // 查询子红包是否已到账
|
| | | List<HongBaoV2> children = hongBaoV2Service
|
| | | .listChildrenById(hongBaoOrder.getHongBaoV2().getId());
|
| | | for (HongBaoV2 hongBaoV2 : children) {
|
| | | if (hongBaoV2.getState() == HongBaoV2.STATE_YILINGQU) {
|
| | | try {
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanInvite(order.getOrderId());
|
| | | } catch (TaoBaoWeiQuanException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "到账后处理维权扣款出错", "订单号:" + order.getOrderId());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | break;
|
| | | try {
|
| | | // taoBaoWeiQuanDrawBackService.doWeiQuanInvite(order.getOrderId());
|
| | | teamRewardManager.weiQuan(order.getOrderId(), Constant.SOURCE_TYPE_TAOBAO, order.getOrderItemId());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "到账后处理维权扣款出错", "订单号:" + order.getOrderId());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | // @Transactional(rollbackFor = Exception.class)
|
| | | // @Transactional(rollbackFor = Exception.class)
|
| | | public void fanliPreInvaite(Long uid, Date maxPreGetTime) {
|
| | | // 邀请赚到账
|
| | | try {
|
| | |
| | | // 返利到账
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 添加红包与事务消息
|
| | | *
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void invalidTaoBaoOrder(String tradeId) {
|
| | | TaoBaoOrder taoBaoOrder = taoBaoOrderService.selectByTradeId(tradeId);
|
| | | //订单付款和订单成功的状态才允许失效
|
| | | if (taoBaoOrder != null && ("订单付款".equalsIgnoreCase(taoBaoOrder.getOrderState()) || "订单成功".equalsIgnoreCase(taoBaoOrder.getOrderState()))) {
|
| | | TaoBaoOrder update = new TaoBaoOrder();
|
| | | update.setId(taoBaoOrder.getId());
|
| | | update.setLatestUpdateTime(new Date());
|
| | | update.setOrderState("订单失效");
|
| | | taoBaoOrderService.updateSelectiveByPrimaryKey(update);
|
| | | CMQManager.getInstance().addTaoBaoOrderMsg(taoBaoOrder.getOrderId());
|
| | | }
|
| | | }
|
| | |
|
| | | }
|