| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap;
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | @Resource
|
| | | private UserOrderMsgNotificationService userOrderMsgNotificationService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void processOrder(ElmeOrder elmeOrder) throws ElmeOrderException {
|
| | |
| | | ElmeHongBaoOrderMap map = elmeHongBaoOrderMapService.selectByOrderId(elmeOrder.getId());
|
| | | if (map == null)// 订单不存在
|
| | | {
|
| | | String rid = elmeOrder.getRid();
|
| | | if (StringUtil.isNullOrEmpty(rid))
|
| | | Long uid = null;
|
| | | if (StringUtil.isNullOrEmpty(elmeOrder.getChannelId())) {//新版本
|
| | | UserExtraTaoBaoInfo extra = userExtraTaoBaoInfoService.getByRelationId(elmeOrder.getRid());
|
| | | if (extra != null)
|
| | | uid = extra.getUser().getId();
|
| | | } else {//老版本
|
| | | uid = Long.parseLong(elmeOrder.getRid());
|
| | | }
|
| | |
|
| | | if (uid == null)
|
| | | return;
|
| | |
|
| | | // 查询映射用户
|
| | | UserInfo user = userInfoService.selectByPKey(Long.parseLong(rid));
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | | if (user == null)
|
| | | return;
|
| | | // 制造hongbao
|