public ResultVO withdrowStockOutApply(String stockID) { ResultVO resultVO = new ResultVO(); resultVO.setResult(-1L); WareHouseStockDAO wareHouseStockDAO = Server.getInstance().getWareHouseStockDAO(); StockPO stockPO = wareHouseStockDAO.getStockPOByIDAndLocked(stockID); if (stockPO == null) { resultVO.addErrorInfo(-1902L, new Object[] {stockID}); return resultVO; } if (stockPO.getStockStatus() != 5) { resultVO.addErrorInfo( -1903L, new Object[] {stockPO.getStockID(), stockPO.getStockStatusMeaning()}); return resultVO; } OutStockPO outStock = wareHouseStockDAO.getUnAuditOutStockByStockID(stockID); if (outStock == null) { resultVO.addErrorInfo(-1904L, new Object[] {stockPO.getStockID()}); return resultVO; } wareHouseStockDAO.updateStockStatus(stockID, 0); wareHouseStockDAO.updateOutStockStatus(outStock.getOutStockID(), 1); resultVO.setResult(1L); return resultVO; }
public ResultVO stockOutAudit(StockOutAuditBO stockOutAuditBO) { ResultVO result = new ResultVO(); result.setResult(-1L); WareHouseStockDAO wareHouseStockDAO = Server.getInstance().getWareHouseStockDAO(); StockPO stockPO = wareHouseStockDAO.getStockPOByIDAndLocked(stockOutAuditBO.getStockID()); if (stockPO == null) { result.addErrorInfo(-1803L, new Object[] {stockOutAuditBO.getStockID()}); return result; } if (stockPO.getStockStatus() != 5) { result.addErrorInfo( -1804L, new Object[] {stockPO.getStockID(), stockPO.getStockStatusMeaning()}); return result; } OutStockPO outStock = wareHouseStockDAO.getUnAuditOutStockByStockID(stockOutAuditBO.getStockID()); if (outStock == null) { result.addErrorInfo(-1808L, new Object[] {stockPO.getStockID()}); return result; } if (!stockOutAuditBO.getKey().equals(outStock.getKey())) { result.addErrorInfo(-1805L); return result; } if (!stockOutAuditBO.getDeliveryPerson().equals(outStock.getDeliveryPerson())) { result.addErrorInfo(-1806L); return result; } wareHouseStockDAO.updateStockStatus(stockPO.getStockID(), 2); wareHouseStockDAO.updateOutStockStatus(outStock.getOutStockID(), 2); wareHouseStockDAO.addGlobalLog( "系统", Server.getInstance().getIp(), 1301, "仓单出库,仓单号:" + stockPO.getStockID(), 1); result.setResult(1L); return result; }