|
|
|
@ -153,6 +153,20 @@ public class SysFileController extends BaseController<SysFileService, SysFile, S |
|
|
|
|
return mav; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/update") |
|
|
|
|
public Result<SysFile> save(SysFile sysFile) throws Exception { |
|
|
|
|
//自动编号,每天从一开始
|
|
|
|
|
String curDate = new SimpleDateFormat("yyyyMMdd").format(new Date()); |
|
|
|
|
if("".equals(LAST_DATE) || curDate.compareTo(LAST_DATE) > 0){ |
|
|
|
|
LAST_DATE = curDate; |
|
|
|
|
counter = new Counter(); |
|
|
|
|
} |
|
|
|
|
SysFile byId = sysFileService.getById(sysFile.getId()); |
|
|
|
|
sysFile.setFileNumber(byId.getFileNumber()); |
|
|
|
|
sysFile.setFileCode(createFileCode(sysFile)); |
|
|
|
|
return sysFileService.updateOrSave(sysFile); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 文件上传 |
|
|
|
|
* |
|
|
|
@ -328,8 +342,8 @@ public class SysFileController extends BaseController<SysFileService, SysFile, S |
|
|
|
|
sb.append("0").append("+"); |
|
|
|
|
} |
|
|
|
|
//资料类型,文件后缀大写
|
|
|
|
|
if(!StringUtils.isEmpty(file.getFileFullName())){ |
|
|
|
|
String fullName = file.getFileFullName(); |
|
|
|
|
if(!StringUtils.isEmpty(file.getFileName())){ |
|
|
|
|
String fullName = file.getFileName(); |
|
|
|
|
sb.append(fullName.substring(fullName.lastIndexOf(".")+1).toUpperCase()).append("+"); |
|
|
|
|
}else{ |
|
|
|
|
sb.append("0").append("+"); |
|
|
|
@ -339,6 +353,7 @@ public class SysFileController extends BaseController<SysFileService, SysFile, S |
|
|
|
|
for(int i=0;i<objects.size();i++){ |
|
|
|
|
if(file.getFileFullName().equals(objects.getJSONObject(i).getString("name"))){ |
|
|
|
|
file.setFileNumber(objects.getJSONObject(i).getString("number")); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|