liweifan 3 سال پیش
والد
کامیت
3a71672e31

+ 2 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/sdk/WithdrawSdk.java

@@ -273,12 +273,13 @@ public class WithdrawSdk {
         String resultJsonStr = null;
         try {
             resultJsonStr = HttpUtil.postForHttp(apiUrl + "/bpotop_trade/balance_query", JSONObject.toJSONString(requestMap), null);
+            logger.info("查询余额响应参数(未解析):{}", resultJsonStr);
             JSONObject jsonObject = JSONObject.parseObject(resultJsonStr);
             String code = jsonObject.getString("code");
             if(code.equals("100")){
                 String resData = jsonObject.getJSONObject("details").getString("data");
                 String decryptStr = RSA.decryptPri(resData, privateKey);
-                logger.info("查询余额响应参数:{}", decryptStr);
+                logger.info("查询余额响应参数(解析后):{}", decryptStr);
                 JSONObject data = JSONObject.parseObject(decryptStr);
                 return new BigDecimal(data.getString("balance")).divide(new BigDecimal("100"));
             }

+ 10 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserWithdrawalServiceImpl.java

@@ -199,7 +199,7 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
 
         List<UserWithdrawal> userWithdrawals = baseMapper.selectList(Wrappers.<UserWithdrawal>lambdaQuery()
                 .in(UserWithdrawal::getId, ids)
-                .ne(UserWithdrawal::getAuthStatus, AuthStatusEnum.DOING));
+                .eq(UserWithdrawal::getAuthStatus, AuthStatusEnum.DOING));
 
         //先判断三方余额是否充足
         //总提现金额
@@ -274,6 +274,15 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
                 build.setTransNo(transNo.toString());
                 build.setErrorMsg(withdraw.getMsg());
                 res = HttpResponseResult.failed("结算" + authOperaReq.getId() + "失败,失败原因:" + withdraw.getMsg());
+
+                //审核不通过,账户解冻
+                UserAccountRecordDto accountRecordDto = new UserAccountRecordDto(
+                        build.getUserId(), build.getAmount(), InOrOutEnum.OUT, AccountBizTypeEnum.WITHDRAWAL,
+                        build.getId(), "老师结算", null
+                );
+                accountRecordDto.setFrozenType(FrozenTypeEnum.FROZEN_BACK);
+                accountRecordDto.setSaveRecord(false);
+                userAccountService.accountChange(accountRecordDto);
             }
         } else {
             //审核不通过,账户解冻