diff --git a/Supermarket/bin/.idea/dataSources/5b23e521-053a-47c0-ae28-a98b513bc6ec.xml b/Supermarket/bin/.idea/dataSources/5b23e521-053a-47c0-ae28-a98b513bc6ec.xml index a48e493..7c2a72a 100644 --- a/Supermarket/bin/.idea/dataSources/5b23e521-053a-47c0-ae28-a98b513bc6ec.xml +++ b/Supermarket/bin/.idea/dataSources/5b23e521-053a-47c0-ae28-a98b513bc6ec.xml @@ -1,32 +1,13 @@ -<<<<<<< HEAD lower/lower InnoDB InnoDB - |root||root|localhost|ALLOW_NONEXISTENT_DEFINER|G -|root||root|localhost|ALTER|G + |root||root|localhost|ALTER|G |root||root|localhost|ALTER ROUTINE|G -|root||root|localhost|APPLICATION_PASSWORD_ADMIN|G -|root||mysql.infoschema|localhost|AUDIT_ABORT_EXEMPT|G -|root||mysql.session|localhost|AUDIT_ABORT_EXEMPT|G -|root||mysql.sys|localhost|AUDIT_ABORT_EXEMPT|G -|root||root|localhost|AUDIT_ABORT_EXEMPT|G -|root||root|localhost|AUDIT_ADMIN|G -|root||mysql.session|localhost|AUTHENTICATION_POLICY_ADMIN|G -|root||root|localhost|AUTHENTICATION_POLICY_ADMIN|G -|root||mysql.session|localhost|BACKUP_ADMIN|G -|root||root|localhost|BACKUP_ADMIN|G -|root||root|localhost|BINLOG_ADMIN|G -|root||root|localhost|BINLOG_ENCRYPTION_ADMIN|G -|root||mysql.session|localhost|CLONE_ADMIN|G -|root||root|localhost|CLONE_ADMIN|G -|root||mysql.session|localhost|CONNECTION_ADMIN|G -|root||root|localhost|CONNECTION_ADMIN|G |root||root|localhost|CREATE|G -|root||root|localhost|CREATE ROLE|G |root||root|localhost|CREATE ROUTINE|G |root||root|localhost|CREATE TABLESPACE|G |root||root|localhost|CREATE TEMPORARY TABLES|G @@ -34,1665 +15,1319 @@ |root||root|localhost|CREATE VIEW|G |root||root|localhost|DELETE|G |root||root|localhost|DROP|G -|root||root|localhost|DROP ROLE|G -|root||root|localhost|ENCRYPTION_KEY_ADMIN|G |root||root|localhost|EVENT|G |root||root|localhost|EXECUTE|G |root||root|localhost|FILE|G -|root||mysql.infoschema|localhost|FIREWALL_EXEMPT|G -|root||mysql.session|localhost|FIREWALL_EXEMPT|G -|root||mysql.sys|localhost|FIREWALL_EXEMPT|G -|root||root|localhost|FIREWALL_EXEMPT|G -|root||root|localhost|FLUSH_OPTIMIZER_COSTS|G -|root||root|localhost|FLUSH_PRIVILEGES|G -|root||root|localhost|FLUSH_STATUS|G -|root||root|localhost|FLUSH_TABLES|G -|root||root|localhost|FLUSH_USER_RESOURCES|G -|root||root|localhost|GROUP_REPLICATION_ADMIN|G -|root||root|localhost|GROUP_REPLICATION_STREAM|G |root||root|localhost|INDEX|G -|root||root|localhost|INNODB_REDO_LOG_ARCHIVE|G -|root||root|localhost|INNODB_REDO_LOG_ENABLE|G |root||root|localhost|INSERT|G |root||root|localhost|LOCK TABLES|G -|root||root|localhost|OPTIMIZE_LOCAL_TABLE|G -|root||root|localhost|PASSWORDLESS_USER_ADMIN|G -|root||mysql.session|localhost|PERSIST_RO_VARIABLES_ADMIN|G -|root||root|localhost|PERSIST_RO_VARIABLES_ADMIN|G |root||root|localhost|PROCESS|G |root||root|localhost|REFERENCES|G |root||root|localhost|RELOAD|G |root||root|localhost|REPLICATION CLIENT|G |root||root|localhost|REPLICATION SLAVE|G -|root||root|localhost|REPLICATION_APPLIER|G -|root||root|localhost|REPLICATION_SLAVE_ADMIN|G -|root||root|localhost|RESOURCE_GROUP_ADMIN|G -|root||root|localhost|RESOURCE_GROUP_USER|G -|root||root|localhost|ROLE_ADMIN|G -|root||mysql.infoschema|localhost|SELECT|G |root||root|localhost|SELECT|G -|root||root|localhost|SENSITIVE_VARIABLES_OBSERVER|G -|root||root|localhost|SERVICE_CONNECTION_ADMIN|G -|root||mysql.session|localhost|SESSION_VARIABLES_ADMIN|G -|root||root|localhost|SESSION_VARIABLES_ADMIN|G -|root||root|localhost|SET_ANY_DEFINER|G |root||root|localhost|SHOW DATABASES|G |root||root|localhost|SHOW VIEW|G -|root||root|localhost|SHOW_ROUTINE|G -|root||mysql.session|localhost|SHUTDOWN|G |root||root|localhost|SHUTDOWN|G |root||mysql.session|localhost|SUPER|G |root||root|localhost|SUPER|G -|root||mysql.infoschema|localhost|SYSTEM_USER|G -|root||mysql.session|localhost|SYSTEM_USER|G -|root||mysql.sys|localhost|SYSTEM_USER|G -|root||root|localhost|SYSTEM_USER|G -|root||mysql.session|localhost|SYSTEM_VARIABLES_ADMIN|G -|root||root|localhost|SYSTEM_VARIABLES_ADMIN|G -|root||root|localhost|TABLE_ENCRYPTION_ADMIN|G -|root||root|localhost|TELEMETRY_LOG_ADMIN|G -|root||root|localhost|TRANSACTION_GTID_TAG|G |root||root|localhost|TRIGGER|G |root||root|localhost|UPDATE|G -|root||root|localhost|XA_RECOVER_ADMIN|G |root||root|localhost|grant option|G performance_schema|schema||mysql.session|localhost|SELECT|G sys|schema||mysql.sys|localhost|TRIGGER|G - 8.4.0 + 5.7.44 - - armscii8 - - - armscii8 -======= - big5 ->>>>>>> remotes/origin/developer 1 - - ascii + + big5 - - ascii + + dec8 1 - - big5 + + dec8 - - big5 + + cp850 1 - - binary + + cp850 + + + hp8 1 - - cp1250 + + hp8 - - cp1250 + + koi8r + 1 - - cp1250 + + koi8r - - cp1250 + + latin1 + + + latin1 1 - - cp1250 + + latin1 - - cp1251 + + latin1 - - cp1251 + + latin1 - - cp1251 - 1 + + latin1 - - cp1251 + + latin1 - - cp1251 + + latin1 - - cp1256 + + latin2 - - cp1256 + + latin2 1 - - cp1257 - - - cp1257 - 1 + + latin2 - - cp1257 + + latin2 - - cp850 + + latin2 - - cp850 + + swe7 1 - - cp852 + + swe7 - - cp852 + + ascii 1 - - cp866 + + ascii - - cp866 + + ujis 1 - - cp932 + + ujis - - cp932 + + sjis 1 - - dec8 + + sjis - - dec8 + + hebrew 1 - - eucjpms + + hebrew - - eucjpms + + tis620 1 - - euckr + + tis620 euckr 1 - - gb18030 + + euckr - - gb18030 + + koi8u 1 - - gb18030 - - - gb2312 + + koi8u - + gb2312 1 - - gbk - - - gbk - 1 - - - geostd8 + + gb2312 - - geostd8 + + greek 1 - + greek - - greek + + cp1250 1 - - hebrew - - - hebrew - 1 + + cp1250 - - hp8 + + cp1250 - - hp8 - 1 + + cp1250 - - keybcs2 + + cp1250 - - keybcs2 + + gbk 1 - - koi8r + + gbk - - koi8r + + latin5 1 - - koi8u + + latin5 - - koi8u + + armscii8 1 - - latin1 - - - latin1 + + armscii8 - - latin1 + + utf8 + 1 - - latin1 + + utf8 - - latin1 + + utf8 - - latin1 + + utf8 - - latin1 + + utf8 - - latin1 - 1 + + utf8 - - latin2 + + utf8 - - latin2 + + utf8 - - latin2 + + utf8 - - latin2 - 1 + + utf8 - - latin2 + + utf8 - - latin5 + + utf8 - - latin5 - 1 + + utf8 - - latin7 + + utf8 - - latin7 + + utf8 - - latin7 - 1 + + utf8 - - latin7 + + utf8 - - macce + + utf8 - - macce - 1 + + utf8 - - macroman + + utf8 - - macroman - 1 + + utf8 - - sjis + + utf8 - - sjis - 1 + + utf8 - - swe7 + + utf8 - - swe7 - 1 + + utf8 - - tis620 + + utf8 - - tis620 - 1 + + utf8 - + ucs2 + 1 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - 1 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - + ucs2 - - ujis - - - ujis + + cp866 1 - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 + + cp866 - - utf16 + + keybcs2 1 - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16 - - - utf16le + + keybcs2 - - utf16le + + macce 1 - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 + + macce - - utf32 + + macroman 1 - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf32 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 + + macroman - - utf8mb3 + + cp852 1 - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 - - - utf8mb3 + + cp852 - - utf8mb3 + + latin7 - - utf8mb3 + + latin7 + 1 - - utf8mb3 + + latin7 - - utf8mb3 + + latin7 - + utf8mb4 1 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - + utf8mb4 - - utf8mb4 + + cp1251 - - utf8mb4 + + cp1251 - - utf8mb4 + + cp1251 - - utf8mb4 + + cp1251 + 1 - - utf8mb4 + + cp1251 - - utf8mb4 + + utf16 + 1 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16 - - utf8mb4 + + utf16le + 1 - - utf8mb4 + + utf16le - - utf8mb4 + + cp1256 + 1 - - utf8mb4 + + cp1256 - - utf8mb4 + + cp1257 - - utf8mb4 + + cp1257 - - utf8mb4 + + cp1257 + 1 - - utf8mb4 + + utf32 + 1 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4 + + utf32 - - utf8mb4_0900_ai_ci - - - utf8mb4_0900_ai_ci - - - utf8mb4_0900_ai_ci - - - utf8mb4_0900_ai_ci - - - utf8mb3_general_ci - - - utf8mb4_0900_ai_ci - - - utf8mb4_0900_ai_ci - - - utf8mb4_0900_ai_ci - - - utf8mb4_0900_ai_ci - - - utf8mb4_0900_ai_ci - - - utf8mb4_0900_ai_ci + + utf32 + + + binary + 1 + + + geostd8 + 1 + + + geostd8 + + + cp932 + 1 + + + cp932 + + + eucjpms + 1 + + + eucjpms + + + gb18030 + 1 + + + gb18030 + + + gb18030 + + + utf8_general_ci - - utf8mb4_0900_ai_ci + + latin1_swedish_ci - - utf8mb4_0900_ai_ci + + latin1_swedish_ci - - utf8mb4_0900_ai_ci + + latin1_swedish_ci - - utf8mb4_0900_ai_ci + + utf8_general_ci - - utf8mb4_0900_ai_ci + + latin1_swedish_ci - - utf8mb4_0900_ai_ci + + utf8mb4_unicode_ci - - utf8mb4_0900_ai_ci + + utf8_general_ci - - utf8mb4_0900_ai_ci + + utf8mb4_general_ci - - 0 - localhost - caching_sha2_password - - - 0 + localhost - caching_sha2_password - - 0 + localhost - caching_sha2_password - + localhost - caching_sha2_password - - root@localhost - procedure - 320 - - - root@localhost - procedure - 196 - - - root@localhost - procedure - 199 - - - root@localhost - procedure - 184 - - +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- +
InnoDB - utf8mb4_0900_ai_ci + utf8mb4_unicode_ci
- - varchar(30)|0s - 1 - - - timestamp|0s - 2 - - - varchar(20)|0s - 3 - - - int|0s - 4 - - - float|0s - 5 - - - varchar(10)|0s - 1 - - - int|0s - 2 - - - varchar(10)|0s - 1 - - - int|0s - 2 - - - varchar(30)|0s - 1 - - - timestamp|0s - 2 - - - varchar(20)|0s - 3 - - - int|0s - 4 - - - float|0s - 5 - - + varchar(20)|0s 1 1 - + varchar(20)|0s 2 - + float|0s 3 - + float|0s 4 - - int|0s + + int(11)|0s 5 - - int|0s + + int(11)|0s 6 - - int|0s + + int(11)|0s 7 - + varchar(20)|0s 8 - + varchar(20)|0s 9 - + float|0s 10 - - int|0s + + int(11)|0s 0 11 - + supplyId id supplierinf - + id2 id prodcatalog - + id btree 1 - + name btree 1 - + supplyId btree - + id2 btree - + 1 1 PRIMARY - + name - + varchar(30)|0s 1 1 - + float|0s 2 - + timestamp|0s + CURRENT_TIMESTAMP + 1 + CURRENT_TIMESTAMP 3 - + varchar(15)|0s 4 - - int|0s + + int(11)|0s 2 5 - - int|0s + + int(11)|0s 1 6 - + iNumber btree 1 - + 1 1 PRIMARY - + varchar(30)|0s 1 - + varchar(20)|0s 2 - - int|0s + + int(11)|0s 3 - + float|0s 4 - + iNumber iNumber inorder - + iNumber btree - + varchar(20)|0s 1 1 - + varchar(20)|0s 2 - + float|0s 3 - + float|0s 4 - - int|0s + + int(11)|0s 5 - - int|0s + + int(11)|0s 6 - - int|0s + + int(11)|0s 7 - + varchar(20)|0s 8 - + varchar(20)|0s 9 - + float|0s 10 - - int|0s + + int(11)|0s 0 11 - + supplyId id supplierinf - + id2 id prodcatalog - + id btree 1 - + name btree 1 - + supplyId btree - + id2 btree - + 1 1 PRIMARY - + name - + varchar(30)|0s 1 1 - + float|0s 2 - + timestamp|0s + CURRENT_TIMESTAMP + 1 + CURRENT_TIMESTAMP 3 - + varchar(15)|0s 4 - - int|0s + + int(11)|0s 1 5 - + oNumber btree 1 - + 1 1 PRIMARY - + varchar(30)|0s 1 - + varchar(20)|0s 2 - - int|0s + + int(11)|0s 3 - + float|0s 4 - + oNumber oNumber outorder - + oNumber btree - + varchar(20)|0s 1 1 - + varchar(20)|0s 2 - + id btree 1 - + 1 1 PRIMARY - + varchar(20)|0s 1 1 - + varchar(20)|0s 2 - + float|0s 3 - + float|0s 4 - - int|0s + + int(11)|0s 5 - - int|0s + + int(11)|0s 6 - - int|0s + + int(11)|0s 7 - + varchar(20)|0s 8 - + varchar(20)|0s 9 - + float|0s 10 - - int|0s + + int(11)|0s 1 11 - + id2 id prodcatalog - + id btree 1 - + name btree 1 - + id2 btree - + 1 1 PRIMARY - + name - + varchar(30)|0s 1 - + timestamp|0s + CURRENT_TIMESTAMP + 1 + CURRENT_TIMESTAMP 2 - + varchar(20)|0s 3 - + enum('+', '-')|0e 4 - - int|0s + + int(11)|0s 5 - - 8 - int|0s + + 9 + int(11)|0s 1 1 - + varchar(30)|0s 2 - + varchar(50)|0s 3 - + varchar(11)|0s 4 - + varchar(50)|0s 5 - - int|0s + + int(11)|0s 1 6 - + id btree 1 - + name btree 1 - + 1 1 PRIMARY - + name - - 5 - int|0s + + 7 + int(11)|0s 1 1 - + varchar(15)|0s 2 - - varchar(15)|0s + + varchar(255)|0s 3 - + varchar(20)|0s 1 4 - + varchar(11)|0s 5 - - int|0s + + int(11)|0s 1 6 - + varchar(50)|0s 7 - - int|0s + + int(11)|0s 1 8 - + id btree 1 - + name btree 1 - + 1 1 PRIMARY - + name
diff --git a/Supermarket/bin/com/lingnan/supermarket/dao/impl/storageRecordImpl.class b/Supermarket/bin/com/lingnan/supermarket/dao/impl/storageRecordImpl.class index 696d216..3aaf533 100644 Binary files a/Supermarket/bin/com/lingnan/supermarket/dao/impl/storageRecordImpl.class and b/Supermarket/bin/com/lingnan/supermarket/dao/impl/storageRecordImpl.class differ diff --git a/Supermarket/bin/com/lingnan/supermarket/utils/JDBCUtil.class b/Supermarket/bin/com/lingnan/supermarket/utils/JDBCUtil.class index ffef5cd..ee0431a 100644 Binary files a/Supermarket/bin/com/lingnan/supermarket/utils/JDBCUtil.class and b/Supermarket/bin/com/lingnan/supermarket/utils/JDBCUtil.class differ diff --git a/Supermarket/bin/com/lingnan/supermarket/utils/TimeAndOrder.class b/Supermarket/bin/com/lingnan/supermarket/utils/TimeAndOrder.class index 73eb6dd..d0c4b0e 100644 Binary files a/Supermarket/bin/com/lingnan/supermarket/utils/TimeAndOrder.class and b/Supermarket/bin/com/lingnan/supermarket/utils/TimeAndOrder.class differ diff --git a/Supermarket/bin/com/lingnan/supermarket/view/InView$MyItemListener.class b/Supermarket/bin/com/lingnan/supermarket/view/InView$MyItemListener.class index 8dc13e9..f14e9d0 100644 Binary files a/Supermarket/bin/com/lingnan/supermarket/view/InView$MyItemListener.class and b/Supermarket/bin/com/lingnan/supermarket/view/InView$MyItemListener.class differ diff --git a/Supermarket/bin/com/lingnan/supermarket/view/InView.class b/Supermarket/bin/com/lingnan/supermarket/view/InView.class index ac7d0fc..b786056 100644 Binary files a/Supermarket/bin/com/lingnan/supermarket/view/InView.class and b/Supermarket/bin/com/lingnan/supermarket/view/InView.class differ diff --git a/Supermarket/src/com/lingnan/supermarket/dao/impl/storageRecordImpl.java b/Supermarket/src/com/lingnan/supermarket/dao/impl/storageRecordImpl.java index 745adae..2fc09f4 100644 --- a/Supermarket/src/com/lingnan/supermarket/dao/impl/storageRecordImpl.java +++ b/Supermarket/src/com/lingnan/supermarket/dao/impl/storageRecordImpl.java @@ -6,10 +6,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.Vector; -<<<<<<< HEAD // 导入相关的业务逻辑接口、数据传输对象以及工具类,用于数据库操作和日期处理等功能 -======= ->>>>>>> remotes/origin/main import com.lingnan.supermarket.dao.storageRecordService; import com.lingnan.supermarket.dto.StorageRecord; import com.lingnan.supermarket.utils.DateUtil; @@ -18,7 +15,6 @@ import com.lingnan.supermarket.utils.JDBCUtil; // 实现storageRecordService接口--用于处理库存记录相关的数据持久化操作 public class storageRecordImpl implements storageRecordService { -<<<<<<< HEAD // 查询所有库存记录信息,并以Vector容器存储返回 @Override public Vector findAllStorageRecord() { @@ -49,53 +45,12 @@ public class storageRecordImpl implements storageRecordService { // 设置StorageRecord对象的执行情况属性 sr.setExecute(resultSet.getString("execute")); // 通过DateUtil工具类的dateToString方法将数据库中获取的时间戳类型的日期数据转换为字符串类型,方便后续使用(第二个参数为null可能表示使用默认的日期格式转换,具体看DateUtil实现) -======= - /** - * 获取所有存储记录 - * - * @return Vector 所有存储记录的集合 - */ - @Override - public Vector findAllStorageRecord() { - - // 创建一个空的Vector对象,用于存储所有查询到的StorageRecord - Vector v = new Vector(); - - // 通过JDBC获取数据库连接 - Connection conn = JDBCUtil.getConn(); - - // 声明PreparedStatement和ResultSet对象 - PreparedStatement pstmt = null; - ResultSet resultSet = null; - - try { - // 编写SQL查询语句,按存储日期降序排列 - String sql = "select * from storageRecord order by cDate desc"; - - // 准备SQL语句 - pstmt = conn.prepareStatement(sql); - - // 执行查询,获取结果集 - resultSet = pstmt.executeQuery(); - - // 迭代结果集,将每条记录封装成StorageRecord对象 - while (resultSet.next()) { - StorageRecord sr = new StorageRecord(); - - // 设置StorageRecord对象的各个属性 - sr.setId(resultSet.getString("id")); // 设置id字段 - sr.setTheNumber(resultSet.getString("theNumber")); // 设置存储记录编号 - sr.setNum(resultSet.getInt("num")); // 设置数量字段 - sr.setExecute(resultSet.getString("execute")); // 设置执行状态字段 - // 设置创建日期字段,并通过DateUtil工具类格式化日期 ->>>>>>> remotes/origin/main sr.setcDate(DateUtil.dateToString(resultSet.getTimestamp("cDate"), null)); // 将StorageRecord对象添加到Vector中 v.add(sr); } -<<<<<<< HEAD } catch (SQLException e) { // 若出现SQL异常,打印异常栈信息 @@ -116,41 +71,10 @@ public class storageRecordImpl implements storageRecordService { StorageRecord sr = null; // 获取数据库连接 Connection conn = JDBCUtil.getConn(); -======= - } catch (SQLException e) { - // 如果出现SQL异常,打印错误信息 - e.printStackTrace(); - } finally { - // 确保资源被关闭,避免内存泄漏 - JDBCUtil.close(resultSet, pstmt, conn); - } - - // 返回所有存储记录的Vector - return v; - } - - /** - * 根据存储记录编号查找存储记录 - * - * @param theNumber 存储记录编号 - * @return StorageRecord 查找到的存储记录对象,如果未找到则为null - */ - @Override - public StorageRecord findByIdStorageRecord(String theNumber) { - - // 创建一个空的StorageRecord对象,用于存储查询结果 - StorageRecord sr = null; - - // 获取数据库连接 - Connection conn = JDBCUtil.getConn(); - - // 声明PreparedStatement和ResultSet对象 ->>>>>>> remotes/origin/main PreparedStatement pstmt = null; ResultSet resultSet = null; try { -<<<<<<< HEAD // 创建一个新的StorageRecord对象,用于后续封装查询到的数据 sr = new StorageRecord(); // 预编译SQL语句,用于根据给定的库存编号(theNumber)查询storageRecord表中的记录 @@ -163,30 +87,11 @@ public class storageRecordImpl implements storageRecordService { if (resultSet.next()) { sr.setTheNumber((resultSet.getString("theNumber"))); sr.setId((resultSet.getString("id"))); -======= - // 初始化StorageRecord对象 - sr = new StorageRecord(); - - // 编写SQL查询语句,通过存储记录编号查询特定记录 - pstmt = conn.prepareStatement("select * from storageRecord where theNumber=?"); - - // 设置查询条件,即存储记录编号 - pstmt.setString(1, theNumber); - - // 执行查询操作,并将结果存放在resultSet中 - resultSet = pstmt.executeQuery(); - - // 如果查询到数据,填充StorageRecord对象 - if (resultSet.next()) { - sr.setTheNumber(resultSet.getString("theNumber")); - sr.setId(resultSet.getString("id")); ->>>>>>> remotes/origin/main sr.setNum(resultSet.getInt("num")); sr.setExecute(resultSet.getString("execute")); // 设置存储记录的创建日期,并进行格式化 sr.setcDate(DateUtil.dateToString(resultSet.getTimestamp("cDate"), null)); } -<<<<<<< HEAD } catch (SQLException e) { // 若出现SQL异常,打印异常栈信息 @@ -205,44 +110,10 @@ public class storageRecordImpl implements storageRecordService { boolean flag = false; // 获取数据库连接 Connection conn = JDBCUtil.getConn(); -======= - } catch (SQLException e) { - // 如果发生SQLException,打印堆栈信息 - e.printStackTrace(); - } finally { - // 确保资源关闭,防止资源泄露 - JDBCUtil.close(resultSet, pstmt, conn); - } - - // 返回找到的存储记录对象,如果没有找到则返回null - return sr; - } - - /** - * 插入新的存储记录 - * - * @param iNumber 存储记录编号 - * @param time 存储记录时间 - * @param prodId 商品编号 - * @param execute 执行状态 - * @param sum 数量 - * @return boolean 插入是否成功,成功返回true,失败返回false - */ - public boolean insertStorageRecord(String iNumber, String time, String prodId, String execute, int sum) { - - // 默认插入操作失败 - boolean flag = false; - - // 获取数据库连接 - Connection conn = JDBCUtil.getConn(); - - // 声明PreparedStatement和ResultSet对象 ->>>>>>> remotes/origin/main PreparedStatement pstmt = null; ResultSet resultSet = null; try { -<<<<<<< HEAD // 预编译插入数据的SQL语句,向storageRecord表中插入五条数据 pstmt = conn.prepareStatement("insert into storageRecord values(?,?,?,?,?) "); // 设置SQL语句中的第一个参数 @@ -268,43 +139,6 @@ public class storageRecordImpl implements storageRecordService { // 关闭相关资源 JDBCUtil.close(resultSet, pstmt, conn); } - -======= - // 编写SQL插入语句,将数据插入到storageRecord表中 - pstmt = conn.prepareStatement("insert into storageRecord values(?,?,?,?,?)"); - - // 设置插入的字段值 - pstmt.setString(1, iNumber); // 存储记录编号 - pstmt.setString(2, time); // 存储记录时间 - pstmt.setString(3, prodId); // 商品编号 - pstmt.setString(4, execute); // 执行状态 - pstmt.setInt(5, sum); // 数量 - - // 执行插入操作,如果插入成功则返回1 - if (pstmt.executeUpdate() == 1) { - // 如果插入成功,设置标志位为true - flag = true; - } - } catch (SQLException e) { - // 如果发生SQLException,打印堆栈信息 - e.printStackTrace(); - } finally { - - - - - - - - - - - // 确保数据库连接和资源被关闭 - JDBCUtil.close(resultSet, pstmt, conn); - } - - // 返回插入操作的结果(成功返回true,失败返回false) ->>>>>>> remotes/origin/main return flag; } } \ No newline at end of file diff --git a/Supermarket/src/com/lingnan/supermarket/utils/CreateOrder.java b/Supermarket/src/com/lingnan/supermarket/utils/CreateOrder.java index 7acb4ca..5e89edd 100644 --- a/Supermarket/src/com/lingnan/supermarket/utils/CreateOrder.java +++ b/Supermarket/src/com/lingnan/supermarket/utils/CreateOrder.java @@ -8,7 +8,6 @@ import com.lingnan.supermarket.dto.Production; // 用于创建订单相关文本内容 public class CreateOrder { -<<<<<<< HEAD // 用于生成一个完整的订单文本信息,接收商品信息向量、订单编号、时间、总价以及负责人用户名等参数 public String CreateOrder(Vector v, String oNumber, String time, Float allPrice, String username) { // 分割线 @@ -19,25 +18,10 @@ public class CreateOrder { // 添加订单小票中商品信息展示的表头部分 InRequireText += "#名称 #单价 #数量 #金额\r\n"; //循环遍历传入的商品信息向量,将每个商品的具体信息按照设定的格式拼接添加到订单文本中 -======= - // 方法:生成订单小票文本 - public String CreateOrder(Vector v, String oNumber, String time, Float allPrice, String username) { - // 初始化分隔符 - String xx = "----------------------------------------------------------------------------\r\n"; - - // 订单生成时间 - String InRequireText = time + "\r\n" + xx; - - // 添加订单标题 - InRequireText += "#名称 #单价 #数量 #金额\r\n"; - - // 遍历商品列表,生成订单项信息 ->>>>>>> remotes/origin/main for (Production p : v) { InRequireText += p.getName() + " " + p.getInPrice() + " " + p.getSum() + " " + p.getPrice() + "\r\n"; } -<<<<<<< HEAD // 添加一条分割线 InRequireText += "\r\n" + xx; @@ -56,75 +40,3 @@ public class CreateOrder { return InRequireText; } } -======= - // 订单总金额 - InRequireText += "\r\n" + xx; - InRequireText += "#总进货金额:" + allPrice + "元"; - - // 订单负责人和编号 - InRequireText += "\r\n#负责人:" + username; - InRequireText += "\r\n#订单编号:" + oNumber; - - // 商店信息 - InRequireText += "\r\n#地址:新民超市"; - InRequireText += "\r\n#联系电话:xxx"; - - // 加入订单备注 - InRequireText += "\r\n#备注:谢谢光临,欢迎下次购买!"; - - // 空行分隔 - InRequireText += "\r\n"; - - // 添加当前时间的时间戳 - InRequireText += "#生成时间:" + System.currentTimeMillis() + "\r\n"; - - // 订单结束标记 - InRequireText += "----------------------------------------------------------------------------\r\n"; - - // 返回生成的订单小票文本 - return InRequireText; - } - - // 日志记录方法(模拟) - private void logOrderCreation(String oNumber) { - // 这里模拟记录订单生成日志 - System.out.println("订单创建成功,订单编号:" + oNumber); - } - - // 模拟打印订单内容的方法 - public void printOrder(String orderContent) { - // 打印订单内容(实际应用中可能是发送到打印机) - System.out.println(orderContent); - } - - // 订单处理(模拟)方法 - public void processOrder(Vector v, String oNumber, String time, Float allPrice, String username) { - // 创建订单内容 - String orderContent = CreateOrder(v, oNumber, time, allPrice, username); - - // 打印订单 - printOrder(orderContent); - - // 记录订单创建日志 - logOrderCreation(oNumber); - } - - // 添加订单清单格式方法 - private String getOrderListFormat(Vector v) { - StringBuilder orderList = new StringBuilder(); - - for (Production p : v) { - orderList.append(p.getName()) - .append(" - 单价: ") - .append(p.getInPrice()) - .append(",数量: ") - .append(p.getSum()) - .append(",金额: ") - .append(p.getPrice()) - .append("\r\n"); - } - - return orderList.toString(); - } -} ->>>>>>> remotes/origin/main diff --git a/Supermarket/src/com/lingnan/supermarket/utils/JDBCUtil.java b/Supermarket/src/com/lingnan/supermarket/utils/JDBCUtil.java index 4da3682..22a58b4 100644 --- a/Supermarket/src/com/lingnan/supermarket/utils/JDBCUtil.java +++ b/Supermarket/src/com/lingnan/supermarket/utils/JDBCUtil.java @@ -9,16 +9,10 @@ import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; -<<<<<<< HEAD // JDBCUtil工具类,用于管理数据库连接相关的操作,如加载数据库配置、获取数据库连接以及释放相关资源等 public class JDBCUtil { // 用于存储数据库连接相关的配置信息,通过读取配置文件将配置项加载到该对象中 -======= -public class JDBCUtil { - - // Properties对象用于加载配置文件 ->>>>>>> remotes/origin/main private static Properties properties; // 数据库连接的URL地址 private static String url; @@ -27,25 +21,15 @@ public class JDBCUtil { // 数据库连接的密码 private static String password; -<<<<<<< HEAD // 静态代码块,在类加载时执行,主要用于加载数据库配置文件并注册数据库驱动,同时获取配置文件中的连接相关信息 static { // 通过类加载器获取配置文件的输入流,该文件应位于类路径下,以便能够正确读取 InputStream inputStream = JDBCUtil.class.getClassLoader().getResourceAsStream("jdbc.properties"); // 创建一个Properties对象,用于存储键值对形式的配置信息 -======= - // 静态代码块用于加载配置文件和数据库驱动 - static { - // 获取配置文件输入流 - InputStream inputStream = JDBCUtil.class.getClassLoader().getResourceAsStream("jdbc.properties"); - - // 初始化Properties对象 ->>>>>>> remotes/origin/main properties = new Properties(); try { -<<<<<<< HEAD // 将从输入流中读取配置文件的内容加载到Properties对象中 properties.load(inputStream); } catch (IOException e) { @@ -54,16 +38,6 @@ public class JDBCUtil { } finally { // 在完成配置文件读取后释放资源 if (inputStream!= null) { -======= - // 加载配置文件 - properties.load(inputStream); - } catch (IOException e) { - // 如果加载配置文件失败,打印错误信息 - e.printStackTrace(); - } finally { - // 关闭输入流 - if (inputStream != null) { ->>>>>>> remotes/origin/main try { inputStream.close(); } catch (IOException e) { @@ -73,7 +47,6 @@ public class JDBCUtil { } } -<<<<<<< HEAD // 注册数据库驱动 try { // 从配置文件中获取驱动类名属性,并加载该驱动类,类加载过程会执行驱动类中相关的静态代码,完成驱动在系统中的注册 @@ -87,35 +60,15 @@ public class JDBCUtil { password = properties.getProperty("password"); } catch (ClassNotFoundException e) { // 若找不到指定的驱动类,打印异常栈信息 -======= - // 注册JDBC驱动 - try { - // 加载JDBC驱动类 - Class.forName(properties.getProperty("driver")); - - // 获取数据库连接信息 - url = properties.getProperty("url"); - user = properties.getProperty("user"); - password = properties.getProperty("password"); - - } catch (ClassNotFoundException e) { - // 如果驱动类加载失败,打印错误信息 ->>>>>>> remotes/origin/main e.printStackTrace(); } } /** -<<<<<<< HEAD * 获取数据库连接的方法,通过DriverManager根据之前从配置文件中读取并设置好的URL、用户名和密码来建立数据库连接,并返回该连接对象。 * 如果建立连接过程中出现SQL异常,会打印异常栈信息,并返回null,表示获取连接失败。 * * @return 返回建立好的数据库连接对象,若失败则返回null -======= - * 获取数据库连接 - * - * @return 数据库连接 ->>>>>>> remotes/origin/main */ public static Connection getConn() { try { @@ -129,7 +82,6 @@ public class JDBCUtil { } /** -<<<<<<< HEAD * 释放数据库相关资源的方法,用于关闭ResultSet(结果集)、Statement(语句执行对象)以及Connection(数据库连接对象),避免资源泄漏。 * 分别判断传入的对象是否为null,若不为null则调用相应的close方法进行关闭操作,若关闭过程中出现SQL异常,会打印异常栈信息。 * @@ -151,97 +103,9 @@ public class JDBCUtil { if (connection!= null) { connection.close(); } -======= - * 释放数据库资源 - * - * @param resultSet 结果集对象 - * @param statement SQL语句对象 - * @param connection 数据库连接对象 - */ - public static void close(ResultSet resultSet, Statement statement, Connection connection) { - try { - // 释放结果集资源 - if (resultSet != null) { - resultSet.close(); - } - - // 释放Statement资源 - if (statement != null) { - statement.close(); - } - - // 释放Connection资源 - if (connection != null) { - connection.close(); - } - ->>>>>>> remotes/origin/main } catch (SQLException e) { // 如果关闭资源时发生错误,打印错误信息 e.printStackTrace(); } } -<<<<<<< HEAD -} -======= - - /** - * 打印当前数据库配置信息(用于调试) - */ - private static void printDbConfig() { - System.out.println("数据库连接信息:"); - System.out.println("JDBC驱动:" + properties.getProperty("driver")); - System.out.println("数据库URL:" + properties.getProperty("url")); - System.out.println("数据库用户名:" + properties.getProperty("user")); - System.out.println("数据库密码:" + properties.getProperty("password")); - } - - /** - * 获取数据库连接信息的字符串 - * - * @return 数据库连接字符串 - */ - private static String getDbConnectionString() { - return "jdbc connection info: " + url + " as user " + user; - } - - /** - * 测试数据库连接是否正常 - * - * @return true if connection is successful, otherwise false - */ - public static boolean testConnection() { - Connection connection = null; - try { - connection = getConn(); - if (connection != null) { - System.out.println("数据库连接成功!"); - return true; - } else { - System.out.println("数据库连接失败!"); - return false; - } - } catch (Exception e) { - System.out.println("测试数据库连接时发生异常:" + e.getMessage()); - return false; - } finally { - // 关闭连接 - close(null, null, connection); - } - } - - /** - * 记录数据库连接日志 - */ - private static void logConnectionStatus() { - System.out.println("正在尝试连接数据库..."); - } - - /** - * 关闭连接时记录日志 - */ - private static void logCloseConnection() { - System.out.println("数据库连接已关闭。"); - } } ->>>>>>> remotes/origin/main diff --git a/Supermarket/src/com/lingnan/supermarket/utils/TimeAndOrder.java b/Supermarket/src/com/lingnan/supermarket/utils/TimeAndOrder.java index bf7d9cf..11d404f 100644 --- a/Supermarket/src/com/lingnan/supermarket/utils/TimeAndOrder.java +++ b/Supermarket/src/com/lingnan/supermarket/utils/TimeAndOrder.java @@ -8,7 +8,6 @@ import java.util.Random; public class TimeAndOrder { /** -<<<<<<< HEAD * 生成订单号和当前时间戳。 * 订单号由用户名、随机数、当前时间戳和另一个随机数组成。 * 时间戳格式为 "yyyy-MM-dd HH:mm:ss"。 @@ -49,46 +48,11 @@ public class TimeAndOrder { System.out.println(s[1]); // 打印时间戳 // 返回包含订单号和时间戳的字符串数组 -======= - * 生成一个包含订单号和时间的字符串数组 - * @param username 用户名,用于生成订单号 - * @return 一个包含订单号和当前时间的字符串数组 - */ - public static String[] TimeAndOrder(String username) { - // 创建一个长度为2的字符串数组,用于存储订单号和当前时间 - String[] s = new String[2]; - - // 创建两个SimpleDateFormat对象,分别用于不同格式的日期输出 - SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 当前时间的格式 - SimpleDateFormat sdf2 = new SimpleDateFormat("yyyyMMddHHmmss"); // 订单号日期格式(年月日时分秒) - - // 获取当前时间 - Calendar cal = Calendar.getInstance(); - String date1 = sdf1.format(cal.getTime()); // 当前日期时间 - String date2 = sdf2.format(cal.getTime()); // 订单号使用的时间 - - // 生成随机数,以增加订单号的随机性 - Random random = new Random(); - int result1 = random.nextInt(10); // 随机生成一个0到9之间的数字 - int result2 = random.nextInt(10); // 随机生成另一个0到9之间的数字 - - // 生成订单号,将用户名、时间和随机数拼接在一起 - s[0] = username + result1 + date2 + result2; - // 生成当前时间字符串 - s[1] = date1; - - // 打印生成的订单号和时间(调试用) - System.out.println(s[0]); - System.out.println(s[1]); - - // 返回包含订单号和时间的字符串数组 ->>>>>>> remotes/origin/main return s; } /** -<<<<<<< HEAD * 生成当前日期,格式为 "yyyy-MM-dd"。 * * @return 返回当前日期的字符串表示。 @@ -105,39 +69,5 @@ public class TimeAndOrder { // 返回当前日期的字符串表示 return date; -======= - * 获取当前日期(不包含时间) - * @return 当前日期的字符串(格式:yyyy-MM-dd) - */ - public static String yMdTime() { - // 创建一个SimpleDateFormat对象,用于格式化当前日期 - SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd"); - - // 获取当前时间 - Calendar cal = Calendar.getInstance(); - String date = sdf1.format(cal.getTime()); // 获取当前日期的字符串 - - // 返回当前日期字符串 - return date; - } - - /** - * 测试方法,输出当前时间和生成的订单号 - */ - public static void testMethod() { - // 输出当前时间和生成的订单号 - System.out.println("Current time: " + yMdTime()); - String[] orderDetails = TimeAndOrder("testUser"); - System.out.println("Generated order number: " + orderDetails[0]); - System.out.println("Generated time: " + orderDetails[1]); - } - - /** - * 打印日志,记录方法调用 - */ - private static void logMethodCall(String methodName) { - // 模拟打印方法调用日志 - System.out.println("Method " + methodName + " was called."); ->>>>>>> remotes/origin/main } } \ No newline at end of file diff --git a/Supermarket/src/com/lingnan/supermarket/view/InView.java b/Supermarket/src/com/lingnan/supermarket/view/InView.java index 47112d0..15e8c96 100644 --- a/Supermarket/src/com/lingnan/supermarket/view/InView.java +++ b/Supermarket/src/com/lingnan/supermarket/view/InView.java @@ -42,7 +42,6 @@ import com.lingnan.supermarket.utils.SendQQMailUtil; import com.lingnan.supermarket.utils.TimeAndOrder; import com.lingnan.supermarket.view.ProdCatalogView.MyItemListener; -<<<<<<< HEAD /** * 用于显示进货系统的界面。 * 包含进货系统的各种操作按钮、搜索框、表格等组件。 @@ -53,18 +52,9 @@ public class InView extends JPanel implements ActionListener { private JPanel toolBarPanel; // 搜索面板 -======= -public class InView extends JPanel implements ActionListener{ - - - //上面 - private JPanel toolBarPanel; - ->>>>>>> remotes/origin/main private JPanel searchPanel; private JLabel nameLabel, locationLabel; private JTextField nameSearchTF; -<<<<<<< HEAD private JButton searchBtn, StockBtn, exitBtn; // 操作面板 @@ -87,31 +77,10 @@ public class InView extends JPanel implements ActionListener{ private static Vector v = new Vector(); // 状态下拉框 -======= - private JButton searchBtn,StockBtn,exitBtn; - - private JPanel opePanel; - private JButton addBtn,updateBtn,deleteBtn,historyBtn,backBtn,detailBtn; - - //中间 - private JScrollPane tableScrollPane; - private JTable inTable; - - //下面 - private JPanel bottomPanel,bottomPanelLeft,bottomPanelRight; - private JLabel countInfoLabel,countInfoLabel2; - - private Buffer Buffer; - private BufferImpl BufferImpl; - - private static Vector v = new Vector(); - ->>>>>>> remotes/origin/main private JComboBox combo; private String[] status = {"全部", "已入库", "待入库", "已取消"}; private int catalog; -<<<<<<< HEAD // 主窗口和用户信息 private JFrame jFrame; private User user; @@ -129,24 +98,10 @@ public class InView extends JPanel implements ActionListener{ private inOrderServiceImpl inOrderImpl; // 总价和行数 -======= - private JFrame jFrame; - private User user; - - private InTableModel inTableModel ; - - private BufferImpl bufferImpl = new BufferImpl(); - - private int mark;/*标记从提醒那里来1是进货表,0是提醒过来的表*/ - - private inOrderServiceImpl inOrderImpl; - ->>>>>>> remotes/origin/main private Float allPrice; private int row; private String uname; -<<<<<<< HEAD //构造函数 public InView(JFrame jFrame, User user, Vector v, int mark) { @@ -259,148 +214,11 @@ public class InView extends JPanel implements ActionListener{ } //处理状态下拉框的选项变化 -======= - public InView(JFrame jFrame,User user,Vector v,int mark) { - this.setLayout(new BorderLayout()); - this.jFrame = jFrame; - this.user = user; - //获得进货缓冲区的保存的货物并删除缓冲区 - this.v =bufferImpl.allInBuffer(); - bufferImpl.DelAllInBuffer(); - - this.mark=mark; - System.out.println("mark="+mark); - uname = user.getUsername(); - initView(); - - - } - - private void initView() { - - - toolBarPanel = new JPanel(new BorderLayout()); - - searchPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - nameLabel = new JLabel("订单号"); - nameSearchTF = new JTextField(20); - searchBtn = new JButton(new ImageIcon("static\\icon\\search.png")); - searchBtn.addActionListener(this); - locationLabel=new JLabel("当前位置>进货系统"); - locationLabel.setFont(new FontUtil().userFont); - locationLabel.setForeground(new Color(18, 150, 219)); - - - - combo = new JComboBox(status); - combo.addItemListener(new MyItemListener()); - - - - opePanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); - addBtn =new JButton(new ImageIcon("static\\icon\\add.png")); - updateBtn =new JButton(new ImageIcon("static\\icon\\change.png")); - deleteBtn =new JButton(new ImageIcon("static\\icon\\delete.png")); - historyBtn =new JButton(new ImageIcon("static\\icon\\history.png")); - backBtn =new JButton(new ImageIcon("static\\icon\\back.png")); - detailBtn = new JButton(new ImageIcon("static\\icon\\detail.png")); - - addBtn.addActionListener(this); - updateBtn.addActionListener(this); - deleteBtn.addActionListener(this); - historyBtn.addActionListener(this); - backBtn.addActionListener(this); - detailBtn.addActionListener(this); - - backBtn.setVisible(false);/*在记录页面显示出来*/ - detailBtn.setVisible(false);/*在订单详情页显示出来*/ - - opePanel.add(addBtn); - opePanel.add(backBtn); - opePanel.add(detailBtn); - opePanel.add(updateBtn); - opePanel.add(deleteBtn); - opePanel.add(historyBtn); - - - searchPanel.add(locationLabel); - searchPanel.add(nameLabel); - searchPanel.add(nameSearchTF); - searchPanel.add(searchBtn); - searchPanel.add(combo); - - - - toolBarPanel.add(searchPanel,"West"); - toolBarPanel.add(opePanel,"East"); - - - //中间表 - inTableModel = new InTableModel(v); - - inTable = new JTable(inTableModel); - inTable.setFont(FontUtil.tableFont); - inTable.setRowHeight(50); - tableScrollPane = new JScrollPane(inTable); - - allPrice = inTableModel.getAllPrice(); - row = inTableModel.getRowCount(); - - - //下面 - bottomPanelLeft = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - countInfoLabel = new JLabel("商品种类:"+row+",总价:"+allPrice); - bottomPanelLeft.add(countInfoLabel,"Left"); - - bottomPanelRight = new JPanel(new FlowLayout(FlowLayout.LEFT)); - StockBtn =new JButton(new ImageIcon("static\\icon\\stock.png"));/*结账按钮*/ - exitBtn =new JButton(new ImageIcon("static\\icon\\exit.png"));/*退出按钮*/ - StockBtn.addActionListener(this); - exitBtn.addActionListener(this); - bottomPanelRight.add(StockBtn); - bottomPanelRight.add(exitBtn); - - bottomPanel = new JPanel(new BorderLayout()); - bottomPanel.add(bottomPanelRight,"East"); - bottomPanel.add(bottomPanelLeft,"West"); - - - this.add(toolBarPanel,"North"); - this.add(tableScrollPane,"Center");/*将表格放到中间*/ - this.add(bottomPanel,"South"); - - if(mark==1) /*判断是不是从提醒那里过来的*/{ - refreshBuffer(v); - } - - else if(mark==0) { - InOrderRecord(); - } - - - - - - setVisible(true); - - - - - - - } - - public static Vector getVector(){ - return v; - } - ->>>>>>> remotes/origin/main public class MyItemListener implements ItemListener { @Override public void itemStateChanged(ItemEvent e) { -<<<<<<< HEAD JComboBox cb = (JComboBox) e.getSource(); // 获取事件源 String catalog1 = (String) cb.getSelectedItem(); // 获取选中的状态 if (catalog1.equals("全部")) @@ -411,35 +229,12 @@ public class InView extends JPanel implements ActionListener{ catalog = 2; else if (catalog1.equals("已取消")) catalog = 3; -======= - JComboBox cb = (JComboBox) e.getSource(); - String catalog1 = (String) cb.getSelectedItem(); - if(catalog1.equals("全部")) - catalog=0; - else if(catalog1.equals("已入库")) - catalog=1; - else if(catalog1.equals("待入库")) - catalog=2; - else if(catalog1.equals("已取消")) - catalog=3; - - resultOfFindStatus(catalog); ->>>>>>> remotes/origin/main resultOfFindStatus(catalog); // 根据状态查询结果 } } -<<<<<<< HEAD //按钮组件隐藏。 -======= - } - - - - - //按钮组件隐藏 ->>>>>>> remotes/origin/main public void OrderView() { backBtn.setVisible(true); // 显示返回按钮 detailBtn.setVisible(true); // 显示详情按钮 @@ -449,7 +244,6 @@ public class InView extends JPanel implements ActionListener{ historyBtn.setVisible(false); // 隐藏历史记录按钮 } -<<<<<<< HEAD //根据订单号查询结果 public void resultOfNumber(String iNumber) { this.mark = 0; // 设置标记为0 @@ -463,20 +257,6 @@ public class InView extends JPanel implements ActionListener{ } //根据状态查询结果 -======= - - public void resultOfNumber(String iNumber) { - this.mark=0; - InOrderTM inOrderTM = new InOrderTM(); - inOrderTM.resultOfNumber(iNumber); - inTable.setModel(inOrderTM); - bottomPanelLeft.removeAll(); - countInfoLabel = new JLabel("共"+inOrderTM.getRowCount()+"条记录"); - bottomPanelLeft.add(countInfoLabel); - OrderView(); - } - ->>>>>>> remotes/origin/main public void resultOfFindStatus(int catalog) { this.mark = 0; // 设置标记为0 InOrderTM inOrderTM = new InOrderTM(); // 创建进货订单表格模型 @@ -488,7 +268,6 @@ public class InView extends JPanel implements ActionListener{ OrderView(); // 调用OrderView方法 } -<<<<<<< HEAD //刷新缓冲区 public void refreshBuffer(Vector v) { this.mark = 1; // 设置标记为1 @@ -520,64 +299,8 @@ public class InView extends JPanel implements ActionListener{ bottomPanelLeft.add(countInfoLabel); // 将标签添加到底部左侧面板 OrderView(); // 调用OrderView方法 } -======= - - /*刷新*/ - public void refreshBuffer(Vector v) { - this.mark=1; - - InTableModel inTableModel = new InTableModel(v); - inTable.setModel(inTableModel); - bottomPanelLeft.removeAll(); - countInfoLabel = new JLabel("商品种类:"+inTableModel.getRowCount()+",总价:"+inTableModel.getAllPrice()); - bottomPanelLeft.add(countInfoLabel); - backBtn.setVisible(false); - detailBtn.setVisible(false); - historyBtn.setVisible(true); - updateBtn.setVisible(true); - addBtn.setVisible(true); - deleteBtn.setVisible(true); - - allPrice = inTableModel.getAllPrice(); - row = inTableModel.getRowCount(); - } - - /*调出进货订单表*/ - public void InOrderRecord() { - this.mark=0; - InOrderTM inOrderTM = new InOrderTM(); - inOrderTM.allInOrderRecord(); - inTable.setModel(inOrderTM); - bottomPanelLeft.removeAll(); - countInfoLabel = new JLabel("共"+inOrderTM.getRowCount()+"条记录"); - bottomPanelLeft.add(countInfoLabel); - OrderView(); - - } - - /*调出进货订单表*/ - public void InRecord(String iNumber) { - this.mark=2; - InRecordTM inRecordTM = new InRecordTM(iNumber); - inRecordTM.findInRecordByINumber(); - inTable.setModel(inRecordTM); - bottomPanelLeft.removeAll(); - countInfoLabel = new JLabel("订单号@"+iNumber+"共有"+inRecordTM.getRowCount()+"条记录"); - bottomPanelLeft.add(countInfoLabel); - backBtn.setVisible(true); - detailBtn.setVisible(false); - updateBtn.setVisible(false); - addBtn.setVisible(false); - historyBtn.setVisible(false); - deleteBtn.setVisible(false); - - } - - ->>>>>>> remotes/origin/main - // 调出进货订单表 public void InRecord(String iNumber) { this.mark = 2; // 设置标记为2 @@ -598,7 +321,6 @@ public class InView extends JPanel implements ActionListener{ //按钮监听事件 @Override public void actionPerformed(ActionEvent e) { -<<<<<<< HEAD BufferImpl = new BufferImpl(); // 获取购物车 Object source = e.getSource(); // 获取事件源 @@ -729,175 +451,7 @@ public class InView extends JPanel implements ActionListener{ MainView.refreshRemind(); // 刷新提醒 JOptionPane.showConfirmDialog(null, "发送邮件成功\r\n订单号:" + s[0] + "\r\n负责人:" + uname, "提示", JOptionPane.YES_OPTION); // 提示用户发送邮件成功 } -======= - BufferImpl = new BufferImpl();/*获得购物车*/ - Object source = e.getSource(); - - if(searchBtn==source) { - String number = nameSearchTF.getText(); - System.out.println("搜索后的订单:"+number); - resultOfNumber(number); - } - - else if(addBtn==source) {/*添加*/ - InDialog outDialog = new InDialog(jFrame,v,user); - outDialog.setVisible(true); - v=outDialog.getVector(); - refreshBuffer(v); - - } - - - else if(updateBtn==source) {/*更新*/ - System.out.println("mark="+mark); - int rowIndex = inTable.getSelectedRow(); - if(rowIndex==-1) { - JOptionPane.showMessageDialog(this,"请选中一条进行更改数量"); - return; - } - //进货表修改 - if(mark==1) { - String id =(String) inTable.getValueAt(rowIndex,0); - ChangeSumDialog changesumDialog = new ChangeSumDialog(jFrame,id,"In",v); - changesumDialog.setVisible(true); - v = changesumDialog.getVector(); - System.out.println("更改状态后v.size="+v.size()); - refreshBuffer(v); - } - - //inOrder修改,修改状态 - else if(mark==0) { - String iNumber =(String) inTable.getValueAt(rowIndex,0); - String status =(String) inTable.getValueAt(rowIndex,4); - if(status.equals("已入库")) { - JOptionPane.showMessageDialog(this,"订单上的货物已入库无法修改状态","提示",JOptionPane.INFORMATION_MESSAGE); - return; - } - - ChangeStatusDialog changeStatusDialog = new ChangeStatusDialog(jFrame,iNumber,status); - changeStatusDialog.setVisible(true); - MainView.refreshRemind(); - HomeView.refreshHome(); - InOrderRecord(); - } - - } - - - else if(deleteBtn==source) { - int rowIndex = inTable.getSelectedRow(); - if(rowIndex==-1) { - JOptionPane.showMessageDialog(this,"请选中一条"); - return; - } - - /*删除进货表的*/ - if(mark==1) { - System.out.println("删除进货表"); - String id =(String) inTable.getValueAt(rowIndex,0); - int select = JOptionPane.showConfirmDialog(this,"是否删除id为"+id+"的记录","提示",JOptionPane.YES_NO_OPTION); - if(select==JOptionPane.YES_OPTION) {/*选择是*/ - for(int i =0;i(); - refreshBuffer(v); - MainView.refreshRemind(); - JOptionPane.showConfirmDialog(null,"发送邮件成功\r\n订单号:"+s[0]+"\r\n负责人:"+uname, "提示", JOptionPane.YES_OPTION); - - } - - - } - }else if(exitBtn==source) { - int res = JOptionPane.showConfirmDialog(null,"确定退出并清空购物车吗", "结账", JOptionPane.YES_NO_OPTION); - if(res==JOptionPane.YES_OPTION)/*如果退出*/{ - v=new Vector();/*将数组置空*/ - refreshBuffer(v); - JOptionPane.showConfirmDialog(null,"退出成功", "提示", JOptionPane.PLAIN_MESSAGE); ->>>>>>> remotes/origin/main } } else if (exitBtn == source) { // 如果是退出按钮 int res = JOptionPane.showConfirmDialog(null, "确定退出并清空购物车吗", "结账", JOptionPane.YES_NO_OPTION); // 提示用户确认退出 @@ -908,8 +462,4 @@ public class InView extends JPanel implements ActionListener{ } } } -<<<<<<< HEAD -} -======= -} ->>>>>>> remotes/origin/main +} \ No newline at end of file