Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
test
Project
Project
Details
Activity
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
邬友楠
test
Commits
7f38ae14
Commit
7f38ae14
authored
Mar 08, 2021
by
雍欢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传附件的时候,检查附件密级是否与人员密级匹配
parent
aa97650f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
TestAttachmentSecretInfoResolver.java
...nt/application/impl/TestAttachmentSecretInfoResolver.java
+9
-1
spring-extend.xml
huigou-xt/src/main/resources/config/spring/spring-extend.xml
+4
-2
No files found.
huigou-uasp/src/main/java/com/huigou/uasp/bmp/doc/attachment/application/impl/TestAttachmentSecretInfoResolver.java
View file @
7f38ae14
...
@@ -29,6 +29,10 @@ public class TestAttachmentSecretInfoResolver implements AttachmentSecretInfoRes
...
@@ -29,6 +29,10 @@ public class TestAttachmentSecretInfoResolver implements AttachmentSecretInfoRes
private
final
static
Pattern
FILE_NAME_PATTERN
=
Pattern
.
compile
(
"^【(.+)】.+$"
);
private
final
static
Pattern
FILE_NAME_PATTERN
=
Pattern
.
compile
(
"^【(.+)】.+$"
);
private
AttachmentConfigurationRepository
attachmentConfigurationRepository
;
private
AttachmentConfigurationRepository
attachmentConfigurationRepository
;
private
OrgApplication
orgApplication
;
private
OrgApplication
orgApplication
;
/**
* 密级字典编码
*/
private
String
securityGradeDictionaryCode
;
@Autowired
@Autowired
public
void
setAttachmentConfigurationRepository
(
AttachmentConfigurationRepository
attachmentConfigurationRepository
)
{
public
void
setAttachmentConfigurationRepository
(
AttachmentConfigurationRepository
attachmentConfigurationRepository
)
{
...
@@ -40,6 +44,10 @@ public class TestAttachmentSecretInfoResolver implements AttachmentSecretInfoRes
...
@@ -40,6 +44,10 @@ public class TestAttachmentSecretInfoResolver implements AttachmentSecretInfoRes
this
.
orgApplication
=
orgApplication
;
this
.
orgApplication
=
orgApplication
;
}
}
public
void
setSecurityGradeDictionaryCode
(
String
securityGradeDictionaryCode
)
{
this
.
securityGradeDictionaryCode
=
securityGradeDictionaryCode
;
}
@Override
@Override
public
void
resolve
(
Attachment
attachment
)
{
public
void
resolve
(
Attachment
attachment
)
{
AttachmentConfiguration
attachmentConfiguration
=
attachmentConfigurationRepository
.
findByCode
(
attachment
.
getBizKindId
());
AttachmentConfiguration
attachmentConfiguration
=
attachmentConfigurationRepository
.
findByCode
(
attachment
.
getBizKindId
());
...
@@ -52,7 +60,7 @@ public class TestAttachmentSecretInfoResolver implements AttachmentSecretInfoRes
...
@@ -52,7 +60,7 @@ public class TestAttachmentSecretInfoResolver implements AttachmentSecretInfoRes
Assert
.
isTrue
(
matcher
.
matches
(),
"附件名不合法"
);
Assert
.
isTrue
(
matcher
.
matches
(),
"附件名不合法"
);
String
attachmentSecurityGradeName
=
matcher
.
group
(
1
);
String
attachmentSecurityGradeName
=
matcher
.
group
(
1
);
Assert
.
hasText
(
attachmentSecurityGradeName
,
"附件名中未包含附件密级信息"
);
Assert
.
hasText
(
attachmentSecurityGradeName
,
"附件名中未包含附件密级信息"
);
Collection
<
DictionaryDesc
>
secrecyLevels
=
SystemCache
.
getDictionary
(
"secrecyLevel"
).
values
();
Collection
<
DictionaryDesc
>
secrecyLevels
=
SystemCache
.
getDictionary
(
securityGradeDictionaryCode
).
values
();
DictionaryDesc
attachmentSecurityGrade
=
secrecyLevels
DictionaryDesc
attachmentSecurityGrade
=
secrecyLevels
.
stream
()
.
stream
()
.
filter
(
e
->
Objects
.
equals
(
e
.
getName
(),
attachmentSecurityGradeName
))
.
filter
(
e
->
Objects
.
equals
(
e
.
getName
(),
attachmentSecurityGradeName
))
...
...
huigou-xt/src/main/resources/config/spring/spring-extend.xml
View file @
7f38ae14
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
<!-- 普通任务邮件 -->
<!-- 普通任务邮件 -->
<bean
id=
"simpleEmailSender"
class=
"com.huigou.uasp.tool.mail.impl.EmailSenderImpl"
>
<bean
id=
"simpleEmailSender"
class=
"com.huigou.uasp.tool.mail.impl.EmailSenderImpl"
>
<property
name=
"mailSender"
ref=
"mailSender"
/>
<property
name=
"mailSender"
ref=
"mailSender"
/>
<property
name=
"fromEmail"
value=
"${email.username}"
/>
<property
name=
"fromEmail"
value=
"${email.username}"
/>
<property
name=
"emailTemplate"
value=
"taskNotice"
/>
<property
name=
"emailTemplate"
value=
"taskNotice"
/>
</bean>
</bean>
...
@@ -73,5 +73,7 @@
...
@@ -73,5 +73,7 @@
<bean
id=
"awesomeCssIconParser"
class=
"com.huigou.uasp.bmp.opm.application.impl.FontAwesomeCssIconParser"
/>
<bean
id=
"awesomeCssIconParser"
class=
"com.huigou.uasp.bmp.opm.application.impl.FontAwesomeCssIconParser"
/>
<bean
id=
"attachmentSecretInfoResolver"
<bean
id=
"attachmentSecretInfoResolver"
class=
"com.huigou.uasp.bmp.doc.attachment.application.impl.TestAttachmentSecretInfoResolver"
/>
class=
"com.huigou.uasp.bmp.doc.attachment.application.impl.TestAttachmentSecretInfoResolver"
>
<property
name=
"securityGradeDictionaryCode"
value=
"secrecyLevel"
/>
</bean>
</beans>
</beans>
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