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

📄 salescollectreport.java

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

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

public class SalesCollectReport extends ShangObject 
{
   /**
部门名称
   */
   private String deptName;

   /**
产品名称
   */
   private String productName;

   /**
数量
   */
   private double quantity;
      
   /**
金额
   */
   private double totalPrice;

   /**
开始日期
   */
   public Timestamp beginDate;

   /**
结束日期
   */
   public Timestamp endDate;   

   /**
记录数
   */
   private int countNum;   
   
   public SalesCollectReport(){
	   this.numInOnePager = 10;  
   }
   
   public int loadAttr(){
       try{
	   	   deptName = getRsString(rs,"deptName");       
	   	   productName = getRsString(rs,"productName");  
	   	   quantity = rs.getDouble("quantity");	   	   
	   	   totalPrice = rs.getDouble("totalPrice");
	   	   beginDate = rs.getTimestamp("beginDate");
	   	   endDate = rs.getTimestamp("endDate");	   	   	   	   
	   	   countNum = rs.getInt("countNum");
	           return 1;
	   }catch(SQLException e){
			e.printStackTrace();
			System.out.println("query failed!");
			return -1;   
	    }		 
   }
   
  /* 
        deptName varchar(30)      -- 部门名称
	,productName  varchar(30)  -- 产品名称
        ,quantity float            -- 数量	
        ,totalPrice float          -- 金额
        ,beginDate datetime        -- 开始日期
        ,endDate datetime          -- 结束日期        
        ,countNum int
 */ 	
       


	/**
    到货记录表   
   */
   public int report(String aClassId,String aDeptId,java.sql.Timestamp aBeginDate,java.sql.Timestamp aEndDate) {
     int i;
     String sql= "{?=call sp_SalesCollectReport(?,?,?,?,?,?,?)}";
 
     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, aClassId);
	setStmtString(updStmt, 6, aDeptId);	
        updStmt.setTimestamp(7,aBeginDate);
        updStmt.setTimestamp(8,aEndDate);
        rs = updStmt.executeQuery();        
        int rtcode = 0; 
	return rtcode;  
      }catch(SQLException E){
      	System.out.println(E.getMessage());
      	return -102;
      }
   }
   
   public String getDeptName() 
   {
      return deptName;
   }
   
   public String getProductName() 
   {
      return productName;
   }

   public double getQuantity() 
   {
      return quantity;
   }

   public double getTotalPrice() 
   {
      return totalPrice;
   }
   
   public Timestamp getBeginDate() 
   {
      return beginDate;
   }

   public Timestamp getEndDate() 
   {
      return endDate;
   }

   public int getCountNum() 
   {
      return countNum;
   }

}

⌨️ 快捷键说明

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