/**
  * 功能说明:将EAM系统发生的公司内资产调拨同步到MIS系统
  *
  * @throws com.sino.base.exception.DataHandleException 将EAM系统发生的公司内资产调拨同步到MIS系统出错时抛数据处理异常
  */
 public void writeAssetsAllocations() throws DataHandleException {
   Connection conn = null;
   try {
     conn = getDBConnection();
     RowSet rows = getCompanyList(conn);
     if (rows != null && !rows.isEmpty()) {
       int dataCount = rows.getSize();
       SrvDAO srvDAO = new SrvDAO();
       for (int i = 0; i < dataCount; i++) {
         Row row = rows.getRow(i);
         String orgId = row.getStrValue("ORGANIZATION_ID");
         int organizationId = Integer.parseInt(orgId);
         taskExecutor = getOUTaskExecutor(conn, organizationId);
         if (taskExecutor == null) {
           continue;
         }
         srvDAO.synTransInCompany(conn, taskExecutor);
       }
     }
   } catch (Throwable ex) {
     Logger.logError(ex);
     throw new DataHandleException(ex.getMessage());
   } finally {
     closeDBConnection(conn);
   }
 }
Ejemplo n.º 2
0
 private void writeData2Excel(HSSFSheet sheet, HSSFCellStyle dataStyle, HSSFCellStyle headerStyle)
     throws ContainerException {
   RowSet searchResult = executeFrm.getSearchResult();
   if (searchResult != null && !searchResult.isEmpty()) {
     List<ReportViewFrm> definedViews = executeFrm.getDefinedViews();
     int fieldCount = definedViews.size();
     int dataCount = searchResult.getSize();
     int xlsRowNum = 0;
     for (int i = 0; i < dataCount; i++) {
       Row row = searchResult.getRow(i);
       xlsRowNum = i;
       if (isFirstFile) {
         xlsRowNum++;
       }
       HSSFRow xlsRow = sheet.createRow(xlsRowNum);
       xlsRow.setHeightInPoints(18);
       for (short j = 0; j < fieldCount; j++) {
         ReportViewFrm viewFrm = definedViews.get(j);
         String fieldName = viewFrm.getFieldName();
         HSSFCell xlsCell = xlsRow.createCell(j);
         xlsCell.setCellStyle(dataStyle);
         HSSFRichTextString richText = new HSSFRichTextString(row.getStrValue(fieldName));
         xlsCell.setCellValue(richText);
       }
     }
   }
 }