Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
9a4c1ac0
提交
9a4c1ac0
authored
5月 27, 2020
作者:
gongwenjie
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'gwj' 到 'master'
Gwj 查看合并请求
!125
上级
711b8d50
3a617b49
流水线
#183
已取消 于阶段
变更
7
流水线
1
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
41 行增加
和
34 行删除
+41
-34
a.txt
a.txt
+0
-0
classpath
classpath
+0
-0
ExcelController.java
...java/com/zjty/tynotes/pas/controller/ExcelController.java
+18
-7
address.xls
notes-pas/src/main/resources/address.xls
+0
-0
UnionApplication.java
...rc/main/java/com/zjty/tynotes/union/UnionApplication.java
+16
-20
address.xls
notes-union/src/main/resources/address.xls
+0
-0
application.properties
notes-union/src/main/resources/application.properties
+7
-7
没有找到文件。
a.txt
0 → 100644
浏览文件 @
9a4c1ac0
classpath
0 → 100644
浏览文件 @
9a4c1ac0
notes-pas/src/main/java/com/zjty/tynotes/pas/controller/ExcelController.java
浏览文件 @
9a4c1ac0
...
@@ -9,17 +9,16 @@ import com.zjty.tynotes.misc.config.AutoDocument;
...
@@ -9,17 +9,16 @@ import com.zjty.tynotes.misc.config.AutoDocument;
import
com.zjty.tynotes.misc.utils.ExcelUtil
;
import
com.zjty.tynotes.misc.utils.ExcelUtil
;
import
com.zjty.tynotes.pas.dao.PasUserDao
;
import
com.zjty.tynotes.pas.dao.PasUserDao
;
import
com.zjty.tynotes.pas.entity.Address
;
import
com.zjty.tynotes.pas.entity.Address
;
import
com.zjty.tynotes.pas.entity.Department
;
import
com.zjty.tynotes.pas.entity.User
;
import
com.zjty.tynotes.pas.entity.User
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.http.RequestEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.util.ResourceUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -33,7 +32,6 @@ import java.util.ArrayList;
...
@@ -33,7 +32,6 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
org
.
springframework
.
http
.
ResponseEntity
.
ok
;
import
static
org
.
springframework
.
http
.
ResponseEntity
.
ok
;
...
@@ -54,7 +52,7 @@ public class ExcelController {
...
@@ -54,7 +52,7 @@ public class ExcelController {
@Autowired
@Autowired
private
BCryptPasswordEncoder
bCryptPasswordEncoder
;
private
BCryptPasswordEncoder
bCryptPasswordEncoder
;
private
String
addressUrl
=
"
C:/Users/gwj/Desktop/工作簿/
address.xls"
;
private
String
addressUrl
=
"address.xls"
;
@ApiOperation
(
value
=
"上传excel通讯录"
)
@ApiOperation
(
value
=
"上传excel通讯录"
)
@PostMapping
(
"/import"
)
@PostMapping
(
"/import"
)
...
@@ -130,8 +128,9 @@ public class ExcelController {
...
@@ -130,8 +128,9 @@ public class ExcelController {
@ApiOperation
(
value
=
"下载通讯录模板"
)
@ApiOperation
(
value
=
"下载通讯录模板"
)
@PostMapping
(
"/download"
)
@PostMapping
(
"/download"
)
public
ResponseEntity
download
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
public
ResponseEntity
download
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
String
filename
=
"address.xls"
;
String
filename
=
"address.xls"
;
File
file
=
new
File
(
addressUrl
);
File
file
=
ResourceUtils
.
getFile
(
"classpath:address.xls"
);
// File file = new File("src/main/resources/address.xls");
// System.out.println(addressUrl);
// System.out.println(addressUrl);
// System.out.println("存在??");
// System.out.println("存在??");
if
(
file
.
exists
()){
//判断文件父目录是否存在
if
(
file
.
exists
()){
//判断文件父目录是否存在
...
@@ -167,4 +166,16 @@ public class ExcelController {
...
@@ -167,4 +166,16 @@ public class ExcelController {
}
}
return
ok
(
"下载失败"
);
return
ok
(
"下载失败"
);
}
}
// public static void main(String[] args) {
// File file = new File("a.txt");
// if(!file.exists()){
// try {
// file.createNewFile();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// }
}
}
notes-pas/src/main/resources/address.xls
0 → 100644
浏览文件 @
9a4c1ac0
File added
notes-union/src/main/java/com/zjty/tynotes/union/UnionApplication.java
浏览文件 @
9a4c1ac0
...
@@ -11,7 +11,6 @@ import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
...
@@ -11,7 +11,6 @@ import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
...
@@ -48,25 +47,22 @@ public class UnionApplication
...
@@ -48,25 +47,22 @@ public class UnionApplication
SpringApplication
.
run
(
UnionApplication
.
class
,
args
);
SpringApplication
.
run
(
UnionApplication
.
class
,
args
);
}
}
// 开始支持http
// 开始支持http
@Bean
// @Bean
public
ServletWebServerFactory
servletContainer
()
{
// public ServletWebServerFactory servletContainer() {
TomcatServletWebServerFactory
tomcat
=
new
TomcatServletWebServerFactory
();
// TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
tomcat
.
addAdditionalTomcatConnectors
(
createHTTPConnector
());
// tomcat.addAdditionalTomcatConnectors(createHTTPConnector());
return
tomcat
;
// return tomcat;
}
// }
//
private
Connector
createHTTPConnector
()
{
// private Connector createHTTPConnector() {
Connector
connector
=
new
Connector
(
"org.apache.coyote.http11.Http11NioProtocol"
);
// Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
//同时启用http(8080)、https(8443)两个端口
// //同时启用http(8080)、https(8443)两个端口
connector
.
setScheme
(
"http"
);
// connector.setScheme("http");
connector
.
setSecure
(
false
);
// connector.setSecure(false);
connector
.
setPort
(
8084
);
// connector.setPort(8084);
connector
.
setRedirectPort
(
8289
);
// connector.setRedirectPort(8289);
return
connector
;
// return connector;
}
// }
@Autowired
private
AttendanceDetailsDao
attendanceDetailsDao
;
}
}
notes-union/src/main/resources/address.xls
0 → 100644
浏览文件 @
9a4c1ac0
File added
notes-union/src/main/resources/application.properties
浏览文件 @
9a4c1ac0
...
@@ -3,13 +3,13 @@ spring.application.name=workbook
...
@@ -3,13 +3,13 @@ spring.application.name=workbook
## https端口号.
## https端口号.
server.port
=
8289
server.port
=
8289
# 证书的路径.
# 证书的路径.
server.ssl.key-store
=
classpath:2586377_workbook.zjtys.com.cn.pfx
#
server.ssl.key-store=classpath:2586377_workbook.zjtys.com.cn.pfx
# 证书密码,请修改为您自己证书的密码.
#
#
证书密码,请修改为您自己证书的密码.
server.ssl.key-store-password
=
bMEPW9BG
#
server.ssl.key-store-password=bMEPW9BG
# 秘钥库类型
#
#
秘钥库类型
server.ssl.keyStoreType
=
PKCS12
#
server.ssl.keyStoreType=PKCS12
# 证书别名
#
#
证书别名
server.ssl.keyAlias
=
alias
#
server.ssl.keyAlias= alias
#mongodb configuration
#mongodb configuration
spring.data.mongodb.uri
=
mongodb://localhost:27017/notes5
spring.data.mongodb.uri
=
mongodb://localhost:27017/notes5
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论