| | |
| | | @Resource
|
| | | private ExtractWeiXinRecordService extractWeiXinRecordService;
|
| | |
|
| | |
|
| | | @Transactional
|
| | | public Integer addExtract(Extract extract) {
|
| | | Integer integer = extract(extract);
|
| | |
| | | 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));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | // 更新提现记录审核表
|
| | | extractAuditRecordMapper.updateByPrimaryKeySelective(auditRecord);
|
| | | }
|
| | |
|
| | | // 外显账户明细
|
| | | UserMoneyDetail userMoneyDetail = userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(
|
| | | UserMoneyDetailTypeEnum.extract, extract.getUserInfo().getId(), extract.getId());
|
| | | if (userMoneyDetail != null) {
|
| | | UserMoneyDetail detail = new UserMoneyDetail(userMoneyDetail.getId());
|
| | | detail.setShow(true);
|
| | | detail.setUpdateTime(new Date());
|
| | | userMoneyDetailMapper.updateByPrimaryKeySelective(detail);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return money;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void autoExtract(UserInfo user) {
|
| | | if (user == null || user.getWxOpenId() == null || user.getWxUnionId() == null ||
|
| | | user.getState() != UserInfo.STATE_NORMAL)
|
| | | if (user == null || user.getWxOpenId() == null || user.getWxUnionId() == null
|
| | | || user.getState() != UserInfo.STATE_NORMAL)
|
| | | return;
|
| | |
|
| | | Date date = new Date();
|
| | |
| | | //redPackParams.setSceneId(null);
|
| | | //redPackParams.setRiskInfo(null);
|
| | |
|
| | | |
| | | // 发生红包状态
|
| | | boolean stateRedPack = false;
|
| | |
|
| | | String pwd = "1520950211";
|
| | | InputStream cert = ExtractServiceImpl.class.getClassLoader().getResourceAsStream("certificate/apiclient_cert.p12"); // 读取.p12文件
|
| | | InputStream cert = ExtractServiceImpl.class.getClassLoader()
|
| | | .getResourceAsStream("certificate/apiclient_cert.p12"); // 读取.p12文件
|
| | | // 执行发放红包
|
| | | try {
|
| | | String result = WXPayUtil.redPackToOpenId(redPackParams, pwd, cert);
|
| | |
| | | userMoneyMsgNotificationService.extractAuto(extractRecord, "未领取-提现中", desc, beizu);
|
| | | }
|
| | |
|
| | | |
| | | private boolean parseSendResult(String result) {
|
| | | try {
|
| | | Document document = DocumentHelper.parseText(result);
|
| | |
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | |
|
| | | private ExtractWeiXinRecord parseDTO(String result) {
|
| | | try {
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public List<UserInfo> preAutoUser() throws Exception {
|
| | | int page = 0;
|
| | |
| | |
|
| | | while (true) {
|
| | | // 查询满足条件 1、2 的uid
|
| | | List<UserInfo> listUser = userInfoService.getAutoExtractUser(page * pageSize, pageSize, minSurplus, beganDate, endDate);
|
| | | List<UserInfo> listUser = userInfoService.getAutoExtractUser(page * pageSize, pageSize, minSurplus,
|
| | | beganDate, endDate);
|
| | | if (listUser == null || listUser.isEmpty())
|
| | | break;
|
| | |
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public List<String> getAutoExtractOpenIds() throws Exception {
|
| | | int page = 0;
|
| | |
| | |
|
| | | while (true) {
|
| | | // 查询满足条件 1、2 的uid
|
| | | List<UserInfo> listUser = userInfoService.getAutoExtractUser(page * pageSize, pageSize, minSurplus, beganDate, endDate);
|
| | | List<UserInfo> listUser = userInfoService.getAutoExtractUser(page * pageSize, pageSize, minSurplus,
|
| | | beganDate, endDate);
|
| | | if (listUser == null || listUser.isEmpty())
|
| | | break;
|
| | |
|
| | |
| | | return listOpendIDs;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private UserInfo subHongBaoByUid(Long uid, BigDecimal money, BigDecimal minSurplus) {
|
| | | UserInfo userInfo = userInfoMapper.selectByPrimaryKeyForUpdate(uid);
|
| | | if (userInfo != null && !StringUtil.isNullOrEmpty(userInfo.getWxOpenId())
|
| | | && !StringUtil.isNullOrEmpty(userInfo.getWxUnionId()) && userInfo.getMyHongBao().compareTo(minSurplus) >= 0) {
|
| | | && !StringUtil.isNullOrEmpty(userInfo.getWxUnionId())
|
| | | && userInfo.getMyHongBao().compareTo(minSurplus) >= 0) {
|
| | | // 微信提现记录
|
| | | ExtractWeiXinRecord extractRecord = new ExtractWeiXinRecord();
|
| | | extractRecord.setUid(uid);
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void updateManualExtractRecord(List<RedPackRecord> list) throws ExtractException{
|
| | | if (list == null || list.isEmpty())
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private void updateWeiXinRecord(RedPackRecord redPackRecord){
|
| | | if (StringUtil.isNullOrEmpty(redPackRecord.getOpenId()))
|
| | | return;
|
| | |
|
| | | ExtractWeiXinRecord record = extractWeiXinRecordService.getByOpenIdAndType(redPackRecord.getOpenId(), ExtractWeiXinRecord.TYPE_MANUAL);
|
| | | ExtractWeiXinRecord record = extractWeiXinRecordService.getByOpenIdAndType(redPackRecord.getOpenId(),
|
| | | ExtractWeiXinRecord.TYPE_MANUAL);
|
| | | if (record == null)
|
| | | return;
|
| | |
|
| | |
| | | // 资金明细
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.extractAutoWXRefund.name() + ":" + record.getId()));
|
| | | detail.setIdentifyCode(
|
| | | StringUtil.Md5(UserMoneyDetailTypeEnum.extractAutoWXRefund.name() + ":" + record.getId()));
|
| | | detail.setMoney(record.getMoney());
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.extractAutoWXRefund.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.extractAutoWXRefund);
|