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;
 }
Example #2
0
 private DTOSet filterDtoSet(DTOSet ds) {
   DTOSet returnds = new DTOSet();
   for (int i = 0; i < ds.getSize(); i++) {
     SBHRHRInquiryOrgStructureDTO dto = (SBHRHRInquiryOrgStructureDTO) ds.getDTO(i);
     if (dto.getOrganizationName().indexOf("OU_") < 0
         && dto.getOrganizationName().indexOf("IO_") < 0
         && dto.getOrganizationName().indexOf("IA_") < 0
         && dto.getOrganizationName().indexOf("LA_") < 0) {
       try {
         returnds.addDTO(dto);
       } catch (DTOException e) {
         e.printLog();
       }
     }
   }
   return returnds;
 }
 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;
 }
Example #4
0
 /**
  * @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(AmsYjItemDTO.class.getName());
     AmsYjItemDTO dtoParameter = (AmsYjItemDTO) req2DTO.getDTO(req);
     String action = dtoParameter.getAct();
     conn = getDBConnection(req);
     AmsYjItemDAO amsYjItemDAO = new AmsYjItemDAO(user, dtoParameter, conn);
     if (action.equals("")) {
       forwardURL = "/yj/yjItemSearch.jsp";
     } else if (action.equals(WebActionConstant.QUERY_ACTION)) {
       BaseSQLProducer sqlProducer = new AmsYjItemModel(user, dtoParameter);
       PageQueryDAO pageDAO = new PageQueryDAO(req, conn, sqlProducer);
       pageDAO.produceWebData();
       forwardURL = "/yj/yjItemSearch.jsp";
     } else if (action.equals(WebActionConstant.NEW_ACTION)) {
       AmsYjItemDTO amsYjItem = new AmsYjItemDTO();
       req.setAttribute("AMS_YJ_ITEM", amsYjItem);
       forwardURL = "/yj/yjItemDetail.jsp";
     } else if (action.equals(WebActionConstant.DETAIL_ACTION)) {
       amsYjItemDAO.setDTOClassName(AmsYjItemDTO.class.getName());
       AmsYjItemDTO amsYjItem = (AmsYjItemDTO) amsYjItemDAO.getDataByPrimaryKey();
       if (amsYjItem == null) {
         amsYjItem = new AmsYjItemDTO();
         message = getMessage(MsgKeyConstant.DATA_NOT_EXIST);
         message.setIsError(true);
       }
       req.setAttribute("AMS_YJ_ITEM", amsYjItem);
       forwardURL = "/yj/yjItemDetail.jsp";
     } else if (action.equals(WebActionConstant.CREATE_ACTION)) {
       boolean isNew = StrUtil.isEmpty(dtoParameter.getItemCode());
       YjManagerUtil yjUtil = new YjManagerUtil(user, conn);
       if (isNew) {
         dtoParameter.setItemCode(String.valueOf(yjUtil.getYjManagerMax("AMS_YJ_ITEM_SEQ")));
       }
       amsYjItemDAO.createData();
       forwardURL =
           "/servlet/com.sino.ams.yj.servlet.AmsYjItemServlet?act="
               + WebActionConstant.QUERY_ACTION
               + "&itemCode="
               + dtoParameter.getItemCode();
     } else if (action.equals(WebActionConstant.UPDATE_ACTION)) {
       amsYjItemDAO.updateData();
       forwardURL =
           "/servlet/com.sino.ams.yj.servlet.AmsYjItemServlet?act="
               + WebActionConstant.QUERY_ACTION
               + "&itemCode="
               + dtoParameter.getItemCode();
     } else if (action.equals(WebActionConstant.DELETE_ACTION)) { // 失效
       amsYjItemDAO.deleteData();
       forwardURL =
           "/servlet/com.sino.ams.yj.servlet.AmsYjItemServlet?act="
               + WebActionConstant.QUERY_ACTION;
     } else if (action.equals(AMSActionConstant.INURE_ACTION)) { // 生效
       String amsYjItem = "";
       amsYjItemDAO.enableItem(amsYjItem);
       forwardURL =
           "/servlet/com.sino.ams.yj.servlet.AmsYjItemServlet?act="
               + WebActionConstant.QUERY_ACTION;
     } else if (action.equals(WebActionConstant.EXPORT_ACTION)) { // 导出到Excel
       File file = amsYjItemDAO.exportFile();
       WebFileDownload fileDown = new WebFileDownload(req, res);
       fileDown.setFilePath(file.getAbsolutePath());
       fileDown.download();
       file.delete();
     } else if (action.equals("verifyItemName")) {
       String itemName = req.getParameter("itemName");
       boolean success = amsYjItemDAO.doVerify(itemName);
       PrintWriter out = res.getWriter();
       if (success) {
         out.print("Y");
       }
       out.flush();
       out.close();
     } 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 (DataHandleException ex) {
     ex.printLog();
     // 请根据实际情况处理消息
     forwardURL = "保持界面录入的数据,返回到原页面,并显示上面给出的消息";
   } catch (WebFileDownException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } finally {
     DBManager.closeDBConnection(conn);
     setHandleMessage(req, message);
     ServletForwarder forwarder = new ServletForwarder(req, res);
     forwarder.forwardView(forwardURL);
     // 根据实际情况修改页面跳转代码。
   }
 }
  public void performTask(HttpServletRequest req, HttpServletResponse res)
      throws ServletException, IOException {
    String forwardURL = "";
    Message message = SessionUtil.getMessage(req);
    Connection conn = null;
    try {
      conn = getDBConnection(req);
      SfUserDTO user = (SfUserDTO) SessionUtil.getUserAccount(req);
      Request2DTO req2DTO = new Request2DTO();
      req2DTO.setDTOClassName(AmsAssetsCJYCDTO.class.getName());
      AmsAssetsCJYCDTO dtoParameter = (AmsAssetsCJYCDTO) req2DTO.getDTO(req);
      AmsAssetsQJCJYCDAO dao = new AmsAssetsQJCJYCDAO(user, dtoParameter, conn);
      ServletConfigDTO sevletConfig = SessionUtil.getServletConfigDTO(req);
      dtoParameter.setFaCategory1(SinoConfig.getFaCat1Mis());
      dtoParameter.setFaCategory2(SinoConfig.getFaCat2Mis());
      dtoParameter.setFaCategory3(SinoConfig.getFaCat3Mis());

      String action = req.getParameter("act");
      action = StrUtil.nullToString(action);
      OptionProducer op = new OptionProducer(user, conn);
      int organizationId = StrUtil.strToInt(dtoParameter.getBookTypeCode());
      String companySelect = op.getAllOrganization(organizationId, true);
      req.setAttribute("OU", companySelect);
      String monthOption = op.getFromMonthOption(dtoParameter.getFromMonth());
      String tomonthOption = op.getFromMonthOption(dtoParameter.getToMonth());
      String bookTypeCode = dtoParameter.getBookTypeCode();
      String bookSelect = op.getAllBookTypeName(bookTypeCode, true);
      String catSegment1 = dtoParameter.getCatSegment1();
      String catSegment1Servlet = op.getUseField(catSegment1, true);
      req.setAttribute("CATSEGMENT1", catSegment1Servlet);
      req.setAttribute("BOOK_TYPE_CODE", bookSelect);
      req.setAttribute("FROM_MONTH_OPTION", monthOption);
      req.setAttribute("TO_MONTH_OPTION", tomonthOption);
      req.setAttribute("AMSBJTRANSNOHDTO", dtoParameter);
      if (action.equals("")) {
        forwardURL = "/newasset/assetsQJCJYC.jsp";
      } else if (action.equals(AssetsActionConstant.QUERY_ACTION)) {
        BaseSQLProducer sqlProducer = new AmsAssetsQJCJYCModel(user, dtoParameter);
        PageQueryDAO pageDAO = new PageQueryDAO(req, conn, sqlProducer);
        pageDAO.setCalPattern(LINE_PATTERN);
        pageDAO.setCountPages(false);
        pageDAO.produceWebData();
        req.setAttribute("AMSBJTRANSNOHDTO", dtoParameter);
        forwardURL = "/newasset/assetsQJCJYC.jsp";
      } else if (action.equals(AssetsActionConstant.EXPORT_ACTION)) {
        File file = dao.exportFile();
        WebFileDownload fileDown = new WebFileDownload(req, res);
        fileDown.setFilePath(file.getAbsolutePath());
        fileDown.download();
        file.delete();
      }
    } catch (DTOException ex) {
      ex.printLog();
      message = getMessage(AssetsMessageKeys.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 (PoolPassivateException ex) {
      ex.printLog();
      message = getMessage(AssetsMessageKeys.POOL_PASSIVATE_ERROR);
      message.setIsError(true);
      forwardURL = MessageConstant.MSG_PRC_SERVLET;
    } catch (WebFileDownException ex) {
      ex.printLog();
      message = getMessage(MsgKeyConstant.COMMON_ERROR);
      message.setIsError(true);
      forwardURL = MessageConstant.MSG_PRC_SERVLET;
    } catch (DataTransException ex) {
      ex.printLog();
      message = getMessage(MsgKeyConstant.COMMON_ERROR);
      message.setIsError(true);
      forwardURL = MessageConstant.MSG_PRC_SERVLET;
    } finally {
      DBManager.closeDBConnection(conn);
      setHandleMessage(req, message);
      ServletForwarder forwarder = new ServletForwarder(req, res);
      forwarder.forwardView(forwardURL);
    }
  }
Example #6
0
 public void performTask(HttpServletRequest req, HttpServletResponse res)
     throws ServletException, IOException {
   String forwardURL = "";
   Message message = SessionUtil.getMessage(req);
   Connection conn = null;
   try {
     SfUserDTO user = (SfUserDTO) getUserAccount(req);
     Request2DTO req2DTO = new Request2DTO();
     req2DTO.setDTOClassName(AmsVendorInfoDTO.class.getName());
     AmsVendorInfoDTO dto = (AmsVendorInfoDTO) req2DTO.getDTO(req);
     String action = dto.getAct();
     conn = getDBConnection(req);
     SpareVendorDAO rptDAO = new SpareVendorDAO(user, dto, conn);
     if (action.equals("")) {
       req.setAttribute(QueryConstant.QUERY_DTO, dto);
       forwardURL = AssetsURLList.SPARE_VENDOR_QUERY;
     } else if (action.equals(AssetsActionConstant.QUERY_ACTION)) {
       BaseSQLProducer sqlProducer = new SpareVendorModel(user, dto);
       PageQueryDAO pageDAO = new PageQueryDAO(req, conn, sqlProducer);
       pageDAO.setCalPattern(LINE_PATTERN);
       pageDAO.produceWebData();
       req.setAttribute(QueryConstant.QUERY_DTO, dto);
       forwardURL = AssetsURLList.SPARE_VENDOR_QUERY;
     } else if (action.equals(WebActionConstant.NEW_ACTION)) {
       String VendorId = rptDAO.getVendorId();
       dto.setVendorId(VendorId);
       req.setAttribute(QueryConstant.QUERY_DTO, dto);
       forwardURL = AssetsURLList.SPARE_VENDOR_INFO;
     } else if (action.equals(WebActionConstant.CREATE_ACTION)) {
       rptDAO.setServletConfig(getServletConfig(req));
       rptDAO.createData();
       message = rptDAO.getMessage();
       forwardURL = AssetsURLList.SPARE_VENDOR_SERVLET;
     } else if (action.equals(WebActionConstant.UPDATE_ACTION)) {
       rptDAO.setServletConfig(getServletConfig(req));
       rptDAO.updateData();
       message = rptDAO.getMessage();
       forwardURL = AssetsURLList.SPARE_VENDOR_SERVLET;
     } else if (action.equals(AssetsActionConstant.DETAIL_ACTION)) {
       rptDAO.setDTOClassName(AmsVendorInfoDTO.class.getName());
       AmsVendorInfoDTO ridDto = (AmsVendorInfoDTO) rptDAO.getDataByPrimaryKey();
       if (ridDto == null) {
         dto = new AmsVendorInfoDTO();
         message = getMessage(MsgKeyConstant.DATA_NOT_EXIST);
         message.setIsError(true);
       }
       req.setAttribute(QueryConstant.QUERY_DTO, ridDto);
       forwardURL = AssetsURLList.SPARE_VENDOR_INFO;
     } else if (action.equals(WebActionConstant.DELETE_ACTION)) {
       rptDAO.deleteData();
       message = rptDAO.getMessage();
       forwardURL = AssetsURLList.SPARE_VENDOR_SERVLET;
     } else if (action.equals("verifyworkNo")) {
       String vendorName = req.getParameter("vendorName");
       boolean success = rptDAO.doVerify(vendorName);
       PrintWriter out = res.getWriter();
       if (success) {
         out.print("Y");
       }
       out.flush();
       out.close();
     } else {
       message = getMessage(MsgKeyConstant.INVALID_REQ);
       message.setIsError(true);
       forwardURL = MessageConstant.MSG_PRC_SERVLET;
     }
   } catch (PoolPassivateException ex) {
     ex.printLog();
     message = getMessage(AssetsMessageKeys.POOL_PASSIVATE_ERROR);
     message.setIsError(true);
     forwardURL = MessageConstant.MSG_PRC_SERVLET;
   } catch (DTOException ex) {
     ex.printLog();
     message = getMessage(AssetsMessageKeys.DTO_ERROR);
     message.setIsError(true);
     forwardURL = MessageConstant.MSG_PRC_SERVLET;
   } catch (QueryException ex) {
     ex.printLog();
     message = getMessage(AssetsMessageKeys.QUERY_ERROR);
     message.setIsError(true);
     forwardURL = MessageConstant.MSG_PRC_SERVLET;
   } catch (DataHandleException ex) {
     ex.printLog();
     message = getMessage(AssetsMessageKeys.COMMON_ERROR);
     message.setIsError(true);
     forwardURL = MessageConstant.MSG_PRC_SERVLET;
   } catch (SQLModelException ex) {
     ex.printLog();
     message = getMessage(AssetsMessageKeys.COMMON_ERROR);
     message.setIsError(true);
     forwardURL = MessageConstant.MSG_PRC_SERVLET;
   } catch (ContainerException e) {
     e.printStackTrace();
   } finally {
     closeDBConnection(conn);
     setHandleMessage(req, message);
     if (!StrUtil.isEmpty(forwardURL)) {
       ServletForwarder forwarder = new ServletForwarder(req, res);
       forwarder.forwardView(forwardURL);
     }
   }
 }
 /**
  * @param req HttpServletRequest
  * @param res HttpServletResponse
  * @throws ServletException
  * @throws IOException
  */
 public void performTask(HttpServletRequest req, HttpServletResponse res)
     throws ServletException, IOException {
   //               String MATCH_MODE_SPARE = "0";        备件确认
   //               String MATCH_MODE_SPARE_RET = "1";    撤销备件关系
   //               String MATCH_MODE_PRJMTL = "2";       工程物资确认
   //               String MATCH_MODE_PRJMTL_RET = "3";   撤销工程物资匹配关系
   //               String MATCH_MODE_OTHER = "4";        设备屏蔽
   //               String MATCH_MODE_0THER_RET = "5";    撤销设备屏蔽
   String forwardURL = "";
   Message message = SessionUtil.getMessage(req);
   String action = req.getParameter("act");
   action = StrUtil.nullToString(action);
   Connection conn = null;
   try {
     SfUserDTO user = (SfUserDTO) SessionUtil.getUserAccount(req);
     TfEtsItemMatchRecDTO dtoParameter = null;
     Request2DTO req2DTO = new Request2DTO();
     req2DTO.setDTOClassName(TfEtsItemMatchRecDTO.class.getName());
     dtoParameter = (TfEtsItemMatchRecDTO) req2DTO.getDTO(req);
     conn = getDBConnection(req);
     TfEtsItemMatchRecDAO etsItemMatchRecDAO = new TfEtsItemMatchRecDAO(user, dtoParameter, conn);
     String matchType = dtoParameter.getMatchType();
     ServletConfigDTO configDTO = getServletConfig(req);
     if (action.equals("")) {
       if (matchType.equals(WebAttrConstant.MATHC_MODE_CHANGED_ASSETS_RET)) { // 撤消资产匹配关系操作
         forwardURL = URLDefineList.TF_UNYOKE_PAGE + "?matchType=" + matchType;
       } else {
         forwardURL = URLDefineList.TF_FINANCE_PROP_SET_PAGE + "?matchType=" + matchType;
       }
     } else if (action.equals(WebActionConstant.QUERY_ACTION)) {
       if (matchType.equals(WebAttrConstant.MATHC_MODE_CHANGED_ASSETS_RET)) {
         BaseSQLProducer sqlProducer = new TfEtsItemMatchRecModel(user, dtoParameter);
         PageQueryDAO pageDAO = new PageQueryDAO(req, conn, sqlProducer);
         pageDAO.setServletConfig(configDTO);
         CheckBoxProp checkProp = new CheckBoxProp("subCheck");
         checkProp.addDbField("SYSTEM_ID");
         checkProp.addDbField("ASSET_ID");
         pageDAO.setWebCheckProp(checkProp);
         pageDAO.produceWebData();
         forwardURL =
             URLDefineList.TF_UNYOKE_PAGE
                 + "?matchType="
                 + matchType
                 + "&unyokeFlag="
                 + dtoParameter.getUnyokeFlag();
       } else {
         BaseSQLProducer sqlProducer = new TfEtsItemMatchRecModel(user, dtoParameter);
         PageQueryDAO pageDAO = new PageQueryDAO(req, conn, sqlProducer);
         pageDAO.produceWebData();
         forwardURL = URLDefineList.TF_FINANCE_PROP_SET_PAGE + "?matchType=" + matchType;
       }
     } else if (action.equals(AMSActionConstant.MATCH_ACTION)) {
       DTOSet dtos = getDTOs(req, matchType);
       if (matchType.equals(WebAttrConstant.MATHC_MODE_CHANGED_ASSETS_RET)) {
         dtos = getCheckedAssets(req, matchType);
         etsItemMatchRecDAO.delDTOs(dtos);
         forwardURL = URLDefineList.TF_UNYOKE_PAGE + "?matchType=" + matchType;
       }
       // 2009.3.31修改su
       //                else if(matchType.equals(WebAttrConstant.MATCH_MODE_RENT)) {//租赁资产确认
       //                    String [] systemIds=req.getParameterValues("systemId");
       //                    etsItemMatchRecDAO.confirmRentAssets(systemIds);
       //                    forwardURL = URLDefineList.FINANCE_PROP_SET_PAGE + "?matchType=" +
       // matchType;
       //                }
       //                else if(matchType.equals(WebAttrConstant.MATCH_MODE_DG)) {//代管资产确认
       //                    String [] systemIds=req.getParameterValues("systemId");
       //                    etsItemMatchRecDAO.confirmDGAssets(systemIds);
       //                    forwardURL = URLDefineList.FINANCE_PROP_SET_PAGE + "?matchType=" +
       // matchType;
       //                }
       //                else if(matchType.equals(WebAttrConstant.MATCH_MODE_LC)) {//低值易耗资产确认
       //                    String [] systemIds=req.getParameterValues("systemId");
       //                    etsItemMatchRecDAO.confirmLCAssets(systemIds);
       //                    forwardURL = URLDefineList.FINANCE_PROP_SET_PAGE + "?matchType=" +
       // matchType;
       //                }
       //                else if(matchType.equals(WebAttrConstant.MATCH_MODE_CT)) {//村通资产确认
       //                    String [] systemIds=req.getParameterValues("systemId");
       //                    etsItemMatchRecDAO.confirmCTAssets(systemIds);
       //                    forwardURL = URLDefineList.FINANCE_PROP_SET_PAGE + "?matchType=" +
       // matchType;
       //                }
       else {
         etsItemMatchRecDAO.saveDTOs(dtos);
         if (matchType.equals(WebAttrConstant.MATCH_MODE_PRJMTL)
             || matchType.equals(WebAttrConstant.MATCH_MODE_PRJMTL_RET)) {
           DTOSet dtoes = this.getSystemIds(req);
           etsItemMatchRecDAO.getDistributePrj(dtoParameter.getPrjId(), dtoes);
         }
         forwardURL =
             URLDefineList.TF_FINANCE_PROP_SET_SERVLET
                 + "?act="
                 + WebActionConstant.QUERY_ACTION
                 + "&matchType="
                 + matchType;
       }
     } 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 (DataHandleException ex) {
     ex.printLog();
     message = getMessage(MsgKeyConstant.DTO_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 (StrException ex) {
     ex.printLog();
     message = getMessage(MsgKeyConstant.COMMON_ERROR);
     message.setIsError(true);
     forwardURL = MessageConstant.MSG_PRC_SERVLET;
   } catch (UploadException ex) {
     // 请根据实际情况处理消息
     forwardURL = "保持界面录入的数据,返回到原页面,并显示上面给出的消息";
   } catch (SQLException e) {
     e.printStackTrace();
   } finally {
     DBManager.closeDBConnection(conn);
     setHandleMessage(req, message);
     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;
 }