bug修复
This commit is contained in:
parent
dda591aa1e
commit
67e3cead5d
|
|
@ -11,6 +11,7 @@ import com.bonus.file.service.FileUploadService;
|
||||||
import com.bonus.file.service.SourceFileService;
|
import com.bonus.file.service.SourceFileService;
|
||||||
import com.bonus.mainDataBase.service.IMDTechnicalService;
|
import com.bonus.mainDataBase.service.IMDTechnicalService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -206,8 +207,23 @@ public class TechnicalService {
|
||||||
return AjaxResult.error(validResult);
|
return AjaxResult.error(validResult);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
// 如果存在新增文件则添加文件
|
||||||
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
||||||
|
// 技术方案名称已最新上传的文件名称为主
|
||||||
|
dto.setTechnicalName(dto.getFiles().get(0).getFileName());
|
||||||
|
for (ResourceFilePo file : dto.getFiles()) {
|
||||||
|
file.setBusinessId(dto.getTechnicalSolutionId()); // 业务id
|
||||||
|
file.setSourceTable(TableConstants.TB_ENTERPRISE_TECHNICAL_SOLUTION); // 来源表
|
||||||
|
}
|
||||||
|
sourceFileService.saveResourceFile(dto.getFiles());
|
||||||
|
}
|
||||||
|
|
||||||
// 修改技术方案库数据
|
// 修改技术方案库数据
|
||||||
imdTechnicalService.operData(Collections.singletonList(dto), 2);
|
imdTechnicalService.operData(Collections.singletonList(dto), 2);
|
||||||
|
// 如果存在删除的文件则删除系统资源文件
|
||||||
|
if (CollectionUtils.isNotEmpty(dto.getDelFiles())) {
|
||||||
|
sourceFileService.delResourceFile(dto.getDelFiles(), TableConstants.TB_ENTERPRISE_TECHNICAL_SOLUTION);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
|
|
||||||
|
|
@ -193,6 +193,9 @@ public class TechnicalDto {
|
||||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
/**删除的文件*/
|
||||||
|
private List<String> delFiles;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询条件限制
|
* 查询条件限制
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ public class ToolDto {
|
||||||
/**
|
/**
|
||||||
* 资源文件
|
* 资源文件
|
||||||
*/
|
*/
|
||||||
@NotEmpty(message = "文件不能为空", groups = {ADD.class,IMPORT.class})
|
@NotEmpty(message = "图片不能为空", groups = {ADD.class,IMPORT.class})
|
||||||
@Size(min = 1,message = "最少上传一个文件", groups = {ADD.class,IMPORT.class})
|
@Size(min = 1,message = "最少上传一个文件", groups = {ADD.class,IMPORT.class})
|
||||||
private List<ResourceFilePo> files;
|
private List<ResourceFilePo> files;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue