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

📄 goodnotenoughwarningjpanel.java

📁 JAVA实现的酒店管理系统
💻 JAVA
字号:
package file1;

/*
 * @Author:
 * Create Time:2008-2-23
 * Description:最低库存量的货品显示面版,在仓库管理员登录系统时自动弹出显示
 */
import javax.swing.*;
import java.util.*;
import tools.DateFormatter;
import java.awt.*;

public class GoodNotEnoughWarningJPanel extends JPanel {

	private JTable recTable = null;
	private JScrollPane recScrollPane = null;
	private String[] head = { "货品类型", "货品名称", "最低允许库存量", "目前库存量", "不足数量",
			"统计日期" };
	private int headNum = 0;
	private String[][] data = null;
	private int totalCount = 0;// 总的记录数

	public GoodNotEnoughWarningJPanel() {
		headNum = head.length;
		Good good = new Good();
		good
				.setProperty(
						"strQuery",
						"select Good.ID,goodName,typeID,storeIn,singlePriceIn,singlePriceOut,storeInLimit,typeName from Good,GoodType where Good.typeID=GoodType.ID and storeIn<storeInLimit order by Good.ID asc");
		GoodOperate goodOperate = new GoodOperate();
		ArrayList valuesGet = goodOperate.selectFromDB(good);
		Iterator it = valuesGet.iterator();
		int total = valuesGet.size();// 总的记录数
		data = new String[total][headNum];
		totalCount = total;// 把值赋给记录记录总数的变量
		total = 0;// 重新置零
		for (int i = 0; i < valuesGet.size(); i++) {
			Good goodGet = (Good) valuesGet.get(i);
			data[total][0] = (String) goodGet.getProperty("typeName");
			data[total][1] = goodGet.getGoodName();
			data[total][2] = String.valueOf(goodGet.getStoreInLimit());
			data[total][3] = String.valueOf(goodGet.getStoreIn());
			data[total][4] = String.valueOf(goodGet.getStoreInLimit()
					- goodGet.getStoreIn());
			data[total][5] = DateFormatter.doFormat(new Date());
			total++;
		}
		recTable = new JTable(data, head);
		recScrollPane = new JScrollPane(recTable);
		this.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
		this.add(recScrollPane);
		this.validate();
	}

	public int getTotalCount() {// 返回库存不足的记录总数
		return totalCount;
	}
}

⌨️ 快捷键说明

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