KKSU
2024-04-18 e676f7bc3498bf81a236e6f2bdc27bcf716757b5
src/main/java/cc/mrbird/febs/mall/controller/AdminMallMemberController.java
@@ -15,10 +15,7 @@
import cc.mrbird.febs.common.utils.excl.ResponseHeadUtil;
import cc.mrbird.febs.mall.dto.*;
import cc.mrbird.febs.mall.entity.*;
import cc.mrbird.febs.mall.mapper.MallMemberAmountMapper;
import cc.mrbird.febs.mall.mapper.MallMemberChargeMapper;
import cc.mrbird.febs.mall.mapper.MallMemberMapper;
import cc.mrbird.febs.mall.mapper.MallMemberWalletMapper;
import cc.mrbird.febs.mall.mapper.*;
import cc.mrbird.febs.mall.service.IAdminMallMemberService;
import cc.mrbird.febs.mall.service.IApiMallMemberService;
import cc.mrbird.febs.mall.service.IMallMoneyFlowService;
@@ -60,6 +57,7 @@
    private final IApiMallMemberService apiMallMemberService;
    private final MallMemberChargeMapper mallMemberChargeMapper;
    private final IMallMoneyFlowService mallMoneyFlowService;
    private final MallMemberWithdrawMapper mallMemberWithdrawMapper;
    @GetMapping("confirmOrder")
@@ -111,6 +109,55 @@
        return new FebsResponse().success();
    }
    @GetMapping("confirmCancelWithdraw")
    @ControllerEndpoint(operation = "批量提现取消", exceptionMessage = "操作失败")
    public FebsResponse confirmCancelWithdraw(MemberChargrDto memberChargrDto){
        String orderIds = memberChargrDto.getOrderIds();
        List<String> ids = StrUtil.splitTrim(orderIds, ",");
        for(String id : ids){
            long orderId = Long.parseLong(id);
            MallMemberWithdraw mallMemberWithdraw = mallMemberWithdrawMapper.selectById(orderId);
            if(1 != mallMemberWithdraw.getStatus()){
                continue;
            }
            mallMemberWithdraw.setStatus(3);
            mallMemberWithdrawMapper.updateById(mallMemberWithdraw);
            MallMemberAmount mallMemberAmount = mallMemberAmountMapper.selectByMemberId(mallMemberWithdraw.getMemberId());
            mallMemberAmount.setFcmCntAva(mallMemberAmount.getFcmCntAva().add(mallMemberWithdraw.getAmount()));
            mallMemberAmountMapper.updateFcmCntAvaById(mallMemberAmount);
        }
        return new FebsResponse().success();
    }
    @GetMapping("confirmWithdraw")
    @ControllerEndpoint(operation = "批量同意", exceptionMessage = "操作失败")
    public FebsResponse confirmWithdraw(MemberChargrDto memberChargrDto){
        String orderIds = memberChargrDto.getOrderIds();
        List<String> ids = StrUtil.splitTrim(orderIds, ",");
        for(String id : ids){
            long orderId = Long.parseLong(id);
            MallMemberWithdraw mallMemberWithdraw = mallMemberWithdrawMapper.selectById(orderId);
            if(1 != mallMemberWithdraw.getStatus()){
                continue;
            }
            mallMemberWithdraw.setStatus(2);
            mallMemberWithdrawMapper.updateById(mallMemberWithdraw);
            String orderNo = MallUtils.getOrderNum("BF");
            mallMoneyFlowService.addMoneyFlow(
                    mallMemberWithdraw.getMemberId(),
                    mallMemberWithdraw.getAmount(),
                    MoneyFlowTypeNewEnum.FCM_INSIDE_OUT.getValue(),
                    orderNo,
                    mallMemberWithdraw.getId(),
                    FlowTypeNewEnum.FCM_COIN.getValue(),
                    MoneyFlowTypeNewEnum.FCM_INSIDE_OUT.getDescrition());
        }
        return new FebsResponse().success();
    }
    /**
     * 充值列表
@@ -121,6 +168,16 @@
        return new FebsResponse().success().data(data);
    }
    /**
     * 提现列表
     */
    @GetMapping("memberWithDrawList")
    public FebsResponse memberWithDrawList(MoneyChargeListDto moneyChargeListDto, QueryRequest request) {
        Map<String, Object> data = getDataTable(mallMemberService.memberWithDrawList(moneyChargeListDto, request));
        return new FebsResponse().success().data(data);
    }
    /**
     * 平台账单
     *