|
@@ -255,6 +255,9 @@ public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, C
|
|
|
.isNotNull(ContractLog::getPdfUrl)
|
|
|
.orderByAsc(ContractLog::getRecordTime)
|
|
|
);
|
|
|
+ if(CollectionUtil.isNotEmpty(contractLogs)){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
//按月分组
|
|
|
Map<String, List<ContractLog>> collect = contractLogs.stream().filter(f -> StringUtil.isNotBlank(f.getRecordTime())).collect(Collectors.groupingBy(log -> {
|
|
@@ -318,26 +321,29 @@ public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, C
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- List<String> collect1 = contractLogMonthPacks.stream().map(ContractLogMonthPack::getRecordTime).collect(Collectors.toList());
|
|
|
- //删除文件
|
|
|
- List<ContractLogMonthPack> list = contractLogMonthPackService.list(Wrappers.<ContractLogMonthPack>lambdaQuery()
|
|
|
- .eq(ContractLogMonthPack::getContractId, logVo.getContractId())
|
|
|
- .eq(ContractLogMonthPack::getWbsNodeId, logVo.getWbsNodeId())
|
|
|
- .in(ContractLogMonthPack::getRecordTime, collect1));
|
|
|
-
|
|
|
- if(CollectionUtil.isNotEmpty(list)){
|
|
|
+ if(CollectionUtil.isNotEmpty(contractLogMonthPacks)){
|
|
|
+ List<String> collect1 = contractLogMonthPacks.stream().map(ContractLogMonthPack::getRecordTime).collect(Collectors.toList());
|
|
|
//删除文件
|
|
|
- list.forEach(f -> {
|
|
|
- if(StringUtil.isNotBlank(f.getPdfUrl())){
|
|
|
- String pdfName = f.getPdfUrl().split("upload")[1];
|
|
|
- this.newIOSSClient.removeFile("upload" + pdfName);
|
|
|
- }
|
|
|
- });
|
|
|
- //删除数据
|
|
|
- contractLogMonthPackService.removeBatchByIds(list);
|
|
|
+ List<ContractLogMonthPack> list = contractLogMonthPackService.list(Wrappers.<ContractLogMonthPack>lambdaQuery()
|
|
|
+ .eq(ContractLogMonthPack::getContractId, logVo.getContractId())
|
|
|
+ .eq(ContractLogMonthPack::getWbsNodeId, logVo.getWbsNodeId())
|
|
|
+ .in(ContractLogMonthPack::getRecordTime, collect1));
|
|
|
+
|
|
|
+ if(CollectionUtil.isNotEmpty(list)){
|
|
|
+ //删除文件
|
|
|
+ list.forEach(f -> {
|
|
|
+ if(StringUtil.isNotBlank(f.getPdfUrl())){
|
|
|
+ String pdfName = f.getPdfUrl().split("upload")[1];
|
|
|
+ this.newIOSSClient.removeFile("upload" + pdfName);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //删除数据
|
|
|
+ contractLogMonthPackService.removeBatchByIds(list);
|
|
|
+ }
|
|
|
+ return contractLogMonthPackService.saveBatch(contractLogMonthPacks);
|
|
|
}
|
|
|
+ return false;
|
|
|
|
|
|
- return contractLogMonthPackService.saveBatch(contractLogMonthPacks);
|
|
|
}
|
|
|
|
|
|
@Override
|