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

📄 productlocation.java

📁 (Java+SQL)-大型企业JAVA的ERP系统
💻 JAVA
字号:
//Source file: D:*\WEB_INF\classes\src\wuyang\ProductLocation.java

package src.wuyang;

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


public class ProductLocation extends ShangObject
{ 	 
   /**
货位编号
   */
   private String locationId;
   
   /**
货位描述
   */
   private String locationDesc;
   
   /**
仓库编号
   */
   private String wearhouseId;
   
   public ProductLocation(){
   	   this.primarykey1Name = "locationId"; 
	   this.primarykey1Type = 1; 
	   this.primarykey2Name = "wearhouseId"; 
	   this.primarykey1Type = 1; 
	   this.tableName = "ProductLocation";  
	   this.viewName = "ProductLocation";
	   this.numInOnePager = 10;   	
   }

    public int loadAttr() { 
    	//try{	    
        	locationId = getRsString(rs,"locationId");  
        	locationDesc = getRsString(rs,"locationDesc");
         	wearhouseId = getRsString(rs,"wearhouseId");         
        /*}catch(SQLException e){
   			e.printStackTrace();
   			System.out.println("query failed!");
   			return -1;
   		 }
   		 */
		return 1;		
    } 	    
    
  
  	
 /*  新增
 
 	@loginName varchar(30) 
	,@ip varchar(20) 
	,@machineName varchar(30) 
	,@locationId varchar(10) 	
	,@locationDesc varchar(30) 	
	,@wearhouseId    varchar(10)	
 */ 

   public int insert() {
	
     String sql= "{?=call sp_InsertProductLocation(?,?,?,?,?,?)}";
     try{
	CallableStatement updStmt=conn.prepareCall(sql);
	updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
	setStmtString(updStmt, 2, theGlobal.loginName);
	setStmtString(updStmt, 3, theGlobal.ip);
	setStmtString(updStmt, 4, theGlobal.machineName);	    
    	setStmtString(updStmt,5,locationId);
    	setStmtString(updStmt,6,locationDesc);
    	setStmtString(updStmt,7,wearhouseId);        
   	 	updStmt.executeUpdate();
   	 	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
      }catch(SQLException E){
      	System.out.println(E.getMessage());
      	return -102;
      }
}

/*
 修改
 	@loginName varchar(30) 
	,@ip varchar(20) 
	,@machineName varchar(30) 
	,@locationId varchar(10) 	
	,@locationDesc varchar(30) 	
	,@wearhouseId    varchar(10)	
*/
   public int update() {
  	
     String sql= "{?=call sp_UpdateProductLocation(?,?,?,?,?,?)}";
     try{
	CallableStatement updStmt=conn.prepareCall(sql);
	updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
	setStmtString(updStmt, 2, theGlobal.loginName);
	setStmtString(updStmt, 3, theGlobal.ip);
	setStmtString(updStmt, 4, theGlobal.machineName);
    	setStmtString(updStmt,5,locationId);
    	setStmtString(updStmt,6,locationDesc);
    	setStmtString(updStmt,7,wearhouseId);     
    	updStmt.executeUpdate();
    	int rtcode = updStmt.getInt(1);
	updStmt.close();
	return rtcode; 
      }catch(SQLException E){
      	System.out.println(E.getMessage());
      	return -102;
      }
}


 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, "locationId", "=", "'", request.getParameter("locationId"));
			whereClause = addWhereClause(whereClause, "locationDesc", "like", "'", request.getParameter("locationDesc"));
			whereClause = addWhereClause(whereClause, "wearhouseId", "=", "'", request.getParameter("wearhouseId"));
			
			break;
			
		case 2: 
			break;

	}
    	return whereClause;
 }
    
  

   
   /**
* Access method for the locationId property.
*
* @return   the current value of the locationId property
   */
   public String getLocationId() {
      return locationId;}
   
   /**
* Sets the value of the locationId property.
*
* @param aLocationId the new value of the locationId property
   */
   public void setLocationId(String aLocationId) {
      locationId = setChnString(aLocationId);}
   
   /**
* Access method for the locationDesc property.
*
* @return   the current value of the locationDesc property
   */
   public String getLocationDesc() {
      return locationDesc;}
   
   /**
* Sets the value of the locationDesc property.
*
* @param aLocationDesc the new value of the locationDesc property
   */
   public void setLocationDesc(String aLocationDesc) {
      
      locationDesc = setChnString(aLocationDesc);
      
      }
   
   /**
* Access method for the wearhouseId property.
*
* @return   the current value of the wearhouseId property
   */
   public String getWearhouseId() {
      return wearhouseId;}
   
   /**
* Sets the value of the wearhouseId property.
*
* @param aWearhouseId the new value of the wearhouseId property
   */
   public void setWearhouseId(String aWearhouseId) {
      wearhouseId = setChnString(aWearhouseId);
   }
}

⌨️ 快捷键说明

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