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

📄 creditdoc.java

📁 (Java+SQL)-大型企业JAVA的ERP系统
💻 JAVA
字号:
//Source file: D:\tomcat\webapps\wuyang\WEB-INF\classes\src\wuyang\src\CreditDoc.java

package src.wuyang;

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

public class CreditDoc extends ShangObject
{
   
   /**
进出口合同号
   */
   private String contractId;
   
   /**
信用证编号
   */
   private String protocolId;
   
   /**
开户银行
   */
   private String bank;
   
   /**
信用银行
   */
   private String creditBank;
   
   /**
开户金额
   */
   private float bankMoney;
   
   /**
保证金额
   */
   private float creditMoney;
   
   /**
远期/近期
0 远
1 近
   */
   private int dateType;
   
   /**
用途
   */
   private String useway;
   
   /**
进口批文号
   */
   private String documentId;
   
   public CreditDoc() 
   {
	primarykey1Name = "protocolId"; 
	primarykey1Type = 1; 
	tableName = "CreditDoc";  
	viewName = "CreditDoc";
	numInOnePager = 10;
   }
   
   /**
* Access method for the contractId property.
*
* @return   the current value of the contractId property
   */
   public String getContractId() 
   {
      return contractId;
   }
   
   /**
* Sets the value of the contractId property.
*
* @param aContractId the new value of the contractId property
   */
   public void setContractId(String aContractId) 
   {
      contractId = setChnString(aContractId);
   }
   
   /**
* Access method for the protocolId property.
*
* @return   the current value of the protocolId property
   */
   public String getProtocolId() 
   {
      return protocolId;
   }
   
   /**
* Sets the value of the protocolId property.
*
* @param aProtocolId the new value of the protocolId property
   */
   public void setProtocolId(String aProtocolId) 
   {
      protocolId = setChnString(aProtocolId);
   }
   
   /**
* Access method for the bank property.
*
* @return   the current value of the bank property
   */
   public String getBank() 
   {
      return bank;
   }
   
   /**
* Sets the value of the bank property.
*
* @param aBank the new value of the bank property
   */
   public void setBank(String aBank) 
   {
      bank = setChnString(aBank);
   }
   
   /**
* Access method for the creditBank property.
*
* @return   the current value of the creditBank property
   */
   public String getCreditBank() 
   {
      return creditBank;
   }
   
   /**
* Sets the value of the creditBank property.
*
* @param aCreditBank the new value of the creditBank property
   */
   public void setCreditBank(String aCreditBank) 
   {
      creditBank = setChnString(aCreditBank);
   }
   
   /**
* Access method for the bankMoney property.
*
* @return   the current value of the bankMoney property
   */
   public float getBankMoney() 
   {
      return bankMoney;
   }
   
   /**
* Sets the value of the bankMoney property.
*
* @param aBankMoney the new value of the bankMoney property
   */
   public void setBankMoney(float aBankMoney) 
   {
      bankMoney = aBankMoney;
   }
   
   /**
* Access method for the creditMoney property.
*
* @return   the current value of the creditMoney property
   */
   public float getCreditMoney() 
   {
      return creditMoney;
   }
   
   /**
* Sets the value of the creditMoney property.
*
* @param aCreditMoney the new value of the creditMoney property
   */
   public void setCreditMoney(float aCreditMoney) 
   {
      creditMoney = aCreditMoney;
   }
   
   /**
* Access method for the dateType property.
*
* @return   the current value of the dateType property
   */
   public int getDateType() 
   {
      return dateType;
   }
   
   /**
* Sets the value of the dateType property.
*
* @param aDateType the new value of the dateType property
   */
   public void setDateType(int aDateType) 
   {
      dateType = aDateType;
   }
   
   /**
* Access method for the useway property.
*
* @return   the current value of the useway property
   */
   public String getUseway() 
   {
      return useway;
   }
   
   /**
* Sets the value of the useway property.
*
* @param aUseway the new value of the useway property
   */
   public void setUseway(String aUseway) 
   {
      useway = setChnString(aUseway);
   }
   
   /**
* Access method for the documentId property.
*
* @return   the current value of the documentId property
   */
   public String getDocumentId() 
   {
      return documentId;
   }
   
   /**
* Sets the value of the documentId property.
*
* @param aDocumentId the new value of the documentId property
   */
   public void setDocumentId(String aDocumentId) 
   {
      documentId = setChnString(aDocumentId);
   }

	public int loadAttr() 
		{
		try 	{
			contractId = getRsString(rs,"contractId");
			protocolId = getRsString(rs, "protocolId");
			bank = getRsString(rs,"bank");
			creditBank = getRsString(rs,"creditBank");
			bankMoney = rs.getFloat("bankMoney");
			creditMoney = rs.getFloat("creditMoney");
			dateType = rs.getInt("dateType");
			useway = getRsString(rs,"useway");
			documentId = getRsString(rs,"documentId");
			} 
		catch(SQLException e) 
			{
			e.printStackTrace();
			System.out.println("query failed!");
			return -1;
			}
		return 1;
		}

	public int insert()
		{
		String sql= "INSERT INTO CreditDoc " +
				"(contractId,protocolId,bank,creditBank,bankMoney,creditMoney," +
				"dateType,useway,documentId) " +
			    "VALUES ('"+getContractId()+"','"+getProtocolId()+"','"+getBank()+
			        "','"+getCreditBank()+"',"+getBankMoney()+","+getCreditMoney()+
			        ","+getDateType()+",'"+getUseway()+"','"+getDocumentId()+"')";
		System.out.println(sql);
		try	{
			Statement stmt=conn.createStatement();
			stmt.execute(sql);
			return 0;
			}
		catch(SQLException E)
			{
		      	System.out.println(E.getMessage());
		      	return -104;
      			}
		}

	public int update()
		{
		String sql= "UPDATE CreditDoc SET contractId='"+getContractId()+"',bank='"
				+getBank()+"',creditBank='"+getCreditBank()+"',bankMoney="
				+getBankMoney()+",creditMoney="+getCreditMoney()+",dateType="
				+getDateType()+",useway='"+getUseway()+"',documentId='"
				+getDocumentId()+"' "+
			    "WHERE protocolId='" + getProtocolId() + "'";
		System.out.println(sql);
		try	{
			Statement stmt=conn.createStatement();
			stmt.execute(sql);
			return 0;
			}
		catch(SQLException E)
			{
		      	System.out.println(E.getMessage());
		      	return -103;
      			}
		}

	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, "contractId", "=", "'", request.getParameter("contractId"));
				whereClause = addWhereClause(whereClause, "protocolId", "=", "'", request.getParameter("protocolId"));
				break;
			case 2: 
				break;
			}
		return whereClause;
		}

}

⌨️ 快捷键说明

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