每日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);
相关推荐
胚芽鞘68135 分钟前
关于java项目中maven的理解
java·数据库·maven
nbsaas-boot1 小时前
Java 正则表达式白皮书:语法详解、工程实践与常用表达式库
开发语言·python·mysql
岁忧1 小时前
(LeetCode 面试经典 150 题 ) 11. 盛最多水的容器 (贪心+双指针)
java·c++·算法·leetcode·面试·go
chao_7892 小时前
二分查找篇——搜索旋转排序数组【LeetCode】两次二分查找
开发语言·数据结构·python·算法·leetcode
CJi0NG2 小时前
【自用】JavaSE--算法、正则表达式、异常
java
风无雨2 小时前
GO 启动 简单服务
开发语言·后端·golang
Hellyc2 小时前
用户查询优惠券之缓存击穿
java·redis·缓存
斯普信专业组2 小时前
Go语言包管理完全指南:从基础到最佳实践
开发语言·后端·golang
今天又在摸鱼2 小时前
Maven
java·maven
老马啸西风2 小时前
maven 发布到中央仓库常用脚本-02
java·maven