Commit ea09b65b authored by hongguangwu's avatar hongguangwu

MVP1.6.2-工资原表识别-主逻辑提交

parent f5ba3a81
......@@ -214,24 +214,28 @@ public class TSalaryStandardOriginalController {
}
// 上传附件
String fileName = System.currentTimeMillis() + "_" + file.getOriginalFilename();
String fileName = file.getOriginalFilename();
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String key = "original/" + fileName;
String key = "original/" + System.currentTimeMillis() + "_" + fileName;
boolean flag = ossUtil.uploadFileByStream(file.getInputStream(), key, null);
if (flag) {
char slash = '/';
char point = '.';
if (fileName.lastIndexOf(slash) >= 0) {
tSalaryStandardOriginal.setAttaName(key.substring(fileName.lastIndexOf(slash), fileName.length()));
} else {
tSalaryStandardOriginal.setAttaName(fileName);
if (fileName != null) {
if (fileName.lastIndexOf(slash) >= 0) {
tSalaryStandardOriginal.setAttaName(fileName.substring(fileName.lastIndexOf(slash)));
} else {
tSalaryStandardOriginal.setAttaName(fileName);
}
if (fileName.lastIndexOf(point) >= 0) {
tSalaryStandardOriginal.setAttaType(fileName.substring(fileName.lastIndexOf(point)));
} else {
tSalaryStandardOriginal.setAttaType(fileName);
}
}
tSalaryStandardOriginal.setAttaSize(file.getSize());
tSalaryStandardOriginal.setAttaSrc(key);
if (key.lastIndexOf(point) >= 0) {
tSalaryStandardOriginal.setAttaType(key.substring(fileName.lastIndexOf(point), fileName.length()));
}
} else {
return R.failed("failed:上传至存储空间失败");
}
......
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