From 0892d843cd394f383ff50f480f7f22f2ec3829bc Mon Sep 17 00:00:00 2001 From: zhaowenxuan <chacca165@163.com> Date: 星期五, 27 六月 2025 20:24:45 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ltkj-admin/src/main/java/com/ltkj/web/config/captcha/CommonController.java | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 42 insertions(+), 5 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/config/captcha/CommonController.java b/ltkj-admin/src/main/java/com/ltkj/web/config/captcha/CommonController.java index 9f1dbfd..89a05ba 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/config/captcha/CommonController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/config/captcha/CommonController.java @@ -9,13 +9,16 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ltkj.common.core.domain.R; import com.ltkj.common.core.domain.entity.SysDictData; import com.ltkj.common.utils.SnowFlake; import com.ltkj.common.utils.uuid.UUID; import com.ltkj.hosp.domain.SysAttachment; +import com.ltkj.hosp.mapper.TestMapper; import com.ltkj.hosp.service.ISysAttachmentService; +import com.ltkj.system.service.ISysConfigService; import com.ltkj.system.service.ISysDictDataService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -49,8 +52,8 @@ @Autowired private ServerConfig serverConfig; - @Value("${path.xdtfilePath}") - private String value; +// @Value("${path.xdtfilePath}") +// private String value; private static final String FILE_DELIMETER = ","; @@ -66,7 +69,10 @@ private ISysAttachmentService sysAttachmentService; @Autowired private ISysDictDataService sysDictDataService; - + @Autowired + private ISysConfigService configService; + @Autowired + private TestMapper testMapper; /** * 閫氱敤涓嬭浇璇锋眰 @@ -147,12 +153,29 @@ } } + /** + * exe涓婁紶鍥剧墖鎺ュ彛 + * @param file + * @param dictVal + * @param ip + * @return + */ @PostMapping("/uploadImgExe") @ApiOperation(value = "EXE绋嬪簭寰幆璇诲彇鍥剧墖涓婁紶") public AjaxResult uploadImgExe(@RequestPart("file") MultipartFile file,@RequestParam("val")String dictVal,@RequestParam("ip")String ip){ + if (StrUtil.isBlank(dictVal)) + return AjaxResult.error("绫诲瀷涓嶈兘涓虹┖"); try { + String exeimgsaveurl = configService.selectConfigByKey("exeimgsaveurl"); + String filePath; + if (StrUtil.isNotBlank(exeimgsaveurl)){ + filePath = exeimgsaveurl; + }else { + filePath = ltkjConfig.getUploadPath(); + } // 涓婁紶鏂囦欢璺緞 - String filePath = ltkjConfig.getUploadPath(); + + filePath+="/"+dictVal; // 涓婁紶骞惰繑鍥炴柊鏂囦欢鍚嶇О String fileName = FileUploadUtils.upload(filePath, file); String url = serverConfig.getUrl() + fileName; @@ -164,9 +187,10 @@ ajax.put("newFileName", newFileName); ajax.put("originalFilename", file.getOriginalFilename()); SysAttachment sysAttachment = new SysAttachment(); + sysAttachment.setOldFileName(file.getOriginalFilename()); sysAttachment.setId(SnowFlake.getInstance().nextId()); sysAttachment.setFileName(newFileName); - sysAttachment.setFilePath(fileName); + sysAttachment.setFilePath(ltkjConfig.getUploadPath()+fileName.replace("/profileupload","")); sysAttachment.setUrl(url); sysAttachment.setSysDictVal(dictVal); sysAttachment.setIp(ip); @@ -180,6 +204,18 @@ e.printStackTrace(); return AjaxResult.error(e.getMessage()); } + } + + /** + * 鑾峰彇exe绋嬪簭涓婁紶鍥剧墖鍒楄〃 + * @param type + * @return + */ + @GetMapping("/getExeUploadImgList") + public AjaxResult getExeUploadImgList(@RequestParam("type") String type){ + if (StrUtil.isBlank(type)) return AjaxResult.error("绫诲瀷涓嶈兘涓虹┖"); + List<Map<String, Object>> list = testMapper.getExeUploadImgListByGnLx(type); + return AjaxResult.success().put("data",list); } @GetMapping("/listExeVal") @@ -289,6 +325,7 @@ @ApiParam("浣撴鍙�") String tjh,@ApiParam("椤圭洰id") String proId) throws Exception { try { // 涓婁紶鏂囦欢璺緞 + String value = configService.selectConfigByKey("path_xdtfilePath"); String filePath = value + File.separator; String outputFileName = tjh +"_" +proId; // 涓婁紶骞惰繑鍥炴柊鏂囦欢鍚嶇О -- Gitblit v1.8.0