|
|
@@ -18,8 +18,10 @@ import com.yingpaipay.business.enumeration.DocumentStatusEnum;
|
|
|
import com.yingpaipay.business.enumeration.MailTemplateEnum;
|
|
|
import com.yingpaipay.business.mapper.DocumentAuditLogMapper;
|
|
|
import com.yingpaipay.business.mapper.DocumentMapper;
|
|
|
-import com.yingpaipay.business.service.IDocumentService;
|
|
|
-import com.yingpaipay.business.service.IFolderKeywordService;
|
|
|
+import com.yingpaipay.business.service.*;
|
|
|
+import com.yingpaipay.business.service.AiAuditService;
|
|
|
+import com.yingpaipay.business.service.common.CommonFolderService;
|
|
|
+import com.yingpaipay.business.service.common.CommonProjectService;
|
|
|
import com.yingpaipay.common.file.util.PdfUtils;
|
|
|
import com.yingpaipay.common.mabatis.utils.WrapperUtils;
|
|
|
import com.yingpaipay.setting.domain.vo.KeywordSettingVo;
|
|
|
@@ -95,6 +97,7 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
private final IFolderKeywordService folderKeywordService;
|
|
|
private final IKeywordSettingService keywordSettingService;
|
|
|
private final ISysDeptService deptService;
|
|
|
+ private final AiAuditService aiAuditService;
|
|
|
|
|
|
/**
|
|
|
* 水印的锁
|
|
|
@@ -295,6 +298,7 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
) > 0;
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public boolean submit(DocumentSubmitBo bo) {
|
|
|
|
|
|
@@ -319,7 +323,15 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
document.setSubmitTime(new Date());
|
|
|
document.setEffectiveDate(bo.getEffectiveDate());
|
|
|
document.setStatus(DocumentStatusEnum.UN_AUDIT.getValue());
|
|
|
- return baseMapper.updateById(document) > 0;
|
|
|
+
|
|
|
+ boolean updateFlag = baseMapper.updateById(document) == 0;
|
|
|
+ if (updateFlag) {
|
|
|
+ throw new RuntimeException("更新文档失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ aiAuditService.audit(bo.getOssId());
|
|
|
+
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -1063,7 +1075,7 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
for (Document document : documentList) {
|
|
|
ProjectExcel excel = new ProjectExcel();
|
|
|
excel.setId(document.getId());
|
|
|
- excel.setName(document.getName());
|
|
|
+ excel.setName(Arrays.stream(document.getName().split("-")).filter(e -> !e.equals("NA")).collect(Collectors.joining("-")));
|
|
|
excel.setStatus(DocumentStatusEnum.getLabel(document.getStatus()));
|
|
|
excel.setActualDocumentName(
|
|
|
Optional.ofNullable(document.getActualDocument())
|
|
|
@@ -1104,7 +1116,8 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
.map(DateUtils::formatDate)
|
|
|
.orElse("-")
|
|
|
);
|
|
|
- Date submitTime = Optional.ofNullable(document.getSubmitTime()).orElse(new Date());
|
|
|
+ Date submitTime = Optional.ofNullable(document.getSubmitTime())
|
|
|
+ .orElse(new Date());
|
|
|
excel.setDaysOverdue(
|
|
|
Optional.ofNullable(document.getSubmitDeadline())
|
|
|
.map(deadline -> {
|
|
|
@@ -1139,7 +1152,7 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
}
|
|
|
excel.setSubmitTime(
|
|
|
Optional.ofNullable(document.getSubmitTime())
|
|
|
- .map(Date::toString)
|
|
|
+ .map(DateUtils::formatDateTime)
|
|
|
.orElse("-")
|
|
|
);
|
|
|
excel.setSubmitter(
|