|
@@ -67,6 +67,34 @@ public class SettlementAppController extends BaseWebController {
|
|
|
return splitService.accountBalanceQuery(params.getId());
|
|
return splitService.accountBalanceQuery(params.getId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/accountBalanceUse")
|
|
|
|
|
+ @ApiOperation(value = "可提现金额查询")
|
|
|
|
|
+ @OperationLog(type = OperateType.SELECT, description ="可提现金额查询")
|
|
|
|
|
+ public VaultsResponse<Long> accountBalanceUse() {
|
|
|
|
|
+
|
|
|
|
|
+ if(StringUtils.isEmpty(TokenContext.cureMiniUser().getIposMerchantId())){
|
|
|
|
|
+ return VaultsResponse.success(0L);
|
|
|
|
|
+ }
|
|
|
|
|
+ GroupLeaderParams groupLeaderParams = new GroupLeaderParams();
|
|
|
|
|
+ groupLeaderParams.setOperatorId(TokenContext.cureOperatorId());
|
|
|
|
|
+ groupLeaderParams.setGroupLeaderId(Integer.parseInt(TokenContext.cureMiniUser().getGroupLeaderId().toString()));
|
|
|
|
|
+ VaultsResponse<GroupLeaderDTO> vaultsResponse = customerFeignClient.getGroupLeaderById(groupLeaderParams);
|
|
|
|
|
+ GroupLeaderDTO groupLeaderDTO = vaultsResponse.getData();
|
|
|
|
|
+ VaultsResponse<AccountBalanceBack> backVaultsResponse = splitService.accountBalanceQuery(TokenContext.cureMiniUser().getIposMerchantId());
|
|
|
|
|
+ AccountBalanceBack back = backVaultsResponse.getData();
|
|
|
|
|
+ try {
|
|
|
|
|
+ Long money =Long.parseLong( back.getList().get(0).getAvl_amt().toString())-groupLeaderDTO.getRemainedAmt();
|
|
|
|
|
+ if(money<0L){
|
|
|
|
|
+ money = 0L;
|
|
|
|
|
+ }
|
|
|
|
|
+ return VaultsResponse.success(money);
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ return VaultsResponse.success(0L);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@PostMapping("/withdraw")
|
|
@PostMapping("/withdraw")
|
|
|
@ApiOperation(value = "取现")
|
|
@ApiOperation(value = "取现")
|
|
|
@OperationLog(type = OperateType.SELECT, description ="取现")
|
|
@OperationLog(type = OperateType.SELECT, description ="取现")
|