• 微服务项目:尚融宝(38)(核心业务流程:申请借款额度(2))


    放弃幻想,认清现实,准备斗争

    一、根据编码获取数据字典

    1、controller

    sevice-core中添加接口方法

    1. @Api(tags = "数据字典")
    2. @RestController
    3. @RequestMapping("/api/core/dict")
    4. @Slf4j
    5. public class DictController {
    6. @Resource
    7. private DictService dictService;
    8. @ApiOperation("根据dictCode获取下级节点")
    9. @GetMapping("/findByDictCode/{dictCode}")
    10. public R findByDictCode(
    11. @ApiParam(value = "节点编码", required = true)
    12. @PathVariable String dictCode) {
    13. List list = dictService.findByDictCode(dictCode);
    14. return R.ok().data("dictList", list);
    15. }
    16. }

    2、service

    接口:DictService

    List findByDictCode(String dictCode);

    实现:DictServiceImpl 

    1. @Override
    2. public List findByDictCode(String dictCode) {
    3. QueryWrapper dictQueryWrapper = new QueryWrapper<>();
    4. dictQueryWrapper.eq("dict_code", dictCode);
    5. Dict dict = baseMapper.selectOne(dictQueryWrapper);
    6. return this.listByParentId(dict.getId());
    7. }

    二、前端展示借款人信息

    1、展示下拉列表

    pages/user/borrower.vue中调用接口

    定义methods:

    1. initSelected() {
    2. //学历列表
    3. this.$axios
    4. .$get('/api/core/dict/findByDictCode/education')
    5. .then((response) => {
    6. this.educationList = response.data.dictList
    7. })
    8. //行业列表
    9. this.$axios
    10. .$get('/api/core/dict/findByDictCode/industry')
    11. .then((response) => {
    12. this.industryList = response.data.dictList
    13. })
    14. //收入列表
    15. this.$axios
    16. .$get('/api/core/dict/findByDictCode/income')
    17. .then((response) => {
    18. this.incomeList = response.data.dictList
    19. })
    20. //还款来源列表
    21. this.$axios
    22. .$get('/api/core/dict/findByDictCode/returnSource')
    23. .then((response) => {
    24. this.returnSourceList = response.data.dictList
    25. })
    26. //联系人关系列表
    27. this.$axios
    28. .$get('/api/core/dict/findByDictCode/relation')
    29. .then((response) => {
    30. this.contactsRelationList = response.data.dictList
    31. })
    32. },

    页面加载时调用 

    1. created() {
    2. this.initSelected()
    3. },

     今日BUG

    前端数据接受异常,页面一直无法展示,也无法跳转到汇付宝中

    一直在前端查找,但是一直找不到结果,前端也拿到了数据,但是一直弄不出来,我把注意力放在后端用户,单独拿起表单的数据可以跳转过去,最后才发现,原来是前端的数据是拿到了,但是后端的这个参数是不一样的,(key value)对不上号

  • 相关阅读:
    k8s驱逐篇(5)-kube-controller-manager驱逐
    python从入门到实践:数据类型、文件处理
    Shell编程-02-正则表达式
    TCS34725颜色感应识别模块
    Prometheus、node_exporter、Grafana端口修改(端口占用)
    电力系统潮流分析(Matlab代码实现)
    docker 记录下go用alpine作为基础镜像出现 no found的问题
    KingbaseES集群管理维护案例之---备库checkpoint分析
    论文学习——考虑场次降雨年际变化特征的年径流总量控制率准确核算
    今年双十二值得买的数码好物推荐!双十二数码产品抢购攻略
  • 原文地址:https://blog.csdn.net/m0_62436868/article/details/126863657