示例#1
0
 /**
  * 提交工单
  *
  * @param dtoSet
  * @return
  * @throws QueryException
  * @throws DataHandleException
  */
 private boolean importEAMhouse(DTOSet dtoSet) throws DataHandleException {
   boolean operatorResult = false;
   try {
     if (dtoSet != null && dtoSet.getSize() > 0) {
       EtsFaAssetsDTO faDTO = null;
       EtsItemInfoDTO itemDTO = null;
       AmsHouseInfoDTO houseDTO = null;
       SystemItemHouse systemItemUtil = new SystemItemHouse();
       for (int i = 0; i < dtoSet.getSize(); i++) {
         faDTO = (EtsFaAssetsDTO) dtoSet.getDTO(i);
         itemDTO = new EtsItemInfoDTO();
         itemDTO.setBarcode(faDTO.getTagNumber());
         itemDTO.setItemName(faDTO.getAssetsDescription());
         itemDTO.setItemSpec(faDTO.getModelNumber());
         itemDTO.setItemQty(StrUtil.nullToString(faDTO.getCurrentUnits()));
         itemDTO.setStartDate(faDTO.getDatePlacedInService().toString());
         itemDTO.setItemCategory("HOUSE");
         itemDTO.setAssetId(faDTO.getAssetId());
         itemDTO.setOrganizationId(faDTO.getOrganizationId());
         itemDTO.setFinanceProp("ASSETS");
         itemDTO = systemItemUtil.checkSysItem(conn, itemDTO);
         appendProjIdData(itemDTO, faDTO);
         appendUserData(itemDTO, faDTO);
         appendAddressData(itemDTO, faDTO);
         if (StrUtil.isEmpty(itemDTO.getAddressId())) {
           addAddressData(faDTO);
           appendAddressData(itemDTO, faDTO);
         }
         if (StrUtil.isEmpty(itemDTO.getAddressId())) {
           continue;
         }
         houseDTO = new AmsHouseInfoDTO();
         houseDTO.setBarcode(faDTO.getTagNumber());
         houseDTO.setHouseAddress(faDTO.getAssetsLocation());
         houseDTO.setHremark("house信息导入");
         itemDTO.setSystemId(getNextSystemId());
         itemDTO.setRemark("house信息导入");
         if (!isExist(faDTO)) {
           insertEtsItemInfo(itemDTO); // IN  ams_item_info
         }
         insertHouesInfo(houseDTO); // IN ams_house_info
         matchData(itemDTO, faDTO); // 进行匹配操作
       }
     }
     operatorResult = true;
   } catch (DataHandleException ex) {
     ex.printLog();
     throw new DataHandleException(ex);
   } catch (SQLException ex) {
     Logger.logError(ex);
     throw new DataHandleException(ex);
   } catch (ContainerException ex) {
     ex.printLog();
     throw new DataHandleException(ex);
   } catch (QueryException ex) {
     ex.printLog();
     throw new DataHandleException(ex);
   } catch (CalendarException ex) {
     ex.printLog();
     throw new DataHandleException(ex);
   }
   return operatorResult;
 }