Merge remote-tracking branch 'origin/master'
This commit is contained in:
+3
@@ -19,6 +19,9 @@ public interface IOSSFileService extends IService<OSSFile> {
|
||||
*/
|
||||
public OSSFile uploadLocal(MultipartFile mf, String bizPath);
|
||||
|
||||
|
||||
public List<OSSFile> getFileInfos(String connectId);
|
||||
|
||||
boolean delete(OSSFile ossFile);
|
||||
|
||||
/**
|
||||
|
||||
+10
-1
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.oss.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
@@ -108,7 +109,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
|
||||
//存入文件表
|
||||
oSSFile.setFileName(orgName);
|
||||
oSSFile.setId(UuidUtils.getUUID());
|
||||
oSSFile.setUrl(file.getPath());
|
||||
oSSFile.setUrl(savePath);
|
||||
oSSFile.setCreateBy(loginUser.getUsername());
|
||||
oSSFile.setCreateTime(new Date());
|
||||
this.save(oSSFile);
|
||||
@@ -119,6 +120,14 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
|
||||
return oSSFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OSSFile> getFileInfos(String connectId) {
|
||||
LambdaQueryWrapper<OSSFile> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(OSSFile::getConnectId,connectId);
|
||||
List<OSSFile> list = this.list(wrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delete(OSSFile ossFile) {
|
||||
try {
|
||||
|
||||
+19
@@ -7,6 +7,8 @@ import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.*;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
@@ -30,6 +32,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表 前端控制器
|
||||
@@ -38,6 +42,7 @@ import java.net.URLDecoder;
|
||||
* @Author scott
|
||||
* @since 2018-12-20
|
||||
*/
|
||||
@Api(tags="文件通用")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/sys/common")
|
||||
@@ -129,6 +134,7 @@ public class CommonController {
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="文件上传统一方法", notes="文件上传统一方法")
|
||||
@PostMapping(value = "/upload")
|
||||
public Result<?> upload(HttpServletRequest request, HttpServletResponse response) {
|
||||
Result<OSSFile> result = new Result<>();
|
||||
@@ -154,6 +160,19 @@ public class CommonController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看已上传的文件
|
||||
* @param connectId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="查看已上传的文件", notes="查看已上传的文件")
|
||||
@GetMapping(value = "/getFileInfos")
|
||||
public Result<?> getFileInfos(String connectId) {
|
||||
List<OSSFile> fileInfos = ossFileService.getFileInfos(connectId);
|
||||
return Result.OK(fileInfos);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 预览图片&下载文件
|
||||
*
|
||||
|
||||
+5
@@ -86,6 +86,11 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
|
||||
*/
|
||||
void updateInfo(Map<String,Object> map);
|
||||
|
||||
/**
|
||||
* 分页
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
IPage getInfoPage(Map<String,Object> parameter);
|
||||
|
||||
|
||||
|
||||
+9
-9
@@ -270,7 +270,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (fieldFile.size() != 0 && ObjectUtils.isNotEmpty(value)) {
|
||||
|
||||
String valueTemp = UUID.randomUUID().toString().replace("-", "");
|
||||
value = valueTemp;
|
||||
// value = valueTemp;
|
||||
//修改文件表关联信息connect_id
|
||||
List<OSSFile> oSSFileList = new ArrayList<>();
|
||||
for (String fileId : value.toString().split(",")) {
|
||||
@@ -280,8 +280,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
oSSFileList.add(ossFile);
|
||||
}
|
||||
iOSSFileService.updateFileInfo(oSSFileList);
|
||||
valuesBuilder.append("," + "'" + valueTemp + "'");
|
||||
}else{
|
||||
valuesBuilder.append("," + "'" + value + "'");
|
||||
}
|
||||
valuesBuilder.append("," + "'" + value + "'");
|
||||
|
||||
}
|
||||
fieldsBuilder.append("," + key);
|
||||
// }
|
||||
@@ -386,9 +389,6 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
|
||||
public IPage getInfoPage(Map<String, Object> parameter) {
|
||||
|
||||
|
||||
|
||||
//需要查询的字段
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
|
||||
if (fieldList.size() != 0) {
|
||||
@@ -464,14 +464,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
} else if ("2".equals((String) parameter.get("orderBy"))) {
|
||||
conditionSb.append(" desc");//倒序
|
||||
}
|
||||
} else {
|
||||
conditionSb.append(" order by create_time desc");
|
||||
}
|
||||
}else{
|
||||
conditionSb.append(" order by create_time desc");
|
||||
}
|
||||
int pageNo = 1;
|
||||
int pageSize = 10;
|
||||
// int pageNo = Integer.parseInt(mapTemp.get("pageNo").toString());
|
||||
// int pageSize = Integer.parseInt(mapTemp.get("pageSize").toString());
|
||||
// int pageNo = Integer.parseInt(parameter.get("pageNo").toString());
|
||||
// int pageSize = Integer.parseInt(parameter.get("pageSize").toString());
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import addForm from './modules/addForm'
|
||||
import frameAssembly from '@/components/frameAssembly/index'
|
||||
import { getAction, postAction, deleteAction } from '@/api/manage'
|
||||
import eventBUs from '../../../common/event'
|
||||
|
||||
export default {
|
||||
name: 'docLibrary',
|
||||
@@ -69,47 +71,48 @@
|
||||
{
|
||||
text: '删除',
|
||||
ClickEvent: 'deleteTable'
|
||||
},
|
||||
}
|
||||
],
|
||||
selectedRowKeys: [],
|
||||
loading: false,
|
||||
url:{
|
||||
tableHeader:'document/bussDocumentLibraryEO/getHeader', //表格头部字段
|
||||
seachList:'document/bussDocumentLibraryEO/queryCondition', //搜索字段
|
||||
tableList:'document/bussDocumentLibraryEO/queryPageInfo', //表格数据
|
||||
getAddForm:'document/bussDocumentLibraryEO/getAddForm', // 表单的字段
|
||||
addInfo:'document/bussDocumentLibraryEO/addInfo', //新增
|
||||
updateInfo:'document/bussDocumentLibraryEO/updateInfo', //编辑
|
||||
getDocumentInfo:'document/bussDocumentLibraryEO/getDocumentInfoById', //查看
|
||||
},
|
||||
url: {
|
||||
tableHeader: 'document/bussDocumentLibraryEO/getHeader', //表格头部字段
|
||||
seachList: 'document/bussDocumentLibraryEO/queryCondition', //搜索字段
|
||||
tableList: 'document/bussDocumentLibraryEO/queryPageInfo', //表格数据
|
||||
getAddForm: 'document/bussDocumentLibraryEO/getAddForm', // 表单的字段
|
||||
addInfo: 'document/bussDocumentLibraryEO/addInfo', //新增
|
||||
updateInfo: 'document/bussDocumentLibraryEO/updateInfo', //编辑
|
||||
getDocumentInfo: 'document/bussDocumentLibraryEO/getDocumentInfoById', //查看
|
||||
deleteBatch: 'document/bussDocumentLibraryEO/deleteBatch' //删除
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSelectChange() {
|
||||
|
||||
},
|
||||
handleExport(){
|
||||
handleExport() {
|
||||
|
||||
},
|
||||
handleFileExport(){
|
||||
handleFileExport() {
|
||||
|
||||
},
|
||||
handleAdd(){
|
||||
handleAdd() {
|
||||
this.$refs.addFormRef.add()
|
||||
},
|
||||
handleModule(){
|
||||
handleModule() {
|
||||
|
||||
},
|
||||
handleDel(){
|
||||
handleDel() {
|
||||
|
||||
},
|
||||
handleCompare() {
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.$refs.frameAssemblyRef.visible = true
|
||||
})
|
||||
// this.$refs.addFormRef.add()
|
||||
},
|
||||
handleFileImport(){
|
||||
handleFileImport() {
|
||||
|
||||
},
|
||||
//编辑按钮
|
||||
@@ -117,16 +120,30 @@
|
||||
this.$refs.addFormRef.edit(val)
|
||||
},
|
||||
//删除按钮
|
||||
deleteTable(val){
|
||||
console.log(val)
|
||||
deleteTable(val) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
content: '确认删除?',
|
||||
onOk() {
|
||||
deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(res.message)
|
||||
eventBUs.$emit('searchReset')
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
//收藏按钮
|
||||
Collection(val){
|
||||
console.log('val111',val)
|
||||
Collection(val) {
|
||||
console.log('val111', val)
|
||||
},
|
||||
//订阅按钮
|
||||
subscribe(val){
|
||||
console.log('val222',val)
|
||||
subscribe(val) {
|
||||
console.log('val222', val)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user