Exemplo n.º 1
0
  @Override
  public ProcessResult process(
      RequestInfo requestInfo, Map<String, String> handler, Map<String, Object> extParameters)
      throws Exception {
    if (StringUtils.isEmpty(requestInfo.getRequestBody().getServiceNumber())) {
      throw new Exception("serviceNumber is null");
    }
    BizHandler appHandler =
        (BizHandler) ServiceUtils.getBeanByTenantId(handler.get("appHandlerName"));
    ProcessResult processResult = appHandler.process(requestInfo, handler, extParameters);
    if (!UnieapConstants.C0.equals(processResult.getResultCode())) {
      return processResult;
    }
    QueryPaymentLogsVO queryPaymentLogsVO = (QueryPaymentLogsVO) processResult.getVo();
    List<MshopPaymentVO> payments = getPaymentLogList(queryPaymentLogsVO);

    if (handler != null) {
      String custHandlerName = handler.get("custHandlerName");
      if (!StringUtils.isEmpty(custHandlerName)) {
        CustomizeBizHanlder custHandler =
            (CustomizeBizHanlder) ServiceUtils.getBean(custHandlerName);
        List<Object> originalVOs = new ArrayList<Object>();
        originalVOs.add(queryPaymentLogsVO);
        custHandler.process(requestInfo, handler, extParameters, payments, originalVOs);
      }
    }

    JSONObject jsonResult = new JSONObject();
    processResult.setResultCode(UnieapConstants.C0);
    processResult.setResultDesc(UnieapConstants.getMessage(UnieapConstants.C0));
    jsonResult.put("paymentList", JSONUtils.collectionToJson(payments));
    processResult.setExtParameters(jsonResult.toString());
    return processResult;
  }
Exemplo n.º 2
0
 @Override
 public ProcessResult process(
     RequestInfo requestInfo, Map<String, String> handler, Map<String, Object> extParameters)
     throws Exception {
   if (StringUtils.isEmpty(requestInfo.getRequestBody().getServiceNumber())) {
     throw new Exception("serviceNumber is null");
   }
   BizHandler appHandler =
       (BizHandler) ServiceUtils.getBeanByTenantId(handler.get("appHandlerName"));
   ProcessResult processResult = appHandler.process(requestInfo, handler, extParameters);
   if (handler != null) {
     String custHandlerName = handler.get("custHandlerName");
     if (!StringUtils.isEmpty(custHandlerName)) {
       CustomizeBizHanlder custHandler =
           (CustomizeBizHanlder) ServiceUtils.getBean(custHandlerName);
       List<Object> originalVOs = new ArrayList<Object>();
       originalVOs.add(processResult.getVo());
       custHandler.process(
           requestInfo, handler, extParameters, processResult.getVo(), originalVOs);
     }
   }
   return processResult;
 }