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

📄 salesslip.java

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


package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class SalesSlip extends ShangObject
{
   
   /**
销售单编号
   */
   private String slipId;
   
   /**
客户编号
   */
   private String customerId;
   
   /**
申请人
   */
   private String proposer;
   
   /**
部门编号
   */
   private String deptId;
   
   /**
发货地
   */
   private String fromAddress;
   
   /**
总金额
   */
   private float totalPrice;
   
   /**
付款方式

1 现金
2 汇票
3 转帐
   */
   private int creaditMethod;
   
   /**
汇票号
   */
   private String huiPiaoId;
   
   /**
转帐号
   */
   private String zhuanZhId;
   
   /**
取汇日期
   */
   private Timestamp quHuiDate;
   
   /**
合同编号
   */
   private String contractId;
   
   /**
发货方式

1
2
   */
   private int delivWay;
   
   /**
申请日期
   */
   private Timestamp slipDate;
   
   /**
部门经理签名
   */
   private String deptManager;
   
   /**
批准人签名
   */
   private String ratifier;
   
   /**
销售单状态
   */
   private int slipState;
   
   /**
备注或批示
   */
   private String comment;
   
   /**
提货单号
   */
   private String huodanNo;
   
   
   
   /**
费用
   */
   private float fee;
   
   /**
费用标记
   */
   private int type;
   
   /**
形式
   */
   private int format;
   
  
  
public  SalesSlip()
 {
	primarykey1Name="slipId" ;
	primarykey1Type=1;
	tableName ="SalesSlip";
	viewName="SalesSlip";
	numInOnePager=10;
}
  
  
public int loadAttr() {

 try { 
	slipId= getRsString(rs,"slipId");
	customerId= getRsString(rs,"customerId");
	proposer= getRsString(rs,"proposer");
	deptId= getRsString(rs,"deptId");
	fromAddress= getRsString(rs,"fromAddress");
	totalPrice= rs.getFloat("totalPrice");
	creaditMethod= rs.getInt("creaditMethod");
	huiPiaoId= getRsString(rs,"huiPiaoId");
	zhuanZhId= getRsString(rs,"zhuanZhId");
	quHuiDate= rs.getTimestamp("quHuiDate");
	contractId= getRsString(rs,"contractId");
	delivWay= rs.getInt("delivWay");
	slipDate= rs.getTimestamp("slipDate");
	deptManager= getRsString(rs,"deptManager");
	ratifier= getRsString(rs,"ratifier");
	slipState= rs.getInt("slipState");
	comment= getRsString(rs,"comment");
	huodanNo= getRsString(rs,"huodanId");
	format= rs.getInt("format");

	} catch(SQLException e) {
		e.printStackTrace();
		print("salesSlip query failed!");
		return -1;
	}
    
    return 1;
    
  }

  
public String getWhereClause(javax.servlet.ServletRequest request) {
	
	String whereClause = "";

    	int queryMode = (new Integer(request.getParameter("queryMode"))).intValue();
	switch(queryMode)
	{
		case 1: // 综合查询
			whereClause = addWhereClause(whereClause, "slipId", "=", "'",request.getParameter("slipId"));
			whereClause = addWhereClause(whereClause, "customerId", "=", "'",request.getParameter("customerId"));
			whereClause = addWhereClause(whereClause, "proposer", "like", "'",request.getParameter("proposer"));
			whereClause = addWhereClause(whereClause, "deptId", "=", "'",request.getParameter("deptId"));
			whereClause = addWhereClause(whereClause, "format", "=", "",request.getParameter("format"));

			break;
			
		case 2: 
			
			whereClause = addWhereClause(whereClause, "slipId", "=", "'",request.getParameter("slipId"));
			break;

	}
    	return whereClause;
    }


public int insert() {

 String sql= "{?=call sp_InsertSalesSlip(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";

 try{
	CallableStatement updStmt=conn.prepareCall(sql);
	updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
	setStmtString(updStmt,2,slipId);
	setStmtString(updStmt,3,customerId);
	setStmtString(updStmt,4,proposer);
	setStmtString(updStmt,5,deptId);
	setStmtString(updStmt,6,fromAddress);
	updStmt.setFloat(7,totalPrice);
	updStmt.setInt(8,creaditMethod);
	setStmtString(updStmt,9,huiPiaoId);
	setStmtString(updStmt,10,zhuanZhId);
	updStmt.setTimestamp(11,quHuiDate);
	setStmtString(updStmt,12,contractId);
	updStmt.setInt(13,delivWay);
	setStmtString(updStmt,14,deptManager);
	setStmtString(updStmt,15,ratifier);
	setStmtString(updStmt,16,comment);
	setStmtString(updStmt,17,huodanNo);
	updStmt.setInt(18,format);
	updStmt.executeUpdate();
	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
    
    }catch(SQLException E){
	print(E.getMessage());
	return -102;
  
  }

}


public int insertFee() {

 String sql= "{?=call sp_InsertSlipFee(?,?,?)}";
 try{
	CallableStatement updStmt=conn.prepareCall(sql);
	updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
	setStmtString(updStmt,2,slipId);
	updStmt.setInt(3,type);
	updStmt.setFloat(4,fee);
	updStmt.executeUpdate();
	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
    
    }catch(SQLException E){
	print(E.getMessage());
	return -102;
  
  }

}



public int update() {
 
 String sql= "{?=call sp_UpdateSalesSlip(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";

	try{
		CallableStatement updStmt=conn.prepareCall(sql);
		updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
		setStmtString(updStmt,2,slipId);
		setStmtString(updStmt,3,customerId);
		setStmtString(updStmt,4,proposer);
		setStmtString(updStmt,5,deptId);
		setStmtString(updStmt,6,fromAddress);
		updStmt.setFloat(7,totalPrice);
		updStmt.setInt(8,creaditMethod);
		setStmtString(updStmt,9,huiPiaoId);
		setStmtString(updStmt,10,zhuanZhId);
		updStmt.setTimestamp(11,quHuiDate);
		setStmtString(updStmt,12,contractId);
		updStmt.setInt(13,delivWay);
		setStmtString(updStmt,14,deptManager);
		setStmtString(updStmt,15,ratifier);
		setStmtString(updStmt,16,comment);
		setStmtString(updStmt,17,huodanNo);
		updStmt.setTimestamp(18,slipDate);
		updStmt.setInt(18,format);
		updStmt.executeUpdate();
		int rtcode = updStmt.getInt(1);
		updStmt.close();
		return rtcode; 
	
	}catch(SQLException E){
		print(E.getMessage());
		return -102;
	  }
}

  
  
  public int updateRatifier(int mode,int agree,String loginName) {
     String sql= "{?=call sp_UpdateSlipRatifier(?,?,?,?,?)}";
     try{
	CallableStatement updStmt=conn.prepareCall(sql);
	updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
	updStmt.setInt(2,mode);
	setStmtString(updStmt,3,slipId);    	  
    	setStmtString(updStmt,4,loginName);
    	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;
      }
}
  
    
   /**
* Access method for the slipId property.
*
* @return   the current value of the slipId property
   */
   public String getSlipId() {
      return slipId;}
   
   /**
* Sets the value of the slipId property.
*
* @param aSlipId the new value of the slipId property
   */
   public void setSlipId(String aSlipId) {
      slipId = setChnString(aSlipId);}
   
   /**
* Access method for the customerId property.
*
* @return   the current value of the customerId property
   */
   public String getCustomerId() {
      return customerId;}
   
   /**
* Sets the value of the customerId property.
*
* @param aCustomerId the new value of the customerId property
   */
   public void setCustomerId(String aCustomerId) {
      customerId = setChnString(aCustomerId);}
   
   /**
* 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 = setChnString(aDeptId);}
   
   /**
* Access method for the fromAddress property.
*
* @return   the current value of the fromAddress property
   */
   public String getFromAddress() {
      return fromAddress;}
   
   /**
* Sets the value of the fromAddress property.
*
* @param aFromAddress the new value of the fromAddress property
   */
   public void setFromAddress(String aFromAddress) {
      fromAddress = setChnString(aFromAddress);}
   
   /**
* Access method for the totalPrice property.
*
* @return   the current value of the totalPrice property
   */
   public float getTotalPrice() {
      return totalPrice;}
   
   /**
* Sets the value of the totalPrice property.
*
* @param aTotalPrice the new value of the totalPrice property
   */
   public void setTotalPrice(float aTotalPrice) {
      totalPrice = aTotalPrice;}
   
   /**
* Access method for the creaditMethod property.
*
* @return   the current value of the creaditMethod property
   */
   public int getCreaditMethod() {
      return creaditMethod;}
   
   /**
* Sets the value of the creaditMethod property.
*
* @param aCreditMethod the new value of the creaditMethod property
   */
   public void setCreaditMethod(int aCreaditMethod) {
      creaditMethod = aCreaditMethod;}
   
   /**
* Access method for the huiPiaoId property.
*
* @return   the current value of the huiPiaoId property
   */
   public String getHuiPiaoId() {
      return huiPiaoId;}
   
   /**
* Sets the value of the huiPiaoId property.
*
* @param aHuiPiaoId the new value of the huiPiaoId property
   */
   public void setHuiPiaoId(String aHuiPiaoId) {
      huiPiaoId = setChnString(aHuiPiaoId);}
   
   /**
* Access method for the zhuanZhId property.
*
* @return   the current value of the zhuanZhId property
   */
   public String getZhuanZhId() {
      return zhuanZhId;}
   
   /**
* Sets the value of the zhuanZhId property.
*
* @param aZhuanZhId the new value of the zhuanZhId property
   */
   public void setZhuanZhId(String aZhuanZhId) {
      zhuanZhId = setChnString(aZhuanZhId);}
   
   /**
* Access method for the quHuiDate property.
*
* @return   the current value of the quHuiDate property
   */
   public Timestamp getQuHuiDate() {
      return quHuiDate;}
   
   /**
* Sets the value of the quHuiDate property.
*
* @param aQuHuiDate the new value of the quHuiDate property
   */
   public void setQuHuiDate(Timestamp aQuHuiDate) {
      quHuiDate = aQuHuiDate;}
   
   /**
* 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 delivWay property.
*
* @return   the current value of the delivWay property
   */
   public int getDelivWay() {
      return delivWay;}
   
   /**
* Sets the value of the delivWay property.
*
* @param aDelivWay the new value of the delivWay property
   */
   public void setDelivWay(int aDelivWay) {
      delivWay = aDelivWay;}
   
   /**
* Access method for the slipDate property.
*
* @return   the current value of the slipDate property
   */
   public Timestamp getSlipDate() {
      return slipDate;}
   
   /**
* Sets the value of the slipDate property.
*
* @param aSlipDate the new value of the slipDate property
   */
   public void setSlipDate(Timestamp aSlipDate) {
      slipDate = aSlipDate;}
   
   /**
* 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 slipState property.
*
* @return   the current value of the slipState property
   */
   public int getSlipState() {
      return slipState;}
   
   /**
* Sets the value of the slipState property.
*
* @param aSlipState the new value of the slipState property
   */
   public void setSlipState(int aSlipState) {
      slipState = aSlipState;}
   
   /**
* 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 huodanNo property.
*
* @return   the current value of the huodanNo property
   */
   public String getHuodanNo() {
      return huodanNo;}
   
   /**
* Sets the value of the huodanNo property.
*
* @param aHuodanNo the new value of the huodanNo property
   */
   public void setHuodanNo(String aHuodanNo) {
      huodanNo = setChnString(aHuodanNo);}


   
   public float getFee() {
      return fee;}

   public void setFee(float aFee) {
      fee = aFee;}
   
   public int getType() {
      return type;}

   public void setType(int aType) {
      type = aType;}
   
   public int getFormat() {
      return format;}

   public void setFormat(int aFormat) {
      format = aFormat;}
   
}

⌨️ 快捷键说明

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