Ejemplo n.º 1
0
  /**
   * 功能:插入地点信息
   *
   * @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);
    }
  }
Ejemplo n.º 2
0
 public RowSet getLine(String transId) throws QueryException {
   AmsBjTransQueryModel model = new AmsBjTransQueryModel(sfUser, dto);
   SQLModel sqlModel = model.getLineData(transId);
   SimpleQuery sq = new SimpleQuery(sqlModel, conn);
   sq.executeQuery();
   return sq.getSearchResult();
 }
Ejemplo n.º 3
0
 public DTOSet getUses() throws QueryException {
   GetMisHousInfoModel model = (GetMisHousInfoModel) sqlProducer;
   SimpleQuery sq = new SimpleQuery(model.getUsesInfo(), conn);
   sq.setDTOClassName(AmsHouseUsesDTO.class.getName());
   sq.executeQuery();
   return sq.getDTOSet();
 }
Ejemplo n.º 4
0
 // -----------------------------------------------------------------------------------------
 // --getItemCode
 public String getItemCodeInESI() throws QueryException, ContainerException {
   AmsCabelInfoModel modelClass = (AmsCabelInfoModel) sqlProducer;
   SQLModel sqlModel = modelClass.getItemCodeInESIModel();
   SimpleQuery sq = new SimpleQuery(sqlModel, conn);
   sq.executeQuery();
   RowSet rs = sq.getSearchResult();
   return rs.getRow(0).getStrValue(0);
 }
Ejemplo n.º 5
0
  public DTOSet getLines(String transId) throws QueryException {
    AmsBjTransQueryModel model = new AmsBjTransQueryModel(sfUser, null);
    SimpleQuery sq = new SimpleQuery(model.getByTransIdModel(dto.getTransId()), conn);
    sq.setDTOClassName(AmsBjsAllotDDto.class.getName());
    sq.executeQuery();

    return sq.getDTOSet();
  }
Ejemplo n.º 6
0
 public boolean verifyBarcode(String barcode) throws QueryException { // 执行校验Barcode操作
   boolean success = false;
   GetMisHousInfoModel getMisHousInfoModel = (GetMisHousInfoModel) sqlProducer;
   SQLModel sqlModel = getMisHousInfoModel.getVerifyBarcodeModel(barcode);
   SimpleQuery sq = new SimpleQuery(sqlModel, conn);
   sq.executeQuery();
   success = sq.hasResult();
   return success;
 }
Ejemplo n.º 7
0
 public boolean checkInESD() throws QueryException {
   boolean hasBeen;
   AmsCabelInfoModel modelClass = (AmsCabelInfoModel) sqlProducer;
   SQLModel sqlModel = modelClass.getCheckInESDModel();
   SimpleQuery sq = new SimpleQuery(sqlModel, conn);
   sq.executeQuery();
   hasBeen = sq.hasResult();
   return hasBeen;
 }
Ejemplo n.º 8
0
 /**
  * 功能:判断项目id的存在性。
  *
  * @return
  */
 private boolean isProjectId(EtsFaAssetsDTO faDTO) throws QueryException {
   boolean hasResule = false;
   SQLModel sqlModel = modelProducer.hasProjId(faDTO.getProjectid());
   SimpleQuery sq = new SimpleQuery(sqlModel, conn);
   sq.executeQuery();
   if (sq.hasResult()) {
     hasResule = true;
   }
   return hasResule;
 }
Ejemplo n.º 9
0
 /**
  * 功能:判断barcode的存在性。
  *
  * @return
  */
 private boolean isExist(EtsFaAssetsDTO faDTO) throws QueryException {
   boolean hasResule = false;
   SQLModel sqlModel = modelProducer.hasBarcode(faDTO.getTagNumber());
   SimpleQuery sq = new SimpleQuery(sqlModel, conn);
   sq.executeQuery();
   if (sq.hasResult()) {
     hasResule = true;
   }
   return hasResule;
 }
Ejemplo n.º 10
0
  public boolean doVerifyWorkNo(String workorderObjectCode)
      throws QueryException { // 执行校验workorderObjectCode操作
    boolean success = false;
    EtsObjectModel etsObjectModel = (EtsObjectModel) sqlProducer;
    SQLModel sqlModel = etsObjectModel.getVerifyWorkNoModel(workorderObjectCode);

    SimpleQuery sq = new SimpleQuery(sqlModel, conn);
    sq.executeQuery();
    success = sq.hasResult();

    return success;
  }
Ejemplo n.º 11
0
 public boolean isTempSave(String barcode) throws QueryException {
   boolean has = false;
   GetMisHousInfoModel tsqlModel = new GetMisHousInfoModel(userAccount, null);
   SQLModel temModel = tsqlModel.isTempDate(barcode);
   SimpleQuery sqt = new SimpleQuery(temModel, conn);
   sqt.executeQuery();
   if (sqt.hasResult()) {
     has = true;
   }
   //         isTempDate
   return has;
 }
Ejemplo n.º 12
0
 /**
  * 功能:判断是否全省租赁管理员;
  *
  * @return
  */
 public String isProvince() throws QueryException {
   String isProvince = "N";
   SQLModel sqlModel = null;
   RentHouseModel sqlProducer = new RentHouseModel(userAccount, null);
   sqlModel = sqlProducer.isProvince();
   SimpleQuery spl = new SimpleQuery(sqlModel, conn);
   spl.executeQuery();
   if (spl.hasResult()) {
     isProvince = "Y";
   }
   return isProvince;
 }
Ejemplo n.º 13
0
  /**
   * 功能:获取资产变更信息对象
   *
   * @param assetid
   * @param conn
   * @return
   * @throws QueryException
   */
  public TDSrvAssetsUpdateDTO getAssetsDtoBydId(String assetid, Connection conn)
      throws QueryException {
    TDSrvAssetsUpdateDTO dto = null;
    TDSrvAssetsUpdateModel assetsModel = new TDSrvAssetsUpdateModel(null, null);
    SQLModel sqlModel = assetsModel.getAssetsUpdateDTO(assetid);
    SimpleQuery sq = new SimpleQuery(sqlModel, conn);
    sq.setDTOClassName(TDSrvAssetsUpdateDTO.class.getName());
    sq.executeQuery();
    if (sq.hasResult()) {
      dto = (TDSrvAssetsUpdateDTO) sq.getFirstDTO();
    }

    return dto;
  }
Ejemplo n.º 14
0
 /**
  * 功能:获得MIS的员工信息
  *
  * @throws QueryException
  * @throws ContainerException
  */
 private void appendUserData(EtsItemInfoDTO itemDTO, EtsFaAssetsDTO faDTO) throws QueryException {
   try {
     SQLModel sqlModel = modelProducer.getMISemployee(faDTO.getAssignedToNumber());
     SimpleQuery sq = new SimpleQuery(sqlModel, conn);
     sq.executeQuery();
     if (sq.hasResult()) {
       Row row = sq.getFirstRow();
       itemDTO.setResponsibilityDept(row.getStrValue("DEPT_CODE"));
       itemDTO.setResponsibilityUser(row.getStrValue("EMPLOYEE_ID"));
     }
   } catch (ContainerException ex) {
     ex.printLog();
     throw new QueryException(ex);
   }
 }
Ejemplo n.º 15
0
 /**
  * 功能:获得ProjectId
  *
  * @throws QueryException
  * @throws ContainerException
  */
 private void appendProjIdData(EtsItemInfoDTO itemDTO, EtsFaAssetsDTO faDTO)
     throws QueryException {
   try {
     SQLModel sqlModel = modelProducer.getProId(faDTO.getProjectid());
     SimpleQuery sq = new SimpleQuery(sqlModel, conn);
     sq.executeQuery();
     if (sq.hasResult()) {
       Row row = sq.getFirstRow();
       itemDTO.setProjectid((String) row.getValue("PROJECT_ID"));
     }
   } catch (ContainerException ex) {
     ex.printLog();
     throw new QueryException(ex);
   }
 }
Ejemplo n.º 16
0
 /**
  * 功能:获取附件张数
  *
  * @return String
  * @throws QueryException
  */
 public String getAccessSheet() throws QueryException {
   String accessSheet = "";
   try {
     OrderApproveModel modelProducer = (OrderApproveModel) sqlProducer;
     SQLModel sqlModel = modelProducer.getAccessSheet();
     SimpleQuery simp = new SimpleQuery(sqlModel, conn);
     simp.executeQuery();
     if (simp.hasResult()) {
       accessSheet = simp.getFirstRow().getStrValue("ACCESS_SHEET");
     }
   } catch (ContainerException ex) {
     ex.printLog();
     throw new QueryException(ex);
   }
   return accessSheet;
 }
Ejemplo n.º 17
0
 /**
  * 功能:获得MIS的员工信息
  *
  * @throws QueryException
  * @throws ContainerException
  */
 private void appendAddressData(EtsItemInfoDTO itemDTO, EtsFaAssetsDTO faDTO)
     throws QueryException {
   try {
     SQLModel sqlModel =
         modelProducer.getLocId(faDTO.getAssetsLocationCode(), faDTO.getOrganizationId());
     SimpleQuery sq = new SimpleQuery(sqlModel, conn);
     sq.executeQuery();
     if (sq.hasResult()) {
       Row row = sq.getFirstRow();
       itemDTO.setAddressId((String) row.getValue("ADDRESS_ID"));
     }
   } catch (ContainerException ex) {
     ex.printLog();
     throw new QueryException(ex);
   }
 }
Ejemplo n.º 18
0
 /**
  * 功能:获取当前的审批角色名称
  *
  * @return String
  * @throws QueryException
  */
 public String getCurrRoleName() throws QueryException {
   String currRoleName = "";
   try {
     OrderApproveModel modelProducer = (OrderApproveModel) sqlProducer;
     SQLModel sqlModel = modelProducer.getCurrApproveRoleModel();
     SimpleQuery simp = new SimpleQuery(sqlModel, conn);
     simp.executeQuery();
     if (simp.hasResult()) {
       currRoleName = simp.getFirstRow().getStrValue("ROLENAME");
     }
   } catch (ContainerException ex) {
     ex.printLog();
     throw new QueryException(ex);
   }
   return currRoleName;
 }
Ejemplo n.º 19
0
  /** 查询资产地点 */
  public void synFaLocation(Connection conn, SfUserDTO user) {
    int totalCount = 0;
    int count = 0;
    long resumeTime = 0;
    SynLogDTO logDTO = null;
    SynLogUtil logUtil = new SynLogUtil();
    long start = System.currentTimeMillis();
    try {
      logDTO = new SynLogDTO();
      logDTO.setSynType(SrvType.SRV_FA_LOCATION);
      logDTO.setCreatedBy(user.getUserId());
      logDTO.setSynMsg("同步MIS资产地点开始");
      logUtil.synLog(logDTO, conn);

      SrvAssetLocationSrv service = new SrvAssetLocationSrv();
      SrvAssetLocationDTO dtoParameter = new SrvAssetLocationDTO();
      SrvAssetLocationDAO srvAssetLocationDAO = new SrvAssetLocationDAO(user, dtoParameter, conn);
      service.setLastUpDate(SynUpdateDateUtils.getLastUpdateDate(SrvType.SRV_FA_LOCATION, conn));
      SrvProcessModel spm = new SrvProcessModel();
      SQLModel sqlModel =
          spm.getLocalCodeModel(MIS_CONSTANT.SOURCE_MIS, SinoConfig.getLoc1SetNameMis());
      SimpleQuery simp = new SimpleQuery(sqlModel, conn);
      simp.executeQuery();
      Row row = null;
      if (simp.hasResult()) {
        RowSet rs = simp.getSearchResult();
        for (int i = 0; i < rs.getSize(); i++) {
          row = rs.getRow(i);
          String cc = row.getStrValue("FLEX_VALUE");
          service.setSegment1(cc);
          service.excute();
          SrvReturnMessage srm = service.getReturnMessage();
          if (srm.getErrorFlag().equals("Y")) {
            DTOSet ds = service.getDs();
            totalCount += ds.getSize();
            if (ds.getSize() > 0) {
              count += srvAssetLocationDAO.synAssetLocation(ds, cc);
            }
          }
        }
        if (totalCount == count) { // 全部成功才更新同步类型日志,以免下次获取不到数据
          SynUpdateDateUtils.createLastUpdateDate(SrvType.SRV_FA_LOCATION, conn);
          SynUpdateDateUtils.updateLastUpdateDate(SrvType.SRV_FA_LOCATION, conn);
        }
      }
      resumeTime = System.currentTimeMillis() - start;
      logDTO = new SynLogDTO();
      logDTO.setSynType(SrvType.SRV_FA_LOCATION);
      logDTO.setCreatedBy(user.getUserId());
      logDTO.setSynMsg(
          "同步MIS资产地点结束。同步"
              + totalCount
              + "条记录,成功"
              + count
              + ",失败"
              + (totalCount - count)
              + ",耗时"
              + resumeTime
              + "毫秒");
      logUtil.synLog(logDTO, conn);
    } catch (Exception e) {
      Logger.logError(e);
    }
  }