|
|
@@ -11,9 +11,7 @@ import com.yingpaipay.business.domain.DocumentAuditLog;
|
|
|
import com.yingpaipay.business.domain.Folder;
|
|
|
import com.yingpaipay.business.domain.Project;
|
|
|
import com.yingpaipay.business.domain.bo.*;
|
|
|
-import com.yingpaipay.business.domain.vo.DocumentAuditLogVo;
|
|
|
-import com.yingpaipay.business.domain.vo.TaskCenterAuditListVo;
|
|
|
-import com.yingpaipay.business.domain.vo.TaskCenterSubmissionListVo;
|
|
|
+import com.yingpaipay.business.domain.vo.*;
|
|
|
import com.yingpaipay.business.mapper.DocumentAuditLogMapper;
|
|
|
import com.yingpaipay.common.file.util.WatermarkUtils;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
@@ -43,7 +41,6 @@ import org.dromara.system.service.ISysOssService;
|
|
|
import org.dromara.system.service.ISysUserService;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import com.yingpaipay.business.domain.vo.DocumentVo;
|
|
|
import com.yingpaipay.business.domain.Document;
|
|
|
import com.yingpaipay.business.mapper.DocumentMapper;
|
|
|
import com.yingpaipay.business.service.IDocumentService;
|
|
|
@@ -305,9 +302,12 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
|
|
|
@Override
|
|
|
public boolean filing(DocumentFilingBo bo) {
|
|
|
+ int type = folderService.getSpecificationType(bo.getFolderId(), bo.getProjectId());
|
|
|
return baseMapper.update(
|
|
|
Wrappers.lambdaUpdate(Document.class)
|
|
|
.eq(Document::getId, bo.getDocumentId())
|
|
|
+ .set(Document::getFolderId, bo.getFolderId())
|
|
|
+ .set(Document::getSpecificationType, type)
|
|
|
.set(Document::getStatus, DocumentStatusConst.FILING)
|
|
|
) > 0;
|
|
|
}
|
|
|
@@ -332,6 +332,8 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
vo.setDeadline(e.getSubmitDeadline());
|
|
|
vo.setSubmitTime(e.getSubmitTime());
|
|
|
vo.setCreateTime(e.getCreateTime());
|
|
|
+ vo.setSendFlag(e.getSendFlag());
|
|
|
+ vo.setSendStatus(e.getSendStatus());
|
|
|
return vo;
|
|
|
}));
|
|
|
}
|
|
|
@@ -427,6 +429,63 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
return TableDataInfo.build(page);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean send(DocumentSendBo bo) {
|
|
|
+ return baseMapper.update(
|
|
|
+ Wrappers.lambdaUpdate(Document.class)
|
|
|
+ .eq(Document::getId, bo.getId())
|
|
|
+ .set(Document::getSendStatus, true)
|
|
|
+ ) > 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public TableDataInfo<TaskCenterFilingListVo> listOnFiling(TaskCenterFilingListBo bo, PageQuery pageQuery) {
|
|
|
+ List<Long> projectIds = projectService.queryIdsOnFiling(bo.getProjectCode(), bo.getProjectName());
|
|
|
+ if (projectIds.isEmpty()) {
|
|
|
+ return TableDataInfo.build();
|
|
|
+ }
|
|
|
+ List<Long> folderIds = folderService.selectIdsOnFiling(bo.getCenterName(), projectIds);
|
|
|
+ LambdaQueryWrapper<Document> wrapper = buildFilingListWrapper(bo, folderIds);
|
|
|
+ IPage<Document> page = baseMapper.selectPage(pageQuery.build(), wrapper);
|
|
|
+ List<Long> ossIds = new ArrayList<>();
|
|
|
+ Map<Long, String> ossMap = new HashMap<>();
|
|
|
+ List<Long> folderIdsInDocument = new ArrayList<>();
|
|
|
+ Map<Long, String> folderMap = new HashMap<>();
|
|
|
+ page.getRecords().forEach(e -> {
|
|
|
+ ossIds.add(e.getOssId());
|
|
|
+ folderIdsInDocument.add(e.getFolderId());
|
|
|
+ });
|
|
|
+ folderService.listByIds(folderIdsInDocument).forEach(e -> folderMap.put(e.getId(), e.getName()));
|
|
|
+ ossService.queryListByIds(ossIds).forEach(e -> ossMap.put(e.getOssId(), e.getUrl()));
|
|
|
+ return TableDataInfo.build(page.convert(e -> {
|
|
|
+ TaskCenterFilingListVo vo = new TaskCenterFilingListVo();
|
|
|
+ vo.setId(e.getId());
|
|
|
+ vo.setName(e.getName());
|
|
|
+ vo.setStatus(e.getStatus());
|
|
|
+ vo.setDeadline(e.getSubmitDeadline());
|
|
|
+ vo.setSubmitterId(e.getSubmitterId());
|
|
|
+ vo.setSubmitTime(e.getSubmitTime());
|
|
|
+ vo.setCreateTime(e.getCreateTime());
|
|
|
+ vo.setOssId(e.getOssId());
|
|
|
+ vo.setOssUrl(ossMap.get(e.getOssId()));
|
|
|
+ vo.setType(e.getType());
|
|
|
+ vo.setDocumentType(e.getPlanType());
|
|
|
+ vo.setProjectId(e.getProjectId());
|
|
|
+ vo.setFolderId(e.getFolderId());
|
|
|
+ vo.setFolderName(folderMap.get(e.getFolderId()));
|
|
|
+ return vo;
|
|
|
+ }));
|
|
|
+ }
|
|
|
+
|
|
|
+ private LambdaQueryWrapper<Document> buildFilingListWrapper(TaskCenterFilingListBo bo, List<Long> folderIds) {
|
|
|
+ return Wrappers.lambdaQuery(Document.class)
|
|
|
+ .like(StringUtils.isNotBlank(bo.getName()), Document::getName, bo.getName())
|
|
|
+ .eq(Document::getCreateBy, LoginHelper.getUserId())
|
|
|
+ .in(!folderIds.isEmpty(), Document::getFolderId, folderIds)
|
|
|
+ .in(Document::getStatus, List.of(DocumentStatusConst.UN_FILING, DocumentStatusConst.FILING))
|
|
|
+ .orderByDesc(Document::getId);
|
|
|
+ }
|
|
|
+
|
|
|
private LambdaQueryWrapper<Document> buildOnSearchWrapper(DocumentSearchBo bo, List<Long> projectIds) {
|
|
|
return Wrappers.lambdaQuery(Document.class)
|
|
|
.in(StringUtils.isNotBlank(bo.getProjectName()) || StringUtils.isNotBlank(bo.getProjectCode()), Document::getProjectId, projectIds.isEmpty() ? List.of(-1L) : projectIds)
|