|
@@ -36,6 +36,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
import org.springblade.archive.dto.ArchiveWarningDTO;
|
|
import org.springblade.archive.dto.ArchiveWarningDTO;
|
|
|
|
+import org.springblade.archive.dto.FindAndReplaceDto;
|
|
import org.springblade.archive.dto.JiLinQueryDto;
|
|
import org.springblade.archive.dto.JiLinQueryDto;
|
|
import org.springblade.archive.dto.SaveApplyDTO;
|
|
import org.springblade.archive.dto.SaveApplyDTO;
|
|
import org.springblade.archive.entity.*;
|
|
import org.springblade.archive.entity.*;
|
|
@@ -4130,6 +4131,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
if(StringUtils.isEmpty(archiveIds)){
|
|
if(StringUtils.isEmpty(archiveIds)){
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ archiveAutoPdfService.assignArchiveTableUrl();
|
|
String[] ids = archiveIds.split(",");
|
|
String[] ids = archiveIds.split(",");
|
|
for (String archiveId : ids) {
|
|
for (String archiveId : ids) {
|
|
ArchivesAuto auto = baseMapper.selectById(archiveId);
|
|
ArchivesAuto auto = baseMapper.selectById(archiveId);
|
|
@@ -4140,6 +4142,59 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public boolean findAndReplace(List<ArchivesAuto> archivesAutos, FindAndReplaceDto dto) {
|
|
|
|
+ for (ArchivesAuto archivesAuto : archivesAutos) {
|
|
|
|
+ if(dto.getType()==1){
|
|
|
|
+ if(StringUtils.isNotEmpty(dto.getQuery())&&StringUtils.isNotEmpty(dto.getReplace())){
|
|
|
|
+ String name = archivesAuto.getName();
|
|
|
|
+ if (StringUtils.isNotEmpty(name)&&name.contains(dto.getQuery())) {
|
|
|
|
+ int index = name.indexOf(dto.getQuery());
|
|
|
|
+ if (index != -1) {
|
|
|
|
+ StringBuilder sb = new StringBuilder(name);
|
|
|
|
+ if (dto.getPosition() != null) {
|
|
|
|
+ switch (dto.getPosition()) {
|
|
|
|
+ case 1: // 在查询内容前插入替换内容
|
|
|
|
+ sb.insert(index, dto.getReplace());
|
|
|
|
+ break;
|
|
|
|
+ case 2: // 在查询内容后插入替换内容
|
|
|
|
+ sb.insert(index + dto.getQuery().length(), dto.getReplace());
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ throw new ServiceException("请选择正确的定位条件");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ archivesAuto.setName(sb.toString()); // 更新名称
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ throw new ServiceException("没有找到原内容");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else if (dto.getType()==2) {
|
|
|
|
+ if(StringUtils.isNotEmpty(dto.getQuery())&&StringUtils.isNotEmpty(dto.getReplace())){
|
|
|
|
+ String name = archivesAuto.getName();
|
|
|
|
+ if (StringUtils.isNotEmpty(name)&&name.contains(dto.getQuery())) {
|
|
|
|
+ String newName = name.replaceAll(dto.getQuery(), dto.getReplace());
|
|
|
|
+ archivesAuto.setName(newName);
|
|
|
|
+ }else {
|
|
|
|
+ throw new ServiceException("没有找到原内容");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ if(StringUtils.isNotEmpty(dto.getQuery())){
|
|
|
|
+ String name = archivesAuto.getName();
|
|
|
|
+ if (StringUtils.isNotEmpty(name)&&name.contains(dto.getQuery())) {
|
|
|
|
+ String newName = name.replaceAll(dto.getQuery(), "");
|
|
|
|
+ archivesAuto.setName(newName);
|
|
|
|
+ }else {
|
|
|
|
+ throw new ServiceException("没有找到原内容");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return this.updateBatchById(archivesAutos);
|
|
|
|
+ }
|
|
|
|
+
|
|
public List<ArchivesAuto> setFileNumberByConfig(ArchiveProjectConfig config,List<ArchivesAutoVO4> value){
|
|
public List<ArchivesAuto> setFileNumberByConfig(ArchiveProjectConfig config,List<ArchivesAutoVO4> value){
|
|
int i=1;
|
|
int i=1;
|
|
List<ArchivesAuto>list=new ArrayList<>();
|
|
List<ArchivesAuto>list=new ArrayList<>();
|