📄 exitemsbean.java
字号:
public void setCostPrice(String sV) {
if (sV != null && !"".equals(sV)) {
this.costPrice = Double.parseDouble(sV);
}
}
public void setCostPrice(double fV) {
this.costPrice = fV;
}
public double getCostAmo() {
return this.costAmo;
}
public void setCostAmo(String sV) {
if (sV != null && !"".equals(sV)) {
this.costAmo = Double.parseDouble(sV);
}
}
public void setCostAmo(double fV) {
this.costAmo = fV;
}
public double getDiscount() {
return this.discount;
}
public void setDiscount(String sV) {
if (sV != null && !"".equals(sV)) {
this.discount = Double.parseDouble(sV);
}
}
public void setDiscount(double fV) {
this.discount = fV;
}
public String getOrderID() {
return this.orderID;
}
public void setOrderID(String sV) {
if (sV != null) {
this.orderID = sV;
}
}
public String getInvoiceID() {
return this.invoiceID;
}
public void setInvoiceID(String sV) {
if (sV != null) {
this.invoiceID = sV;
}
}
public double getFeeItems() {
return this.feeItems;
}
public void setFeeItems(String sV) {
if (sV != null && !"".equals(sV)) {
this.feeItems = Double.parseDouble(sV);
}
}
public void setFeeItems(double fV) {
this.feeItems = fV;
}
public String getLocation() {
return this.location;
}
public void setLocation(String sV) {
if (sV != null) {
this.location = sV;
}
}
public String getRemark() {
return this.remark;
}
public void setRemark(String sV) {
if (sV != null) {
this.remark = sV;
}
}
public boolean getIsCom() {
return this.isCom;
}
public void setIsCom(String b) {
if (b == null) {
return;
}
if ("1".equals(b)) {
this.isCom = true;
} else {
this.isCom = false;
}
}
public void setIsCom(boolean b) {
this.isCom = b;
}
public double getJs() {
return this.js;
}
public void setJs(String sV) {
if (sV != null && !"".equals(sV)) {
this.js = Double.parseDouble(sV);
}
}
public void setJs(double fV) {
this.js = fV;
}
private double sheetSalePrice = 0;
private double sheetSaleAmo = 0;
public double getSheetSalePrice() {
return this.sheetSalePrice;
}
public void setSheetSalePrice(String sV) {
if (sV != null && !"".equals(sV)) {
this.sheetSalePrice = Double.parseDouble(sV);
}
}
public void setSheetSalePrice(double nV) {
this.sheetSalePrice = nV;
}
public double getSheetSaleAmo() {
return this.sheetSaleAmo;
}
public void setSheetSaleAmo(String sV) {
if (sV != null && !"".equals(sV)) {
this.sheetSaleAmo = Double.parseDouble(sV);
}
}
public void setSheetSaleAmo(double nV) {
this.sheetSaleAmo = nV;
}
public boolean insert() {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
DatabaseConnection dc = new DatabaseConnection(jndiName);
conn = dc.getConnection();
String sql = "insert into exItems(exSheetCode,freeID,goodsID,productNo,gdsName,gdsNo,unit,color,brandName,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,pQua,mQua,qua,price,amo,costPrice,costAmo,discount,orderID,invoiceID,feeItems,location,remark,isCom,js,warehouseCode,sheetSalePrice,sheetSaleAmo) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
pstmt = conn.prepareStatement(sql);
// pstmt.setInt(1, this.ID);
pstmt.setString(1, this.exSheetCode);
pstmt.setString(2, this.freeID);
pstmt.setInt(3, this.goodsID);
pstmt.setString(4, this.productNo);
pstmt.setString(5, this.gdsName);
pstmt.setString(6, this.gdsNo);
pstmt.setString(7, this.unit);
pstmt.setString(8, this.color);
pstmt.setString(9, this.brandName);
pstmt.setDouble(10, this.s1);
pstmt.setDouble(11, this.s2);
pstmt.setDouble(12, this.s3);
pstmt.setDouble(13, this.s4);
pstmt.setDouble(14, this.s5);
pstmt.setDouble(15, this.s6);
pstmt.setDouble(16, this.s7);
pstmt.setDouble(17, this.s8);
pstmt.setDouble(18, this.s9);
pstmt.setDouble(19, this.s10);
pstmt.setDouble(20, this.s11);
pstmt.setDouble(21, this.s12);
pstmt.setDouble(22, this.s13);
pstmt.setDouble(23, this.pQua);
pstmt.setDouble(24, this.mQua);
pstmt.setDouble(25, this.qua);
pstmt.setDouble(26, this.price);
pstmt.setDouble(27, this.amo);
pstmt.setDouble(28, this.costPrice);
pstmt.setDouble(29, this.costAmo);
pstmt.setDouble(30, this.discount);
pstmt.setString(31, this.orderID);
pstmt.setString(32, this.invoiceID);
pstmt.setDouble(33, this.feeItems);
pstmt.setString(34, this.location);
pstmt.setString(35, this.remark);
pstmt.setBoolean(36, this.isCom);
pstmt.setDouble(37, this.js);
pstmt.setInt(38, this.warehouseCode);
pstmt.setDouble(39, this.sheetSalePrice);
pstmt.setDouble(40, this.sheetSaleAmo);
pstmt.execute();
sql = " select max(ID) as ID from exItems ";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
while (rs.next()) {
this.ID = rs.getInt("ID");
}
return true;
} catch (Exception ex) {
ex.printStackTrace();
new WriteLog(jndiName, 0, 10000, "core", "kernel", "database", this
.getClass().getName()
+ ": " + ex.getMessage(), true, 0);
return false;
} finally {
try {
if (rs != null) {
rs.close();
}
if (pstmt != null) {
pstmt.close();
}
if (conn != null) {
conn.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
public boolean modify() {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
DatabaseConnection dc = new DatabaseConnection(jndiName);
conn = dc.getConnection();
String sql = "update exItems set exSheetCode=?,freeID=?,goodsID=?,productNo=?,gdsName=?,gdsNo=?,unit=?,color=?,brandName=?,s1=?,s2=?,s3=?,s4=?,s5=?,s6=?,s7=?,s8=?,s9=?,s10=?,s11=?,s12=?,s13=?,pQua=?,mQua=?,qua=?,price=?,amo=?,costPrice=?,costAmo=?,discount=?,orderID=?,invoiceID=?,feeItems=?,location=?,remark=?,isCom=?,js=?,warehouseCode=?,sheetSalePrice=?,sheetSaleAmo=? where ID=?";
pstmt = conn.prepareStatement(sql);
// pstmt.setInt(1, this.ID);
pstmt.setString(1, this.exSheetCode);
pstmt.setString(2, this.freeID);
pstmt.setInt(3, this.goodsID);
pstmt.setString(4, this.productNo);
pstmt.setString(5, this.gdsName);
pstmt.setString(6, this.gdsNo);
pstmt.setString(7, this.unit);
pstmt.setString(8, this.color);
pstmt.setString(9, this.brandName);
pstmt.setDouble(10, this.s1);
pstmt.setDouble(11, this.s2);
pstmt.setDouble(12, this.s3);
pstmt.setDouble(13, this.s4);
pstmt.setDouble(14, this.s5);
pstmt.setDouble(15, this.s6);
pstmt.setDouble(16, this.s7);
pstmt.setDouble(17, this.s8);
pstmt.setDouble(18, this.s9);
pstmt.setDouble(19, this.s10);
pstmt.setDouble(20, this.s11);
pstmt.setDouble(21, this.s12);
pstmt.setDouble(22, this.s13);
pstmt.setDouble(23, this.pQua);
pstmt.setDouble(24, this.mQua);
pstmt.setDouble(25, this.qua);
pstmt.setDouble(26, this.price);
pstmt.setDouble(27, this.amo);
pstmt.setDouble(28, this.costPrice);
pstmt.setDouble(29, this.costAmo);
pstmt.setDouble(30, this.discount);
pstmt.setString(31, this.orderID);
pstmt.setString(32, this.invoiceID);
pstmt.setDouble(33, this.feeItems);
pstmt.setString(34, this.location);
pstmt.setString(35, this.remark);
pstmt.setBoolean(36, this.isCom);
pstmt.setDouble(37, this.js);
pstmt.setInt(38, this.warehouseCode);
pstmt.setDouble(39, this.sheetSalePrice);
pstmt.setDouble(40, this.sheetSaleAmo);
pstmt.setInt(41, this.ID);
pstmt.execute();
return true;
} catch (Exception ex) {
ex.printStackTrace();
new WriteLog(jndiName, 0, 10000, "core", "kernel", "database", this
.getClass().getName()
+ ": " + ex.getMessage(), true, 0);
return false;
} finally {
try {
if (rs != null) {
rs.close();
}
if (pstmt != null) {
pstmt.close();
}
if (conn != null) {
conn.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
public boolean content() {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
DatabaseConnection dc = new DatabaseConnection(jndiName);
conn = dc.getConnection();
String sql = "select * from exItems where ID=?";
pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, this.ID);
rs = pstmt.executeQuery();
while (rs.next()) {
setID(rs.getInt("ID"));
setExSheetCode(rs.getString("exSheetCode"));
setFreeID(rs.getString("freeID"));
setGoodsID(rs.getInt("goodsID"));
setProductNo(rs.getString("productNo"));
setGdsName(rs.getString("gdsName"));
setGdsNo(rs.getString("gdsNo"));
setUnit(rs.getString("unit"));
setColor(rs.getString("color"));
setBrandName(rs.getString("brandName"));
setS1(rs.getDouble("s1"));
setS2(rs.getDouble("s2"));
setS3(rs.getDouble("s3"));
setS4(rs.getDouble("s4"));
setS5(rs.getDouble("s5"));
setS6(rs.getDouble("s6"));
setS7(rs.getDouble("s7"));
setS8(rs.getDouble("s8"));
setS9(rs.getDouble("s9"));
setS10(rs.getDouble("s10"));
setS11(rs.getDouble("s11"));
setS12(rs.getDouble("s12"));
setS13(rs.getDouble("s13"));
setPQua(rs.getDouble("pQua"));
setMQua(rs.getDouble("mQua"));
setQua(rs.getDouble("qua"));
setPrice(rs.getDouble("price"));
setAmo(rs.getDouble("amo"));
setCostPrice(rs.getDouble("costPrice"));
setCostAmo(rs.getDouble("costAmo"));
setDiscount(rs.getDouble("discount"));
setOrderID(rs.getString("orderID"));
setInvoiceID(rs.getString("invoiceID"));
setFeeItems(rs.getDouble("feeItems"));
setLocation(rs.getString("location"));
setRemark(rs.getString("remark"));
setIsCom(rs.getBoolean("isCom"));
setJs(rs.getDouble("js"));
setWarehouseCode(rs.getInt("warehouseCode"));
setSheetSalePrice(rs.getDouble("sheetSalePrice"));
setSheetSaleAmo(rs.getDouble("sheetSaleAmo"));
return true;
}
return false;
} catch (Exception ex) {
ex.printStackTrace();
new WriteLog(jndiName, 0, 10000, "core", "kernel", "database", this
.getClass().getName()
+ ": " + ex.getMessage(), true, 0);
return false;
} finally {
try {
if (rs != null) {
rs.close();
}
if (pstmt != null) {
pstmt.close();
}
if (conn != null) {
conn.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
public boolean isExistsByCode() {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
DatabaseConnection dc = new DatabaseConnection(jndiName);
conn = dc.getConnection();
String sql = "select * from exItems where ID=?";
pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, this.ID);
rs = pstmt.executeQuery();
while (rs.next()) {
return true;
}
return false;
} catch (Exception ex) {
ex.printStackTrace();
new WriteLog(jndiName, 0, 10000, "core", "kernel", "database", this
.getClass().getName()
+ ": " + ex.getMessage(), true, 0);
return false;
} finally {
try {
if (rs != null) {
rs.close();
}
if (pstmt != null) {
pstmt.close();
}
if (conn != null) {
conn.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
public boolean delete() {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
DatabaseConnection dc = new DatabaseConnection(jndiName);
conn = dc.getConnection();
String sql = "delete from exItems where ID=?";
pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, this.ID);
pstmt.execute();
return true;
} catch (Exception ex) {
ex.printStackTrace();
new WriteLog(jndiName, 0, 10000, "core", "kernel", "database", this
.getClass().getName()
+ ": " + ex.getMessage(), true, 0);
return false;
} finally {
try {
if (rs != null) {
rs.close();
}
if (pstmt != null) {
pstmt.close();
}
if (conn != null) {
conn.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
public Object clone() {
ExItemsModel ex = null;
try {
ex = (ExItemsModel) super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return ex;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -