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

📄 allocat.java

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

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


public class Allocat extends ShangObject
{
   
   /**
调拨单编号
   */
   private String allocatId;
   
   /**
办事处名
   */
   private String subCompanyId;
   
   /**
申请人签名
   */
   private String proposer;
   
   /**
部门经理签名
   */
   private String subManager;
   
   /**
批准人签名
   */
   private String ratifier;
   
   /**
发货地
   */
   private String fromAddress;
   
   /**
送达地点
   */
   private String arrivAddress;
   
   /**
总金额
   */
   private float totalPrice;
   
   /**
备注或批示
   */
   private String comment;
   
   /**
调拨单状态:
    */
   private int allocatState;
   
   /**
申请时间
   */
   private Timestamp allocatDate;
   
   /**
提货单号
   */
   private String huodanNo;
   
   /**
仓储费
   */
   private float storeFee;
   
   /**
力费
   */
   private float carryFee;
   
   /**
运费
   */
   private float deliveFee;
   
   
   /**
费用
   */
   private float fee;
   
   /**
费用标记
   */
   private int type;
   
   /**
形式
0:计划调拨
1:非计划调拨
   */
   private int format;
   
   /**
调出部门
0:总公司
   */
   private String fromDept;
   
   /**
* Access method for the allocatId property.
*
* @return   the current value of the allocatId property
   */
   public String getAllocatId() {
      return allocatId;}
   
   /**
* Sets the value of the allocatId property.
*
* @param aAllocatId the new value of the allocatId property
   */
   public void setAllocatId(String aAllocatId) {
      allocatId = setChnString(aAllocatId);}
   
   /**
* Access method for the subCompanyId property.
*
* @return   the current value of the subCompanyId property
   */
   public String getSubCompanyId() {
      return subCompanyId;}
   
   /**
* Sets the value of the subCompanyId property.
*
* @param aSubCompanyId the new value of the subCompanyId property
   */
   public void setSubCompanyId(String aSubCompanyId) {
      subCompanyId = setChnString(aSubCompanyId);}
   
   /**
* 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 subManager property.
*
* @return   the current value of the subManager property
   */
   public String getSubManager() {
      return subManager;}
   
   /**
* Sets the value of the subManager property.
*
* @param aSubManager the new value of the subManager property
   */
   public void setSubManager(String aSubManager) {
      subManager = setChnString(aSubManager);}
   
   /**
* 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 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 arrivAddress property.
*
* @return   the current value of the arrivAddress property
   */
   public String getArrivAddress() {
      return arrivAddress;}
   
   /**
* Sets the value of the arrivAddress property.
*
* @param aArrivAddress the new value of the arrivAddress property
   */
   public void setArrivAddress(String aArrivAddress) {
      arrivAddress = setChnString(aArrivAddress);}
   
   /**
* 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 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 allocatState property.
*
* @return   the current value of the allocatState property
   */
   public int getAllocatState() {
      return allocatState;}
   
   /**
* Sets the value of the allocatState property.
*
* @param aAllocatState the new value of the allocatState property
   */
   public void setAllocatState(int aAllocatState) {
      allocatState = aAllocatState;}
   
   /**
* Access method for the allocatDate property.
*
* @return   the current value of the allocatDate property
   */
   public Timestamp getAllocatDate() {
      return allocatDate;}
   
   /**
* Sets the value of the allocatDate property.
*
* @param aAllocatDate the new value of the allocatDate property
   */
   public void setAllocatDate(Timestamp aAllocatDate) {
      allocatDate = aAllocatDate;}

   /**
* Access method for the storeFee property.
*
* @return   the current value of the storeFee property
   */
   public float getStoreFee() {
      return storeFee;}
   
   /**
* Sets the value of the storeFee property.
*
* @param aStoreFee the new value of the storeFee property
   */
   public void setStoreFee(float aStoreFee) {
      storeFee = aStoreFee;}
   
   /**
* Access method for the carryFee property.
*
* @return   the current value of the carryFee property
   */
   public float getCarryFee() {
      return carryFee;}
   
   /**
* Sets the value of the carryFee property.
*
* @param aCarryFee the new value of the carryFee property
   */
   public void setCarryFee(float aCarryFee) {
      carryFee = aCarryFee;}
   
   /**
* Access method for the deliveFee property.
*
* @return   the current value of the deliveFee property
   */
   public float getDeliveFee() {
      return deliveFee;}
   
   /**
* Sets the value of the deliveFee property.
*
* @param aDeliveFee the new value of the deliveFee property
   */
   public void setDeliveFee(float aDeliveFee) {
      deliveFee = aDeliveFee;}
   
   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 void setFormat(int aFormat) {
      format = aFormat;}
   
   public int getFormat() {
      return format;}
   
   public void setFromDept(String aFromDept) {
      fromDept = aFromDept;}
   
   public String getFromDept() {
      return fromDept;}
   
	public  Allocat()
		{
		primarykey1Name="allocatId" ;
		primarykey1Type=1;
		tableName ="Allocat";
		viewName="Allocat";
		numInOnePager=10;
		}

	public String getWhereClause(javax.servlet.ServletRequest request) 
		{
		String whereClause = "";
		String beginDaten;
		String beginDatey;
		String beginDater;	
		String beginDate = "";	
		String endDaten;
		String endDatey;
		String endDater;	
		String endDate = "";	
	
		if((request.getParameter("beginDaten")!=null)&&(request.getParameter("beginDatey")!=null)&&(request.getParameter("beginDater")!=null)&&(!request.getParameter("beginDaten").equals(""))&&(!request.getParameter("beginDatey").equals(""))&&(!request.getParameter("beginDater").equals(""))){
			beginDaten = request.getParameter("beginDaten");
			beginDatey = request.getParameter("beginDatey");
			beginDater = request.getParameter("beginDater");
			beginDate=beginDaten+"-"+beginDatey+"-"+beginDater;
		}
		
		if((request.getParameter("endDaten")!=null)&&(request.getParameter("endDatey")!=null)&&(request.getParameter("endDater")!=null)&&(!request.getParameter("endDaten").equals(""))&&(!request.getParameter("endDatey").equals(""))&&(!request.getParameter("endDater").equals(""))){
			endDaten = request.getParameter("endDaten");
			endDatey = request.getParameter("endDatey");
			endDater = request.getParameter("endDater");
			endDate=endDaten+"-"+endDatey+"-"+endDater;
		}
		whereClause = addWhereClause(whereClause, "allocatId", "=", "'",request.getParameter("allocatId"));
		whereClause = addWhereClause(whereClause, "subCompanyId", "=", "'",request.getParameter("subCompanyId"));
		whereClause = addWhereClause(whereClause, "proposer", "like", "'",request.getParameter("proposer"));
		whereClause = addWhereClause(whereClause, "allocatState", "=", "",request.getParameter("allocatState"));
		whereClause = addWhereClause(whereClause, "format", "=", "",request.getParameter("format"));
		whereClause = addWhereClause(whereClause, "allocatDate", ">=", "'", beginDate);
		whereClause = addWhereClause(whereClause, "allocatDate", "<=", "'", endDate);
	
		return whereClause;
		}

	public int loadAttr() 
		{
		 try 	{ 
			allocatId= getRsString(rs,"allocatId");
			subCompanyId= getRsString(rs,"subCompanyId");
			proposer= getRsString(rs,"proposer");
			subManager= getRsString(rs,"subManager");
			ratifier= getRsString(rs,"ratifier");
			fromAddress= getRsString(rs,"fromAddress");
			arrivAddress= getRsString(rs,"arrivAddress");
			totalPrice= rs.getFloat("totalPrice");
			comment= getRsString(rs,"comment");
			allocatState= rs.getInt("allocatState");
			allocatDate= rs.getTimestamp("allocatDate");
			storeFee= rs.getFloat("storeFee");
			carryFee= rs.getFloat("carryFee");
			deliveFee= rs.getFloat("deliveFee");
			format= rs.getInt("format");
			fromDept= getRsString(rs,"fromDept");
			} 
		catch(SQLException e) 
			{
			e.printStackTrace();
			System.out.println("query failed!");
			return -1;
			}
    		return 1;
    		}

	public int update() 
		{
 		String sql= "{?=call sp_UpdateAllocat(?,?,?,?,?,?,?,?,?)}";
		try	{
			CallableStatement updStmt=conn.prepareCall(sql);
			updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
			setStmtString(updStmt,2,allocatId);
			setStmtString(updStmt,3,subCompanyId);
			setStmtString(updStmt,4,proposer);
			setStmtString(updStmt,5,subManager);
			setStmtString(updStmt,6,fromAddress);
			setStmtString(updStmt,7,arrivAddress);
			setStmtString(updStmt,8,comment);
			updStmt.setInt(9,format);
			setStmtString(updStmt,10,fromDept);
			updStmt.executeUpdate();
			int rtcode = updStmt.getInt(1);
			updStmt.close();
			return rtcode; 
			}
		catch(SQLException E)
			{
			System.out.println(E.getMessage());
			return -102;
  			}
		}

	public int insert() 
		{
 		String sql= "{?=call sp_InsertAllocat(?,?,?,?,?,?,?,?,?)}";
		try	{
			CallableStatement updStmt=conn.prepareCall(sql);
			updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
			setStmtString(updStmt,2,allocatId);
			setStmtString(updStmt,3,subCompanyId);
			setStmtString(updStmt,4,proposer);
			setStmtString(updStmt,5,subManager);
			setStmtString(updStmt,6,fromAddress);
			setStmtString(updStmt,7,arrivAddress);
			setStmtString(updStmt,8,comment);
			updStmt.setInt(9,format);
			setStmtString(updStmt,10,fromDept);
			updStmt.executeUpdate();
			int rtcode = updStmt.getInt(1);
			updStmt.close();
			return rtcode; 
			}
		catch(SQLException E)
			{
			System.out.println(E.getMessage());
			return -102;
			}
		}

	public int insertFee() {
		String sql= "{?=call sp_InsertAllocatFee(?,?,?)}";
		try{
		CallableStatement updStmt=conn.prepareCall(sql);
		updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
		setStmtString(updStmt,2,allocatId);
		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 updateRatifier(int mode,int agree,String employeeId) 
  		{
     		String sql= "{?=call sp_UpdateAllocatRatifier(?,?,?,?,?)}";
     		try	{
			CallableStatement updStmt=conn.prepareCall(sql);
			updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
			updStmt.setInt(2,mode);
			setStmtString(updStmt,3,allocatId);    	  
		    	updStmt.setInt(4,agree);   
		    	setStmtString(updStmt,5,employeeId);
		    	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;
      			}
		}

}

⌨️ 快捷键说明

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