机构管理 bug + 上传文件改名接口

This commit is contained in:
yuezhihang
2022-06-27 14:25:48 +08:00
parent 19db42504f
commit cd3729ace3
8 changed files with 47 additions and 1 deletions
@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -752,4 +753,12 @@ public class AttFileEOController {
}
}
@ApiOperation(value = "修改文件名称")
@GetMapping("/updateFileName")
public ResponseMessage<AttFileEO> updateFileName(@Param("fileId") String fileId,@Param("fileName") String fileName) {
AttFileEO attFileEO = attFileEOService.updateFileInfo(fileId,fileName);
return Result.success(attFileEO);
}
}
@@ -20,6 +20,8 @@ public interface AttFileEODao extends BaseMapper<AttFileEO> {
public AttFileEO selectFileInfoById(AttFileEO attFileEO);
public int updateFileInfoById(AttFileEO attFileEO);
public int insertData(AttFileEO attFileEO);
}
@@ -20,6 +20,8 @@ public interface IAttFileEOService extends IService<AttFileEO> {
public AttFileEO getFileInfo(String attId);
public AttFileEO updateFileInfo(String attId,String name);
public List<AttFileEO> getMultiFileInfos(String fileIds);
public List<AttFileEO> getMultiFileInfosOrderByDateDesc(String fileIds);
@@ -333,6 +333,26 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
return attFileEO;
}
@Override
public AttFileEO updateFileInfo(String attId,String name) {
/**
* 根据ID获取文件信息
*/
AttFileEO attFileEO = new AttFileEO();
AttFileEO attFileInfo=null;
Integer flag=0;
try {
attFileEO.setId(attId);
attFileInfo = this.baseMapper.selectFileInfoById(attFileEO);
attFileInfo.setOldFileName(name);
this.baseMapper.updateFileInfoById(attFileEO);
return attFileInfo;
} catch (Exception e) {
log.error(e.getMessage(),e);
}
return attFileInfo;
}
/**
* @Author super_liu
* @Description 多文件查询