Commit 2abdd07c authored by Shen's avatar Shen

1. 文件信息保存修改

2. 静态资源访问与swagger冲突修复
parent 1ec5f002
......@@ -36,7 +36,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
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
......
......@@ -23,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
......
......@@ -62,12 +62,17 @@ public class PensionDocumentServiceImpl extends CrudServiceImpl<PensionDocumentD
//保存文件信息
PensionDocumentEntity pensionDocumentEntity = new PensionDocumentEntity();
pensionDocumentEntity.setFileName(fileAct.getName());
String fileName = fileAct.getName();
pensionDocumentEntity.setFileName(fileName);
pensionDocumentEntity.setFilePath(file_path);
pensionDocumentEntity.setFilePathAct(fileAct.getPath());
pensionDocumentEntity.setFileSize(Double.parseDouble(String.valueOf(file.getSize())));
pensionDocumentEntity.setFileType(file.getContentType());
pensionDocumentEntity.setStatus("1");
// Integer fileLength = fileName.length();
// if (fileName.substring(fileLength-3, fileLength).equals("mp3")) {
// pensionDocumentEntity.setRemark("2");
// }
insert(pensionDocumentEntity);
Map<String, Object> result = new HashMap<>();
......
......@@ -267,7 +267,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
orderDocumentDTO.setOrderId(orderId);
orderDocumentDTO.setCreateDate(new Date());
RoleDTO roleDTO = roleService.get(roleId);
/* RoleDTO roleDTO = roleService.get(roleId);
if(roleDTO != null && roleDTO.getName().contains("老人")){
orderDocumentDTO.setRemark("3");
}
......@@ -279,6 +279,11 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
orderDocumentDTO.setRemark("2");
}
}*/
if (item.toLowerCase().endsWith(".mp3")) {
orderDocumentDTO.setRemark("2");
} else {
orderDocumentDTO.setRemark("1");
}
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