Пример #1
0
 protected void my_weekorder_pagingquery(
     HttpServletRequest paramHttpServletRequest,
     HttpServletResponse paramHttpServletResponse,
     String paramString1,
     ResponseResult paramResponseResult,
     String paramString2) {
   if (this.log.isDebugEnabled()) {
     this.log.debug("Entering 'my_weekorder_pagingquery' method ");
   }
   int i = 0;
   long l1 = 0L;
   String str1 = "";
   String str2 = "";
   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") == null
             ? "1"
             : getValueByTagName(paramString1, "ISDESC");
     if ((str8 == null) || ("".endsWith(str8)) || ("0".endsWith(str8))) {
       str8 = "1000";
     }
     String str11 = getValueByTagName(paramString1, "PAGENUM");
     String str12 = getValueByTagName(paramString1, "ISQUERYALL");
     String str13 = getValueByTagName(paramString1, "PRI");
     String str14 = getValueByTagName(paramString1, "TYPE");
     String str15 = getValueByTagName(paramString1, "STA");
     int j =
         (str8 == null ? 0 : Integer.valueOf(str8).intValue())
             * (str11 == null ? 0 : Integer.valueOf(str11).intValue() - 1);
     if (j < 0) {
       j = 0;
     }
     int k = j + (str8 == null ? 0 : Integer.valueOf(str8).intValue());
     HashMap localHashMap = new HashMap();
     localHashMap.put("startPagingNum", Integer.valueOf(j));
     localHashMap.put("endPagingNum", Integer.valueOf(k));
     localHashMap.put("isQueryAll", str12 == null ? "0" : str12);
     localHashMap.put(this.orderKeyMap.get("PRI"), str13 == null ? "" : str13);
     localHashMap.put(this.orderKeyMap.get("TYPE"), str14 == null ? "0" : str14);
     localHashMap.put(this.orderKeyMap.get("STA"), str15 == null ? "0" : str15);
     long l2 = parseLong(getValueByTagName(paramString1, "SESSION_ID"));
     String str16 = getValueByTagName(paramString1, "UT");
     int m = (str16 == null) || ("0".equals(str16)) || ("".equals(str16.trim())) ? 1 : 0;
     String str17 = m != 0 ? "queryAll" : str16;
     SmallHelper localSmallHelper = new SmallHelper();
     if (!isLogon(paramHttpServletRequest, str2, l2, str3)) {
       i = -201;
       str1 = this.properties.getProperty("-205");
     } else {
       OrdersPagingManager localOrdersPagingManager =
           (OrdersPagingManager) getBean("ordersPagingManager");
       Orders localOrders = new Orders();
       localOrders.setBS_Flag(localShort);
       localOrders.setA_OrderNo(localLong);
       localOrders.setTraderID(str2);
       localOrders.setCommodityID(str6);
       localOrders.setUpdateTime(str17);
       SortCondition localSortCondition = new SortCondition();
       localSortCondition.setStartNu(str7);
       localSortCondition.setIsdesc(Integer.parseInt(str10));
       localSortCondition.setReccnt(str8);
       localSortCondition.setSortfLD((String) this.orderKeyMap.get(str9));
       Privilege localPrivilege = getSessionBean(paramHttpServletRequest);
       if (PrivilegeController.checkSuperTrader(localPrivilege)) {
         localOrders.setSuperTrader("A");
       }
       localSmallHelper.setAction("select ");
       localSmallHelper.setField(
           " max("
               + this.orderKeyMap.get("UT").toString()
               + ")  "
               + this.orderKeyMap.get("UT")
               + " ");
       localSmallHelper.setTable(" t_orders ");
       List localList1 = localOrdersPagingManager.smallHelper(localSmallHelper);
       List localList2 =
           localOrdersPagingManager.my_weekorder_pagingquery(
               localOrders, localPrivilege, localSortCondition, localHashMap);
       List localList3 =
           localOrdersPagingManager.totalDateQuery(
               ("1".equals(str12)) || ("2".equals(str12))
                   ? "my_order_pagingquery"
                   : "my_weekorder_pagingquery",
               localPrivilege,
               localHashMap);
       if (localList2 == null) {
         i = -202;
         str1 = this.properties.getProperty("-208");
       } else if (localList2.size() == 0) {
         i = 0;
         str1 = this.properties.getProperty("-200");
       } else {
         paramResponseResult.setResultList(localList2);
       }
       Object localObject;
       if ((localList1 != null) && (localList1.size() > 0)) {
         localObject = (Map) localList1.get(0);
         l1 = ((Timestamp) ((Map) localObject).get(this.orderKeyMap.get("UT"))).getTime();
       }
       if ((localList3 != null) && (localList3.size() > 0)) {
         localObject = (TotalDate) localList3.get(0);
         paramResponseResult.setTotalDate((TotalDate) localObject);
       }
     }
   } catch (ConnectException localConnectException) {
     this.log.error("my_weekorder_pagingquery rmi conection exception" + localConnectException);
     i = -202;
     str1 = this.properties.getProperty("-201");
     initRMI();
   } catch (RemoteException localRemoteException) {
     this.log.error("my_weekorder_pagingquery remoteerror:" + localRemoteException);
     errorException(localRemoteException);
     i = -204;
     str1 = this.properties.getProperty("-204");
   } catch (Exception localException) {
     this.log.error("my_weekorder_pagingquery error:" + localException);
     errorException(localException);
     i = -203;
     str1 = this.properties.getProperty("-203");
   }
   paramResponseResult.setRetCode(i);
   paramResponseResult.setMessage(str1);
   paramResponseResult.setUserID(str2);
   renderXML(paramHttpServletResponse, ResponseXml.my_order_pagingquery(paramResponseResult, l1));
 }
Пример #2
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));
   }
 }