校内拍卖系统EJB版客户端,初始版(设置了数据过滤、XML配置)。

This commit is contained in:
ICECITY 2014-07-18 15:28:04 +08:00
parent 48153b28f2
commit 1ea7110ada
78 changed files with 987 additions and 254 deletions

View File

@ -2,6 +2,9 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="G:/PROJECTS/ECLIPSE/nudt_ah_client/src/dialog/datepicker.jar"/>
<classpathentry kind="lib" path="lib/datepicker.jar"/>
<classpathentry kind="lib" path="lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="lib/hibernate-jpa-2.1-api-1.0.0.Final.jar"/>
<classpathentry kind="lib" path="lib/jboss-client.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,11 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.3
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=ignore
org.eclipse.jdt.core.compiler.source=1.3
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.jboss.ide.eclipse.as.core.singledeployable.deployableList=

BIN
lib/dom4j-1.6.1.jar Normal file

Binary file not shown.

Binary file not shown.

BIN
lib/jboss-client.jar Normal file

Binary file not shown.

31
src/client/AHClient.java Normal file
View File

@ -0,0 +1,31 @@
package client;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.entity.UserManageRemote;
import org.model.Good;
import org.model.User;
import frame.AHJFrame;
public class AHClient{
public static void main(String[] args) throws NamingException {
// Context context = new InitialContext();
// UserManageRemote userManage = (UserManageRemote)context.lookup("ejb:/AhServer/UserManage!org.entity.UserManageRemote");
// User temUser = userManage.getUserById(2);
//
// Good temGood = userManage.getGoodsById(2);
// System.out.println(temGood.toString());
// System.out.println(temUser.getUserId() + "|" + temUser.getUserName() + "|" + temUser.getUserPsw() + "|" + temUser.getUserMobile());
try {
AHJFrame frame = new AHJFrame();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -1,14 +0,0 @@
package client;
import frame.AHJFrame;
public class Client{
public static void main(String[] args) {
try {
AHJFrame frame = new AHJFrame();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
}

7
src/config.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<config>
<server>
<ip>localhost</ip>
<port>9000</port>
</server>
</config>

View File

@ -19,6 +19,8 @@ import javax.swing.border.LineBorder;
//import client.Client;
import com.eltima.components.ui.DatePicker;
import com.sun.awt.AWTUtilities;
@ -44,6 +46,11 @@ import label.AHJLabel;
import javax.swing.JComboBox;
import javax.swing.JTextArea;
import org.check.DataCheck;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
public class AHJDialogAddGoods extends AHJDialog {
private static final long serialVersionUID = 1L;
private String m_strImageURI;
@ -65,6 +72,15 @@ public class AHJDialogAddGoods extends AHJDialog {
super(1000, 600);
initial();
idealPriceField = new JTextField();
idealPriceField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
if(!DataCheck.isRegularCode(idealPriceField.getText(), "^[0-9]+\\.{0,1}[0-9]*$"))
{
JOptionPane.showMessageDialog(panelMain, new String("价格格式不正确(只能为整数或小数)!"), "提示", JOptionPane.ERROR_MESSAGE);
}
}
});
deadline=new DatePicker();
getContentPane().add(getMainPanel(), BorderLayout.CENTER);
@ -138,6 +154,15 @@ public class AHJDialogAddGoods extends AHJDialog {
panelLoginC.add(label);
basePriceField = new JTextField();
basePriceField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
if(!DataCheck.isRegularCode(basePriceField.getText(), "^[0-9]+\\.{0,1}[0-9]*$"))
{
JOptionPane.showMessageDialog(panelMain, new String("价格格式不正确(只能为整数或小数)!"), "提示", JOptionPane.ERROR_MESSAGE);
}
}
});
basePriceField.setFont(new Font("ËÎÌå", Font.PLAIN, 16));
basePriceField.setColumns(10);
basePriceField.setBounds(180, 100, 220, 40);

View File

@ -32,6 +32,11 @@ import label.AHJLabel;
import javax.swing.JTextArea;
import org.check.DataCheck;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
public class AHJDialogGoods extends AHJDialog {
private static final long serialVersionUID = 1L;
private String m_strImageURI;
@ -164,6 +169,15 @@ public class AHJDialogGoods extends AHJDialog {
panelLoginC.add(labelPrice);
priceField = new JTextField();
priceField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
if(!DataCheck.isRegularCode(priceField.getText(), "^[0-9]+\\.{0,1}[0-9]*$"))
{
JOptionPane.showMessageDialog(panelMain, new String("价格格式不正确(只能为整数或小数)!"), "提示", JOptionPane.ERROR_MESSAGE);
}
}
});
priceField.setFont(new Font("ËÎÌå", Font.PLAIN, 16));
priceField.setColumns(10);
priceField.setBounds(180, 460, 220, 40);
@ -182,15 +196,28 @@ public class AHJDialogGoods extends AHJDialog {
dispose();
*/
int userID=panelMain.getClientUserInfo().getUserId();
double price=Double.parseDouble(priceField.getText());
int result=panelMain.getGoodsManage().auction(userID, goodsID, price);
if(1==result)
JOptionPane.showMessageDialog(panelMain, new String("竞拍成功!"), "提示", JOptionPane.ERROR_MESSAGE);
if(!DataCheck.isRegularCode(priceField.getText(), "^[0-9]+\\.{0,1}[0-9]*$"))
{
JOptionPane.showMessageDialog(panelMain, new String("价格格式不正确(只能为整数或小数)!"), "提示", JOptionPane.ERROR_MESSAGE);
}
else
JOptionPane.showMessageDialog(panelMain, new String("竞拍失败!"), "提示", JOptionPane.ERROR_MESSAGE);
{
int userID=panelMain.getClientUserInfo().getUserId();
double price=Double.parseDouble(priceField.getText());
double dResult = 0;
try{
dResult = panelMain.getGoodsManage().auction(userID, goodsID, price, "2014-06-16 23:05:39");
if(-1 == dResult)
JOptionPane.showMessageDialog(panelMain, new String("竞拍成功!"), "提示", JOptionPane.PLAIN_MESSAGE);
else
JOptionPane.showMessageDialog(panelMain, new String("竞拍失败,您的出价过低!当前价格为:" + dResult), "提示", JOptionPane.ERROR_MESSAGE);
} catch (Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(panelMain, new String("竞拍失败,当前商品已结束拍卖!"), "提示", JOptionPane.ERROR_MESSAGE);
}
}
}
});
buttonLogin.setFont(new Font("ËÎÌå", Font.BOLD, 16));

View File

@ -22,6 +22,8 @@ import java.awt.geom.RoundRectangle2D;
import javax.swing.JTextField;
import javax.swing.JLabel;
import org.check.DataCheck;
import panel.AHJPanelBg;
import panel.AHJPanelMainBg;
@ -37,7 +39,7 @@ public class AHJDialogLogin extends AHJDialog {
public static void main(String[] args) {
}
public AHJDialogLogin(final AHJPanelMainBg panelMain, final JLabel labelUserInfo) {
public AHJDialogLogin(final AHJPanelMainBg panelMain, final JLabel labelUserInfo, final JButton btnLogin, final JButton btnReg) {
super(500, 300);
initial();
getContentPane().add(getMainPanel(), BorderLayout.CENTER);
@ -104,9 +106,10 @@ public class AHJDialogLogin extends AHJDialog {
JButton buttonLogin = new JButton("登录");
buttonLogin.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent arg0) {
if(0 == textFieldUserName.getText().trim().length() || 0 == textFieldPwd.getText().trim().length())
//if(0 == textFieldUserName.getText().trim().length() || 0 == textFieldPwd.getText().trim().length())
if(!DataCheck.isRegularCode(textFieldUserName.getText(), "^[0-9a-zA-Z]{6,16}$") || !DataCheck.isRegularCode(textFieldPwd.getText(), "^.{6,16}$"))
{
JOptionPane.showMessageDialog(panelMain, new String("用户名或密码不能为空"), "提示", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(panelMain, new String("用户名或密码格式不正确"), "提示", JOptionPane.ERROR_MESSAGE);
}
else
{
@ -119,6 +122,8 @@ public class AHJDialogLogin extends AHJDialog {
panelMain.getClientUserInfo().setUserName(textFieldUserName.getText());
panelMain.getClientUserInfo().setUserId(iResult);
labelUserInfo.setText(panelMain.getClientUserInfo().getUserName() + ",您好!欢迎使用本系统,系统中当前正在交易的商品共有" + panelMain.getGoodsList().length + "件。");
btnLogin.setVisible(false);
btnReg.setVisible(false);
panelMain.repaint();
setVisible(false);
dispose();

View File

@ -1,15 +1,14 @@
package dialog;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Shape;
import java.awt.SystemColor;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
@ -19,46 +18,38 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.RoundRectangle2D;
import javax.swing.JTextField;
import javax.swing.JLabel;
import panel.AHJPanel;
import panel.AHJPanelBg;
import panel.AHJPanelMainBg;
import java.awt.Font;
import label.AHJLabel;
import javax.swing.JComboBox;
import javax.swing.JTextArea;
public class AHJDialogMyGoods extends AHJDialog {
private static final long serialVersionUID = 1L;
private String m_strImageURI;
private JTextField goodsNameField;
private JComboBox typeCB;
private JTextField rpwdField;
private JComboBox mailField;
private JTextArea telField;
private JTextArea infoField;
public static void main(String[] args) {
new AHJDialogMyGoods(null, null);
}
private JTable table;
// public static void main(String[] args) {
// new AHJDialogMyGoods(null, null);
// }
public AHJDialogMyGoods(final AHJPanelMainBg panelMain, final JLabel labelUserInfo) {
super(1000, 600);
initial();
getContentPane().add(getMainPanel(), BorderLayout.CENTER);
getMainPanel().setLayout(new BorderLayout(0, 0));
{
JPanel panelLoginN = new JPanel();
panelLoginN.setPreferredSize(new Dimension(10, 45));
// JPanel panelLoginW = new JPanel();
panelLoginN.setPreferredSize(new Dimension(10, 53));
panelLoginN.setOpaque(false);
getMainPanel().add(panelLoginN, BorderLayout.NORTH);
panelLoginN.setLayout(new BorderLayout(0, 0));
{
JButton btnNewButton = new JButton("X");
// JButton NewButton1 = new JButton("我是买家");
// JButton NewButton2 = new JButton("我是卖家");
btnNewButton.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent arg0) {
setVisible(false);
@ -66,129 +57,135 @@ public class AHJDialogMyGoods extends AHJDialog {
}
});
panelLoginN.add(btnNewButton, BorderLayout.EAST);
}
// panelLoginN.add(panelLoginW);
// panelLoginW.setLayout(null);
// NewButton1.setFont(new Font("宋体", Font.BOLD, 16));
// NewButton1.setBounds(160, 10, 130, 40);
// NewButton2.setFont(new Font("宋体", Font.BOLD, 16));
// NewButton2.setBounds(10, 10, 130, 40);
// panelLoginW.setOpaque(false);
// panelLoginW.add(NewButton2);
// panelLoginW.add(NewButton1);
// NewButton1.setSize(100,15);
new AHJPanel(panelLoginN, BorderLayout.SOUTH, null);
new AHJLabel(new AHJPanel(panelLoginN, BorderLayout.WEST, null), "ÎÒµÄÉÌÆ·", new Dimension(100, 28), new Font("΢ÈíÑźÚ", Font.BOLD, 18));
new AHJPanel(getMainPanel(), BorderLayout.WEST, null);
new AHJPanel(getMainPanel(), BorderLayout.EAST, null);
new AHJPanel(getMainPanel(), BorderLayout.SOUTH, null);
JPanel panelLoginC = new AHJPanelBg(getMainPanel(), BorderLayout.CENTER, null, "images/scrollpane3.png");
panelLoginC.setLayout(null);
//panelLoginC.setOpaque(false);
//panelLoginN.add (new Button("我是买家"),BorderLayout.NORTH);
final JPanel panelLoginC = new AHJPanelBg(getMainPanel(), BorderLayout.CENTER, null, "images/scrollpane3.png");
panelLoginC.setBorder(new LineBorder(SystemColor.textHighlight, 1, true));
final JLabel labelUserName = new JLabel("商 品 名:");
labelUserName.setFont(new Font("微软雅黑", Font.BOLD, 16));
labelUserName.setBounds(70, 35, 100, 30);
panelLoginC.add(labelUserName);
goodsNameField = new JTextField();
goodsNameField.setFont(new Font("宋体", Font.PLAIN, 16));
goodsNameField.setBounds(180, 30, 220, 40);
goodsNameField.setBorder(new LineBorder(new Color(51, 153, 255)));
panelLoginC.add(goodsNameField);
goodsNameField.setColumns(10);
JLabel labelPwd = new JLabel("商品类型:");
labelPwd.setFont(new Font("微软雅黑", Font.BOLD, 16));
labelPwd.setBounds(550, 35, 100, 30);
panelLoginC.add(labelPwd);
String str[] = { "FIFO", "SSTF", "SCAN", "CSCAN" };
typeCB = new JComboBox(str);
typeCB.setFont(new Font("宋体", Font.PLAIN, 16));
typeCB.setBounds(660, 30, 220, 40);
typeCB.setBorder(new LineBorder(new Color(51, 153, 255)));
typeCB.setBackground(Color.WHITE);
panelLoginC.add(typeCB);
JLabel label = new JLabel("起拍价格:");
label.setFont(new Font("微软雅黑", Font.BOLD, 16));
label.setBounds(70, 125, 100, 30);
panelLoginC.add(label);
rpwdField = new JTextField();
rpwdField.setFont(new Font("宋体", Font.PLAIN, 16));
rpwdField.setColumns(10);
rpwdField.setBounds(180, 120, 220, 40);
rpwdField.setBorder(new LineBorder(new Color(51, 153, 255)));
panelLoginC.add(rpwdField);
JLabel labelMail = new JLabel("竞拍策略:");
labelMail.setFont(new Font("微软雅黑", Font.BOLD, 16));
labelMail.setBounds(550, 125, 100, 30);
panelLoginC.add(labelMail);
String strSg[] = {"时间策略", "价格策略"};
mailField = new JComboBox(strSg);
mailField.setFont(new Font("宋体", Font.PLAIN, 16));
mailField.setBounds(660, 120, 220, 40);
mailField.setBorder(new LineBorder(new Color(51, 153, 255)));
mailField.setBackground(Color.WHITE);
panelLoginC.add(mailField);
JLabel labelShortInfo = new JLabel("简短信息:");
labelShortInfo.setFont(new Font("微软雅黑", Font.BOLD, 16));
labelShortInfo.setBounds(70, 215, 100, 30);
panelLoginC.add(labelShortInfo);
telField = new JTextArea();
telField.setFont(new Font("宋体", Font.PLAIN, 16));
telField.setBorder(new LineBorder(new Color(51, 153, 255)));
telField.setColumns(10);
telField.setBounds(180, 210, 700, 60);
panelLoginC.add(telField);
JLabel labelInfo = new JLabel("详细信息:");
labelInfo.setFont(new Font("微软雅黑", Font.BOLD, 16));
labelInfo.setBounds(70, 325, 100, 30);
panelLoginC.add(labelInfo);
infoField = new JTextArea();
infoField.setFont(new Font("宋体", Font.PLAIN, 16));
infoField.setBorder(new LineBorder(new Color(51, 153, 255)));
infoField.setColumns(10);
infoField.setBounds(180, 320, 700, 100);
panelLoginC.add(infoField);
JButton buttonLogin = new JButton("竞拍");
buttonLogin.addMouseListener(new MouseAdapter() {
panelLoginC.setLayout(new BorderLayout(0, 0));
final String[]Names ={
"商品名称","商品底价","拍卖截止时间","商品理想价格","商品状态","最高出价","我的出价","详细信息"
};
// final String[]Names2 ={
// "商品名称","我的底价","拍卖截止时间","我的理想价格","商品状态","最高出价","详细信息"
// };
final Object[][] object;
// final Object[][] object2;
int i=0;
int iCCount = panelMain.getGoodsList().length;
for(int iIndex = 0; iIndex < iCCount; ++iIndex)
{
if(panelMain.getGoodsList()[iIndex].getLastAuctionerID() == panelMain.getClientUserInfo().getUserId() ||
panelMain.getGoodsList()[iIndex].getProviderID() == panelMain.getClientUserInfo().getUserId())
i++;
// if(panelMain.getGoodsList()[iIndex].getGoodsID()==panelMain.getGoodsList()[iIndex].getGoodsID())
// j++;
}
if(14 >= i)
{
object = new Object[14][8];
}
else
{
object=new Object[iCCount][8];
}
// if(14 >= j)
// {
// object2 = new Object[14][8];
// }
// else
// {
// object2=new Object[iCCount][8];
// }
i=0;
final int tablerowID [];
tablerowID=new int[iCCount];
for(int iIndex = 0; iIndex < iCCount; ++iIndex)
{
if(panelMain.getGoodsList()[iIndex].getLastAuctionerID() == panelMain.getClientUserInfo().getUserId() ||
panelMain.getGoodsList()[iIndex].getProviderID() == panelMain.getClientUserInfo().getUserId())
{
tablerowID[i] =iIndex;
object[i][1] =Double.toString(panelMain.getGoodsList()[iIndex].getOriginalPrice());
object[i][0] = panelMain.getGoodsList()[iIndex].getGoodsName();
object[i][2] = panelMain.getGoodsList()[iIndex].getEndTime();
object[i][3] = Double.toString(panelMain.getGoodsList()[iIndex].getDeadLinePrice());
object[i][4] = Integer.toString(panelMain.getGoodsList()[iIndex].getState());
object[i][5] = Double.toString(panelMain.getGoodsList()[iIndex].getLastPrice());
object[i][6] = Double.toString(panelMain.getGoodsManage().getGoods(panelMain.getGoodsList()[iIndex].getGoodsID()).getLastPrice());
object[i][7] = "点击查看";
i++;
}
}
// for(int iIndex = 0; iIndex < iCCount; ++iIndex)
// {
// if(panelMain.getGoodsList()[iIndex].getGoodsID()==panelMain.getGoodsList()[iIndex].getGoodsID())
// {
// tablerowID[j] =iIndex;
// object2[j][1] =Double.toString(panelMain.getGoodsList()[iIndex].getOriginalPrice());
// object2[j][0] = panelMain.getGoodsList()[iIndex].getGoodsName();
// object2[j][2] = panelMain.getGoodsList()[iIndex].getEndTime();
// object2[j][3] = Double.toString(panelMain.getGoodsList()[iIndex].getDeadLinePrice());
// object2[j][4] =Integer.toString(panelMain.getGoodsList()[iIndex].getState());
// object2[j][5] = Double.toString(panelMain.getGoodsList()[iIndex].getLastPrice());
// object2[j][6] = Double.toString(panelMain.getGoodsManage().getGoods( panelMain.getGoodsList()[iIndex].getGoodsID()).getLastPrice());
// object2[j][6] = "点击查看";
// j++;
//
// }
// }
table=new JTable(object,Names);
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent arg0) {
JOptionPane.showMessageDialog(panelMain, new String("下阶段功能,敬请期待!"), "提示", JOptionPane.ERROR_MESSAGE);
/*
panelMain.getUserInfo().setUserName(goodsNameField.getText());
labelUserInfo.setText(panelMain.getUserInfo().getUserName() + "您好。您已参与交易90笔信用度9000当前正在交易商品80件。");;
panelMain.repaint();
setVisible(false);
dispose();
*/
int iGoodsId= panelMain.getGoodsList()[tablerowID[table.getSelectedRow()]].getGoodsID();
if(7 == table.getSelectedColumn())
{
new AHJDialogGoods(panelMain, iGoodsId);
}
}
});
buttonLogin.setFont(new Font("宋体", Font.BOLD, 16));
buttonLogin.setBounds(285, 460, 130, 40);
panelLoginC.add(buttonLogin);
JButton buttonReset = new JButton("重置");
buttonReset.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent arg0) {
goodsNameField.setText("");
rpwdField.setText("");
telField.setText("");
infoField.setText("");
}
});
buttonReset.setFont(new Font("宋体", Font.BOLD, 16));
buttonReset.setBounds(560, 460, 130, 40);
panelLoginC.add(buttonReset);
setGoodsInfo();
}
//panelParent.getComponentCount();
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
setVisible(true);
JScrollPane scrollPane=new JScrollPane(table);
panelLoginC.add(scrollPane,BorderLayout.CENTER);
scrollPane.setBounds(0,60,390,470);
scrollPane.setViewportView(table);
panelLoginC.add(table.getTableHeader(),BorderLayout.NORTH);
// setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
table.setRowHeight(36);
setVisible(true);
// NewButton1.addMouseListener(new MouseAdapter() {
// public void mouseClicked(MouseEvent arg0) {
// new AHJDialogMyGoods(null, null);
// }
// });
// NewButton2.addMouseListener(new MouseAdapter() {
// public void mouseClicked(MouseEvent arg0) {
// setVisible(false);
// dispose();
// table= new JTable(object2,Names2);
// JScrollPane scrollPane=new JScrollPane(table);
// panelLoginC.add(scrollPane,BorderLayout.CENTER);
// scrollPane.setBounds(0,60,390,470);
// scrollPane.setViewportView(table);
// panelLoginC.add(table.getTableHeader(),BorderLayout.NORTH);
// setVisible(true);
// }
// });
}
}
protected void initial()
@ -199,7 +196,7 @@ public class AHJDialogMyGoods extends AHJDialog {
getMainPanel().setBgImageURI(m_strImageURI);
getMainPanel().setBorder(new EmptyBorder(10, 10, 10, 10));
setVisibleRegion(this.getWidth(),this.getHeight());
getMainPanel().setBorder(new LineBorder(SystemColor.textHighlight, 3, true));
getMainPanel().setBorder(new LineBorder(SystemColor.textHighlight, 3, true));
}
public void setVisibleRegion(int width,int height){
@ -210,9 +207,5 @@ public class AHJDialogMyGoods extends AHJDialog {
public void setGoodsInfo()
{
goodsNameField.setText("演示商品名");
rpwdField.setText("1000.8");
telField.setText("演示简短信息");
infoField.setText("这里是演示的商品详情\n演示具体的商品内容");
}
}
}

View File

@ -7,6 +7,7 @@ import java.awt.SystemColor;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.border.EmptyBorder;
@ -21,11 +22,15 @@ import java.awt.geom.RoundRectangle2D;
import javax.swing.JTextField;
import javax.swing.JLabel;
import org.check.DataCheck;
import panel.AHJPanelBg;
import panel.AHJPanelMainBg;
import userManage.UserInfo;
import java.awt.Font;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
public class AHJDialogReg extends AHJDialog {
private static final long serialVersionUID = 1L;
@ -35,11 +40,13 @@ public class AHJDialogReg extends AHJDialog {
private JTextField rpwdField;
private JTextField mailField;
private JTextField telField;
private String warnInfo;
private int warnCount[] = {0,0,0,0,0};
public static void main(String[] args) {
//new AHJDialogReg(null, null);
}
public AHJDialogReg(final AHJPanelMainBg panelMain, final JLabel labelUserInfo) {
public AHJDialogReg(final AHJPanelMainBg panelMain, final JLabel labelUserInfo, final JButton btnLogin, final JButton btnReg) {
super(500, 600);
initial();
getContentPane().add(getMainPanel(), BorderLayout.CENTER);
@ -142,29 +149,8 @@ public class AHJDialogReg extends AHJDialog {
panelLoginC.add(telField);
JButton buttonLogin = new JButton("×¢²á");
buttonLogin.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent arg0) {
// if(pwdField.getText() != rpwdField.getText())
// {
// JOptionPane.showMessageDialog(panelMain, new String("密码校验不正确,请确认!"), "提示", JOptionPane.ERROR_MESSAGE);
// return;
// }
UserInfo userInfo = panelMain.getUserManage().getBlankUser();
userInfo.setUserName(userNameField.getText());
userInfo.setUserPassword(pwdField.getText());
userInfo.setUserEmail(mailField.getText());
userInfo.setUserPhone(telField.getText());
panelMain.getUserManage().addUser(userInfo);
panelMain.getClientUserInfo().setUserName(userNameField.getText());
labelUserInfo.setText(panelMain.getClientUserInfo().getUserName() + "您好。您已参与交易90笔信用度9000当前正在交易商品80件。");;
panelMain.repaint();
setVisible(false);
dispose();
}
});
buttonLogin.setFont(new Font("ËÎÌå", Font.BOLD, 16));
buttonLogin.setBounds(70, 460, 130, 40);
buttonLogin.setBounds(70, 483, 130, 40);
panelLoginC.add(buttonLogin);
JButton buttonReset = new JButton("ÖØÖÃ");
@ -178,8 +164,194 @@ public class AHJDialogReg extends AHJDialog {
}
});
buttonReset.setFont(new Font("ËÎÌå", Font.BOLD, 16));
buttonReset.setBounds(270, 460, 130, 40);
buttonReset.setBounds(270, 483, 130, 40);
panelLoginC.add(buttonReset);
final JLabel labelUserNameInfo = new JLabel("帐号由6-16位字母或数字组成");
labelUserNameInfo.setForeground(SystemColor.textHighlight);
labelUserNameInfo.setFont(new Font("宋体", Font.PLAIN, 12));
labelUserNameInfo.setBounds(180, 78, 200, 30);
panelLoginC.add(labelUserNameInfo);
final JLabel label_1 = new JLabel("\u5BC6\u7801\u75316-16\u4F4D\u5B57\u6BCD\u6216\u6570\u5B57\u7EC4\u6210");
label_1.setForeground(SystemColor.textHighlight);
label_1.setFont(new Font("宋体", Font.PLAIN, 12));
label_1.setBounds(180, 168, 200, 30);
panelLoginC.add(label_1);
final JLabel label_2 = new JLabel("\u8BF7\u786E\u8BA4\u60A8\u7684\u5BC6\u7801");
label_2.setForeground(SystemColor.textHighlight);
label_2.setFont(new Font("宋体", Font.PLAIN, 12));
label_2.setBounds(180, 260, 200, 30);
panelLoginC.add(label_2);
final JLabel label_3 = new JLabel("\u90AE\u7BB1\u5FC5\u987B\u5E26@");
label_3.setForeground(SystemColor.textHighlight);
label_3.setFont(new Font("宋体", Font.PLAIN, 12));
label_3.setBounds(180, 350, 200, 30);
panelLoginC.add(label_3);
final JLabel label_4 = new JLabel("\u624B\u673A\u53F7\u7801\u753111\u4F4D\u6570\u5B57\u7EC4\u6210");
label_4.setForeground(SystemColor.textHighlight);
label_4.setFont(new Font("宋体", Font.PLAIN, 12));
label_4.setBounds(180, 443, 200, 30);
panelLoginC.add(label_4);
//数据校验
userNameField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
if(DataCheck.isRegularCode(userNameField.getText(), "^[0-9a-zA-Z]{6,16}$"))
{
labelUserNameInfo.setText("帐号输入正确");
labelUserNameInfo.setForeground(SystemColor.GREEN);
warnCount[0] = 1;
warnInfo = null;
}
else
{
labelUserNameInfo.setText("对不起,您的帐号格式不正确");
labelUserNameInfo.setForeground(SystemColor.RED);
warnCount[0] = 0;
warnInfo = "对不起,您的帐号格式不正确";
}
}
});
pwdField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
if(DataCheck.isRegularCode(pwdField.getText(), "^.{6,16}$"))
{
label_1.setText("密码输入正确");
label_1.setForeground(SystemColor.GREEN);
warnCount[1] = 1;
warnInfo = (null == warnInfo) ? null : warnInfo;
}
else
{
label_1.setText("对不起,您的密码格式不正确");
label_1.setForeground(SystemColor.RED);
warnCount[1] = 0;
warnInfo = "对不起,您的密码格式不正确";
}
}
});
rpwdField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
if(pwdField.getText().equals(rpwdField.getText()))
{
label_2.setText("密码确认正确");
label_2.setForeground(SystemColor.GREEN);
warnCount[2] = 1;
warnInfo = (null == warnInfo) ? null : warnInfo;
}
else
{
label_2.setText("对不起,请重新确认您的密码");
label_2.setForeground(SystemColor.RED);
warnCount[2] = 0;
warnInfo = "对不起rpwdField";
}
}
});
mailField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
if(DataCheck.isRegularCode(mailField.getText(), "^.*@.*\\..*$"))
{
label_3.setText("邮箱输入正确");
label_3.setForeground(SystemColor.GREEN);
warnCount[3] = 1;
warnInfo = (null == warnInfo) ? null : warnInfo;
}
else
{
label_3.setText("对不起,您的邮箱格式不正确");
label_3.setForeground(SystemColor.RED);
warnCount[3] = 0;
warnInfo = "对不起,您的邮箱格式不正确";
}
}
});
telField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
if(DataCheck.isRegularCode(telField.getText(), "^[0-9]{11}$"))
{
label_4.setText("手机输入正确");
label_4.setForeground(SystemColor.GREEN);
warnCount[4] = 1;
warnInfo = (null == warnInfo) ? null : warnInfo;
}
else
{
label_4.setText("对不起,您的手机格式不正确");
label_4.setForeground(SystemColor.RED);
warnCount[4] = 0;
warnInfo = "对不起,您的手机格式不正确";
}
}
});
buttonLogin.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent arg0) {
if(null == warnInfo && 5 == (warnCount[0] + warnCount[1] + warnCount[2] + warnCount[3] + warnCount[4]))
{
UserInfo userInfo = panelMain.getUserManage().getBlankUser();
userInfo.setUserName(userNameField.getText());
userInfo.setUserPassword(pwdField.getText());
userInfo.setUserEmail(mailField.getText());
userInfo.setUserPhone(telField.getText());
panelMain.getUserManage().addUser(userInfo);
panelMain.getClientUserInfo().setUserName(userNameField.getText());
labelUserInfo.setText(panelMain.getClientUserInfo().getUserName() + "您好。您已参与交易90笔信用度9000当前正在交易商品80件。");
btnLogin.setVisible(false);
btnReg.setVisible(false);
panelMain.getComponent(1);
panelMain.repaint();
setVisible(false);
dispose();
}
else
{
int iIndex = 0;
String warnText = "";
for(int info:warnCount)
{
if(0 == info)
{
if(!warnText.equals("")) warnText += "";
switch(iIndex)
{
case 0:
warnText += "帐号";
break;
case 1:
warnText += "密码";
break;
case 2:
warnText += "确认密码";
break;
case 3:
warnText += "邮箱";
break;
case 4:
warnText += "手机";
break;
default:
}
}
++iIndex;
}
JOptionPane.showMessageDialog(null, warnText.equals("") ? "您的信息输入不完整!" : "请检查您的" + warnText + "等信息!", "提示", JOptionPane.ERROR_MESSAGE);
}
}
});
}
//panelParent.getComponentCount();
@ -196,6 +368,7 @@ public class AHJDialogReg extends AHJDialog {
getMainPanel().setBorder(new EmptyBorder(10, 10, 10, 10));
setVisibleRegion(this.getWidth(),this.getHeight());
getMainPanel().setBorder(new LineBorder(SystemColor.textHighlight, 3, true));
warnInfo = "请输入完整信息";
}
public void setVisibleRegion(int width,int height){

View File

@ -128,7 +128,7 @@ public class AHJFrame extends JFrame {
panelTop_CCI_Button = new JPanel();
panelTop_CCI_Info = new JPanel();
setTitle("校内拍卖系统");
setTitle("校内拍卖系统-EJB版");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(getGraphicsConfiguration());
setBounds(0, 0, Toolkit.getDefaultToolkit().getScreenSize().width, Toolkit.getDefaultToolkit().getScreenSize().height - screenInsets.bottom);
@ -147,7 +147,7 @@ public class AHJFrame extends JFrame {
panelTop_Top = new AHJPanel(panelTop, BorderLayout.NORTH, new BorderLayout(0, 0));
panelTop_Top_Left = new AHJPanel(panelTop_Top, BorderLayout.WEST, null);
labelTitel = new JLabel("校内拍卖系统");
labelTitel = new JLabel("校内拍卖系统-EJB版");
labelTitel.setForeground(Color.WHITE);
labelTitel.setHorizontalAlignment(SwingConstants.CENTER);
labelTitel.setFont(new Font("宋体", Font.BOLD, 14));
@ -208,7 +208,7 @@ public class AHJFrame extends JFrame {
btnLogin = new JButton("登录");
btnLogin.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent arg0) {
new AHJDialogLogin(panelMain, labelUserInfo);
new AHJDialogLogin(panelMain, labelUserInfo, btnLogin, btnReg);
}
});
panelTop_CCI_Button.add(btnLogin);
@ -216,7 +216,7 @@ public class AHJFrame extends JFrame {
btnReg = new JButton("注册");
btnReg.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent arg0) {
new AHJDialogReg(panelMain, labelUserInfo);
new AHJDialogReg(panelMain, labelUserInfo, btnLogin, btnReg);
}
});
panelTop_CCI_Button.add(btnReg);
@ -226,7 +226,7 @@ public class AHJFrame extends JFrame {
labelUserInfo.setText(panelMain.getClientUserInfo().getUserName() + ",您好!欢迎使用本系统,系统中当前正在交易的商品共有" + panelMain.getGoodsList().length + "件。");
}
labelUserInfo.setForeground(Color.BLUE);
labelUserInfo.setPreferredSize(new Dimension(390, 46));
labelUserInfo.setPreferredSize(new Dimension(390, 58));
labelUserInfo.setHorizontalAlignment(SwingConstants.LEFT);
labelUserInfo.setFont(new Font("微软雅黑", Font.BOLD, 14));
panelTop_CCI.add(labelUserInfo, BorderLayout.CENTER);

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/Goods.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public interface Goods extends GoodsOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/GoodsCategory.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public interface GoodsCategory extends GoodsCategoryOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/GoodsCategoryHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
abstract public class GoodsCategoryHelper

View File

@ -3,8 +3,8 @@ package goodsManage;
/**
* goodsManage/GoodsCategoryHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public final class GoodsCategoryHolder implements org.omg.CORBA.portable.Streamable

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/GoodsCategoryOperations.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public interface GoodsCategoryOperations

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/GoodsCategoryPOA.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public abstract class GoodsCategoryPOA extends org.omg.PortableServer.Servant

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/GoodsCategoryPOATie.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public class GoodsCategoryPOATie extends GoodsCategoryPOA

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/GoodsHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
abstract public class GoodsHelper

View File

@ -3,8 +3,8 @@ package goodsManage;
/**
* goodsManage/GoodsHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public final class GoodsHolder implements org.omg.CORBA.portable.Streamable

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/GoodsManage.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public interface GoodsManage extends GoodsManageOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/GoodsManageHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
abstract public class GoodsManageHelper

View File

@ -3,8 +3,8 @@ package goodsManage;
/**
* goodsManage/GoodsManageHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public final class GoodsManageHolder implements org.omg.CORBA.portable.Streamable

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/_GoodsCategoryStub.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public class _GoodsCategoryStub extends org.omg.CORBA.portable.ObjectImpl implements goodsManage.GoodsCategory

Binary file not shown.

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/goodsCategorysHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
abstract public class goodsCategorysHelper

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/goodsCategorysHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public final class goodsCategorysHolder implements org.omg.CORBA.portable.Streamable

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/goodsListHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
abstract public class goodsListHelper

View File

@ -4,8 +4,8 @@ package goodsManage;
/**
* goodsManage/goodsListHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/GoodsManage.idl
* 2014年6月9日 星期一 下午02时04分19 CST
* 从D:/javaworkspace/Server/src/GoodsManage.idl
* 2014年6月12日 星期四 下午07时01分44 CST
*/
public final class goodsListHolder implements org.omg.CORBA.portable.Streamable

View File

@ -0,0 +1,5 @@
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port=4447
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

1
src/jndi.properties Normal file
View File

@ -0,0 +1 @@
java.naming.factory.url.pkgs=org.jboss.ejb.client.naming

View File

@ -0,0 +1,12 @@
/***************************************************
* 字符串校验函数zengping 20140717
*/
package org.check;
import java.util.regex.Pattern;
public class DataCheck {
public static boolean isRegularCode(String userData, String mtcStr) {
return Pattern.compile(mtcStr).matcher(userData).matches();
}
}

View File

@ -0,0 +1,15 @@
package org.entity;
import javax.ejb.Remote;
import org.model.Good;
import org.model.User;
@Remote
public interface UserManageRemote {
public void addUser(User user);
public boolean delUserById(int id);
public User getUserById(int id);
public void updateUser(User user);
public Good getGoodsById(int id);
}

View File

@ -0,0 +1,83 @@
package org.model;
import java.io.Serializable;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* The persistent class for the auctiontable database table.
*
*/
@Entity
@NamedQuery(name="Auctiontable.findAll", query="SELECT a FROM Auctiontable a")
public class Auctiontable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@SequenceGenerator(name="AUCTIONTABLE_AID_GENERATOR", sequenceName="AUCTIONTABLE")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="AUCTIONTABLE_AID_GENERATOR")
private int aid;
private double aprice;
private int astate;
private Timestamp auctiontime;
private int gid;
private int uid;
public Auctiontable() {
}
public int getAid() {
return this.aid;
}
public void setAid(int aid) {
this.aid = aid;
}
public double getAprice() {
return this.aprice;
}
public void setAprice(double aprice) {
this.aprice = aprice;
}
public int getAstate() {
return this.astate;
}
public void setAstate(int astate) {
this.astate = astate;
}
public Timestamp getAuctiontime() {
return this.auctiontime;
}
public void setAuctiontime(Timestamp auctiontime) {
this.auctiontime = auctiontime;
}
public int getGid() {
return this.gid;
}
public void setGid(int gid) {
this.gid = gid;
}
public int getUid() {
return this.uid;
}
public void setUid(int uid) {
this.uid = uid;
}
}

174
src/org/model/Good.java Normal file
View File

@ -0,0 +1,174 @@
package org.model;
import java.io.Serializable;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* The persistent class for the goods database table.
*
*/
@Entity
@Table(name="goods")
@NamedQuery(name="Good.findAll", query="SELECT g FROM Good g")
public class Good implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@SequenceGenerator(name="GOODS_GOODSID_GENERATOR", sequenceName="AUCTIONTABLE")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="GOODS_GOODSID_GENERATOR")
private int goodsId;
private double goodsDeadlinePrice;
private Timestamp goodsDeadlineTime;
private String goodsDetails;
private int goodsLastAuctionerId;
private Timestamp goodsLastAuctionTime;
private double goodsLastPrice;
private String goodsName;
private double goodsOriginalPrice;
private Timestamp goodsPromotedTime;
private int goodsProviderId;
private String goodsResume;
private int goodsSort;
private int goodsState;
private int goodsStrategy;
public Good() {
}
public int getGoodsId() {
return this.goodsId;
}
public void setGoodsId(int goodsId) {
this.goodsId = goodsId;
}
public double getGoodsDeadlinePrice() {
return this.goodsDeadlinePrice;
}
public void setGoodsDeadlinePrice(double goodsDeadlinePrice) {
this.goodsDeadlinePrice = goodsDeadlinePrice;
}
public Timestamp getGoodsDeadlineTime() {
return this.goodsDeadlineTime;
}
public void setGoodsDeadlineTime(Timestamp goodsDeadlineTime) {
this.goodsDeadlineTime = goodsDeadlineTime;
}
public String getGoodsDetails() {
return this.goodsDetails;
}
public void setGoodsDetails(String goodsDetails) {
this.goodsDetails = goodsDetails;
}
public int getGoodsLastAuctionerId() {
return this.goodsLastAuctionerId;
}
public void setGoodsLastAuctionerId(int goodsLastAuctionerId) {
this.goodsLastAuctionerId = goodsLastAuctionerId;
}
public Timestamp getGoodsLastAuctionTime() {
return this.goodsLastAuctionTime;
}
public void setGoodsLastAuctionTime(Timestamp goodsLastAuctionTime) {
this.goodsLastAuctionTime = goodsLastAuctionTime;
}
public double getGoodsLastPrice() {
return this.goodsLastPrice;
}
public void setGoodsLastPrice(double goodsLastPrice) {
this.goodsLastPrice = goodsLastPrice;
}
public String getGoodsName() {
return this.goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public double getGoodsOriginalPrice() {
return this.goodsOriginalPrice;
}
public void setGoodsOriginalPrice(double goodsOriginalPrice) {
this.goodsOriginalPrice = goodsOriginalPrice;
}
public Timestamp getGoodsPromotedTime() {
return this.goodsPromotedTime;
}
public void setGoodsPromotedTime(Timestamp goodsPromotedTime) {
this.goodsPromotedTime = goodsPromotedTime;
}
public int getGoodsProviderId() {
return this.goodsProviderId;
}
public void setGoodsProviderId(int goodsProviderId) {
this.goodsProviderId = goodsProviderId;
}
public String getGoodsResume() {
return this.goodsResume;
}
public void setGoodsResume(String goodsResume) {
this.goodsResume = goodsResume;
}
public int getGoodsSort() {
return this.goodsSort;
}
public void setGoodsSort(int goodsSort) {
this.goodsSort = goodsSort;
}
public int getGoodsState() {
return this.goodsState;
}
public void setGoodsState(int goodsState) {
this.goodsState = goodsState;
}
public int getGoodsStrategy() {
return this.goodsStrategy;
}
public void setGoodsStrategy(int goodsStrategy) {
this.goodsStrategy = goodsStrategy;
}
}

52
src/org/model/Sort.java Normal file
View File

@ -0,0 +1,52 @@
package org.model;
import java.io.Serializable;
import javax.persistence.*;
/**
* The persistent class for the sort database table.
*
*/
@Entity
@NamedQuery(name="Sort.findAll", query="SELECT s FROM Sort s")
public class Sort implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@SequenceGenerator(name="SORT_SORTID_GENERATOR", sequenceName="AUCTIONTABLE")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SORT_SORTID_GENERATOR")
private int sortId;
private String sortDescribe;
private String sortName;
public Sort() {
}
public int getSortId() {
return this.sortId;
}
public void setSortId(int sortId) {
this.sortId = sortId;
}
public String getSortDescribe() {
return this.sortDescribe;
}
public void setSortDescribe(String sortDescribe) {
this.sortDescribe = sortDescribe;
}
public String getSortName() {
return this.sortName;
}
public void setSortName(String sortName) {
this.sortName = sortName;
}
}

103
src/org/model/User.java Normal file
View File

@ -0,0 +1,103 @@
package org.model;
import java.io.Serializable;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* The persistent class for the user database table.
*
*/
@Entity
@NamedQuery(name="User.findAll", query="SELECT u FROM User u")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@SequenceGenerator(name="USER_USERID_GENERATOR", sequenceName="AUCTIONTABLE")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="USER_USERID_GENERATOR")
private int userId;
private Timestamp lastLoginTime;
private String userIP;
private int userLevel;
private String userMail;
private String userMobile;
private String userName;
private String userPsw;
public User() {
}
public int getUserId() {
return this.userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public Timestamp getLastLoginTime() {
return this.lastLoginTime;
}
public void setLastLoginTime(Timestamp lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public String getUserIP() {
return this.userIP;
}
public void setUserIP(String userIP) {
this.userIP = userIP;
}
public int getUserLevel() {
return this.userLevel;
}
public void setUserLevel(int userLevel) {
this.userLevel = userLevel;
}
public String getUserMail() {
return this.userMail;
}
public void setUserMail(String userMail) {
this.userMail = userMail;
}
public String getUserMobile() {
return this.userMobile;
}
public void setUserMobile(String userMobile) {
this.userMobile = userMobile;
}
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPsw() {
return this.userPsw;
}
public void setUserPsw(String userPsw) {
this.userPsw = userPsw;
}
}

22
src/org/xml/XmlRead.java Normal file
View File

@ -0,0 +1,22 @@
package org.xml;
import java.util.List;
import org.dom4j.Document;
import org.dom4j.DocumentException;
//import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class XmlRead {
@SuppressWarnings("rawtypes")
public static List readXML(String xmlUrl) throws DocumentException
{
Document document = new SAXReader().read(xmlUrl).getDocument();
return document.getRootElement().elements();
// int i = 1;
// for(Element server : (List<Element>)document.getRootElement().elements()){
// //取得txtbook节点下的name节点的内容
// System.out.println(server.element("ip").getText());
// System.out.println(server.element("port").getText());
// i++; //原来这里少些了这一行先补上
// }
}
}

View File

@ -10,6 +10,7 @@ import goodsManage.GoodsManage;
import goodsManage.GoodsManageHelper;
import java.awt.Graphics;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
@ -17,9 +18,12 @@ import javax.swing.JPanel;
import user.ClientUserInfo;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.omg.CORBA.ORB;
import org.omg.CosNaming.NamingContextExt;
import org.omg.CosNaming.NamingContextExtHelper;
import org.xml.XmlRead;
import userManage.UserInfo;
import userManage.UserManage;
@ -142,10 +146,20 @@ public class AHJPanelMainBg extends JPanel{
m_arrGoodsCateGory = m_goodsManage.getCategoryList();
}
public void init()
@SuppressWarnings("unchecked")
public void init() throws DocumentException
{
this.iServerState = 1;
String[] port={"-ORBInitialPort", "9000", "-ORBInitialHost", "192.168.1.103"};
@SuppressWarnings("rawtypes")
List list = XmlRead.readXML("src/config.xml");
String serverIp = "127.0.0.1";
String serverPort = "";
for(Element server : (List<Element>)list){
serverIp = server.element("ip").getText();
serverPort = server.element("port").getText();
}
String[] port={"-ORBInitialPort", serverPort, "-ORBInitialHost", serverIp};
try{
ORB orb = ORB.init(port, null);
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/AuctionTable.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public interface AuctionTable extends AuctionTableOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/AuctionTableHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
abstract public class AuctionTableHelper

View File

@ -4,7 +4,7 @@ package userManage;
* userManage/AuctionTableHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public final class AuctionTableHolder implements org.omg.CORBA.portable.Streamable

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/AuctionTableOperations.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public interface AuctionTableOperations

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/AuctionTablePOA.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public abstract class AuctionTablePOA extends org.omg.PortableServer.Servant

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/AuctionTablePOATie.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public class AuctionTablePOATie extends AuctionTablePOA

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/UserInfo.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/UserInfoHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/

View File

@ -4,7 +4,7 @@ package userManage;
* userManage/UserInfoHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/

Binary file not shown.

Binary file not shown.

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/UserManage.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public interface UserManage extends UserManageOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/UserManageHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
abstract public class UserManageHelper

View File

@ -4,7 +4,7 @@ package userManage;
* userManage/UserManageHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public final class UserManageHolder implements org.omg.CORBA.portable.Streamable

Binary file not shown.

Binary file not shown.

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/_AuctionTableStub.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public class _AuctionTableStub extends org.omg.CORBA.portable.ObjectImpl implements userManage.AuctionTable

Binary file not shown.

Binary file not shown.

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/auctiontablesHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
abstract public class auctiontablesHelper

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/auctiontablesHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public final class auctiontablesHolder implements org.omg.CORBA.portable.Streamable

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/longsHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
abstract public class longsHelper

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/longsHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public final class longsHolder implements org.omg.CORBA.portable.Streamable

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/usersHelper.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
abstract public class usersHelper

View File

@ -5,7 +5,7 @@ package userManage;
* userManage/usersHolder.java .
* 由IDL-to-Java 编译器 (可移植), 版本 "3.2"生成
* 从D:/javaworkspace/Server/src/UserManage.idl
* 2014年6月9日 星期一 下午02时14分40 CST
* 2014年6月12日 星期四 下午08时17分51 CST
*/
public final class usersHolder implements org.omg.CORBA.portable.Streamable