本文旨在记录日常开发中的模糊点。。。。
持续更新汇总中。。。。。。。
在Linux上的部署发方式
nohup java -jar xxx.jar > catalina.out 2>&1 &
停止方式
ps -ef | grep email-0.0.1.jar | grep -v grep | awk '{ print $2 }'
kill -9 pid
对应停止脚本
#!/bin/bash
PID=$(ps -ef | grep yourapp.jar | grep -v grep | awk '{ print $2 }')
if [ ${PID} ];
then
echo 'Application is stpping...'
echo kill $PID DONE
kill $PID
else
echo 'Application is already stopped...'
fi
win上对应的停止脚本
netstat -ano|findstr 9000
TCP 0.0.0.0:7004 0.0.0.0:0 LISTENING 15044
taskkill -PID 15044 -F
date—>LocalDate
public stat ic LocalDate transport(Date date) {
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse("2014-03-02");
1、对Map分组
2、对Map遍历
1、对list实体进行分组
List<ProjectconfigeventEntity> dataAll = this.queryList();
Map<Integer, List<ProjectconfigeventEntity>> collect = dataAll.stream().collect(Collectors.groupingBy(ProjectconfigeventEntity::getTreeid));
用这种方式分组后会有一个问题,那就是顺序是乱的,排序不对,使用如下方式解决
List<ProjectflowconfigEntity> list = this.list(queryWrapper);
Map<String, List<ProjectflowconfigEntity>> collect = list.stream().collect(Collectors.groupingBy(ProjectflowconfigEntity::getCurrentNode,LinkedHashMap::new, Collectors.toList()));
Map<String, ProjectflowconfigEntity> map = new LinkedHashMap<>(collect.size());
collect.forEach(
(k, v) -> {
ProjectflowconfigEntity projectflowconfigEntity = v.get(0);
map.put(k, projectflowconfigEntity);
}
);
2、对list中存储的map分组
List<Map<String, Object>> ydMaps = projectapplyinfoydjsDao.countEventYD(year);
Map<String, List<Map<String, Object>>> ydMap = ydMaps.stream().collect(Collectors.groupingBy(o -> o.get("mon").toString()));
Map<String, String> params = JSONObject.parseObject(listsFiles, new TypeReference<Map<String, String>>() { });
实体类----》map
Map map = JSON.parseObject(JSON.toJSONString(ApplyIntoCenterEntity), Map.class);
单机启动命令
sh startup.sh -m standalone
#三、开发工具
将代理地址修改为阿里云的地址即可
https://start.aliyun.com/
启动
docker start $(docker ps -a | awk '{ print $1}' | tail -n +2)
关闭
docker stop $(docker ps -a | awk '{ print $1}' | tail -n +2)
vi /etc/docker/daemon.json
docker save -o redis.tar redis:5.0.2
docker load -i redis.tar
1、Linux上tomcat启动正常,就是访问不了,
问题排查方式:
使用这种方式,启动后查看报错信息
./catalina.sh run &
Mybatis使用in语句
String[] split = ids.split(",");
for (int i = 0; i < split.length; i++) {
lists.add(split[0]);
}
qw.in("", lists);
vi /etc/profile
export MAVEN_HOME=/usr/local/soft/maven/apache-maven-3.6.0/
export PATH=${PATH}:${MAVEN_HOME}/bin
本地jar安装到指定仓库
mvn install:install-file -Dmaven.repo.local=/root/maven/repository/ -DgroupId=com.dfec -DartifactId=common-auth -Dversion=1.0.4 -Dpackaging=jar -Dfile=/root/common-auth-1.0.4.jar
JAVA_HOME=/usr/local/soft/java/jdk1.8.0_311/
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
select table_name,table_comment from information_schema.tables where table_schema='lnrf';