Exemplo n.º 1
0
 public static Long genLongkey(String tableName, String tableSchema, String keyVol) {
   String _str = tableName;
   if (StringUtil.isNotBlank(tableSchema)) {
     _str = tableSchema + "." + tableName;
   }
   if (m_mapSerials.get(_str) == null) {
     m_mapSerials.put(
         _str,
         ((RetrieveMaxKeyFromDB) BeansLocator.getBeanResource("retrieveMaxKeyFromDB"))
             .getLongMaxKey(tableName, tableSchema, keyVol));
   }
   Long _llTemp = new Long(((Long) m_mapSerials.get(_str)).longValue() + 1L);
   m_mapSerials.put(_str, _llTemp);
   return _llTemp;
 }
Exemplo n.º 2
0
 public static String genStringkey(
     String tableName, String tableSchema, String keyVol, int keyLength) {
   String _str = tableName;
   if (StringUtil.isNotBlank(tableSchema)) {
     _str = tableSchema + "." + tableName;
   }
   if (m_mapSerials.get(_str) == null) {
     m_mapSerials.put(
         _str,
         ((RetrieveMaxKeyFromDB) BeansLocator.getBeanResource("retrieveMaxKeyFromDB"))
             .getStringMaxKey(tableName, tableSchema, keyVol));
   }
   String _strKey = stringIncrease((String) m_mapSerials.get(_str), keyLength);
   m_mapSerials.put(_str, _strKey);
   return _strKey;
 }
Exemplo n.º 3
0
  public ActionForward queryPaperFeeByPaperNumber(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    if (logger.isDebugEnabled()) {
      logger.debug(
          "queryPaperFeeByPaperNumber(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - start");
    }

    ActionMessages _messages = new ActionMessages();
    ActionForward _forward = mapping.findForward("paperFeeInput");
    try {
      ManagerFeeService _service = ApplicationServiceLocator.getManagerFeeService();
      String _strPaperNumber = RequestUtil.getRequiredStringParameter(request, "paperNumber");
      String _strPaperLNumber = RequestUtil.getRequiredStringParameter(request, "paperLNumber");
      SearchService _searchService = ApplicationServiceLocator.getSearchService();
      PaperView _paperView = _searchService.serachByPaperNumber(_strPaperNumber);
      SmallPaperView _smallPaperView = _paperView.getSmallPaperView();
      SmallAuthorView[] _smallAuthorViews = _paperView.getAuthors();

      for (int i = 0; i < _smallAuthorViews.length; i++) {
        if (StringUtil.isNotBlank(_smallAuthorViews[i].getChrPartiNo())) {
          _smallAuthorViews[i].setCurrentPaperLNumber(_strPaperLNumber);
          _smallAuthorViews[i].setRegFeeReceived(
              ServicesUtil.isRegFeeReceivedOfParticipant(_smallAuthorViews[i].getChrPartiNo()));
        }
      }

      TpaperPresented _tpaperPresented = _paperView.getPaperPresented();
      if (_tpaperPresented != null
          && StringUtil.isNotBlank(_tpaperPresented.getChrPresenterPartiNo())) {
        ParticipantDao _participantDao =
            (ParticipantDao) BeansLocator.getBeanResource("participantDao");
        Tparticipant _tparticipant =
            _participantDao.findByParticipantNo(_tpaperPresented.getChrPresenterPartiNo());
        SmallUserView _smallUserView = new SmallUserView();
        BeanUtils.copyProperties(_smallUserView, _tparticipant);
        _smallUserView.setCurrentPaperLNumber(_strPaperLNumber);
        _smallUserView.setRegFeeReceived(
            ServicesUtil.isRegFeeReceivedOfParticipant(_smallUserView.getChrPartiNo()));
        request.setAttribute("presented", _smallUserView);
      }

      request.setAttribute("paperView", _smallPaperView);
      request.setAttribute("authors", _smallAuthorViews);
      TpaperRegistation _tpaperRegistation =
          _service.loadPaperRegistrationByPaperNumber(_strPaperNumber);
      if (_tpaperRegistation == null) {
        _tpaperRegistation = new TpaperRegistation();
        _tpaperRegistation.setChvPaperLNumber(_strPaperLNumber);
        _tpaperRegistation.setChvPaperNumber(_strPaperNumber);
        _tpaperRegistation.setChrPaymentMethodNo("1");
        _tpaperRegistation.setBitIsAppJuniorAward(
            _paperView.getSmallPaperView().getBitIsJuniorAward());
        _tpaperRegistation.setBitIsAppJaegerPrize(
            _paperView.getSmallPaperView().getBitIsPaperPrize());
        _service.createPaperRegistration(_tpaperRegistation);
        _tpaperRegistation = _service.loadPaperRegistrationByPaperNumber(_strPaperNumber);
      }
      PaperFeeForm _form = (PaperFeeForm) form;
      _form.setPaperFee(_tpaperRegistation);

    } catch (BusinessServiceException e) {
      logger.error(
          "queryPaperFeeByPaperNumber(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)",
          e);

      _messages.add("paperFeeError", new ActionMessage("errors.code." + e.getErrCode()));
      saveErrors(request, _messages);
      _forward = mapping.findForward("error");
    } catch (CannotFoundRequestParameterException e) {
      logger.error(
          "queryPaperFeeByPaperNumber(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)",
          e);

      _messages.add("paperFeeError", new ActionMessage("errors.code.132"));
      saveErrors(request, _messages);
      _forward = mapping.findForward("error");
    } catch (Exception e) {
      logger.error(
          "queryPaperFeeByPaperNumber(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)",
          e);

      _messages.add("paperFeeError", new ActionMessage("errors.code.97"));
      saveErrors(request, _messages);
      _forward = mapping.findForward("error");
    }

    if (logger.isDebugEnabled()) {
      logger.debug(
          "queryPaperFeeByPaperNumber(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - end");
    }
    return _forward;
  }