Ejemplo n.º 1
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.º 2
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.º 3
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);
    }
  }