⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ullageproduct.java

📁 (Java+SQL)-大型企业JAVA的ERP系统
💻 JAVA
字号:
//Source file: D:\work\五洋\javaBean\src\UllageProduct.java

package src.wuyang;

import src.com.*;
import java.sql.*;
import java.io.*;



public class UllageProduct extends ShangObject
{
   
   /**
易耗品采购单编号
   */
   private String ullageId;
   
   /**
易耗品采购产品名称
   */
   private String productName;
   
   /**
易耗品采购产品类型
   */
   private String productType;
   
   /**
申请数量
   */
   private float appQuantity;
   
   /**
申请单价
   */
   private float appPrice;
   
   /**
实际数量
   */
   private float actQuantity;
   
   /**
实际单价
   */
   private float actPrice;
   
   /**
备注
   */
   private String comment;
   
   /*
实际领用数量
   */
   private float actGetQuantity;
   
   /*
序号
   */
   private int no;
   
   public UllageProduct() 
   {
   	this.primarykey1Name = "no";
   	this.primarykey1Type = 0;
   	this.tableName = "UllageProduct";
   	this.viewName = "UllageProduct";
   	this.numInOnePager = 10;   	
   }
   
  public int loadAttr() {
    try{
		ullageId = getRsString(rs,"ullageId");		
		productName = getRsString(rs,"productName");
		productType = getRsString(rs,"productType");
		appQuantity = rs.getFloat("appQuantity");
		appPrice = rs.getFloat("appPrice");
		actQuantity = rs.getFloat("actQuantity");
		actPrice = rs.getFloat("actPrice");		
		comment = getRsString(rs,"comment");		
		actGetQuantity = rs.getFloat("actGetQuantity");
		no = rs.getInt("no");
     } 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;
       String ullageId = request.getParameter("ullageId");
       
   	   int queryMode = (new Integer(request.getParameter("queryMode"))).intValue();
	   	   switch(queryMode){	   	   
	   	   	   case 1://综合查询
	   	   	   	   if(ullageId.equals("") == false && ullageId != null){
	   	   	           whereClause = addWhereClause(whereClause,"ullageId","=","'",ullageId);	   	   	   	  	
	   	   	       }
	   	   	   	  	  
	   	   	   	  	   else{
	   	   	   	  	   	    whereClause = "";
	   	   	   	  	   }	   	   	   	  	
	   	   	   	  break;	   
	   	   	   case 2:
	   	   	   	   break;	   	
	   	   }
	  return whereClause;
   	   
   }
   
   /*  新增
 
 	@loginName varchar(30) 
	,@ip varchar(20) 
	,@machineName varchar(30) 
	,@ullageId    varchar(10)	
	,@productName varchar(30) 	
	,@productType varchar(30) 
	,@appQuantity float
	,@appPrice float
	,@comment varchar(20)
 */ 	

   public int insert() {
	
     String sql= "{?=call sp_InsertUllageProduct(?,?,?,?,?,?,?,?,?)}";
     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,ullageId);
    	setStmtString(updStmt,6,productName);
    	setStmtString(updStmt,7,productType);
    	updStmt.setFloat(8,appQuantity);
    	updStmt.setFloat(9,appPrice);
    	setStmtString(updStmt,10,comment);
   	 	updStmt.executeUpdate();
   	 	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
      }catch(SQLException E){
      	System.out.println(E.getMessage());
      	return -102;
      }
}
  
 /*  修改
 
 	@loginName varchar(30) 
	,@ip varchar(20) 
	,@machineName varchar(30) 
	,@ullageId    varchar(10)	
	,@productName varchar(30) 	
	,@productType varchar(30) 
	,@appQuantity float
	,@appPrice float
	,@comment varchar(20)
 */ 	

   public int update() {
	
     String sql= "{?=call sp_UpdateUllageProduct(?,?,?,?,?,?,?,?,?,?)}";
     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,ullageId);
    	setStmtString(updStmt,6,productName);
    	setStmtString(updStmt,7,productType);
    	updStmt.setFloat(8,appQuantity);
    	updStmt.setFloat(9,appPrice);
    	setStmtString(updStmt,10,comment);
    	updStmt.setInt(11,no);
   	 	updStmt.executeUpdate();
   	 	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
      }catch(SQLException E){
      	System.out.println(E.getMessage());
      	return -102;
      }
}  
  
   /*  修改
 
 	@loginName varchar(30) 
	,@ip varchar(20) 
	,@machineName varchar(30) 
	,@ullageId    varchar(10)	
	,@productName varchar(30) 	
	,@actQuantity float
	,@actPrice float
	
 */ 	

   public int updateAct() {
	
     String sql= "{?=call sp_UpdateUllageProductAct(?,?,?,?,?,?,?,?)}";
     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,ullageId);
    	setStmtString(updStmt,6,productName);    	
    	updStmt.setFloat(7,actQuantity);
    	updStmt.setFloat(8,actPrice);    	
    	updStmt.setInt(9,no);
   	 	updStmt.executeUpdate();
   	 	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
      }catch(SQLException E){
      	System.out.println(E.getMessage());
      	return -102;
      }
}  
   
   public int updateAccountId() {
	
     String sql= "{?=call sp_UpdateUllageAccountId(?,?,?,?)}";
     try{
	CallableStatement updStmt=conn.prepareCall(sql);
	updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
	setStmtString(updStmt, 2, comment);
    	setStmtString(updStmt,3,ullageId);
    	updStmt.setFloat(4,actGetQuantity);
    	updStmt.setInt(5,no);
 	updStmt.executeUpdate();
 	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
      }catch(SQLException E){
      	System.out.println(E.getMessage());
      	return -102;
      }
}  
   
   public int delete() {
	String sql= "{?=call sp_DeleteUllageProduct(?,?,?,?,?)}";
	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,ullageId);
	    	updStmt.setInt(6,no);
   	 	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 ullageId property.
*
* @return   the current value of the ullageId property
   */
   public String getUllageId() 
   {
      return ullageId;
   }
   
   /**
* Sets the value of the ullageId property.
*
* @param aUllageId the new value of the ullageId property
   */
   public void setUllageId(String aUllageId) 
   {
      ullageId = setChnString(aUllageId);
   }
   
   /**
* Access method for the productName property.
*
* @return   the current value of the productName property
   */
   public String getProductName() 
   {
      return productName;
   }
   
   /**
* Sets the value of the productName property.
*
* @param aProductName the new value of the productName property
   */
   public void setProductName(String aProductName) 
   {
      productName = setChnString(aProductName);
   }
   
   /**
* Access method for the productType property.
*
* @return   the current value of the productType property
   */
   public String getProductType() 
   {
      return productType;
   }
   
   /**
* Sets the value of the productType property.
*
* @param aProductType the new value of the productType property
   */
   public void setProductType(String aProductType) 
   {
      productType = setChnString(aProductType);
   }
   
   /**
* Access method for the appQuantity property.
*
* @return   the current value of the appQuantity property
   */
   public float getAppQuantity() 
   {
      return appQuantity;
   }
   
   /**
* Sets the value of the appQuantity property.
*
* @param aAppQuantity the new value of the appQuantity property
   */
   public void setAppQuantity(float aAppQuantity) 
   {
      appQuantity = aAppQuantity;
   }
   
   /**
* Access method for the appPrice property.
*
* @return   the current value of the appPrice property
   */
   public float getAppPrice() 
   {
      return appPrice;
   }
   
   /**
* Sets the value of the appPrice property.
*
* @param aAppPrice the new value of the appPrice property
   */
   public void setAppPrice(float aAppPrice) 
   {
      appPrice = aAppPrice;
   }
   
   /**
* 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;
   }
   
   /**
* Access method for the actPrice property.
*
* @return   the current value of the actPrice property
   */
   public float getActPrice() 
   {
      return actPrice;
   }
   
   /**
* Sets the value of the actPrice property.
*
* @param aActPrice the new value of the actPrice property
   */
   public void setActPrice(float aActPrice) 
   {
      actPrice = aActPrice;
   }
   
   /**
* 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 actGetQuantity property.
*
* @return   the current value of the actGetQuantity property
   */
   public float getActGetQuantity() 
   {
      return actGetQuantity;
   }
   
   /**
* Sets the value of the actGetQuantity property.
*
* @param aactGetQuantity the new value of the actGetQuantity property
   */
   public void setActGetQuantity(float aActGetQuantity) 
   {
      actGetQuantity = aActGetQuantity;
   }
   
   /**
* Access method for the no property.
*
* @return   the current value of the no property
   */
   public int getNo() 
   {
      return no;
   }
   
   /**
* Sets the value of the no property.
*
* @param aNo the new value of the no property
   */
   public void setNo(int aNo) 
   {
      no = aNo;
   }
   
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -