コード例 #1
0
ファイル: ManageStock.java プロジェクト: chinahuangxin/prjs
  public ResultVO stockOutUpdate(StockOutApplyBO stockOutApplyBO) {
    ResultVO result = new ResultVO();

    WareHouseStockDAO wareHouseStockDAO = Server.getInstance().getWareHouseStockDAO();

    OutStockPO outStock = new OutStockPO();
    outStock.setIdnumber(stockOutApplyBO.getIdnumber());
    outStock.setDeliveryPerson(stockOutApplyBO.getDeliveryPerson());
    outStock.setKey(stockOutApplyBO.getKey());
    outStock.setStatus(0);
    outStock.setStockID(stockOutApplyBO.getStockID());

    outStock.setAddress(stockOutApplyBO.getAddress());
    outStock.setPhone(stockOutApplyBO.getPhone());
    outStock.setDeliveryStatus(Integer.valueOf(stockOutApplyBO.getDeliveryStatus()));

    wareHouseStockDAO.updateOutStock(outStock);

    result.setResult(1L);

    wareHouseStockDAO.addGlobalLog(
        "系统",
        Server.getInstance().getIp(),
        1301,
        "仓单出库申请信息修改,仓单号:" + stockOutApplyBO.getStockID(),
        1);

    return result;
  }
コード例 #2
0
ファイル: ManageStock.java プロジェクト: chinahuangxin/prjs
  public ResultVO stockOut(String stockID, String userID, String userName, String password) {
    ResultVO resultVO = new ResultVO();
    resultVO.setResult(-1L);

    WareHouseStockDAO wareHouseStockDAO = Server.getInstance().getWareHouseStockDAO();

    StockPO stockPO = wareHouseStockDAO.getStockPOByIDAndLocked(stockID);
    if (stockPO == null) {
      resultVO.addErrorInfo(-1292L, new Object[] {stockID});
      return resultVO;
    }
    if (stockPO.getStockStatus() != 0) {
      resultVO.addErrorInfo(-1293L, new Object[] {stockPO.getStockStatusMeaning()});
      return resultVO;
    }
    wareHouseStockDAO.updateStockStatus(stockID, 2);

    Random random = new Random();
    long t1 = 0x7FFFFFFF & System.currentTimeMillis();

    long key = t1 << 32 | Math.abs(random.nextInt());

    OutStockPO outStock = new OutStockPO();
    outStock.setIdnumber(null);
    outStock.setDeliveryPerson(null);
    outStock.setKey(key + "");
    outStock.setStatus(2);
    outStock.setStockID(stockPO.getStockID());
    wareHouseStockDAO.addOutStock(outStock);

    resultVO.setResult(key);

    wareHouseStockDAO.addGlobalLog(
        "系统", Server.getInstance().getIp(), 1301, "仓单直接出库,仓单号:" + stockID, 1);

    UnRegisterRequestVO request = new UnRegisterRequestVO();
    request.setPwd(password);
    request.setQuantity(stockPO.getQuantity());
    request.setStockID(stockPO.getRealStockCode());
    request.setUserID(userID);
    request.setUserName(userName);

    ResponseVO response = this.wareHouseStockService.stockOut(request);
    if ((response == null) || (response.getResult() == null)) {
      throw new BillCoreException("调用仓库系统失败,仓库系统返回信息为空");
    }
    if (response.getResult().getReturnCode() != 0L) {
      if ((response.getResult().getMessage() != null)
          && (response.getResult().getMessage().trim().length() > 0)) {
        throw new BillCoreException(response.getResult().getMessage());
      }
      throw new BillCoreException("仓库系统处理失败");
    }
    return resultVO;
  }
コード例 #3
0
ファイル: ManageStock.java プロジェクト: chinahuangxin/prjs
  public ResultVO stockOutApply(StockOutApplyBO stockOutApplyBO) {
    ResultVO result = new ResultVO();
    result.setResult(-1L);

    WareHouseStockDAO wareHouseStockDAO = Server.getInstance().getWareHouseStockDAO();

    StockPO stockPO = wareHouseStockDAO.getStockPOByIDAndLocked(stockOutApplyBO.getStockID());
    if (stockPO == null) {
      result.addErrorInfo(-1703L, new Object[] {stockOutApplyBO.getStockID()});
      return result;
    }
    if (stockPO.getStockStatus() != 0) {
      result.addErrorInfo(
          -1704L, new Object[] {stockPO.getStockID(), stockPO.getStockStatusMeaning()});
      return result;
    }
    wareHouseStockDAO.updateStockStatus(stockPO.getStockID(), 5);

    Random random = new Random();
    long t1 = 0x7FFFFFFF & System.currentTimeMillis();

    long key = t1 << 32 | Math.abs(random.nextInt());

    OutStockPO outStock = new OutStockPO();
    outStock.setIdnumber(stockOutApplyBO.getIdnumber());
    outStock.setDeliveryPerson(stockOutApplyBO.getDeliveryPerson());
    outStock.setKey(key + "");
    outStock.setStatus(0);
    outStock.setStockID(stockPO.getStockID());

    outStock.setAddress(stockOutApplyBO.getAddress());
    outStock.setPhone(stockOutApplyBO.getPhone());
    outStock.setDeliveryStatus(Integer.valueOf(stockOutApplyBO.getDeliveryStatus()));

    wareHouseStockDAO.addOutStock(outStock);

    result.setResult(key);

    wareHouseStockDAO.addGlobalLog(
        "系统", Server.getInstance().getIp(), 1301, "仓单出库申请,仓单号:" + stockPO.getStockID(), 1);

    return result;
  }