Merge branch 'main' into branch_zyx

# Conflicts:
#	test.txt3
branch_zyx
郑亦歆 9 months ago
commit f19c4fa975

@ -3,5 +3,5 @@
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="21" project-jdk-type="JavaSDK" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK" />
</project>

@ -6,6 +6,6 @@
<classpathentry kind="src" path="config"/>
<classpathentry kind="lib" path="Supermarket/lib/activation.jar"/>
<classpathentry kind="lib" path="Supermarket/lib/mail.jar"/>
<classpathentry kind="lib" path="Supermarket/lib/mysql-connector-java-5.1.32.jar"/>
<classpathentry kind="lib" path="Supermarket/lib/mysql-connector-java-8.0.20.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

@ -2,7 +2,7 @@
<project version="4">
<component name="dataSourceStorageLocal" created-in="IU-231.8109.175">
<data-source name="@localhost" uuid="5b23e521-053a-47c0-ae28-a98b513bc6ec">
<database-info product="MySQL" version="5.7.44-log" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-j-8.2.0 (Revision: 06a1f724497fd81c6a659131fda822c9e5085b6c)" dbms="MYSQL" exact-version="5.7.44" exact-driver-version="8.2">
<database-info product="MySQL" version="8.4.0" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-j-8.2.0 (Revision: 06a1f724497fd81c6a659131fda822c9e5085b6c)" dbms="MYSQL" exact-version="8.4.0" exact-driver-version="8.2">
<extra-name-characters>#@</extra-name-characters>
<identifier-quote-string>`</identifier-quote-string>
</database-info>

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="mysql.connector.java" type="repository">
<properties maven-id="mysql:mysql-connector-java:8.0.20" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/mysql-connector-java-8.0.20.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/protobuf-java-3.6.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="file://D:/大二下学期实训超市管理系统/Supermarket/lib/activation.jar" />
<libelement value="file://D:/大二下学期实训超市管理系统/Supermarket/lib/mail.jar" />
<libelement value="file://D:/大二下学期实训超市管理系统/Supermarket/lib/mysql-connector-java-5.1.32.jar" />
<libelement value="file://$MODULE_DIR$/../../../大二下学期实训超市管理系统/Supermarket/lib/activation.jar" />
<libelement value="file://$MODULE_DIR$/../../../大二下学期实训超市管理系统/Supermarket/lib/mail.jar" />
<libelement value="file://$MODULE_DIR$/../../../大二下学期实训超市管理系统/Supermarket/lib/mysql-connector-java-5.1.32.jar" />
<src_description expected_position="1">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
<src_folder value="file://$MODULE_DIR$" expected_position="1" />
@ -47,5 +47,6 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="mysql.connector.java" level="project" />
</component>
</module>

@ -6,6 +6,6 @@
<classpathentry kind="src" path="config"/>
<classpathentry kind="lib" path="Supermarket/lib/activation.jar"/>
<classpathentry kind="lib" path="Supermarket/lib/mail.jar"/>
<classpathentry kind="lib" path="Supermarket/lib/mysql-connector-java-5.1.32.jar"/>
<classpathentry kind="lib" path="Supermarket/lib/mysql-connector-java-8.0.20.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

@ -2,7 +2,7 @@
<project version="4">
<component name="dataSourceStorageLocal" created-in="IU-231.8109.175">
<data-source name="@localhost" uuid="5b23e521-053a-47c0-ae28-a98b513bc6ec">
<database-info product="MySQL" version="5.7.44-log" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-j-8.2.0 (Revision: 06a1f724497fd81c6a659131fda822c9e5085b6c)" dbms="MYSQL" exact-version="5.7.44" exact-driver-version="8.2">
<database-info product="MySQL" version="8.4.0" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-j-8.2.0 (Revision: 06a1f724497fd81c6a659131fda822c9e5085b6c)" dbms="MYSQL" exact-version="8.4.0" exact-driver-version="8.2">
<extra-name-characters>#@</extra-name-characters>
<identifier-quote-string>`</identifier-quote-string>
</database-info>

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="file://D:/大二下学期实训超市管理系统/Supermarket/lib/activation.jar" />
<libelement value="file://D:/大二下学期实训超市管理系统/Supermarket/lib/mail.jar" />
<libelement value="file://D:/大二下学期实训超市管理系统/Supermarket/lib/mysql-connector-java-5.1.32.jar" />
<libelement value="file://$MODULE_DIR$/../../../大二下学期实训超市管理系统/Supermarket/lib/activation.jar" />
<libelement value="file://$MODULE_DIR$/../../../大二下学期实训超市管理系统/Supermarket/lib/mail.jar" />
<libelement value="file://$MODULE_DIR$/../../../大二下学期实训超市管理系统/Supermarket/lib/mysql-connector-java-5.1.32.jar" />
<src_description expected_position="1">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
<src_folder value="file://$MODULE_DIR$" expected_position="1" />
@ -47,5 +47,6 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="mysql.connector.java" level="project" />
</component>
</module>

@ -1,4 +1,4 @@
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/supermarket
driver=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/supermarket?serverTimezone=UTC
user=root
password=123456
password=040820

@ -1,4 +1,4 @@
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/supermarket
driver=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/supermarket?serverTimezone=UTC
user=root
password=123456
password=040820

@ -1,4 +1,4 @@
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/supermarket
driver=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/supermarket?serverTimezone=UTC
user=root
password=123456
password=040820

@ -52,9 +52,10 @@ public class inOrderServiceImpl implements inOrderService{
try {
// 准备SQL语句根据订单号查找特定的订单
preparedStatement = conn.prepareStatement("select * from inOrder where iNumber = ?");
preparedStatement = conn.prepareStatement("select * from inOrder where iNumber = ?"); //根据订单号查询订单
preparedStatement.setString(1, iNumber); // 设置订单号参数
resultSet = preparedStatement.executeQuery(); // 执行查询
// 设置查询到的订单的属性到InOrder对象中
if (resultSet.next()) { // 如果找到对应记录
// 从结果集中获取属性并设置到inOrder对象
inOrder.setiNumber(resultSet.getString("iNumber"));

@ -486,7 +486,7 @@ public class InView extends JPanel implements ActionListener{
CreateOrder createOrder = new CreateOrder();
String OrderText = createOrder.CreateOrder(v, s[0], s[1], allPrice,uname);
try {/*发送邮件*/
SendQQMailUtil QQEmail = new SendQQMailUtil("sender@qq.com","自行获取 SMTP 授权码","receiver@qq.com","@新民超市进货需求申请",OrderText);
SendQQMailUtil QQEmail = new SendQQMailUtil("cwfeng5@qq.com","wlcinslohrgpdiac","1912638153@qq.com","@新民超市进货需求申请",OrderText);
} catch (MessagingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();

@ -56,7 +56,7 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
/*菜单栏*/
JLabel logoLabel,userMenuLabel1,homeMenuLabel,userMenuLabel,inMenuLabel,
outMenuLabel,storageMenuLabel,supplierMenuLabel,catalogMenuLabel;
outMenuLabel,storageMenuLabel,supplierMenuLabel,catalogMenuLabel;
static JLabel remindMenuLabel;/*全局调用刷新*/
@ -126,7 +126,6 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
this.addWindowListener(this);
//获得未进货的信息
Vector<InOrder> vInOrder;
vInOrder = inOrderImpl.findUnconfirmInOrder();
@ -364,92 +363,149 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
}
@Override/*左侧菜单栏点击事件*/
/**
* cwf 2024/12/11
*
*/
@Override
/* 左侧菜单栏点击事件 */
public void mouseClicked(MouseEvent e) {
Object source = e.getSource();
if(source==homeMenuLabel) {
rightPanelLayout.show(rightPanel,"0");
location=0;
}else if(source==userMenuLabel) {
if(sSuper==0)
rightPanelLayout.show(rightPanel,"1");
else{
rightPanelLayout.show(rightPanel,"7");
Object source = e.getSource(); // 获取点击事件的来源
// 如果点击的是首页菜单
if (source == homeMenuLabel) {
rightPanelLayout.show(rightPanel, "0"); // 显示首页界面
location = 0; // 设置当前位置为首页
}
// 如果点击的是人员管理菜单
else if (source == userMenuLabel) {
// 如果用户是管理员 (sSuper == 0) 或进货员 (sSuper == 1)
if (sSuper == 0 || sSuper == 1) {
rightPanelLayout.show(rightPanel, "1"); // 显示人员管理界面
}
// 如果用户是普通用户 (sSuper == 3)
else if (sSuper == 3) {
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
}
// 其他情况(例如普通用户权限)
else {
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
}
location=1;
location = 1; // 设置当前位置为人员管理
}
else if(source==inMenuLabel) {
if(sSuper==2)
rightPanelLayout.show(rightPanel,"7");
else{
rightPanelLayout.show(rightPanel,"2");
// 如果点击的是进货系统菜单
else if (source == inMenuLabel) {
// 如果用户是普通用户 (sSuper == 2) 或进货员 (sSuper == 1)
if (sSuper == 2 || sSuper == 1) {
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
}
// 其他情况(例如管理员权限)
else {
rightPanelLayout.show(rightPanel, "2"); // 显示进货系统界面
}
location=2;
location = 2; // 设置当前位置为进货系统
}
else if(source==outMenuLabel) {
rightPanelLayout.show(rightPanel,"3");
location=3;
// 如果点击的是收银系统菜单
else if (source == outMenuLabel) {
// 如果用户是普通用户 (sSuper == 3) 或进货员 (sSuper == 1)
if (sSuper == 3 || sSuper == 1) {
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
}
// 其他情况(例如管理员权限)
else {
rightPanelLayout.show(rightPanel, "3"); // 显示收银系统界面
location = 3; // 设置当前位置为收银系统
}
}
else if(source==storageMenuLabel) {
rightPanelLayout.show(rightPanel,"4");
location=4;
// 如果点击的是库存系统菜单
else if (source == storageMenuLabel) {
// 如果用户是进货员 (sSuper == 1)
if (sSuper == 1) {
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
}
// 其他情况(例如管理员权限)
else {
rightPanelLayout.show(rightPanel, "4"); // 显示库存系统界面
location = 4; // 设置当前位置为库存系统
}
}
else if(source==supplierMenuLabel) {
rightPanelLayout.show(rightPanel,"5");
location=5;
// 如果点击的是供应商菜单
else if (source == supplierMenuLabel) {
// 如果用户是进货员 (sSuper == 1)
if (sSuper == 1) {
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
}
// 其他情况(例如管理员权限)
else {
rightPanelLayout.show(rightPanel, "5"); // 显示供应商界面
location = 5; // 设置当前位置为供应商
}
}
else if(source==catalogMenuLabel) {
rightPanelLayout.show(rightPanel,"6");
location=6;
}else if(source==remindMenuLabel) {
if(sSuper==2)
rightPanelLayout.show(rightPanel,"7");
else{
rightPanelLayout.show(rightPanel,"8");
// 如果点击的是商品目录菜单
else if (source == catalogMenuLabel) {
// 如果用户是进货员 (sSuper == 1)
if (sSuper == 1) {
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
}
location=7;
}else if(source==userMenuLabel1){
UserInfDialog userInfDialog = new UserInfDialog(this,user);
userInfDialog.setVisible(true);
location=8;
// 其他情况(例如管理员权限)
else {
rightPanelLayout.show(rightPanel, "6"); // 显示商品目录界面
location = 6; // 设置当前位置为商品目录
}
}
// 如果点击的是提醒菜单
else if (source == remindMenuLabel) {
// 如果用户是普通用户 (sSuper == 2) 或进货员 (sSuper == 1)
if (sSuper == 2 || sSuper == 1) {
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
}
// 其他情况(例如管理员权限)
else {
rightPanelLayout.show(rightPanel, "8"); // 显示进货信息提示界面
}
location = 7; // 设置当前位置为提醒
}
// 如果点击的是用户信息菜单
else if (source == userMenuLabel1) {
UserInfDialog userInfDialog = new UserInfDialog(this, user); // 创建用户信息对话框
userInfDialog.setVisible(true); // 显示用户信息对话框
location = 8; // 设置当前位置为用户信息
}
refreshRemove();
refreshRemove(); // 刷新当前界面的位置信息
}
//获取当前位置
public void refreshRemove(){
public void refreshRemove(){
purposePanel.removeAll();
if(location==0){
purposeLabel = new JLabel("当前位置是:"+homeMenuLabel.getText());
purposePanel.removeAll();
if(location==0){
purposeLabel = new JLabel("当前位置是:"+homeMenuLabel.getText());
}else if(location==1){
purposeLabel = new JLabel("当前位置是:"+userMenuLabel.getText());
}else if(location==1){
purposeLabel = new JLabel("当前位置是:"+userMenuLabel.getText());
}else if(location==2){
purposeLabel = new JLabel("当前位置是:"+inMenuLabel.getText());
}else if(location==2){
purposeLabel = new JLabel("当前位置是:"+inMenuLabel.getText());
}else if(location==3){
purposeLabel = new JLabel("当前位置是:"+outMenuLabel.getText());
}else if(location==3){
purposeLabel = new JLabel("当前位置是:"+outMenuLabel.getText());
}else if(location==4){
purposeLabel = new JLabel("当前位置是:"+storageMenuLabel.getText());
}else if(location==4){
purposeLabel = new JLabel("当前位置是:"+storageMenuLabel.getText());
}else if(location==5){
purposeLabel = new JLabel("当前位置是:"+supplierMenuLabel.getText());
}else if(location==5){
purposeLabel = new JLabel("当前位置是:"+supplierMenuLabel.getText());
}else{
purposeLabel = new JLabel("当前位置是:"+catalogMenuLabel.getText());
}
}else{
purposeLabel = new JLabel("当前位置是:"+catalogMenuLabel.getText());
}
purposePanel.add(purposeLabel);
purposePanel.add(purposeLabel);
}
}
@Override
public void mousePressed(MouseEvent e) {
@ -488,11 +544,10 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
}else if(source==catalogMenuLabel) {
catalogMenuLabel.setForeground(new Color(18, 150, 219));
catalogMenuLabel.setIcon(new ImageIcon("static\\icon\\catalog2.png"));
}
else if(source==userMenuLabel1) {
} else if(source==userMenuLabel1) {
userMenuLabel1.setForeground(new Color(18, 150, 219));
}
}
}
@Override
@ -501,8 +556,7 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
if(source==homeMenuLabel) {
homeMenuLabel.setForeground(Color.white);
homeMenuLabel.setIcon(new ImageIcon("static\\icon\\home1.png"));
}
else if(source==userMenuLabel) {
} else if(source==userMenuLabel) {
userMenuLabel.setForeground(Color.white);
userMenuLabel.setIcon(new ImageIcon("static\\icon\\user1.png"));
}else if(source==inMenuLabel) {
@ -520,11 +574,10 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
}else if(source==catalogMenuLabel) {
catalogMenuLabel.setForeground(Color.white);
catalogMenuLabel.setIcon(new ImageIcon("static\\icon\\catalog1.png"));
}
else {
} else {
userMenuLabel1.setForeground(Color.white);
}
}
}

@ -3,4 +3,16 @@ z1 z2 13131
d11111
d2
Z3
d3
d4w
d5
d6
d7
顶顶顶
444444
11111

Loading…
Cancel
Save