/** * 功能:插入地点信息 * * @throws DataHandleException */ private void addAddressData(EtsFaAssetsDTO faDTO) throws DataHandleException, QueryException { try { EtsObjectDTO obDTO = new EtsObjectDTO(); obDTO.setWorkorderObjectCode(faDTO.getAssetsLocationCode()); obDTO.setWorkorderObjectName(faDTO.getAssetsLocation()); obDTO.setWorkorderObjectLocation(faDTO.getAssetsLocation()); obDTO.setOrganizationId(faDTO.getOrganizationId()); obDTO.setObjectCategory("81"); SQLModel sqlModel = modelProducer.getCount(faDTO.getDepreciationAccount().substring(5, 11)); SimpleQuery sq = new SimpleQuery(sqlModel, conn); sq.executeQuery(); if (sq.hasResult()) { Row row = sq.getFirstRow(); obDTO.setCountyCode(row.getStrValue("COUNTY_CODE")); } if (obDTO.getWorkorderObjectName().equals("")) { return; } EtsObjectDAO etsObjectDAO = new EtsObjectDAO(userAccount, obDTO, conn); etsObjectDAO.createData2(); } catch (ContainerException ex) { ex.printLog(); throw new QueryException(ex); } }
/** * 提交工单 * * @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; }