KKSU
2025-01-09 f8f52081879eb09033c3cf66fd40314a46c92604
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallAgentServiceImpl.java
@@ -54,15 +54,21 @@
//            return new FebsResponse().fail().message("当前城市已经无法申请");
//        }
        MallAgentRecord mallAgentRecordNew = MallAgentRecordConversion.INSTANCE.dtoToEntity(apiAgentApplyDto);
        mallAgentRecordNew.setMemberId(memberId);
        mallAgentRecordNew.setState(MallAgentRecord.APPLY_ING);
        mallAgentRecordMapper.insert(mallAgentRecordNew);
        DataDictionaryCustom agentAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.PRICE_AMOUNT.getType()
                , DataDictionaryEnum.PRICE_AMOUNT.getCode());
        String agentAmount = agentAmountDic.getValue();
        BigDecimal bigDecimal = new BigDecimal(agentAmount);
        MallAgentRecord mallAgentRecordNew = MallAgentRecordConversion.INSTANCE.dtoToEntity(apiAgentApplyDto);
        mallAgentRecordNew.setMemberId(memberId);
        mallAgentRecordNew.setState(MallAgentRecord.APPLY_ING);
        mallAgentRecordNew.setAgentLevel(apiAgentApplyDto.getType());
        if(apiAgentApplyDto.getType().equals(AgentLevelEnum.LEVEL_THREE.getName())){
            mallAgentRecordNew.setAmount(bigDecimal);
        }
        mallAgentRecordMapper.insert(mallAgentRecordNew);
        return new FebsResponse().success().data(bigDecimal);
    }
}