예제 #1
0
 public static Set<String> getUsersByWorkGroup(Set<Workgroup> workgroupSet) {
   Set<String> userNames = new HashSet<String>();
   for (Workgroup workGroup : workgroupSet) {
     userNames.addAll(
         getUserLoginName(ApiFactory.getAcsService().getUsersByWorkgroupId(workGroup.getId())));
   }
   return userNames;
 }
 /** 新建工作组 */
 @Action("work-group-inputWorkGroup")
 public String inputWorkGroup() throws Exception {
   companyId = companyManager.getCompanyId();
   if (workGroup.getId() == null) {
     workGroup.setCode(createWorkGroupCode());
     workGroup.setSubCompanyId(branchesId);
   }
   return "work-group-input";
 }
 private boolean validateOnly(List<Workgroup> workgroupList, Long id) {
   boolean repeat = false;
   if (id == null) {
     if (workgroupList != null && workgroupList.size() > 0) {
       repeat = true;
     }
   } else {
     for (Workgroup w : workgroupList) {
       if (!id.equals(w.getId())) {
         repeat = true;
         break;
       }
     }
   }
   return repeat;
 }
 @Override
 @Action("work-group-delete")
 public String delete() throws Exception {
   String logSign = ""; // 该字段只是为了标识日志信息:工作组名称
   String[] str = ides.split(",");
   for (String sid : str) {
     workGroup = workGroupManager.getWorkGroup(Long.valueOf(sid));
     workGroupManager.cleanWorkGroup(workGroup.getId());
     if (StringUtils.isNotEmpty(logSign)) {
       logSign += ",";
     }
     logSign += workGroup.getName();
     workGroupManager.deleteWorkGroup(Long.valueOf(sid));
   }
   ApiFactory.getBussinessLogService()
       .log("工作组管理", "删除工作组:" + logSign, ContextUtils.getSystemId("acs"));
   this.renderText("ok");
   return null;
 }