📄 purch.java
字号:
//Source file: D:\work\五洋\javaBean\src\Purch.java
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class Purch extends ShangObject
{
/**
采购单编号
*/
private String purchId;
/**
采购单状态
*/
private int purchState;
/**
用途
*/
private String useFor;
/**
合同编号
*/
private String contractId;
/**
客户编号
*/
private String customerId;
/**
申请金额
*/
private float appMoney;
/**
部门经理
*/
private String deptManager;
/**
供应部经理签名
*/
private String gongYinId;
/**
总经理签名
*/
private String ceoId;
/**
用款方式
*/
private int useWay;
/**
预计发货期
*/
private Timestamp perdictDate;
/**
用款时间
*/
private Timestamp needDate;
/**
申请人
*/
private String proposer;
/**
部门编号
*/
private String deptId;
/**
申请日
*/
private Timestamp appDate;
/**
备注或批示
*/
private String comment;
/**
货单号
*/
private String huoDanId;
/**
* Access method for the purchId property.
*
* @return the current value of the purchId property
*/
public String getPurchId() {
return purchId;}
/**
* Sets the value of the purchId property.
*
* @param aPurchId the new value of the purchId property
*/
public void setPurchId(String aPurchId) {
purchId = setChnString(aPurchId);}
/**
* Access method for the purchState property.
*
* @return the current value of the purchState property
*/
public int getPurchState() {
return purchState;}
/**
* Sets the value of the purchState property.
*
* @param aPurchState the new value of the purchState property
*/
public void setPurchState(int aPurchState) {
purchState = aPurchState;}
/**
* Access method for the useFor property.
*
* @return the current value of the useFor property
*/
public String getUseFor() {
return useFor;}
/**
* Sets the value of the useFor property.
*
* @param aUseFor the new value of the useFor property
*/
public void setUseFor(String aUseFor) {
useFor = setChnString(aUseFor);}
/**
* Access method for the contractId property.
*
* @return the current value of the contractId property
*/
public String getContractId() {
return contractId;}
/**
* Sets the value of the contractId property.
*
* @param aContractId the new value of the contractId property
*/
public void setContractId(String aContractId) {
contractId = setChnString(aContractId);}
/**
* Access method for the customerId property.
*
* @return the current value of the customerId property
*/
public String getCustomerId() {
return customerId;}
/**
* Sets the value of the customerId property.
*
* @param aCustomerId the new value of the customerId property
*/
public void setCustomerId(String aCustomerId) {
customerId = setChnString(aCustomerId);}
/**
* Access method for the appMoney property.
*
* @return the current value of the appMoney property
*/
public float getAppMoney() {
return appMoney;}
/**
* Sets the value of the appMoney property.
*
* @param aAppMoney the new value of the appMoney property
*/
public void setAppMoney(float aAppMoney) {
appMoney = aAppMoney;}
/**
* Access method for the deptManager property.
*
* @return the current value of the deptManager property
*/
public String getDeptManager() {
return deptManager;}
/**
* Sets the value of the deptManager property.
*
* @param aDeptManager the new value of the deptManager property
*/
public void setDeptManager(String aDeptManager) {
deptManager = setChnString(aDeptManager);}
/**
* Access method for the gongYinId property.
*
* @return the current value of the gongYinId property
*/
public String getGongYinId() {
return gongYinId;}
/**
* Sets the value of the gongYinId property.
*
* @param aGongYinId the new value of the gongYinId property
*/
public void setGongYinId(String aGongYinId) {
gongYinId = setChnString(aGongYinId);}
/**
* Access method for the ceoId property.
*
* @return the current value of the ceoId property
*/
public String getCeoId() {
return ceoId;}
/**
* Sets the value of the ceoId property.
*
* @param aCeoId the new value of the ceoId property
*/
public void setCeoId(String aCeoId) {
ceoId = setChnString(aCeoId);}
/**
* Access method for the useWay property.
*
* @return the current value of the useWay property
*/
public int getUseWay() {
return useWay;}
/**
* Sets the value of the useWay property.
*
* @param aUseWay the new value of the useWay property
*/
public void setUseWay(int aUseWay) {
useWay = aUseWay;}
/**
* Access method for the perdictDate property.
*
* @return the current value of the perdictDate property
*/
public Timestamp getPerdictDate() {
return perdictDate;}
/**
* Sets the value of the perdictDate property.
*
* @param aPerdictDate the new value of the perdictDate property
*/
public void setPerdictDate(Timestamp aPerdictDate) {
perdictDate = aPerdictDate;}
/**
* Access method for the needDate property.
*
* @return the current value of the needDate property
*/
public Timestamp getNeedDate() {
return needDate;}
/**
* Sets the value of the needDate property.
*
* @param aNeedDate the new value of the needDate property
*/
public void setNeedDate(Timestamp aNeedDate) {
needDate = aNeedDate;}
/**
* Access method for the proposer property.
*
* @return the current value of the proposer property
*/
public String getProposer() {
return proposer;}
/**
* Sets the value of the proposer property.
*
* @param aProposer the new value of the proposer property
*/
public void setProposer(String aProposer) {
proposer = setChnString(aProposer);}
/**
* Access method for the deptId property.
*
* @return the current value of the deptId property
*/
public String getDeptId() {
return deptId;}
/**
* Sets the value of the deptId property.
*
* @param aDeptId the new value of the deptId property
*/
public void setDeptId(String aDeptId) {
deptId = setChnString(aDeptId);}
/**
* Access method for the appDate property.
*
* @return the current value of the appDate property
*/
public Timestamp getAppDate() {
return appDate;}
/**
* Sets the value of the appDate property.
*
* @param aAppDate the new value of the appDate property
*/
public void setAppDate(Timestamp aAppDate) {
appDate = aAppDate;}
/**
* Access method for the comment property.
*
* @return the current value of the comment property
*/
public String getComment() {
return comment;}
/**
* Sets the value of the comment property.
*
* @param aComment the new value of the comment property
*/
public void setComment(String aComment) {
comment = setChnString(aComment);}
/**
* Access method for the huoDanId property.
*
* @return the current value of the huoDanId property
*/
public String getHuoDanId() {
return huoDanId;}
/**
* Sets the value of the huoDanId property.
*
* @param aHuoDanId the new value of the huoDanId property
*/
public void setHuoDanId(String aHuoDanId) {
huoDanId = setChnString(aHuoDanId);}
public Purch()
{
primarykey1Name="purchId" ;
primarykey1Type=1;
tableName ="Purch";
viewName="Purch";
numInOnePager=10;
}
public String getWhereClause(javax.servlet.ServletRequest request)
{
String whereClause = "";
whereClause = addWhereClause(whereClause, "purchId", "=", "'",request.getParameter("purchId"));
whereClause = addWhereClause(whereClause, "purchState", "=", "",request.getParameter("purchState"));
whereClause = addWhereClause(whereClause, "contractId", "=", "'",request.getParameter("contractId"));
whereClause = addWhereClause(whereClause, "customerId", "=", "'",request.getParameter("customerId"));
whereClause = addWhereClause(whereClause, "proposer", "like", "'",request.getParameter("proposer"));
whereClause = addWhereClause(whereClause, "deptId", "=", "'",request.getParameter("deptId"));
return whereClause;
}
public int loadAttr()
{
try {
purchId= getRsString(rs,"purchId");
purchState= rs.getInt("purchState");
useFor= getRsString(rs,"useFor");
contractId= getRsString(rs,"contractId");
customerId= getRsString(rs,"customerId");
appMoney= rs.getFloat("appMoney");
deptManager= getRsString(rs,"deptManager");
gongYinId= getRsString(rs,"gongYinId");
ceoId= getRsString(rs,"ceoId");
useWay= rs.getInt("useWay");
perdictDate= rs.getTimestamp("perdictDate");
needDate= rs.getTimestamp("needDate");
proposer= getRsString(rs,"proposer");
deptId= getRsString(rs,"deptId");
appDate= rs.getTimestamp("appDate");
comment= getRsString(rs,"comment");
huoDanId= getRsString(rs,"huoDanId");
}
catch(SQLException e)
{
e.printStackTrace();
System.out.println("query failed!");
return -1;
}
return 1;
}
public int update()
{
String sql= "{?=call sp_UpdatePurch(?,?,?,?,?,?,?,?,?,?)}";
try {
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt,2,purchId);
setStmtString(updStmt,3,useFor);
setStmtString(updStmt,4,contractId);
setStmtString(updStmt,5,customerId);
updStmt.setFloat(6,appMoney);
updStmt.setInt(7,useWay);
updStmt.setTimestamp(8,perdictDate);
updStmt.setTimestamp(9,needDate);
setStmtString(updStmt,10,proposer);
setStmtString(updStmt,11,comment);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}
catch(SQLException E)
{
System.out.println(E.getMessage());
return -102;
}
}
public int insert()
{
String sql= "{?=call sp_InsertPurch(?,?,?,?,?,?,?,?,?,?)}";
try {
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt,2,purchId);
setStmtString(updStmt,3,useFor);
setStmtString(updStmt,4,contractId);
setStmtString(updStmt,5,customerId);
updStmt.setFloat(6,appMoney);
updStmt.setInt(7,useWay);
updStmt.setTimestamp(8,perdictDate);
updStmt.setTimestamp(9,needDate);
setStmtString(updStmt,10,proposer);
setStmtString(updStmt,11,comment);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}
catch(SQLException E)
{
System.out.println(E.getMessage());
return -102;
}
}
public int updateRatifier(int mode,int agree,String employeeId) {
String sql= "{?=call sp_UpdatePurchRatifier(?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
updStmt.setInt(2,mode);
setStmtString(updStmt,3,purchId);
updStmt.setInt(4,agree);
setStmtString(updStmt,5,employeeId);
setStmtString(updStmt,6,comment);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
public int announce(String employeeId) {
String sql= "{?=call sp_PurchAnnounce(?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
setStmtString(updStmt,2,purchId);
setStmtString(updStmt,3,employeeId);
setStmtString(updStmt,4,comment);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -