📄 locationstate.java
字号:
//Source file: D:\work\五洋\javaBean\src\LocationState.java
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class LocationState extends ShangObject
{
/**
货位编号
*/
private String locationId;
/**
产品编号
*/
private String productId;
/**
数量
*/
private float quantity;
/**
件数
*/
private float counting;
/**
盘存日期
*/
private Timestamp balanceDate;
/**
盘存数量
*/
private float newQuantity;
/**
盘存件数
*/
private float newCounting;
/**
盘存人签名
*/
private String accountId;
/**
仓库编码
*/
private String wearhouseId;
/**
采购日期
*/
private Timestamp purchDate;
public LocationState()
{
primarykey1Name = "locationId";
primarykey1Type = 1;
primarykey2Name = "productId";
primarykey2Type = 1;
tableName = "locationState";
viewName = "locationState";
numInOnePager = 10;
}
public int loadAttr(){
try{
locationId = getRsString(rs,"locationId");
productId = getRsString(rs,"productId");
quantity = rs.getFloat("quantity");
counting = rs.getInt("counting");
balanceDate = rs.getTimestamp("balanceDate");
newQuantity = rs.getFloat("newQuantity");
accountId = getRsString(rs,"accountId");
wearhouseId = getRsString(rs,"wearhouseId");
purchDate = rs.getTimestamp("purchDate");
return 1;
}catch(SQLException e){
e.printStackTrace();
System.out.println("query failed");
return -1;
}
}
public String getWhereClause(javax.servlet.ServletRequest request){
String whereClause = "";
String str;
String wearhouseId = request.getParameter("wearhouseId");
String locationId = request.getParameter("locationId");
int queryMode = (new Integer(request.getParameter("queryMode"))).intValue();
switch(queryMode){
case 1://综合查询
whereClause = addWhereClause(whereClause,"wearhouseId","=","'",wearhouseId);
whereClause = addWhereClause(whereClause,"locationId","=","'",locationId);
break;
case 2:
break;
}
return whereClause;
}
/* 修改1
@loginName varchar(30)
,@ip varchar(20)
,@machineName varchar(30)
,@locationId
,@productId
,@newQuantity float
,@newCounting float
,@accountId
*/
public int update() {
String sql= "{?=call sp_UpdateLocationState(?,?,?,?,?,?,?,?)}";
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,locationId);
setStmtString(updStmt,6,productId);
updStmt.setFloat(7,newQuantity);
updStmt.setFloat(8,newCounting);
setStmtString(updStmt,9,accountId);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
/* 盘存 */
public int balance() {
String sql= "{?=call sp_BalanceLocation(?,?,?,?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
setStmtString(updStmt, 2, theGlobal.loginName);
setStmtString(updStmt,3,locationId);
setStmtString(updStmt,4,productId);
updStmt.setFloat(5,quantity);
updStmt.setFloat(6,counting);
updStmt.setFloat(7,newQuantity);
updStmt.setFloat(8,newCounting);
setStmtString(updStmt,9,wearhouseId);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
/* 修改2
@loginName varchar(30)
,@ip varchar(20)
,@machineName varchar(30)
,@locationId
,@productId
,@Quantity float
,@Counting float
*/
public int updateAct() {
String sql= "{?=call sp_UpdateLocationStateAct(?,?,?,?,?,?,?)}";
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,locationId);
setStmtString(updStmt,6,productId);
updStmt.setFloat(7,quantity);
updStmt.setFloat(8,counting);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
public int adjust(javax.servlet.ServletRequest request) {
String sql= "{?=call sp_AdjustInventory(?,?,?,?,?,?,?,?)}";
String locationId1 = request.getParameter("locationId1");
String wearhouseId1 = request.getParameter("wearhouseId1");
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
setStmtString(updStmt, 2, theGlobal.empId);
setStmtString(updStmt,3,locationId1);
setStmtString(updStmt,4,wearhouseId1);
setStmtString(updStmt,5,locationId);
setStmtString(updStmt,6,wearhouseId);
setStmtString(updStmt,7,productId);
updStmt.setFloat(8,quantity);
updStmt.setFloat(9,counting);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
E.printStackTrace();
return -102;
}
}
/**
* Access method for the locationId property.
*
* @return the current value of the locationId property
*/
public String getLocationId()
{
return locationId;
}
/**
* Sets the value of the locationId property.
*
* @param aLocationId the new value of the locationId property
*/
public void setLocationId(String aLocationId)
{
locationId = setChnString(aLocationId);
}
/**
* 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 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 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 balanceDate property.
*
* @return the current value of the balanceDate property
*/
public Timestamp getBalanceDate()
{
return balanceDate;
}
/**
* Sets the value of the balanceDate property.
*
* @param aBalanceDate the new value of the balanceDate property
*/
public void setBalanceDate(Timestamp aBalanceDate)
{
balanceDate = aBalanceDate;
}
/**
* Access method for the newQuantity property.
*
* @return the current value of the newQuantity property
*/
public float getNewQuantity()
{
return newQuantity;
}
/**
* Sets the value of the newQuantity property.
*
* @param aNewQuantity the new value of the newQuantity property
*/
public void setNewQuantity(float aNewQuantity)
{
newQuantity = aNewQuantity;
}
/**
* Access method for the newCounting property.
*
* @return the current value of the newCounting property
*/
public float getNewCounting()
{
return newCounting;
}
/**
* Sets the value of the newCounting property.
*
* @param aNewCounting the new value of the newCounting property
*/
public void setNewCounting(float aNewCounting)
{
newCounting = aNewCounting;
}
/**
* Access method for the accountId property.
*
* @return the current value of the accountId property
*/
public String getAccountId()
{
return accountId;
}
/**
* Sets the value of the accountId property.
*
* @param aAccountId the new value of the accountId property
*/
public void setAccountId(String aAccountId)
{
accountId = setChnString(aAccountId);
}
/**
* Access method for the wearhouseId property.
*
* @return the current value of the wearhouseId property
*/
public String getWearhouseId()
{
return wearhouseId;
}
/**
* Sets the value of the wearhouseId property.
*
* @param aLocationId the new value of the wearhouseId property
*/
public void setWearhouseId(String aWearhouseId)
{
wearhouseId = setChnString(aWearhouseId);
}
/**
* Access method for the purchDate property.
*
* @return the current value of the purchDate property
*/
public Timestamp getPurchDate()
{
return purchDate;
}
/**
* Sets the value of the purchDate property.
*
* @param aPurchDate the new value of the purchDate property
*/
public void setPurchDate(Timestamp aPurchDate)
{
purchDate = aPurchDate;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -