Commit 7f38ae14 authored by 雍欢's avatar 雍欢

上传附件的时候,检查附件密级是否与人员密级匹配

parent aa97650f
...@@ -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))
......
...@@ -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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment