Beispiel #1
0
  public ResultVO logoutStock(String stockID) {
    ResultVO resultVO = new ResultVO();
    resultVO.setResult(-1L);
    WareHouseStockDAO wareHouseStockDAO = Server.getInstance().getWareHouseStockDAO();
    StockPO stockPO = wareHouseStockDAO.getStockPOByIDAndLocked(stockID);
    if (stockPO == null) {
      resultVO.addErrorInfo(-1272L, new Object[] {stockID});
      return resultVO;
    }
    if (stockPO.getStockStatus() != 1) {
      resultVO.addErrorInfo(-1273L, new Object[] {stockPO.getStockStatusMeaning()});
      return resultVO;
    }
    List<StockOperationPO> list = wareHouseStockDAO.getStockOperation(stockPO.getStockID());
    if (list.size() > 0) {
      String operationStr = "";
      for (StockOperationPO o : list) {
        if (operationStr.length() == 0) {
          operationStr = StockOperation.getName(o.getOperationID());
        } else {
          operationStr = operationStr + "、" + StockOperation.getName(o.getOperationID());
        }
      }
      resultVO.addErrorInfo(-1274L, new Object[] {operationStr, stockPO.getStockID()});
      return resultVO;
    }
    wareHouseStockDAO.updateStockStatus(stockID, 0);

    wareHouseStockDAO.addGlobalLog(
        "系统", Server.getInstance().getIp(), 1301, "注销仓单,仓单号:" + stockID, 1);

    resultVO.setResult(1L);
    return resultVO;
  }
 public ResultVO frozenStocks(int paramInt, String[] paramArrayOfString) {
   ResultVO localResultVO = new ResultVO();
   localResultVO.setResult(-1L);
   WareHouseStockDAO localWareHouseStockDAO = Server.getInstance().getWareHouseStockDAO();
   ArrayList localArrayList = new ArrayList();
   StockPO localStockPO;
   Object localObject1;
   Object localObject2;
   for (int i = 0; i < paramArrayOfString.length; i++) {
     localStockPO = localWareHouseStockDAO.getStockPOByIDAndLocked(paramArrayOfString[i]);
     if (localStockPO == null) {
       localResultVO.addErrorInfo(-1504L, new Object[] {paramArrayOfString[i]});
       return localResultVO;
     }
     if (localStockPO.getStockStatus() != 1) {
       localResultVO.addErrorInfo(-1505L, new Object[] {localStockPO.getStockID()});
       return localResultVO;
     }
     localObject1 = localWareHouseStockDAO.getStockOperation(paramArrayOfString[i]);
     if (((List) localObject1).size() > 0) {
       localObject2 = "";
       Iterator localIterator2 = ((List) localObject1).iterator();
       while (localIterator2.hasNext()) {
         StockOperationPO localStockOperationPO = (StockOperationPO) localIterator2.next();
         if (((String) localObject2).length() == 0) {
           localObject2 = StockOperation.getName(localStockOperationPO.getOperationID());
         } else {
           localObject2 =
               (String) localObject2
                   + "、"
                   + StockOperation.getName(localStockOperationPO.getOperationID());
         }
       }
       localResultVO.addErrorInfo(-1506L, new Object[] {localStockPO.getStockID(), localObject2});
       return localResultVO;
     }
     localArrayList.add(localStockPO);
   }
   Iterator localIterator1 = localArrayList.iterator();
   while (localIterator1.hasNext()) {
     localStockPO = (StockPO) localIterator1.next();
     localObject1 = new StockOperationPO();
     ((StockOperationPO) localObject1).setStockID(localStockPO.getStockID());
     ((StockOperationPO) localObject1).setOperationID(StockOperation.FROZEN.getOperation());
     localWareHouseStockDAO.insertStockOperation((StockOperationPO) localObject1);
     localObject2 = new FrozenStockPO();
     ((FrozenStockPO) localObject2).setStockID(localStockPO.getStockID());
     ((FrozenStockPO) localObject2).setModuleID(paramInt);
     ((FrozenStockPO) localObject2).setStatus(0);
     localWareHouseStockDAO.insertFrozenStockPO((FrozenStockPO) localObject2);
     localWareHouseStockDAO.addGlobalLog(
         "系统",
         Server.getInstance().getIp(),
         1301,
         "冻结仓单,系统模块号:" + paramInt + "仓单编号:" + localStockPO.getStockID() + ";",
         1);
   }
   localResultVO.setResult(1L);
   return localResultVO;
 }
 public ResultVO sellStock(int paramInt, String paramString1, String paramString2) {
   ResultVO localResultVO = new ResultVO();
   localResultVO.setResult(-1L);
   WareHouseStockDAO localWareHouseStockDAO = Server.getInstance().getWareHouseStockDAO();
   StockPO localStockPO = localWareHouseStockDAO.getStockPOByIDAndLocked(paramString2);
   if (localStockPO == null) {
     localResultVO.addErrorInfo(-1100L, new Object[] {paramString2});
     return localResultVO;
   }
   if (localStockPO.getStockStatus() != 1) {
     localResultVO.addErrorInfo(-1101L, new Object[] {paramString2});
     return localResultVO;
   }
   List localList = localWareHouseStockDAO.getStockOperation(localStockPO.getStockID());
   if (localList.size() > 0) {
     String localObject1 = "";
     Iterator localObject2 = localList.iterator();
     while (((Iterator) localObject2).hasNext()) {
       StockOperationPO localStockOperationPO =
           (StockOperationPO) ((Iterator) localObject2).next();
       if (((String) localObject1).length() == 0) {
         localObject1 = StockOperation.getName(localStockOperationPO.getOperationID());
       } else {
         localObject1 =
             (String) localObject1
                 + "、"
                 + StockOperation.getName(localStockOperationPO.getOperationID());
       }
     }
     localResultVO.addErrorInfo(-1102L, new Object[] {localObject1, localStockPO.getStockID()});
     return localResultVO;
   }
   Object localObject1 = new StockOperationPO();
   ((StockOperationPO) localObject1).setStockID(localStockPO.getStockID());
   ((StockOperationPO) localObject1).setOperationID(StockOperation.SELL.getOperation());
   localWareHouseStockDAO.insertStockOperation((StockOperationPO) localObject1);
   Object localObject2 = new PledgeStockPO();
   ((PledgeStockPO) localObject2).setStockID(localStockPO.getStockID());
   ((PledgeStockPO) localObject2).setModuleid(paramInt);
   ((PledgeStockPO) localObject2).setOrderID(paramString1);
   ((PledgeStockPO) localObject2).setStatus(0L);
   localWareHouseStockDAO.insertPledgeStock((PledgeStockPO) localObject2);
   localWareHouseStockDAO.addGlobalLog(
       "系统",
       Server.getInstance().getIp(),
       1301,
       localStockPO.getOwnerFirm()
           + "卖仓单,参与交易的委托号:"
           + paramString1
           + ";参与交易的仓单号:"
           + localStockPO.getStockID()
           + ";",
       1);
   localResultVO.setResult(1L);
   return localResultVO;
 }
 public FinancingApplyVO startFinancing(String paramString, long paramLong) {
   FinancingApplyVO localFinancingApplyVO = new FinancingApplyVO();
   localFinancingApplyVO.setResult(-1L);
   WareHouseStockDAO localWareHouseStockDAO = Server.getInstance().getWareHouseStockDAO();
   StockPO localStockPO = localWareHouseStockDAO.getStockPOByIDAndLocked(paramString);
   if (localStockPO == null) {
     localFinancingApplyVO.addErrorInfo(-1100L, new Object[] {paramString});
     return localFinancingApplyVO;
   }
   if (localStockPO.getStockStatus() != 1) {
     localFinancingApplyVO.addErrorInfo(-1101L, new Object[] {paramString});
     return localFinancingApplyVO;
   }
   List localList = localWareHouseStockDAO.getStockOperation(localStockPO.getStockID());
   if (localList.size() > 0) {
     String localObject1 = "";
     Iterator localObject2 = localList.iterator();
     while (((Iterator) localObject2).hasNext()) {
       StockOperationPO localStockOperationPO =
           (StockOperationPO) ((Iterator) localObject2).next();
       if (((String) localObject1).length() == 0) {
         localObject1 = StockOperation.getName(localStockOperationPO.getOperationID());
       } else {
         localObject1 =
             (String) localObject1
                 + "、"
                 + StockOperation.getName(localStockOperationPO.getOperationID());
       }
     }
     localFinancingApplyVO.addErrorInfo(
         -1202L, new Object[] {localObject1, localStockPO.getStockID()});
     return localFinancingApplyVO;
   }
   Object localObject1 = new StockOperationPO();
   ((StockOperationPO) localObject1).setStockID(paramString);
   ((StockOperationPO) localObject1).setOperationID(StockOperation.FINANCING.getOperation());
   localWareHouseStockDAO.insertStockOperation((StockOperationPO) localObject1);
   Object localObject2 = new FinancingStockPO();
   ((FinancingStockPO) localObject2).setStockID(paramString);
   ((FinancingStockPO) localObject2).setFinancingstockID(paramLong);
   localWareHouseStockDAO.addFinancingStock((FinancingStockPO) localObject2);
   localWareHouseStockDAO.addGlobalLog(
       "系统",
       Server.getInstance().getIp(),
       1301,
       paramString + "参与融资:" + ";融资仓单号:" + paramLong + ";",
       1);
   localFinancingApplyVO.setResult(1L);
   localFinancingApplyVO.setFinancingStockID(paramLong);
   return localFinancingApplyVO;
 }