📄 delivinfo.java
字号:
//Source file: D:\work\五洋\javaBean\src\DelivInfo.java
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class DelivInfo extends ShangObject
{
/**
凭证编号
*/
private String receiptId;
/**
货单号
*/
private String huodanNo;
/**
状态
0 出库
1 入库
2 调拨
3 调整
*/
private int status;
/**
客户编号
*/
private String customerId;
/**
货运客户
*/
private String delivCustomer;
/**
运输工具
*/
private String delivTool;
/**
牌号
*/
private String toolNo;
/**
运输日期
*/
private Timestamp delivDate;
/**
凭证类型
1,销售单
2,采购单
3,调拨单
*/
private int receiptType;
public DelivInfo()
{
this.primarykey1Name = "huodanNo";
this.primarykey1Type = 1;
this.tableName = "DelivInfo";
this.viewName = "DelivInfo";
this.numInOnePager = 10;
}
public int loadAttr(){
try{
receiptId = getRsString(rs,"receiptId");
huodanNo = getRsString(rs,"huodanNo");
status = rs.getInt("status");
customerId = getRsString(rs,"customerId");
delivCustomer = getRsString(rs,"delivCustomer");
delivTool = getRsString(rs,"delivTool");
toolNo = getRsString(rs,"toolNo");
delivDate = rs.getTimestamp("delivDate");
receiptType = rs.getInt("receiptType");
return 1;
}catch(SQLException e){
e.printStackTrace();
System.out.println("query failed!");
return -1;
}
}
/* 新增
@loginName varchar(30)
,@ip varchar(20)
,@machineName varchar(30)
,@receiptId varchar(10)
,@huodanNo varchar(10)
,@status int
,@customerId varchar(10)
,@delivCustomer varchar(10)
,@delivTool varchar(10)
,@toolNo varchar(10)
,@delivDate Timestamp
,@receiptType int
*/
public int insert() {
String sql= "{?=call sp_InsertDelivInfo(?,?,?,?,?,?,?,?,?,?,?,?)}";
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,receiptId);
setStmtString(updStmt,6,huodanNo);
updStmt.setInt(7,status);
setStmtString(updStmt,8,customerId);
setStmtString(updStmt,9,delivCustomer);
setStmtString(updStmt,10,delivTool);
setStmtString(updStmt,11,toolNo);
updStmt.setTimestamp(12,delivDate);
updStmt.setInt(13,receiptType);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
public int update() {
String sql= "{?=call sp_UpdateDelivInfo(?,?,?,?,?,?,?,?,?,?,?,?)}";
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,receiptId);
setStmtString(updStmt,6,huodanNo);
updStmt.setInt(7,status);
setStmtString(updStmt,8,customerId);
setStmtString(updStmt,9,delivCustomer);
setStmtString(updStmt,10,delivTool);
setStmtString(updStmt,11,toolNo);
updStmt.setTimestamp(12,delivDate);
updStmt.setInt(13,receiptType);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
/**
* Access method for the receiptId property.
*
* @return the current value of the receiptId property
*/
public String getReceiptId()
{
return receiptId;
}
/**
* Sets the value of the receiptId property.
*
* @param aReceiptId the new value of the receiptId property
*/
public void setReceiptId(String aReceiptId)
{
receiptId = setChnString(aReceiptId);
}
/**
* Access method for the huodanNo property.
*
* @return the current value of the huodanNo property
*/
public String getHuodanNo()
{
return huodanNo;
}
/**
* Sets the value of the huodanNo property.
*
* @param aHuodanNo the new value of the huodanNo property
*/
public void setHuodanNo(String aHuodanNo)
{
huodanNo = setChnString(aHuodanNo);
}
/**
* Access method for the statu property.
*
* @return the current value of the statu property
*/
public int getStatus()
{
return status;
}
/**
* Sets the value of the statu property.
*
* @param aStatu the new value of the statu property
*/
public void setStatu(int aStatus)
{
status = aStatus;
}
/**
* 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 delivCustomer property.
*
* @return the current value of the delivCustomer property
*/
public String getDelivCustomer()
{
return delivCustomer;
}
/**
* Sets the value of the delivCustomer property.
*
* @param aDelivCustomer the new value of the delivCustomer property
*/
public void setDelivCustomer(String aDelivCustomer)
{
delivCustomer = setChnString(aDelivCustomer);
}
/**
* Access method for the delivTool property.
*
* @return the current value of the delivTool property
*/
public String getDelivTool()
{
return delivTool;
}
/**
* Sets the value of the delivTool property.
*
* @param aDelivTool the new value of the delivTool property
*/
public void setDelivTool(String aDelivTool)
{
delivTool = setChnString(aDelivTool);
}
/**
* Access method for the toolNo property.
*
* @return the current value of the toolNo property
*/
public String getToolNo()
{
return toolNo;
}
/**
* Sets the value of the toolNo property.
*
* @param aToolNo the new value of the toolNo property
*/
public void setToolNo(String aToolNo)
{
toolNo = setChnString(aToolNo);
}
/**
* Access method for the delivDate property.
*
* @return the current value of the delivDate property
*/
public Timestamp getDelivDate()
{
return delivDate;
}
/**
* Sets the value of the delivDate property.
*
* @param aDelivDate the new value of the delivDate property
*/
public void setDelivDate(Timestamp aDelivDate)
{
delivDate = aDelivDate;
}
/**
* Access method for the receiptType property.
*
* @return the current value of the receiptType property
*/
public int getReceiptType()
{
return receiptType;
}
/**
* Sets the value of the receiptType property.
*
* @param aReceiptType the new value of the receiptType property
*/
public void setReceiptType(int aReceiptType)
{
receiptType = aReceiptType;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -