From ab39dd7e0b981fd54e128351235b8f30f8602e7d Mon Sep 17 00:00:00 2001 From: zhangyanli Date: Wed, 6 Mar 2024 17:38:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B1=E9=80=9A=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/zcloud/util/Const.java | 10 +++++++-- src/main/java/com/zcloud/util/DateUtil.java | 19 +++++++++++++++++ src/main/java/com/zcloud/util/PathUtil.java | 8 ------- src/main/resources/application.properties | 23 +++++++++++++++++++++ 4 files changed, 50 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/zcloud/util/Const.java b/src/main/java/com/zcloud/util/Const.java index 3d99cc7..ebd709c 100644 --- a/src/main/java/com/zcloud/util/Const.java +++ b/src/main/java/com/zcloud/util/Const.java @@ -70,7 +70,6 @@ public class Const { public static final String ALI_TEMPLATEGROUPID = "eda7780b4706ec92ea47a79b6e6bcad1"; // 阿里云视频转码模板id public static final String ALIYUN_REGIONID = "cn-beijing"; // 点播服务接入地域 public static final String ENDPOINT = "vod.cn-beijing.aliyuncs.com";// 访问的域名 - public static final String TOPIC_EIGHTWORK="eightWork_whb_chen"; // 修改用户相关 @@ -106,5 +105,12 @@ public class Const { put("uniformnn", "工服(工服库)"); put("wastebinmonitoring", "垃圾桶检测"); }}; - + public static final String FILEPATHWORDTEMPLATE = "/uploadFiles/wordTemplate/"; //word导出模板文件夹 + public static final String FILEPATHFACE = "/uploadFiles/face/"; //文件上传路径 + public static final String ARCHIVESPDFFILE = "/uploadFiles/archivesPdfFile/"; // 档案pdf 文件 + public static final String FILEPATHUSERPHOTO = "/uploadFiles/userphoto/"; //文件上传路径-用户头像 + public static final String TEMPZIPFILES = "/uploadFiles/tempZip/"; //文件上传路径 + public static final String FILEPATHARCHIVES = "/uploadFiles/archives/"; //档案文件上传路径 + public static final String FILEPATHCURRICULUM = "/uploadFiles/curriculum/"; //课程照片 + public static final String ALI_TEMPLATEGROUPIDM3U8 = "90b8844910ae453b8bb656497c245bc0"; // 阿里云视频转码模板id M3U8模板 } diff --git a/src/main/java/com/zcloud/util/DateUtil.java b/src/main/java/com/zcloud/util/DateUtil.java index 6153fe1..644a58d 100644 --- a/src/main/java/com/zcloud/util/DateUtil.java +++ b/src/main/java/com/zcloud/util/DateUtil.java @@ -20,6 +20,7 @@ public class DateUtil { private final static SimpleDateFormat sdfDays = new SimpleDateFormat("yyyyMMdd"); private final static SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private final static SimpleDateFormat sdfTimes = new SimpleDateFormat("yyyyMMddHHmmss"); + private final static SimpleDateFormat sdfTimesSSS = new SimpleDateFormat("yyyyMMddHHmmssSSS"); /** * 获取YYYY格式 @@ -29,6 +30,14 @@ public class DateUtil { public static String getSdfTimes() { return sdfTimes.format(new Date()); } + /** + * 获取YYYY格式 毫秒 + * + * @return + */ + public static String getSdfTimesSSS() { + return sdfTimesSSS.format(new Date()); + } /** * 获取YYYY格式 @@ -872,4 +881,14 @@ public class DateUtil { Collections.reverse(timeArray); return timeArray; } + + public static Date getDate(String date) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + return sdf.parse(date); + } catch (ParseException e) { + e.printStackTrace(); + } + return new Date(); + } } diff --git a/src/main/java/com/zcloud/util/PathUtil.java b/src/main/java/com/zcloud/util/PathUtil.java index 77e303b..1900847 100644 --- a/src/main/java/com/zcloud/util/PathUtil.java +++ b/src/main/java/com/zcloud/util/PathUtil.java @@ -41,14 +41,6 @@ public class PathUtil implements ServletContextAware { return path; } - /**获取Projectpath - * @return - */ - public static String getProjectpath(){ - HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - String path = request.getServletContext().getRealPath("/").replaceAll("%20", " ").replaceAll("file:/", "").trim(); - return path; - } @Override public void setServletContext(ServletContext servletContext) { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index fece455..71f49e5 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -12,6 +12,16 @@ datasource.no2.url=jdbc:mysql://192.168.0.64:3306/qa-traffic-admin?serverTimezon datasource.no2.username=root datasource.no2.password=root +datasource.no3.driver-class-name: com.mysql.cj.jdbc.Driver +datasource.no3.url=jdbc:mysql://192.168.0.64:3306/qa-traffic-education-org?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 +datasource.no3.username=root +datasource.no3.password=root + +datasource.no4.driver-class-name: com.mysql.cj.jdbc.Driver +datasource.no4.url=jdbc:mysql://192.168.0.64:3306/qa-traffic-education-res?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 +datasource.no4.username=root +datasource.no4.password=root + #druid\u8FDE\u63A5\u6C60 spring.datasource.type: com.alibaba.druid.pool.DruidDataSource #\u6700\u5927\u6D3B\u8DC3\u6570 @@ -84,3 +94,16 @@ customer.SECRET_KEY=a256e8575c3f4240b08f6350f13ce8e2 #\u5F00\u53D1 customer.url=https://api.qhdsafety.com/sync/ customer.domain=video.qhdsafety.com + + +#???????? +# ?????? +spring.task.execution.pool.core-size= 1 +# ?????? +spring.task.execution.pool.max-size= 1 +# ??????? +spring.task.execution.pool.queue-capacity= 30 +# ?????????? +spring.task.execution.pool.keep-alive= 60 +## ???????? +spring.task.execution.thread-name-prefix= upload-archives-file-task-