Exemple #1
0
 protected void my_order_query(
     HttpServletRequest paramHttpServletRequest,
     HttpServletResponse paramHttpServletResponse,
     String paramString1,
     ResponseResult paramResponseResult,
     String paramString2) {
   if (this.log.isDebugEnabled()) {
     this.log.debug("Entering 'my_order_query' method ");
   }
   int i = 0;
   String str1 = "";
   String str2 = "";
   long l1 = 0L;
   try {
     String str3 = getLogonType(paramString2);
     str2 = getValueByTagName(paramString1, "USER_ID");
     if ("".equals(str2)) {
       str2 = getValueByTagName(paramString1, "TRADER_ID");
     }
     international((String) lanaguages.get(str2));
     String str4 = getValueByTagName(paramString1, "BUY_SELL");
     Short localShort = (str4.equals("")) || (str4.equals("0")) ? null : new Short(str4);
     String str5 = getValueByTagName(paramString1, "ORDER_NO");
     Long localLong = (str5.equals("")) || (str5.equals("0")) ? null : new Long(str5);
     String str6 = getValueByTagName(paramString1, "COMMODITY_ID");
     String str7 = getValueByTagName(paramString1, "STARTNUM");
     String str8 = getValueByTagName(paramString1, "RECCNT");
     String str9 = getValueByTagName(paramString1, "SORTFLD");
     String str10 = getValueByTagName(paramString1, "ISDESC") == "" ? "0" : "1";
     String str11 = getValueByTagName(paramString1, "UT");
     int j = (str11 == null) || ("0".equals(str11)) || ("".equals(str11.trim())) ? 1 : 0;
     String str12 = j != 0 ? "queryAll" : str11;
     SortCondition localSortCondition = new SortCondition();
     localSortCondition.setStartNu(str7);
     localSortCondition.setIsdesc(Integer.parseInt(str10));
     localSortCondition.setReccnt(str8);
     localSortCondition.setSortfLD((String) this.orderKeyMap.get(str9));
     long l2 = parseLong(getValueByTagName(paramString1, "SESSION_ID"));
     if (!isLogon(paramHttpServletRequest, str2, l2, str3)) {
       i = -201;
       str1 = this.properties.getProperty("-205");
     } else {
       OrdersManager localOrdersManager = (OrdersManager) getBean("ordersManager");
       Orders localOrders = new Orders();
       Privilege localPrivilege = getSessionBean(paramHttpServletRequest);
       if (PrivilegeController.checkSuperTrader(localPrivilege)) {
         localOrders.setSuperTrader("A");
       }
       localOrders.setBS_Flag(localShort);
       localOrders.setA_OrderNo(localLong);
       localOrders.setTraderID(str2);
       localOrders.setUpdateTime(str12);
       localOrders.setCommodityID(str6);
       List localList =
           localOrdersManager.my_order_query(localOrders, localPrivilege, localSortCondition);
       Timestamp localObject = null;
       for (int k = 0; k < localList.size(); k++) {
         Timestamp localTimestamp = null;
         Map localMap = (Map) localList.get(k);
         if (localMap.containsKey("UPDATETIME")) {
           localTimestamp = (Timestamp) localMap.get("UPDATETIME");
         }
         if (localObject == null) {
           localObject = localTimestamp;
         } else if (localObject.before(localTimestamp)) {
           localObject = localTimestamp;
         }
       }
       l1 =
           localObject == null ? parseLong("".equals(str11) ? "0" : str11) : localObject.getTime();
       if (localList == null) {
         i = -202;
         str1 = this.properties.getProperty("-208");
       } else if (localList.size() == 0) {
         i = 0;
         str1 = this.properties.getProperty("-200");
       } else {
         paramResponseResult.setResultList(localList);
       }
     }
   } catch (ConnectException localConnectException) {
     this.log.error("my_order_query rmi conection exception" + localConnectException);
     i = -202;
     str1 = this.properties.getProperty("-202");
     initRMI();
   } catch (RemoteException localRemoteException) {
     this.log.error("my_order_query remoteerror:" + localRemoteException);
     errorException(localRemoteException);
     i = -204;
     str1 = this.properties.getProperty("-204");
   } catch (Exception localException) {
     this.log.error("my_order_query error:" + localException);
     errorException(localException);
     i = -203;
     str1 = this.properties.getProperty("-203");
   }
   paramResponseResult.setRetCode(i);
   paramResponseResult.setMessage(str1);
   paramResponseResult.setUserID(str2);
   if ("mobile".equals(paramString2)) {
     this.mobileServlet.renderXML(
         paramHttpServletResponse, ResponseXml.my_order_query(paramResponseResult, l1));
   } else {
     renderXML(paramHttpServletResponse, ResponseXml.my_order_query(paramResponseResult, l1));
   }
 }
Exemple #2
0
 protected void order_wd(
     HttpServletRequest paramHttpServletRequest,
     HttpServletResponse paramHttpServletResponse,
     String paramString1,
     ResponseResult paramResponseResult,
     String paramString2) {
   if (this.log.isDebugEnabled()) {
     this.log.debug("Entering 'order_wd' method ");
   }
   String str1 = "";
   OrderReturnValue localOrderReturnValue = new OrderReturnValue();
   try {
     String str2 = getLogonType(paramString2);
     str1 = getValueByTagName(paramString1, "USER_ID");
     if ("".equals(str1)) {
       str1 = getValueByTagName(paramString1, "TRADER_ID");
     }
     international((String) lanaguages.get(str1));
     Long localLong = new Long(getValueByTagName(paramString1, "ORDER_NO"));
     long l = parseLong(getValueByTagName(paramString1, "SESSION_ID"));
     if (!isLogon(paramHttpServletRequest, str1, l, str2)) {
       paramResponseResult.setRetCode(-201);
       paramResponseResult.setMessage(this.properties.getProperty("-205"));
     } else {
       OrdersManager localOrdersManager = (OrdersManager) getBean("ordersManager");
       Orders localOrders = new Orders();
       localOrders.setA_OrderNo(localLong);
       Privilege localPrivilege = getSessionBean(paramHttpServletRequest);
       List localList = localOrdersManager.my_order_query(localOrders, localPrivilege);
       Map localMap = (Map) localList.get(0);
       String str3 = (String) localMap.get("TraderID");
       int i = 0;
       if (localMap.get("CloseFlag") != null) {
         i = ((BigDecimal) localMap.get("CloseFlag")).intValue();
       }
       if ((str1 != null) && (i != 2)) {
         Order localOrder = new Order();
         localOrder.setCommodityID((String) localMap.get("CommodityID"));
         localOrder.setCustomerID((String) localMap.get("CustomerID"));
         localOrder.setTraderID(str1);
         localOrder.setOrderType(Short.valueOf("4"));
         localOrder.setWithdrawID(localLong);
         String str4 = (String) localMap.get("TRADER_ID");
         if ((str4 == null) || (tradeRMI.getFirmID(str3).equals(localPrivilege.getFirmId()))) {
           paramResponseResult =
               submitOrder(l, localOrder, paramResponseResult, localOrderReturnValue, str2);
         } else {
           paramResponseResult.setRetCode(1);
           paramResponseResult.setMessage(this.properties.getProperty("1"));
         }
       } else if (i == 2) {
         paramResponseResult.setRetCode(1);
         paramResponseResult.setMessage(this.properties.getProperty("-14"));
       } else {
         paramResponseResult.setRetCode(1);
         paramResponseResult.setMessage(this.properties.getProperty("1"));
       }
     }
   } catch (ConnectException localConnectException) {
     this.log.error("change_password rmi conection exception" + localConnectException);
     paramResponseResult.setRetCode(-201);
     paramResponseResult.setMessage(this.properties.getProperty("-201"));
     initRMI();
   } catch (RemoteException localRemoteException) {
     this.log.error("order_wd error:" + localRemoteException.getMessage());
     errorException(localRemoteException);
     paramResponseResult.setRetCode(-202);
     paramResponseResult.setMessage(this.properties.getProperty("-202"));
   } catch (Exception localException) {
     this.log.error("order_wd error:" + localException.getMessage());
     errorException(localException);
     paramResponseResult.setRetCode(-203);
     paramResponseResult.setMessage(this.properties.getProperty("-203"));
   }
   if ("mobile".equals(paramString2)) {
     this.mobileServlet.renderXML(
         paramHttpServletResponse,
         ResponseXml.responseXml(
             str1,
             paramResponseResult.getName(),
             paramResponseResult.getRetCode(),
             paramResponseResult.getMessage()));
   } else {
     renderXML(
         paramHttpServletResponse,
         ResponseXml.responseXml(
             str1,
             paramResponseResult.getName(),
             paramResponseResult.getRetCode(),
             paramResponseResult.getMessage()));
   }
 }