|
@@ -70,13 +70,15 @@ public class PaperStructService {
|
|
|
* @return
|
|
|
*/
|
|
|
public PaperStruct save(PaperStruct paperStruct, AccessUser user) {
|
|
|
- PaperStruct oldPaperStruct = paperStructRepo.findOne(paperStruct.getId());
|
|
|
- PaperStruct rps = null;
|
|
|
- if (oldPaperStruct != null && !paperStruct.getName().equals(oldPaperStruct.getName())) {// 那么就是更新操作
|
|
|
- rps = this.checkNameUnique(paperStruct.getName(), user.getOrgId().toString());
|
|
|
- }
|
|
|
- if (rps != null) {
|
|
|
- return null;
|
|
|
+ if (StringUtils.isNotBlank(paperStruct.getId())) {
|
|
|
+ PaperStruct oldPaperStruct = paperStructRepo.findOne(paperStruct.getId());
|
|
|
+ PaperStruct rps = null;
|
|
|
+ if (oldPaperStruct != null && !paperStruct.getName().equals(oldPaperStruct.getName())) {// 那么就是更新操作
|
|
|
+ rps = this.checkNameUnique(paperStruct.getName(), user.getOrgId().toString());
|
|
|
+ }
|
|
|
+ if (rps != null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
List<PaperDetailStruct> paperDetailStructs = paperStruct.getPaperDetailStructs();
|
|
|
int number = 0;
|