Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kwell-mes
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
gavelinfo
kwell-mes
Commits
ab9c06a7
Commit
ab9c06a7
authored
Apr 02, 2022
by
yff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
附件修改
parent
61045403
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
6 deletions
+45
-6
GpfkController.java
.../main/java/com/gavel/kwell/controller/GpfkController.java
+0
-2
GpfkfjService.java
.../src/main/java/com/gavel/kwell/service/GpfkfjService.java
+3
-0
GpfkServiceImpl.java
...in/java/com/gavel/kwell/service/impl/GpfkServiceImpl.java
+2
-0
GpfkfjServiceImpl.java
.../java/com/gavel/kwell/service/impl/GpfkfjServiceImpl.java
+40
-4
No files found.
gavel/src/main/java/com/gavel/kwell/controller/GpfkController.java
View file @
ab9c06a7
package
com
.
gavel
.
kwell
.
controller
;
import
java.io.FileInputStream
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -278,7 +277,6 @@ public class GpfkController extends BaseController {
FileInputStream
fileInputStream
=
attachmentService
.
download
(
file
.
getId
());
doAttachmentPreview
(
file
.
getId
(),
response
,
fileInputStream
);
}
}
@RequestMapping
(
value
=
"/jgfk"
,
method
=
RequestMethod
.
POST
)
...
...
gavel/src/main/java/com/gavel/kwell/service/GpfkfjService.java
View file @
ab9c06a7
package
com
.
gavel
.
kwell
.
service
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.gavel.common.attachment.persistent.Attachment
;
import
com.gavel.common.base.service.BaseEditService
;
...
...
@@ -9,4 +11,5 @@ public interface GpfkfjService extends BaseEditService {
public
Attachment
queryBzgxFj
(
String
bzgxid
,
String
type
);
public
void
checkGxfjIfFitRule
(
MultipartFile
multipartFile
,
String
folderorpath
,
String
groupid
);
}
gavel/src/main/java/com/gavel/kwell/service/impl/GpfkServiceImpl.java
View file @
ab9c06a7
...
...
@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.gavel.common.Constants
;
import
com.gavel.common.attachment.persistent.Attachment
;
...
...
@@ -1967,5 +1968,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
}
/************ -------------------科威尔反馈升级--END--------- ******/
}
gavel/src/main/java/com/gavel/kwell/service/impl/GpfkfjServiceImpl.java
View file @
ab9c06a7
...
...
@@ -6,8 +6,11 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.gavel.common.attachment.persistent.Attachment
;
import
com.gavel.common.attachment.persistent.Folder
;
import
com.gavel.common.attachment.service.AttachmentFolderService
;
import
com.gavel.common.attachment.service.AttachmentService
;
import
com.gavel.common.base.service.impl.BaseEditServiceImpl
;
import
com.gavel.gygl.dao.BzgxDao
;
...
...
@@ -18,7 +21,8 @@ import com.gavel.kwell.service.GpfkfjService;
@Service
(
"gpfkfjService"
)
@Transactional
public
class
GpfkfjServiceImpl
extends
BaseEditServiceImpl
implements
GpfkfjService
{
@Autowired
private
AttachmentFolderService
attachmentFolderService
;
@Autowired
private
AttachmentService
attachmentService
;
...
...
@@ -26,7 +30,7 @@ public class GpfkfjServiceImpl extends BaseEditServiceImpl implements GpfkfjServ
@Autowired
private
BzgxDao
bzgxDao
;
private
static
final
String
ZDS1_FLODER
=
"
bzgx\\gyzyzdso
"
;
private
static
final
String
ZDS1_FLODER
=
"
gylx
"
;
private
static
final
String
ZDS2_FLODER
=
"bzgx\\gyzyzdss"
;
...
...
@@ -35,7 +39,6 @@ public class GpfkfjServiceImpl extends BaseEditServiceImpl implements GpfkfjServ
private
static
final
String
ZDS2_BZ
=
"T"
;
private
static
final
String
SP_BZ
=
"M"
;
@Override
public
void
initService
()
{
}
...
...
@@ -68,9 +71,42 @@ public class GpfkfjServiceImpl extends BaseEditServiceImpl implements GpfkfjServ
}
@Override
public
void
checkGxfjIfFitRule
(
MultipartFile
multipartFile
,
String
folderorpath
,
String
groupid
)
{
Folder
folder
=
attachmentFolderService
.
getFolder
(
folderorpath
,
true
);
if
(
folder
!=
null
&&
StringUtils
.
isNotEmpty
(
folder
.
getPath
()))
{
String
suffix
=
getFileSuffix
(
multipartFile
);
if
(
folder
.
getPath
().
equals
(
ZDS1_FLODER
))
{
if
(!
suffix
.
toUpperCase
().
endsWith
(
".PDF"
))
{
throwReturnMessage
(
"上传文件得为PDF格式!,请重新检查!"
);
}
}
else
if
(
folder
.
getPath
().
equals
(
ZDS2_FLODER
))
{
if
(!
suffix
.
toUpperCase
().
endsWith
(
".PDF"
))
{
throwReturnMessage
(
"上传文件得为PDF格式!,请重新检查!"
);
}
}
else
if
(
folder
.
getPath
().
equals
(
SP_FLODER
))
{
if
(!
suffix
.
toUpperCase
().
endsWith
(
".MP4"
))
{
throwReturnMessage
(
"上传文件得为MP4视频格式!,请重新检查!"
);
}
}
else
{
}
}
}
public
static
String
getFileSuffix
(
MultipartFile
multipartFile
)
{
//获取文件全名
String
filename
=
multipartFile
.
getOriginalFilename
();
//对文文件的全名进行截取然后在后缀名进行删选。
int
begin
=
filename
.
indexOf
(
"."
);
int
last
=
filename
.
length
();
//获得文件后缀名
return
filename
.
substring
(
begin
,
last
);
}
}
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