提交 7d869a38 作者: xiaowang

提现资金池额度及提现总额

上级 44a79e5b
package com.mmc.iuav.user.model.dto.wallet;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @Author LW
* @date 2023/10/26 13:49
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CashAmountDTO {
@ApiModelProperty(value = "资金池余额")
private Double cashPoolAmount;
@ApiModelProperty(value = "总提现金额")
private BigDecimal totalWithdrawAmt;
}
package com.mmc.iuav.user.model.dto.xzsz;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author LW
* @date 2023/10/26 14:03
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CashPoolingDTO {
@ApiModelProperty(value = "商户企业名称")
private String companyName;
@ApiModelProperty(value = "可用余额")
private Double availableBalance;
@ApiModelProperty(value = "冻结余额")
private Double holdBalance;
}
......@@ -3,6 +3,7 @@ package com.mmc.iuav.user.controller.wallet;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.controller.BaseController;
import com.mmc.iuav.user.entity.wallet.UserBillingDetailVO;
import com.mmc.iuav.user.model.dto.wallet.CashAmountDTO;
import com.mmc.iuav.user.model.dto.wallet.WithdrawalApplyDTO;
import com.mmc.iuav.user.model.qo.wallet.WalletFlowQO;
import com.mmc.iuav.user.model.qo.wallet.WithdrawalApplyQO;
......@@ -66,4 +67,12 @@ public class WithdrawalController extends BaseController {
HttpServletRequest request) {
return ResultBody.success(withdrawalService.approveWithdrawalApply(id, applyStatus, this.getUserLoginInfoFromRedis(request).getUserAccountId(), remark));
}
@ApiOperation(value = "获取资金池余额及提现总额")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("getCashAmountAndWithdrawAmount")
public ResultBody<CashAmountDTO> getCashAmountAndWithdrawAmount(HttpServletRequest request) {
return ResultBody.success(withdrawalService.getCashAmountAndWithdrawAmount(this.getUserLoginInfoFromRedis(request)));
}
}
......@@ -9,6 +9,7 @@ import com.mmc.iuav.user.model.qo.wallet.WithdrawalApplyQO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
/**
......@@ -47,4 +48,6 @@ public interface PayWalletDao {
List<XzWithdrawalApplyDO> listPageWithdrawalApply(WithdrawalApplyQO param);
int updateWithdrawalApply(XzWithdrawalApplyDO apply);
BigDecimal getTotalWithdrawAmount();
}
......@@ -2,6 +2,8 @@ package com.mmc.iuav.user.service.xzsz;
import com.mmc.iuav.page.PageResult;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.model.dto.wallet.CashAmountDTO;
import com.mmc.iuav.user.model.qo.wallet.WalletFlowQO;
import com.mmc.iuav.user.model.qo.wallet.WithdrawalApplyQO;
import com.mmc.iuav.user.model.vo.wallet.ApplyWithdrawalVO;
......@@ -18,4 +20,6 @@ public interface WithdrawalService {
PageResult listPageWithdrawalApply(WithdrawalApplyQO param);
ResultBody approveWithdrawalApply(Integer id, Integer applyStatus, Integer userAccountId, String remark);
CashAmountDTO getCashAmountAndWithdrawAmount(LoginSuccessDTO loginSuccessDTO);
}
package com.mmc.iuav.user.service.xzsz.impl;
import com.alibaba.fastjson2.JSONObject;
import com.mmc.iuav.general.CodeUtil;
import com.mmc.iuav.page.PageResult;
import com.mmc.iuav.response.ResultBody;
......@@ -16,7 +17,10 @@ import com.mmc.iuav.user.entity.wallet.WithdrawalLogDO;
import com.mmc.iuav.user.enums.WithdrawalApplyStatus;
import com.mmc.iuav.user.enums.WithdrawalMethod;
import com.mmc.iuav.user.enums.XzEnums;
import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.model.dto.wallet.CashAmountDTO;
import com.mmc.iuav.user.model.dto.wallet.WithdrawalApplyDTO;
import com.mmc.iuav.user.model.dto.xzsz.CashPoolingDTO;
import com.mmc.iuav.user.model.qo.wallet.WalletFlowQO;
import com.mmc.iuav.user.model.qo.wallet.WithdrawalApplyQO;
import com.mmc.iuav.user.model.vo.XzWithdrawalVO;
......@@ -255,4 +259,19 @@ public class WithdrawalServiceImpl implements WithdrawalService {
payWalletDO.setWdlFreeze(wallet.getWdlFreeze().subtract(BigDecimal.valueOf(applyInfo.getPayAmount())));
return payWalletDao.updatePayWallet(payWalletDO);
}
@Override
public CashAmountDTO getCashAmountAndWithdrawAmount(LoginSuccessDTO loginSuccessDTO) {
if (!loginSuccessDTO.getRoleInfo().getSuperAdmin().equals(1)) {
return null;
}
CashAmountDTO cashAmountDTO = new CashAmountDTO();
BigDecimal totalWithdrawAmount = payWalletDao.getTotalWithdrawAmount();
cashAmountDTO.setTotalWithdrawAmt(totalWithdrawAmount);
ResultBody cashPooling = xzService.getCashPooling();
String s = JSONObject.toJSONString(cashPooling.getResult());
CashPoolingDTO cashPoolingDTO = JSONObject.parseObject(s, CashPoolingDTO.class);
cashAmountDTO.setCashPoolAmount(cashPoolingDTO.getAvailableBalance());
return cashAmountDTO;
}
}
......@@ -411,4 +411,8 @@
order by create_time desc
limit #{pageNo},#{pageSize}
</select>
<select id="getTotalWithdrawAmount" resultType="java.math.BigDecimal">
select sum(salary_wdl)
from pay_wallet
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论