Просмотр исходного кода

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

于继渤 2 лет назад
Родитель
Сommit
bb741abe4e

+ 27 - 2
src/main/java/com/dk/mdm/controller/FileController.java

@@ -11,7 +11,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import java.io.File;
 import java.io.IOException;
-import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.UUID;
 
 @RestController
@@ -45,7 +45,8 @@ public class FileController {
             JSONObject json = new JSONObject();
             json.put("path", filePath.replace(uploadPath, ""));
             json.put("name", fileName);
-            json.put("createTime", LocalDate.now());
+            json.put("type",getFileType(fileName));
+            json.put("createTime", LocalDateTime.now());
             return ResponseResultUtil.success(json);
         } catch (IOException e) {
             e.printStackTrace();
@@ -54,6 +55,30 @@ public class FileController {
     }
 
     /**
+     * @desc   : 获取文件类型
+     * @author : 周兴
+     * @date   : 2024-03-27 14:09
+     */
+    private String getFileType(String fileName) {
+        String[] arr = fileName.split(".");
+        String fileType = arr[arr.length - 1].toLowerCase();
+
+        if (fileType == "jpg" || fileType == "jepg" || fileType == "png") {
+            return "img";
+        }
+        if (fileType == "mp4" || fileType == "avi" || fileType == "mov") {
+            return "video";
+        }
+        if (fileType == "xls" || fileType == "xlsx") {
+            return "excel";
+        }
+        if (fileType == "pdf") {
+            return "pdf";
+        }
+        return "";
+    }
+
+    /**
      * @desc   : 根据类型创建目录文件夹
      * @author : 洪旭东
      * @date   : 2023-06-26 14:10

+ 1 - 1
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

@@ -232,7 +232,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                         .setOutAmt(BigDecimal.ZERO);
             }
             //入库状态
-            outboundItemVO.setOutStatus(outboundItemVO.getOutStatus());
+            outboundItemVO.setOutStatus(outboundVO.getOutStatus());
             //实体转换
             OutboundItem outboundItem = outboundItemConvert.convertToPo(outboundItemVO);
             outboundItemMapper.insert(outboundItem);

+ 3 - 11
src/main/java/com/dk/mdm/test/Test.java

@@ -25,22 +25,14 @@ public class Test {
 
 
     @org.junit.Test
-    public void accReceivable() {
+    public void acc() {
         accountService.accReceivable("10112024-0312-0000-0000-00000fd3a80b","t_psi_outbound");
-    }
-
-    @org.junit.Test
-    public void reverseReceivable() {
-        accountService.reverseReceivable("10112024-0312-0000-0000-00000fd3a80b","t_psi_outbound");
-    }
-
-    @org.junit.Test
-    public void accPayable() {
         accountService.accPayable("10112024-0308-0000-0000-00000d06fd8f","t_psi_inbound");
     }
 
     @org.junit.Test
-    public void reversePayable() {
+    public void reverse() {
+        accountService.reverseReceivable("10112024-0312-0000-0000-00000fd3a80b","t_psi_outbound");
         accountService.reversePayable("10112024-0308-0000-0000-00000d06fd8f","t_psi_inbound");
     }
 }