📄 stockmanagementmainframe.java
字号:
int stockFunction = user.getStockFunction();
if((stockFunction & 1) != 1){
JOptionPane.showMessageDialog(null, user.getUserName() + "用户不具有该权限.");
return;
}
if(ledgerDate.length() == 0){
JOptionPane.showMessageDialog(null, "请选择账套.");
return;
}
if(orderSubmitFrame == null){
orderSubmitFrame = new OrderSubmitFrame(this);
//使窗口居中对齐
setCenterPosition(orderSubmitFrame);
orderSubmitFrame.setVisible(true);
}else{
//重新传入用户类和账套
orderSubmitFrame.setUser(user);
orderSubmitFrame.setLedgerDate(ledgerDate);
orderSubmitFrame.setVisible(true);
}
}
orderSubmitFrame.setTitle("进货单填写窗口"+ ":用户("
+ user.getUserName() + "):账套(" + ledgerDate + ")");
}
else if (actionCommand.equals("orderCommit")) {
if(user == null){
JOptionPane.showMessageDialog(null, "先登陆系统,再打开进货单审核窗口.");
return;
}else{
//取得进货模块的用户权限
int stockFunction = user.getStockFunction();
if((stockFunction & 2) != 2){
JOptionPane.showMessageDialog(null, user.getUserName() + "用户不具有该权限.");
return;
}
if(ledgerDate.length() == 0){
JOptionPane.showMessageDialog(null, "请选择账套.");
return;
}
if(orderCommitFrame == null){
orderCommitFrame = new OrderCommitFrame(this);
//使窗口居中对齐
setCenterPosition(orderCommitFrame);
orderCommitFrame.setVisible(true);
}else{
//重新传入用户类和账套
orderCommitFrame.setUser(user);
orderCommitFrame.setLedgerDate(ledgerDate);
orderCommitFrame.setVisible(true);
}
}
orderCommitFrame.setTitle("进货单审核窗口"+ ":用户("
+ user.getUserName() + "):账套(" + ledgerDate + ")");
}
else if (actionCommand.equals("orderCheck")) {
if(user == null){
JOptionPane.showMessageDialog(null, "先登陆系统,再打开检查货物窗口.");
return;
}else{
//取得进货模块的用户权限
int stockFunction = user.getStockFunction();
if((stockFunction & 4) != 4){
JOptionPane.showMessageDialog(null, user.getUserName() + "用户不具有该权限.");
return;
}
if(ledgerDate.length() == 0){
JOptionPane.showMessageDialog(null, "请选择账套.");
return;
}
if(orderCheckFrame == null){
orderCheckFrame = new OrderCheckFrame(this);
//使窗口居中对齐
setCenterPosition(orderCheckFrame);
orderCheckFrame.setVisible(true);
}else{
//重新传入用户类和账套
orderCheckFrame.setUser(user);
orderCheckFrame.setLedgerDate(ledgerDate);
orderCheckFrame.setVisible(true);
}
}
orderCheckFrame.setTitle("检查货物窗口"+ ":用户("
+ user.getUserName() + "):账套(" + ledgerDate + ")");
}
else if (actionCommand.equals("orderPay")) {
if(user == null){
JOptionPane.showMessageDialog(null, "先登陆系统,再打开进货付款窗口.");
return;
}else{
//取得进货模块的用户权限
int stockFunction = user.getStockFunction();
if((stockFunction & 8) != 8){
JOptionPane.showMessageDialog(null, user.getUserName() + "用户不具有该权限.");
return;
}
if(ledgerDate.length() == 0){
JOptionPane.showMessageDialog(null, "请选择账套.");
return;
}
if(orderPayFrame == null){
orderPayFrame = new OrderPayFrame(this);
//使窗口居中对齐
setCenterPosition(orderPayFrame);
orderPayFrame.setVisible(true);
}else{
//重新传入用户类和账套
orderPayFrame.setUser(user);
orderPayFrame.setLedgerDate(ledgerDate);
orderPayFrame.setVisible(true);
}
}
orderPayFrame.setTitle("进货付款窗口"+ ":用户("
+ user.getUserName() + "):账套(" + ledgerDate + ")");
}
else if (actionCommand.equals("cashLedgerView")) {
if(user == null){
JOptionPane.showMessageDialog(null, "先登陆系统,再打开现金日记账查看窗口.");
return;
}else{
//取得进货模块的用户权限
int stockFunction = user.getStockFunction();
if((stockFunction & 16) != 16){
JOptionPane.showMessageDialog(null, user.getUserName() + "用户不具有该权限.");
return;
}
if(ledgerDate.length() == 0){
JOptionPane.showMessageDialog(null, "请选择账套.");
return;
}
if(cashLedgerViewFrame == null){
cashLedgerViewFrame = new CashLedgerViewFrame(this);
//使窗口居中对齐
setCenterPosition(cashLedgerViewFrame);
cashLedgerViewFrame.setVisible(true);
}else{
//重新传入用户类和账套
cashLedgerViewFrame.setUser(user);
cashLedgerViewFrame.setLedgerDate(ledgerDate);
cashLedgerViewFrame.setVisible(true);
}
}
cashLedgerViewFrame.setTitle("现金日记账查看窗口"+ ":用户("
+ user.getUserName() + "):账套(" + ledgerDate + ")");
}
else if (actionCommand.equals("returnOrderSubmit")) {
if(user == null){
JOptionPane.showMessageDialog(null, "先登陆系统,再打开填写退货单窗口.");
return;
}else{
//取得进货模块的用户权限
int stockFunction = user.getStockFunction();
if((stockFunction & 2) != 2){
JOptionPane.showMessageDialog(null, user.getUserName() + "用户不具有该权限.");
return;
}
if(ledgerDate.length() == 0){
JOptionPane.showMessageDialog(null, "请选择账套.");
return;
}
if(returnOrderSubmitFrame == null){
returnOrderSubmitFrame = new ReturnOrderSubmitFrame(this);
//使窗口居中对齐
setCenterPosition(returnOrderSubmitFrame);
returnOrderSubmitFrame.setVisible(true);
}else{
//重新传入用户类和账套
returnOrderSubmitFrame.setUser(user);
returnOrderSubmitFrame.setLedgerDate(ledgerDate);
returnOrderSubmitFrame.setVisible(true);
}
}
returnOrderSubmitFrame.setTitle("填写退货单窗口"+ ":用户("
+ user.getUserName() + "):账套(" + ledgerDate + ")");
}
else if (actionCommand.equals("returnOrderPay")) {
if(user == null){
JOptionPane.showMessageDialog(null, "先登陆系统,再打开收取退款窗口.");
return;
}else{
//取得进货模块的用户权限
int stockFunction = user.getStockFunction();
if((stockFunction & 8) != 8){
JOptionPane.showMessageDialog(null, user.getUserName() + "用户不具有该权限.");
return;
}
if(ledgerDate.length() == 0){
JOptionPane.showMessageDialog(null, "请选择账套.");
return;
}
if(returnOrderPayFrame == null){
returnOrderPayFrame = new ReturnOrderPayFrame(this);
//使窗口居中对齐
setCenterPosition(returnOrderPayFrame);
returnOrderPayFrame.setVisible(true);
}else{
//重新传入用户类和账套
returnOrderPayFrame.setUser(user);
returnOrderPayFrame.setLedgerDate(ledgerDate);
returnOrderPayFrame.setVisible(true);
}
}
returnOrderPayFrame.setTitle("收取退款窗口"+ ":用户("
+ user.getUserName() + "):账套(" + ledgerDate + ")");
}
else if (actionCommand.equals("returnOrderCheck")) {
if(user == null){
JOptionPane.showMessageDialog(null, "先登陆系统,再打开退还货物窗口.");
return;
}else{
//取得进货模块的用户权限
int stockFunction = user.getStockFunction();
if((stockFunction & 4) != 4){
JOptionPane.showMessageDialog(null, user.getUserName() + "用户不具有该权限.");
return;
}
if(ledgerDate.length() == 0){
JOptionPane.showMessageDialog(null, "请选择账套.");
return;
}
if(returnOrderCheckFrame == null){
returnOrderCheckFrame = new ReturnOrderCheckFrame(this);
//使窗口居中对齐
setCenterPosition(returnOrderCheckFrame);
returnOrderCheckFrame.setVisible(true);
}else{
//重新传入用户类和账套
returnOrderCheckFrame.setUser(user);
returnOrderCheckFrame.setLedgerDate(ledgerDate);
returnOrderCheckFrame.setVisible(true);
}
}
returnOrderCheckFrame.setTitle("退还货物窗口"+ ":用户("
+ user.getUserName() + "):账套(" + ledgerDate + ")");
}
else if (actionCommand.equals("stockOrderSearch")) {
if(user == null){
JOptionPane.showMessageDialog(null, "先登陆系统,再打开进货单查询窗口.");
return;
}else{
//取得进货模块的用户权限
int stockFunction = user.getStockFunction();
if((stockFunction & 32) != 32){
JOptionPane.showMessageDialog(null, user.getUserName() + "用户不具有该权限.");
return;
}
if(ledgerDate.length() == 0){
JOptionPane.showMessageDialog(null, "请选择账套.");
return;
}
if(stockOrderSearchFrame == null){
stockOrderSearchFrame = new StockOrderSearchFrame(this);
//使窗口居中对齐
setCenterPosition(stockOrderSearchFrame);
stockOrderSearchFrame.setVisible(true);
}else{
//重新传入用户类和账套
stockOrderSearchFrame.setUser(user);
stockOrderSearchFrame.setLedgerDate(ledgerDate);
stockOrderSearchFrame.setVisible(true);
}
}
stockOrderSearchFrame.setTitle("进货单查询窗口"+ ":用户("
+ user.getUserName() + "):账套(" + ledgerDate + ")");
}
else if (actionCommand.equals("accountPayableSearch")) {
if(user == null){
JOptionPane.showMessageDialog(null, "先登陆系统,再打开应付账款查询窗口.");
return;
}else{
//取得进货模块的用户权限
int stockFunction = user.getStockFunction();
if((stockFunction & 64) != 64){
JOptionPane.showMessageDialog(null, user.getUserName() + "用户不具有该权限.");
return;
}
if(ledgerDate.length() == 0){
JOptionPane.showMessageDialog(null, "请选择账套.");
return;
}
if(accountPayableSearchFrame == null){
accountPayableSearchFrame = new AccountPayableSearchFrame(this);
//使窗口居中对齐
setCenterPosition(accountPayableSearchFrame);
accountPayableSearchFrame.setVisible(true);
}else{
//重新传入用户类和账套
accountPayableSearchFrame.setUser(user);
accountPayableSearchFrame.setLedgerDate(ledgerDate);
accountPayableSearchFrame.setVisible(true);
}
}
accountPayableSearchFrame.setTitle("应付账款查询窗口"+ ":用户("
+ user.getUserName() + "):账套(" + ledgerDate + ")");
}
else if (actionCommand.equals("stockAccountEntryCheck")) {
if(user == null){
JOptionPane.showMessageDialog(null, "先登陆系统,再打开审核进货会计分录窗口.");
return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -