版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
...wd......wd......wd...尤帅物流系统开发文档TOC\o"1-4"\h\u13021物流系统开发文档14736目录1238891.概述234872.系统分析与总体设计383582.1系统分析3146382.1.1需求描述36212.1.2用例分析359182.2总体设计4196912.2.1系统软件构造设计4164642.2.2功能模块设计557422.2.3数据库设计5304962.2.4系统构造设计841212.2.5界面设计样式10101002.2.6通用组件配置文件12164483.功能模块的详细设计与实现1220963.1接单管理模块12114143.1.1接单管理总体构造12289773.1.2订单信息MVC模式的设计12232123.1.3接单信息实体类的实现13210583.1.4接单信息实体接口类144113.1.5接单信息实体接口的实现类15232143.1.6接单信息业务逻辑类17240153.1.7接单信息业务逻辑类的实现类1777623.1.8接单信息控制类19246463.1.9视图层的实现24113633.2送货员信息管理模块25319473.2.1送货员信息管理总体构造26279753.2.2送货员信息MVC模式的设计26140593.2.3送货员信息实体类的实现2720843.2.4送货员信息实体接口类29193883.2.5送货员信息实体接口的实现类29220453.2.6送货员信息业务逻辑类3217083.2.7送货员信息业务逻辑类的实现类33226193.2.8送货员信息控制类344943.2.9视图层的实现4039073.3送货管理模块42223453.3.1送货管理总体构造42175573.3.2送货管理MVC模式的设计42113413.3.3送货管理实体类的实现42100503.3.4送货管理实体接口类4474813.3.5送货管理实体接口的实现类44202883.3.6送货管理业务逻辑类48256283.3.7送货管理业务逻辑类的实现49124483.3.8送货管理控制类53179133.3.9视图层的实现581783.4仓库管理模块59240423.4.1仓库管理总体构造59258603.4.2仓库管理MVC模式的设计59242283.4.3仓库管理实体类的实现59172623.4.4仓库管理实体接口类61257943.4.5仓库管理实体接口的实现类629223.4.6仓库管理业务逻辑类6722443.4.7仓库管理业务逻辑类的实现67219233.4.8仓库管理控制类7055393.4.9视图层的实现74283453.5仓库管理模块76126473.5.1视图层的实现76296864.系统配置78284634.1物流系统给的数据库配置如下:78196524.2引入Structs2支持79概述本报告对一个物流系统的分析、设计及编码实现进展了介绍。该报告说明了物流系统的需求,软件设计以及编码实现。本系统采用J2EE进展实现,采用MVC模式设计构造,采用Struts2+Hibernate框架+MSQL数据库系统。系统分析与总体设计2.1系统分析2.1.1需求描述物流系统是用于物流公司处理物流与配送的业务,这个系统主要具有以下功能:仓库管理员揽货点节后用户的货物、称重、打包、填单、收费,用于系统管理员将信息输入计算机中,要求将送货单号扫描入数据库。送货员到各个网点接送货物,将货物集中到物流仓库。仓库管理员每天将集中的货物根据送达目的地不同而分拣成不同区域。有送货员分别送到不同的地方或收货人手中。各个阶段均由系统管理员通过扫描进入数据库。客户可以根据送货单号查询到货物状态财务局部根据送货单的信息处理收货以及各相关人的结算。2.1.2用例分析用例图是用来显示外部参与者与系统的交互吗,能够更直观的描述系统的功能。从角色来看,物流系统主要分为5个角色,分别是:系统管理员、客户、送货员、仓库管理员、签收人。以以下列图为物流系统的用例图。2.2总体设计2.2.1系统软件构造设计2.2.2功能模块设计子系统模块名子功能描述后台订单管理模块订单信息输入管理员输入订单信息订单查询管理员查询订单信息订单信息更新管理员更新订单信息送货员信息管理模块送货员信息输入管理员输入送货员信息送货员信息更新管理员更新送货员信息送货员信息查询管理员查询送货员信息工资结算管理员结算查询送货员的工资送货管理模块送货明细管理员查询送货明细信息订单签收送货员送货,让客户签收订单支付客户付款送货员工资结算管理员结算送货员的工资仓库管理模块货物信息输入管理员输入货物信息货物分拣管理员进展货物分拣处理货物发送管理员把货物让送货员发送货物信息更新管理员更新货物信息2.2.3数据库设计货物单(t_send_foods)货物编号字段名是否为空长度描述1idnotint主键2Consignor_namenotVarchar(64)发货员名字3Consignor_addressnotVarchar(64)发货地址4Consignor_telnotVarchar(64)发货人号码5Recess_namenotVarchar(32)收货人名字6Recess_telnotVarchar(32)收货人号码7Recess_addressnotVarchar(32)收货人地址8Charge_methodnotVarchar(64)收费方法9costnotfloat费用10Goods_weightnotVarchar(32)货物重量11Goods_volumenotVarchar(32)货物体积12Is_signnotInt(3)是否签收13Is_costnotInt(3)是否收费14acceptornotVarchar(3)受理人送货员(t_delivery)送货员编号字段名是否为空长度描述1idnotint主键2Worker_nubnotVarchar(64)职工号3Delivery_addressnotVarchar(64)送货员家庭地址4Delivery_telnotVarchar(64)送货员号码5Delivery_namenotVarchar(32)送货员名字6sexnotVarchar(32)性别7agenotVarchar(32)年龄8Id_carnotVarchar(64)身份证号9Delivery_areanotfloat送货范围入库明细表(t_warehousing_detail)入库明细表编号字段名是否为空长度描述1idnotint主键2Warehousing_datenotVarchar(64)入库时间3Send_idnotint送货单号4Warehouse_managernotVarchar(64)仓库管理员5Warehousing_areanotVarchar(32)入库存放区分拣明细表(t_manage_detail)入库明细表编号字段名是否为空长度描述1idnotint主键2manage_datenotVarchar(64)分拣时间3Send_idnotint送货单号4Manage_namenotVarchar(64)分拣员5areanotVarchar(32)目的地区域送货明细表(t_detail)送货明细表编号字段名是否为空长度描述1idnotint主键2Send_datenottime送货时间3Send_idnotint送货单号4Charge__methodnotVarchar(64)收费方法5Consignor_namenotVarchar(32)发货员名字6Delivery_namenotVarchar(32)送货员名字7Real_costnotVarchar(32)实收费用8Send_statusnotVarchar(64)送货状态9Sign_nameVarchar(64)签收人姓名10Is_signVarchar(64)是否签收费用结算表(t_settlement)送货明细表编号字段名是否为空长度描述1idnotint主键2settlement_datenottime结算时间3Send_idnotint送货职工号4Send_nubnotVarchar(64)送货数量5Lose_debitsnotVarchar(32)损耗扣款6Real_moneynotVarchar(32)实发总数7Total_commissionnotVarchar(32)提成总数8salarynotVarchar(64)底薪物流系统数据库表及其关系2.2.4系统构造设计系统采用分层构造,整体上分为4层:视图层、控制层、业务逻辑层和数据访问层工程名称为logisticsSys。数据访问层与业务逻辑层采用SH框架的Struts2+Hibernate技术实现。视图层和控制层采用JSP技术实现。包名说明org.logistic.action控制类包org.logistic.dao数据访问层接口包org.logistic.dao.impl数据访问层实现类包org.logistic.entity数据模型类包,实体包org.logistic.service业务逻辑层接口包org.logistic.service.impl业务逻辑层实现类org.logistic.util配置文件包logisticsSys包的划分WebRoot文件的划分2.2.5界面设计样式该局部为界面设计的公共局部,给界面提供样式。2.2.6通用组件配置文件功能模块的详细设计与实现3.1接单管理模块3.1.1接单管理总体构造3.1.2订单信息MVC模式的设计层次功能所在的包/位置程序M接单信息管理相关实体接口类org.logistic.daoSendFoodsDao.java接单信息管理相关实体接口实现类org.logistic.dao.implSendFoodsDao,impl.java接单信息管理相关实体类org.logistic.entitySendFoods.java接单信息管理相关实体类的配置org.logistic.entitySendFoods.hbm.xmlV接单信息管理逻辑类org.logistic.serviceSendFoodsService.java接单信息管理的逻辑实现类org.logistic.service.implSendFoodsService,impl.java接单信息管理相关实体类org.logistic.actionSendFoodsAction.javaC接单输入页面logisticsSys\jspSend_foods_Add.jsp接单信息列表页面logisticsSys\jspSend_foods_list.jsp接单信息编辑页面logisticsSys\jspSend_foods_update.jsp接单入库页面logisticsSys\jspwarehourse.jsp3.1.3接单信息实体类的实现SendFoods.javapublicclassSendFoods{privateintid;privateStringconsignorName;privateStringconsignorAddress;privateStringconsignorTel;privateStringrecessName;privateStringrecessTel;privateStringchargeMethod;privatefloatcost;privateStringgoodsWeight;privateStringgoodsVolume;privatebooleanisSign;privatebooleanisCost;privateStringacceptor;privateStringrecessAddress;}SendFoods.hbm.xml<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEhibernate-mappingPUBLIC"-//Hibernate/HibernateMappingDTD3.0//EN"":///hibernate-mapping-3.0.dtd"><hibernate-mapping><classname="org.logistic.entity.SendFoods"table="t_send_foods"><idname="id"type="int"unsaved-value="null"><generatorclass="identity"/></id><propertyname="consignorName"><columnname="consignor_name"></column></property><propertyname="consignorAddress"><columnname="consignor_address"></column></property><propertyname="consignorTel"><columnname="consignor_tel"></column></property><propertyname="recessName"><columnname="recess_name"></column></property><propertyname="recessAddress"><columnname="recess_address"></column></property><propertyname="recessTel"><columnname="recess_tel"></column></property><propertyname="cost"><columnname="cost"></column></property><propertyname="chargeMethod"><columnname="charge_method"></column></property><propertyname="goodsWeight"><columnname="goods_weight"></column></property><propertyname="goodsVolume"><columnname="goods_volume"></column></property><propertyname="isSign"><columnname="is_sign"></column></property><propertyname="isCost"><columnname="is_cost"></column></property><propertyname="acceptor"></property></class></hibernate-mapping>3.1.4接单信息实体接口类SendFoodDao.javapublicinterfaceSendFoodsDaoextendsIBaseDao<SendFoods>{publicbooleanwarehouse(WarehousingDetailwarehousingDetail);publicStringgetHQL(SendFoodssendFoods);}3.1.5接单信息实体接口的实现类SendFoodDaoImpl.javapublicclassSendFoodsDaoImplextendsHibernateSessionimplementsSendFoodsDao{publicbooleandelete(intid){returnsuper.deleteEntityBean(SendFoods.class,id); }@SuppressWarnings("unchecked")publicList<SendFoods>findAll(StringsendFoods){returnsuper.getQueryList("from"+sendFoods); }publicbooleansave(SendFoodssendFoods){returnsuper.insertEntityBean(sendFoods); }publicbooleanupdate(SendFoodssendFoods){returnsuper.updateEntityBean(sendFoods); }@SuppressWarnings("unchecked")publicList<SendFoods>findById(intid){ Stringsql="fromSendFoodswhereid="+id;returnsuper.getQueryList(sql); }/***分页查询*@paramhql查询的条件*@paramoffset开场记录*@paramlength一次查询几条记录*@return*/@SuppressWarnings("unchecked")publicList<SendFoods>findBySQLForPage(Stringhql,intoffset,intlength){returnsuper.getQueryList(hql,offset,length); }/***查询所有记录数*@return总记录数*/publicintgetAllRowCount(Stringhql){returnsuper.getQueryList(hql).size(); }publicbooleanwarehouse(WarehousingDetailwarehousingDetail){ Stringhql1="fromWarehousingDetailwwherew.sendId='"+warehousingDetail.getSendId()+"'"; WarehousingDetailw=(WarehousingDetail)super.getEntityBean(hql1);//如果查询有结果,则入库失败if(w==null){ warehousingDetail.setWarehousingDate(newDate());returnsuper.insertEntityBean(warehousingDetail); }returnfalse; }publicStringgetHQL(SendFoodssendFoods){ Stringhql="fromSendFoodss";//查询语句if(sendFoods!=null){if(sendFoods.getConsignorName()!=null){ hql+="wheres.consignorName='"+sendFoods.getConsignorName()+"'"; }elseif(sendFoods.getConsignorTel()!=null){ hql+="wheres.consignorTel='"+sendFoods.getConsignorTel()+"'"; }elseif(sendFoods.getAcceptor()!=null){ hql+="wheres.acceptor='"+sendFoods.getAcceptor()+"'"; }elseif(sendFoods.getRecessTel()!=null){ hql+="wheres.recessTel='"+sendFoods.getRecessTel()+"'"; }else{if(sendFoods.getIsSign()){ hql+="wheres.isSign=1"; }else{ hql+="wheres.isSign=0"; } } }returnhql; }}3.1.6接单信息业务逻辑类SendFoodsService.javapublicinterfaceSendFoodsService{publicbooleandelete(intid);publicList<SendFoods>findAll(Stringtable);publicList<SendFoods>findById(intid);publicbooleansave(SendFoodssendFoods);publicbooleanupdate(SendFoodssendFoods);publicPageBeanqueryForPage(intpageSize,intcurrentPage,SendFoodssendFoods);publicintgetAllRowCount(Stringhql);publicbooleanwarehouse(WarehousingDetailwarehousingDetail);}3.1.7接单信息业务逻辑类的实现类SendFoodsServiceImpl.javapublicclassSendFoodsServiceImplimplementsSendFoodsService{privateSendFoodsDaosendFoodsDao=newSendFoodsDaoImpl();publicbooleandelete(intid){returnsendFoodsDao.delete(id); }publicList<SendFoods>findAll(Stringtable){returnsendFoodsDao.findAll(table); }publicList<SendFoods>findById(intid){returnsendFoodsDao.findById(id); }publicbooleansave(SendFoodssendFoods){returnsendFoodsDao.save(sendFoods); }publicbooleanupdate(SendFoodssendFoods){sendFoodsDao.findById(sendFoods.getId());returnsendFoodsDao.update(sendFoods); }publicSendFoodsDaogetSendFoodsDao(){returnsendFoodsDao; }publicvoidsetSendFoodsDao(SendFoodsDaosendFoodsDao){this.sendFoodsDao=sendFoodsDao; }/***分页查询*@paramhql查询的条件*@paramoffset开场记录*@paramlength一次查询几条记录*@return*/publicPageBeanqueryForPage(intpageSize,intpage,SendFoodssendFoods){ Stringhql=sendFoodsDao.getHQL(sendFoods);//查询语句intallRow=sendFoodsDao.getAllRowCount(hql);//总记录数inttotalPage=PageBean.countTotalPage(pageSize,allRow);//总页数finalintoffset=PageBean.countOffset(pageSize,page);//当前页开场记录finalintlength=pageSize;//每页记录数finalintcurrentPage=PageBean.countCurrentPage(page); List<SendFoods>list=sendFoodsDao.findBySQLForPage(hql,offset,length);//"一页"的记录//把分页信息保存到Bean中 PageBeanpageBean=newPageBean(); pageBean.setPageSize(pageSize); pageBean.setCurrentPage(currentPage); pageBean.setAllRow(allRow); pageBean.setTotalPage(totalPage); pageBean.setList(list); pageBean.init();returnpageBean; }/***查询所有记录数*@return总记录数*/publicintgetAllRowCount(Stringhql){returnsendFoodsDao.getAllRowCount(hql); }//进库publicbooleanwarehouse(WarehousingDetailwarehousingDetail){returnsendFoodsDao.warehouse(warehousingDetail); }}3.1.8接单信息控制类SendFoodsAction.javapublicclassSendFoodsActionextendsActionSupport{privatestaticfinallongserialVersionUID=1L;privateSendFoodsServicesendFoodsService=newSendFoodsServiceImpl();privateintpage=1;privateintpageSize=10;privatePageBeanpageBean;//包含分布信息的beanprivateSendFoodssendFoods;privateList<SendFoods>sendFoodsList;privateStringselect="";privateStringtext="";privateWarehousingDetailwarehousingDetail;privateStringid;publicWarehousingDetailgetWarehousingDetail(){returnwarehousingDetail; }publicvoidsetWarehousingDetail(WarehousingDetailwarehousingDetail){this.warehousingDetail=warehousingDetail; }publicList<SendFoods>getSendFoodsList(){returnsendFoodsList; }publicvoidsetSendFoodsList(List<SendFoods>sendFoodsList){this.sendFoodsList=sendFoodsList; }publicStringgetSelect(){returnselect; }publicvoidsetSelect(Stringselect){this.select=select; }publicStringgetId(){returnid; }publicvoidsetId(Stringid){this.id=id; }publicSendFoodsgetSendFoods(){returnsendFoods; }publicvoidsetSendFoods(SendFoodssendFoods){this.sendFoods=sendFoods; }publicvoidsetSendFoodsService(SendFoodsServicesendFoodsService){this.sendFoodsService=sendFoodsService; }publicintgetPage(){returnpage; }publicvoidsetPage(intpage){this.page=page; }publicPageBeangetPageBean(){returnpageBean; }publicintgetPageSize(){returnpageSize; }publicvoidsetPageSize(intpageSize){this.pageSize=pageSize; }publicvoidsetPageBean(PageBeanpageBean){this.pageBean=pageBean; }publicStringgetText(){returntext; }publicvoidsetText(Stringtext){this.text=text; }/** *获取货物单并分页 *@return */publicStringgetAllSendFoods(){//分页的pageBean,参数pageSize表示每页显示记录数,page为当前页try{ SendFoodss=setSelectValue();pageBean=sendFoodsService.queryForPage(pageSize,page,s); }catch(Exceptione){ e.printStackTrace(); }returnSUCCESS; }privateSendFoodssetSelectValue(){ SendFoodssendFoods=newSendFoods();//网上对比方法if(text.length()==0){returnnull; }if(select.length()>0){if(select.equals("consignorName")){ sendFoods.setConsignorName(text); }elseif(select.equals("consignorTel")){ sendFoods.setConsignorTel(text); }elseif(select.equals("isSign")){if(text.equals("是")){ sendFoods.setIsSign(true); }elseif(text.equals("否")){ sendFoods.setIsSign(false); } }elseif(select.equals("acceptor")){ sendFoods.setAcceptor(text); }elseif(select.equals("recessTel")){ sendFoods.setRecessTel(text); }returnsendFoods; }returnnull; }/** *添加货物单 *@return */publicStringadd(){try{sendFoodsService.save(sendFoods); }catch(Exceptione){ e.printStackTrace(); }returnSUCCESS; }/** *通过ID找货物单 *@return */publicStringfindById(){try{sendFoodsList=sendFoodsService.findById(Integer.parseInt(id)); }catch(NumberFormatExceptione){ e.printStackTrace(); }returnSUCCESS; }/** *货物信息修改 *@return */publicStringupdate(){try{sendFoodsService.update(sendFoods); }catch(NumberFormatExceptione){ e.printStackTrace(); }returnSUCCESS; }/** *货物信息删除 *@return */publicStringdelete(){try{sendFoodsService.delete(Integer.parseInt(id)); }catch(NumberFormatExceptione){ e.printStackTrace(); }returnSUCCESS; }/** *入库 *@return */publicStringwarehouse(){try{sendFoodsService.warehouse(warehousingDetail); }catch(Exceptione){ e.printStackTrace(); }returnSUCCESS; }}3.1.9视图层的实现订单信息输入页面订单列表页面点单入库页面3.2送货员信息管理模块3.2.1送货员信息管理总体构造3.2.2送货员信息MVC模式的设计层次功能所在的包/位置程序M送货员和送货员工资信息管理相关实体接口类org.logistic.daoDeliveryDao.javaSettlementDao.java送货员和送货员工资信息管理相关实体接口实现类org.logistic.dao.implDeliveryDaoImpl.javaSettlementDaoImpl.java送货员和送货员工资管理相关实体类org.logistic.entityDelivery.javaSettlement.java送货员和送货员工资管理相关实体类的配置org.logistic.entityDeliveryDao.hbm.xmlSettlementDao.hbm.xmlV送货员和送货员工资管理逻辑类org.logistic.serviceDeliveryService.javaSettlementService.java送货员和送货员工资管理的逻辑实现类org.logistic.service.implSettlementServiceImpl.javaSendFoodsServiceImpl.java送货员和送货员工资管理相关实体类org.logistic.actionDeliveryAction.javaSettlementAction.javaC送货员输入页面logisticsSys\jspdelivery_Add.jsp送货员信息列表页面logisticsSys\jspdelivery_list.jsp送货员信息编辑页面logisticsSys\jspdelivery_update.jsp送货员入库页面logisticsSys\jspWages_list.jsp3.2.3送货员信息实体类的实现Delivery.javapublicclassDelivery{privateintid;privateStringworkerNub;private StringdeliveryAddress;privateStringdeliveryTel;private StringdeliveryName;privateStringsex;privateIntegerage;privateStringidCard;privateStringdeliveryArea;Delivery.hbm.xml<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEhibernate-mappingPUBLIC"-//Hibernate/HibernateMappingDTD3.0//EN"":///hibernate-mapping-3.0.dtd"><hibernate-mapping><classname="org.logistic.entity.Delivery"table="t_delivery"><idname="id"type="int"unsaved-value="null"><generatorclass="identity"/></id><propertyname="workerNub"><columnname="worker_nub"></column></property><propertyname="deliveryAddress"><columnname="delivery_address"></column></property><propertyname="deliveryTel"><columnname="delivery_tel"></column></property><propertyname="deliveryName"><columnname="delivery_name"></column></property><propertyname="sex"><columnname="sex"></column></property><propertyname="age"><columnname="age"></column></property><propertyname="idCard"><columnname="id_card"></column></property><propertyname="deliveryArea"><columnname="delivery_area"></column></property></class></hibernate-mapping>送货员工资publicclassSettlement{privateintid;privateDatesettlementDate;privateintdeliveryId;privateintsendNub;privatefloatloseDebits;privatefloatrealMonney;privatefloattotalCommission;privatefloatsalary;Settlement.hbm.xml<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEhibernate-mappingPUBLIC"-//Hibernate/HibernateMappingDTD3.0//EN"":///hibernate-mapping-3.0.dtd"><hibernate-mapping><classname="org.logistic.entity.Settlement"table="t_settlement"><idname="id"type="int"unsaved-value="null"><generatorclass="identity"/></id><propertyname="settlementDate"><columnname="settlement_date"></column></property><propertyname="deliveryId"><columnname="delivery_id"></column></property><propertyname="sendNub"><columnname="send_nub"></column></property><propertyname="loseDebits"><columnname="lose_debits"></column></property><propertyname="realMonney"><columnname="real_monney"></column></property><propertyname="totalCommission"><columnname="total_commission"></column></property><propertyname="salary"><columnname="salary"></column></property></class></hibernate-mapping>3.2.4送货员信息实体接口类送货员信息publicinterfaceDeliveryDaoextendsIBaseDao<Delivery>{publicDeliveryfindSettlement(Deliverydelivery);publicStringgetHQL(Deliverydelivery);}送货员工资信息*/publicinterfaceSettlementDaoextendsIBaseDao<Settlement>{publicSettlementfindSettlement(intdeliveryId);}3.2.5送货员信息实体接口的实现类送货员信息DeliveryDaoImpl。JavaublicclassDeliveryDaoImplextendsHibernateSessionimplementsDeliveryDao{publicbooleandelete(intid){returnsuper.deleteEntityBean(Delivery.class,id); }publicList<Delivery>findAll(Stringtable){//TODOAuto-generatedmethodstubreturnnull; }publicList<Delivery>findById(intid){ Stringsql="fromDeliverywhereid="+id;returnsuper.getQueryList(sql); }publicList<Delivery>findBySQLForPage(Stringhql,intoffset,intlength){returnsuper.getQueryList(hql,offset,length); }publicintgetAllRowCount(Stringhql){returnsuper.getQueryList(hql).size(); }publicbooleansave(Deliverydelivery){returnsuper.insertEntityBean(delivery); }publicbooleanupdate(Deliverydelivery){returnsuper.updateEntityBean(delivery); }publicDeliveryfindSettlement(Deliverydelivery){ Stringhql="fromDeliverydwhered.idCard='"+delivery.getIdCard()+"'";return(Delivery)super.getEntityBean(hql); }publicStringgetHQL(Deliverydelivery){ Stringhql="fromDeliveryd";if(delivery!=null){if(delivery.getWorkerNub()!=null){ hql+="whered.workerNub='"+delivery.getWorkerNub()+"'"; }elseif(delivery.getDeliveryName()!=null){ hql+="whered.deliveryName='"+delivery.getDeliveryName()+"'"; }elseif(delivery.getDeliveryTel()!=null){ hql+="whered.deliveryTel='"+delivery.getDeliveryTel()+"'"; }elseif(delivery.getIdCard()!=null){ hql+="whered.idCard='"+delivery.getIdCard()+"'"; }elseif(delivery.getDeliveryArea()!=null){ hql+="whered.deliveryArea='"+delivery.getDeliveryArea()+"'"; } }returnhql; }}送货员工信息SettlementDaoImpl.javapublicclassSettlementDaoImplextendsHibernateSessionimplementsSettlementDao{publicbooleandelete(intid){returnsuper.deleteEntityBean(Settlement.class,id); }publicList<Settlement>findAll(Stringtable){//TODOAuto-generatedmethodstubreturnnull; }publicList<Settlement>findById(intid){//TODOAuto-generatedmethodstubreturnnull; }publicList<Settlement>findBySQLForPage(Stringhql,intoffset,intlength){returnsuper.getQueryList(hql,offset,length); }publicintgetAllRowCount(Stringhql){returnsuper.getQueryList(hql).size(); }publicbooleansave(Settlementsettlement){returnsuper.insertEntityBean(settlement); }publicbooleanupdate(Settlementobj){//TODOAuto-generatedmethodstubreturnfalse; }publicSettlementfindSettlement(intdeliveryId){ Stringhql="fromSettlementswheres.deliveryId='"+deliveryId+"'";return(Settlement)super.getEntityBean(hql); }}3.2.6送货员信息业务逻辑类送货员信息DeliverService.javapublicinterfaceDeliveryService{publicbooleandelete(intid);publicPageBeandeliveryQuery(intpageSize,intcurrentPage,Deliverydelivery);publicList<Delivery>findById(intid);publicbooleanupdate(Deliverydelivery);publicDeliveryadd(Deliverydelivery);}送货员工工资信息SettlementService.javapublicinterfaceSettlementService{publicbooleanadd(Settlementsettlement);publicbooleandelete(intdeliveryId);}3.2.7送货员信息业务逻辑类的实现类送货员信息DeliverServiceImpl.java*/publicclassDeliveryServiceImplimplementsDeliveryService{privateDeliveryDaodeliveryDao=newDeliveryDaoImpl();//删除publicbooleandelete(intid){returndeliveryDao.delete(id); }//获取信息publicList<Delivery>findById(intid){returndeliveryDao.findById(id); }//更新publicbooleanupdate(Deliverydelivery){deliveryDao.findById(delivery.getId());returndeliveryDao.update(delivery); }//添加员工publicDeliveryadd(Deliverydelivery){if(deliveryDao.save(delivery)){//查找刚插入的员工对象 Deliveryd=deliveryDao.findSettlement(delivery);returnd; }returnnull; }//查找publicPageBeandeliveryQuery(intpageSize,intpage, Deliverydelivery){ Stringhql=deliveryDao.getHQL(delivery);intallRow=deliveryDao.getAllRowCount(hql);//总记录数inttotalPage=PageBean.countTotalPage(pageSize,allRow);//总页数finalintoffset=PageBean.countOffset(pageSize,page);//当前页开场记录finalintlength=pageSize;//每页记录数finalintcurrentPage=PageBean.countCurrentPage(page);List<Delivery>list=deliveryDao.findBySQLForPage(hql,offset,length);//"一页"的记录//把分页信息保存到Bean中PageBeanpageBean=newPageBean();pageBean.setPageSize(pageSize);pageBean.setCurrentPage(currentPage);pageBean.setAllRow(allRow);pageBean.setTotalPage(totalPage);pageBean.setList(list);pageBean.init();returnpageBean; }}送货员工资信息SettlementService.javapublicclassSettlementServiceImplimplementsSettlementService{privateSettlementDaosettlementDao=newSettlementDaoImpl();publicbooleanadd(Settlementsettlement){returnsettlementDao.save(settlement); }publicbooleandelete(intdeliveryId){ Settlements=settlementDao.findSettlement(deliveryId);returnsettlementDao.delete(s.getId()); }}3.2.8送货员信息控制类送货员信息DeliveryAction.javaublicclassDeliveryListActionextendsActionSupport{privateDeliveryServicedeliveryService=newDeliveryServiceImpl();privateStringid;privateintpage=1;privateintpageSize=10;privateDeliverydelivery;privateSettlementsettlement;privatePageBeanpageBean;//包含分布信息的beanprivateList<Delivery>deliveryList;privateStringselect="";privateStringtext="";publicPageBeangetPageBean(){returnpageBean; }publicvoidsetPageBean(PageBeanpageBean){this.pageBean=pageBean; }publicStringgetId(){returnid; }publicvoidsetId(Stringid){this.id=id; }publicintgetPage(){returnpage; }publicvoidsetPage(intpage){this.page=page; }publicintgetPageSize(){returnpageSize; }publicvoidsetPageSize(intpageSize){this.pageSize=pageSize; }publicDeliverygetDelivery(){returndelivery; }publicvoidsetDelivery(Deliverydelivery){this.delivery=delivery; }publicList<Delivery>getDeliveryList(){returndeliveryList; }publicvoidsetDeliveryList(List<Delivery>deliveryList){this.deliveryList=deliveryList; }publicSettlementgetSettlement(){returnsettlement; }publicvoidsetSettlement(Settlementsettlement){this.settlement=settlement; }publicStringgetSelect(){returnselect; }publicvoidsetSelect(Stringselect){this.select=select; }publicStringgetText(){returntext; }publicvoidsetText(Stringtext){this.text=text; }/** *快递员添加 *@return */publicStringadd(){try{ Deliveryd=deliveryService.add(delivery); //d为空就是添加失败settlement.setDeliveryId(d.getId()); }catch(NumberFormatExceptione){ e.printStackTrace(); }returnSUCCESS; }/** *快递员删除 *@return */publicStringdelete(){try{deliveryService.delete(Integer.parseInt(id)); }catch(NumberFormatExceptione){ e.printStackTrace(); }returnSUCCESS; }/** *快递员查询 *@return */publicStringquery(){try{ Deliveryd=setSelectValue();pageBean=deliveryService.deliveryQuery(pageSize,page,d); }catch(NumberFormatExceptione){ e.printStackTrace(); }returnSUCCESS; }privateDeliverysetSelectValue(){ Deliverydelivery=newDelivery();//网上对比方法if(text.length()==0){returnnull; }if(select.length()>0){if(select.equals("workerNub")){ delivery.setWorkerNub(text); }elseif(select.equals("deliveryName")){ delivery.setDeliveryName(text); }elseif(select.equals("deliveryTel")){ delivery.setDeliveryTel(text); }elseif(select.equals("idCard")){ delivery.setIdCard(text); }elseif(select.equals("deliveryArea")){ delivery.setDeliveryArea(text); }returndelivery; }returnnull; }/** *通过ID找快递员 *@return */publicStringfindById(){try{deliveryList=deliveryService.findById(Integer.parseInt(id)); }catch(NumberFormatExceptione){ e.printStackTrace(); }returnSUCCESS; }/** *快递员信息修改 *@return */publicStringupdate(){try{deliveryService.update(delivery); }catch(NumberFormatExceptione){ e.printStackTrace(); }returnSUCCESS; }}送货员工资SettlementAction.javapublicclassSettlementActionextendsActionSupport{privateSettlementServicesettlementService=newSettlementServiceImpl();privateStringid;privateSettlementsettlement;privateDeliverydelivery;publicSettlementgetSettlement(){returnsettlement; }publicvoidsetSettlement(Settlementsettlement){this.settlement=settlement; }publicStringgetId(){returnid; }publicvoidsetId(Stringid){this.id=id; }publicDeliverygetDelivery(){returndelivery; }publicvoidsetDelivery(Deliverydelivery){this.delivery=delivery; }/***快递员工资表添加*@return*/publicStringadd(){try{settlement.setSendNub(0);settlement.setLoseDebits(0);settlement.setRealMonney(0);settlement.setTotalCommission(0);settlement.setSettlementDate(newDate());settlementService.add(settlement); }catch(NumberFormatExceptione){ e.printStackTrace(); }returnSUCCESS;}/***快递员工资表删除*@return*/publicStringdelete(){try{settlementService.delete(Integer.parseInt(id)); }catch(NumberFormatExceptione){ e.printStackTrace(); }returnSUCCESS;}}3.2.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 无创注射后客户跟踪回访制度
- ze净化车间硫胺楼地坪平台维修工程施工方案-复制1
- 2022年大学预防医学专业大学物理下册模拟考试试题B卷-附解析
- 苏教版五年级上册数学第四单元 小数加法和减法 测试卷附答案【预热题】
- 2022年大学电气信息专业大学物理下册期中考试试题D卷-含答案
- 2022年大学物理学专业大学物理二期中考试试卷B卷-附解析
- 2022年大学天文学专业大学物理二期末考试试卷B卷-附解析
- 2022年大学电气信息专业大学物理二期末考试试题C卷-附解析
- 2022年大学中医学专业大学物理下册期末考试试题A卷-附答案
- 2021版建筑工地安全生产管理制度
- 英语四级单词4500
- 神经病学课件:癫痫
- 县人民医院药事管理与药物治疗学委员会会议纪要五篇
- 酒店预订确认函
- 走开大黑兔“十校联赛”一等奖
- 动脉血气分析采集课件
- 10KV供配电工程施工组织设计
- 《小学教育政策与法规》总资料
- 张爱玲及《金锁记》
- 云南花灯教案
- 信任五环:超级销售拜访技巧
评论
0/150
提交评论