From 306e2714266cef35638514f05cf4f643857608d9 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期三, 26 七月 2023 19:06:34 +0800
Subject: [PATCH] 药剂管理
---
igds-inout/src/main/java/com/ld/igds/inout/view/InoutDataPR.java | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/igds-inout/src/main/java/com/ld/igds/inout/view/InoutDataPR.java b/igds-inout/src/main/java/com/ld/igds/inout/view/InoutDataPR.java
index 4d1c07e..4c7df5e 100644
--- a/igds-inout/src/main/java/com/ld/igds/inout/view/InoutDataPR.java
+++ b/igds-inout/src/main/java/com/ld/igds/inout/view/InoutDataPR.java
@@ -1,6 +1,7 @@
package com.ld.igds.inout.view;
import java.io.File;
+import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -259,12 +260,18 @@
*/
@FileResolver
public String uploadImage(UploadFile file, Map<String, Object> parameter) {
+ //杞︾墝
String plateNum = (String) parameter.get("plateNum");
+ //娴佺▼
+ String bizTag = (String) parameter.get("bizTag");
String newFileName = null;
try {
String basePath = fileService.getInoutFilePath(new Date());
// 鑾峰彇鏂扮殑ID
newFileName = DateFormatUtils.format(new Date(), "yyyyMMddHHmmss");
+ if(StringUtils.isNotEmpty(bizTag)){
+ newFileName = bizTag + "_" + newFileName;
+ }
// 鏂囦欢鍚庣紑鍚�
String suffixName = file.getFileName().substring(file.getFileName().lastIndexOf("."));
// 鍚堟垚鏂扮殑鏂囦欢鍚�
@@ -278,4 +285,28 @@
return newFileName;
}
+ /**
+ * inoutDataPR#delImage
+ *
+ * @param parameter
+ * @return
+ */
+ @Expose
+ public String delImage(Map<String, Object> parameter) throws Exception {
+
+ String fileName = (String) parameter.get("fileName");
+ Date createTime = (Date) parameter.get("createTime");
+ if (null == createTime) createTime = new Date();
+ fileName = URLDecoder.decode(fileName, "UTF-8");
+
+ File file = new File(fileService.getInoutFilePath(createTime), fileName);
+
+ if (!file.exists()) {
+ return "鍒犻櫎澶辫触锛岀郴缁熸湭鎵惧埌褰撳墠闄勪欢";
+ }
+
+ file.delete();
+ return null;
+ }
+
}
--
Gitblit v1.9.3