Commit 6043849c by wang_jiaxing

版本更新文件上传修改

parent eb16b7fe
......@@ -92,29 +92,31 @@ public class AppBbgxServiceImpl extends ServiceImpl<AppBbgxMapper, AppBbgx> impl
}
}
File oldFile = new File(bbgxfjPath + File.separator + fileName);
if (oldFile.exists()) {
// String suffix = "." + FilenameUtils.getExtension(fileName);
String dzwjmc = DateUtil.getSysDateStr() + "_" + fileName;
String dzwjwz = bbgxfjPath + File.separator + dzwjmc;
File newFile = new File(bbgxfjPath + File.separator + dzwjmc);
if (!newFile.exists()) {
boolean b = oldFile.renameTo(newFile);
// String suffix = "." + FilenameUtils.getExtension(fileName);
String dzwjmc = DateUtil.getSysDateStr() + "_" + fileName;
String dzwjwz = bbgxfjPath + File.separator + dzwjmc;
File newFile = new File(bbgxfjPath + File.separator + dzwjmc);
if (!newFile.exists()) {
int insert;
try {
insert = appBbgxMapper.insert(bbgx);
boolean b = true;
if (oldFile.exists()) {
b = oldFile.renameTo(newFile);
}
if (b) {
file.transferTo(new File(bbgxfjPath + File.separator, fileName));
bbgx.setAppGxwjwz(dzwjwz);
bbgx.setFilename(dzwjmc);
int insert;
try {
insert = appBbgxMapper.insert(bbgx);
} catch (Exception e) {
e.printStackTrace();
insert = 0;
}
if (insert == 0) {
return null;
}
}
} catch (Exception e) {
e.printStackTrace();
insert = 0;
}
if (insert == 0) {
return null;
}
}
return version;
}
......
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