• 微服务项目:尚融宝(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)对不上号

  • 相关阅读:
    如何成为 10 倍软件工程师
    工作小记:企业微信 嵌H5页面 用户权限获取匹配
    Ant-Design-Pro-V5 :ProTable自定义搜索菜单操作栏和搜索事件、列表工具栏操作。
    如何写一份HR主动给你发送面试邀请的简历
    Dubbo使用invoke指令来调用dubbo接口
    【C++】C到C++的入门知识
    windows环境如何查询端口号占用及杀死进程
    你的领导也会有这3种特点吗?
    小波神经网络的基本原理,小波神经网络训练过程
    在K8S1.24使用Helm3部署Alluxio2.8.1
  • 原文地址:https://blog.csdn.net/m0_62436868/article/details/126863657