package com.jtonsoft.storage.operator;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import com.jtonsoft.common.DBConection;
import com.jtonsoft.hibernate.*;
import com.jtonsoft.storage.dto.ListReceive;
import com.jtonsoft.storage.dto.Receiver;
import com.jtonsoft.storage.dto.ReceiverNum;
/**@description 用于处理仓库管理的存货收发汇总,存货单据汇总,存货存量比较
* @author 张隆斌
* @Modify Date 2007-11-19
* */
public class ReceiveOperator {
//构造一个函数
/**
* @exception 用于处理业务逻辑
*/
private Session session;//定义Session
private Transaction tran;//定义事务的提交
private List list=null;
DBConection db;
Connection conn;
public ReceiveOperator(){
db=new DBConection();
conn=db.conn;
session=HibernateSessionFactory.getSession();
tran=null;
}
//关闭SESSION
public void close(){
session.close();
}
//得到收入数量,查询的单据有:盘盈单,调拨单据中仓库为调入仓库(但是调拨单不参与成本核算),入库单据(外购入库,外购退货-红字,自制收货,其他收货)
@SuppressWarnings("unchecked")
public Hashtable Query(String month1,String month2,String storage,String chdm) throws SQLException{
String aa=null;
//当存货代码确定,仓库为全部仓库时候,进行查询
String sql=null;
String sql2=null;
if(storage.equals("*")&&chdm!=""&&chdm!=null){
System.out.println("当存货代码确定,仓库为全部仓库时候,进行查询");
sql="select Sum(StorageInDetail.realNum)as number ,merchandiseID as merchandiseID from StorageInDetail,StorageInDraw where StorageInDetail.StorageInDrawID=StorageInDraw.id and DATEPART(month ,billDate) between'"+month1+"' and '"+month2+"' and merchandiseID='"+chdm+"' group by merchandiseID";
//sql2="select Sum(StorageOutDetail.realNum)as number2 ,merchandiseID as merchandiseID2 from StorageOutDetail,StorageOutDraw where StorageOutDetail.StorageOutDrawID=StorageOutDraw.id and DATEPART(month ,billDate) between'"+month1+"' and '"+month2+"' and merchandiseID='"+chdm+"' group by merchandiseID";
aa="1";
}
System.out.println("****************************/");
//当存货代码确定,仓库确定的时候的查询
if(!storage.equals("*")&&chdm!=""&&chdm!=null){
System.out.println("当存货代码确定,仓库确定的时候的查询");
sql="select Sum(StorageInDetail.realNum) as number,merchandiseID as merchandiseID ,storageAddressID as storageAddressID from StorageInDetail,StorageInDraw where StorageInDetail.StorageInDrawID=StorageInDraw.id and datepart(mm,billdate) between '"+month1+"'and '"+month2+"' and merchandiseID='"+chdm+"' and storageAddressID='"+storage+"' group by merchandiseID ,storageAddressID";
// sql2="select Sum(StorageOutDetail.realNum)as number2 ,merchandiseID as merchandiseID2 ,storageAddressID as storageAddressID2 from StorageOutDetail,StorageOutDraw where StorageOutDetail.StorageOutDrawID=StorageOutDraw.id and DATEPART(month ,billDate) between'"+month1+"' and '"+month2+"' and merchandiseID='"+chdm+"' and storageAddressID='"+storage+"' group by merchandiseID,storageAddressID";
aa="2";
}
//当存货代码为空,仓库为全部仓库时候进行的查询
if(storage.equals("*")&&chdm.length()==0){
System.out.println("当存货代码为空,仓库为全部仓库时候进行的查询");
sql="select Sum(StorageInDetail.realNum) as number ,merchandiseID as merchandiseID from StorageInDetail,StorageInDraw where StorageInDetail.StorageInDrawID=StorageInDraw.id and datepart(mm,billdate)between '"+month1+"' and '"+month2+"' group by merchandiseID";
//sql2="select Sum(StorageOutDetail.realNum)as number2 ,merchandiseID as merchandiseID2 from StorageOutDetail,StorageOutDraw where StorageOutDetail.StorageOutDrawID=StorageOutDraw.id and DATEPART(month ,billDate) between'"+month1+"' and '"+month2+"' group by merchandiseID";
aa="3";
}
//当存货代码为空,仓库确定时候进行的查询
if(!storage.equals("*")&&chdm.length()==0){
System.out.println("当存货代码为空,仓库确定时候进行的查询");
sql="select Sum(StorageInDetail.realNum) as number ,merchandiseID as merchandiseID,storageAddressID as storageAddressID from StorageInDetail,StorageInDraw where StorageInDetail.StorageInDrawID=StorageInDraw.id and datepart(mm,billdate) between '"+month1+"'and '"+month2+"' and storageAddressID='"+storage+"' group by merchandiseID,storageAddressID";
//sql2="select Sum(StorageOutDetail.realNum)as number2 ,merchandiseID as merchandiseID2 ,storageAddressID as storageAddressID2 from StorageOutDetail,StorageOutDraw where StorageOutDetail.StorageOutDrawID=StorageOutDraw.id and DATEPART(month ,billDate) between'"+month1+"' and '"+month2+"' and storageAddressID='"+storage+"' group by merchandiseID,storageAddressID";
aa="4";
}
PreparedStatement pStat = conn.prepareStatement(sql);
ResultSet rs = pStat.executeQuery();
Hashtable ht=new Hashtable();
if(aa.equals("1")||aa.equals("3")){
while(rs.next()){
System.out.println("收到数量的1和3");
System.out.println("收到数量"+rs.getString("number"));//收到数量
System.out.println("受到的ID"+rs.getInt("merchandiseID"));
int merchandiseID=rs.getInt("merchandiseID");//收到的ID
String number=rs.getString("number");//受到的数量
ht.put(merchandiseID, number);
}
}else{
while(rs.next()){
System.out.println("收到数量的2和4");
System.out.println("//收到数量"+rs.getString("number"));//收到数量
System.out.println("//收到数量DEID"+rs.getString("merchandiseID"));
int merchandiseID=rs.getInt("merchandiseID");//收到的ID
String number=rs.getString("number");//受到的数量
ht.put(merchandiseID, number);
}
}return ht;
}
// 得到发出的数量,查询的单据有:盘亏单,调拨单据中仓库为调出仓库(但是调拨单不参与成本核算),出库(销售发货,销售退回,其他发货)
@SuppressWarnings("unchecked")
public Hashtable QuerySend(String month1,String month2,String storage,String chdm) throws SQLException{
System.out.println(month1);
System.out.println(month2);
System.out.println(storage);
System.out.println(chdm);
String aa=null;
//DBConection db=new DBConection();
//Connection conn=db.conn;
String sql2=null;
if(storage.equals("*")&&chdm!=""&&chdm!=null){
System.out.println("当存货代码确定,仓库为全部仓库时候,进行查询");
//sql="select Sum(StorageInDetail.realNum)as number ,merchandiseID as merchandiseID from StorageInDetail,StorageInDraw where StorageInDetail.StorageInDrawID=StorageInDraw.id and DATEPART(month ,billDate) between'"+month1+"' and '"+month2+"' and merchandiseID='"+chdm+"' group by merchandiseID";
sql2="select Sum(StorageOutDetail.realNum)as number2 ,merchandiseID as merchandiseID2 from StorageOutDetail,StorageOutDraw where StorageOutDetail.StorageOutDrawID=StorageOutDraw.id and DATEPART(month ,billDate) between'"+month1+"' and '"+month2+"' and merchandiseID='"+chdm+"' group by merchandiseID";
aa="1";
}
System.out.println("****************************/");
//当存货代码确定,仓库确定的时候的查询
if(!storage.equals("*")&&chdm!=""&&chdm!=null){
System.out.println("当存货代码确定,仓库确定的时候的查询");
//sql="select Sum(StorageInDetail.realNum) as number,merchandiseID as merchandiseID ,storageAddressID as storageAddressID from StorageInDetail,StorageInDraw where StorageInDetail.StorageInDrawID=StorageInDraw.id and datepart(mm,billdate) between '"+month1+"'and '"+month2+"' and merchandiseID='"+chdm+"' and storageAddressID='"+storage+"' group by merchandiseID ,storageAddressID";
sql2="select Sum(StorageOutDetail.realNum)as number2 ,merchandiseID as merchandiseID2 ,storageAddressID as storageAddressID2 from StorageOutDetail,StorageOutDraw where StorageOutDetail.StorageOutDrawID=StorageOutDraw.id and DATEPART(month
没有合适的资源?快使用搜索试试~ 我知道了~
进销存/财务系统.war
共1011个文件
class:269个
java:269个
gif:134个
3星 · 超过75%的资源 需积分: 0 17 下载量 33 浏览量
2009-06-09
14:12:49
上传
评论
收藏 3.11MB RAR 举报
温馨提示
hibernate+struts开发的进销存+财务系统,
资源详情
资源评论
资源推荐
收起资源包目录
进销存/财务系统.war (1011个子文件)
dsfsdfds.bmp 2.25MB
user.bmp 25KB
subject.bmp 24KB
log.bmp 22KB
copy.bmp 22KB
merchandise.bmp 22KB
password.bmp 22KB
hesuan.bmp 22KB
brief.bmp 22KB
gx.bmp 21KB
mode.bmp 19KB
storage.bmp 17KB
ReceiveOperator.class 26KB
AccountSubjectAction.class 24KB
OrderOperatr.class 23KB
AccountSubjectInfoBPO.class 23KB
RecOperator.class 23KB
StorageOperator.class 22KB
VenditionAction.class 21KB
MerchandiseAction.class 20KB
BillAction.class 19KB
OrderForm.class 19KB
CheckOprator.class 18KB
PopedomDeliver.class 17KB
storageOutOperator.class 16KB
venditionOperator.class 16KB
StorageForm.class 16KB
QueryOpertor.class 16KB
GetInAction.class 15KB
UserAction.class 15KB
CurrencyAction.class 15KB
VenditionForm.class 15KB
GetSOneAction.class 15KB
MingxiForm.class 14KB
MerchantAction.class 14KB
AccountSubjectInfo.class 14KB
DBManager.class 14KB
OrderoutAction.class 14KB
CheckListAction.class 14KB
StorageOutForm.class 13KB
OrderAction.class 13KB
MaterialOperator.class 13KB
MingxiAction.class 13KB
getObject.class 13KB
DBHelper.class 12KB
GetBOneAction.class 12KB
PopedomAction.class 11KB
OrderQueryForm.class 11KB
StaffInfo.class 11KB
OneAction.class 11KB
AccountInfo.class 10KB
StorageInfoAction.class 10KB
TempDTO.class 10KB
MerchandiseInfo.class 10KB
CheckForm.class 10KB
BranchInfoAction.class 9KB
PopedomBPO.class 9KB
GetOneAction.class 9KB
GroupAction.class 9KB
ProcedureInfoAction.class 9KB
SettlementAction.class 9KB
BriefAction.class 9KB
StorageOutAction.class 9KB
AccountInfoDAO.class 8KB
OrderQueryDTO.class 8KB
QueryAction.class 8KB
Currency.class 8KB
AccountSubjectInfoDAO.class 8KB
CurrencyDAO.class 8KB
AccountSubjectInfoForm.class 8KB
MerchandiseBPO.class 8KB
BillForm.class 8KB
StaffInfoBPO.class 8KB
PositionAction.class 8KB
AllotDetailForm.class 7KB
MerchandiseInfoDAO.class 7KB
getObject.class 7KB
StorageInDraw.class 7KB
StorageOutDraw.class 7KB
MerchantInfoDAO.class 7KB
StaffInfoDAO.class 7KB
TaxCalculateDAO.class 6KB
VenditionDetailDAO.class 6KB
OrderDraw.class 6KB
MerchantInfo.class 6KB
VBackDetailDAO.class 6KB
OrderDetailDAO.class 6KB
BackDraw.class 6KB
BackDetailDAO.class 6KB
CurrencyBPO.class 6KB
StorageInDetailDAO.class 6KB
VBackDraw.class 6KB
StorageOutDetailDAO.class 6KB
FormatHelper.class 6KB
VenditionDrawDAO.class 6KB
EnterpriseInfoDAO.class 6KB
VenditionDraw.class 6KB
SystemDefaultSettingDAO.class 6KB
AccountPeriodDAO.class 6KB
UnitageInfoDAO.class 6KB
共 1011 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
hutianfan1984
- 粉丝: 0
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- mosquitto-2.018-install-windows-x64
- FTPServer FTP 服务器,绿色免安装,单文件
- 梦畅语音点名软件,上课点名
- 利用ADNI数据集和标签,在tensorflow框架上使用tensorlayer接口,通过架构u-net实现海马体的分割
- Kutools for Word v9.0 office word 插件
- 修复Windows 10 LTSC 2021资源占用率高
- Hash工具,小巧绿色hash校验工具,免费hash工具
- 重启进行BIOS快捷方式,不需要开机按BIOS键
- 鸭子开车记(儿童绘本)
- 威纶通触摸屏编程软件Easy builder pro V6.09.01.556安装包(2024.04).txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1