| | |
| | | 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.UserMoneyDetailFactory;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private PushService pushService;
|
| | |
|
| | | @Resource
|
| | | private UserNotificationService userNotificationService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
| | | extractAuditRecordMapper.updateByPrimaryKeySelective(auditRecord);
|
| | | // 新版资金详情
|
| | |
|
| | | try {
|
| | | userNotificationService.extractWrong(user.getId(), find,
|
| | | TimeUtil.getGernalTime(find.getExtractTime(), "yyyy-MM-dd HH:mm"));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.extractFail(find, reason);
|
| | | }
|
| | |
| | | auditRecord.setBeforeMoney(user.getMyHongBao());
|
| | | auditRecord.setExtract(extract);
|
| | |
|
| | | Date minTime = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 180L);
|
| | | // 统计数据
|
| | | int orderCount50More = orderUserStatisticService.countHongBaoOrderCount50MoreByUid(user.getId());
|
| | | BigDecimal weiQuanOrderFanAmount = orderUserStatisticService.sumWeiQuanOrderFanAmountByUid(user.getId());
|
| | | int weiQuanOrderCount = orderUserStatisticService.countWeiQuanOrderByUid(user.getId());
|
| | | int safeOrderCount = orderUserStatisticService.countSafeOrderByUid(user.getId());
|
| | | auditRecord.setExtraInfoStr(new Gson().toJson(new ExtractOrderStatisticDTO(orderCount50More, weiQuanOrderCount,
|
| | | weiQuanOrderFanAmount, safeOrderCount)));
|
| | | 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);
|
| | |
|
| | | // 新版资金详情
|
| | |
| | | // 减去账户资金
|
| | | userMoneyService.subUserMoney(extract.getUserInfo().getId(), extract.getMoney(), userMoneyDetail);
|
| | |
|
| | | userNotificationService.extractApply(extract.getUserInfo().getId());
|
| | | // 添加新版通知
|
| | | userMoneyMsgNotificationService.extractApplay(extract);
|
| | |
|
| | |
| | | */
|
| | | @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");
|
| | |
| | | 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));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | userMoneyService.addUserMoney(user.getId(), extract.getMoney(), userMoneyDetail);
|
| | |
|
| | | try {
|
| | |
|
| | | userNotificationService.extractTransferFail(user.getId(),
|
| | | TimeUtil.getGernalTime(extract.getExtractTime(), "yyyy-MM-dd HH:mm"));
|
| | |
|
| | | LogHelper.userInfo("支付宝转账失败:[提现IP:" + extract.getIp() + ",所转账号:" + extract.getAccount() + ",真实姓名:"
|
| | | + extract.getName() + ",所转金额:" + extract.getMoney() + ",失败原因" + extract.getReason() + "]");
|
| | |
|
| | |
| | | extractMapper.updateByPrimaryKeySelective(updateExtract);
|
| | |
|
| | | try {
|
| | | userNotificationService.extractSuccess(extract.getUserInfo().getId(), extract,
|
| | | TimeUtil.getGernalTime(extract.getExtractTime(), "yyyy-MM-dd HH:mm"));
|
| | |
|
| | | LogHelper.userInfo("支付宝转账成功:[提现IP:" + extract.getIp() + ",所转账号:" + extract.getAccount() + ",真实姓名:"
|
| | | + extract.getName() + ",所转金额:" + extract.getMoney() + "]");
|
| | | } catch (Exception e) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public double countTodayMoney(Long uid) {
|
| | | return extractMapper.countTodayMoney(uid);
|
| | | public BigDecimal sumTodayApplyMoney(Long uid,String day) {
|
| | | return extractMapper.sumToadyApplyByUid(uid,day);
|
| | | }
|
| | | }
|