导入设置

This commit is contained in:
liuliang 2025-05-27 10:19:34 +08:00
parent 453eddc892
commit d0d0052496
3 changed files with 8 additions and 8 deletions

View File

@ -58,12 +58,12 @@ public class JclUpLoadFileController extends BaseCommonController {
@WeaPermission(publicPermission = true)
@GetMapping("/jcluploadFile")
@ResponseBody
public WeaResult<Map<String, Object>> uploadTest(@RequestParam("fileId") String fileId,@RequestParam("tableName") String tableName){
public WeaResult<Map<String, Object>> uploadTest(@RequestParam("fileId") String fileId,@RequestParam("tableName") String tableName,@RequestParam("folderId") String folderId){
Map<String,Object> returnMap = Maps.newHashMap();
try {
String sql = "select * from fileobj where id in ("+fileId+")";
List<Map<String, Object>> list = databaseUtils.getSqlList(sql);
returnMap = uploadService.jcluploadFile(list,tableName,getCurrentUser());
returnMap = uploadService.jcluploadFile(list,tableName,folderId,getCurrentUser());
}catch (Exception e){
log.error("error msg :[{}]",e);

View File

@ -8,10 +8,10 @@ import java.util.Map;
public interface UploadService {
Map<String, Object> uploadFile(Map<String,Object> fileMap, ModuleSource module, Long refId, SimpleEmployee employee, String chunks);
Map<String, Object> uploadFile(Map<String,Object> fileMap,String folderId, ModuleSource module, Long refId, SimpleEmployee employee, String chunks);
Map<String, Object> importData(List<Map<String, String>> dataList,String tableName,SimpleEmployee employee);
Map<String, Object> jcluploadFile(List<Map<String, Object>> list,String tableName,SimpleEmployee employee) throws Exception;
Map<String, Object> jcluploadFile(List<Map<String, Object>> list,String tableName,String folderId,SimpleEmployee employee) throws Exception;
}

View File

@ -63,7 +63,7 @@ public class UploadServiceImpl implements UploadService {
@Override
public Map<String, Object> jcluploadFile(List<Map<String, Object>> list,String tableName,SimpleEmployee employee) throws Exception {
public Map<String, Object> jcluploadFile(List<Map<String, Object>> list,String tableName,String folderId,SimpleEmployee employee) throws Exception {
Map<String,Object> returnMap = Maps.newHashMap();
List<Map<String, Object>> importList = Lists.newArrayList();
for (Map<String, Object> resultMap:list){
@ -110,7 +110,7 @@ public class UploadServiceImpl implements UploadService {
String fileName = dataList.get(rowNum-1).get(titles.get(colNum));
fileMap.put("filename",fileName);
Map<String,Object> fileUploadMap = uploadFile(fileMap,ModuleSource.ebuildercard,0L,employee,null);
Map<String,Object> fileUploadMap = uploadFile(fileMap,folderId,ModuleSource.ebuildercard,0L,employee,null);
long docId = ((FileObj)fileUploadMap.get("fileObj")).getDocId();
dataList.get(rowNum-1).put(titles.get(colNum),String.valueOf(docId));
Map<String,String> updataMap = Maps.newHashMap();
@ -127,7 +127,7 @@ public class UploadServiceImpl implements UploadService {
return returnMap;
}
public Map<String, Object> uploadFile(Map<String,Object> fileMap, ModuleSource module, Long refId, SimpleEmployee employee, String chunks) {
public Map<String, Object> uploadFile(Map<String,Object> fileMap,String folderId, ModuleSource module, Long refId, SimpleEmployee employee, String chunks) {
File data = null;
try{
data = File.createTempFile(UUID.randomUUID().toString(),null);
@ -200,7 +200,7 @@ public class UploadServiceImpl implements UploadService {
try{
fileObj = remoteUploadService.saveFile(employee.getTenantKey(), fileObj, Files.readAllBytes(data.toPath()));
//生成附件文档
fileObj.setDocId(docClientService.fileCreateDoc(fileObj.getFileid(),8444718832337138266L,employee.getId(),EntityType.valueOf(module.toString()),employee.getTenantKey()));
fileObj.setDocId(docClientService.fileCreateDoc(fileObj.getFileid(),Long.valueOf(folderId),employee.getId(),EntityType.valueOf(module.toString()),employee.getTenantKey()));
//fileObj.setDocId(docClientService.postFileUploadReId(fileObj, employee, new Date(), EntityType.valueOf(module.toString())));
fileClientService.update(fileObj);
} catch (Exception e) {