Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王琮
platform
Commits
3629cb7f
Commit
3629cb7f
authored
Nov 05, 2021
by
王琮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口所在文件
parent
94282bf9
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
24 additions
and
27 deletions
+24
-27
FileCtrl.java
src/main/java/com/tiptimes/ctrl/FileCtrl.java
+3
-3
QuestionnaireCtrl.java
src/main/java/com/tiptimes/ctrl/QuestionnaireCtrl.java
+1
-1
FileDao.java
src/main/java/com/tiptimes/dao/FileDao.java
+0
-5
QuestionnaireDao.java
src/main/java/com/tiptimes/dao/QuestionnaireDao.java
+3
-0
FileService.java
src/main/java/com/tiptimes/service/FileService.java
+0
-4
QuestionnaireService.java
src/main/java/com/tiptimes/service/QuestionnaireService.java
+3
-0
FileServiceImpl.java
src/main/java/com/tiptimes/service/impl/FileServiceImpl.java
+0
-10
QuestionnaireServiceImpl.java
...a/com/tiptimes/service/impl/QuestionnaireServiceImpl.java
+5
-0
FileUtil.java
src/main/java/com/tiptimes/util/FileUtil.java
+5
-0
File.xml
src/main/resources/mapper/File.xml
+0
-4
Questionnaire.xml
src/main/resources/mapper/Questionnaire.xml
+4
-0
No files found.
src/main/java/com/tiptimes/ctrl/FileCtrl.java
View file @
3629cb7f
...
...
@@ -147,9 +147,9 @@ public class FileCtrl {
fileName
=
file
.
getFileName
();
String
originPath
=
""
;
if
(
fileNum
.
startsWith
(
"http"
))
{
originPath
=
fileN
ame
;
originPath
=
fileN
um
;
}
else
{
originPath
=
this
.
getfileUrl
()
+
fileN
ame
;
originPath
=
this
.
getfileUrl
()
+
fileN
um
;
}
String
targetPath
=
myPath
+
fileName
;
...
...
@@ -220,7 +220,7 @@ public class FileCtrl {
map
.
put
(
"fileName"
,
myfile
.
getOriginalFilename
());
map
.
put
(
"fileID"
,
uuid
);
byte
[]
buffer
=
myfile
.
getBytes
();
FileOutputStream
fos
=
new
FileOutputStream
(
this
.
getfileUrl
()
+
myfile
.
getOriginalFilename
()
);
FileOutputStream
fos
=
new
FileOutputStream
(
this
.
getfileUrl
()
+
fileNum
);
fos
.
write
(
buffer
);
fos
.
close
();
File
file
=
new
File
();
...
...
src/main/java/com/tiptimes/ctrl/QuestionnaireCtrl.java
View file @
3629cb7f
...
...
@@ -265,7 +265,7 @@ public class QuestionnaireCtrl {
if
(!
fileForExists
.
exists
())
{
FileUtil
.
mkdirFolders
(
myPath
);
}
List
<
String
>
fileID
=
this
.
fileServer
.
selectFileId
(
optionId
,
recordId
);
List
<
String
>
fileID
=
this
.
questionnaireService
.
selectFileId
(
optionId
,
recordId
);
for
(
int
i
=
0
;
i
<
fileID
.
size
();++
i
)
{
File
file
=
this
.
fileServer
.
selectFileByFileID
(
fileID
.
get
(
i
));
try
{
...
...
src/main/java/com/tiptimes/dao/FileDao.java
View file @
3629cb7f
...
...
@@ -6,8 +6,6 @@
package
com
.
tiptimes
.
dao
;
import
com.tiptimes.model.File
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
FileDao
{
...
...
@@ -18,7 +16,4 @@ public interface FileDao {
List
<
File
>
listFileByFileID
(
String
var1
);
List
<
String
>
listFileNameByFileID
(
String
var1
);
List
<
String
>
selectFileId
(
@Param
(
"optionId"
)
Long
optionId
,
@Param
(
"recordId"
)
Long
recordId
);
}
src/main/java/com/tiptimes/dao/QuestionnaireDao.java
View file @
3629cb7f
...
...
@@ -32,4 +32,7 @@ public interface QuestionnaireDao {
Record
selectById
(
Long
recordId
);
List
<
Record
>
selectRecordList
(
Record
record
);
List
<
String
>
selectFileId
(
@Param
(
"optionId"
)
Long
optionId
,
@Param
(
"recordId"
)
Long
recordId
);
}
src/main/java/com/tiptimes/service/FileService.java
View file @
3629cb7f
...
...
@@ -2,16 +2,12 @@ package com.tiptimes.service;
import
com.tiptimes.model.File
;
import
java.util.List
;
public
interface
FileService
{
File
selectFileByFileID
(
String
paramString
);
void
saveFile
(
File
paramFile
);
String
updateFile
(
String
paramString1
,
String
paramString2
);
//根据选项id查询文件对应id
List
<
String
>
selectFileId
(
Long
optionId
,
Long
recordId
);
}
...
...
src/main/java/com/tiptimes/service/QuestionnaireService.java
View file @
3629cb7f
...
...
@@ -86,6 +86,9 @@ public interface QuestionnaireService {
* @return
*/
List
<
Record
>
selectRecordList
(
Record
record
);
//根据选项id查询文件对应id
List
<
String
>
selectFileId
(
Long
optionId
,
Long
recordId
);
}
src/main/java/com/tiptimes/service/impl/FileServiceImpl.java
View file @
3629cb7f
...
...
@@ -45,14 +45,4 @@ public class FileServiceImpl implements FileService {
return
""
;
}
/**
*
* @param optionId
* @return
*/
@Override
public
List
<
String
>
selectFileId
(
Long
optionId
,
Long
recordId
)
{
return
fileDao
.
selectFileId
(
optionId
,
recordId
);
}
}
src/main/java/com/tiptimes/service/impl/QuestionnaireServiceImpl.java
View file @
3629cb7f
...
...
@@ -131,4 +131,9 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
public
List
<
Record
>
selectRecordList
(
Record
record
)
{
return
questionnaireDao
.
selectRecordList
(
record
);
}
@Override
public
List
<
String
>
selectFileId
(
Long
optionId
,
Long
recordId
)
{
return
questionnaireDao
.
selectFileId
(
optionId
,
recordId
);
}
}
src/main/java/com/tiptimes/util/FileUtil.java
View file @
3629cb7f
...
...
@@ -156,6 +156,7 @@ public class FileUtil {
public
static
File
copyFileByPath
(
String
originPath
,
String
targetPath
,
String
targetPathForRepeat
)
throws
IOException
{
File
targetFile
=
new
File
(
targetPath
);
try
{
BufferedInputStream
input
=
null
;
if
(
originPath
.
startsWith
(
"http"
))
{
...
...
@@ -172,16 +173,20 @@ public class FileUtil {
byte
[]
buffer
=
new
byte
[
1048576
];
int
bytesum
=
0
;
boolean
var8
=
false
;
int
byteread
;
while
((
byteread
=
input
.
read
(
buffer
))
!=
-
1
)
{
bytesum
+=
byteread
;
fps
.
write
(
buffer
,
0
,
byteread
);
fps
.
flush
();
}
fps
.
close
();
input
.
close
();
}
catch
(
Exception
var9
)
{
}
return
targetFile
;
}
}
src/main/resources/mapper/File.xml
View file @
3629cb7f
...
...
@@ -46,8 +46,4 @@
where pf.FileID=#{fileID}
AND pf.UserLifeCycle=0
</select>
<select
id=
"selectFileId"
resultType=
"java.lang.String"
>
select `value` from t_answer where options_id=#{optionId} and record_id =#{recordId}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/Questionnaire.xml
View file @
3629cb7f
...
...
@@ -111,4 +111,8 @@
AND process_status #{processStatus}
</if>
</select>
<select
id=
"selectFileId"
resultType=
"java.lang.String"
>
select `value` from t_answer where options_id=#{optionId} and record_id =#{recordId}
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment