每日Bug汇总--Day05

Bug汇总---Day05

一、项目运行报错

二、项目运行Bug

1、**问题描述:**前端将从后台查询的数据作为参数进行get请求,参数为空

原因分析:

  • 这种写法可能只支全局的参数
  • 调用方法的传参响应

代码实现

js 复制代码
if (this.jishiName) {
      this.$http({
        url: `huiyuanyuyuexinxi/xiaofei/${this.jishiName}`,
        method: 'get'
      }).then(res => {
        console.log(res.data)
        // 读取接口请求成功回传回来的数据
        var Huiyuanxiaofeixinxis = res.data.Huiyuanxiaofeixinxis
        // 定义数组,存放一会覆盖echarts图形的数据
        var data = []
        console.log(Huiyuanxiaofeixinxis.length)
        // 循环遍历数组,取出数据,转成和data一样的格式
        for (var i = 0; i < Huiyuanxiaofeixinxis.length; i++) {
          var d = { name: '', value: 0 }
          d.name = Huiyuanxiaofeixinxis[i].xingming
          d.value = Huiyuanxiaofeixinxis[i].nianxiaofeie
          // 往data数组中添加数据
          data.push(d)
        }
        // 排序,b - a降序------a - b升序
        data.sort((a, b) => b.value - a.value)
        // 覆盖data(){}中全局变量的数据
        this.dataHuiyuanXiaoliang = data
        // 画出图形
        this.DrawNian()
      }).catch(err => {
        console.log(err)
        console.log("后台接口请求失败!")
      })
    } else {
      this.$http({
        url: `jishi/jishiName/${this.$storage.get('adminName')}`,
        method: 'get'
      }).then(res => {
        console.log(res.data.data)
        this.jishiName = res.data.data
        this.$http({
          url: `huiyuanyuyuexinxi/xiaofei/${this.jishiName}`,
          method: 'get'
        }).then(res => {
          console.log(res.data)
          // 读取接口请求成功回传回来的数据
          var Huiyuanxiaofeixinxis = res.data.Huiyuanxiaofeixinxis
          // 定义数组,存放一会覆盖echarts图形的数据
          var data = []
          console.log(Huiyuanxiaofeixinxis.length)
          // 循环遍历数组,取出数据,转成和data一样的格式
          for (var i = 0; i < Huiyuanxiaofeixinxis.length; i++) {
            var d = { name: '', value: 0 }
            d.name = Huiyuanxiaofeixinxis[i].xiangmumingcheng
            d.value = Huiyuanxiaofeixinxis[i].count
            // 往data数组中添加数据
            data.push(d)
          }
          // 排序,b - a降序------a - b升序
          data.sort((a, b) => b.value - a.value)
          // 覆盖data(){}中全局变量的数据
          this.dataHuiyuanXiaoliang = data
          // 画出图形
          this.DrawNian()
        }).catch(err => {
          console.log(err)
          console.log("后台接口请求失败!")
        })
        console.log("技师姓名查询成功!")
      })
    }

2、问题描述: Parameter 'jishiNames' not found. Available parameters are [collection, list]

解决思路: 在DAO层方法参数加注解@Param("jishiNames")

实现代码:

java 复制代码
List<JishinianyejitongjiEntity> selectJiShixiaofeixinxis(@Param("jishiNames") List<String> jishiNames);
相关推荐
Murphy_lx6 分钟前
C++ thread类
开发语言·c++
LXY_BUAA13 分钟前
《计算机操作系统》_并发 bug 和应对 (死锁/数据竞争/原子性违反;防御性编程和动态分析)20251106
bug
彩妙不是菜喵13 分钟前
C++ 中 nullptr 的使用与实践:从陷阱到最佳实践
开发语言·jvm·c++
L.EscaRC16 分钟前
Spring Boot 自定义组件深度解析
java·spring boot·后端
pengzhuofan23 分钟前
IntelliJ IDEA 常用快捷键
java·ide·intellij-idea
ANGLAL25 分钟前
17.MyBatis动态SQL语法整理
java·sql·mybatis
lskisme35 分钟前
springboot maven导入本地jar包
开发语言·python·pycharm
SheepHappy39 分钟前
MyBatis-Plus 源码阅读(二)代码生成器原理深度剖析
java·源码阅读
雨白1 小时前
重识 Java IO、NIO 与 OkIO
android·java
light_in_hand1 小时前
内存区域划分——垃圾回收
java·jvm·算法