Compare commits
2 Commits
1c2c70d077
...
dafe6f3c88
Author | SHA1 | Date |
---|---|---|
|
dafe6f3c88 | |
|
2e03763f87 |
|
@ -38,7 +38,7 @@ import java.util.stream.Collectors;
|
||||||
*/
|
*/
|
||||||
@Api(tags = "服务指令")
|
@Api(tags = "服务指令")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/services/serviceDirective/configServiceDirective")
|
@RequestMapping("/services/serviceDirective")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ConfigServiceDirectiveController extends JeecgController<ConfigServiceDirective, IConfigServiceDirectiveService> {
|
public class ConfigServiceDirectiveController extends JeecgController<ConfigServiceDirective, IConfigServiceDirectiveService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -109,8 +109,9 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
@ApiOperation(value = "服务指令-添加", notes = "服务指令-添加")
|
@ApiOperation(value = "服务指令-添加", notes = "服务指令-添加")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<String> add(@RequestBody ConfigServiceDirective configServiceDirective) {
|
public Result<String> add(@RequestBody ConfigServiceDirective configServiceDirective) {
|
||||||
//处理媒体资源
|
//处理媒体资源(放在保存方法之前)
|
||||||
configServiceDirectiveService.handleMedia(configServiceDirective);
|
configServiceDirectiveService.handleMediaFile(configServiceDirective);
|
||||||
|
log.info("服务指令保存时,pre:{},immedia:{},mp3:{},mp4:{}",configServiceDirective.getPreviewFile(),configServiceDirective.getImmediateFile(),configServiceDirective.getMp3File(),configServiceDirective.getMp4File());
|
||||||
configServiceDirectiveService.save(configServiceDirective);
|
configServiceDirectiveService.save(configServiceDirective);
|
||||||
if (StringUtils.isNotBlank(configServiceDirective.getBodyTags())) {
|
if (StringUtils.isNotBlank(configServiceDirective.getBodyTags())) {
|
||||||
configServiceDirectiveService.saveBodyTags(configServiceDirective);
|
configServiceDirectiveService.saveBodyTags(configServiceDirective);
|
||||||
|
@ -123,7 +124,6 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
} else {
|
} else {
|
||||||
configServiceDirectiveService.removeEmotionTags(configServiceDirective);
|
configServiceDirectiveService.removeEmotionTags(configServiceDirective);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Result.OK("添加成功!");
|
return Result.OK("添加成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,8 +137,9 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
@ApiOperation(value = "服务指令-编辑", notes = "服务指令-编辑")
|
@ApiOperation(value = "服务指令-编辑", notes = "服务指令-编辑")
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
public Result<String> edit(@RequestBody ConfigServiceDirective configServiceDirective) {
|
public Result<String> edit(@RequestBody ConfigServiceDirective configServiceDirective) {
|
||||||
//处理媒体资源
|
//处理媒体资源(放在保存方法之前)
|
||||||
configServiceDirectiveService.handleMedia(configServiceDirective);
|
configServiceDirectiveService.handleMediaFile(configServiceDirective);
|
||||||
|
log.info("服务指令保存时,pre:{},immedia:{},mp3:{},mp4:{}",configServiceDirective.getPreviewFile(),configServiceDirective.getImmediateFile(),configServiceDirective.getMp3File(),configServiceDirective.getMp4File());
|
||||||
configServiceDirectiveService.updateById(configServiceDirective);
|
configServiceDirectiveService.updateById(configServiceDirective);
|
||||||
if (StringUtils.isNotBlank(configServiceDirective.getBodyTags())) {
|
if (StringUtils.isNotBlank(configServiceDirective.getBodyTags())) {
|
||||||
configServiceDirectiveService.saveBodyTags(configServiceDirective);
|
configServiceDirectiveService.saveBodyTags(configServiceDirective);
|
||||||
|
|
|
@ -85,9 +85,9 @@ public class ConfigServiceDirective implements Serializable {
|
||||||
@Excel(name = "排序", width = 15)
|
@Excel(name = "排序", width = 15)
|
||||||
@ApiModelProperty(value = "排序")
|
@ApiModelProperty(value = "排序")
|
||||||
private java.lang.Integer sort;
|
private java.lang.Integer sort;
|
||||||
/**服务说明*/
|
/**服务描述*/
|
||||||
@Excel(name = "服务说明", width = 15)
|
@Excel(name = "服务描述", width = 15)
|
||||||
@ApiModelProperty(value = "服务说明")
|
@ApiModelProperty(value = "服务描述")
|
||||||
private java.lang.String serviceContent;
|
private java.lang.String serviceContent;
|
||||||
/**服务时长(分钟)*/
|
/**服务时长(分钟)*/
|
||||||
@Excel(name = "服务时长(分钟)", width = 15)
|
@Excel(name = "服务时长(分钟)", width = 15)
|
||||||
|
@ -122,42 +122,30 @@ public class ConfigServiceDirective implements Serializable {
|
||||||
/**所属部门*/
|
/**所属部门*/
|
||||||
@ApiModelProperty(value = "所属部门")
|
@ApiModelProperty(value = "所属部门")
|
||||||
private java.lang.String sysOrgCode;
|
private java.lang.String sysOrgCode;
|
||||||
/**语音文件*/
|
/**指令音频文件*/
|
||||||
@ApiModelProperty(value = "语音文件")
|
@ApiModelProperty(value = "指令音频文件")
|
||||||
private java.lang.String mp3File;
|
private java.lang.String mp3File;
|
||||||
//语音文件是否变更
|
//语音文件是否变更
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private boolean mp3FileChanged;
|
private boolean mp3FileChanged;
|
||||||
//语音文件路径
|
/**指令视频文件*/
|
||||||
@TableField(exist = false)
|
@ApiModelProperty(value = "指令视频文件")
|
||||||
private java.lang.String mp3FileMedia;
|
|
||||||
/**视频文件*/
|
|
||||||
@ApiModelProperty(value = "视频文件")
|
|
||||||
private java.lang.String mp4File;
|
private java.lang.String mp4File;
|
||||||
//视频文件是否变更
|
//视频文件是否变更
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private boolean mp4FileChanged;
|
private boolean mp4FileChanged;
|
||||||
//视频文件路径
|
/**服务指令图片*/
|
||||||
@TableField(exist = false)
|
@ApiModelProperty(value = "服务指令图片")
|
||||||
private java.lang.String mp4FileMedia;
|
|
||||||
/**预览图片*/
|
|
||||||
@ApiModelProperty(value = "预览图片")
|
|
||||||
private java.lang.String previewFile;
|
private java.lang.String previewFile;
|
||||||
//预览图片是否变更
|
//服务指令图片是否变更
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private boolean previewFileChanged;
|
private boolean previewFileChanged;
|
||||||
//预览图片路径
|
/**即时指令图标*/
|
||||||
@TableField(exist = false)
|
@ApiModelProperty(value = "即时指令图标")
|
||||||
private java.lang.String previewFileMedia;
|
|
||||||
/**即时指令图片*/
|
|
||||||
@ApiModelProperty(value = "即时指令图片")
|
|
||||||
private java.lang.String immediateFile;
|
private java.lang.String immediateFile;
|
||||||
//即时指令图片是否变更
|
//即时指令图标是否变更
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private boolean immediateFileChanged;
|
private boolean immediateFileChanged;
|
||||||
//即时指令图片路径
|
|
||||||
@TableField(exist = false)
|
|
||||||
private java.lang.String immediateFileMedia;
|
|
||||||
|
|
||||||
//合并单元格用:类别合并的行数
|
//合并单元格用:类别合并的行数
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
@ -174,12 +162,6 @@ public class ConfigServiceDirective implements Serializable {
|
||||||
//情绪标签id,id,id
|
//情绪标签id,id,id
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String emotionTags;
|
private String emotionTags;
|
||||||
@TableField(exist = false)
|
|
||||||
//服务类别名称
|
|
||||||
private String categoryName;
|
|
||||||
//服务类型名称
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String typeName;
|
|
||||||
|
|
||||||
|
|
||||||
//体型标签
|
//体型标签
|
||||||
|
@ -195,4 +177,20 @@ public class ConfigServiceDirective implements Serializable {
|
||||||
//情绪标签字符串
|
//情绪标签字符串
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String emotionTagsName;
|
private String emotionTagsName;
|
||||||
|
|
||||||
|
//分类标签中文名称
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String instructionName;
|
||||||
|
//服务类别中文名称
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryName;
|
||||||
|
//服务类型中文名称
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String typeName;
|
||||||
|
//周期类型中文名称
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String cycleTypeName;
|
||||||
|
//媒体资源存储路径名
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String mediaFileSavePath;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,24 +21,28 @@ public interface IConfigServiceDirectiveService extends IService<ConfigServiceDi
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储体型标签数据
|
* 存储体型标签数据
|
||||||
|
*
|
||||||
* @param configServiceDirective
|
* @param configServiceDirective
|
||||||
*/
|
*/
|
||||||
void saveBodyTags(ConfigServiceDirective configServiceDirective);
|
void saveBodyTags(ConfigServiceDirective configServiceDirective);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储情绪标签数据
|
* 存储情绪标签数据
|
||||||
|
*
|
||||||
* @param configServiceDirective
|
* @param configServiceDirective
|
||||||
*/
|
*/
|
||||||
void saveEmotionTags(ConfigServiceDirective configServiceDirective);
|
void saveEmotionTags(ConfigServiceDirective configServiceDirective);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 移除改服务指令下体型标签
|
* 移除改服务指令下体型标签
|
||||||
|
*
|
||||||
* @param configServiceDirective
|
* @param configServiceDirective
|
||||||
*/
|
*/
|
||||||
void removeBodyTags(ConfigServiceDirective configServiceDirective);
|
void removeBodyTags(ConfigServiceDirective configServiceDirective);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 移除改服务指令下情绪标签
|
* 移除改服务指令下情绪标签
|
||||||
|
*
|
||||||
* @param configServiceDirective
|
* @param configServiceDirective
|
||||||
*/
|
*/
|
||||||
void removeEmotionTags(ConfigServiceDirective configServiceDirective);
|
void removeEmotionTags(ConfigServiceDirective configServiceDirective);
|
||||||
|
@ -53,7 +57,5 @@ public interface IConfigServiceDirectiveService extends IService<ConfigServiceDi
|
||||||
|
|
||||||
void insertAllDirectives(List<ConfigServiceDirective> directives);
|
void insertAllDirectives(List<ConfigServiceDirective> directives);
|
||||||
|
|
||||||
void handleMedia(ConfigServiceDirective configServiceDirective);
|
void handleMediaFile(ConfigServiceDirective configServiceDirective);
|
||||||
|
|
||||||
// List<JSONObject> selectMediaList(String dataSourceCode, List<String> idList);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.nu.modules.servicedirective.service.impl;
|
package com.nu.modules.servicedirective.service.impl;
|
||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
@ -12,16 +11,16 @@ import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||||
import com.nu.utils.RabbitMQUtil;
|
import com.nu.utils.RabbitMQUtil;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 服务指令
|
* @Description: 服务指令
|
||||||
|
@ -32,8 +31,9 @@ import java.util.stream.Stream;
|
||||||
@Service
|
@Service
|
||||||
public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigServiceDirectiveMapper, ConfigServiceDirective> implements IConfigServiceDirectiveService {
|
public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigServiceDirectiveMapper, ConfigServiceDirective> implements IConfigServiceDirectiveService {
|
||||||
|
|
||||||
// @Autowired
|
@Value(value = "${jeecg.path.upload}")
|
||||||
// private IMediaManageApi mediaManageApi;
|
private String uploadpath;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysConfigApi sysConfigApi;
|
private ISysConfigApi sysConfigApi;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -56,23 +56,6 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
List<DirectiveEmotionTag> emotionTagList = record.getEmotionTagList();
|
List<DirectiveEmotionTag> emotionTagList = record.getEmotionTagList();
|
||||||
record.setEmotionTags(emotionTagList.stream().map(DirectiveEmotionTag::getId).collect(Collectors.joining(",")));
|
record.setEmotionTags(emotionTagList.stream().map(DirectiveEmotionTag::getId).collect(Collectors.joining(",")));
|
||||||
});
|
});
|
||||||
//处理媒体资源转换
|
|
||||||
{
|
|
||||||
List<String> meidsIds = list.stream().flatMap(directive -> Stream.of(directive.getMp3File(), directive.getMp4File(), directive.getPreviewFile(), directive.getImmediateFile())).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
|
||||||
|
|
||||||
// if (!CollectionUtils.isEmpty(meidsIds)) {
|
|
||||||
// List<JSONObject> mediaObjs = mediaManageApi.queryByIds(meidsIds);
|
|
||||||
//
|
|
||||||
// Map<String, String> idToFilePathMap = mediaObjs.stream().collect(Collectors.toMap(media -> media.getStr("id"), media -> media.getStr("filePath")));
|
|
||||||
//
|
|
||||||
// list.stream().forEach(record -> {
|
|
||||||
// record.setPreviewFileMedia(idToFilePathMap.get(record.getPreviewFile()));
|
|
||||||
// record.setImmediateFileMedia(idToFilePathMap.get(record.getImmediateFile()));
|
|
||||||
// record.setMp3FileMedia(idToFilePathMap.get(record.getMp3File()));
|
|
||||||
// record.setMp4FileMedia(idToFilePathMap.get(record.getMp4File()));
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//处理单元格合并所需数据
|
//处理单元格合并所需数据
|
||||||
merge(list);
|
merge(list);
|
||||||
|
@ -242,35 +225,101 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理资源文件
|
||||||
|
* 1、检测各资源文件的存储路径是否跟路径字段的值一致
|
||||||
|
* 2、如果不一致1)检测缺少的路径新建目录 2)然后把资源挪到新路径中 3)修改媒体资源对应字段的值的路径名
|
||||||
|
*
|
||||||
|
* @param configServiceDirective
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void handleMedia(ConfigServiceDirective configServiceDirective) {
|
public void handleMediaFile(ConfigServiceDirective configServiceDirective) {
|
||||||
// Map<String, String> params = Maps.newHashMap();
|
//上传根路径
|
||||||
// params.put("sysFunc", "directive");
|
String path = uploadpath;
|
||||||
// if (configServiceDirective.isImmediateFileChanged()) {
|
//需要存储的路径
|
||||||
// params.put("fileName", configServiceDirective.getDirectiveName() + "预览图片");
|
String mediaFileSavePath = configServiceDirective.getMediaFileSavePath();
|
||||||
// params.put("descr", "服务指令用户上传图片:" + configServiceDirective.getDirectiveName() + "预览图片");
|
//服务指令图片
|
||||||
// configServiceDirective.setImmediateFile((mediaManageApi.saveByPath(configServiceDirective.getImmediateFileMedia(), params)));
|
String previewFile = configServiceDirective.getPreviewFile();
|
||||||
// }
|
//即时指令图标
|
||||||
// if (configServiceDirective.isPreviewFileChanged()) {
|
String immediateFile = configServiceDirective.getImmediateFile();
|
||||||
// params.put("fileName", configServiceDirective.getDirectiveName() + "即时指令图片");
|
//指令音频文件
|
||||||
// params.put("descr", "服务指令用户上传图片:" + configServiceDirective.getDirectiveName() + "即时指令图片");
|
String mp3File = configServiceDirective.getMp3File();
|
||||||
// configServiceDirective.setPreviewFile(mediaManageApi.saveByPath(configServiceDirective.getPreviewFileMedia(), params));
|
//指令视频文件
|
||||||
// }
|
String mp4File = configServiceDirective.getMp4File();
|
||||||
// if (configServiceDirective.isMp3FileChanged()) {
|
|
||||||
// params.put("fileName", configServiceDirective.getDirectiveName() + "音频文件");
|
// 处理每个文件并获取更新后的路径
|
||||||
// params.put("descr", "服务指令用户上传音频:" + configServiceDirective.getDirectiveName() + "音频文件");
|
String newPreviewFile = processFile(path, mediaFileSavePath, previewFile);
|
||||||
// configServiceDirective.setMp3File(mediaManageApi.saveByPath(configServiceDirective.getMp3FileMedia(), params));
|
String newImmediateFile = processFile(path, mediaFileSavePath, immediateFile);
|
||||||
// }
|
String newMp3File = processFile(path, mediaFileSavePath, mp3File);
|
||||||
// if (configServiceDirective.isMp4FileChanged()) {
|
String newMp4File = processFile(path, mediaFileSavePath, mp4File);
|
||||||
// params.put("fileName", configServiceDirective.getDirectiveName() + "视频文件");
|
|
||||||
// params.put("descr", "服务指令用户上传视频:" + configServiceDirective.getDirectiveName() + "视频文件");
|
// 如果有变化,更新ConfigServiceDirective对象
|
||||||
// configServiceDirective.setMp4File(mediaManageApi.saveByPath(configServiceDirective.getMp4FileMedia(), params));
|
if (newPreviewFile != null) {
|
||||||
// }
|
configServiceDirective.setPreviewFile(newPreviewFile);
|
||||||
|
}
|
||||||
|
if (newImmediateFile != null) {
|
||||||
|
configServiceDirective.setImmediateFile(newImmediateFile);
|
||||||
|
}
|
||||||
|
if (newMp3File != null) {
|
||||||
|
configServiceDirective.setMp3File(newMp3File);
|
||||||
|
}
|
||||||
|
if (newMp4File != null) {
|
||||||
|
configServiceDirective.setMp4File(newMp4File);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
/**
|
||||||
// public List<JSONObject> selectMediaList(String dataSourceCode, List<String> idList) {
|
* 处理单个文件,检查路径是否需要迁移
|
||||||
// return mediaManageApi.selectByDirectiveIds(dataSourceCode, idList);
|
* @param basePath 基础路径
|
||||||
// }
|
* @param targetDir 目标目录
|
||||||
|
* @param filePath 文件路径
|
||||||
|
* @return 如果路径有变化返回新路径,否则返回null
|
||||||
|
*/
|
||||||
|
private String processFile(String basePath, String targetDir, String filePath) {
|
||||||
|
if (StringUtils.isBlank(filePath)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 检查文件路径是否以目标目录开头
|
||||||
|
if (!filePath.startsWith(targetDir + "/")) {
|
||||||
|
// 获取文件名(路径的最后一部分)
|
||||||
|
String fileName = filePath.substring(filePath.lastIndexOf('/') + 1);
|
||||||
|
|
||||||
|
// 构建新的完整路径
|
||||||
|
String newRelativePath = targetDir + "/" + fileName;
|
||||||
|
String oldFullPath = basePath + "/" + filePath;
|
||||||
|
String newFullPath = basePath + "/" + newRelativePath;
|
||||||
|
|
||||||
|
// 创建目标目录(如果不存在)
|
||||||
|
File targetDirectory = new File(basePath + "/" + targetDir);
|
||||||
|
if (!targetDirectory.exists()) {
|
||||||
|
targetDirectory.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 移动文件
|
||||||
|
File oldFile = new File(oldFullPath);
|
||||||
|
if (oldFile.exists()) {
|
||||||
|
File newFile = new File(newFullPath);
|
||||||
|
|
||||||
|
// 如果目标文件已存在,先删除
|
||||||
|
if (newFile.exists()) {
|
||||||
|
newFile.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 移动文件
|
||||||
|
Files.move(oldFile.toPath(), newFile.toPath());
|
||||||
|
|
||||||
|
// 返回新的相对路径
|
||||||
|
return newRelativePath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 处理异常,可以根据实际需求记录日志或抛出
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,13 +254,10 @@ jeecg:
|
||||||
pc: http://localhost:3100
|
pc: http://localhost:3100
|
||||||
app: http://localhost:8051
|
app: http://localhost:8051
|
||||||
path:
|
path:
|
||||||
#服务指令上传目录
|
|
||||||
directivepath: /cache/nu/opt/upFiles/directive
|
|
||||||
#文件上传根目录 设置
|
#文件上传根目录 设置
|
||||||
upload: /cache/ope/opt/upFiles
|
upload: /cache/ope/opt/upFiles
|
||||||
#webapp文件路径
|
#webapp文件路径
|
||||||
webapp: /cache/ope/opt/webapp
|
webapp: /cache/ope/opt/webapp
|
||||||
webapp1: /abc
|
|
||||||
shiro:
|
shiro:
|
||||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
||||||
#阿里云oss存储和大鱼短信秘钥配置
|
#阿里云oss存储和大鱼短信秘钥配置
|
||||||
|
|
|
@ -253,8 +253,6 @@ jeecg:
|
||||||
pc: http://localhost:3100
|
pc: http://localhost:3100
|
||||||
app: http://localhost:8051
|
app: http://localhost:8051
|
||||||
path:
|
path:
|
||||||
#服务指令上传目录
|
|
||||||
directivepath: /opt/upFiles/directive
|
|
||||||
#文件上传根目录 设置
|
#文件上传根目录 设置
|
||||||
upload: /opt/ope/upFiles
|
upload: /opt/ope/upFiles
|
||||||
#webapp文件路径
|
#webapp文件路径
|
||||||
|
|
Loading…
Reference in New Issue