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

📄 ullage.java

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

package src.wuyang;

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


public class Ullage extends ShangObject
{
   
   /**
易耗品采购单编号
   */
   private String ullageId;
   
   /**
易耗品采购申请时间
   */
   private Timestamp ullageDate;
   
   /**
易耗品采购申请人
   */
   private String proposer;
   
   /**
部门编号
   */
   private String deptId;
   
   /**
易耗品采购申请金额
   */
   private float appMoney;
   
   /**
实用金额
   */
   private float actMoney;
   
   /**
部门经理签名
   */
   private String deptManager;
   
   /**
批准人签名
   */
   private String ratifier;
   
   /**
易耗品采购单状态
   */
   private int ullageState;
   
   /**
备注或批注
   */
   private String comment;
   
   /**
签收人
   */
   private String accountId;
   
   public Ullage() 
   {
   	this.primarykey1Name = "ullageId";
   	this.primarykey1Type = 1;   	
   	this.tableName = "Ullage";
   	this.viewName = "Ullage";
   	this.numInOnePager = 10;   	
   }
   
   public int loadAttr() {
    try{
		ullageId = getRsString(rs,"ullageId");
		ullageDate = rs.getTimestamp("ullageDate");
		proposer = getRsString(rs,"proposer");
		deptId = getRsString(rs,"deptId");
		appMoney = rs.getFloat("appMoney");
		actMoney = rs.getFloat("actMoney");
		deptManager = getRsString(rs,"deptManager");
		ratifier = getRsString(rs,"ratifier");
		ullageState = rs.getInt("ullageState");
		comment = getRsString(rs,"comment");
		accountId = getRsString(rs,"accountId");
     } catch(SQLException e) {
   	 e.printStackTrace();
   	 System.out.println("query failed!");
   	 return -1;
      }
      return 1;
    }  
   
   
   /*  新增
 
 	@loginName varchar(30) 
	,@ip varchar(20) 
	,@machineName varchar(30) 
	,@ullageId varchar(10) 	
	,@proposer varchar(10)
	,@deptId varchar(10)	
 */ 

   public int insert() {
	
     String sql= "{?=call sp_InsertUllage(?,?,?)}";
     try{
	CallableStatement updStmt=conn.prepareCall(sql);
	updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
    	setStmtString(updStmt,2,ullageId);
    	setStmtString(updStmt,3,proposer);
    	setStmtString(updStmt,4,deptId);       
   	updStmt.executeUpdate();
   	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
      }catch(SQLException E){
      	print(E.getMessage());
      	return -102;
      }
}

/*  修改
 
 	@loginName varchar(30) 
	,@ip varchar(20) 
	,@machineName varchar(30) 
	,@ullageId varchar(10) 		
	,@comment varchar(10)
 */ 

   public int update() {
	
     String sql= "{?=call sp_UpdateUllage(?,?,?,?,?,?)}";
     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,comment);    	   	    
   	updStmt.setFloat(7,appMoney);
   	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) 	
	,@ratifier varchar(10)	
	,@ullageState int
	,@comment varchar(30)
 */ 

   public int updateRatifier(String empId,int agree,int type) {
	
     String sql= "{?=call sp_UpdateUllageRatifier(?,?,?,?,?)}";
     try{
	CallableStatement updStmt=conn.prepareCall(sql);
	updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
	updStmt.setInt(2,type);
	setStmtString(updStmt,3,ullageId);    	  
	setStmtString(updStmt,4,empId);  	     
    	updStmt.setInt(5,agree);   
    	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;
      }
}
   
  /*  修改4
 
 	@loginName varchar(30) 
	,@ip varchar(20) 
	,@machineName varchar(30) 
	,@ullageId varchar(10) 	
	
 */ 

   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, theGlobal.loginName);
	setStmtString(updStmt, 3, theGlobal.ip);
	setStmtString(updStmt, 4, theGlobal.machineName);	    
    	setStmtString(updStmt,5,ullageId);      	    		   	    
   	 	updStmt.executeUpdate();
   	 	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
      }catch(SQLException E){
      	System.out.println(E.getMessage());
      	return -102;
      }
} 

/*  修改5
 
 	@loginName varchar(30) 
	,@ip varchar(20) 
	,@machineName varchar(30) 
	,@ullageId varchar(10) 		
	,@actMoney float	
 */ 

   public int updateActMoney() {
	
     String sql= "{?=call sp_UpdateUllageActMoney(?,?,?,?,?)}";
     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.setFloat(6,actMoney);     		   	    
   	 	updStmt.executeUpdate();
   	 	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
      }catch(SQLException E){
      	System.out.println(E.getMessage());
      	return -102;
      }
}

 /*  修改6
 
 	@loginName varchar(30) 
	,@ip varchar(20) 
	,@machineName varchar(30) 
	,@ullageId varchar(10) 		
	,@appMoney float	
 */ 

   public int updateAppMoney() {
	
     String sql= "{?=call sp_UpdateUllageAppMoney(?,?,?,?,?)}";
     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.setFloat(6,appMoney);     		   	    
   	 	updStmt.executeUpdate();
   	 	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
      }catch(SQLException E){
      	System.out.println(E.getMessage());
      	return -102;
      }
}

public String getWhereClause(javax.servlet.ServletRequest request) {
	String whereClause = "";
	String deptId,ullageId;
	deptId = request.getParameter("deptId");
	ullageId = request.getParameter("ullageId");	
	if (((ullageId!=null)&&(!ullageId.equals("")))) 
		{
		whereClause=" ullageId='"+ullageId+"'";
		if (((deptId!=null)&&(!deptId.equals("")))) 
			{
			whereClause=whereClause+" and deptId='"+deptId+"'";
			}
		}
	else if (((deptId!=null)&&(!deptId.equals("")))) 
		{
			whereClause="deptId='"+deptId+"'";
		}
	return whereClause;

}
 
   /**
* 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 aUlltageId the new value of the ullageId property
   */
   public void setUllageId(String aUllageId) 
   {
      ullageId = setChnString(aUllageId);
   }
   
   /**
* Access method for the ullageDate property.
*
* @return   the current value of the ullageDate property
   */
   public Timestamp getUllageDate() 
   {
      return ullageDate;
   }
   
   /**
* Sets the value of the ullageDate property.
*
* @param aUllageDate the new value of the ullageDate property
   */
   public void setUllageDate(Timestamp aUllageDate) 
   {
      ullageDate = aUllageDate;
   }
   
   /**
* 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 = aDeptId;
   }
   
   /**
* 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 actMoney property.
*
* @return   the current value of the actMoney property
   */
   public float getActMoney() 
   {
      return actMoney;
   }
   
   /**
* Sets the value of the actMoney property.
*
* @param aActMoney the new value of the actMoney property
   */
   public void setActMoney(float aActMoney) 
   {
      actMoney = aActMoney;
   }
   
   /**
* 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 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 = setChnString(aRatifier);
   }
   
   /**
* Access method for the ulltageState property.
*
* @return   the current value of the ulltageState property
   */
   public int getUllageState() 
   {
      return ullageState;
   }
   
   /**
* Sets the value of the ulltageState property.
*
* @param aUlltageState the new value of the ulltageState property
   */
   public void setUllageState(int aUllageState) 
   {
      ullageState = aUllageState;
   }
   
   /**
* 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 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 = aAccountId;
   }
}

⌨️ 快捷键说明

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