package com.xu.dao.impl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import com.xu.dao.IOrderDAO;
import com.xu.vo.Orders;
public class OrderDAOImpl implements IOrderDAO{
private Connection conn=null;
private PreparedStatement pst=null;
public OrderDAOImpl(Connection conn){
this.conn=conn;
}
public Set<Orders> searchOrder(String id)throws Exception{
Orders o=null;
Set<Orders> orders=new HashSet<Orders>();
String sql="SELECT * FROM orders WHERE id LIKE \'%"+id+"%\'";
this.pst=this.conn.prepareStatement(sql);
ResultSet rs=this.pst.executeQuery();
while(rs.next()){
o=new Orders();
o.setId(rs.getString(1));
o.setGoodsid(rs.getString(2));
o.setCounts(rs.getInt(3));
o.setPostperson(rs.getString(4));
o.setGetperson(rs.getString(5));
o.setPaymethod(rs.getString(6));
o.setCarid(rs.getString(7));
o.setChecked(rs.getString(8));
o.setPrice(rs.getFloat(9));
o.setTotle(rs.getFloat(10));
o.setThetime(rs.getDate(11).toString());
o.setArrival(rs.getString(12));
if(rs.getDate(13)==null){
}else{
o.setThelasttime(rs.getDate(13).toString());
}
o.setOwn(rs.getString(14));
o.setSignperson(rs.getString(15));
o.setIsdeal(rs.getString(16));
o.setPhone(rs.getString(17));
orders.add(o);
}
this.pst.close();
rs.close();
return orders;
}
public boolean addOrder(Orders o)throws Exception{
boolean flag=false;
String sql="insert into orders(id,goodsid,counts,paymethod,price,totle,thetime,own,phone) values(?,?,?,?,?,?,?,?,?)";
this.pst=this.conn.prepareStatement(sql);
this.pst.setString(1, o.getId());
this.pst.setString(2,o.getGoodsid());
this.pst.setInt(3,o.getCounts());
this.pst.setString(4, o.getPaymethod());
this.pst.setDouble(5, o.getPrice());
this.pst.setDouble(6, o.getTotle());
this.pst.setString(7, o.getThetime());
this.pst.setString(8, o.getOwn());
this.pst.setString(9, o.getPhone());
if(this.pst.executeUpdate()>0){
flag=true;
this.pst.close();
}
return flag;
}
public Set<Orders> heDui()throws Exception{
Orders o=null;
Set<Orders> orders=new HashSet<Orders>();
String sql="SELECT * FROM orders WHERE checked =\"未核定...\"";
this.pst=this.conn.prepareStatement(sql);
ResultSet rs=this.pst.executeQuery();
while(rs.next()){
o=new Orders();
o.setId(rs.getString(1));
o.setGoodsid(rs.getString(2));
o.setCounts(rs.getInt(3));
o.setPostperson(rs.getString(4));
o.setGetperson(rs.getString(5));
o.setPaymethod(rs.getString(6));
o.setCarid(rs.getString(7));
o.setChecked(rs.getString(8));
o.setPrice(rs.getFloat(9));
o.setTotle(rs.getFloat(10));
o.setThetime(rs.getDate(11).toString());
o.setArrival(rs.getString(12));
if(rs.getDate(13)==null){
}else{
o.setThelasttime(rs.getDate(13).toString());
}
o.setOwn(rs.getString(14));
o.setSignperson(rs.getString(15));
o.setIsdeal(rs.getString(16));
o.setPhone(rs.getString(17));
orders.add(o);
}
this.pst.close();
rs.close();
return orders;
}
public Set<Orders> daiChuLi() throws Exception{
Orders o=null;
Set<Orders> orders=new HashSet<Orders>();
String sql="SELECT * FROM orders WHERE isdeal=\"未处理..\"and checked=\"已核对...\"";
this.pst=this.conn.prepareStatement(sql);
ResultSet rs=this.pst.executeQuery();
while(rs.next()){
o=new Orders();
o.setId(rs.getString(1));
o.setGoodsid(rs.getString(2));
o.setCounts(rs.getInt(3));
o.setPostperson(rs.getString(4));
o.setGetperson(rs.getString(5));
o.setPaymethod(rs.getString(6));
o.setCarid(rs.getString(7));
o.setChecked(rs.getString(8));
o.setPrice(rs.getFloat(9));
o.setTotle(rs.getFloat(10));
o.setThetime(rs.getDate(11).toString());
o.setArrival(rs.getString(12));
o.setThelasttime(rs.getDate(13).toString());
o.setOwn(rs.getString(14));
o.setSignperson(rs.getString(15));
o.setIsdeal(rs.getString(16));
o.setPhone(rs.getString(17));
orders.add(o);
}
this.pst.close();
rs.close();
return orders;
}
public Set<Orders> weiTongguo()throws Exception{
Orders o=null;
Set<Orders> orders=new HashSet<Orders>();
String sql="SELECT * FROM orders WHERE checked=\"n\"";
this.pst=this.conn.prepareStatement(sql);
ResultSet rs=this.pst.executeQuery();
while(rs.next()){
o=new Orders();
o.setId(rs.getString(1));
o.setGoodsid(rs.getString(2));
o.setCounts(rs.getInt(3));
o.setPostperson(rs.getString(4));
o.setGetperson(rs.getString(5));
o.setPaymethod(rs.getString(6));
o.setCarid(rs.getString(7));
o.setChecked(rs.getString(8));
o.setPrice(rs.getFloat(9));
o.setTotle(rs.getFloat(10));
o.setThetime(rs.getDate(11).toString());
o.setArrival(rs.getString(12));
o.setThelasttime(rs.getDate(13).toString());
o.setOwn(rs.getString(14));
o.setSignperson(rs.getString(15));
o.setIsdeal(rs.getString(16));
o.setPhone(rs.getString(17));
orders.add(o);
}
this.pst.close();
rs.close();
return orders;
}
public boolean fenPei(Orders o)throws Exception{ //加个触发器 同时将车辆的working修改为忙碌
boolean flag=false;
String sql="update orders set postperson=?,getperson=?,carid=?,checked=?,thelasttime=?,signperson=?,isdeal=? where id=?";
this.pst=this.conn.prepareStatement(sql);
pst.setString(1, o.getPostperson());
pst.setString(2, o.getGetperson());
pst.setString(3, o.getCarid());
pst.setString(4,o.getChecked());
pst.setString(5, o.getThelasttime());
pst.setString(6,o.getSignperson());
pst.setString(7,o.getIsdeal());
pst.setString(8,o.getId());
if(this.pst.executeUpdate()>=1){
flag=true;
};
return flag;
}
public boolean confimOrders(String id)throws Exception{
boolean flag=false;
String sql="update orders set isdeal=\"已处理...\" where id=?";// 增加一个触发器,出发车辆信息中的working为闲置
this.pst=this.conn.prepareStatement(sql);
pst.setString(1, id);
if(this.pst.executeUpdate()>=1){
flag=true;
}
return flag;
}
public boolean setFail(String id)throws Exception{
boolean flag=false;
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyyMMdd");
String s=myFmt2.format(new Date()).toString();
String sql="update orders set checked=\"n\" , thelasttime="+s+" where id="+id;
this.pst=this.conn.prepareStatement(sql);
if(this.pst.executeUpdate()>=1){
flag=true;
}
return flag;
}
public boolean setLocation(String id,String f1,String f2)throws Exception{
boolean flag=false;
String ff=f1+"_"+f2;
System.out.print(ff);
String sql="update orders set location=? where carid=?";
this.pst=this.conn.prepareStatement(sql);
pst.setString(1,ff);
pst.setString(2, id);
if(this.pst.executeUpdate()>=1){
flag=true;
}
return flag;
}
public String getLocation(String s)throws Exception{
String ss=null;
String sql="SELECT location FROM orders WHERE id=?";
this.pst=this.conn.prepareStatement(sql);
pst.setString(1,s);
ResultSet rs=this
没有合适的资源?快使用搜索试试~ 我知道了~
java mvc实现物流资源管理系统
共294个文件
class:53个
gif:53个
java:53个
3星 · 超过75%的资源 需积分: 10 23 下载量 157 浏览量
2013-06-23
15:01:47
上传
评论 1
收藏 2.24MB ZIP 举报
温馨提示
物流管理系统,下载后部署到服务器中可以直接运行,服务器段有tomcat,mysql,servlet(标准的mvc实现)组成,前台有Jquery和eazyUI组成。具有很多的参考价值
资源推荐
资源详情
资源评论
收起资源包目录
java mvc实现物流资源管理系统 (294个子文件)
OrderDAOImpl.class 8KB
CarDAOImpl.class 4KB
OrderDAOProxy.class 4KB
GoodsDAOImpl.class 4KB
Orders.class 4KB
ToJson.class 3KB
ToJson.class 3KB
EnterpriseDAOImpl.class 3KB
CarDAOProxy.class 3KB
PeiZhi.class 3KB
AddGoods.class 2KB
AddOrder.class 2KB
LoginServlet.class 2KB
EnterpriseDAOProxy.class 2KB
GoodsDAOProxy.class 2KB
Car.class 2KB
BlackEnterprise.class 2KB
AddCar.class 2KB
SearchEnterprise.class 2KB
FailOrder.class 2KB
DaiChuLi.class 2KB
CustomDAOImpl.class 2KB
SearchOrder.class 2KB
SearchGoods.class 2KB
Login2Sevlet.class 2KB
SearchCar.class 2KB
CheckOrder.class 2KB
XianZhi.class 2KB
AddEnterprise.class 2KB
QueHuo.class 2KB
BuChongHuoWu.class 2KB
Goods.class 2KB
DingWei.class 2KB
CarDingWei.class 2KB
CustomDAOProxy.class 2KB
DingdanDingWei.class 2KB
LoginFilter.class 2KB
SetFail.class 2KB
ConfirmOrder.class 2KB
SetHei.class 2KB
Jsontest.class 1KB
Message.class 1KB
Enterprise.class 1KB
DatabaseConnection.class 1KB
Customer.class 1KB
DAOFactory.class 1KB
IOrderDAO.class 829B
Test.class 761B
Person.class 689B
ICarDAO.class 588B
IEnterpriseDAO.class 509B
IGoodsDAO.class 500B
ICustomDAO.class 327B
.classpath 529B
org.eclipse.wst.common.component 453B
org.eclipse.wst.jsdt.ui.superType.container 49B
easyui.css 32KB
Default.css 9KB
User_Login.css 6KB
xtree.css 5KB
datagrid.css 4KB
tabs.css 4KB
tree.css 4KB
calendar.css 3KB
panel.css 2KB
layout.css 2KB
linkbutton.css 1KB
window.css 1KB
menu.css 1KB
icon.css 1KB
slider.css 1KB
searchbox.css 1KB
pagination.css 980B
splitbutton.css 819B
spinner.css 732B
messager.css 692B
combo.css 686B
validatebox.css 636B
accordion.css 591B
propertygrid.css 583B
datebox.css 527B
menubutton.css 484B
dialog.css 422B
demo.css 384B
progressbar.css 260B
combobox.css 186B
Thumbs.db 35KB
topbar.gif 79KB
user_top_c.gif 7KB
user_botton.gif 6KB
user_top_l.gif 6KB
user_bottom_r.gif 4KB
user_bottom_l.gif 4KB
user_bottom_c.gif 4KB
user_top_r.gif 4KB
user_main_l.gif 3KB
user_main_r.gif 3KB
button_span_bg.gif 2KB
user_main_c.gif 2KB
panel_loading.gif 2KB
共 294 条
- 1
- 2
- 3
资源评论
- LinRain2013-06-23下来看看,学习了,可以参考一下
- zhaohongkun2014-04-29好像不能运行
- u0100185302013-06-27无法导入,但是可以参考
- cf_java_numone2014-07-06不能运行,数据还不完整
- comg19832014-01-21挺好的,不错的东西
光西
- 粉丝: 2
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功