📄 slipproduct.java
字号:
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class SlipProduct extends ShangObject
{
/**
销售单编号
*/
private String slipId;
/**
产品编号
*/
private String productId;
/**
件数
*/
private float counting;
/**
数量
*/
private float quantity;
/**
包装
*/
private int pack;
/**
单价
*/
private float unitPrice;
/**
实际数量
*/
private float actQuantity;
/**
成本单价
*/
private float unitCost;
/*
private float interest;
private float stockFee;
private float otherFee;
private float inFee;
private float outFee;
private float ratio;
*/
public SlipProduct()
{
primarykey1Name="slipId" ;
primarykey1Type=1;
primarykey2Name="productId" ;
primarykey2Type=1;
tableName ="SlipProduct";
viewName="SlipProduct";
numInOnePager=10;
}
public int loadAttr() {
try {
slipId= getRsString(rs,"slipId");
productId= getRsString(rs,"productId");
counting= rs.getFloat("counting");
quantity= rs.getFloat("quantity");
pack= rs.getInt("pack");
unitPrice= rs.getFloat("unitPrice");
actQuantity= rs.getFloat("actQuantity");
unitCost=rs.getFloat("unitCost");
/*
interest = rs.getFloat("interest");
stockFee = rs.getFloat("stockFee");
otherFee = rs.getFloat("otherFee");
inFee = rs.getFloat("inFee");
outFee = rs.getFloat("outFee");
ratio = rs.getFloat("ratio");
*/
} catch(SQLException e) {
e.printStackTrace();
print("query failed!");
return -1;
}
return 1;
}
public String getWhereClause(javax.servlet.ServletRequest request) {
String whereClause = "";
int queryMode = (new Integer(request.getParameter("queryMode"))).intValue();
switch(queryMode)
{
case 1: // 综合查询
whereClause = addWhereClause(whereClause, "slipId", "=", "'",request.getParameter("slipId"));
whereClause = addWhereClause(whereClause, "productId", "=", "'",request.getParameter("productId"));
break;
case 2:
break;
}
return whereClause;
}
public int insert() {
String sql= "{?=call sp_InsertSlipProduct(?,?,?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt,2,slipId);
setStmtString(updStmt,3,productId);
updStmt.setFloat(4,counting);
updStmt.setFloat(5,quantity);
updStmt.setInt(6,pack);
updStmt.setFloat(7,unitPrice);
updStmt.setFloat(8,actQuantity);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
print(E.getMessage());
return -102;
}
}
public int update() {
String sql= "{?=call sp_UpdateSlipProduct(?,?,?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt,2,slipId);
setStmtString(updStmt,3,productId);
updStmt.setFloat(4,counting);
updStmt.setFloat(5,quantity);
updStmt.setInt(6,pack);
updStmt.setFloat(7,unitPrice);
updStmt.setFloat(8,actQuantity);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
print(E.getMessage());
return -102;
}
}
public int updateQuantity() {
String sql= "{?=call sp_UpdateSlipQuantity(?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt,2,slipId);
setStmtString(updStmt,3,productId);
updStmt.setFloat(4,counting);
updStmt.setFloat(5,actQuantity);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
print(E.getMessage());
return -102;
}
}
public int unitCostConfirm() {
String sql= "{?=call sp_UpdateUnitCost(?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt,2,slipId);
setStmtString(updStmt,3,productId);
updStmt.setFloat(4,unitCost);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
print(E.getMessage());
return -102;
}
}
public int close() {
String sql= "{?=call sp_CloseSlipProduct(?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt,2,slipId);
setStmtString(updStmt,3,productId);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
print(E.getMessage());
return -102;
}
}
/**
* Access method for the slipId property.
*
* @return the current value of the slipId property
*/
public String getSlipId() {
return slipId;}
/**
* Sets the value of the slipId property.
*
* @param aSlipId the new value of the slipId property
*/
public void setSlipId(String aSlipId) {
slipId = setChnString(aSlipId);}
/**
* Access method for the productId property.
*
* @return the current value of the productId property
*/
public String getProductId() {
return productId;}
/**
* Sets the value of the productId property.
*
* @param aProductId the new value of the productId property
*/
public void setProductId(String aProductId) {
productId = setChnString(aProductId);}
/**
* Access method for the counting property.
*
* @return the current value of the counting property
*/
public float getCounting() {
return counting;}
/**
* Sets the value of the counting property.
*
* @param aCounting the new value of the counting property
*/
public void setCounting(float aCounting) {
counting = aCounting;}
/**
* Access method for the quantity property.
*
* @return the current value of the quantity property
*/
public float getQuantity() {
return quantity;}
/**
* Sets the value of the quantity property.
*
* @param aQuantity the new value of the quantity property
*/
public void setQuantity(float aQuantity) {
quantity = aQuantity;}
/**
* Access method for the pack property.
*
* @return the current value of the pack property
*/
public int getPack() {
return pack;}
/**
* Sets the value of the pack property.
*
* @param aPack the new value of the pack property
*/
public void setPack(int aPack) {
pack = aPack;}
/**
* Access method for the unitPrice property.
*
* @return the current value of the unitPrice property
*/
public float getUnitPrice() {
return unitPrice;}
/**
* Sets the value of the unitPrice property.
*
* @param aUnitPrice the new value of the unitPrice property
*/
public void setUnitPrice(float aUnitPrice) {
unitPrice = aUnitPrice;}
/**
* Access method for the actQuantity property.
*
* @return the current value of the actQuantity property
*/
public float getActQuantity() {
return actQuantity;}
/**
* Sets the value of the actQuantity property.
*
* @param aActQuantity the new value of the actQuantity property
*/
public void setActQuantity(float aActQuantity) {
actQuantity = aActQuantity;
}
public float getUnitCost() {
return unitCost;}
public void setUnitCost(float aUnitCost) {
unitCost = aUnitCost;}
/*
public float getInterest() {
return interest;}
public void setInterest(float aInterest) {
interest = aInterest;}
public float getStockFee() {
return stockFee;}
public void setStockFee(float aStockFee) {
stockFee = aStockFee;}
public float getOtherFee() {
return otherFee;}
public void setOtherFee(float aOtherFee) {
otherFee = aOtherFee;}
public float getInFee() {
return inFee;}
public void setInFee(float aInFee) {
inFee = aInFee;}
public float getOutFee() {
return outFee;}
public void setOutFee(float aOutFee) {
outFee = aOutFee;}
public float getRatio() {
return ratio;}
public void setRatio(float aRatio) {
ratio = aRatio;}
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -