提交 a83277ae 编写于 作者: O o2null

Merge branch 'fix/根据WorkCompleted查询工作时异常' into 'wrdp'

[流程平台]修复根据work查询附件传入workCompleteId参数时异常

See merge request o2oa/o2oa!2441
......@@ -13,8 +13,6 @@ import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.tools.ListTools;
import com.x.processplatform.assemble.surface.Business;
import com.x.processplatform.core.entity.content.Attachment;
import com.x.processplatform.core.entity.content.Work;
import com.x.processplatform.core.entity.content.WorkCompleted;
import java.util.List;
......@@ -23,20 +21,13 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
ActionResult<Wo> result = new ActionResult<>();
Business business = new Business(emc);
Work work = emc.find(workId, Work.class);
if(work == null){
WorkCompleted workCompleted = emc.find(workId, WorkCompleted.class);
if (null == workCompleted) {
throw new ExceptionEntityNotExist(workId, Work.class);
}
}
Attachment attachment = emc.find(id, Attachment.class);
if (null == attachment) {
throw new ExceptionEntityNotExist(id, Attachment.class);
}
if (!business.readableWithWorkOrWorkCompleted(effectivePerson, work.getId(),
new ExceptionEntityNotExist(work.getId()))) {
if (!business.readableWithWorkOrWorkCompleted(effectivePerson, workId,
new ExceptionEntityNotExist(workId))) {
throw new ExceptionAccessDenied(effectivePerson);
}
......@@ -157,4 +148,4 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
}
return value;
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册