⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stockorderinfo.java

📁 java阿里巴巴代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
			log.LOG_INFO(e.getMessage());
		}
		if (iResult != 0) {
			this.outBuffer.setInt("RESULT_CODE", -1);
			this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
			
		}
		else {
			this.outBuffer.setInt("RESULT_CODE", 0);
			this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
		}
		log.LOG_INFO("退出addstockorder方法...");
	}
	
	
	public int addStockorderinfo(StockorderDAO stockorderDao) throws SaasApplicationException {

		String content = stockorderDao.getContent();
		content = comm.setTextYin(content);
		StockorderExt stockorderExt = new StockorderExt();
		stockorderExt.setParam(":VSTOCK_ID", stockorderDao.getStock_id());
		stockorderExt.setParam(":VCUST_ID", stockorderDao.getCust_id());
		stockorderExt.setParam(":VTITLE", stockorderDao.getTitle());
		stockorderExt.setParam(":VCONTENT", content);
		stockorderExt.setParam(":VSTOCK_ADDR", stockorderDao.getStock_addr());
		stockorderExt.setParam(":VSTOCK_CLASS", "0");
		stockorderExt.setParam(":VSTART_DATE", stockorderDao.getStart_date());
		stockorderExt.setParam(":VEND_DATE", stockorderDao.getEnd_date());
		stockorderExt.setParam(":VSTOCK_TYPE", "0");
		stockorderExt.setParam(":VPUBLISH_USER_ID", stockorderDao.getPublish_user_id());
		stockorderExt.setParam(":VVALIDITY", "0");
		tradeQuery.executeBy(stockorderExt.insBy("INS_BY_ALL"));
		this.outBuffer.setString("ROOT_ID", stockorderDao.getStock_id());
		return 0;
	}
	
	
	
	// 查询当前用户的采购列表
	public void genCustStockorder(Buffers inbuffer) {

		log.LOG_INFO("进入genCustStockorder方法...");
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String query_param = inbuffer.getString("QUERY_PARAM");
		try {
			if (query_param.equals(""))
				this.queryResult = genCustStockorder(cust_id);
			else
				this.queryResult = searchStockorder(query_param, cust_id);
		}
		catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
			
		}
		log.LOG_INFO("退出genCustStockorderr方法...");
	}
	
	
	public ArrayList genCustStockorder(String cust_id) throws SaasApplicationException {

		ArrayList stockorderList = new ArrayList();
		StockorderExt stockorderExt = new StockorderExt();
		stockorderExt.setParam(":VCUST_ID", cust_id);
		stockorderExt.setParam(":VVALIDITY", "0");
		stockorderList = stockorderExt.selByList("SEL_CUST_STOCKORDER");
		return stockorderList;
	}
	
	
	
	// 按标题查询
	public ArrayList searchStockorder(String title, String cust_id) throws SaasApplicationException {

		ArrayList itemsList = new ArrayList();
		StockorderExt stockorderExt = new StockorderExt();
		stockorderExt.setParam(":VTITLE", "%" + title + "%");
		stockorderExt.setParam(":VCUST_ID", cust_id);
		stockorderExt.setParam(":VVALIDITY", "0");
		itemsList = stockorderExt.selByList("SEL_BY_SEARCH");
		return itemsList;
	}
	
	
	
	// 修改
	public void changstockorder(Buffers inbuffer) {

		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		log.LOG_INFO("进入changstockorder方法...");
		int iResult = -1;
		try {
			StockorderDAO stockorderDao = new StockorderDAO();
			stockorderDao.setTitle(inbuffer.getString("TITLE"));
			stockorderDao.setContent(inbuffer.getString("CONTENT"));
			stockorderDao.setStock_addr(inbuffer.getString("STOCK_ADDR"));
			stockorderDao.setStock_id(inbuffer.getString("STOCK_ID"));
			stockorderDao.setStart_date(inbuffer.getString("START_DATE"));
			stockorderDao.setEnd_date(inbuffer.getString("END_DATE"));
			iResult = changstockorder(stockorderDao);
		}
		catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
		}
		if (iResult != 0) {
			this.outBuffer.setInt("RESULT_CODE", -1);
			this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
			
		}
		else {
			this.outBuffer.setInt("RESULT_CODE", 0);
			this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
		}
		log.LOG_INFO("退出changstockorder方法...");
	}
	
	
	public int changstockorder(StockorderDAO stockorderDao) throws SaasApplicationException {

		StockorderExt stockorderExt = new StockorderExt();
		stockorderExt.setParam(":VSTOCK_ID", stockorderDao.getStock_id());
		stockorderExt.setParam(":VTITLE", stockorderDao.getTitle());
		stockorderExt.setParam(":VCONTENT", stockorderDao.getContent());
		stockorderExt.setParam(":VSTOCK_ADDR", stockorderDao.getStock_addr());
		stockorderExt.setParam(":VSTART_DATE", stockorderDao.getStart_date());
		stockorderExt.setParam(":VEND_DATE", stockorderDao.getEnd_date());
		tradeQuery.executeBy(stockorderExt.insBy("UPDATE_BY_STOCKORDER"));
		return 0;
	}
	
	
	
	// 查询单个
	public void genOneStockorder(Buffers inbuffer) {

		log.LOG_INFO("进入genOneStockorder方法...");
		this.outBuffer = inbuffer;
		String stock_id = inbuffer.getString("STOCK_ID");
		try {
			
			this.queryResult = genOneStockorder(stock_id);
			
		}
		catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
			
		}
		log.LOG_INFO("退出genOneStockorder方法...");
	}
	
	
	public ArrayList genOneStockorder(String stock_id) throws SaasApplicationException {

		ArrayList stockorderList = new ArrayList();
		StockorderExt stockorderExt = new StockorderExt();
		stockorderExt.setParam(":VSTOCK_ID", stock_id);
		stockorderList = stockorderExt.selByList("SEL_BY_PK");
		return stockorderList;
	}
	
	
	
	// 删除一条采购信息
	public void delStockorder(Buffers inbuffer) {

		log.LOG_INFO("进入delStockorder方法...");
		this.outBuffer = inbuffer;
		String stock_id = inbuffer.getString("STOCK_ID");
		int iResult = -1;
		try {
			iResult = delStockorder(stock_id);
		}
		catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
		}
		if (iResult != 0) {
			this.outBuffer.setInt("RESULT_CODE", -1);
			this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
			
		}
		else {
			this.outBuffer.setInt("RESULT_CODE", 0);
			this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
		}
		log.LOG_INFO("退出delStockorder方法...");
	}
	
	
	public int delStockorder(String stock_id) throws SaasApplicationException {

		StockorderExt stockorderExt = new StockorderExt();
		stockorderExt.setParam(":VSTOCK_ID", stock_id);
		tradeQuery.executeBy(stockorderExt.insBy("DEL_BY_ID"));
		return 0;
	}
	
	
	
	// 采购信息分页查询
	public ArrayList getStockListByAll(int iStart, String cust_id) throws SaasApplicationException {

		ArrayList stockList = new ArrayList();
		StockorderExt stockorderExt = new StockorderExt();
		stockorderExt.setParam(":VCUST_ID", cust_id);
		if (iStart > 1) {
			iStart = (iStart - 1) * 20;
		}
		else {
			iStart = 0;
		}
		stockorderExt.setParam(":VVALIDITY", "0");
		stockList = stockorderExt.selByList("SEL_CUST_STOCKORDER", iStart, 20);
		return stockList;
	}
	
	
	
	// 采购信息分页统计
	public int getStockListNumber(String cust_id) throws SaasApplicationException {

		ArrayList stockList = new ArrayList();
		StockorderExt stockorderExt = new StockorderExt();
		stockorderExt.setParam(":VCUST_ID", cust_id);
		stockList = stockorderExt.selByList("SEL_STOCK_CT");
		if (stockList != null && stockList.size() > 0) {
			HashMap map = (HashMap) stockList.get(0);
			return Integer.parseInt(map.get("ct").toString());
		}
		else {
			return 0;
		}
	}
	
	
	
	// 分页搜索查询
	public ArrayList getStockListBySearch(int iStart, String Keys) throws SaasApplicationException {

		if (iStart == 0) {
			iStart = 0;
		}
		else {
			iStart = (iStart - 1) * 30;
		}
		ArrayList productList = new ArrayList();
		StockorderExt productExt = new StockorderExt();
		productExt.setParam(":VCONTENT", "%" + Keys.trim() + "%");
		productList = productExt.selByList("SEL_BY_KEYS", iStart, 30);
		return productList;
	}
	
	
	
	// 分页搜索统计
	public int getStockSearch(String Keys) throws SaasApplicationException {

		ArrayList productList = new ArrayList();
		StockorderExt productExt = new StockorderExt();
		productExt.setParam(":VCONTENT", "%" + Keys.trim() + "%");
		productList = productExt.selByList("SEL_BY_KEYS");
		if (productList != null) {
			return productList.size();
		}
		else {
			return 0;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -