Commit 2abdd07c authored by Shen's avatar Shen

1. 文件信息保存修改

2. 静态资源访问与swagger冲突修复
parent 1ec5f002
...@@ -36,7 +36,8 @@ public class WebMvcConfig implements WebMvcConfigurer { ...@@ -36,7 +36,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/swagger2/**").addResourceLocations("classpath:/swagger2/"); registry.addResourceHandler("/swagger2/**").addResourceLocations("classpath:/swagger2/");
registry.addResourceHandler("/static/**").addResourceLocations("file:D:/123/"); registry.addResourceHandler("/static/**").addResourceLocations("file:/home/websoft/java_jar/pension_service/myfile/");
// registry.addResourceHandler("/static/**").addResourceLocations("file:D:/123/");
} }
@Autowired @Autowired
......
...@@ -23,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -23,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
......
...@@ -62,12 +62,17 @@ public class PensionDocumentServiceImpl extends CrudServiceImpl<PensionDocumentD ...@@ -62,12 +62,17 @@ public class PensionDocumentServiceImpl extends CrudServiceImpl<PensionDocumentD
//保存文件信息 //保存文件信息
PensionDocumentEntity pensionDocumentEntity = new PensionDocumentEntity(); PensionDocumentEntity pensionDocumentEntity = new PensionDocumentEntity();
pensionDocumentEntity.setFileName(fileAct.getName()); String fileName = fileAct.getName();
pensionDocumentEntity.setFileName(fileName);
pensionDocumentEntity.setFilePath(file_path); pensionDocumentEntity.setFilePath(file_path);
pensionDocumentEntity.setFilePathAct(fileAct.getPath()); pensionDocumentEntity.setFilePathAct(fileAct.getPath());
pensionDocumentEntity.setFileSize(Double.parseDouble(String.valueOf(file.getSize()))); pensionDocumentEntity.setFileSize(Double.parseDouble(String.valueOf(file.getSize())));
pensionDocumentEntity.setFileType(file.getContentType()); pensionDocumentEntity.setFileType(file.getContentType());
pensionDocumentEntity.setStatus("1"); pensionDocumentEntity.setStatus("1");
// Integer fileLength = fileName.length();
// if (fileName.substring(fileLength-3, fileLength).equals("mp3")) {
// pensionDocumentEntity.setRemark("2");
// }
insert(pensionDocumentEntity); insert(pensionDocumentEntity);
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
......
...@@ -267,7 +267,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -267,7 +267,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
orderDocumentDTO.setOrderId(orderId); orderDocumentDTO.setOrderId(orderId);
orderDocumentDTO.setCreateDate(new Date()); orderDocumentDTO.setCreateDate(new Date());
RoleDTO roleDTO = roleService.get(roleId); /* RoleDTO roleDTO = roleService.get(roleId);
if(roleDTO != null && roleDTO.getName().contains("老人")){ if(roleDTO != null && roleDTO.getName().contains("老人")){
orderDocumentDTO.setRemark("3"); orderDocumentDTO.setRemark("3");
} }
...@@ -279,6 +279,11 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -279,6 +279,11 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
orderDocumentDTO.setRemark("2"); orderDocumentDTO.setRemark("2");
} }
}*/
if (item.toLowerCase().endsWith(".mp3")) {
orderDocumentDTO.setRemark("2");
} else {
orderDocumentDTO.setRemark("1");
} }
PensionOrderDocumentService.save(orderDocumentDTO); PensionOrderDocumentService.save(orderDocumentDTO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment