| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanDrawBackService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyService;
|
| | | import com.yeshi.fanli.service.inter.user.UserNotificationService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private UserNotificationService userNotificationService;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderMapper commonOrderMapper;
|
| | |
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.fanliOrderWeiQuan(uid, orderId,Constant.SOURCE_TYPE_TAOBAO, drawBackMoney,
|
| | | userInfoMapper.selectByPKey(uid).getMyHongBao());
|
| | |
|
| | | userNotificationService.weiQuanFanli(uid, orderId, drawBackMoney);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | userMoneyService.subUserMoney(uid, drawBackMoney, userMoneyDetail);
|
| | |
|
| | | userMoneyMsgNotificationService.shareOrderWeiQuan(uid, orderId, Constant.SOURCE_TYPE_TAOBAO,drawBackMoney,
|
| | | userInfoMapper.selectByPrimaryKey(uid).getMyHongBao());
|
| | |
|
| | | userNotificationService.weiQuanTiCheng(uid, orderId, drawBackMoney);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | weiQuanDrawBack.setUser(child.getUserInfo());
|
| | | taoBaoWeiQuanDrawBackMapper.insertSelective(weiQuanDrawBack);// 加入返还记录
|
| | |
|
| | | // 判断资金是否足够扣款
|
| | | UserInfo user = userInfoMapper.selectByPKey(uid);
|
| | | if (user != null && user.getMyHongBao().compareTo(drawBackMoney) < 0)// 资金不足
|
| | | {
|
| | | try {
|
| | | addDebt(uid, child.getId(), drawBackMoney);
|
| | | } catch (UserMoneyDebtException e) {
|
| | | throw new TaoBaoWeiQuanException(101, "资金借贷异常");
|
| | | // 如果资金大于0才扣除
|
| | |
|
| | | if (drawBackMoney != null && drawBackMoney.compareTo(new BigDecimal(0)) > 0) {
|
| | |
|
| | | // 判断资金是否足够扣款
|
| | | UserInfo user = userInfoMapper.selectByPKey(uid);
|
| | | if (user != null && user.getMyHongBao().compareTo(drawBackMoney) < 0)// 资金不足
|
| | | {
|
| | | try {
|
| | | addDebt(uid, child.getId(), drawBackMoney);
|
| | | } catch (UserMoneyDebtException e) {
|
| | | throw new TaoBaoWeiQuanException(101, "资金借贷异常");
|
| | | }
|
| | | continue;
|
| | | }
|
| | | continue;
|
| | | }
|
| | |
|
| | | UserMoneyDetail userMoneyDetail = null;
|
| | | // 新版资金记录
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createInviteWeiQuan(uid, weiQuanDrawBack,
|
| | | drawBackMoney);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | UserMoneyDetail userMoneyDetail = null;
|
| | | // 新版资金记录
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | userMoneyDetail = UserMoneyDetailFactory.createInviteWeiQuan(uid, weiQuanDrawBack,
|
| | | drawBackMoney);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | userMoneyService.subUserMoney(uid, drawBackMoney, userMoneyDetail);
|
| | | userMoneyService.subUserMoney(uid, drawBackMoney, userMoneyDetail);
|
| | |
|
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.inviteOrderWeiQuan(uid, orderId,Constant.SOURCE_TYPE_TAOBAO, drawBackMoney,
|
| | | userInfoMapper.selectByPrimaryKey(uid).getMyHongBao());
|
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.inviteOrderWeiQuan(uid, orderId,Constant.SOURCE_TYPE_TAOBAO, drawBackMoney,
|
| | | userInfoMapper.selectByPrimaryKey(uid).getMyHongBao());
|
| | | } |
| | | }
|
| | | }
|
| | | }
|