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

📄 operatefee.java

📁 (Java+SQL)-大型企业JAVA的ERP系统
💻 JAVA
字号:
package src.wuyang;

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

public class OperateFee extends ShangObject 
{
   
   /**
帐号编号
   */
   private String accountId;
   
   /**
费用编号
   */
   private int feeId;
   
   /**
费用数量
   */
   private float feeMoney;
   
   /**
费用时间
   */
   private Timestamp feeDate;
   
   /**
凭证号
   */
   private String receiptId;
   
   private int operateFeeId;
   
   public OperateFee() 
   {
   	primarykey1Name = "operateFeeId"; 
	primarykey1Type = 0; 
	tableName = "OperateFee";  
	viewName = "OperateFee";
	numInOnePager = 10;	
   }
   
   public int loadAttr(){
    try{
	operateFeeId = rs.getInt("operateFeeId");
	accountId = getRsString(rs,"accountId");
	feeId = rs.getInt("feeId");
	feeMoney = rs.getFloat("feeMoney");
	feeDate = rs.getTimestamp("feeDate");
	receiptId = getRsString(rs,"receiptId");
	
     } catch(SQLException e) {
   	 e.printStackTrace();
   	 System.out.println("query failed!");
   	 return -1;
      }
      return 1;
    }  
   
/**
	@accountId	varchar(20)
	,@feeName	varchar(30)
	,@feeMoney	float
	,@feeDate	datetime
	,@receiptId	varchar(20)
*/ 
 public int insert(){
  	String sql= "{?=call sp_InsertOperateFee(?,?,?,?,?)}";
	try{
	     CallableStatement updStmt=conn.prepareCall(sql);
	     updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
	     setStmtString(updStmt, 2, accountId);
	     updStmt.setInt(3, feeId);
	     updStmt.setFloat(4,feeMoney);
	     updStmt.setTimestamp(5,feeDate);
	     setStmtString(updStmt, 6, receiptId);
	     updStmt.executeUpdate();
	     int rtcode = updStmt.getInt(1);
	     updStmt.close(); 
             return rtcode;	
   	
   	}catch(SQLException e){
   	     System.out.println(e.getMessage());
   		e.printStackTrace();
   		return -1;
   		}	
     }


 public int update(){
   	String sql = "update OperateFee set accountId=?,feeId=?,feeMoney=?,feeDate=?,receiptId=? where operateFeeId="
   			+ operateFeeId;
   	try{
   		PreparedStatement updStmt = conn.prepareStatement(sql);
  	     	setStmtString(updStmt, 1, accountId);
	     	updStmt.setInt(2, feeId);
	     	updStmt.setFloat(3,feeMoney);
	     	updStmt.setTimestamp(4,feeDate);
	     	setStmtString(updStmt, 5, receiptId);
	 	print("sql== " + sql );
	 	updStmt.executeUpdate();
   		updStmt.close(); 
   		return 0;
   	}catch(SQLException e){
   		 System.out.println(e.getMessage());
   		e.printStackTrace();
   		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, "feeId", "=", "", request.getParameter("feeName"));
			whereClause = addWhereClause(whereClause, "accountId", "=", "", request.getParameter("accountId"));
			whereClause = addWhereClause(whereClause, "receiptId", "=", "'", request.getParameter("receiptId"));
			break;
			
		case 2: 
			whereClause = addWhereClause(whereClause,"operateFeeId","=","'",request.getParameter("operateFeeId"));
			break;

	}
    	return whereClause;
    }
   
   /**
* 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 feeId property.
*
* @return   the current value of the feeId property
   */
   public int getFeeId() 
   {
      return feeId;
   }
   
   /**
* Sets the value of the feeId property.
*
* @param aFeeId the new value of the feeId property
   */
   public void setFeeId(int aFeeId) 
   {
      feeId = aFeeId;
   }
   
   /**
* Access method for the feeMoney property.
*
* @return   the current value of the feeMoney property
   */
   public float getFeeMoney() 
   {
      return feeMoney;
   }
   
   /**
* Sets the value of the feeMoney property.
*
* @param aFeeMoney the new value of the feeMoney property
   */
   public void setFeeMoney(float aFeeMoney) 
   {
      feeMoney = aFeeMoney;
   }
   
   /**
* Access method for the feeDate property.
*
* @return   the current value of the feeDate property
   */
   public Timestamp getFeeDate() 
   {
      return feeDate;
   }
   
   /**
* Sets the value of the feeDate property.
*
* @param aFeeDate the new value of the feeDate property
   */
   public void setFeeDate(Timestamp aFeeDate) 
   {
      feeDate = aFeeDate;
   }
   
   /**
* 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);
   }

   public int getOperateFeeId() 
   {
      return operateFeeId;
   }
   

   public void setOperateFeeId(int aOperateFeeId) 
   {
      operateFeeId = aOperateFeeId;
   }
}

⌨️ 快捷键说明

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