| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import com.alipay.api.request.AlipayFundTransToaccountTransferRequest;
|
| | | import com.alipay.api.response.AlipayFundTransToaccountTransferResponse;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.AccountDetailsMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.AccountMessageMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.AlipayAccountValidNormalHistoryMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.ExtractAuditRecordMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.ExtractMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.ExtractRecordMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.MoneyRecordMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.HongBaoV2Mapper;
|
| | | import com.yeshi.fanli.dao.mybatis.PayInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.SystemMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.hongbao.HongBaoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.dao.user.AccountDetailsDao;
|
| | | import com.yeshi.fanli.dao.user.AccountMessageDao;
|
| | | import com.yeshi.fanli.dao.user.ExtractDao;
|
| | | import com.yeshi.fanli.dao.user.ExtractRecordDao;
|
| | | import com.yeshi.fanli.dao.user.MoneyRecordDao;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountDetails;
|
| | | import com.yeshi.fanli.dto.HongBao;
|
| | | import com.yeshi.fanli.dto.money.ExtractOrderStatisticDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayTransferResultInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.MoneyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.PayInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.exception.ExtractException;
|
| | | import com.yeshi.fanli.exception.NotExistObjectException;
|
| | | import com.yeshi.fanli.exception.ObjectStateException;
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDebtService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderUserStatisticService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountDetailsService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountMessageService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.user.MoneyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyService;
|
| | | import com.yeshi.fanli.service.inter.user.UserNotificationService;
|
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | public class ExtractServiceImpl implements ExtractService {
|
| | |
|
| | | @Resource
|
| | | private ExtractDao extractDao;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private MoneyRecordService moneyRecordService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
| | | private SystemConfigService systemConfigService;
|
| | |
|
| | | @Resource
|
| | | private AccountDetailsService accountDetailsService;
|
| | |
|
| | | @Resource
|
| | | private AccountMessageService accountMessageService;
|
| | |
|
| | | @Resource
|
| | | private ExtractMapper extractMapper;
|
| | |
|
| | | @Resource
|
| | |
| | | private UserInfoMapper userInfoMapper;
|
| | |
|
| | | @Resource
|
| | | private ExtractRecordDao extractRecordDao;
|
| | |
|
| | | @Resource
|
| | | private MoneyRecordDao moneyRecordDao;
|
| | |
|
| | | @Resource
|
| | | private AccountDetailsDao accountDetailsDao;
|
| | |
|
| | | @Resource
|
| | | private AccountMessageDao accountMessageDao;
|
| | |
|
| | | @Resource
|
| | | private PayInfoMapper payInfoMapper;
|
| | |
|
| | | @Resource
|
| | | private AccountDetailsMapper accountDetailsMapper;
|
| | |
|
| | | @Resource
|
| | | private MoneyRecordMapper moneyRecordMapper;
|
| | |
|
| | | @Resource
|
| | | private AccountMessageMapper accountMessageMapper;
|
| | |
| | | private ExtractRecordMapper extractRecordMapper;
|
| | |
|
| | | @Resource
|
| | | private SystemMapper systemMapper;
|
| | | private HongBaoV2Mapper hongBaoV2Mapper;
|
| | |
|
| | | @Resource
|
| | | private HongBaoMapper hongBaoMapper;
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
|
| | | @Resource
|
| | | private PushService pushService;
|
| | |
|
| | | @Resource
|
| | | private UserNotificationService userNotificationService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | |
|
| | | @Resource
|
| | | private AlipayAccountValidNormalHistoryMapper alipayAccountValidNormalHistoryMapper;
|
| | |
|
| | | public List<Extract> getExtractInfoByUid(long uid) {
|
| | | return extractDao.list("from Extract e where e.userInfo.id=? and e.state != 2", new Serializable[] { uid });
|
| | | }
|
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | | @Resource
|
| | | private UserAccountBindingHistoryService userAccountBindingHistoryService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDebtService userMoneyDebtService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyService userMoneyService;
|
| | |
|
| | | @Resource
|
| | | private OrderUserStatisticService orderUserStatisticService;
|
| | |
|
| | | @Transactional
|
| | | public Integer addExtract(Extract extract) {
|
| | | Integer integer = extract(extract);
|
| | | return integer;
|
| | | }
|
| | |
|
| | | public List<Extract> getExtractList(int index) {
|
| | | int start = index * Constant.PAGE_SIZE;
|
| | | return extractDao.list("from Extract e order by e.id desc", start, Constant.PAGE_SIZE, new Serializable[] {});
|
| | | }
|
| | |
|
| | | public int getCount() {
|
| | | Long lcount = extractDao.getCount("select count(e.id) from Extract e");
|
| | | return lcount.intValue();
|
| | | }
|
| | |
|
| | | @Transactional
|
| | |
| | | }
|
| | |
|
| | | @Transactional
|
| | | public synchronized void rejectExtract(long id, String reason, long extractTime, AdminUser admin)
|
| | | public synchronized void rejectExtract(long id, String reason, AdminUser admin)
|
| | | throws ObjectStateException, NotExistObjectException {
|
| | | Extract find = extractDao.find(Extract.class, id);
|
| | | Extract find = extractMapper.selectByPrimaryKey(id);
|
| | |
|
| | | if (find == null) {
|
| | | throw new NotExistObjectException("不存在该对象");
|
| | |
| | |
|
| | | UserInfo user = find.getUserInfo();
|
| | |
|
| | | userInfoMapper.addHongBaoByUid(user.getId(), find.getMoney());
|
| | | UserMoneyDetail userMoneyDetail = null;
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createExtractReject(find);
|
| | | } catch (UserMoneyDetailException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | |
|
| | | // 删除提现记录
|
| | | moneyRecordMapper.deleteMoneyRecordByExtractId(id);
|
| | |
|
| | | // 增加资金
|
| | | userMoneyService.addUserMoney(user.getId(), find.getMoney(), userMoneyDetail);
|
| | | // 更新原来的状态
|
| | | Extract updateExtract = new Extract();
|
| | | updateExtract.setId(id);
|
| | |
| | |
|
| | | // 更新提现记录审核表
|
| | | extractAuditRecordMapper.updateByPrimaryKeySelective(auditRecord);
|
| | |
|
| | | AccountDetails ad = AccountDetailsFactory.create("+" + find.getMoney(), AccountDetailsFactory.HUIKUAN, null,
|
| | | find, find.getUserInfo());
|
| | | accountDetailsMapper.insertSelective(ad);
|
| | | // 新版资金详情
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtractReject(find);
|
| | | userMoneyDetail.setId(find.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e2) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e2);
|
| | | } catch (Exception e3) {
|
| | | e3.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | try {
|
| | | UserMoneyDetailFactory.createExtractReject(find);
|
| | | } catch (UserMoneyDetailException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | userNotificationService.extractWrong(user.getId(), find,
|
| | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.extractFail(find, reason);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | @Transactional
|
| | | private Integer extract(Extract extract) {
|
| | | UserAccountBindingHistory history = userAccountBindingHistoryService
|
| | | .getLatestHistory(extract.getUserInfo().getId(), UserAccountBindingHistory.TYPE_PHONE);
|
| | | // 手机号更换绑定的7天内不能提现
|
| | | if (history != null && !history.getFirst()
|
| | | && (System.currentTimeMillis() - history.getCreateTime().getTime()) < 1000 * 60 * 60 * 24 * 7L)
|
| | | return 111;
|
| | |
|
| | | final String autoExtract = configService.get("extract_way"); // 是否自动转账
|
| | | final String maxCount = configService.get("extract_count_day");
|
| | | final String maxMoney = configService.get("extract_money_day");
|
| | |
| | | return 3;
|
| | | }
|
| | |
|
| | | // 有借贷关系
|
| | | boolean isHaveToReplay = userMoneyDebtService.isHaveDebtToRepay(extract.getUserInfo().getId());
|
| | | if (isHaveToReplay) {
|
| | | return 110;
|
| | | }
|
| | |
|
| | | Integer type = setExtractRecord(extract, maxCount, maxMoney);
|
| | | if (type != 0) {
|
| | | return type;
|
| | | }
|
| | |
|
| | | extractMapper.insertSelective(extract);
|
| | |
|
| | | ExtractAuditRecord auditRecord = new ExtractAuditRecord();
|
| | | auditRecord.setBeforeMoney(user.getMyHongBao());
|
| | | auditRecord.setExtract(extract);
|
| | |
|
| | | Date minTime = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 180L);
|
| | | // 统计数据
|
| | | int orderCount50More = orderUserStatisticService.countOrderCount100MoreByUidAndMinTime(user.getId(), minTime);
|
| | |
|
| | | BigDecimal weiQuanOrderFanAmount = orderUserStatisticService.sumWeiQuanOrderFanAmountByUid(user.getId(),
|
| | | minTime);
|
| | | int weiQuanOrderCount = orderUserStatisticService.countWeiQuanOrderByUid(user.getId(), minTime);
|
| | | auditRecord.setExtraInfoStr(new Gson()
|
| | | .toJson(new ExtractOrderStatisticDTO(orderCount50More, weiQuanOrderCount, weiQuanOrderFanAmount, 0)));
|
| | | extractAuditRecordMapper.insertSelective(auditRecord);
|
| | |
|
| | | // 减去账户资金
|
| | | userInfoMapper.subHongBaoByUid(extract.getUserInfo().getId(), extract.getMoney());
|
| | |
|
| | | MoneyRecord moneyRecord = new MoneyRecord(user, null, extract.getMoney(), "提现", "", extract.getExtractTime(),
|
| | | 2);
|
| | | moneyRecord.setExtract(extract);
|
| | | moneyRecordMapper.insertSelective(moneyRecord);
|
| | |
|
| | | AccountDetails ad = AccountDetailsFactory.create("-" + extract.getMoney(), AccountDetailsFactory.TIXIAN, null,
|
| | | extract, user);
|
| | | accountDetailsMapper.insertSelective(ad);
|
| | | |
| | | // 新版资金详情
|
| | | UserMoneyDetail userMoneyDetail = null;
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtract(extract);
|
| | | userMoneyDetail.setId(extract.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | userMoneyDetail = UserMoneyDetailFactory.createExtract(extract);
|
| | | } catch (UserMoneyDetailException e2) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e2);
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 减去账户资金
|
| | | userMoneyService.subUserMoney(extract.getUserInfo().getId(), extract.getMoney(), userMoneyDetail);
|
| | |
|
| | | userNotificationService.extractApply(extract.getUserInfo().getId());
|
| | | // 添加新版通知
|
| | | userMoneyMsgNotificationService.extractApplay(extract);
|
| | |
|
| | | if ("是".equals(autoExtract)) {
|
| | | LogHelper.userInfo("uid=" + user.getId() + ",提交转账申请!");
|
| | | } else {// 暂时不自动提现
|
| | | transfer(extract, null);
|
| | | // transfer(extract, null);
|
| | | ;
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
| | | */
|
| | | @Transactional
|
| | | private void extractByZhiFuBao(Extract extract, AdminUser adminUser) {
|
| | | LogHelper.userErrorInfo("提现:开始通过提现-"+extract.getId());
|
| | | String privateKey = Constant.alipayConfig.getPrivateKey();
|
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",
|
| | | Constant.alipayConfig.getAppId(), privateKey, "json", "gbk", null, "RSA2");
|
| | | AlipayFundTransToaccountTransferRequest request = new AlipayFundTransToaccountTransferRequest();
|
| | | String uuid = UUID.randomUUID().toString().replace("-", "");
|
| | | String appName = systemConfigService.get("appName", extract.getSystem());
|
| | | String appName = Constant.systemCommonConfig.getProjectChineseName();
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("out_biz_no", uuid);
|
| | | json.put("payee_type", "ALIPAY_LOGONID");
|
| | | json.put("payee_account", extract.getAccount());
|
| | | json.put("amount", extract.getMoney());
|
| | | json.put("payer_show_name", appName + "提现");
|
| | | json.put("payer_show_name", appName + "App" + "提现");
|
| | | json.put("payee_real_name", extract.getName());
|
| | | json.put("remark", "来自" + appName + "的提现");
|
| | | json.put("remark", "来自" + appName + "App" + "的提现");
|
| | | request.setBizContent(json.toString());
|
| | | AlipayFundTransToaccountTransferResponse response = null;
|
| | | try {
|
| | | response = alipayClient.execute(request);
|
| | | LogHelper.userErrorInfo("提现:支付宝通过提现成功-"+extract.getId());
|
| | | } catch (AlipayApiException e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.userErrorInfo("支付宝提现异常:" + response + ",提现信息" + GsonUtil.toJson(extract));
|
| | | LogHelper.userErrorInfo("提现:支付宝提现异常:" + response + ",提现信息" + GsonUtil.toJson(extract));
|
| | | }
|
| | |
|
| | | try {
|
| | | CMQManager.getInstance().addExtractResultMsg(extract, response, adminUser);
|
| | | LogHelper.userErrorInfo("提现:添加处理队列成功-"+extract.getId());
|
| | | } catch (Exception e) {
|
| | | LogHelper.userErrorInfo("支付宝提现CMQ异常:" + new Gson().toJson(response) + ",提现信息" + GsonUtil.toJson(extract));
|
| | | LogHelper.userErrorInfo("提现:支付宝提现CMQ异常:" + new Gson().toJson(response) + ",提现信息" + GsonUtil.toJson(extract));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | updateExtract.setReason(msg);
|
| | | extractMapper.updateByPrimaryKeySelective(updateExtract);
|
| | |
|
| | | userInfoMapper.addHongBaoByUid(user.getId(), extract.getMoney());
|
| | |
|
| | | AccountDetails ad = AccountDetailsFactory.create("+" + extract.getMoney(), AccountDetailsFactory.HUIKUAN,
|
| | | null, extract, extract.getUserInfo());
|
| | | accountDetailsMapper.insertSelective(ad);
|
| | | |
| | | UserMoneyDetail userMoneyDetail = null;
|
| | | // 新版资金详情
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtractReject(extract);
|
| | | userMoneyDetail.setId(extract.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | userMoneyDetail = UserMoneyDetailFactory.createExtractReject(extract);
|
| | | } catch (UserMoneyDetailException e2) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e2);
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | // 增加资金
|
| | | userMoneyService.addUserMoney(user.getId(), extract.getMoney(), userMoneyDetail);
|
| | |
|
| | | try {
|
| | |
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 新版提现
|
| | | userMoneyMsgNotificationService.extractFail(extract, null);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | Extract updateExtract = new Extract();
|
| | | updateExtract.setId(extract.getId());
|
| | | updateExtract.setState(Constant.EXTRACT_PASS);
|
| | | updateExtract.setReceiveTime(new Date());
|
| | | updateExtract.setReason("提现成功");
|
| | | extractMapper.updateByPrimaryKeySelective(updateExtract);
|
| | |
|
| | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.extractSuccess(extract);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | @Override
|
| | | public Extract getExtractById(long id) {
|
| | | return extractDao.find(Extract.class, id);
|
| | | return extractMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void checkExtract(String uid) throws ExtractException {
|
| | | int count = hongBaoMapper.getCountByUidAndState(Long.parseLong(uid), HongBao.STATE_YILINGQU);
|
| | | if (count == 0)
|
| | | public void checkExtract(Long uid) throws ExtractException {
|
| | | BigDecimal compensateMoney = extractMapper.computeCompensateByUid(uid);
|
| | | if (compensateMoney == null)
|
| | | compensateMoney = new BigDecimal(0);
|
| | | // 不判定到账红包问题
|
| | | Long count = hongBaoV2Mapper.countByUidAndState(uid, HongBao.STATE_YILINGQU);
|
| | | if ((count == null || count == 0) && compensateMoney.compareTo(new BigDecimal(0)) == 0) {
|
| | | throw new ExtractException(1, "没有已到账的红包");
|
| | | List<Integer> list = extractMapper.checkExtract(uid);
|
| | | if (list != null && list.size() > 0 && list.get(0) == 0)
|
| | | }
|
| | | // 查询是否有欠账
|
| | | boolean isDebt = userMoneyDebtService.isHaveDebtToRepay(uid);
|
| | | if (isDebt)
|
| | | throw new ExtractException(3, "有欠账未还");
|
| | | // 获取所有收入所得
|
| | | BigDecimal hongBaoMoney = hongBaoV2Service.computeMoneyByUidAndState(uid, HongBaoV2.STATE_YILINGQU);
|
| | |
|
| | | Date now = new Date();
|
| | | // 获取提现,获取提现验证
|
| | | List<UserMoneyDetailTypeEnum> typeList = new ArrayList<>();
|
| | | typeList.add(UserMoneyDetailTypeEnum.extract);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractReject);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractVerify);
|
| | | BigDecimal extractMoney = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, new Date(0),
|
| | | now);
|
| | | extractMoney = extractMoney.abs();
|
| | | // 获取维权
|
| | | typeList = new ArrayList<>();
|
| | | typeList.add(UserMoneyDetailTypeEnum.weiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliWeiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.inviteWeiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.shareWeiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.hongbaoDeduct);
|
| | | BigDecimal weiqaunMoney = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, new Date(0),
|
| | | now);
|
| | | weiqaunMoney = weiqaunMoney.abs();
|
| | |
|
| | | BigDecimal balance = userInfoService.selectByPKey(uid).getMyHongBao();
|
| | |
|
| | | BigDecimal after = hongBaoMoney.subtract(extractMoney.add(weiqaunMoney).add(balance).add(compensateMoney));
|
| | |
|
| | | if (after.compareTo(new BigDecimal("0")) != 0)
|
| | | throw new ExtractException(2, "结算资金异常");
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public double countTodayMoney(Long uid) {
|
| | | return extractMapper.countTodayMoney(uid);
|
| | | public BigDecimal sumTodayApplyMoney(Long uid,String day) {
|
| | | return extractMapper.sumToadyApplyByUid(uid,day);
|
| | | }
|
| | | }
|