/**
   * 删除入库单中的半成品
   *
   * @throws IOException
   */
  public String deleteBom() throws IOException {
    List<ZgTstorageCanclebomEx> bomECancleList =
        (List<ZgTstorageCanclebomEx>) this.getSession().getAttribute("bomECancleList");

    for (int i = 0; i < items.length; i++) {
      Hashtable params = HttpUtils.parseQueryString(items[i]);
      String cuid = (String) params.get("cuid");
      for (ZgTstorageCanclebomEx obj : bomECancleList) {
        if (cuid.equals(obj.getCuid())) {
          obj.setIsDel(true);
          obj.setIsModity(true);
          break;
        }
      }
    }

    this.getSession().setAttribute("bomECancleList", bomECancleList);

    // 保存bomIds到session中,用于页面展示可选bom的时候过滤
    String bomECancleIds = "";
    for (ZgTstorageCanclebomEx obj : bomECancleList) {
      if (!obj.getIsDel()) {
        bomECancleIds = bomECancleIds + obj.getStorageId() + obj.getOrderBomId() + ",";
      }
    }
    this.getSession().setAttribute("bomECancleIds", bomECancleIds);

    return SUCCESS;
  }
 /** 删除对象 */
 public String delete() {
   for (int i = 0; i < items.length; i++) {
     Hashtable params = HttpUtils.parseQueryString(items[i]);
     zgTorderPlanbomExBo.removeById((java.lang.String) params.get("id"));
   }
   return LIST_ACTION;
 }
Exemple #3
0
  /**
   * 批量 启用/停用 0/1
   *
   * @return
   */
  public String batchAble() {
    String message = "";
    for (int i = 0; i < items.length; i++) {
      Hashtable params = HttpUtils.parseQueryString(items[i]);
      String id = (String) params.get("id");
      User user = userManager.getById(id);

      // 超级管理员不允许禁用
      if (user.getLoginname() != null && user.getLoginname().equals("admin")) {
        message = "超级管理员禁止执行当前操作";
      } else {
        if (ableFlag != null && ableFlag.equals("enabled")) {
          if (user.getIsLeave().equals("0")) // 判断是否离职,如果已离职,则不允许启用该用户
          {
            message = "该员工已离职!不允许做操作!";
          } else {
            user.setAbledFlag("0");
          }
        }
        if (ableFlag != null && ableFlag.equals("disabled")) {
          user.setAbledFlag("1");
        }
        this.userManager.save(user);
      }
    }

    if (message != null && !message.equals("")) {
      Flash.current().success(message);
    } else {
      Flash.current().success(ADMIT_SUCCESS);
    }

    return LIST_ACTION;
  }
Exemple #4
0
  /**
   * 删除对象
   *
   * @return
   */
  public String delete() {

    String deleteMessage = "";
    for (int i = 0; i < items.length; i++) {
      Hashtable params = HttpUtils.parseQueryString(items[i]);
      String id = (String) params.get("id");
      User user = userManager.getById(id);

      try {
      } catch (Exception e) {
      }

      // 超级管理员禁止删除
      if (user.getLoginname() != null && user.getLoginname().equals("admin")) {
        deleteMessage = "超级管理员禁止删除";
      } else {
        // 删除时,置换删除标记
        user.setDf("1");
        // 删除人员时 需要把人员与角色的关系 以及管理员与分区的关系删除
        user.setRoles(new HashSet<Role>(0));
        user.setOuRelations(null);
        user.setPartitions(new HashSet<Partition>(0));

        userManager.delete(user);
      }
    }

    if (deleteMessage != null && !deleteMessage.equals("")) {
      Flash.current().success(deleteMessage);
    } else {
      Flash.current().success(DELETE_SUCCESS);
    }

    return LIST_ACTION;
  }
 /** 删除对象 */
 public String delBatch() {
   for (int i = 0; i < items.length; i++) {
     Hashtable params = HttpUtils.parseQueryString(items[i]);
     java.lang.Integer id = new java.lang.Integer((String) params.get("id"));
     noteSendManager.removeById(id);
   }
   Flash.current().success(DELETE_SUCCESS);
   return LIST_ACTION;
 }
 /** 删除对象 */
 public String delete() {
   for (int i = 0; i < items.length; i++) {
     Hashtable params = HttpUtils.parseQueryString(items[i]);
     java.lang.String id = new java.lang.String((String) params.get("id"));
     partition = (Partition) partitionManager.getById(id);
     partition.setDf("1");
     // 删除分区时,把分区与管理员的关系 分区与角色的关系删除
     //			partition.setApplications(new HashSet<Application>(0));
     //			partition.setUsers(new HashSet<User>(0));
     partition.setOrganizations(new HashSet<Organization>(0));
     List roles = roleManager.findAllByDf("partitionId", partition.getId());
     if (!roles.isEmpty() && roles.size() > 0) {
       Flash.current().error("分区" + partition.getName() + "下已经有角色等数据,不能删除!");
       return LIST_ACTION;
     }
     partitionManager.update(this.partition);
   }
   Flash.current().success(DELETE_SUCCESS);
   return LIST_ACTION;
 }
 /** 删除草稿 */
 public String removeDraf() {
   for (int i = 0; i < items.length; i++) {
     Hashtable params = HttpUtils.parseQueryString(items[i]);
     String id = (String) params.get("id");
     List<Attachment> attachments = attachmentManager.findAllBy("refId", id);
     if (attachments != null && !attachments.isEmpty()) {
       getRequest().setAttribute("attachments", attachments);
       for (Attachment attachment : attachments) {
         attachmentManager.delete(attachment);
         String fileName = attachment.getFilePath(); // 得到文件路径
         File file = new File(fileName);
         if (file.exists()) {
           file.delete();
         }
       }
     }
     this.messageManager.removeById(id);
   }
   return "draftAction";
 }
  /**
   * 为入库冲单生成入生成半成品
   *
   * @throws IOException
   */
  public void generateBom() throws IOException {
    List<ZgTstorageCanclebomEx> bomECancleList =
        (List<ZgTstorageCanclebomEx>) this.getSession().getAttribute("bomECancleList");

    for (int i = 0; i < items.length; i++) {
      Hashtable params = HttpUtils.parseQueryString(items[i]);
      ZgTstorageCanclebomEx obj = new ZgTstorageCanclebomEx();
      String cuid = zgTorderPlanbomExBo.getCUID();
      obj.setCuid(cuid);
      obj.setAufnr((java.lang.String) params.get("aufnr"));

      obj.setArbpl((java.lang.String) params.get("arbpl"));
      obj.setStorageId((java.lang.String) params.get("storageId"));
      obj.setMatnr((java.lang.String) params.get("matnr"));
      obj.setIdnrk((java.lang.String) params.get("idnrk"));
      obj.setMsehl1((java.lang.String) params.get("msehl1"));
      obj.setAllNum(Double.parseDouble((java.lang.String) params.get("allNum")));
      obj.setNum(Double.parseDouble((java.lang.String) params.get("allNum")));
      obj.setOrderBomId((java.lang.String) params.get("orderBomId"));
      obj.setStorageCancleId((java.lang.String) params.get("storageCancleId"));
      obj.setLgort((String) params.get("lgort"));
      obj.setIsModity(true);
      bomECancleList.add(obj);
    }
    this.getSession().setAttribute("bomECancleList", bomECancleList);

    // 保存bomIds到session中,用于页面展示可选bom的时候过滤
    String bomECancleIds = "";
    for (ZgTstorageCanclebomEx obj : bomECancleList) {
      if (!obj.getIsDel()) {
        bomECancleIds = bomECancleIds + obj.getStorageId() + obj.getOrderBomId() + ",";
      }
    }
    this.getSession().setAttribute("bomECancleIds", bomECancleIds);

    returnMsgAndCloseWindow("操作成功");
  }