Exemplo n.º 1
0
 /** 撤销机构 */
 @Override
 public void terminate(Date date) {
   if (getTopOrganization().equals(this)) {
     throw new TerminateRootOrganizationException();
   }
   if (hasEmployees(date)) {
     throw new TerminateNotEmptyOrganizationException();
   }
   for (Post post : getPosts(date)) {
     post.terminate(date);
   }
   for (Organization child : getChildren(date)) {
     child.terminate(date);
   }
   super.terminate(date);
 }