Java
Java问题的解决
调皮の毛毛
生活就是一半诗意一半烟火,我们手持烟火以谋生,心怀诗意以谋爱。
展开
-
使用stream流式处理拼装三级分类以及问题的解决(Tree组件)
出现的问题后端代码 @Override public List<TbCategory> listTree() { //1.查出所有分类 List<TbCategory> tbCategories = tbCategoryMapper.selectList(null); //2.查出所有一级分类 List<TbCategory> level1Menus = tbCategories.strea原创 2021-04-30 16:24:38 · 412 阅读 · 2 评论 -
初学者可能出现的问题,以及解决办法(目前大部分是商城问题)
文章目录前言一、把数字字符,拼接在一起总结前言本篇主要为刚开始学习的人,以及为了便于自己以后碰到同类问题而写的一、把数字字符,拼接在一起代码如下(因为我的三个字符用的是Long,所以是Long集合): List<Long> recString = new ArrayList<>(); recString.add(spu.getCid1()); recString.add(spu.getCid2()); recS原创 2021-05-26 17:35:26 · 430 阅读 · 0 评论 -
Could not write JSON: Java 8 date/time type `java.time.LocalDateTime`
Redis 在Springboot 中反序列化 LocalDateTime 时报错。原创 2023-10-10 14:50:37 · 347 阅读 · 1 评论 -
最基础的多表多条件分页查询
Controller层 @ApiOperation(value = "根据条件分页查询成绩") @PostMapping("condition/{current}/{limit}") public R pageQueryCondition(@ApiParam(name = "current", value = "当前页码", required = true) @PathVariable Long current,原创 2021-05-11 14:46:05 · 606 阅读 · 0 评论 -
ExcelVLOOKUP函数报#N/A错误的解决
1.首先你要返回的数据必须在第二列,因为在第一列,返回数据表第一列的数值。2.你查找值不能有空格,否则就会造成上述错误。原创 2023-04-11 16:43:16 · 183 阅读 · 1 评论 -
Could not autowire. No beans of “xxxxxx” type found.
Could not autowire. No beans of ‘RedisConnectionFactory‘ type found.原创 2023-10-17 10:53:42 · 191 阅读 · 0 评论 -
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)可能是因为target里mapper的impl没有解决办法1.粘贴复制impl2.在pom添加下面依赖,重新运行即可(有时候可能会比较慢)<build> <!--此配置是为了把配置文件夹打包到jar包中--> <resources> <resource> <dir原创 2021-04-23 15:23:35 · 121 阅读 · 0 评论 -
省市县三级联动异步问题解决方法(与后台仅交互一次)
问题代码created() { if (this.$route.params && this.$route.params.id) { const id = this.$route.params.id; this.getInfo(id);//有时候这个还没加载出来下面的已经加载了 } this.getProvinces(); },修改后的代码(把getProvinces放到生命周期靠后的挂载即可) created() { if原创 2021-05-06 17:06:49 · 127 阅读 · 0 评论 -
将多个List对象合并一个List对象,且List对象保持不变
将多个List对象合并一个List对象,且List对象保持不变,而不是变成list。这样前端不需要通过下标去取所有数据。原创 2021-05-14 15:32:34 · 3151 阅读 · 5 评论 -
如何将List集合中相同属性的对象合并
在实际的业务处理中,我们经常会碰到需要合并同一个集合内相同属性对象的情况,比如,同一个用户短时间内下的订单,我们需要将各个订单的金额合并成一个总金额。那么用lambda表达式和HashMap怎么分别处理该种情况呢?本文以Student的name,age,score为例,一个List集合中有多个Student对象,针对name和age相同属性值的Student对象,对score值相加并合并为一条,介绍两种不同的处理办法。1.用lambda表达式:首先,我们新建一个Student类 然后...转载 2021-05-14 15:36:44 · 4114 阅读 · 0 评论