importcontract.java
来自「(Java+SQL)-大型企业JAVA的ERP系统」· Java 代码 · 共 938 行 · 第 1/2 页
JAVA
938 行
*
* @param aProposer the new value of the proposer property
*/
public void setProposer(String aProposer)
{
proposer = setChnString(aProposer);
}
/**
* 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 = aDeptManager;
}
/**
* 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 ratifier property.
*
* @return the current value of the ratifier property
*/
public String getRatifier()
{
return ratifier;
}
/**
* Sets the value of the ratifier property.
*
* @param aRatifier the new value of the ratifier property
*/
public void setRatifier(String aRatifier)
{
ratifier = aRatifier;
}
/**
* Access method for the moneyFlag property.
*
* @return the current value of the moneyFlag property
*/
public int getMoneyFlag()
{
return moneyFlag;
}
/**
* Sets the value of the moneyFlag property.
*
* @param aMoneyFlag the new value of the moneyFlag property
*/
public void setMoneyFlag(int aMoneyFlag)
{
moneyFlag = aMoneyFlag;
}
/**
* Access method for the incasementId property.
*
* @return the current value of the incasementId property
*/
public String getIncasementId()
{
return setNull(incasementId);
}
/**
* Sets the value of the incasementId property.
*
* @param aIncasementId the new value of the incasementId property
*/
public void setIncasementId(String aIncasementId)
{
incasementId = setChnString(aIncasementId);
}
/**
* Access method for the listId property.
*
* @return the current value of the listId property
*/
public String getListId()
{
return setNull(listId);
}
/**
* Sets the value of the listId property.
*
* @param aListId the new value of the listId property
*/
public void setListId(String aListId)
{
listId = setChnString(aListId);
}
/**
* Access method for the liberId property.
*
* @return the current value of the liberId property
*/
public String getLiberId()
{
return setNull(liberId);
}
/**
* Sets the value of the liberId property.
*
* @param aLiberId the new value of the liberId property
*/
public void setLiberId(String aLiberId)
{
liberId = setChnString(aLiberId);
}
/**
* Access method for the liceniceId property.
*
* @return the current value of the liceniceId property
*/
public String getLiceniceId()
{
return setNull(liceniceId);
}
/**
* Sets the value of the liceniceId property.
*
* @param aLiceniceId the new value of the liceniceId property
*/
public void setLiceniceId(String aLiceniceId)
{
liceniceId = setChnString(aLiceniceId);
}
/**
* Access method for the provementId property.
*
* @return the current value of the provementId property
*/
public String getProvementId()
{
return setNull(provementId);
}
/**
* Sets the value of the provementId property.
*
* @param aProvementId the new value of the provementId property
*/
public void setProvementId(String aProvementId)
{
provementId = setChnString(aProvementId);
}
/**
* Access method for the checkDocId property.
*
* @return the current value of the checkDocId property
*/
public String getCheckDocId()
{
return setNull(checkDocId);
}
/**
* Sets the value of the checkDocId property.
*
* @param aCheckDocId the new value of the checkDocId property
*/
public void setCheckDocId(String aCheckDocId)
{
checkDocId = setChnString(aCheckDocId);
}
/**
* Access method for the customsDocId property.
*
* @return the current value of the customsDocId property
*/
public String getCustomsDocId()
{
return setNull(customsDocId);
}
/**
* Sets the value of the customsDocId property.
*
* @param aCustomsDocId the new value of the customsDocId property
*/
public void setCustomsDocId(String aCustomsDocId)
{
customsDocId = setChnString(aCustomsDocId);
}
public ImportContract()
{
primarykey1Name = "contractId";
primarykey1Type = 1;
tableName = "ImportContract";
viewName = "ImportContract";
numInOnePager = 10;
}
/*
@loginName varchar (30),
@ip varchar (20),
@machineName varchar (30),
@contractId varchar (10),
@customerId varchar (5),
@contractFlag tinyint ,
@arrivPort varchar (50),
@packStand varchar (50),
@qulitity varchar (100),
@mark varchar (20),
@insurance varchar (100),
@loadDate datetime ,
@loadPort varchar (50),
@arriveDate datetime ,
@payment varchar (50),
@other varchar (100),
@proposer varchar (5),
@moneyFlag tinyint ,
*/
public int insert()
{
String sql= "{?=call sp_InsertImportContract(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
try {
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
setStmtString(updStmt, 2, theGlobal.loginName);
setStmtString(updStmt, 3, theGlobal.ip);
setStmtString(updStmt, 4, theGlobal.machineName);
setStmtString(updStmt,5,contractId);
setStmtString(updStmt,6,customerId);
updStmt.setInt(7,contractFlag);
setStmtString(updStmt,8,arrivPort);
setStmtString(updStmt,9,packStand);
setStmtString(updStmt,10,qulitity);
setStmtString(updStmt,11,mark);
setStmtString(updStmt,12,insurance);
updStmt.setTimestamp(13,loadDate);
setStmtString(updStmt,14,loadPort);
updStmt.setTimestamp(15,arriveDate);
setStmtString(updStmt,16,payment);
setStmtString(updStmt,17,other);
setStmtString(updStmt,18,proposer);
updStmt.setInt(19,moneyFlag);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}
catch(SQLException E)
{
System.out.println(E.getMessage());
return -102;
}
}
public int confirm0(int state)
{
String sql= "UPDATE ImportContract SET contractState=" + state + ",deptManager='"
+ getDeptManager() + "',comment='" + getComment() + "' " +
"WHERE contractId='" + getContractId() + "'";
System.out.println(sql);
try {
Statement stmt=conn.createStatement();
stmt.execute(sql);
return 0;
}
catch(SQLException E)
{
System.out.println(E.getMessage());
return -102;
}
}
public int confirm1(int state)
{
String sql= "UPDATE ImportContract SET contractState=" + state + ",ratifier='"
+ getRatifier() + "',comment='" + getComment() + "' " +
"WHERE contractId='" + getContractId() + "'";
System.out.println(sql);
try {
Statement stmt=conn.createStatement();
stmt.execute(sql);
return 0;
}
catch(SQLException E)
{
System.out.println(E.getMessage());
return -102;
}
}
public int register()
{
String sql= "UPDATE ImportContract SET incasementId='"+getIncasementId()+"',listId='"
+getListId()+"',liberId='"+getLiberId()+"',liceniceId='"
+getLiceniceId()+"',provementId='"+getProvementId()+"',checkDocId='"
+getCheckDocId()+"',customsDocId='"+getCustomsDocId()+
"' WHERE contractId='" + getContractId() + "'";
System.out.println(sql);
try {
Statement stmt=conn.createStatement();
stmt.execute(sql);
return 0;
}
catch(SQLException E)
{
System.out.println(E.getMessage());
return -102;
}
}
public int update()
{
String sql= "{?=call sp_UpdateImportContract(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
try {
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
setStmtString(updStmt, 2, theGlobal.loginName);
setStmtString(updStmt, 3, theGlobal.ip);
setStmtString(updStmt, 4, theGlobal.machineName);
setStmtString(updStmt,5,contractId);
setStmtString(updStmt,6,customerId);
updStmt.setInt(7,contractFlag);
setStmtString(updStmt,8,arrivPort);
setStmtString(updStmt,9,packStand);
setStmtString(updStmt,10,qulitity);
setStmtString(updStmt,11,mark);
setStmtString(updStmt,12,insurance);
updStmt.setTimestamp(13,loadDate);
setStmtString(updStmt,14,loadPort);
updStmt.setTimestamp(15,arriveDate);
setStmtString(updStmt,16,payment);
setStmtString(updStmt,17,other);
setStmtString(updStmt,18,proposer);
updStmt.setInt(19,moneyFlag);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}
catch(SQLException E)
{
System.out.println(E.getMessage());
return -102;
}
}
public int loadAttr()
{
try {
contractId = getRsString(rs,"contractId");
customerId = getRsString(rs, "customerId");
contractFlag = rs.getInt("contractFlag");
contractState = rs.getInt("contractState");
contractDate = rs.getTimestamp("contractDate");
arrivPort = getRsString(rs,"arrivPort");
packStand = getRsString(rs,"packStand");
qulitity = getRsString(rs,"qulitity");
mark = getRsString(rs,"mark");
insurance = getRsString(rs,"insurance");
loadDate = rs.getTimestamp("loadDate");
loadPort = getRsString(rs, "loadPort");
arriveDate = rs.getTimestamp("arriveDate");
payment = getRsString(rs, "payment");
other = getRsString(rs, "other");
proposer = getRsString(rs, "proposer");
deptManager = getRsString(rs,"deptManager");
comment = getRsString(rs,"comment");
ratifier = getRsString(rs,"ratifier");
moneyFlag = rs.getInt("moneyFlag");
incasementId = getRsString(rs,"incasementId");
listId = getRsString(rs,"listId");
liberId = getRsString(rs,"liberId");
liceniceId = getRsString(rs,"liceniceId");
provementId = getRsString(rs,"provementId");
checkDocId = getRsString(rs,"checkDocId");
customsDocId = getRsString(rs,"customsDocId");
}
catch(SQLException e)
{
e.printStackTrace();
System.out.println("query failed!");
return -1;
}
return 1;
}
public String getWhereClause(javax.servlet.ServletRequest request)
{
String whereClause = "";
String str;
int queryMode = (new Integer(request.getParameter("queryMode"))).intValue();
switch(queryMode)
{
case 1: // 综合查询
whereClause = addWhereClause(whereClause, "contractId", "=", "'", request.getParameter("contractId"));
whereClause = addWhereClause(whereClause, "customerId", "=", "'", request.getParameter("customerId"));
whereClause = addWhereClause(whereClause, "contractFlag", "=", "'", request.getParameter("contractFlag"));
whereClause = addWhereClause(whereClause, "arrivPort", "=", "'", request.getParameter("arrivPort"));
whereClause = addWhereClause(whereClause, "loadPort", "=", "'", request.getParameter("loadPort"));
whereClause = addWhereClause(whereClause, "proposer", "=", "'", request.getParameter("proposer"));
break;
case 2:
break;
}
return whereClause;
}
public String setNull(String stringValue)
{
if ((stringValue != null) == false)
{
stringValue = "";
}
return stringValue;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?