xiaoyong931011
2023-04-13 f5beeeda5c8cad4ef29a4a875d5a05543657f1eb
后台修改
3 files modified
19 ■■■■ changed files
src/main/java/cc/mrbird/febs/mall/dto/ApiRechargeWalletDto.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/entity/MallAgentRecord.java 4 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/dto/ApiRechargeWalletDto.java
@@ -13,6 +13,9 @@
    @ApiModelProperty(value = "1:普通充值 2:合伙人充值", example = "10")
    private Integer type;
    @ApiModelProperty(value = "代理申请ID", example = "10")
    private Long agentApplyId;
    @ApiModelProperty(value = "充值金额", example = "10")
    private BigDecimal amount;
src/main/java/cc/mrbird/febs/mall/entity/MallAgentRecord.java
@@ -27,6 +27,10 @@
    private String area;
    //详细地址
    private String storeAddress;
    //充值金额
    private BigDecimal amount;
    //代理等级
    private Integer agentLevel;
    //状态 1::申请中 2:同意 3:拒绝
    private Integer state;
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
@@ -748,11 +748,13 @@
        Integer type = apiRechargeWalletDto.getType();
        if(2 == type){
            //成为合伙人的充值金额
            DataDictionaryCustom agentPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.PRICE_AMOUNT.getType(),
                    DataDictionaryEnum.PRICE_AMOUNT.getCode());
            String agentPrice = agentPriceDic.getValue();
            BigDecimal price = new BigDecimal(agentPrice);
            if(price.compareTo(amount) != 0){
            MallAgentRecord mallAgentRecord = mallAgentRecordMapper.selectById(apiRechargeWalletDto.getAgentApplyId());
            BigDecimal agentPrice = mallAgentRecord.getAmount();
//            DataDictionaryCustom agentPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.PRICE_AMOUNT.getType(),
//                    DataDictionaryEnum.PRICE_AMOUNT.getCode());
//            String agentPrice = agentPriceDic.getValue();
//            BigDecimal price = new BigDecimal(agentPrice);
            if(agentPrice.compareTo(amount) != 0){
                return new FebsResponse().fail().message("成为合伙人的金额为"+agentPrice);
            }
        }