xiaoyong931011
2023-09-19 e2e8e9de828dc83db2fb254f29e544d6e7ff4d57
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);
    }
}