|
@@ -143,6 +143,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
private final NewIOSSClient newIOSSClient;
|
|
|
|
|
|
private final IArchiveExpertConclusionService expertConclusionService;
|
|
|
+ private final ITraceLogService iTraceLogService;
|
|
|
+
|
|
|
//表格高度
|
|
|
private static int high = 20;
|
|
|
//表格宽度
|
|
@@ -700,7 +702,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void archiveAutoMethod(Long projectId, Long contractId, Long nodeId) {
|
|
|
+ public void archiveAutoMethod(Long projectId, Long contractId, Long nodeId, Long traceId) {
|
|
|
//步骤一:把档号集合初始化
|
|
|
indexMap = new HashMap<>();
|
|
|
//步list = {ArrayList@18238} size = 19骤二:查询归档树节点。存在未归档文件的节点。
|
|
@@ -746,19 +748,19 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
Map<String,List<ArchiveFile>> boxMap = new LinkedHashMap<>();
|
|
|
Map<Long,String> boxFileMap = new LinkedHashMap<>();
|
|
|
|
|
|
- archiveAutoMethod3(list3,boxMap,boxFileMap);//单独组卷
|
|
|
+ archiveAutoMethod3(list3,boxMap,boxFileMap,traceId);//单独组卷
|
|
|
//设置完成度30%
|
|
|
projectClient.updateIsArchivesAutoById(projectId,30);
|
|
|
- archiveAutoMethod2(list2,projectId,boxMap,boxFileMap);//分类组卷
|
|
|
+ archiveAutoMethod2(list2,projectId,boxMap,boxFileMap,traceId);//分类组卷
|
|
|
//设置完成度50%
|
|
|
projectClient.updateIsArchivesAutoById(projectId,50);
|
|
|
- archiveAutoMethod1(list1,boxMap,boxFileMap);//默认组卷
|
|
|
+ archiveAutoMethod1(list1,boxMap,boxFileMap,traceId);//默认组卷
|
|
|
|
|
|
//分盒组卷的且节点没配置组卷类型的
|
|
|
archiveAutoMethod0(list0,boxMap,boxFileMap);//默认组卷
|
|
|
//设置完成度70%
|
|
|
projectClient.updateIsArchivesAutoById(projectId,70);
|
|
|
- archiveAutoMethodBox(boxMap);//分盒组卷
|
|
|
+ archiveAutoMethodBox(boxMap,traceId);//分盒组卷
|
|
|
}
|
|
|
|
|
|
private void addBoxMap(ArchiveFile file,Map<String,List<ArchiveFile>> boxMap,Map<Long,String> boxFileMap){
|
|
@@ -1476,17 +1478,25 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* @param list
|
|
|
* @param boxMap
|
|
|
*/
|
|
|
- private void archiveAutoMethod3(List<ArchiveTreeContract> list,Map<String,List<ArchiveFile>> boxMap,Map<Long,String> boxFileMap){
|
|
|
+ private void archiveAutoMethod3(List<ArchiveTreeContract> list,Map<String,List<ArchiveFile>> boxMap,Map<Long,String> boxFileMap, Long traceId){
|
|
|
//步骤1:遍历节点集合
|
|
|
for(ArchiveTreeContract node:list){
|
|
|
//步骤2:查询节点下的未组卷文件
|
|
|
List<ArchiveFile> archiveFiles = archiveFileClient.getListByNodeID(node.getId().toString());
|
|
|
+
|
|
|
//步骤3:遍历未归档文件
|
|
|
//待组卷文件集合
|
|
|
List<ArchiveFile> waitArchiveFiles = new ArrayList<>();
|
|
|
//待组卷文件总页数
|
|
|
int archivesSize=0;
|
|
|
if(archiveFiles!=null){
|
|
|
+
|
|
|
+ if (archiveFiles.size() > 0) {
|
|
|
+ String completeMsg = "[自动组卷] 单独组卷:"+"-traceId:"+traceId + "节点:" + node.getNodeName() + " 文件数量:" + archiveFiles.size();
|
|
|
+ iTraceLogService.saveLog(traceId, completeMsg);
|
|
|
+ //log.info("[自动组卷]{}","单独组卷:"+"-traceId:"+traceId + "节点:" + node.getNodeName() + " 文件数量:" + archiveFiles.size());
|
|
|
+ }
|
|
|
+
|
|
|
for(ArchiveFile file:archiveFiles){
|
|
|
//步骤4:断文件是否存在分盒设置
|
|
|
if(file.getBoxNumber()!=null && file.getBoxNumber()!=-1){
|
|
@@ -1514,7 +1524,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* 分类并卷组卷 设置分类的节点下只有一个案卷,节点下的所有文件都组成这个案卷。如果设置分类节点(select=1的)多个,案卷归属排序第一个节点。
|
|
|
*/
|
|
|
private void archiveAutoMethod2(List<ArchiveTreeContract> list,Long projectId,
|
|
|
- Map<String,List<ArchiveFile>> boxMap,Map<Long,String> boxFileMap){
|
|
|
+ Map<String,List<ArchiveFile>> boxMap,Map<Long,String> boxFileMap, Long traceId){
|
|
|
|
|
|
//分类并卷集合<groupId,List<文件>>
|
|
|
Map<Long,List<ArchiveFile>> archiveMap = new HashMap<>();
|
|
@@ -1530,6 +1540,11 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
//步骤3:遍历未归档文件
|
|
|
if(archiveFiles!=null){
|
|
|
for(ArchiveFile file:archiveFiles){
|
|
|
+
|
|
|
+ if (archiveFiles.size() > 0) {
|
|
|
+ String completeMsg = "[自动组卷] 分类组卷:"+"-traceId:"+traceId + "节点:" + node.getNodeName() + " 文件数量:" + archiveFiles.size();
|
|
|
+ iTraceLogService.saveLog(traceId, completeMsg);
|
|
|
+ }
|
|
|
//步骤4:判断文件是否存在分盒设置
|
|
|
if(file.getBoxNumber()!=null && file.getBoxNumber()!=-1){
|
|
|
//添加到分盒文件集合
|
|
@@ -1566,7 +1581,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* 默认组卷流程 文件可以跨节点组卷,受最高并卷节点限制范围,跨节点文件组卷时,案卷规格按照第一个文件所在的节点规格 组卷。
|
|
|
*/
|
|
|
private void archiveAutoMethod1(List<ArchiveTreeContract> list,Map<String,List<ArchiveFile>> boxMap,
|
|
|
- Map<Long,String> boxFileMap){
|
|
|
+ Map<Long,String> boxFileMap, Long traceId){
|
|
|
//最高并卷节点
|
|
|
Long archiveAutoNodeId=null;
|
|
|
|
|
@@ -1616,6 +1631,11 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
//步骤3.3:遍历未组卷文件
|
|
|
int archiveFilesSize=0;
|
|
|
for(ArchiveFile file:archiveFiles){
|
|
|
+
|
|
|
+ if (archiveFiles.size() > 0) {
|
|
|
+ String completeMsg = "[自动组卷] 最高组卷:"+"-traceId:"+traceId + "节点:" + node.getNodeName() + " 文件数量:" + archiveFiles.size();
|
|
|
+ iTraceLogService.saveLog(traceId, completeMsg);
|
|
|
+ }
|
|
|
archiveFilesSize++;
|
|
|
//步骤3.4:判断文件是否存在分盒设置
|
|
|
if(file.getBoxNumber()!=null && file.getBoxNumber()!=-1) {
|
|
@@ -1729,10 +1749,12 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* 分盒组卷流程
|
|
|
* @param boxMap
|
|
|
*/
|
|
|
- private void archiveAutoMethodBox(Map<String,List<ArchiveFile>> boxMap){
|
|
|
+ private void archiveAutoMethodBox(Map<String,List<ArchiveFile>> boxMap, Long traceId){
|
|
|
Set<Map.Entry<String, List<ArchiveFile>>> entries = boxMap.entrySet();
|
|
|
for (Map.Entry<String, List<ArchiveFile>> entry:entries){
|
|
|
//一个分盒一个案卷 归属第一个文件所在节点
|
|
|
+ String completeMsg = "[自动组卷] 分盒组卷:"+"-traceId:"+traceId + "box:" + entry.getKey() + " 文件数量:" + entry.getValue().size();
|
|
|
+ iTraceLogService.saveLog(traceId, completeMsg);
|
|
|
createArchiveBox(entry.getKey(),entry.getValue());
|
|
|
}
|
|
|
}
|
|
@@ -1742,7 +1764,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<ArchivesAuto> findArchivesAutosByIds(List<Long> ids) {
|
|
|
+ public List<ArchivesAuto> findArchivesAutosByIds(List<Long> ids,Long traceId) {
|
|
|
QueryWrapper<ArchivesAuto> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.in("node_id", ids)
|
|
|
.eq("is_deleted",0)
|
|
@@ -1768,11 +1790,11 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* @param contractId
|
|
|
* @param nodeId
|
|
|
*/
|
|
|
- public void refreshFileNumberNoSlipt(Long projectId,Long contractId,Long nodeId,boolean bforce) {
|
|
|
+ public void refreshFileNumberNoSlipt(Long projectId,Long contractId,Long nodeId,boolean bforce, Long traceId) {
|
|
|
List<ArchiveTreeContract> list = archiveTreeContractClient.getListByProjectId(projectId);
|
|
|
if (nodeId!= null) {
|
|
|
ArchiveTreeContract node = archiveTreeContractClient.getArchiveTreeContractById(nodeId);
|
|
|
- if (node!= null && node.getContractId() != null) {
|
|
|
+ if (node!= null && node.getContractId() != null && node.getContractId() != -1) {
|
|
|
contractId = node.getContractId();
|
|
|
}
|
|
|
}
|
|
@@ -1780,7 +1802,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
Integer indexType = 0;
|
|
|
ArchiveProjectConfig config = archiveProjectConfigService.getByProjectIdOrNew(projectId);
|
|
|
|
|
|
- this.refreshFileNumberNoSlipt(list,contractId,nodeId,bforce,config.getIndexType(),config.getDirType(),config.getIndexNum());
|
|
|
+ this.refreshFileNumberNoSlipt(list,contractId,nodeId,bforce,config.getIndexType(),config.getDirType(),config.getIndexNum(),traceId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1790,7 +1812,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* @param nodeId
|
|
|
*/
|
|
|
public void refreshFileNumberNoSlipt(List<ArchiveTreeContract> archiveTreeContracts,Long contractId,Long nodeId,
|
|
|
- boolean bforce,Integer indexType, Integer dirType,Integer indexNum) {
|
|
|
+ boolean bforce,Integer indexType, Integer dirType,Integer indexNum,Long traceId) {
|
|
|
|
|
|
List<ArchiveTreeContractVO2> subTreeList = new ArrayList<>();
|
|
|
List<List<ArchiveTreeContract>> subGroupedList = new ArrayList<>();
|
|
@@ -1819,7 +1841,13 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
if(ids.size()==0){
|
|
|
continue;
|
|
|
}
|
|
|
- List<ArchivesAuto> archivesAutos = findArchivesAutosByIds(ids);
|
|
|
+
|
|
|
+ for(ArchiveTreeContract node:subList){
|
|
|
+ String fileMessage = "[自动组卷] 刷新档号:节点名0 "+ subList.get(0).getNodeName()+ "-节点列表:"+node.getNodeName()+ "-traceId:"+traceId;
|
|
|
+ log.info(fileMessage);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ArchivesAuto> archivesAutos = findArchivesAutosByIds(ids,traceId);
|
|
|
if (archivesAutos == null || archivesAutos.size() == 0) {
|
|
|
continue;
|
|
|
}
|
|
@@ -1829,6 +1857,13 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
node_fileNumberPrefixMap.put(node.getId().toString(),node.getFileNumberPrefix());
|
|
|
}
|
|
|
|
|
|
+ if (archivesAutos.size() > 0) {
|
|
|
+ String startLogMessage = "[自动组卷] 刷新档号:节点名0 "+ subList.get(0).getNodeName()+"-案卷0 :"+archivesAutos.get(0).getName()
|
|
|
+ +"-案卷数量:"+archivesAutos.size()+"-traceId:"+traceId;
|
|
|
+ iTraceLogService.saveLog(traceId, startLogMessage);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
for (ArchivesAuto archivesAuto: archivesAutos) {
|
|
|
String nodeId1 = archivesAuto.getNodeId().toString();
|
|
|
String fileNumberPrefix ="";
|
|
@@ -1868,6 +1903,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ String fileMessage = "[自动组卷] 刷新档号:"+archivesAuto.getName()+"-fileNumber:"+fileNumber+"-index:"+index+"-traceId:"+traceId;
|
|
|
+ log.info(fileMessage);
|
|
|
index++;
|
|
|
}
|
|
|
}
|
|
@@ -2328,74 +2365,99 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
return autoMapper.getCarrierTypeByDict();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void archiveAutoMethodThread(Long projectId, Long contractId, Long nodeId, Long traceId) {
|
|
|
- executorService.execute(()->{
|
|
|
- try{
|
|
|
- //将项目未锁定案卷拆卷
|
|
|
- log.info("[自动组卷]{}","开始对未锁定案卷拆卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
|
|
|
+ executorService.execute(() -> {
|
|
|
+ try {
|
|
|
+ // 将项目未锁定案卷拆卷
|
|
|
+ String startSplitMsg = "[自动组卷] 开始对未锁定案卷拆卷。projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
|
|
|
+ //log.info(startSplitMsg);
|
|
|
+ iTraceLogService.saveLog(traceId, startSplitMsg);
|
|
|
|
|
|
- //todo 有项目上传几百G文件,点组卷会产生大量费用,等改完文件下载走内网再打开此开关。
|
|
|
-// if (true) {
|
|
|
-// return;
|
|
|
-// }
|
|
|
+ // TODO: 有项目上传几百G文件,点组卷会产生大量费用,等改完文件下载走内网再打开此开关。
|
|
|
+ // if (true) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
|
|
|
- splitArchvies(projectId,contractId,nodeId);
|
|
|
- //设置完成度10%
|
|
|
- contractClient.updateIsArchivesAutoById(contractId,10);
|
|
|
+ splitArchvies(projectId, contractId, nodeId);
|
|
|
+ // 设置完成度10%
|
|
|
+ contractClient.updateIsArchivesAutoById(contractId, 10);
|
|
|
|
|
|
- //项目自动组卷入口
|
|
|
- log.info("[自动组卷]{}","开始自动组卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
|
|
|
- archiveAutoMethod(projectId,contractId,nodeId);
|
|
|
- //设置完成度80%
|
|
|
- contractClient.updateIsArchivesAutoById(contractId,80);
|
|
|
+ // 项目自动组卷入口
|
|
|
+ String startAutoArchiveMsg = "[自动组卷] 开始自动组卷。projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
|
|
|
+ //log.info(startAutoArchiveMsg);
|
|
|
+ iTraceLogService.saveLog(traceId, startAutoArchiveMsg);
|
|
|
|
|
|
- //刷新项目档号
|
|
|
- log.info("[自动组卷]{}","开始刷新组卷档号。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
|
|
|
- refreshFileNumberNoSlipt(projectId,contractId,nodeId,true);
|
|
|
+ archiveAutoMethod(projectId, contractId, nodeId, traceId);
|
|
|
+ // 设置完成度80%
|
|
|
+ contractClient.updateIsArchivesAutoById(contractId, 80);
|
|
|
|
|
|
+ // 刷新项目档号
|
|
|
+ String startRefreshMsg = "[自动组卷] 开始刷新组卷档号。projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
|
|
|
+ //log.info(startRefreshMsg);
|
|
|
+ iTraceLogService.saveLog(traceId, startRefreshMsg);
|
|
|
|
|
|
- //设置自动组卷结束
|
|
|
- contractClient.updateIsArchivesAutoById(contractId,0);
|
|
|
- log.info("[自动组卷]{}","自动组卷完成。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
|
|
|
- }catch (Exception e){
|
|
|
+ refreshFileNumberNoSlipt(projectId, contractId, nodeId, true,traceId);
|
|
|
+
|
|
|
+ // 设置自动组卷结束
|
|
|
+ contractClient.updateIsArchivesAutoById(contractId, 0);
|
|
|
+ String completeMsg = "[自动组卷] 自动组卷完成。projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
|
|
|
+ //log.info(completeMsg);
|
|
|
+ iTraceLogService.saveLog(traceId, completeMsg);
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- log.error("[自动组卷] 报错。"+e.getMessage()+"--projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
|
|
|
- //设置自动组卷结束
|
|
|
+ String errorMsg = "[自动组卷] 报错。" + e.getMessage() + "--projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
|
|
|
+ //log.error(errorMsg);
|
|
|
+ iTraceLogService.saveLog(traceId, errorMsg);
|
|
|
+
|
|
|
+ // 设置自动组卷结束
|
|
|
contractClient.updateIsArchivesAutoById(contractId, 0);
|
|
|
- }finally {
|
|
|
+
|
|
|
+ } finally {
|
|
|
contractClient.updateIsArchivesAutoById(contractId, 0);
|
|
|
- log.error("[自动组卷] 流程结束--projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
|
|
|
+ String endMsg = "[自动组卷] 流程结束--projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
|
|
|
+ //log.error(endMsg);
|
|
|
+ iTraceLogService.saveLog(traceId, endMsg);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public void refreshFileNumberThread(Long projectId, Long contractId, Long nodeId) {
|
|
|
+ public void refreshFileNumberThread(Long projectId, Long contractId, Long nodeId, Long traceId) {
|
|
|
executorService.execute(()->{
|
|
|
- try{
|
|
|
- //将项目未锁定案卷拆卷
|
|
|
- log.info("[自动组卷]{}","开始对未锁定案卷拆卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
|
|
|
+ try {
|
|
|
+ // 将项目未锁定案卷拆卷
|
|
|
+ String startLogMessage = "[刷新档号] 开始对未锁定案卷拆卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId;
|
|
|
+ iTraceLogService.saveLog(traceId, startLogMessage);
|
|
|
|
|
|
- //设置完成度10%
|
|
|
+ // 设置完成度10%
|
|
|
contractClient.updateIsArchivesAutoById(contractId,10);
|
|
|
|
|
|
- //项目自动组卷入口
|
|
|
- this.refreshFileNumberNoSlipt(projectId,contractId,null,false);
|
|
|
+ // 项目自动组卷入口
|
|
|
+ this.refreshFileNumberNoSlipt(projectId, contractId, null, false,traceId);
|
|
|
|
|
|
- //设置自动组卷结束
|
|
|
+ // 设置自动组卷结束
|
|
|
contractClient.updateIsArchivesAutoById(contractId,0);
|
|
|
- log.info("[自动组卷]{}","自动组卷完成。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
|
|
|
- }catch (Exception e){
|
|
|
+
|
|
|
+ String endLogMessage = "[刷新档号] 自动组卷完成。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId;
|
|
|
+ iTraceLogService.saveLog(traceId, endLogMessage);
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- log.error("自动组卷报错。"+e.getMessage()+"--projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
|
|
|
- //设置自动组卷结束
|
|
|
+ String errorLogMessage = "刷新档号报错。" + e.getMessage() + "--projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId;
|
|
|
+ iTraceLogService.saveLog(traceId, errorLogMessage);
|
|
|
+
|
|
|
+ // 设置自动组卷结束
|
|
|
contractClient.updateIsArchivesAutoById(contractId, 0);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public List<User> getArchiveDestroyUser(Long projectId) {
|
|
|
return autoMapper.getArchiveDestroyUser(projectId);
|
|
@@ -2873,7 +2935,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
total += (int)Math.ceil(new Double(vo2.getName().length()+4) / 50);
|
|
|
//如果出现不相同,则合并之前的
|
|
|
document.add(dataTable);
|
|
|
- if (total >= 35 && i != (vo2s.size()-1)) {
|
|
|
+ if (total >= 40 && i != (vo2s.size()-1)) {
|
|
|
total = 0;
|
|
|
document.newPage();
|
|
|
tableHeader(projectName,document,size10font,size17font,floats);
|
|
@@ -3033,11 +3095,12 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void updateInspectStatus(Long archiveId,Long projectId) {
|
|
|
+ public void updateInspectStatus(Long archiveId,Long projectId,Long conclusionId) {
|
|
|
//查看当前档案是否存在有意见的数据,存在则什么都不修改,不存在则修改已抽检,合格
|
|
|
long count2 = inspectionService.count(new LambdaQueryWrapper<ExpertInspection>()
|
|
|
.eq(ExpertInspection::getIsPass, 0)
|
|
|
- .eq(ExpertInspection::getArchiveId, archiveId));
|
|
|
+ .eq(ExpertInspection::getArchiveId, archiveId)
|
|
|
+ .eq(ExpertInspection::getConclusionId,conclusionId));
|
|
|
//修改档案抽检状态
|
|
|
if (count2 == 0) {
|
|
|
this.update(new LambdaUpdateWrapper<ArchivesAuto>()
|
|
@@ -3049,7 +3112,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
Long userId = AuthUtil.getUserId();
|
|
|
long count = inspectionService.count(new LambdaQueryWrapper<ExpertInspection>()
|
|
|
.eq(ExpertInspection::getExpertId, userId)
|
|
|
- .eq(ExpertInspection::getArchiveId, archiveId));
|
|
|
+ .eq(ExpertInspection::getArchiveId, archiveId)
|
|
|
+ .eq(ExpertInspection::getConclusionId,conclusionId));
|
|
|
if (count == 0){
|
|
|
String userName = AuthUtil.getNickName();
|
|
|
//获取档案信息,如果状态未未查阅则修改
|
|
@@ -3070,6 +3134,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
inspection.setUnitType(unitType);
|
|
|
inspection.setArchiveId(archiveId);
|
|
|
inspection.setArchiveName(archive.getName());
|
|
|
+ inspection.setConclusionId(conclusionId);
|
|
|
inspectionService.save(inspection);
|
|
|
}
|
|
|
|
|
@@ -3117,18 +3182,21 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
ExpertInspection one = inspectionService.getOne(new LambdaQueryWrapper<ExpertInspection>()
|
|
|
.eq(ExpertInspection::getExpertId, userId)
|
|
|
.eq(ExpertInspection::getArchiveId, archive.getId())
|
|
|
- .eq(ExpertInspection::getIsPass, 1));
|
|
|
+ .eq(ExpertInspection::getIsPass, 1)
|
|
|
+ .eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
|
|
|
if (one == null) {
|
|
|
//先删除当前专家对当前案卷当前文件的意见
|
|
|
inspectionService.remove(new LambdaQueryWrapper<ExpertInspection>()
|
|
|
.eq(ExpertInspection::getExpertId, userId)
|
|
|
.eq(ExpertInspection::getArchiveId, inspection.getArchiveId())
|
|
|
- .eq(ExpertInspection::getFileId, inspection.getFileId()));
|
|
|
+ .eq(ExpertInspection::getFileId, inspection.getFileId())
|
|
|
+ .eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
|
|
|
//判断当前档案是否存在其他意见,有则直接跳过
|
|
|
long count3 = inspectionService.count(new LambdaQueryWrapper<ExpertInspection>()
|
|
|
.eq(ExpertInspection::getExpertId, userId)
|
|
|
.eq(ExpertInspection::getArchiveId, archive.getId())
|
|
|
- .eq(ExpertInspection::getIsPass, 0));
|
|
|
+ .eq(ExpertInspection::getIsPass, 0)
|
|
|
+ .eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
|
|
|
if (count3 == 0) {
|
|
|
//没有就直接保存合格
|
|
|
inspection.setFileId(null);
|
|
@@ -3141,12 +3209,14 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
inspectionService.remove(new LambdaQueryWrapper<ExpertInspection>()
|
|
|
.eq(ExpertInspection::getExpertId, userId)
|
|
|
.eq(ExpertInspection::getArchiveId, inspection.getArchiveId())
|
|
|
- .eq(ExpertInspection::getIsPass, 1));
|
|
|
+ .eq(ExpertInspection::getIsPass, 1)
|
|
|
+ .eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
|
|
|
//再去查看意见表是否存在对当前档案当前文件的意见
|
|
|
ExpertInspection one = inspectionService.getOne(new LambdaQueryWrapper<ExpertInspection>()
|
|
|
.eq(ExpertInspection::getExpertId, userId)
|
|
|
.eq(ExpertInspection::getArchiveId, inspection.getArchiveId())
|
|
|
- .eq(ExpertInspection::getFileId, inspection.getFileId()));
|
|
|
+ .eq(ExpertInspection::getFileId, inspection.getFileId())
|
|
|
+ .eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
|
|
|
//如果不存在数据,然后保存
|
|
|
if (one == null) {
|
|
|
inspectionService.save(inspection);
|
|
@@ -3160,7 +3230,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
//查询当前档案的所有不合格专家意见
|
|
|
long count = inspectionService.count(new LambdaQueryWrapper<ExpertInspection>()
|
|
|
.eq(ExpertInspection::getArchiveId, archive.getId())
|
|
|
- .eq(ExpertInspection::getIsPass, 0));
|
|
|
+ .eq(ExpertInspection::getIsPass, 0)
|
|
|
+ .eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
|
|
|
if (count > 0){
|
|
|
//如果有则修改档案不合格
|
|
|
archive.setUpdateStatus(1);
|
|
@@ -3175,17 +3246,17 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* 在线验收-抽检记录
|
|
|
*/
|
|
|
@Override
|
|
|
- public IPage<ExpertInspectionVO> getUserInspectInfo(Query query, Long projectId) {
|
|
|
+ public IPage<ExpertInspectionVO> getUserInspectInfo(Query query, Long projectId, Long conclusionId) {
|
|
|
Long userId = AuthUtil.getUserId();
|
|
|
IPage<ExpertInspectionVO> page = new Page<>(query.getCurrent(),query.getSize());
|
|
|
- return baseMapper.getUserInspectInfo(page,projectId,userId);
|
|
|
+ return baseMapper.getUserInspectInfo(page,projectId,userId,conclusionId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 在线验收-抽检记录-汇总
|
|
|
*/
|
|
|
@Override
|
|
|
- public IPage<ExpertInspectionVO> getUserInspectInfo2(Query query, Long projectId) {
|
|
|
+ public IPage<ExpertInspectionVO> getUserInspectInfo2(Query query, Long projectId,Long conclusionId) {
|
|
|
Long userId = AuthUtil.getUserId();
|
|
|
//判断当前用户职位是否为专家组长,专家组长查看所有
|
|
|
String userRole = AuthUtil.getUserRole();
|
|
@@ -3193,7 +3264,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
userId = null;
|
|
|
}
|
|
|
IPage<ExpertInspectionVO> page = new Page<>(query.getCurrent(),query.getSize());
|
|
|
- return baseMapper.getUserInspectInfo(page,projectId,userId);
|
|
|
+ return baseMapper.getUserInspectInfo(page,projectId,userId,conclusionId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3298,12 +3369,12 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* 在线验收-获取档案文件抽检意见
|
|
|
*/
|
|
|
@Override
|
|
|
- public ExpertInspectionVO getArchiveFileOpinion(Long fileId, Long projectId) {
|
|
|
+ public ExpertInspectionVO getArchiveFileOpinion(Long fileId, Long projectId,Long conclusionId) {
|
|
|
Long userId = AuthUtil.getUserId();
|
|
|
String userName = AuthUtil.getNickName();
|
|
|
ExpertInspectionVO vo = new ExpertInspectionVO();
|
|
|
//获取意见表里当前文件相关意见
|
|
|
- List<ExpertInspection> list = inspectionService.getListByFileId(fileId,projectId);
|
|
|
+ List<ExpertInspection> list = inspectionService.getListByFileId(fileId,projectId,conclusionId);
|
|
|
if (list != null && list.size() > 0){
|
|
|
StringBuilder str = new StringBuilder();
|
|
|
for (ExpertInspection inspection : list) {
|