|
@@ -77,14 +77,14 @@ class ActionCreate extends BaseAction {
|
|
|
if (!business.editable(effectivePerson, null)) {
|
|
if (!business.editable(effectivePerson, null)) {
|
|
|
throw new ExceptionApplicationAccessDenied(effectivePerson.getName(), wi.getName(), wi.getId());
|
|
throw new ExceptionApplicationAccessDenied(effectivePerson.getName(), wi.getName(), wi.getId());
|
|
|
}
|
|
}
|
|
|
- Application application = this.create(business, wi);
|
|
|
|
|
|
|
+ Application application = this.create(business, wi, effectivePerson);
|
|
|
wo.setId(application.getId());
|
|
wo.setId(application.getId());
|
|
|
result.setData(wo);
|
|
result.setData(wo);
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private Application create(Business business, Wi wi) throws Exception {
|
|
|
|
|
|
|
+ private Application create(Business business, Wi wi, EffectivePerson effectivePerson) throws Exception {
|
|
|
List<JpaObject> persistObjects = new ArrayList<>();
|
|
List<JpaObject> persistObjects = new ArrayList<>();
|
|
|
Application application = business.entityManagerContainer().find(wi.getId(), Application.class);
|
|
Application application = business.entityManagerContainer().find(wi.getId(), Application.class);
|
|
|
if (null != application) {
|
|
if (null != application) {
|
|
@@ -154,6 +154,8 @@ class ActionCreate extends BaseAction {
|
|
|
throw new ExceptionEntityExistForCreate(wrapProcess.getId(), Process.class);
|
|
throw new ExceptionEntityExistForCreate(wrapProcess.getId(), Process.class);
|
|
|
}
|
|
}
|
|
|
process = WrapProcess.inCopier.copy(wrapProcess);
|
|
process = WrapProcess.inCopier.copy(wrapProcess);
|
|
|
|
|
+ process.setLastUpdatePerson(effectivePerson.getDistinguishedName());
|
|
|
|
|
+ process.setLastUpdateTime(new Date());
|
|
|
process.setApplication(application.getId());
|
|
process.setApplication(application.getId());
|
|
|
persistObjects.add(process);
|
|
persistObjects.add(process);
|
|
|
if (StringUtils.isNotEmpty(process.getEdition())) {
|
|
if (StringUtils.isNotEmpty(process.getEdition())) {
|
|
@@ -161,7 +163,6 @@ class ActionCreate extends BaseAction {
|
|
|
for (Process p : business.entityManagerContainer().listEqualAndEqual(Process.class, Process.application_FIELDNAME,
|
|
for (Process p : business.entityManagerContainer().listEqualAndEqual(Process.class, Process.application_FIELDNAME,
|
|
|
process.getApplication(), Process.edition_FIELDNAME, process.getEdition())) {
|
|
process.getApplication(), Process.edition_FIELDNAME, process.getEdition())) {
|
|
|
if (!process.getId().equals(p.getId()) && BooleanUtils.isTrue(p.getEditionEnable())) {
|
|
if (!process.getId().equals(p.getId()) && BooleanUtils.isTrue(p.getEditionEnable())) {
|
|
|
- p.setLastUpdateTime(new Date());
|
|
|
|
|
p.setEditionEnable(false);
|
|
p.setEditionEnable(false);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|