diff --git a/warehousing-system/project/wh-manage/src/main/java/com/wh/config/FileUploadConfig.java b/warehousing-system/project/wh-manage/src/main/java/com/wh/config/FileUploadConfig.java
new file mode 100644
index 00000000..fa01c9dd
--- /dev/null
+++ b/warehousing-system/project/wh-manage/src/main/java/com/wh/config/FileUploadConfig.java
@@ -0,0 +1,29 @@
+package com.wh.config;
+
+import org.springframework.boot.web.servlet.MultipartConfigFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.util.unit.DataSize;
+
+import javax.servlet.MultipartConfigElement;
+
+/**
+ * 文件上传配置类
+ *
+ * @Author mashanghaoyun
+ * @Date 2020/11/11 01:34
+ * @Version 1.0
+ **/
+@Configuration
+public class FileUploadConfig {
+ @Bean
+ public MultipartConfigElement multipartConfigElement() {
+ MultipartConfigFactory factory = new MultipartConfigFactory();
+ // 单个数据大小
+ factory.setMaxFileSize(DataSize.parse("502400KB")); // KB,MB
+ // 总上传数据大小
+ factory.setMaxRequestSize(DataSize.parse("1024000KB"));
+ return factory.createMultipartConfig();
+ }
+
+}
diff --git a/warehousing-system/project/wh-manage/src/main/java/com/wh/controller/shstorehouse/ShStorehouseRest.java b/warehousing-system/project/wh-manage/src/main/java/com/wh/controller/shstorehouse/ShStorehouseRest.java
index 94036fb4..20f01653 100644
--- a/warehousing-system/project/wh-manage/src/main/java/com/wh/controller/shstorehouse/ShStorehouseRest.java
+++ b/warehousing-system/project/wh-manage/src/main/java/com/wh/controller/shstorehouse/ShStorehouseRest.java
@@ -147,7 +147,9 @@ public class ShStorehouseRest {
File file1 = new File(filePath);
if (!file1.exists()) file1.mkdirs(); // 要是目录不存在,创建一个
file.transferTo(file1); // 保存起来
- urlPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/archive/" + suffix + newFileName;
+ //urlPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/archive/" + suffix + newFileName;
+
+ urlPath = "http://jianguan.yyundong.com/warehouseapi/archive/" + suffix + newFileName;
} catch (Exception e) {
e.printStackTrace();
}
@@ -173,7 +175,8 @@ public class ShStorehouseRest {
File file1 = new File(filePath);
if (!file1.exists()) file1.mkdirs(); // 要是目录不存在,创建一个
file.transferTo(file1); // 保存起来
- urlPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/archive/" + suffix + newFileName;
+ //urlPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/archive/" + suffix + newFileName;
+ urlPath = "http://jianguan.yyundong.com/warehouseapi/archive/" + suffix + newFileName;
// dto.setStorehouseSid(); // 库房sid
// dto.setStorehouseName(); // 库房名称
diff --git a/warehousing-system/project/wh-manage/src/main/java/com/wh/service/shstorehouse/ShStorehouseService.java b/warehousing-system/project/wh-manage/src/main/java/com/wh/service/shstorehouse/ShStorehouseService.java
index 574b66d0..a6d5f23d 100644
--- a/warehousing-system/project/wh-manage/src/main/java/com/wh/service/shstorehouse/ShStorehouseService.java
+++ b/warehousing-system/project/wh-manage/src/main/java/com/wh/service/shstorehouse/ShStorehouseService.java
@@ -50,9 +50,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
/**
* Project: yxt_supervise(宇信通监管)
@@ -71,6 +69,7 @@ import java.util.Map;
public class ShStorehouseService extends MybatisBaseService {
@Autowired
private FileUploadComponent fileUploadComponent;
+ @Autowired
private ShStorehouseAttachmentService shStorehouseAttachmentService;
private QueryWrapper createQueryWrapper(ShStorehouseQuery query) {
// todo: 这里根据具体业务调整查询条件
@@ -104,12 +103,11 @@ public class ShStorehouseService extends MybatisBaseService shStorehouseAttachmentVos=new ArrayList<>();
+ if (StringUtils.isNotBlank(dtoSid)) {
+ shStorehouseAttachmentVos= shStorehouseAttachmentService.fetchDetailsVoByShSid(dtoSid);
+ }
+ Map picsmap2=new HashMap<>();
+ for (ShStorehouseAttachmentVo shStorehouseAttachmentVo : shStorehouseAttachmentVos) {
+ picsmap2.put(shStorehouseAttachmentVo.getSid(),shStorehouseAttachmentVo.getSid());
+ }
+
ShStorehouse entity = fetchBySid(dtoSid);
String provinceName = dto.getProvinceName();
String cityName = dto.getCityName();
@@ -146,12 +153,25 @@ public class ShStorehouseService extends MybatisBaseService pics = dto.getPics();
+ Map picsmap=new HashMap<>();
+ for (String pic : pics) {
+ picsmap.put(pic,pic);
+ }
+
+ Set> entries = picsmap2.entrySet();
+ for (Map.Entry entry : entries) {
+ String key = entry.getKey();
+ if(picsmap.get(key)==null){
+ shStorehouseAttachmentService.deleteBySid(key);
+ }
+ }
for (String pic : pics) {
+
ShStorehouseAttachmentDetailsVo shStorehouseAttachmentDetailsVo = shStorehouseAttachmentService.fetchDetailsVoBySid(pic);
shStorehouseAttachmentDetailsVo.setStorehouseSid(entity.getSid());
shStorehouseAttachmentDetailsVo.setStorehouseName(entity.getName());
ShStorehouseAttachmentDto picdto=new ShStorehouseAttachmentDto();
- BeanUtil.copyProperties(pic,picdto);
+ BeanUtil.copyProperties(shStorehouseAttachmentDetailsVo,picdto);
shStorehouseAttachmentService.updateByDto(picdto);
}
baseMapper.updateById(entity);
@@ -160,7 +180,7 @@ public class ShStorehouseService extends MybatisBaseService pics=shStorehouseAttachmentService.fetchDetailsVoByShSid(sid);
BeanUtil.copyProperties(entity, vo);
diff --git a/warehousing-system/project/wh-manage/src/main/resources/application.yml b/warehousing-system/project/wh-manage/src/main/resources/application.yml
index eb90bf78..4e7e941e 100644
--- a/warehousing-system/project/wh-manage/src/main/resources/application.yml
+++ b/warehousing-system/project/wh-manage/src/main/resources/application.yml
@@ -4,7 +4,7 @@ server:
context-path: /
multipart:
enabled: true
- max-file-size: 20MB
+ max-file-size: 50MB
max-request-size: 200MB
spring:
application: