|
@@ -0,0 +1,729 @@
|
|
|
+package com.ruoyi.web.controller.common;
|
|
|
+
|
|
|
+import com.ruoyi.common.config.RuoYiConfig;
|
|
|
+import com.ruoyi.common.constant.Constants;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
|
+import com.ruoyi.common.utils.file.FileUtils;
|
|
|
+import com.ruoyi.common.utils.uuid.IdUtils;
|
|
|
+import com.ruoyi.framework.config.ServerConfig;
|
|
|
+import com.ruoyi.web.domain.JccFile;
|
|
|
+import com.ruoyi.web.domain.JccFileModule;
|
|
|
+import com.ruoyi.web.mapper.JccFileMapper;
|
|
|
+import com.ruoyi.web.mapper.JccFileModuleMapper;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.MediaType;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+
|
|
|
+ * 通用请求处理
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+public class CommonFileController
|
|
|
+{
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(CommonFileController.class);
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ServerConfig serverConfig;
|
|
|
+ @Autowired
|
|
|
+ private JccFileModuleMapper jccFileModuleMapper;
|
|
|
+ @Autowired
|
|
|
+ private JccFileMapper jccFileMapper;
|
|
|
+
|
|
|
+
|
|
|
+ * 固定人员上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/getFixedPersonFile")
|
|
|
+ public AjaxResult uploadFile(MultipartFile file) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ SysUser thisUser = SecurityUtils.getLoginUser().getUser();
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFileModule jccFileModule =new JccFileModule();
|
|
|
+ jccFileModule.setName(name);
|
|
|
+ jccFileModule.setUrl(url);
|
|
|
+ jccFileModule.setId(uuid);
|
|
|
+ jccFileModule.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFileModule.setModuleName("jcc_fixed_personnel");
|
|
|
+ jccFileModule.setLabId(thisUser.getLabId());
|
|
|
+ jccFileModuleMapper.insertJccFileModule(jccFileModule);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 流动人员上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/uploadFileFlowPerson")
|
|
|
+ public AjaxResult uploadFileFlowPerson(MultipartFile file) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ SysUser thisUser = SecurityUtils.getLoginUser().getUser();
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFileModule jccFileModule =new JccFileModule();
|
|
|
+ jccFileModule.setName(name);
|
|
|
+ jccFileModule.setUrl(url);
|
|
|
+ jccFileModule.setId(uuid);
|
|
|
+ jccFileModule.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFileModule.setModuleName("jcc_flow_personnel");
|
|
|
+ jccFileModule.setLabId(thisUser.getLabId());
|
|
|
+ jccFileModuleMapper.insertJccFileModule(jccFileModule);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 学术委员会上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/uploadFileCommittee")
|
|
|
+ public AjaxResult uploadFileCommittee(MultipartFile file) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ SysUser thisUser = SecurityUtils.getLoginUser().getUser();
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFileModule jccFileModule =new JccFileModule();
|
|
|
+ jccFileModule.setName(name);
|
|
|
+ jccFileModule.setUrl(url);
|
|
|
+ jccFileModule.setId(uuid);
|
|
|
+ jccFileModule.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFileModule.setModuleName("jcc_academic_committee");
|
|
|
+ jccFileModule.setLabId(thisUser.getLabId());
|
|
|
+ jccFileModuleMapper.insertJccFileModule(jccFileModule);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ * 研究方向上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/uploadFileDirection")
|
|
|
+ public AjaxResult uploadFileDirection(MultipartFile file) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ SysUser thisUser = SecurityUtils.getLoginUser().getUser();
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFileModule jccFileModule =new JccFileModule();
|
|
|
+ jccFileModule.setName(name);
|
|
|
+ jccFileModule.setUrl(url);
|
|
|
+ jccFileModule.setId(uuid);
|
|
|
+ jccFileModule.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFileModule.setModuleName("jcc_research_direction");
|
|
|
+ jccFileModule.setLabId(thisUser.getLabId());
|
|
|
+ jccFileModuleMapper.insertJccFileModule(jccFileModule);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/uploadFileInput")
|
|
|
+ public AjaxResult uploadFileInput(MultipartFile file) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ SysUser thisUser = SecurityUtils.getLoginUser().getUser();
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFileModule jccFileModule =new JccFileModule();
|
|
|
+ jccFileModule.setName(name);
|
|
|
+ jccFileModule.setUrl(url);
|
|
|
+ jccFileModule.setId(uuid);
|
|
|
+ jccFileModule.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFileModule.setModuleName("jcc_fixed_input");
|
|
|
+ jccFileModule.setLabId(thisUser.getLabId());
|
|
|
+ jccFileModuleMapper.insertJccFileModule(jccFileModule);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("/common/upload/shebei1")
|
|
|
+ public AjaxResult shebei1(MultipartFile file) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ SysUser thisUser = SecurityUtils.getLoginUser().getUser();
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFileModule jccFileModule =new JccFileModule();
|
|
|
+ jccFileModule.setName(name);
|
|
|
+ jccFileModule.setUrl(url);
|
|
|
+ jccFileModule.setId(uuid);
|
|
|
+ jccFileModule.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFileModule.setModuleName("jcc_equipment_condition");
|
|
|
+ jccFileModule.setLabId(thisUser.getLabId());
|
|
|
+ jccFileModuleMapper.insertJccFileModule(jccFileModule);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/patent")
|
|
|
+ public AjaxResult uploadFilePatent(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_scientific_output_patent");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/science")
|
|
|
+ public AjaxResult uploadFileScience(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_bear_science");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/award")
|
|
|
+ public AjaxResult uploadFileAward(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_scientific_output_award");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/paper")
|
|
|
+ public AjaxResult uploadFilePaper(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_scientific_output_paper");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/other")
|
|
|
+ public AjaxResult uploadFileOther(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_scientific_output_result_other");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/technicalservice")
|
|
|
+ public AjaxResult uploadFileTechnicalservice(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_learning_openup_technicalservice");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/scienceactivities")
|
|
|
+ public AjaxResult uploadFileScienceactivities(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_learning_openup_scienceactivities");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/socialservices")
|
|
|
+ public AjaxResult uploadFileSocialservices(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_learning_openup_socialservices");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/report")
|
|
|
+ public AjaxResult uploadFileReport(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_learning_openup_report");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/personnelname")
|
|
|
+ public AjaxResult uploadFilePersonnelname(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_ranks_personnelname");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/common/upload/doctor")
|
|
|
+ public AjaxResult uploadFileDoctor(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_ranks_doctor");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/common/upload/title")
|
|
|
+ public AjaxResult uploadFileTitle(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_ranks_title");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 固定人员上传请求
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 固定投入上传请求
|
|
|
+ */
|
|
|
+ @PostMapping("/common/upload/outcome")
|
|
|
+ public AjaxResult uploadFileOutcome(MultipartFile file, @RequestParam(name = "listId") String listId) throws Exception
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
+
|
|
|
+ String name=file.getOriginalFilename();
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ String url = serverConfig.getUrl() + fileName;
|
|
|
+ String uuid = IdUtils.simpleUUID();
|
|
|
+ JccFile jccFile =new JccFile();
|
|
|
+ jccFile.setName(name);
|
|
|
+ jccFile.setUrl(url);
|
|
|
+ jccFile.setId(uuid);
|
|
|
+ jccFile.setCreateTime(DateUtils.getNowDate());
|
|
|
+ jccFile.setModuleName("jcc_outcome");
|
|
|
+ jccFile.setModuleId(listId);
|
|
|
+ jccFileMapper.insertJccFile(jccFile);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("fileName", fileName);
|
|
|
+ ajax.put("url", url);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|