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

📄 moneyflow.java

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

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

public class MoneyFlow extends ShangObject
{
   
   /**
发票编号
   */
   private String invoiceId;
   
   /**
收付款日
   */
   private Timestamp lmDate;
   
   /**
收款人签名
   */
   private String accountId;
   
   /**
银行凭证编号
   */
   private String pinId;
   
   /**
备注
   */
   private String comment;
   
   /**
收付金额
   */
   private float lmMoney;
   
   private int flowId;
   
   public MoneyFlow() 
   {
	primarykey1Name = "flowId"; 
	primarykey1Type = 0; 
	tableName = "MoneyFlow";  
	viewName = "MoneyFlow";
	numInOnePager = 10;	
   }
   
 
 public int loadAttr(){
    try{
	flowId = rs.getInt("flowId");
	invoiceId = getRsString(rs,"invoiceId");
	lmDate = rs.getTimestamp("lmDate");
	accountId = getRsString(rs,"accountId");
	pinId = getRsString(rs,"pinId");
	comment = getRsString(rs,"comment");
	lmMoney = rs.getFloat("lmMoney");
     } catch(SQLException e) {
   	 e.printStackTrace();
   	 System.out.println("query failed!");
   	 return -1;
      }
      return 1;
    }  


/**
	@invoiceId	varchar(20)
	,@lmDate	datetime
	,@lmMoney	float
	,@accountId	varchar(20)
	,@pinId		varchar(20)
	,@comment	varchar(100)
*/

public int insert(){
  	String sql= "{?=call sp_InsertMoneyFlow(?,?,?,?,?,?)}";
	try{
	     CallableStatement updStmt=conn.prepareCall(sql);
	     updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
	     setStmtString(updStmt, 2, invoiceId);
	     updStmt.setTimestamp(3,lmDate);
	     updStmt.setFloat(4,lmMoney);
	     setStmtString(updStmt, 5, accountId);
	     setStmtString(updStmt, 6, pinId);
	     setStmtString(updStmt, 7, comment);
	     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 = "{?=call sp_UpdateMoneyFlow(?,?,?,?,?,?)}";
   	try{
	     CallableStatement updStmt=conn.prepareCall(sql);
	     updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
	 	setStmtString(updStmt, 2, invoiceId);
	        updStmt.setTimestamp(3,lmDate);
	        updStmt.setFloat(4,lmMoney);
	        setStmtString(updStmt, 5, pinId);
	        setStmtString(updStmt, 6, comment);
	        updStmt.setInt(7,flowId);
	 	updStmt.executeUpdate();
	     int rtcode = updStmt.getInt(1);
   		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, "invoiceId", "=", "'", request.getParameter("invoiceId"));
			whereClause = addWhereClause(whereClause, "pinId", "=", "'", request.getParameter("pinId"));
			break;
			
		case 2: 
			whereClause = addWhereClause(whereClause,"flowId","=","'",request.getParameter("flowId"));
			break;

	}
    	return whereClause;
    }


   /**
* Access method for the invoiceId property.
*
* @return   the current value of the invoiceId property
   */
   public String getInvoiceId() {
      return invoiceId;}
   
   /**
* Sets the value of the invoiceId property.
*
* @param aInvoiceId the new value of the invoiceId property
   */
   public void setInvoiceId(String aInvoiceId) {
      invoiceId = setChnString(aInvoiceId);}
   
   /**
* Access method for the lmDate property.
*
* @return   the current value of the lmDate property
   */
   public Timestamp getLmDate() {
      return lmDate;}
   
   /**
* Sets the value of the lmDate property.
*
* @param aLmDate the new value of the lmDate property
   */
   public void setLmDate(Timestamp aLmDate) {
      lmDate = aLmDate;}
   
   /**
* 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 pinId property.
*
* @return   the current value of the pinId property
   */
   public String getPinId() {
      return pinId;}
   
   /**
* Sets the value of the pinId property.
*
* @param aPinId the new value of the pinId property
   */
   public void setPinId(String aPinId) {
      pinId = setChnString(aPinId);}
   
   /**
* 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 lmMoney property.
*
* @return   the current value of the lmMoney property
   */
   public float getLmMoney() {
      return lmMoney;}
   
   /**
* Sets the value of the lmMoney property.
*
* @param aLmMoney the new value of the lmMoney property
   */
   public void setLmMoney(float aLmMoney) {
      lmMoney = aLmMoney;}

	
   public int getFlowId() {
      return flowId;}
   
   public void setFlowId(int aFlowId) {
      flowId = aFlowId;}

}

⌨️ 快捷键说明

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