📄 clothesinandoutaction.java
字号:
.getVipId());
vipName = vipVo.getVipName();
vipPhone = vipVo.getVipPhone();
}
Object[] data = { value.getOrderId(),
orderVo.getGetClothesDate(),
orderVo.getTakeClothesDate(),
orderVo.getOrderValue(),
orderVo.getOrderValue(),
new Integer(vipId), vipName, vipPhone,
orderVo.isTakeOrNot()?"已取走":"未取走", orderVo.getOperatorName() };
model.addRow(data);
}
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
JTable table = dialog
.buildReturnedCollectionTable();
int row = table.getSelectedRow();
long orderId = Long.parseLong(table.getValueAt(
row, 0).toString());
int vipId = Integer.parseInt(table.getValueAt(
row, 5).toString());
double neededAmount = Double.parseDouble(table
.getValueAt(row, 3).toString());
double receivedAmount = Double
.parseDouble(table.getValueAt(row, 4)
.toString());
buildRewashItemTableData(orderId, vipId);
buildLabelPanel(orderId, neededAmount,
receivedAmount, vipId);
}
});
} catch (DbException e) {
JOptionPane.showMessageDialog(null, "统计返回重洗记录失败:" + e.getMessage());
}
} else if (nodeStr.equals("过期未取走衣物")) {
JTable table = dialog.buildOverTimeCollectionTable();
try {
long[] orderIds = dao.findOutOfDateOrderId(fromDate,
toDate);
DefaultTableModel model = (DefaultTableModel) table
.getModel();
int rows = table.getRowCount();
for (int i = rows - 1; i >= 0; i--) {
model.removeRow(i);
}
for (int i = 0; i < orderIds.length; i++) {
long orderId = orderIds[i];
OrderVo value = cdao.getOrderInfoByOrderId(orderId);
String vipName = "无卡用户";
String vipPhone = "无";
int vipId = value.getCustomerId();
if (vipId != 0) {
VipVo vipVo = cdao.getVipInfoByVipId(vipId);
vipName = vipVo.getVipName();
vipPhone = vipVo.getVipPhone();
}
Object[] data = { value.getOrderId(),
value.getGetClothesDate(),
value.getTakeClothesDate(),
value.getOrderValue(),
value.getOrderValue(),
value.getCustomerId(), vipName, vipPhone,
value.isTakeOrNot()?"已取走":"未取走", value.getOperatorName() };
model.addRow(data);
}
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
JTable table = dialog
.buildOverTimeCollectionTable();
int row = table.getSelectedRow();
long orderId = Long.parseLong(table.getValueAt(
row, 0).toString());
int vipId = Integer.parseInt(table.getValueAt(
row, 5).toString());
double neededAmount = Double.parseDouble(table
.getValueAt(row, 3).toString());
double receivedAmount = Double
.parseDouble(table.getValueAt(row, 4)
.toString());
buildOutOfDateItemTableData(orderId, vipId);
buildLabelPanel(orderId, neededAmount,
receivedAmount, vipId);
}
});
} catch (DbException e) {
JOptionPane.showMessageDialog(null, "统计过期未取走衣物失败:"+e.getMessage());
e.printStackTrace();
}
}
}
}
}
public void buildItemTableData(long orderId, int vipId) {
CommonDao cdao = new CommonDaoImpl(log);
try {
OrderItemVo vo = null;
Iterator iter = null;
Vector v = null;
v = cdao.getOrderItemByOrderId(orderId);
iter = v.iterator();
JTable table = dialog.buildItemTable();
DefaultTableModel model = (DefaultTableModel) table.getModel();
int rows = table.getRowCount();
for (int i = rows - 1; i >= 0; i--) {
model.removeRow(i);
}
double discount = cdao.getDiscountByVipId(vipId)*0.1;
while (iter.hasNext()) {
vo = (OrderItemVo) iter.next();
ClothesTypeVo type = (ClothesTypeVo) vo.getClothesType();
String addition = vo.getClothesAdditionInfo();
if(addition == null)
addition ="";
Object[] data = {
type.getClothesName(),
vo.getClothesQuatity(),
type.getServiceType(),
type.getUnitOriginalPrice() * discount,
(type.getUnitOriginalPrice()) * discount
* (vo.getClothesQuatity()), discount*10,
vo.getAccessory(), vo.getColor(),
addition};
model.addRow(data);
}
} catch (DbException e) {
JOptionPane.showMessageDialog(null, "构造定单的详单信息失败:"+e.getMessage());
}
}
public void buildDamagedItemTableData(long orderId) {
CommonDao cdao = new CommonDaoImpl(log);
try {
OrderItemVo vo = null;
Iterator iter = null;
Vector v = null;
v = cdao.getOrderItemByOrderId(orderId);
iter = v.iterator();
JTable table = dialog.buildDamagedItemTable();
DefaultTableModel model = (DefaultTableModel) table.getModel();
int rows = table.getRowCount();
for (int i = rows - 1; i >= 0; i--) {
model.removeRow(i);
}
int vipId = cdao.getVipIdByOrderId(orderId);
double discount = cdao.getDiscountByVipId(vipId);
while (iter.hasNext()) {
vo = (OrderItemVo) iter.next();
ClothesTypeVo type = (ClothesTypeVo) vo.getClothesType();
String addition = vo.getClothesAdditionInfo();
if(addition == null)
addition ="";
Object[] data = {
type.getClothesName(),
vo.getClothesQuatity(),
type.getServiceType(),
type.getUnitOriginalPrice() * discount * 0.1,
(type.getUnitOriginalPrice()) * discount
* (vo.getClothesQuatity()) * 0.1, discount,
vo.getAccessory(), vo.getColor(),
addition };
model.addRow(data);
}
} catch (DbException e) {
JOptionPane.showMessageDialog(null, "显示赔偿定单的详细信息失败:"+ e.getMessage());
}
}
public void buildRewashItemTableData(long orderId, int vipId) {
CommonDao cdao = new CommonDaoImpl(log);
try {
OrderItemVo vo = null;
Iterator iter = null;
Vector v = null;
v = cdao.getOrderItemByOrderId(orderId);
iter = v.iterator();
JTable table = dialog.buildReturnedItemTable();
DefaultTableModel model = (DefaultTableModel) table.getModel();
int rows = table.getRowCount();
for (int i = rows - 1; i >= 0; i--) {
model.removeRow(i);
}
double discount = cdao.getDiscountByVipId(vipId)*0.1;
while (iter.hasNext()) {
vo = (OrderItemVo) iter.next();
ClothesTypeVo type = (ClothesTypeVo) vo.getClothesType();
String addition = vo.getClothesAdditionInfo();
if(addition == null)
addition ="";
Object[] data = {
type.getClothesName(),
vo.getClothesQuatity(),
type.getServiceType(),
type.getUnitOriginalPrice() * discount,
(type.getUnitOriginalPrice()) * discount
* (vo.getClothesQuatity()), discount*10,
vo.getAccessory(), vo.getColor(), "是",
addition };
model.addRow(data);
}
} catch (DbException e) {
JOptionPane.showMessageDialog(null, "显示重洗定单的详细信息失败:"+ e.getMessage());
}
}
public void buildOutOfDateItemTableData(long orderId, int vipId) {
CommonDao cdao = new CommonDaoImpl(log);
try {
OrderItemVo vo = null;
Iterator iter = null;
Vector v = null;
v = cdao.getOrderItemByOrderId(orderId);
iter = v.iterator();
JTable table = dialog.buildOverTimeItemTable();
DefaultTableModel model = (DefaultTableModel) table.getModel();
int rows = table.getRowCount();
for (int i = rows - 1; i >= 0; i--) {
model.removeRow(i);
}
double discount = cdao.getDiscountByVipId(vipId)*0.1;
while (iter.hasNext()) {
vo = (OrderItemVo) iter.next();
ClothesTypeVo type = (ClothesTypeVo) vo.getClothesType();
String addition = vo.getClothesAdditionInfo();
if(addition == null)
addition ="";
Object[] data = {
type.getClothesName(),
vo.getClothesQuatity(),
type.getServiceType(),
type.getUnitOriginalPrice() * discount,
(type.getUnitOriginalPrice()) * discount
* (vo.getClothesQuatity()), discount*10,
vo.getAccessory(), vo.getColor(), "未取走",
addition };
model.addRow(data);
}
} catch (DbException e) {
JOptionPane.showMessageDialog(null, "显示过期未领定单的详细信息失败"+e.getMessage());
}
}
public void buildLabelPanel(long orderId, double neededAmount,
double receivedAmount, int vipId) {
JLabel label = dialog.buildLabel();
CommonDao cdao = new CommonDaoImpl(log);
try {
double discount = cdao.getDiscountByVipId(vipId);
label.setText("交易单:" + orderId + ",应收金额:" + neededAmount
+ "元,实收金额:" + receivedAmount + ",折扣:" + discount);
} catch (DbException e) {
e.printStackTrace();
}
}
public void buildLabelPanel(long orderId) {
JLabel label = dialog.buildLabel();
label.setText("相关赔偿单号的详细信息 交易单号:" + orderId);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -