private DTOSet getSystemIds(HttpServletRequest req) throws UploadException {
   DTOSet dtos = new DTOSet();
   try {
     CheckBoxProp checkProp = new CheckBoxProp("subCheck");
     checkProp.setIgnoreOtherField(true);
     RequestParser reqParser = new RequestParser();
     reqParser.setCheckBoxProp(checkProp);
     reqParser.transData(req);
     String[] exarr = reqParser.getParameterValues("systemId");
     if (exarr != null) {
       TfEtsItemMatchRecDTO dto;
       String inarr;
       for (int i = 0; i < exarr.length; i++) {
         inarr = exarr[i];
         if (inarr != null && !inarr.equals("")) {
           dto = new TfEtsItemMatchRecDTO();
           dto.setSystemId(inarr);
           dtos.addDTO(dto);
         }
       }
     }
   } catch (StrException ex) {
     ex.printLog();
     throw new UploadException(ex);
   } catch (DTOException ex) {
     ex.printLog();
     throw new UploadException(ex);
   }
   return dtos;
 }
 public void performTask(HttpServletRequest req, HttpServletResponse res)
     throws ServletException, IOException {
   String forwardURL = "";
   Message message = null;
   Connection conn = null;
   res.setContentType(sContentType);
   try {
     conn = DBManager.getDBConnection();
     SfUserDTO userAccount = (SfUserDTO) SessionUtil.getUserAccount(req);
     Logger.logInfo("Excel submit servlet begin....");
     RequestParser reqPar = new RequestParser();
     reqPar.transData(req);
     UploadFile[] upFiles = null;
     UploadRow uploadRow;
     String conFilePath = PDAUtil.getCurUploadFilePath(conn);
     UploadFileSaver uploadFileSaver = reqPar.getFileSaver();
     uploadFileSaver.saveFiles(conFilePath);
     uploadRow = uploadFileSaver.getRow();
     upFiles = uploadRow.getFiles();
     if (upFiles == null) {
       return;
     } else if (upFiles.length != 1 || upFiles[0].getFileName().equals("")) {
       return;
     }
     UploadFile uploadFile = upFiles[0];
     String fileName = uploadFile.getAbsolutePath();
     fileName = fileName.replaceAll("\\\\", "/");
     forwardURL = "/public/windowClose.jsp?retValue=" + fileName;
   } catch (PoolException e) {
     e.printStackTrace();
   } catch (UploadException e) {
     e.printStackTrace();
   } catch (FileSizeException e) {
     e.printStackTrace();
   } catch (ContainerException e) {
     e.printStackTrace();
   } finally {
     DBManager.closeDBConnection(conn);
     setHandleMessage(req, message);
     ServletForwarder forwarder = new ServletForwarder(req, res);
     forwarder.forwardView(forwardURL);
   }
 }
 private DTOSet getCheckedAssets(HttpServletRequest req, String matchType)
     throws ServletException {
   DTOSet dtos = new DTOSet();
   try {
     RequestParser parser = new RequestParser();
     CheckBoxProp checkProp = new CheckBoxProp("subCheck");
     checkProp.setIgnoreOtherField(true);
     parser.setCheckBoxProp(checkProp);
     parser.transData(req);
     String[] systemids = parser.getParameterValues("systemId");
     String[] assetIds = parser.getParameterValues("assetId");
     if (systemids != null) {
       int checkedCount = systemids.length;
       for (int i = 0; i < checkedCount; i++) {
         TfEtsItemMatchRecDTO dto = new TfEtsItemMatchRecDTO();
         dto.setSystemId(systemids[i]);
         dto.setAssetId(assetIds[i]);
         dto.setMatchType(matchType);
         // String flag = req.getParameter("unyokeFlag");
         String flag = "1";
         if (flag.equals("1")) { // 资产匹配撤销
           dto.setOldFinanceProp(DictConstant.FIN_PROP_ASSETS);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_UNKNOW);
         } else if (flag.equals("0")) { // 转资匹配撤销
           dto.setOldFinanceProp(DictConstant.FIN_PROP_ASSETS);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_PRJ);
         }
         dtos.addDTO(dto);
       }
     }
   } catch (UploadException ex) {
     ex.printLog();
     throw new ServletException(ex);
   } catch (StrException ex) {
     ex.printLog();
     throw new ServletException(ex);
   } catch (DTOException ex) {
     ex.printLog();
     throw new ServletException(ex);
   }
   return dtos;
 }
  /**
   * @param req HttpServletRequest
   * @param res HttpServletResponse
   * @throws ServletException
   * @throws IOException
   */
  public void performTask(HttpServletRequest req, HttpServletResponse res)
      throws ServletException, IOException {
    String forwardURL = "";
    Message message = SessionUtil.getMessage(req);
    Connection conn = null;
    try {
      SfUserDTO user = (SfUserDTO) SessionUtil.getUserAccount(req);
      Request2DTO req2DTO = new Request2DTO();
      req2DTO.setDTOClassName(EamDhCheckLineDTO.class.getName());
      EamDhCheckLineDTO dto = (EamDhCheckLineDTO) req2DTO.getDTO(req);
      String action = dto.getAct();
      conn = getDBConnection(req);
      if (action.equals("")) {
        req.setAttribute(QueryConstant.QUERY_DTO, dto);
        forwardURL = LvecURLs.INS_CONFIRM_PAGE;
      } else if (action.equals(DzyhActionConstant.QUERY_ACTION)) {
        BaseSQLProducer sqlProducer = new OrderLineConfirmModel(user, dto);
        PageQueryDAO pageDAO = new PageQueryDAO(req, conn, sqlProducer);
        pageDAO.setDTOClassName(EamDhCheckLineDTO.class.getName());
        pageDAO.setCalPattern(LINE_PATTERN);

        CheckBoxProp checkProp = new CheckBoxProp("subCheck");
        checkProp.addDbField("HEADER_ID");
        checkProp.addDbField("BARCODE");
        checkProp.addDbField("CATALOG_VALUE_ID");
        checkProp.addDbField("RESPONSIBILITY_USER");
        checkProp.addDbField("RESPONSIBILITY_DEPT");
        checkProp.addDbField("ORDER_NO");

        pageDAO.setWebCheckProp(checkProp);
        pageDAO.produceWebData();

        req.setAttribute(QueryConstant.QUERY_DTO, dto);
        forwardURL = LvecURLs.INS_CONFIRM_PAGE;
      } else if (action.equals(DzyhActionConstant.CONFIRM_ACTION)) { // 确认
        if (user.getEmployeeNumber().equals("")) {
          message = getMessage(LvecMessageKeys.NO_EMPLOYEE_NUMBER);
          message.setIsError(true);
          message.setNeedBack(true);
          forwardURL = MessageConstant.MSG_PRC_SERVLET;
        } else {
          RequestParser parser = new RequestParser();
          CheckBoxProp checkProp = new CheckBoxProp("subCheck");
          checkProp.setIgnoreOtherField(true);
          parser.setCheckBoxProp(checkProp);
          parser.transData(req);

          req2DTO.setIgnoreFields(EamCheckTaskDTO.class);
          req2DTO.addIgnoreField("itemName");
          //					req2DTO.addIgnoreField("orderNo");

          DTOSet orderLines = req2DTO.getDTOSet(parser);
          InstruConfirmDAO confirmDAO = new InstruConfirmDAO(user, dto, conn);

          confirmDAO.ConfirmInstrument(orderLines);
          message = confirmDAO.getMessage();
          forwardURL = LvecURLs.INS_CONFIRM_SERVLET;
          forwardURL += "?act=" + DzyhActionConstant.QUERY_ACTION;
        }
      } else {
        message = getMessage(MsgKeyConstant.INVALID_REQ);
        message.setIsError(true);
        forwardURL = MessageConstant.MSG_PRC_SERVLET;
      }
    } catch (PoolPassivateException ex) {
      ex.printLog();
      message = getMessage(MsgKeyConstant.POOL_PASSIVATE_ERROR);
      message.setIsError(true);
      forwardURL = MessageConstant.MSG_PRC_SERVLET;
    } catch (DTOException ex) {
      ex.printLog();
      message = getMessage(MsgKeyConstant.DTO_ERROR);
      message.setIsError(true);
      forwardURL = MessageConstant.MSG_PRC_SERVLET;
    } catch (QueryException ex) {
      ex.printLog();
      message = getMessage(MsgKeyConstant.QUERY_ERROR);
      message.setIsError(true);
      forwardURL = MessageConstant.MSG_PRC_SERVLET;
    } catch (UploadException ex) {
      ex.printLog();
      message = getMessage(MsgKeyConstant.COMMON_ERROR);
      message.setIsError(true);
      forwardURL = MessageConstant.MSG_PRC_SERVLET;
    } catch (StrException ex) {
      ex.printLog();
      message = getMessage(MsgKeyConstant.COMMON_ERROR);
      message.setIsError(true);
      forwardURL = MessageConstant.MSG_PRC_SERVLET;
    } catch (DataHandleException ex) {
      ex.printLog();
      message = getMessage(MsgKeyConstant.SQL_ERROR);
      message.setIsError(true);
      forwardURL = MessageConstant.MSG_PRC_SERVLET;
    } finally {
      DBManager.closeDBConnection(conn);
      setHandleMessage(req, message);
      if (!forwardURL.equals("")) {
        ServletForwarder forwarder = new ServletForwarder(req, res);
        forwarder.forwardView(forwardURL);
      }
    }
  }
 private DTOSet getDTOs(HttpServletRequest req, String matchType) throws UploadException {
   DTOSet dtos = new DTOSet();
   try {
     RequestParser reqParser = new RequestParser();
     reqParser.transData(req);
     String[] exarr = reqParser.getParameterValues("systemId");
     //            String[] arr = reqParser.getParameterValues("assetId");
     if (exarr != null) {
       int exLength = exarr.length;
       for (int i = 0; i < exLength; i++) {
         TfEtsItemMatchRecDTO dto = new TfEtsItemMatchRecDTO();
         dto.setSystemId(exarr[i]);
         //                    dto.setAssetId(arr[i]);
         if (matchType.equals(WebAttrConstant.MATCH_MODE_SPARE)) { // 备件确认
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_SPARE);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_SPARE_RET)) { // 撤销备件关系
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_SPARE);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_PRJMTL)) { // 工程物资确认
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_PRJ);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_PRJMTL_RET)) { // 撤销工程物资匹配关系
           //                        dto.setAssetId(arr[i]);
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_PRJ);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_OTHER)) { // 设备屏蔽
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_OTHER);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_0THER_RET)) { // 撤销设备屏蔽
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_OTHER);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_RENT)) { // 租赁资产确认
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_RENT);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_RENT_RET)) { // 租赁资产撤销
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_RENT);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_DG)) { // 代管资产确认
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_DG);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_DG_RET)) { // 代管资产撤销
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_DG);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_LC)) { // 低值易耗资产确认
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_DH);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_LC_RET)) { // 低值易耗资产撤销
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_DH);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_TD)) { // TD资产确认
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_TD);
           dtos.addDTO(dto);
         } else if (matchType.equals(WebAttrConstant.MATCH_MODE_TD_RET)) { // TD资产撤销
           dto.setMatchType(matchType);
           dto.setOldFinanceProp(DictConstant.FIN_PROP_TD);
           dto.setNewFinanceProp(DictConstant.FIN_PROP_UNKNOW);
           dtos.addDTO(dto);
         }
         //                    else if
         // (matchType.equals(WebAttrConstant.MATHC_MODE_CHANGED_ASSETS_RET)) { // 撤消资产匹配关系操作
         //                        dto.setMatchType(matchType);
         //                        String flag = req.getParameter("unyokeFlag");
         //                        if (flag.equals("1")) {                   //资产匹配撤销
         //                            dto.setOldFinanceProp(DictConstant.FIN_PROP_ASSETS);
         //                            dto.setNewFinanceProp(DictConstant.FIN_PROP_UNKNOW);
         //                            dtos.addDTO(dto);
         //                        } else if (flag.equals("0")) {            //转资匹配撤销
         //                            dto.setOldFinanceProp(DictConstant.FIN_PROP_ASSETS);
         //                            dto.setNewFinanceProp(DictConstant.FIN_PROP_PRJ);
         //                            dtos.addDTO(dto);
         //                        }
         //                    }
       }
     }
   } catch (DTOException ex) {
     ex.printLog();
     throw new UploadException(ex);
   }
   return dtos;
 }