- 博客(21)
- 问答 (1)
- 收藏
- 关注
原创 优化两层for循环,map<需要比较的属性,实体类>
1.将energyTonAvgList转换成Map,以减少对List的多次遍历,提高计算效率。2.使用三目运算符对warning和alarm进行设置,不需要使用if-else语句。
2023-05-25 15:37:08
222
转载 HttpClientUtil(转载) 支持http、https、包含请求头
一、HttpClientUtil(转载)仅作为个人随笔, 不用作其他, 如有侵权, 请联系作者删除import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.apache.http.*;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.HttpClien
2021-11-25 15:54:55
560
原创 SpringSchedule定时任务
一、SpringSchedule定时任务(三步)第一步:启动类加 @EnableScheduling //开启SpringSchedule定时任务,扫描容器import org.mybatis.spring.annotation.MapperScan;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;impor
2021-11-25 15:33:06
348
原创 从指定的url下载文件到指定目录,计算出md5,判断下载下来的文件和指定的文件 类别 是否一致(不根据文件后缀判断)
一、从指定的url下载文件到指定目录,计算出md5,判断链接实际类别与给定类别是否一致一、使用步骤1.导入包import org.apache.commons.codec.digest.DigestUtils;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import javax.imageio.ImageIO;import javax.imageio.ImageReader;import javax.imageio.stre
2021-11-24 11:34:37
1741
原创 合并两个int数组为一个新的有序数组(正序,倒序)
一、合并两个int数组为一个新的有序数组代码如下(示例):public static void main(String[] args) { int[] a = {1,2,3,4,5}; int[] b = {2,5,6}; int[] result = new int[a.length + b.length]; System.arraycopy(a, 0, result, 0, a.length); System.arraycopy(b, 0, resu
2021-11-01 16:29:58
622
原创 调用两个接口,将两个List放入到一个List中
文章目录使用步骤1.调用网易七鱼接口2.调用第三方接口3.将两个List合并到一个提示:以下是本篇文章正文内容,下面案例可供参考使用步骤1.调用网易七鱼接口代码如下:private static final int timeoutMills = 3000;//设置请求超时@Override public List<OnlineSessionRecord> queryOnlineSessionRecords(String personID, String appKey, S
2021-06-24 18:36:42
620
原创 List使用stream手动分页
二、使用步骤1.List使用stream手动分页代码如下(示例):public static void main(String[] args) { List<String> asList = Arrays.asList("1", "2", "3", "4"); Integer currentPageNumber = 1;//当前页 Integer pageMaxSize = 3;//每页条数 List<String>
2021-06-19 14:52:39
3119
原创 SpringMVC使用ModelAndView 跳转第三方url
1.SpringMVC使用ModelAndView 跳转外部项目方式代码如下(示例):@RequestMapping(value = "/goToWcyAIClinical", method = RequestMethod.GET) public ModelAndView goToWcyAIClinical(HttpServletRequest request, HttpServletResponse response) throws BaseException { ModelA
2021-06-18 10:51:33
2798
原创 java前端传时间范围, 后端处理
二、java前端传时间范围, 后端处理 String timeRange = tcActivity.getTimeRange(); if (StringUtils.isNotEmpty(timeRange)){ List<Long> list = JsonUtil.jsonStringToList(timeRange); if (!list.isEmpty()) { tcActivity.setS
2021-06-08 23:40:48
2311
2
原创 枚举类
二、快速建一个枚举类代码如下(示例):package com.seeyon.store.enums;import java.text.MessageFormat;public enum TestEnum { SUCCESS("00000", "成功"); private String code; private String message; TestEnum (String code, String message) { this.cod
2021-04-26 16:36:44
100
原创 项目工程对接第三方接口
对接第三方接口controller@Autowired private AchUnionService achUnionService; @RequestMapping("/getAchUnion") public PetInfoResult getAchUnion(HttpServletRequest request) throws BaseException { String couponCode = request.getParameter("couponCod
2021-03-06 14:14:32
627
原创 小程序跳转小程序, 判断手机号是否一致, 跳转页面
if (判断条件) { let userInfo = cache.getUserInfoFromCache(); //从缓存获取手机号 this.xxxPhoneCheck(userInfo.phoneNumber, enterWebviewUrl); return; }xxxPhoneCheck(phoneNumber, enterWebviewUrl
2021-03-05 17:58:20
286
原创 从当前页面url获取参数(不是从router获取)
从当前页面url获取参数(不是从router获取)获取当前页url的域: window.location.origincreated(){ this.queryUrlParam(); },queryUrlParam(){ let url = document.location.toString();//获取url地址 let urlParmStr = url.slice(url.indexOf('?')+1);//获取问号后所有的字符串 let
2021-03-05 17:18:11
198
原创 vue页面跳转小程序wx-open-launch-weapp
vue页面跳转小程序wx-open-launch-weappvue页面跳转小程序wx-open-launch-weappvue页面跳转小程序wx-open-launch-weapp需求: 从vue页面点击按钮跳转小程序参考官网: 微信开发官网https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html#21个人原创: 哆啦a梦宋<template> <div class="
2021-03-04 18:20:50
1732
7
空空如也
java 如何获取本地已安装的所有软件,并获取已安装的软件是否运行?
2022-01-19
TA创建的收藏夹 TA关注的收藏夹
TA关注的人