|
@@ -62,6 +62,12 @@ public class TaskSplitServiceImpl extends BaseServiceImpl<TaskSplitMapper, TaskS
|
|
|
Map<String,Object> data = new HashMap<>();
|
|
|
String contractId = taskSplit.getContractId();
|
|
|
String splitIds = taskSplit.getIds();
|
|
|
+ int dataType = taskSplit.getDataType();
|
|
|
+
|
|
|
+ if(dataType!=2){
|
|
|
+ taskSplit.setDataType(1);
|
|
|
+ }
|
|
|
+
|
|
|
if (contractId=="" || contractId==null || contractId.length()==0 || Func.isEmpty(contractId)){
|
|
|
return R.fail("合同段Id为空");
|
|
|
}
|
|
@@ -69,7 +75,14 @@ public class TaskSplitServiceImpl extends BaseServiceImpl<TaskSplitMapper, TaskS
|
|
|
if (splitIds=="" || splitIds==null || splitIds.length()==0 || Func.isEmpty(splitIds)){ // 代表整个合同解析
|
|
|
taskSplit.setType(2);
|
|
|
// 查询整个合同段下的所有文件
|
|
|
- Integer spliteTaskCount =baseMapper.getSpliteTaskCount(contractId);
|
|
|
+
|
|
|
+ Integer spliteTaskCount = 0;
|
|
|
+ if(dataType==2){ //
|
|
|
+ spliteTaskCount = baseMapper.getSpliteTaskCountByScan(contractId);
|
|
|
+ }else {
|
|
|
+ spliteTaskCount = baseMapper.getSpliteTaskCount(contractId);
|
|
|
+ }
|
|
|
+
|
|
|
if(spliteTaskCount>=1){
|
|
|
return R.fail("该合同已经添加任务,无需重复操作");
|
|
|
}
|
|
@@ -81,8 +94,11 @@ public class TaskSplitServiceImpl extends BaseServiceImpl<TaskSplitMapper, TaskS
|
|
|
Integer archiveCount = baseMapper.getArchiveCount(contractId);
|
|
|
taskSplit.setToolCount(archiveCount);
|
|
|
taskSplit.setFinished(0);
|
|
|
-
|
|
|
- taskSplit.setTaskName("整个合同段 "+archiveCount+" 条的分解任务");
|
|
|
+ if(dataType==2) { //
|
|
|
+ taskSplit.setTaskName("整个合同段 " + archiveCount + " 条的识别任务");
|
|
|
+ }else {
|
|
|
+ taskSplit.setTaskName("整个合同段 " + archiveCount + " 条的分解任务");
|
|
|
+ }
|
|
|
data.put("fileCount",archiveCount);
|
|
|
data.put("taskTime",i);
|
|
|
// 修改整个合同任务状态为 未分解
|
|
@@ -103,8 +119,13 @@ public class TaskSplitServiceImpl extends BaseServiceImpl<TaskSplitMapper, TaskS
|
|
|
data.put("taskTime",i);
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss");
|
|
|
- String formattedDateTime = now.format(formatter)+"_"+split.size()+"条分解任务";
|
|
|
- taskSplit.setTaskName(formattedDateTime);
|
|
|
+ if(dataType==2) { //
|
|
|
+ String formattedDateTime = now.format(formatter)+"_"+split.size()+"条识别任务";
|
|
|
+ taskSplit.setTaskName(formattedDateTime);
|
|
|
+ }else {
|
|
|
+ String formattedDateTime = now.format(formatter)+"_"+split.size()+"条分解任务";
|
|
|
+ taskSplit.setTaskName(formattedDateTime);
|
|
|
+ }
|
|
|
baseMapper.updateArchiveByIds(split);
|
|
|
}
|
|
|
|