java 使用IBMMQ
摘要:1. 安装IBM MQ的服务端,参考https://blog.csdn.net/qq_34010941/article/details/119995202 以下我安装的 队列管理器的名称:mq mq配置的监听端口:1414 本地队列名字:MQ_send 字符集:1381 属于 mq组 的本地用户账号
阅读全文
如何在swagger中配置多个spec
摘要:1.效果图如下: 2.已springBoot项目为例 在SwaggerConfig中添加以下代码: @Bean("质量管理") public Docket controller1Apis() { return new Docket(DocumentationType.SWAGGER_2) .grou
阅读全文
下载文件
摘要:/** * 下载文件 * @param fileName * @param out */ public static void downloadTemplate(String fileName, HttpServletResponse response) { try { fileName = URL
阅读全文
将byte转为16进制
摘要:/** * 将byte转为16进制 * * @param bytes * @return */ private static String byte2Hex(byte[] bytes) { StringBuffer stringBuffer = new StringBuffer(); String
阅读全文
JavaBean对象转化成Map对象
摘要:/** * JavaBean对象转化成Map对象 * * @param javaBean * @return * @author */ public static Map<String, Object> bean2Map(Object javaBean) { Map<String, Object>
阅读全文
判断字符串是否是数字
摘要:/** * 判断字符串是否是数字 * @param s * @return */ public final static boolean isNumeric(String s) { if (s != null && !"".equals(s.trim())) return s.matches("^[
阅读全文
判断是否是正确的ip地址
摘要:/** * 判断是否是正确的ip地址 * @param str * @return */ public static boolean isIPAddress(String str) { // 如果长度不符合条件 返回false if (str.length() < 7 || str.length()
阅读全文
list<entity>转list<map>
摘要:@SuppressWarnings("unchecked") public static <T> List<Map<String, Object>> listConvert(List<T> list) { List<Map<String, Object>> list_map = new ArrayL
阅读全文
对list分页
摘要:/** * 根据索引对源list进行截取并返回新的list,如果pageSize和pageNum任意一个为null、空字符串 * @param list 源list * @param pageSize 每页数量 * @param pageNum 页数 * @return */ @SuppressWa
阅读全文
UTC时间与本地时间转换
摘要:/** * UTC时间转成本地时间 * 把带t和z的时间转换成相应的时间格式(对应时区) * @param tzTime 传入的时间(格式为:2016-08-15T16:00:00.000Z) * @param foramt 返回的时间类型 * @return */ public static St
阅读全文
格式化时间(xx天xx时xx分xx秒)
摘要:/** * 格式化时间(xx天xx时xx分xx秒) * @param mills * @return */ public static String formatTime(long ms) { if (ms == 0) { return ""; } Integer ss = 1000; Intege
阅读全文
计算两个日期相差的天数
摘要:/** * 计算两个日期相差的天数 * @param date1 * @param date2 * @return */ public static int differentDays(Date date1, Date date2) { Calendar cal1 = Calendar.getIns
阅读全文
获取当前星期几
摘要:/** * 获取当前星期几 * @return */ @SuppressWarnings("static-access") public static int getWeek() { //获取当前星期几 Calendar calendar; calendar = Calendar.getInstan
阅读全文
配jdk的环境变量
摘要:变量名:JAVA_HOME 变量值:C:\Program Files (x86)\Java\jdk1.7.0_01(jdk的安装路径) 变量名:CLASSPATH 变量值:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;(不要改) 变量名:Path 变量值:%
阅读全文