位置:首页 » 技术 » s2sh调整带有配置文件

s2sh调整带有配置文件

日期:2014-11-30 阅读:1num
Advertisement

s2sh整合带有配置文件
<1>applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations" value="classpath:jdbc.properties" />
</bean>
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close" dependency-check="none">
<property name="driverClass">
<value>${datasource.driverClassName}</value>
</property>
<property name="jdbcUrl">
<value>${datasource.url}</value>
</property>
<property name="user">
<value>${datasource.username}</value>
</property>
<property name="password">
<value>${datasource.password}</value>
</property>
<property name="acquireIncrement">
<value>${c3p0.acquireIncrement}</value>
</property>
<property name="initialPoolSize">
<value>${c3p0.initialPoolSize}</value>
</property>
<property name="minPoolSize">
<value>${c3p0.minPoolSize}</value>
</property>
<property name="maxPoolSize">
<value>${c3p0.maxPoolSize}</value>
</property>
<property name="maxIdleTime">
<value>${c3p0.maxIdleTime}</value>
</property>
<property name="idleConnectionTestPeriod">
<value>${c3p0.idleConnectionTestPeriod}</value>
</property>
<property name="maxStatements">
<value>${c3p0.maxStatements}</value>
</property>
<property name="numHelperThreads">
<value>${c3p0.numHelperThreads}</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.OracleDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
</props>
</property>

<property name="mappingResources">
<list>

<value>com/baina/bnoffice/system/user/model/User.hbm.xml</value>
<value>com/baina/bnoffice/system/user/model/Role.hbm.xml</value>
<!--<value>com/baina/bnoffice/system/task/model/Task.hbm.xml</value>
<value>com/baina/bnoffice/system/task/model/Progress.hbm.xml</value>
-->
<value>com/baina/bnoffice/system/task/model/Preserve.hbm.xml</value>
<value>com/baina/bnoffice/system/task/model/Affair.hbm.xml</value>
<value>com/baina/bnoffice/system/task/model/Affix.hbm.xml</value>
<value>com/baina/bnoffice/system/order/model/Order.hbm.xml</value>
<value>com/baina/bnoffice/system/order/model/LinkPerson.hbm.xml</value>
<value>com/baina/bnoffice/system/order/model/OrderRMB.hbm.xml</value>
<value>com/baina/bnoffice/system/user/model/Menu.hbm.xml</value></list>
</property>
</bean>
<bean name="baseDAOs" class="com.baina.bnoffice.common.BaseDAO" abstract="true">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 配置事物管理器 -->

<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>

<!-- 配置事物的传播特性 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method rollback-for="java.lang.Exception" name="add*" />
<tx:method rollback-for="java.lang.Exception" name="save*" />
<tx:method rollback-for="java.lang.Exception" name="remove*" />
<tx:method rollback-for="java.lang.Exception" name="clear*" />
<tx:method rollback-for="java.lang.Exception" name="delete*" />
<tx:method rollback-for="java.lang.Exception" name="modify*" />
<tx:method rollback-for="java.lang.Exception" name="update*" />
<tx:method rollback-for="java.lang.Exception" name="change*" />
<tx:method rollback-for="java.lang.Exception" name="reset*" />
<tx:method name="*" read-only="true" propagation="SUPPORTS" />
</tx:attributes>
</tx:advice>
<!-- 配置参与事物的类和方法 -->
<aop:config>
<aop:pointcut id="allMethod"
expression="execution(* com.baina.*.*.service.*.*(..))" />
<aop:advisor pointcut-ref="allMethod" advice-ref="txAdvice" />
</aop:config>
</beans>
<2>jdbc.properties
datasource.driverClassName=oracle.jdbc.driver.OracleDriver
datasource.url=jdbc\:oracle\:thin\:@127.0.0.1\:1521\:baina
datasource.username=bnoffice
datasource.password=bnoffice
c3p0.acquireIncrement=3
c3p0.initialPoolSize=3
c3p0.idleConnectionTestPeriod=900
c3p0.minPoolSize=2
c3p0.maxPoolSize=50
c3p0.maxStatements=100
c3p0.numHelperThreads=10
c3p0.maxIdleTime=600

<3>struts.xml配置文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">

<struts>
<constant name="struts.i18n.encoding" value="utf-8"></constant>
<constant name="struts.enable.DynamicMethodInvocation" value="true">
</constant>
<constant name="struts.devMode" value="false"></constant>
<constant name="struts.i18n.reload" value="true"></constant>
<constant name="struts.configuration.xml.reload" value="true"></constant>
<constant name="struts.ognl.allowStaticMethodAccess" value="false">
</constant>
<constant name="struts.action.extension" value="action"></constant>
<constant name="struts.ui.theme" value="simple"></constant>
<constant name="struts.multipart.saveDir" value="/tmp" />
<constant name="struts.multipart.maxSize" value="10737418" />
<!--

<package name="index" namespace="/manage/index"
extends="struts-default"> <action name="user"> </action> </package>

<package name="web" namespace="/" extends="struts-default">
<action name="webAction" class="com.baina.bnoffice.system.web.action.WebAction">
<interceptor-ref name="fileUpload">
配置允许上传的文件类型,多个用","分隔
<param name="allowedTypes">
image/bmp,image/png,image/gif,image/jpeg,image/jpg,image/x-png,
image/pjpeg
</param>
配置允许上传的文件大小,单位字节
<param name="maximumSize">102400</param>
</interceptor-ref>
<result name="person">/manage/order/addOrder.jsp</result>
<result name="commit">/manage/order/addOrder.jsp</result>

<interceptor-ref name="fileUploadStack" />

<result name="webCommit">/manage/order/addOrder.jsp</result>
</action>
</package>
-->
<package name="user" extends="struts-default" namespace="/">
<action name="user" class="com.baina.bnoffice.system.user.action.UserAction">
<result name="alterError">/commons/error.jsp</result>
<result name="alterSuccess">/manage/task/listTask.jsp</result>
<result name="toAdd">/manage/user/addUser.jsp</result>
<result name="list">/manage/user/userManage.jsp</result>
<result name="add" type="redirect">user!list.action</result>
<result name="delete" type="redirect">user!list.action</result>
<result name="toUpdate">/manage/user/alterUser.jsp</result>
<result name="toMenu" >
/manage/index/left3.jsp

</result>

</action>
<action name="login" class="com.baina.bnoffice.system.user.action.LoginAction">
<result name="error" type="redirect">/commons/failure.jsp</result>
<result name="success" type="redirect">/manage/index/index.jsp</result>
<result name="loginout" type="redirect">/login.jsp</result>
<result name="top" >/manage/index/top.jsp</result>
</action>
</package>

<package name="affair" extends="struts-default" namespace="/">
<action name="affair" class="com.baina.bnoffice.system.task.action.AffairAction">
<result name="tocount">/manage/task/count.jsp</result>
<result name="addAffairSuccess" type="redirect">affair!listInitTask.action</result>
<result name="completeAffairSuccess" type="redirect">affair!listAffair.action</result>
<result name="listUAffair">/manage/task/listTask.jsp</result>
<result name="checkAffair" type="redirect">affair!listUAffair.action</result>
<result name="getChAffairById">/manage/task/check.jsp</result>
<result name="checkFAffair" type="redirect">affair!listInitTask.action</result>
<result name="backAffair" type="redirect">affair!listInitTask.action</result>
<result name="complete">/manage/task/complete.jsp</result>
<result name="getUAffairById">/manage/task/follow.jsp</result>
<result name="down" type="stream">
<param name="inputName">file</param>
<param name="contentType">application/octet-stream</param>
<param name="bufferSize">2048</param>
</result>
<result name="ss" type="chain">
<param name="actionName">affair</param>
<param name="method">listUAffair</param>
</result>
<result name="getUDAffairById">/manage/task/completeDetail.jsp</result>
<result name="listAffair" >/manage/task/listCompleteTask.jsp</result>
<result name="listInitTask">/manage/task/listInitTask.jsp</result>
<result name="getAffairById">/manage/task/detail.jsp</result>
<result name="getPreserveById">/manage/task/progress.jsp</result>
<result name="selectAllAffair">/manage/task/selectAllAffair.jsp</result>
<result name="getPreservs">/manage/task/countPreserve.jsp</result>
</action>
</package>
<package name="order" extends="struts-default" namespace="/">
<action name="orderadd" class="com.baina.bnoffice.system.order.action.OrderAddAction">
<result name="add" type="redirect">order!listAllOrderes.action</result>
</action>
<!-- 统计 -->
<action name="ordercount" class="com.baina.bnoffice.system.order.action.OrderCountAction">
<result name="ordercount">/manage/order/count.jsp</result>
<result name="getBranchOrder">/manage/order/countAdmin.jsp</result>
<result name="getPersonOrders">/manage/order/countPerson.jsp</result>
<result name="getPersonUOrders">/manage/order/countPersonFOrder.jsp</result>
<result name="getPersonUUOrders">/manage/order/countPersonUOrder.jsp</result>
</action>
<action name="order" class="com.baina.bnoffice.system.order.action.OrderAction">
<result name="listPaymentMessage">/manage/order/addPayment.jsp</result>
<result name="listOrder" >/manage/order/gatherUROrder.jsp</result>
<result name="listURecievedOrder">/manage/order/orderInfo1.jsp</result>
<result name="listRecievedOrder">/manage/order/follow.jsp</result>
<result name="commitOrderPreserve">/manage/order/commit.jsp</result>
<result name="listPCollection">/manage/order/gatherProgressOrder.jsp</result>
<result name="commiteOrder">/login.jsp</result>
<result name="listFinishOrder">/manage/order/gatherOrder.jsp</result>
<result name="listAllOrderes">/manage/order/listAllOrders.jsp</result>
<result name="selectAllOrders">/manage/order/selectAllOrders.jsp</result>

<result name="listOrderDesign">/manage/order/design.jsp</result>
<result name="listPDesign">/manage/order/designPro.jsp</result>
<result name="listFinishOrderDesign">/manage/order/designFinish.jsp</result>

<result name="listOrderLayout">/manage/order/layout.jsp</result>
<result name="listPLayout">/manage/order/layoutPro.jsp</result>
<result name="listFinishOrderLayOut">/manage/order/layoutFinish.jsp</result>

<result name="listOrderProgram">/manage/order/program.jsp</result>
<result name="listPProgram">/manage/order/programPro.jsp</result>
<result name="listFinishOrderProgram">/manage/order/programFinish.jsp</result>

<result name="listOrderUpload">/manage/order/upload.jsp</result>
<result name="listPUpload">/manage/order/uploadPro.jsp</result>
<result name="listFinishOrderUpload">/manage/order/uploadFinish.jsp</result>

<result name="listOrderAffirm">/manage/order/affirm.jsp</result>
<result name="listPAffirm">/manage/order/affirmPro.jsp</result>
<result name="listFinishOrderAffirm">/manage/order/affirmFinish.jsp</result>

<result name="listOrderPayment">/manage/order/payment.jsp</result>
<result name="listPPayment">/manage/order/paymentPro.jsp</result>
<result name="listFinishOrderPayment">/manage/order/paymentFinish.jsp</result>

</action>
</package>
</struts>
<4>log4j properties
#配置根Logger
#OFF、FATAL、ERROR、WARN、INFO、DEBUG、ALL
#Log4j建议只使用四个级别,优先级从高到低分别是ERROR、WARN、INFO、DEBUG
log4j.rootLogger=INFO,stdout,allFile,todayAllFile,todayErrorFile
#控制台
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.target=System.out
log4j.appender.stdout.immediateFlush=true
log4j.appender.stdout.threshold=DEBUG
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.conversionPattern=%d{ABSOLUTE} %-5p [%F:%L] - %m%n
#总文件
log4j.appender.allFile=org.apache.log4j.RollingFileAppender
log4j.appender.allFile.file=c\:\\testlogs\\test_all.log
log4j.appender.allFile.append=true
log4j.appender.allFile.immediateFlush=true
log4j.appender.allFile.threshold=DEBUG
log4j.appender.allFile.layout=org.apache.log4j.PatternLayout
log4j.appender.allFile.layout.conversionPattern=%d [%t] %-5p %c{2} %x - %m%n
log4j.appender.allFile.maxFileSize=10MB
log4j.appender.allFile.maxBackupIndex=356
#总错误文件
#log4j.appender.allFileError=org.apache.log4j.RollingFileAppender
#log4j.appender.allFileError.file=c\:\\shoplogs\\cschenshop_all_error.log
#log4j.appender.allFileError.append=true
#log4j.appender.allFileError.immediateFlush=true
#log4j.appender.allFileError.threshold=WARN
#log4j.appender.allFileError.layout=org.apache.log4j.PatternLayout
#log4j.appender.allFileError.layout.conversionPattern=%d [%t] %-5p %c{2} %x - %m%n
#log4j.appender.allFileError.maxFileSize=10MB
#log4j.appender.allFileError.maxBackupIndex=356
#每日文件
log4j.appender.todayAllFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.todayAllFile.file=c\:\\testlogs\\infoHistory\\test_all.log
log4j.appender.todayAllFile.append=true
log4j.appender.todayAllFile.immediateFlush=true
log4j.appender.todayAllFile.threshold=DEBUG
log4j.appender.todayAllFile.layout=org.apache.log4j.PatternLayout
log4j.appender.todayAllFile.layout.conversionPattern=%d [%t] %-5p %c{2} %x - %m%n
log4j.appender.todayAllFile.datePattern='.'yyyy-MM-dd'.log'
#每日error文件
log4j.appender.todayErrorFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.todayErrorFile.file=c\:\\testlogs\\errorHistory\\test_error.log
log4j.appender.todayErrorFile.append=true
log4j.appender.todayErrorFile.immediateFlush=true
log4j.appender.todayErrorFile.threshold=WARN
log4j.appender.todayErrorFile.layout=org.apache.log4j.PatternLayout
log4j.appender.todayErrorFile.layout.conversionPattern=%d [%t] %-5p %c{2} %x - %m%n
log4j.appender.todayErrorFile.datePattern='.'yyyy-MM-dd'.log'
# OpenSymphony Stuff
log4j.logger.com.opensymphony=INFO
log4j.logger.org.apache.struts2=INFO
# Spring Stuff
log4j.logger.org.springframework=INFO
# Hibernate Stuff
log4j.logger.org.hiberante=INFO
log4j.logger.org.hibernate.tool.hbm2ddl=debug
<5>web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml,

<!--
/WEB-INF/classes/com/baina/bnoffice/system/web/cfg/webs.xml,
/WEB-INF/classes/com/baina/bnoffice/system/web/cfg/attachments.xml,
-->
/WEB-INF/classes/com/baina/bnoffice/system/order/cfg/orders.xml,
/WEB-INF/classes/com/baina/bnoffice/system/task/cfg/affairs.xml,
/WEB-INF/classes/com/baina/bnoffice/system/user/cfg/users.xml
</param-value>

</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<filter>
<filter-name>Spring character encoding filter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Spring character encoding filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<filter>
<filter-name>loginFilter</filter-name>
<filter-class>com.baina.bnoffice.common.LoginFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>loginFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
</web-app>

二.Dao
<1>basedao
package com.baina.bnoffice.common;

/**
* copyRight(c) 2010 hcj 版权
*/

import java.io.Serializable;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.criterion.Example;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Projections;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.baina.*;

/**
*
* description:BaseDAO类表示与数据库交互的基类
*
* @author
* @version 1.0
* @history
*/
public abstract class BaseDAO extends HibernateDaoSupport {

/**
* 根据ID获取对象(针对整数ID)
*
* @param id
* 数据Bean对象的主�?
* @param clazz
* 数据Bean对象的类�?
* @return 数据Bean对象
*/
public Object get(int id, Class<?> clazz) throws Exception {

return (Object) super.getHibernateTemplate().get(clazz, id);

}

/**
* 根据ID获取对象(针对整数非整�?)
*
* @param id
* @param clazz
* @return
* @throws Exception
* Sep 30, 2010 4:43:34 PM author:laijianbin
*/
public Object get(String id, Class<?> clazz) throws Exception {
return super.getHibernateTemplate().get(clazz, id);
}
/**
* 添加数据对象
*
* @param bean
* 数据Bean对象
*/
public Serializable add(Object bean) throws Exception {
return super.getHibernateTemplate().save(bean);

}

/**
* 删除数据对象
*
* @param id
* 数据Bean对象的主�?
* @param clazz
* 数据Bean对象的类�?
*/
public void delete(int id, Class<?> clazz) throws Exception {
HibernateTemplate template = super.getHibernateTemplate();
template.delete(template.load(clazz, id));

}

/**
* 查询数据对象
*
* @param bean
* 数据Bean条件对象
* @param clazz
* 数据Bean对象的类�?
* @return 结果�?
*/
public List<?> search(final Object bean) throws Exception {
return super.getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Criteria cariteria = session.createCriteria(bean
.getClass());
cariteria.add(Example.create(bean).ignoreCase()
.enableLike(MatchMode.ANYWHERE));
List<?> list = cariteria.list();
return list;
}
});
}

/**
* 查询数据对象
*
* @param bean
* 数据Bean条件对象
* @param clazz
* 数据Bean对象的类�?
* @return 结果�?
*/
public List<?> search(final Object bean, final PageBean pageBean,
final String[] orderArr) throws Exception {
return super.getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Criteria cariteria = session.createCriteria(bean
.getClass());
cariteria.add(Example.create(bean).ignoreCase()
.enableLike(MatchMode.ANYWHERE));
int firstResultIndex = pageBean.getPageCnt()
* (pageBean.getPage() - 1);
cariteria.setFirstResult(firstResultIndex);
cariteria.setMaxResults(pageBean.getPageCnt());
if (orderArr != null && orderArr.length > 0)
for (int i = 0; i < orderArr.length; i++) {
cariteria.addOrder(Order.desc(orderArr[i]));
}
List<?> list = cariteria.list();
return list;
}
});
}

/**
* 查询数据对象
*
* @param bean
* @param pageBean
* @param orderArrByDESC
* 降序条件数组
* @param orderArrByASC
* 升序条件数组
* @return
* @throws Exception
* Oct 29, 2010 10:54:06 AM author:laijianbin
*/
public List<?> search(final Object bean, final PageBean pageBean,
final String[] orderArrByDESC, final String[] orderArrByASC)
throws Exception {
return super.getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Criteria cariteria = session.createCriteria(bean
.getClass());
cariteria.add(Example.create(bean).ignoreCase()
.enableLike().enableLike(MatchMode.ANYWHERE));
int firstResultIndex = pageBean.getPageCnt()
* (pageBean.getPage() - 1);
cariteria.setFirstResult(firstResultIndex);
cariteria.setMaxResults(pageBean.getPageCnt());
if (orderArrByDESC != null && orderArrByDESC.length > 0)
for (int i = 0; i < orderArrByDESC.length; i++) {
cariteria.addOrder(Order
.desc(orderArrByDESC[i]));
}
if (orderArrByASC != null && orderArrByASC.length > 0)
for (int i = 0; i < orderArrByASC.length; i++) {
cariteria.addOrder(Order.asc(orderArrByASC[i]));
}
List<?> list = cariteria.list();
return list;
}
});
}

/**
* 查询数据对象
*
*
* @param clazz
* 数据Bean对象的类�?
* @return 结果�?
*/
public List<?> search(final Class<?> clazz) throws Exception {
return super.getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
List<?> results = session.createCriteria(clazz).list();
return results;
}
});
}

/**
* 修改数据Bean对象
*
* @param bean
* 数据Bean对象
*/
public void update(Object bean) throws Exception {
super.getHibernateTemplate().update(bean);
}

/**
* 批量保存数据Bean对象
*
* @param list
* 数据Bean对象集合
*/
public void saveBatch(List<?> list) throws Exception {
// TODO:
}

/**
* 批量删除数据Bean对象
*
* @param list
* 数据Bean对象集合
*/
public void delAll(List<?> list) throws Exception {
// TODO:
}

/**
* 查询
*
* @param hql
* hql语句
* @return list 数据Bean对象集合
*/
public List<?> search(String hql) {
HibernateTemplate template = super.getHibernateTemplate();
return template.find(hql);
}

/**
* 查询前几条数�?
*
* @param hql
* hql语句
* @return list 数据Bean对象集合
*/
public List<?> search(final String hql, final int size) {
return super.getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException {
Query query = session.createQuery(hql);
query.setFirstResult(0);
query.setMaxResults(size);
return query.list();
}
});
}

/**
* 分页查询
*
* @param hql
* 语句
* @param pageNo
* 页号
* @param pageSize
* 大小
* @return Sep 9, 2010 10:38:44 AM author:laijianbin
*/
public List<?> searchPage(final String hql, final PageBean pageBean) {
return super.getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException {
Query query = session.createQuery(hql);
if (pageBean.getPage() > 0 && pageBean.getPageCnt() > 0) {
query.setFirstResult((pageBean.getPage() - 1)
* pageBean.getPageCnt());
query.setMaxResults(pageBean.getPageCnt());
}
return query.list();
}
});

}

/**
* HQL查询
*
* @param hql
* HQL语句
* @param obj
* 条件数组
* @return Sep 9, 2010 12:54:36 PM author:laijianbin
*/
public List<?> getList(final String hql, final Object[] obj) {
return super.getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException {
Query query = session.createQuery(hql);
if (obj != null && obj.length > 0)
for (int i = 0; i < obj.length; i++) {
query.setParameter(i, obj[i]);
}
return query.list();
}
});

}

/**
* 分页获取对象的集�?
*
* @param clz
* 实体类型
* @param pageBean
* 分页对象
* @param orderDesc
* 降序条件
* @return Sep 9, 2010 11:01:09 AM author:laijianbin
*/
public List<?> search(final Class<?> clz, final PageBean pageBean,
final String[] orderDesc) {
return super.getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException {
Criteria cariteria = session.createCriteria(clz);
int firstResultIndex = pageBean.getPageCnt()
* (pageBean.getPage() - 1);
cariteria.setFirstResult(firstResultIndex);
cariteria.setMaxResults(pageBean.getPageCnt());
if (orderDesc != null && orderDesc.length > 0)
for (int i = 0; i < orderDesc.length; i++) {
cariteria.addOrder(Order.desc(orderDesc[i]));
}
List<?> list = cariteria.list();
return list;
}
});

}

/**
* 根据HQL语句删除
*
* @param hql
* Sep 9, 2010 10:39:33 AM author:laijianbin
*/
public void del(final String hql) {
super.getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException {
return session.createQuery(hql).executeUpdate();
}
});
}

/**
* 根据HQL语句更新
*
* @param hql
* @return list 数据Bean对象集合
*/
public void update(final String hql) {
super.getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException {
return session.createQuery(hql).executeUpdate();
}
});
}

/**
* 根据HQL语句更新
*
* @param hql
* @return list 数据Bean对象集合
*/
public boolean addList(final List<?> list) {
return (Boolean) super.getHibernateTemplate().execute(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException {
boolean flag = true;
try {
int i = 0;
for (int j = 0; i < list.size(); j++) {
session.save(list.get(j));
i++;
}
if ((i + 1) % list.size() == 0) {
session.flush();
session.clear();
}
} catch (Exception e) {
flag = false;
}
return flag;
}
});
}

/**
* 使用SQL查询
*
* @param clz
* @param pageBean
* @param orderDesc
* @return Oct 10, 2010 4:22:36 PM author:laijianbin
*/
public List<?> searchSQL(final String sql) {
return super.getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
List<List<String>> list = new ArrayList<List<String>>();
Connection con = session.connection();
Statement st = null;
ResultSet rs = null;
st = con.createStatement();
rs = st.executeQuery(sql);
while (rs.next()) {
List<String> temp = new ArrayList<String>();
int count = rs.getMetaData().getColumnCount();
for (int i = 1; i <= count; i++) {
temp.add(rs.getString(i));
}
list.add(temp);
}
rs.close();
st.close();
con.close();
return list;
}
});

}

/**
* 获取模糊查询分页总记录数
*
* @param bean
* @param pageBean
* @param orderArrByDESC
* @param orderArrByASC
* @return
* @throws Exception
* Oct 29, 2010 11:36:56 AM author:laijianbin
*/
public Integer getTotalByCriteria(final Object bean,
final String[] orderArrByDESC, final String[] orderArrByASC)
throws Exception {
return (Integer) super.getHibernateTemplate().execute(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Criteria cariteria = session.createCriteria(bean
.getClass());
cariteria.add(Example.create(bean).ignoreCase()
.enableLike(MatchMode.ANYWHERE));
return cariteria.setProjection(Projections.rowCount())
.uniqueResult();
}
});
}
/**
* 使用SQL查询
*
* @param clz
* @param pageBean
* @param orderDesc
* @return Oct 10, 2010 4:22:36 PM author:laijianbin
*/
public List<?> searchSQL(final String sql,final PageBean pageBean) {
return super.getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
List<List<String>> list = new ArrayList<List<String>>();
Connection con = session.connection();
Statement st = null;
ResultSet rs = null;
st = con.createStatement();
rs = st.executeQuery(sql);
while (rs.next()) {
List<String> temp = new ArrayList<String>();
int count = rs.getMetaData().getColumnCount();
for (int i = 1; i <= count; i++) {
temp.add(rs.getString(i));
}
list.add(temp);
}
rs.close();
st.close();
con.close();
int a =pageBean.getPageCnt()*(pageBean.getPage() - 1);
int b = 0;
if(pageBean.getPage()<pageBean.getMaxPage()){
b = pageBean.getPageCnt()*(pageBean.getPage());
}else if(pageBean.getPage()==pageBean.getMaxPage()){
b = a+ pageBean.getRecordCnt()%pageBean.getPageCnt();
}
list = list.subList(a, b);
return list;
}
});

}

}
<2>orderDaoImpl
package com.baina.bnoffice.system.order.dao;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;

import com.baina.bnoffice.common.BaseDAO;
import com.baina.bnoffice.common.PageBean;
import com.baina.bnoffice.common.Tools;
import com.baina.bnoffice.system.order.model.Count;
import com.baina.bnoffice.system.order.model.LinkPerson;
import com.baina.bnoffice.system.order.model.Order;
import com.baina.bnoffice.system.order.model.OrderRMB;
import com.baina.bnoffice.system.order.model.UGroup;
import com.baina.bnoffice.system.user.model.User;

public class OrderDAOImpl extends BaseDAO implements IOrderDAO {
public int addOrder(Order order) {
String sql = "select seq_tec_order.nextval from dual";
String s = super.searchSQL(sql).get(0).toString();
int id = Integer.parseInt(s.substring(1, s.length() - 1));
order.setToid(id);
try {
super.add(order);
} catch (Exception e) {
e.printStackTrace();
}
return id;
}

/**
*根据订单ID查询出联系人
*
*/
public List getLikePerson(int toid) throws Exception {

String hql = "from LinkPerson where toid=" + toid;
return super.search(hql);
}

/**
* 根据订单ID款项信息
*
*/
public List getOrderRMB(int toid) throws Exception {
String hql = "from OrderRMB where toid=" + toid;
return super.search(hql);
}

/**
*
* 跟进订单id得到订单表信息
*
*/
public Order getOrderById(int toid) throws Exception {
String hql = "from Order where toid=" + toid;
Order o = (Order) super.search(hql).get(0);
return o;
}

/**
*
*
*/
public void addLinkperson(LinkPerson linkperson) {
try {
super.add(linkperson);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

/**
*
*
*/
public void addOrderRMB(OrderRMB orderRMB) {
try {
super.add(orderRMB);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
/**
* 改变订单类型
*
*/
public void updateOrderState(Order order) throws Exception {
super.update(order);

}

/**
*
*
*/
public List listOrderCollection(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {

String hql = "from Order where gatheruserid=" + userid
+ "and gatherstate='0'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("ddText") != null) {
String ddvText = String.valueOf(hashtabel.get("ddText"));
hql += " and ddText like '%" + ddvText.trim() + "%' ";
}
if (hashtabel.get("ddValue") != null) {
String ddValue = String.valueOf(hashtabel.get("ddValue"));
hql += " and ddValue like '%" + ddValue.trim() + "%' ";
}
if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public void updateGatherState(Order order) throws Exception {
super.update(order);
}

public List listOrderProgressCollection(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where gatheruserid=" + userid
+ "and gatherstate='2'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;

}

public List listFinishCollection(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where gatheruserid=" + userid
+ "and gatherstate='1'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
// System.out.println("+++++++++++++++count"+count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderDesign(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where designuserid=" + userid
+ "and designstate='1'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderURDesign(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where designuserid=" + userid
+ "and designstate='0'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderProDesign(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where designuserid=" + userid
+ "and designstate='2'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderProLayOut(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where layoutuserid=" + userid
+ "and layoutstate='2'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderURLayOut(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where layoutuserid=" + userid
+ "and layoutstate='0'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderFiLayOut(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where layoutuserid=" + userid
+ "and layoutstate='1'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderPayment(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where paymentuserid=" + userid
+ "and paymentstate='1'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderURPayment(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where paymentuserid=" + userid
+ " and paymentstate='0'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderPropayment(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where paymentuserid=" + userid
+ "and paymentstate='2'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderURprogram(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where programuserid=" + userid
+ "and programstate='0'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderprogram(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where programuserid=" + userid
+ "and programstate='1'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderProprogram(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where programuserid=" + userid
+ "and programstate='2'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderAffirm(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where affirmuserid=" + userid
+ "and affirmstate='1'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderURAffirm(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where affirmuserid=" + userid
+ "and affirmstate='0'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderProAffirm(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where affirmuserid=" + userid
+ "and affirmstate='2'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderProUpload(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where uploaduserid=" + userid
+ "and uploadstate='2'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderURUpload(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where uploaduserid=" + userid
+ "and uploadstate='0'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List listOrderUpload(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {
String hql = "from Order where uploaduserid=" + userid
+ "and uploadstate='1'";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List sendMails() throws Exception {
String hql = "from Order where tostate<9";
return super.search(hql);
}

public void addPament(OrderRMB oR) {
try {
super.add(oR);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

public List listAllOrdersByUserId(int userid, PageBean pagebean,
Hashtable hashtabel) {
String hql = "from Order where douserid=" + userid;
String column = "toid";
String updown = "desc";

if (hashtabel != null) {

if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();

hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

public List selectAllOrders(PageBean pagebean, Hashtable hashtabel) {
String hql=" from Order where 1=1";
String column = "toid";
String updown = "desc";

if (hashtabel != null) {
if (hashtabel.get("begindate") != null) {
String begindate = String.valueOf(hashtabel.get("begindate"));
hql += " and to_char(ostartdate,'yyyy-mm-dd')>='"+begindate +"'";
}
if (hashtabel.get("enddate") != null) {
String enddate = String.valueOf(hashtabel.get("enddate"));
hql += " and to_char(ostartdate,'yyyy-mm-dd') <='"+enddate+"'";
}
if (hashtabel.get("today") != null) {
String today = String.valueOf(hashtabel.get("today"));
hql += " and to_char(ostartdate,'yyyy-mm-dd')='"+today+"'";
}
if (hashtabel.get("month") != null) {
String month = String.valueOf(hashtabel.get("month"));
hql += " and to_char(ostartdate,'yyyy-mm')='"+month+"'";
}
if (hashtabel.get("year") != null) {
String year = String.valueOf(hashtabel.get("year"));
hql += " and to_char(ostartdate,'yyyy')='"+year+"'";
}
if (hashtabel.get("cpy") != null) {
String cpy = String.valueOf(hashtabel.get("cpy"));
hql += " and cpyname like '%" + cpy.trim() + "%' ";
}
if (hashtabel.get("otype") != null) {
String otype = String.valueOf(hashtabel.get("otype"));
hql += " and otype = '" + otype.trim() + "' ";
}
if (hashtabel.get("douserid") != null) {
String douserid = String.valueOf(hashtabel.get("douserid"));
hql += " and douserid = " + douserid.trim();
}
}
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

/*
*
*
* 统计从这开始
*
*
*
*
*/

/**
* 建站个人订单数
*/
public int getCount(int userid) {
String hql = "from Order where douserid=" + userid
+ " or gatheruserid=" + userid + " or designuserid=" + userid
+ " or layoutuserid=" + userid + "or programuserid=" + userid
+ " or uploaduserid=" + userid + " or affirmuserid=" + userid
+ " or paymentuserid=" + userid + "or douserid=" + userid;

int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
return count;
}

/**
* 建站个人完成的任务数
*
*/
public int getFinishCount(int roleid, int userid, Hashtable hashtabel) {

int count = 0;
String sql = "";
System.out.println(hashtabel);

if (hashtabel.get("begindate") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd')>='"
+ hashtabel.get("begindate") + "'";
}
if (hashtabel.get("enddate") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd') <='"
+ hashtabel.get("enddate") + "'";
}
if (hashtabel.get("today") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ hashtabel.get("today") + "'";
}
if (hashtabel.get("month") != null) {
sql += " and to_char(ostartdate,'yyyy-mm')='"
+ hashtabel.get("month") + "'";
System.out.println(hashtabel.get("month")
+ "++++++++++++++++++++++++++++++++++++month");
}
if (hashtabel.get("year") != null) {
sql += " and to_char(ostartdate,'yyyy')='"
+ hashtabel.get("year") + "'";
}

if (hashtabel.get("begindate") == null&&hashtabel.get("enddate") == null&&
hashtabel.get("today")== null&&hashtabel.get("month") == null&&hashtabel.get("year") == null){
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ Tools.getTime("yyyy-MM-dd") + "'";
System.out.println(sql+"+++++++++++++++++++++++++++++++++++++++++++++++++++");

}
if (roleid == 3) {
String hql = "from Order where (( layoutuserid=" + userid
+ " and layoutstate='1' ) or ( designuserid=" + userid
+ " and designstate='1'))";
hql +=sql;
count = Integer.parseInt(super.search(
"select count(*) " + hql ).get(0).toString());

System.out.println(hql+"+++++++++++++++++++++++++++++++++++++++++++++++"+count);
}
if (roleid == 4) {
String hql = "from Order where ((gatheruserid=" + userid
+ " and gatherstate='1') or " + "(uploaduserid=" + userid
+ " and uploadstate='1') or (affirmuserid=" + userid
+ " and affirmstate='1') or (paymentuserid=" + userid
+ " and paymentstate='1') or douserid=" + userid+")";
hql += sql;
count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());

}
if (roleid == 5) {
String hql = "from Order where programuserid=" + userid
+ " and programstate='1'";
hql += sql;
count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println(hql+"+++++++++++++++++++++++++++++++++++++++++++++++"+count);
}

return count;
}

/**
* 建站个人未完成的任务数
*
*/
public int getUFinishCount(int roleid, int userid, Hashtable hashtabel) {

int count = 0;
String sql = "";
System.out.println((hashtabel==null)+"+++++++++++++++++++++++++++++++++++hashtabel");

if (hashtabel.get("begindate") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd')>='"
+ hashtabel.get("begindate") + "'";
}
if (hashtabel.get("enddate") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd') <='"
+ hashtabel.get("enddate") + "'";
}
if (hashtabel.get("today") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ hashtabel.get("today") + "'";
}
if (hashtabel.get("month") != null) {
sql += " and to_char(ostartdate,'yyyy-mm')='"
+ hashtabel.get("month") + "'";
}
if (hashtabel.get("year") != null) {
sql += " and to_char(ostartdate,'yyyy')='"
+ hashtabel.get("year") + "'";
}

if (hashtabel.get("begindate") == null&&hashtabel.get("enddate") == null&&
hashtabel.get("today")== null&&hashtabel.get("month") == null&&hashtabel.get("year") == null){
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ Tools.getTime("yyyy-MM-dd") + "'";
System.out.println(sql+"+++++++++++++++++++++++++++++++++++++++++++++++++++");
}

if (roleid == 3) {
String hql = "from Order where (( layoutuserid="
+ userid+" and layoutstate='0' ) or (layoutuserid="+userid
+ " and layoutstate='2') or ( designuserid="
+ userid + " and designstate='0') or (designuserid="+userid+" and designstate='2'))";
hql +=sql;
count = Integer.parseInt(super.search(
"select count(*) " + hql).get(0).toString());

System.out.println(hql+"__________________________________________________"+count);
}
if (roleid == 4) {
String hql = "from Order where (( gatheruserid="
+ userid +" and gatherstate='0') or (gatheruserid="+userid+" and gatherstate='2') or "

+ "( uploaduserid="
+ userid
+ " and uploadstate='0') or (uploaduserid="+userid+" and uploadstate='2') or (affirmuserid="
+ userid
+ " and affirmstate='0') or (affirmuserid="
+ userid +" and affirmstate='2') or (paymentuserid="
+ userid + " and paymentstate='0') or (paymentuserid="
+ userid + " and paymentstate='2'))";
hql += sql;
count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());

}
if (roleid == 5) {
String hql = "from Order where ( programuserid=" + userid
+ " and (programstate='0' or programstate='2'))";
hql+=sql;
count = Integer.parseInt(super.search(
"select count(*) " + hql ).get(0).toString());
System.out.println(hql+"__________________________________________________"+count);
}

return count;

}

/**
*
* 统计超时与按时的数据
*
*/
public Hashtable getFinishOrder(int userid, int roleid, Hashtable hashtabel) {

int overtime = 0;
int ontime = 0;
String sql = "";

if (hashtabel.get("begindate") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd')>='"
+ hashtabel.get("begindate") + "'";
}
if (hashtabel.get("enddate") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd') <='"
+ hashtabel.get("enddate") + "'";
}
if (hashtabel.get("today") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd')='"
+ hashtabel.get("today") + "'";
}
if (hashtabel.get("month") != null) {
sql += "and to_char(ostartdate,'yyyy-mm')='"
+ hashtabel.get("month") + "'";
}
if (hashtabel.get("year") != null) {
sql += "and to_char(ostartdate,'yyyy')='"
+ hashtabel.get("year") + "'";
}

if (hashtabel.get("begindate") == null&&hashtabel.get("enddate") == null&&
hashtabel.get("today")== null&&hashtabel.get("month") == null&&hashtabel.get("year") == null){
sql += "and to_char(ostartdate,'yyyy-mm-dd')='"
+ Tools.getTime("yyyy-MM-dd") + "'";
}

if (roleid == 1) {
int overtime1 = 0;
int ontime1 = 0;
int overtime2 = 0;
int ontime2 = 0;
String hql = "from Order where 1=1 ";
int count = Integer.parseInt(super.search(
"select count(*) " + hql + sql).get(0).toString());
String hql1 = "from Order where tostate='9' or tostate='a'";

int count1 = Integer.parseInt(super.search(
"select count(*) " + hql1 + sql).get(0).toString());

String hql2 = "from Order where tostate!='9' and tostate!='a'";
int count2 = Integer.parseInt(super.search(
"select count(*) " + hql2 + sql).get(0).toString());

List listf1 = super.search(hql1 + " and otype='0'");
for (int i = 0; i < listf1.size(); i++) {

Order or = (Order) listf1.get(i);
if ((or.getOenddate()).compareTo(or.getOstartdate()) > 3) {
overtime1++;
} else {
ontime1++;
}
}

List listf2 = super.search(hql1 + " and otype='1'");
for (int i = 0; i < listf2.size(); i++) {

Order or = (Order) listf2.get(i);
if ((or.getOenddate()).compareTo(or.getOstartdate()) > 20) {
overtime2++;
} else {
ontime2++;
}
}
ontime = ontime1 + ontime1;
overtime = overtime1 + overtime2;

}
if (roleid == 3) {

int overtime2 = 0;
int ontime2 = 0;
int overtime3 = 0;
int ontime3 = 0;
int overtime4 = 0;
int ontime4 = 0;
// 经济型
String hql = "from Order where layoutuserid=" + userid
+ " and layoutstate='1' and otype='0'";
// 非经济型
String hql3 = "from Order where layoutuserid=" + userid
+ " and layoutstate='1' and otype='1'";
String hql2 = "from Order where designuserid=" + userid
+ " and designstate='1' ";
List list = super.search(hql + sql);
List list2 = super.search(hql2 + sql);
List list3 = super.search(hql3 + sql);
for (int i = 0; i < list.size(); i++) {
Order or = (Order) list.get(i);
if ((or.getLayoutend()).compareTo(or.getLayoutstart()) > 1) {
overtime2++;
} else {
ontime2++;
}
}
for (int i = 0; i < list2.size(); i++) {
Order or = (Order) list2.get(i);
if ((or.getLayoutstart()).compareTo(or.getLayoutstart()) > 2) {
overtime3++;
} else {
ontime3++;
}
}
for (int i = 0; i < list3.size(); i++) {
Order or = (Order) list3.get(i);
if ((or.getDesignend()).compareTo(or.getDesignstart()) > 3) {
overtime4++;
} else {
ontime4++;
}
}
overtime = overtime2 + overtime3 + overtime4;
ontime = ontime2 + ontime3 + ontime4;

}
if (roleid == 4) {
int overtime1 = 0;
int ontime1 = 0;
int overtime2 = 0;
int ontime2 = 0;
int overtime3 = 0;
int ontime3 = 0;
int overtime4 = 0;
int ontime4 = 0;
int overtime6 = 0;
int ontime6 = 0;
String hql7="from Order where douserid="+userid;
String hql1 = "from Order where gatheruserid=" + userid
+ " and gatherstate='1'";
// 经济型
String hql2 = "from Order where uploaduserid=" + userid
+ " and uploadstate='1' and otype='0'";
// 非经济型
String hql3 = "from Order where uploaduserid=" + userid
+ " and uploadstate='1' and otype='1'";

String hql4 = "from Order where affirmuserid=" + userid
+ " and affirmstate='1'";

String hql6 = "from Order where paymentuserid=" + userid
+ " and paymentstate='1'";
List list1 = super.search(hql1 + sql);
List list2 = super.search(hql2 + sql);
List list3 = super.search(hql3 + sql);
List list4 = super.search(hql4 + sql);
List list6 = super.search(hql6 + sql);
List list7=super.search(hql7+sql);
int ontime7 = Integer.parseInt(super.search(
"select count(*) " + hql7 + sql).get(0).toString());
for (int i = 0; i < list1.size(); i++) {
Order or = (Order) list1.get(i);
if ((or.getGatherend()).compareTo(or.getGatherstart()) > 2) {
overtime1++;
} else {
ontime1++;
}
}
for (int i = 0; i < list2.size(); i++) {
Order or = (Order) list2.get(i);
if ((or.getUploadend()).compareTo(or.getUploadstart()) > 2) {
overtime2++;
} else {
ontime2++;
}

}
for (int i = 0; i < list3.size(); i++) {
Order or = (Order) list3.get(i);
if ((or.getUploadend()).compareTo(or.getUploadstart()) > 2) {
overtime3++;
} else {
ontime3++;
}

}
for (int i = 0; i < list4.size(); i++) {
Order or = (Order) list4.get(i);
if ((or.getAffirmend()).compareTo(or.getAffirmstart()) > 1) {
overtime4++;
} else {
ontime4++;
}
}
for (int i = 0; i < list6.size(); i++) {
Order or = (Order) list6.get(i);
if ((or.getPaymentend()).compareTo(or.getPaymentstart()) > 7) {
overtime6++;
} else {
ontime6++;
}
}

ontime = ontime1 + ontime2 + ontime3 + ontime4 + ontime6+ontime7;
overtime = overtime1 + overtime2 + overtime3 + overtime4
+ overtime6;
}
if (roleid == 5) {
int overtime1 = 0;
int overtime2 = 0;
int ontime1 = 0;
int ontime2 = 0;

String hql = "from Order where programuserid=" + userid
+ " and programstate='1' and otype='1'";
String hql1 = "from Order where programuserid=" + userid
+ " and programstate='1' and otype='0'";
List list = super.search(hql + sql);
List list1 = super.search(hql1 + sql);
for (int i = 0; i < list.size(); i++) {
Order or = (Order) list.get(i);
if ((or.getProgramend()).compareTo(or.getProgramstart()) > 2) {
overtime1++;
} else {
ontime1++;
}
}
for (int i = 0; i < list1.size(); i++) {
Order or = (Order) list1.get(i);
if ((or.getProgramend()).compareTo(or.getProgramstart()) > 2) {
overtime2++;
} else {
ontime2++;
}
}
ontime = ontime1 + ontime1;
overtime = overtime1 + overtime2;
}
Hashtable ht = new Hashtable();
ht.put("ontime", ontime);
ht.put("overtime", overtime);
return ht;
}

/**
* 技术部总体的数据完成的未完成的,以及总数
*
*/
public Hashtable getAdminOrder(int userid, int roleid, Hashtable hashtabel) {
String sql = "";
if (hashtabel.get("begindate") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd')>='"
+ hashtabel.get("begindate") + "'";
}
if (hashtabel.get("enddate") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd') <='"
+ hashtabel.get("enddate") + "'";
}
if (hashtabel.get("today") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd')='"
+ hashtabel.get("today") + "'";
}
if (hashtabel.get("month") != null) {
sql += "and to_char(ostartdate,'yyyy-mm')='"
+ hashtabel.get("month") + "'";
}
if (hashtabel.get("year") != null) {
sql += "and to_char(ostartdate,'yyyy')='"
+ hashtabel.get("year") + "'";
}

if (hashtabel.get("begindate") == null&&hashtabel.get("enddate") == null&&
hashtabel.get("today")== null&&hashtabel.get("month") == null&&hashtabel.get("year") == null){
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ Tools.getTime("yyyy-MM-dd") + "'";
System.out.println(sql+"+++++++++++++++++++++++++++++++++++++++++++++++++++");
}

String hql = "from Order where 1=1 ";
int count = Integer.parseInt(super.search(
"select count(*) " + hql + sql).get(0).toString());
String hql1 = "from Order where tostate='9' or tostate='a'";

int count1 = Integer.parseInt(super.search(
"select count(*) " + hql1 + sql).get(0).toString());

String hql2 = "from Order where tostate!='9' and tostate!='a'";
int count2 = Integer.parseInt(super.search(
"select count(*) " + hql2 + sql).get(0).toString());

Hashtable ht = new Hashtable();
ht.put("count", count);
ht.put("count1", count1);
ht.put("count2", count2);
return ht;

}

/**
* 组别的数据
*
*/
public List getGroupOrder(Hashtable hashtabel) {
int overtime = 0;
int ontime = 0;
int overtime1 = 0;
int ontime1 = 0;
int overtime2 = 0;
int ontime2 = 0;
int overtime3 = 0;
int ontime3 = 0;
int overtime4 = 0;
int ontime4 = 0;
int overtime6 = 0;
int ontime6 = 0;
int overtimeh = 0;
int ontimeh = 0;
int overtimei = 0;
int ontimei = 0;
int overtimea = 0;
int ontimea = 0;
int overtimeb = 0;
int ontimeb = 0;
int overtimec = 0;
int ontimec = 0;
int overtimed = 0;
int ontimed = 0;

String sql = "";

String hql1 = "from Order where gatherstate='1'";
// 经济型
String hql2 = "from Order where uploadstate='1' and otype='0'";
// 非经济型
String hql3 = "from Order where uploadstate='1' and otype='1'";

String hql4 = "from Order where affirmstate='1'";
String hql6 = "from Order where paymentstate='1'";
String hql7 = "from Order where gatherstate!='1'";
String hql8 = "from Order where uploadstate!='1'";
String hql10 = "from Order where affirmstate!='1'";
String hql11 = "from Order where paymentstate!='1'";

// 经济型
String hqla = "from Order where layoutstate='1' and otype='0'";
// 非经济型
String hqlb = "from Order where layoutstate='1' and otype='1'";
String hqlc = "from Order where designstate='1' ";
String hqlh = "from Order where programstate='1' and otype='1'";
String hqli = "from Order where programstate='1' and otype='0'";
String hqlk = "from Order where programstate!='1'";
String hqle = "from Order where layoutstate!='1'";
String hqlf = "from Order where designstate='1' ";

List al = new ArrayList();

if (hashtabel.get("begindate") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd')>='"
+ hashtabel.get("begindate") + "'";
}
if (hashtabel.get("enddate") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd') <='"
+ hashtabel.get("enddate") + "'";
}
if (hashtabel.get("today") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd')='"
+ hashtabel.get("today") + "'";
}
if (hashtabel.get("month") != null) {
sql += "and to_char(ostartdate,'yyyy-mm')='"
+ hashtabel.get("month") + "'";
}
if (hashtabel.get("year") != null) {
sql += "and to_char(ostartdate,'yyyy')='"
+ hashtabel.get("year") + "'";
}

if (hashtabel.get("begindate") == null&&hashtabel.get("enddate") == null&&
hashtabel.get("today")== null&&hashtabel.get("month") == null&&hashtabel.get("year") == null){
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ Tools.getTime("yyyy-MM-dd") + "'";
System.out.println(sql+"+++++++++++++++++++++++++++++++++++++++++++++++++++");
}

List list1 = super.search(hql1 + sql);
List list2 = super.search(hql2 + sql);
List list3 = super.search(hql3 + sql);
List list4 = super.search(hql4 + sql);
List list6 = super.search(hql6 + sql);

for (int i = 0; i < list1.size(); i++) {
Order or = (Order) list1.get(i);
if ((or.getGatherend()).compareTo(or.getGatherstart()) > 2) {
overtime1++;
} else {
ontime1++;
}
}
for (int i = 0; i < list2.size(); i++) {
Order or = (Order) list2.get(i);
if ((or.getUploadend()).compareTo(or.getUploadstart()) > 2) {
overtime2++;
} else {
ontime2++;
}

}
for (int i = 0; i < list3.size(); i++) {
Order or = (Order) list3.get(i);
if ((or.getUploadend()).compareTo(or.getUploadstart()) > 2) {
overtime3++;
} else {
ontime3++;
}

}
for (int i = 0; i < list4.size(); i++) {
Order or = (Order) list4.get(i);
if ((or.getAffirmend()).compareTo(or.getAffirmstart()) > 1) {
overtime4++;
} else {
ontime4++;
}
}
for (int i = 0; i < list6.size(); i++) {
Order or = (Order) list6.get(i);
if ((or.getPaymentend()).compareTo(or.getPaymentstart()) > 7) {
overtime6++;
} else {
ontime6++;
}
}
String hql = "from Order where 1=1 ";
int count = Integer.parseInt(super.search(
"select count(*) " + hql + sql).get(0).toString());
int count1 = Integer.parseInt(super.search(
"select count(*) " + hql1 + sql).get(0).toString());
int count2 = Integer.parseInt(super.search(
"select count(*) " + hql2 + sql).get(0).toString());
int count3 = Integer.parseInt(super.search(
"select count(*) " + hql3 + sql).get(0).toString());
int count4 = Integer.parseInt(super.search(
"select count(*) " + hql4 + sql).get(0).toString());
int count6 = Integer.parseInt(super.search(
"select count(*) " + hql6 + sql).get(0).toString());
int count7 = Integer.parseInt(super.search(
"select count(*) " + hql7 + sql).get(0).toString());
int count8 = Integer.parseInt(super.search(
"select count(*) " + hql8 + sql).get(0).toString());
int count10 = Integer.parseInt(super.search(
"select count(*) " + hql10 + sql).get(0).toString());
int count11 = Integer.parseInt(super.search(
"select count(*) " + hql11 + sql).get(0).toString());
int countf = count1 + count2 + count3 + count4 + count6+count;
int countu = count7 + count8 + count10 + count11;
UGroup g = new UGroup();
ontime = ontime1 + ontime2 + ontime3 + ontime4 + ontime6+count;
overtime = overtime1 + overtime2 + overtime3 + overtime4 + overtime6;
g.setOntime(ontime);
g.setOvertime(overtime);
g.setCountf(countf);
g.setCountu(countu);
g.setCounts(countf+countu);
g.setUgroup("客服组");
al.add(g);

List lista = super.search(hqla + sql);
List listb = super.search(hqlb + sql);
List listc = super.search(hqlc + sql);
for (int i = 0; i < lista.size(); i++) {
Order or = (Order) lista.get(i);
if ((or.getLayoutend()).compareTo(or.getLayoutstart()) > 1) {
overtimea++;
} else {
ontimea++;
}
}
for (int i = 0; i < listb.size(); i++) {
Order or = (Order) listb.get(i);
if ((or.getLayoutstart()).compareTo(or.getLayoutstart()) > 2) {
overtimeb++;
} else {
ontimeb++;
}
}
for (int i = 0; i < listc.size(); i++) {
Order or = (Order) listc.get(i);
if ((or.getDesignend()).compareTo(or.getDesignstart()) > 3) {
overtimec++;
} else {
ontimec++;
}
}

List listh = super.search(hqlh + sql);
List listi = super.search(hqli + sql);
for (int i = 0; i < listh.size(); i++) {
Order or = (Order) listh.get(i);
if ((or.getProgramend()).compareTo(or.getProgramstart()) > 2) {
overtimeh++;
} else {
ontimeh++;
}
}
for (int i = 0; i < listi.size(); i++) {
Order or = (Order) listi.get(i);
if ((or.getProgramend()).compareTo(or.getProgramstart()) > 2) {
overtimei++;
} else {
ontimei++;
}
}
int counti1 = Integer.parseInt(super.search(
"select count(*) " + hqlh + sql).get(0).toString());
int counti = Integer.parseInt(super.search(
"select count(*) " + hqli + sql).get(0).toString());
int countu2 = Integer.parseInt(super.search(
"select count(*) " + hqlk + sql).get(0).toString());
int counta = Integer.parseInt(super.search(
"select count(*) " + hqla + sql).get(0).toString());
int countb = Integer.parseInt(super.search(
"select count(*) " + hqlb + sql).get(0).toString());
int countc = Integer.parseInt(super.search(
"select count(*) " + hqlc + sql).get(0).toString());
int counte = Integer.parseInt(super.search(
"select count(*) " + hqle + sql).get(0).toString());
int counth = Integer.parseInt(super.search(
"select count(*) " + hqlf + sql).get(0).toString());
int countf1 = counta + countb + countc + counti1 + counti;
int countu1 = counte + counth + countu2;
ontimed = ontimea + ontimeb + ontimec + ontimei + ontimeh;
overtimed = overtimea + overtimeb + overtimec + overtimeh + overtimei;
UGroup g1 = new UGroup();
g1.setOntime(ontimed);
g1.setOvertime(overtimed);
g1.setCountf(countf1);
g1.setCountu(countu1);
g1.setCounts(countf1+countu1);
g1.setUgroup("建站组");
al.add(g1);

return al;
}

/**
* 总的统计数据
*
*/
public List getUserOrder(Hashtable hashtabel,List user) {
//通过传进来的id 调用DAO内的方法算出每个人的当前的总的数据。
ArrayList al=new ArrayList();
for(int i=0;i<user.size();i++) {
User user1=(User)user.get(i);
if(user1.getRoleid()!=1) {
Hashtable h=getFinishOrder(user1.getUserid(), user1.getRoleid(), hashtabel) ;
int countf=getFinishCount(user1.getRoleid(),user1.getUserid(),hashtabel);
int countu=getUFinishCount(user1.getRoleid(),user1.getUserid(), hashtabel);
Count c=new Count();
c.setOvertime(Integer.parseInt(h.get("overtime").toString()));
c.setOntime(Integer.parseInt(h.get("ontime").toString()));
c.setCountf(countf);
c.setCountu(countu);
c.setCounts(countf+countu);
c.setUgroup(user1.getUgroup());
c.setUname(user1.getUname());
c.setUserid(user1.getUserid());
al.add(c);

}

}

return al;
}

/**
*
* 得到技术部传递时间的订单统计
*
*/

public List getAllOrders(Hashtable hashtabel,PageBean pageBean) {
String hql="from Order where 1=1 ";
String sql = "";
String column = "toid";
String updown = "desc";

if (hashtabel.get("begindate") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd')>='"
+ hashtabel.get("begindate") + "'";
}
if (hashtabel.get("enddate") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd') <='"
+ hashtabel.get("enddate") + "'";
}
if (hashtabel.get("today") != null) {
sql += "and to_char(ostartdate,'yyyy-mm-dd')='"
+ hashtabel.get("today") + "'";
}
if (hashtabel.get("month") != null) {
sql += "and to_char(ostartdate,'yyyy-mm')='"
+ hashtabel.get("month") + "'";
}
if (hashtabel.get("year") != null) {
sql += "and to_char(ostartdate,'yyyy')='"
+ hashtabel.get("year") + "'";
}

if (hashtabel.get("begindate") == null&&hashtabel.get("enddate") == null&&
hashtabel.get("today")== null&&hashtabel.get("month") == null&&hashtabel.get("year") == null){
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ Tools.getTime("yyyy-MM-dd") + "'";
System.out.println(sql+"+++++++++++++++++++++++++++++++++++++++++++++++++++");
}
hql +=sql;

int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());

pageBean.setRecordCnt(count);
pageBean.countMaxPage();

hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pageBean);
return list;

}

/**
* 统计
* 个人信息的全部选定时间内的订单数据
*/

public List listOrder(int userid, PageBean pagebean, Hashtable hashtabel)
throws Exception {
String hql = "from Order where (douserid=" + userid + " or gatheruserid="
+ userid + " or designuserid=" + userid + " or layoutuserid="
+ userid + " or programuserid=" + userid + " or uploaduserid="
+ userid + " or affirmuserid=" + userid + " or paymentuserid="
+ userid +")";
String column = "toid";
String updown = "desc";
String sql="";
if (hashtabel.get("begindate") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd')>='"
+ hashtabel.get("begindate") + "'";
}
if (hashtabel.get("enddate") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd') <='"
+ hashtabel.get("enddate") + "'";
}
if (hashtabel.get("today") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ hashtabel.get("today") + "'";
}
if (hashtabel.get("month") != null) {
sql += " and to_char(ostartdate,'yyyy-mm')='"
+ hashtabel.get("month") + "'";
}
if (hashtabel.get("year") != null) {
sql += " and to_char(ostartdate,'yyyy')='"
+ hashtabel.get("year") + "'";
}

if (hashtabel.get("begindate") == null&&hashtabel.get("enddate") == null&&
hashtabel.get("today")== null&&hashtabel.get("month") == null&&hashtabel.get("year") == null){
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ Tools.getTime("yyyy-MM-dd") + "'";
System.out.println(sql+"+++++++++++++++++++++++++++++++++++++++++++++++++++");
}
hql+=sql;
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + count);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

/**
*
* 通过userid查出该用户的所有完成的建站任务
*
*/
public List getUOrderByUserid(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {

String hql = "from Order where ( (layoutuserid=" + userid
+ " and layoutstate='1') or ( designuserid=" + userid
+ " and designstate='1') or (gatheruserid=" + userid
+ " and gatherstate='1') or " + "(uploaduserid=" + userid
+ " and uploadstate='1') or (affirmuserid=" + userid
+ " and affirmstate='1') or (paymentuserid=" + userid
+ " and paymentstate='1') or douserid=" + userid+" or (programuserid=" + userid
+ " and programstate='1') )";

String column = "toid";
String updown = "desc";
String sql="";
if (hashtabel.get("begindate") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd')>='"
+ hashtabel.get("begindate") + "'";
}
if (hashtabel.get("enddate") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd') <='"
+ hashtabel.get("enddate") + "'";
}
if (hashtabel.get("today") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ hashtabel.get("today") + "'";
}
if (hashtabel.get("month") != null) {
sql += " and to_char(ostartdate,'yyyy-mm')='"
+ hashtabel.get("month") + "'";
}
if (hashtabel.get("year") != null) {
sql += " and to_char(ostartdate,'yyyy')='"
+ hashtabel.get("year") + "'";
}

if (hashtabel.get("begindate") == null&&hashtabel.get("enddate") == null&&
hashtabel.get("today")== null&&hashtabel.get("month") == null&&hashtabel.get("year") == null){
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ Tools.getTime("yyyy-MM-dd") + "'";
System.out.println(sql+"+++++++++++++++++++++++++++++++++++++++++++++++++++");
}
hql +=sql;
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + hql);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}

/**
*
* 通过userid查出该用户的所有未完成的建站任务
*
*/
public List getUUOrderByUserid(int userid, PageBean pagebean,
Hashtable hashtabel) throws Exception {

String hql = "from Order where ( (layoutuserid=" + userid
+ " and layoutstate!='1') or ( designuserid=" + userid
+ " and designstate!='1') or (gatheruserid=" + userid
+ " and gatherstate!='1') or " + "(uploaduserid=" + userid
+ " and uploadstate!='1') or (affirmuserid=" + userid
+ " and affirmstate!='1') or (paymentuserid=" + userid
+ " and paymentstate!='1') or (programuserid=" + userid
+ " and programstate!='1') )";

String column = "toid";
String updown = "desc";
String sql="";
if (hashtabel.get("begindate") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd')>='"
+ hashtabel.get("begindate") + "'";
}
if (hashtabel.get("enddate") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd') <='"
+ hashtabel.get("enddate") + "'";
}
if (hashtabel.get("today") != null) {
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ hashtabel.get("today") + "'";
}
if (hashtabel.get("month") != null) {
sql += " and to_char(ostartdate,'yyyy-mm')='"
+ hashtabel.get("month") + "'";
}
if (hashtabel.get("year") != null) {
sql += " and to_char(ostartdate,'yyyy')='"
+ hashtabel.get("year") + "'";
}

if (hashtabel.get("begindate") == null&&hashtabel.get("enddate") == null&&
hashtabel.get("today")== null&&hashtabel.get("month") == null&&hashtabel.get("year") == null){
sql += " and to_char(ostartdate,'yyyy-mm-dd')='"
+ Tools.getTime("yyyy-MM-dd") + "'";
System.out.println(sql+"++++++++++++++++++++++++++++123456789++++");
}
hql +=sql;
int count = Integer.parseInt(super.search("select count(*) " + hql)
.get(0).toString());
System.out.println("+++++++++++++++count" + hql);
pagebean.setRecordCnt(count);
pagebean.countMaxPage();
// TODO Auto-generated method stub
hql += " order by " + column + " " + updown + " ";
List list = super.searchPage(hql, pagebean);
return list;
}
}
三.Model 加.xml 配置文件
Order 配置文件
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="com.baina.bnoffice.system.order.model.Order" table="TEC_ORDER" schema="BNOFFICE">
<id name="toid" type="java.lang.Integer">
<column name="TOID" precision="22" scale="0" />
<generator class="assigned"></generator>
</id>
<property name="tonum" type="java.lang.String">
<column name="TONUM" length="20" />
</property>
<property name="tostate" type="java.lang.String">
<column name="TOSTATE" length="1" />
</property>
<property name="cpyid" type="java.lang.Integer">
<column name="CPYID" precision="22" scale="0" />
</property>
<property name="cpyname" type="java.lang.String">
<column name="CPYNAME" length="40" />
</property>
<property name="signuser" type="java.lang.String">
<column name="SIGNUSER" length="15" />
</property>
<property name="signbranch" type="java.lang.String">
<column name="SIGNBRANCH" length="15" />
</property>
<property name="signarea" type="java.lang.String">
<column name="SIGNAREA" length="15" />
</property>
<property name="signcpy" type="java.lang.String">
<column name="SIGNCPY" length="15" />
</property>
<property name="signpresident" type="java.lang.String">
<column name="SIGNPRESIDENT" length="15" />
</property>
<property name="signdate" type="java.util.Date">
<column name="SIGNDATE" length="7" />
</property>
<property name="signdatey" type="java.lang.String">
<column name="SIGNDATEY" length="8" />
</property>
<property name="signdateq" type="java.lang.String">
<column name="SIGNDATEQ" length="8" />
</property>
<property name="signdatem" type="java.lang.String">
<column name="SIGNDATEM" length="8" />
</property>
<property name="signdatew" type="java.lang.String">
<column name="SIGNDATEW" length="8" />
</property>
<property name="signdated" type="java.lang.String">
<column name="SIGNDATED" length="8" />
</property>
<property name="referdate" type="java.util.Date">
<column name="REFERDATE" length="7" />
</property>
<property name="referdatey" type="java.lang.String">
<column name="REFERDATEY" length="8" />
</property>
<property name="referdateq" type="java.lang.String">
<column name="REFERDATEQ" length="8" />
</property>
<property name="referdatem" type="java.lang.String">
<column name="REFERDATEM" length="8" />
</property>
<property name="referdatew" type="java.lang.String">
<column name="REFERDATEW" length="8" />
</property>
<property name="referdated" type="java.lang.String">
<column name="REFERDATED" length="8" />
</property>
<property name="ostartdate" type="java.util.Date">
<column name="OSTARTDATE" length="7" />
</property>
<property name="ostartdatey" type="java.lang.String">
<column name="OSTARTDATEY" length="8" />
</property>
<property name="ostartdateq" type="java.lang.String">
<column name="OSTARTDATEQ" length="8" />
</property>
<property name="ostartdatem" type="java.lang.String">
<column name="OSTARTDATEM" length="8" />
</property>
<property name="ostartdatew" type="java.lang.String">
<column name="OSTARTDATEW" length="8" />
</property>
<property name="ostartdated" type="java.lang.String">
<column name="OSTARTDATED" length="8" />
</property>
<property name="otype" type="java.lang.String">
<column name="OTYPE" length="1" />
</property>
<property name="ototrmb" type="java.lang.Integer">
<column name="OTOTRMB" precision="22" scale="0" />
</property>
<property name="douserid" type="java.lang.Integer">
<column name="DOUSERID" precision="22" scale="0" />
</property>
<property name="dousername" type="java.lang.String">
<column name="DOUSERNAME" length="10" />
</property>
<property name="dousersuperior" type="java.lang.String">
<column name="DOUSERSUPERIOR" length="10" />
</property>
<property name="dousergroup" type="java.lang.String">
<column name="DOUSERGROUP" length="10" />
</property>
<property name="douserbranch" type="java.lang.String">
<column name="DOUSERBRANCH" length="10" />
</property>
<property name="dousercpy" type="java.lang.String">
<column name="DOUSERCPY" length="30" />
</property>
<property name="douserpresident" type="java.lang.String">
<column name="DOUSERPRESIDENT" length="20" />
</property>
<property name="oremark" type="java.lang.String">
<column name="OREMARK" length="200" />
</property>
<property name="ifaffix" type="java.lang.String">
<column name="IFAFFIX" length="1" />
</property>
<property name="gatherstate" type="java.lang.String">
<column name="GATHERSTATE" length="1" />
</property>
<property name="gatheruserid" type="java.lang.Integer">
<column name="GATHERUSERID" precision="22" scale="0" />
</property>
<property name="gatherusername" type="java.lang.String">
<column name="GATHERUSERNAME" length="10" />
</property>
<property name="gatherusersuperior" type="java.lang.String">
<column name="GATHERUSERSUPERIOR" length="10" />
</property>
<property name="gatherusergroup" type="java.lang.String">
<column name="GATHERUSERGROUP" length="10" />
</property>
<property name="gatheruserbranch" type="java.lang.String">
<column name="GATHERUSERBRANCH" length="10" />
</property>
<property name="gatherusercpy" type="java.lang.String">
<column name="GATHERUSERCPY" length="30" />
</property>
<property name="gatheruserpresident" type="java.lang.String">
<column name="GATHERUSERPRESIDENT" length="20" />
</property>
<property name="gatherstart" type="java.util.Date">
<column name="GATHERSTART" length="7" />
</property>
<property name="gatherstarty" type="java.lang.String">
<column name="GATHERSTARTY" length="8" />
</property>
<property name="gatherstartq" type="java.lang.String">
<column name="GATHERSTARTQ" length="8" />
</property>
<property name="gatherstartm" type="java.lang.String">
<column name="GATHERSTARTM" length="8" />
</property>
<property name="gatherstartw" type="java.lang.String">
<column name="GATHERSTARTW" length="8" />
</property>
<property name="gatherstartd" type="java.lang.String">
<column name="GATHERSTARTD" length="8" />
</property>
<property name="gatherend" type="java.util.Date">
<column name="GATHEREND" length="7" />
</property>
<property name="gatherendy" type="java.lang.String">
<column name="GATHERENDY" length="8" />
</property>
<property name="gatherendq" type="java.lang.String">
<column name="GATHERENDQ" length="8" />
</property>
<property name="gatherendm" type="java.lang.String">
<column name="GATHERENDM" length="8" />
</property>
<property name="gatherendw" type="java.lang.String">
<column name="GATHERENDW" length="8" />
</property>
<property name="gatherendd" type="java.lang.String">
<column name="GATHERENDD" length="8" />
</property>
<property name="designstate" type="java.lang.String">
<column name="DESIGNSTATE" length="1" />
</property>
<property name="designuserid" type="java.lang.Integer">
<column name="DESIGNUSERID" precision="22" scale="0" />
</property>
<property name="designusername" type="java.lang.String">
<column name="DESIGNUSERNAME" length="10" />
</property>
<property name="designusersuperior" type="java.lang.String">
<column name="DESIGNUSERSUPERIOR" length="10" />
</property>
<property name="designusergroup" type="java.lang.String">
<column name="DESIGNUSERGROUP" length="10" />
</property>
<property name="designuserbranch" type="java.lang.String">
<column name="DESIGNUSERBRANCH" length="10" />
</property>
<property name="designusercpy" type="java.lang.String">
<column name="DESIGNUSERCPY" length="30" />
</property>
<property name="designuserpresident" type="java.lang.String">
<column name="DESIGNUSERPRESIDENT" length="20" />
</property>
<property name="designstart" type="java.util.Date">
<column name="DESIGNSTART" length="7" />
</property>
<property name="designstarty" type="java.lang.String">
<column name="DESIGNSTARTY" length="8" />
</property>
<property name="designstartq" type="java.lang.String">
<column name="DESIGNSTARTQ" length="8" />
</property>
<property name="designstartm" type="java.lang.String">
<column name="DESIGNSTARTM" length="8" />
</property>
<property name="designstartw" type="java.lang.String">
<column name="DESIGNSTARTW" length="8" />
</property>
<property name="designstartd" type="java.lang.String">
<column name="DESIGNSTARTD" length="8" />
</property>
<property name="designend" type="java.util.Date">
<column name="DESIGNEND" length="7" />
</property>
<property name="designendy" type="java.lang.String">
<column name="DESIGNENDY" length="8" />
</property>
<property name="designendq" type="java.lang.String">
<column name="DESIGNENDQ" length="8" />
</property>
<property name="designendm" type="java.lang.String">
<column name="DESIGNENDM" length="8" />
</property>
<property name="designendw" type="java.lang.String">
<column name="DESIGNENDW" length="8" />
</property>
<property name="designendd" type="java.lang.String">
<column name="DESIGNENDD" length="8" />
</property>
<property name="layoutstate" type="java.lang.String">
<column name="LAYOUTSTATE" length="1" />
</property>
<property name="layoutuserid" type="java.lang.Integer">
<column name="LAYOUTUSERID" precision="22" scale="0" />
</property>
<property name="layoutusername" type="java.lang.String">
<column name="LAYOUTUSERNAME" length="10" />
</property>
<property name="layoutusersuperior" type="java.lang.String">
<column name="LAYOUTUSERSUPERIOR" length="10" />
</property>
<property name="layoutusergroup" type="java.lang.String">
<column name="LAYOUTUSERGROUP" length="10" />
</property>
<property name="layoutuserbranch" type="java.lang.String">
<column name="LAYOUTUSERBRANCH" length="10" />
</property>
<property name="layoutusercpy" type="java.lang.String">
<column name="LAYOUTUSERCPY" length="30" />
</property>
<property name="layoutuserpresident" type="java.lang.String">
<column name="LAYOUTUSERPRESIDENT" length="20" />
</property>
<property name="layoutstart" type="java.util.Date">
<column name="LAYOUTSTART" length="7" />
</property>
<property name="layoutstarty" type="java.lang.String">
<column name="LAYOUTSTARTY" length="8" />
</property>
<property name="layoutstartq" type="java.lang.String">
<column name="LAYOUTSTARTQ" length="8" />
</property>
<property name="layoutstartm" type="java.lang.String">
<column name="LAYOUTSTARTM" length="8" />
</property>
<property name="layoutstartw" type="java.lang.String">
<column name="LAYOUTSTARTW" length="8" />
</property>
<property name="layoutstartd" type="java.lang.String">
<column name="LAYOUTSTARTD" length="8" />
</property>
<property name="layoutend" type="java.util.Date">
<column name="LAYOUTEND" length="7" />
</property>
<property name="layoutendy" type="java.lang.String">
<column name="LAYOUTENDY" length="8" />
</property>
<property name="layoutendq" type="java.lang.String">
<column name="LAYOUTENDQ" length="8" />
</property>
<property name="layoutendm" type="java.lang.String">
<column name="LAYOUTENDM" length="8" />
</property>
<property name="layoutendw" type="java.lang.String">
<column name="LAYOUTENDW" length="8" />
</property>
<property name="layoutendd" type="java.lang.String">
<column name="LAYOUTENDD" length="8" />
</property>
<property name="programstate" type="java.lang.String">
<column name="PROGRAMSTATE" length="1" />
</property>
<property name="programuserid" type="java.lang.Integer">
<column name="PROGRAMUSERID" precision="22" scale="0" />
</property>
<property name="programusername" type="java.lang.String">
<column name="PROGRAMUSERNAME" length="10" />
</property>
<property name="programusersuperior" type="java.lang.String">
<column name="PROGRAMUSERSUPERIOR" length="10" />
</property>
<property name="programusergroup" type="java.lang.String">
<column name="PROGRAMUSERGROUP" length="10" />
</property>
<property name="programuserbranch" type="java.lang.String">
<column name="PROGRAMUSERBRANCH" length="10" />
</property>
<property name="programusercpy" type="java.lang.String">
<column name="PROGRAMUSERCPY" length="30" />
</property>
<property name="programuserpresident" type="java.lang.String">
<column name="PROGRAMUSERPRESIDENT" length="20" />
</property>
<property name="programstart" type="java.util.Date">
<column name="PROGRAMSTART" length="7" />
</property>
<property name="programstarty" type="java.lang.String">
<column name="PROGRAMSTARTY" length="8" />
</property>
<property name="programstartq" type="java.lang.String">
<column name="PROGRAMSTARTQ" length="8" />
</property>
<property name="programstartm" type="java.lang.String">
<column name="PROGRAMSTARTM" length="8" />
</property>
<property name="programstartw" type="java.lang.String">
<column name="PROGRAMSTARTW" length="8" />
</property>
<property name="programstartd" type="java.lang.String">
<column name="PROGRAMSTARTD" length="8" />
</property>
<property name="programend" type="java.util.Date">
<column name="PROGRAMEND" length="7" />
</property>
<property name="programendy" type="java.lang.String">
<column name="PROGRAMENDY" length="8" />
</property>
<property name="programendq" type="java.lang.String">
<column name="PROGRAMENDQ" length="8" />
</property>
<property name="programendm" type="java.lang.String">
<column name="PROGRAMENDM" length="8" />
</property>
<property name="programendw" type="java.lang.String">
<column name="PROGRAMENDW" length="8" />
</property>
<property name="programendd" type="java.lang.String">
<column name="PROGRAMENDD" length="8" />
</property>
<property name="uploadstate" type="java.lang.String">
<column name="UPLOADSTATE" length="1" />
</property>
<property name="uploaduserid" type="java.lang.Integer">
<column name="UPLOADUSERID" precision="22" scale="0" />
</property>
<property name="uploadusername" type="java.lang.String">
<column name="UPLOADUSERNAME" length="10" />
</property>
<property name="uploadusersuperior" type="java.lang.String">
<column name="UPLOADUSERSUPERIOR" length="10" />
</property>
<property name="uploadusergroup" type="java.lang.String">
<column name="UPLOADUSERGROUP" length="10" />
</property>
<property name="uploaduserbranch" type="java.lang.String">
<column name="UPLOADUSERBRANCH" length="10" />
</property>
<property name="uploadusercpy" type="java.lang.String">
<column name="UPLOADUSERCPY" length="30" />
</property>
<property name="uploaduserpresident" type="java.lang.String">
<column name="UPLOADUSERPRESIDENT" length="20" />
</property>
<property name="uploadstart" type="java.util.Date">
<column name="UPLOADSTART" length="7" />
</property>
<property name="uploadstarty" type="java.lang.String">
<column name="UPLOADSTARTY" length="8" />
</property>
<property name="uploadstartq" type="java.lang.String">
<column name="UPLOADSTARTQ" length="8" />
</property>
<property name="uploadstartm" type="java.lang.String">
<column name="UPLOADSTARTM" length="8" />
</property>
<property name="uploadstartw" type="java.lang.String">
<column name="UPLOADSTARTW" length="8" />
</property>
<property name="uploadstartd" type="java.lang.String">
<column name="UPLOADSTARTD" length="8" />
</property>
<property name="uploadend" type="java.util.Date">
<column name="UPLOADEND" length="7" />
</property>
<property name="uploadendy" type="java.lang.String">
<column name="UPLOADENDY" length="8" />
</property>
<property name="uploadendq" type="java.lang.String">
<column name="UPLOADENDQ" length="8" />
</property>
<property name="uploadendm" type="java.lang.String">
<column name="UPLOADENDM" length="8" />
</property>
<property name="uploadendw" type="java.lang.String">
<column name="UPLOADENDW" length="8" />
</property>
<property name="uploadendd" type="java.lang.String">
<column name="UPLOADENDD" length="8" />
</property>
<property name="affirmstate" type="java.lang.String">
<column name="AFFIRMSTATE" length="1" />
</property>
<property name="affirmuserid" type="java.lang.Integer">
<column name="AFFIRMUSERID" precision="22" scale="0" />
</property>
<property name="affirmusername" type="java.lang.String">
<column name="AFFIRMUSERNAME" length="10" />
</property>
<property name="affirmusersuperior" type="java.lang.String">
<column name="AFFIRMUSERSUPERIOR" length="10" />
</property>
<property name="affirmusergroup" type="java.lang.String">
<column name="AFFIRMUSERGROUP" length="10" />
</property>
<property name="affirmuserbranch" type="java.lang.String">
<column name="AFFIRMUSERBRANCH" length="10" />
</property>
<property name="affirmusercpy" type="java.lang.String">
<column name="AFFIRMUSERCPY" length="30" />
</property>
<property name="affirmuserpresident" type="java.lang.String">
<column name="AFFIRMUSERPRESIDENT" length="20" />
</property>
<property name="affirmstart" type="java.util.Date">
<column name="AFFIRMSTART" length="7" />
</property>
<property name="affirmstarty" type="java.lang.String">
<column name="AFFIRMSTARTY" length="8" />
</property>
<property name="affirmstartq" type="java.lang.String">
<column name="AFFIRMSTARTQ" length="8" />
</property>
<property name="affirmstartm" type="java.lang.String">
<column name="AFFIRMSTARTM" length="8" />
</property>
<property name="affirmstartw" type="java.lang.String">
<column name="AFFIRMSTARTW" length="8" />
</property>
<property name="affirmstartd" type="java.lang.String">
<column name="AFFIRMSTARTD" length="8" />
</property>
<property name="affirmend" type="java.util.Date">
<column name="AFFIRMEND" length="7" />
</property>
<property name="affirmendy" type="java.lang.String">
<column name="AFFIRMENDY" length="8" />
</property>
<property name="affirmendq" type="java.lang.String">
<column name="AFFIRMENDQ" length="8" />
</property>
<property name="affirmendm" type="java.lang.String">
<column name="AFFIRMENDM" length="8" />
</property>
<property name="affirmendw" type="java.lang.String">
<column name="AFFIRMENDW" length="8" />
</property>
<property name="affirmendd" type="java.lang.String">
<column name="AFFIRMENDD" length="8" />
</property>
<property name="paymentstate" type="java.lang.String">
<column name="PAYMENTSTATE" length="1" />
</property>
<property name="paymentuserid" type="java.lang.Integer">
<column name="PAYMENTUSERID" precision="22" scale="0" />
</property>
<property name="paymentusername" type="java.lang.String">
<column name="PAYMENTUSERNAME" length="10" />
</property>
<property name="paymentusersuperior" type="java.lang.String">
<column name="PAYMENTUSERSUPERIOR" length="10" />
</property>
<property name="paymentusergroup" type="java.lang.String">
<column name="PAYMENTUSERGROUP" length="10" />
</property>
<property name="paymentuserbranch" type="java.lang.String">
<column name="PAYMENTUSERBRANCH" length="10" />
</property>
<property name="paymentusercpy" type="java.lang.String">
<column name="PAYMENTUSERCPY" length="30" />
</property>
<property name="paymentuserpresident" type="java.lang.String">
<column name="PAYMENTUSERPRESIDENT" length="20" />
</property>
<property name="paymentstart" type="java.util.Date">
<column name="PAYMENTSTART" length="7" />
</property>
<property name="paymentstarty" type="java.lang.String">
<column name="PAYMENTSTARTY" length="8" />
</property>
<property name="paymentstartq" type="java.lang.String">
<column name="PAYMENTSTARTQ" length="8" />
</property>
<property name="paymentstartm" type="java.lang.String">
<column name="PAYMENTSTARTM" length="8" />
</property>
<property name="paymentstartw" type="java.lang.String">
<column name="PAYMENTSTARTW" length="8" />
</property>
<property name="paymentstartd" type="java.lang.String">
<column name="PAYMENTSTARTD" length="8" />
</property>
<property name="paymentend" type="java.util.Date">
<column name="PAYMENTEND" length="7" />
</property>
<property name="paymentendy" type="java.lang.String">
<column name="PAYMENTENDY" length="8" />
</property>
<property name="paymentendq" type="java.lang.String">
<column name="PAYMENTENDQ" length="8" />
</property>
<property name="paymentendm" type="java.lang.String">
<column name="PAYMENTENDM" length="8" />
</property>
<property name="paymentendw" type="java.lang.String">
<column name="PAYMENTENDW" length="8" />
</property>
<property name="paymentendd" type="java.lang.String">
<column name="PAYMENTENDD" length="8" />
</property>
<property name="oenddate" type="java.util.Date">
<column name="OENDDATE" length="7" />
</property>
<property name="oenddatey" type="java.lang.String">
<column name="OENDDATEY" length="8" />
</property>
<property name="oenddateq" type="java.lang.String">
<column name="OENDDATEQ" length="8" />
</property>
<property name="oenddatem" type="java.lang.String">
<column name="OENDDATEM" length="8" />
</property>
<property name="oenddatew" type="java.lang.String">
<column name="OENDDATEW" length="8" />
</property>
<property name="oenddated" type="java.lang.String">
<column name="OENDDATED" length="8" />
</property>
<property name="temp1" type="java.lang.String">
<column name="TEMP1" length="20" />
</property>
<property name="temp2" type="java.lang.String">
<column name="TEMP2" length="20" />
</property>
<property name="temp3" type="java.lang.String">
<column name="TEMP3" length="20" />
</property>
<property name="temp4" type="java.lang.String">
<column name="TEMP4" length="20" />
</property>
</class>
</hibernate-mapping>

四.Action
package com.baina.bnoffice.system.order.action;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;
import java.util.Hashtable;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.baina.bnoffice.common.Job2;
import com.baina.bnoffice.common.PageBean;
import com.baina.bnoffice.common.SDate;
import com.baina.bnoffice.common.Tools;
import com.baina.bnoffice.system.order.model.LinkPerson;
import com.baina.bnoffice.system.order.model.Order;
import com.baina.bnoffice.system.order.model.OrderRMB;
import com.baina.bnoffice.system.order.service.IOrderService;
import com.baina.bnoffice.system.task.model.Affix;
import com.baina.bnoffice.system.task.model.Preserve;
import com.baina.bnoffice.system.task.service.IAffairService;
import com.baina.bnoffice.system.task.service.IaffixService;
import com.baina.bnoffice.system.user.model.User;
import com.baina.bnoffice.system.user.service.IUserService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class OrderAction extends ActionSupport {

private HttpServletRequest request = (HttpServletRequest) ActionContext
.getContext().get(ServletActionContext.HTTP_REQUEST);
private IOrderService orderService;
private Order order;
private PageBean pageBean;
private List orders;
private List affixs;
private String page;
private int toid;
private List linkPersons;
private OrderRMB orderRMB;
private LinkPerson jclink;
private LinkPerson fzlink;
private List orderRMBs;
private IAffairService affairService;
private List preserves;
private String areaInfo2;
private String msg;
private Affix affix;
private java.util.List<File> uploads;
private java.util.List<String> uploadsFileName;
private java.util.List<String> uploadsContentType;
private IaffixService affixService;
private String tostate;
private IUserService userService;
private String amount;
private String receipt;
private String cpyname;
private String otype;

/**
* 订单查询
* @return
*/
public String selectAllOrders(){

User user = (User) request.getSession().getAttribute("loginUser");
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();

if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

//获取页面查询条件
String today = request.getParameter("today");
String month = request.getParameter("month");
String year = request.getParameter("year");
String begindate = request.getParameter("begindate");
String enddate = request.getParameter("enddate");
String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");
String douserid = request.getParameter("douserid");

Hashtable hashtable = new Hashtable();

if (today != null && today.trim().length() > 0) {
hashtable.put("today", today);
request.setAttribute("today", today);
}
if (month != null && month.trim().length() > 0) {
hashtable.put("month", month);
request.setAttribute("month", month);
}
if (year != null && year.trim().length() > 0) {
hashtable.put("year", year);
request.setAttribute("year", year);
}
if (begindate != null && begindate.trim().length() > 0) {
hashtable.put("begindate", begindate);
request.setAttribute("begindate", begindate);
}
if (enddate != null && enddate.trim().length() > 0) {
hashtable.put("enddate", enddate);
request.setAttribute("enddate", enddate);
}

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}
if (douserid != null && douserid.trim().length() > 0) {
hashtable.put("douserid", douserid);
request.setAttribute("douserid", douserid);
}

try {
orders = orderService.selectAllOrders(pageBean, hashtable);

} catch (Exception e) {
e.printStackTrace();
}
return "selectAllOrders";
}
/**
* 根据资料收集人用户ID查询任务1
*
* @return
*/
public String listOrder() {
User user = (User) request.getSession().getAttribute("loginUser");
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
System.out.println("++++++++++++++++++++++++++++++++++++++++++user"+user.getUserid());
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String ddText = request.getParameter("ddText");
String ddValue = request.getParameter("ddValue");
String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (ddText != null && ddText.trim().length() > 0) {
hashtable.put("ddText", ddText);
request.setAttribute("ddText", ddText);
}
if (ddValue != null && ddValue.trim().length() > 0) {
hashtable.put("ddValue", ddValue);
request.setAttribute("ddValue", ddValue);
}
if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderCollection(user.getUserid(),
pageBean, hashtable);

} catch (Exception e) {
e.printStackTrace();
}

return "listOrder";
}

/**
*
* 收集人的进行中的任务1
*/
public String listPCollection() throws Exception {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderProgressCollection(user.getUserid(),
pageBean, hashtable);

} catch (Exception e) {
e.printStackTrace();
}

return "listPCollection";
}

/**
* 根据用户id得到资料收集的已完成的订单任务内容1
*
*/
public String listFinishOrder() throws Exception {
User user = (User) request.getSession().getAttribute("loginUser");
System.out.println("++++++++++++++++++++++++++++++++++++++++++user"+user.getUserid());
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();

if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listFinishCollection(user.getUserid(),
pageBean, hashtable);

} catch (Exception e) {
e.printStackTrace();
}
return "listFinishOrder";
}

/**
*收集人接收订单1
*
*/
public String recieveGOrder() throws Exception {
Order order1 = orderService.getOrderById(toid);
Date date = new Date();
order1.setGatherstart(date);
order1.setGatherstartd(SDate.getDay(date));
order1.setGatherstartm(SDate.getMonth(date));
order1.setGatherstartw(SDate.getWeek(date));
order1.setGatherstarty(SDate.getYear(date));
order1.setGatherstate("2");
orderService.updateGatherState(order1);

return listOrder();
}

/**
* 根据设计用户ID查询未接收任务1
*
* @return
*/
public String listOrderDesign() {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderURDesign(user.getUserid(), pageBean,
hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listOrderDesign";
}

/**
*
* 设计的进行中的任务1
*/
public String listPDesign() throws Exception {
User user = (User) request.getSession().getAttribute("loginUser");
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();

if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderProDesign(user.getUserid(),
pageBean, hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listPDesign";
}

/**
* 根据用户id得设计的已完成的订单任务内容1
*
*/
public String listFinishOrderDesign() throws Exception {
User user = (User) request.getSession().getAttribute("loginUser");
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();

if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderDesign(user.getUserid(), pageBean,
hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}
return "listFinishOrderDesign";
}

/**
* 根据布局用户ID查询未接收任务1
*
* @return
*/
public String listOrderLayout() {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderURLayOut(user.getUserid(), pageBean,
hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listOrderLayout";
}

/**
*
* 布局的进行中的任务1
*/
public String listPLayout() throws Exception {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderProLayOut(user.getUserid(),
pageBean, hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listPLayout";
}

/**
* 根据用户id得布局的已完成的订单任务内容1
*
*/
public String listFinishOrderLayOut() throws Exception {

pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderFiLayOut(user.getUserid(), pageBean,
hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}
return "listFinishOrderLayOut";
}

/**
* 根据程序用户ID查询未接收任务1
*
* @return
*/
public String listOrderProgram() {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderURprogram(user.getUserid(),
pageBean, hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listOrderProgram";
}

/**
*
* 程序的进行中的任务1
*/
public String listPProgram() throws Exception {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderProprogram(user.getUserid(),
pageBean, hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listPProgram";
}

/**
* 根据用户id得程序的已完成的订单任务内容1
*
*/
public String listFinishOrderProgram() throws Exception {

pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderprogram(user.getUserid(), pageBean,
hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}
return "listFinishOrderProgram";
}

/**
* 根据资料上传用户ID查询未接收任务1
*
* @return
*/
public String listOrderUpload() {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderURUpload(user.getUserid(), pageBean,
hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listOrderUpload";
}

/**
*
* 资料上传的进行中的任务1
*/
public String listPUpload() throws Exception {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderProUpload(user.getUserid(),
pageBean, hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listPUpload";
}

/**
* 根据用户id得资料上传的已完成的订单任务内容1
*
*/
public String listFinishOrderUpload() throws Exception {

pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderUpload(user.getUserid(), pageBean,
hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}
return "listFinishOrderUpload";
}

/**
* 根据确认用户ID查询未接收任务1
*
* @return
*/
public String listOrderAffirm() {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderURAffirm(user.getUserid(), pageBean,
hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listOrderAffirm";
}

/**
*
* 确认的进行中的任务1
*/
public String listPAffirm() throws Exception {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderProAffirm(user.getUserid(),
pageBean, hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listPAffirm";
}

/**
* 根据用户id得确认的已完成的订单任务内容1
*
*/
public String listFinishOrderAffirm() throws Exception {

pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderAffirm(user.getUserid(), pageBean,
hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}
return "listFinishOrderAffirm";
}

/**
* 根据尾款用户ID查询未接收任务1
*
* @return
*/
public String listOrderPayment() {
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderURPayment(user.getUserid(),
pageBean, hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listOrderPayment";
}

/**
*
* 尾款的进行中的任务1
*/
public String listPPayment() {

pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");
if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderPropayment(user.getUserid(),
pageBean, hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}

return "listPPayment";
}

/**
* 根据用户id得尾款的已完成的订单任务内容1
*
*/
public String listFinishOrderPayment() throws Exception {

pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();
User user = (User) request.getSession().getAttribute("loginUser");

if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listOrderPayment(user.getUserid(), pageBean,
hashtable);
System.out.println(orders.size() + "+++++++++");
} catch (Exception e) {
e.printStackTrace();
}
return "listFinishOrderPayment";
}

/**
* 布局人接收订单2
*
*/
public String recieveLayoutOrder() throws Exception {
Order order1 = orderService.getOrderById(toid);
Date date = new Date();
order1.setLayoutstart(date);
order1.setLayoutstartd(SDate.getDay(date));
order1.setLayoutstartm(SDate.getMonth(date));
order1.setLayoutstartw(SDate.getWeek(date));
order1.setLayoutstarty(SDate.getYear(date));
order1.setLayoutstate("2");
orderService.updateGatherState(order1);

return listOrderLayout();
}

/**
* 设计人接收订单2
*
*/
public String recieveDesignOrder() throws Exception {
Order order1 = orderService.getOrderById(toid);
Date date = new Date();
order1.setDesignstart(date);
order1.setDesignstartd(SDate.getDay(date));
order1.setDesignstartm(SDate.getMonth(date));
order1.setDesignstartw(SDate.getWeek(date));
order1.setDesignstarty(SDate.getYear(date));
order1.setDesignstate("2");
orderService.updateGatherState(order1);

return listOrderDesign();
}

/**
* 程序接收订单2
*
*/
public String recieveProgramOrder() throws Exception {
Order order1 = orderService.getOrderById(toid);
Date date = new Date();
order1.setProgramstart(date);
order1.setProgramstartd(SDate.getDay(date));
order1.setProgramstartm(SDate.getMonth(date));
order1.setProgramstartw(SDate.getWeek(date));
order1.setPaymentstarty(SDate.getYear(date));
order1.setProgramstate("2");
orderService.updateGatherState(order1);

return listOrderProgram();
}

/**
* 资料上传接收订单2
*
*/
public String recieveUploadOrder() throws Exception {
Order order1 = orderService.getOrderById(toid);
Date date = new Date();
order1.setUploadstart(date);
order1.setUploadstartd(SDate.getDay(date));
order1.setUploadstartm(SDate.getMonth(date));
order1.setUploadstartw(SDate.getWeek(date));
order1.setUploadstarty(SDate.getYear(date));
order1.setUploadstate("2");
orderService.updateGatherState(order1);

return listOrderUpload();
}

/**
* 确认人接收订单2
*
*/
public String recieveAffirmOrder() throws Exception {
Order order1 = orderService.getOrderById(toid);
Date date = new Date();
order1.setAffirmstart(date);
order1.setAffirmstartd(SDate.getDay(date));
order1.setAffirmstartm(SDate.getMonth(date));
order1.setAffirmstartw(SDate.getWeek(date));
order1.setAffirmstarty(SDate.getYear(date));
order1.setAffirmstate("2");
orderService.updateGatherState(order1);

return listOrderAffirm();
}

/**
* 崔款人接收订单2
*
*/
public String recievePaymentOrder() throws Exception {
Order order1 = orderService.getOrderById(toid);
Date date = new Date();
order1.setPaymentstart(date);
order1.setPaymentstartd(SDate.getDay(date));
order1.setPaymentstartm(SDate.getMonth(date));
order1.setPaymentstartw(SDate.getWeek(date));
order1.setPaymentstarty(SDate.getYear(date));
order1.setPaymentstate("2");
orderService.updateGatherState(order1);

return listOrderPayment();
}

/**
* 得到详细信息并且跳转至详情
*
* @return
* @throws Exception
*/
public String listURecievedOrder() throws Exception {

preserves = affairService.listPreserve(toid, '2');
affixs = affairService.listAttachment(toid, '2');
orderRMBs = orderService.getOrderRMB(toid);
order = orderService.getOrderById(toid);
linkPersons = orderService.getLikePerson(toid);
for (int i = 0; i < linkPersons.size(); i++) {
LinkPerson lp = (LinkPerson) linkPersons.get(i);
if(lp.getLptype().equals("1")){
jclink = (LinkPerson) linkPersons.get(i);
}
if(lp.getLptype().equals("2")){
fzlink = (LinkPerson) linkPersons.get(i);
}
}
return "listURecievedOrder";
}

/**
* 得到详细信息并且跳转至跟进页面
*
* @return
* @throws Exception
*/
public String listRecievedOrder() throws Exception {
preserves = affairService.listPreserve(toid, '2');
affixs = affairService.listAttachment(toid, '2');
orderRMBs = orderService.getOrderRMB(toid);
order = orderService.getOrderById(toid);
linkPersons = orderService.getLikePerson(toid);
for (int i = 0; i < linkPersons.size(); i++) {
LinkPerson lp = (LinkPerson) linkPersons.get(i);
if(lp.getLptype().equals("1")){
jclink = (LinkPerson) linkPersons.get(i);
}
if(lp.getLptype().equals("2")){
fzlink = (LinkPerson) linkPersons.get(i);
}
}
return "listRecievedOrder";
}

/**
*
*添加跟进信息
*
* @return
*/
public String addOrderPreserve() throws Exception {

Date date = new Date();
Preserve pres = new Preserve();
pres.setPerdate(date);
pres.setTaid(toid);
pres.setPrecontent(areaInfo2);
pres.setTaptype("2");
User user=(User)request.getSession().getAttribute("loginUser");
pres.setPreuserid(user.getUserid());
pres.setPreuser(user.getUname());
pres.setPreuserbranch(user.getBranch());
pres.setPreusergroup(user.getUgroup());
// pres.setPreusercpy(user.getCpy());
affairService.addPreserve(pres);
msg = "^-^跟进内容添加成功";
return listRecievedOrder();
}

/**
*得到详细信息并且跳转至提交页面
*
* @return
* @throws Exception
*/
public String commitOrderPreserve() throws Exception {
// if(otype.equals("1")){
// List list = null;
// try {
// list = orderService.getOrderRMB(toid);
// } catch (Exception e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
// if(list!=null){
// int tag = 0;
// for (int i = 0; i < list.size(); i++) {
// if(((OrderRMB)list.get(i)).getFundtype().equals("3")){
// tag=1;
// }
// }
// if(tag==0){
// msg = "请先添加尾款信息再提交!";
// return listPPayment();
// }
// }
// }
preserves = affairService.listPreserve(toid, '2');
affixs = affairService.listAttachment(toid, '2');
orderRMBs = orderService.getOrderRMB(toid);
order = orderService.getOrderById(toid);
linkPersons = orderService.getLikePerson(toid);
for (int i = 0; i < linkPersons.size(); i++) {
LinkPerson lp = (LinkPerson) linkPersons.get(i);
if(lp.getLptype().equals("1")){
jclink = (LinkPerson) linkPersons.get(i);
}
if(lp.getLptype().equals("2")){
fzlink = (LinkPerson) linkPersons.get(i);
}
}
return "commitOrderPreserve";
}

/**
* 订单任务完成提交
*
* @return
*/
public String commit() throws Exception {

Preserve pres = new Preserve();
pres.setPerdate(new Date());
pres.setTaid(toid);
pres.setPrecontent(areaInfo2);
pres.setTaptype("2");
User user=(User)request.getSession().getAttribute("loginUser");
pres.setPreuserid(user.getUserid());
pres.setPreuser(user.getUname());
pres.setPreuserbranch(user.getBranch());
pres.setPreusergroup(user.getUgroup());
// pres.setPreusercpy(user.getCpy());
affairService.addPreserve(pres);

int i = Integer.parseInt(tostate.trim())+ 1;

Order order1=new Order();
order1 = orderService.getOrderById(toid);

if(otype.equals("1")) {
if (i == 3) {
order1.setTostate("3");
order1.setDesignstate("0");
order1.setGatherstate("1");
SDate.setDismantleDate(order1, "gatherend", new Date());
User u=userService.getById(order1.getDesignuserid());
//发送邮件至责任人邮箱
if(u.getEmail()!=null&&!u.getEmail().equals("")){
String content = "亲爱的<font color=\"#660000\">"+u.getUname()+"</font>:<br>";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您有未接单的订单任务需要处理,请尽快登陆事务系统";
content += "订单信息如下:<br><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" style=\"font-size:12px\"><tr><td bgcolor=\"#CCCCCC\">&nbsp;&nbsp;&nbsp;";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单号"+order1.getTonum()+"&nbsp&nbsp公司"+order1.getCpyname()+"</td></tr><tr><td>任务类型:设计</td></tr></table><br /><font color=\"#CCCCCC\">福建百纳在线网络技术有限公司 技术部<br /></font>";
Tools.sendMail(u.getEmail(), order1.getTonum(), content);
}
System.out.println("发送事务提醒邮件到邮箱:" +u.getEmail());

}
if (i == 4) {
order1.setTostate("4");
order1.setLayoutstate("0");
order1.setDesignstate("1");
SDate.setDismantleDate(order1, "designend", new Date());
User u=userService.getById(order1.getLayoutuserid());
//发送邮件至责任人邮箱
if(u.getEmail()!=null&&!u.getEmail().equals("")){
String content = "亲爱的<font color=\"#660000\">"+u.getUname()+"</font>:<br>";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您有未接单的订单任务需要处理,请尽快登陆建站订单系统";
content += "订单信息如下:<br><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" style=\"font-size:12px\"><tr><td bgcolor=\"#CCCCCC\">&nbsp;&nbsp;&nbsp;";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单号"+order1.getTonum()+"&nbsp&nbsp公司"+order1.getCpyname()+"</td></tr><tr><td>任务类型:布局</td></tr></table><br /><font color=\"#CCCCCC\">福建百纳在线网络技术有限公司 技术部<br /></font>";
Tools.sendMail(u.getEmail(), order1.getTonum(), content);
}
System.out.println("发送建站订单提醒邮件到邮箱:" +u.getEmail());

}
if (i == 5) {

order1.setTostate("5");
order1.setProgramstate("0");
order1.setLayoutstate("1");
SDate.setDismantleDate(order1, "layoutend", new Date());
User u=userService.getById(order1.getProgramuserid());
//发送邮件至责任人邮箱
if(u.getEmail()!=null&&!u.getEmail().equals("")){
String content = "亲爱的<font color=\"#660000\">"+u.getUname()+"</font>:<br>";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您有未接单的订单任务需要处理,请尽快登陆建站订单系统";
content += "订单信息如下:<br><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" style=\"font-size:12px\"><tr><td bgcolor=\"#CCCCCC\">&nbsp;&nbsp;&nbsp;";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单号"+order1.getTonum()+"&nbsp&nbsp公司"+order1.getCpyname()+"</td></tr><tr><td>任务类型:程序</td></tr></table><br /><font color=\"#CCCCCC\">福建百纳在线网络技术有限公司 技术部<br /></font>";
Tools.sendMail(u.getEmail(), order1.getTonum(), content);
}
System.out.println("发送建站订单提醒邮件到邮箱:" +u.getEmail());

}
if (i == 6) {
order1.setTostate("6");
order1.setUploadstate("0");
order1.setProgramstate("1");
SDate.setDismantleDate(order1, "programend", new Date());
User u=userService.getById(order1.getUploaduserid());
//发送邮件至责任人邮箱
if(u.getEmail()!=null&&!u.getEmail().equals("")){
String content = "亲爱的<font color=\"#660000\">"+u.getUname()+"</font>:<br>";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您有未接单的订单任务需要处理,请尽快登陆建站订单系统";
content += "订单信息如下:<br><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" style=\"font-size:12px\"><tr><td bgcolor=\"#CCCCCC\">&nbsp;&nbsp;&nbsp;";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单号"+order1.getTonum()+"&nbsp&nbsp公司"+order1.getCpyname()+"</td></tr><tr><td>任务类型:</td></tr></table><br /><font color=\"#CCCCCC\">福建百纳在线网络技术有限公司 技术部<br /></font>";
Tools.sendMail(u.getEmail(), order1.getTonum(), content);
}
System.out.println("发送建站订单提醒邮件到邮箱:" +u.getEmail());

}

if (i == 7) {
order1.setTostate("7");
order1.setAffirmstate("0");
order1.setUploadstate("1");
SDate.setDismantleDate(order1, "uploadend", new Date());
User u=userService.getById(order1.getAffirmuserid());
//发送邮件至责任人邮箱
if(u.getEmail()!=null&&!u.getEmail().equals("")){
String content = "亲爱的<font color=\"#660000\">"+u.getUname()+"</font>:<br>";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您有未接单的订单任务需要处理,请尽快登陆建站订单系统";
content += "订单信息如下:<br><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" style=\"font-size:12px\"><tr><td bgcolor=\"#CCCCCC\">&nbsp;&nbsp;&nbsp;";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单号"+order1.getTonum()+"&nbsp&nbsp公司"+order1.getCpyname()+"</td></tr><tr><td>任务类型:</td></tr></table><br /><font color=\"#CCCCCC\">福建百纳在线网络技术有限公司 技术部<br /></font>";
Tools.sendMail(u.getEmail(), order1.getTonum(), content);
}
System.out.println("发送建站订单提醒邮件到邮箱:" +u.getEmail());

}
if (i ==s2sh调整带有配置文件
{
order1.setTostate("8");
order1.setPaymentstate("0");
order1.setAffirmstate("1");
SDate.setDismantleDate(order1, "affirmend", new Date());
User u=userService.getById(order1.getPaymentuserid());
//发送邮件至责任人邮箱
if(u.getEmail()!=null&&!u.getEmail().equals("")){
String content = "亲爱的<font color=\"#660000\">"+u.getUname()+"</font>:<br>";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您有未接单的订单任务需要处理,请尽快登陆建站订单系统";
content += "订单信息如下:<br><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" style=\"font-size:12px\"><tr><td bgcolor=\"#CCCCCC\">&nbsp;&nbsp;&nbsp;";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单号"+order1.getTonum()+"&nbsp&nbsp公司"+order1.getCpyname()+"</td></tr><tr><td>任务类型:</td></tr></table><br /><font color=\"#CCCCCC\">福建百纳在线网络技术有限公司 技术部<br /></font>";
Tools.sendMail(u.getEmail(), order1.getTonum(), content);
}
System.out.println("发送建站订单提醒邮件到邮箱:" +u.getEmail());
}
if (i >s2sh调整带有配置文件
{
order1.setTostate("9");
order1.setPaymentstate("1");
SDate.setDismantleDate(order1, "paymentend", new Date());
SDate.setDismantleDate(order1, "oenddate", new Date());

}
} else if(otype.equals("0")){
if (i == 5) {
order1.setTostate("5");
order1.setProgramstate("0");
order1.setLayoutstate("1");
SDate.setDismantleDate(order1, "layoutend", new Date());
User u=userService.getById(order1.getProgramuserid());
//发送邮件至责任人邮箱
if(u.getEmail()!=null&&!u.getEmail().equals("")){
String content = "亲爱的<font color=\"#660000\">"+u.getUname()+"</font>:<br>";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您有未接单的订单任务需要处理,请尽快登陆建站订单系统";
content += "订单信息如下:<br><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" style=\"font-size:12px\"><tr><td bgcolor=\"#CCCCCC\">&nbsp;&nbsp;&nbsp;";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单号"+order1.getTonum()+"&nbsp&nbsp公司"+order1.getCpyname()+"</td></tr><tr><td>任务类型:程序</td></tr></table><br /><font color=\"#CCCCCC\">福建百纳在线网络技术有限公司 技术部<br /></font>";
Tools.sendMail(u.getEmail(), order1.getTonum(), content);
}
System.out.println("发送建站订单提醒邮件到邮箱:" +u.getEmail());

}
if (i == 6) {
order1.setTostate("6");
order1.setUploadstate("0");
order1.setProgramstate("1");
SDate.setDismantleDate(order1, "programend", new Date());
User u=userService.getById(order1.getUploaduserid());
//发送邮件至责任人邮箱
if(u.getEmail()!=null&&!u.getEmail().equals("")){
String content = "亲爱的<font color=\"#660000\">"+u.getUname()+"</font>:<br>";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您有未接单的订单任务需要处理,请尽快登陆建站订单系统";
content += "订单信息如下:<br><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" style=\"font-size:12px\"><tr><td bgcolor=\"#CCCCCC\">&nbsp;&nbsp;&nbsp;";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单号"+order1.getTonum()+"&nbsp&nbsp公司"+order1.getCpyname()+"</td></tr><tr><td>任务类型:</td></tr></table><br /><font color=\"#CCCCCC\">福建百纳在线网络技术有限公司 技术部<br /></font>";
Tools.sendMail(u.getEmail(), order1.getTonum(), content);
}
System.out.println("发送建站订单提醒邮件到邮箱:" +u.getEmail());

}

if (i == 7) {
order1.setTostate("7");
order1.setAffirmstate("0");
order1.setUploadstate("1");
SDate.setDismantleDate(order1, "uploadend", new Date());
User u=userService.getById(order1.getAffirmuserid());
//发送邮件至责任人邮箱
if(u.getEmail()!=null&&!u.getEmail().equals("")){
String content = "亲爱的<font color=\"#660000\">"+u.getUname()+"</font>:<br>";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您有未接单的订单任务需要处理,请尽快登陆建站订单系统";
content += "订单信息如下:<br><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" style=\"font-size:12px\"><tr><td bgcolor=\"#CCCCCC\">&nbsp;&nbsp;&nbsp;";
content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单号"+order1.getTonum()+"&nbsp&nbsp公司"+order1.getCpyname()+"</td></tr><tr><td>任务类型:</td></tr></table><br /><font color=\"#CCCCCC\">福建百纳在线网络技术有限公司 技术部<br /></font>";
Tools.sendMail(u.getEmail(), order1.getTonum(), content);
}
System.out.println("发送建站订单提醒邮件到邮箱:" +u.getEmail());

}

if (i ==s2sh调整带有配置文件
{
order1.setTostate("a");
//order1.setPaymentstate("0");
order1.setAffirmstate("1");
SDate.setDismantleDate(order1, "affirmend", new Date());
SDate.setDismantleDate(order1, "oenddate", new Date());
}
}

orderService.updateOrderState(order1);
upload(toid);
if (i == 3) {
return listFinishOrder();
}
if (i == 4) {
return listFinishOrderDesign();
}
if (i == 5) {
return listFinishOrderLayOut();
}
if (i == 6) {
return listFinishOrderProgram();
}
if (i == 7) {
return listFinishOrderUpload();
}
if (i ==s2sh调整带有配置文件
{
return listFinishOrderAffirm();
}
else {
return listFinishOrderPayment();
}

}

public void upload(int id) {
String curDate = Tools.getTime("yyyyMMdd");
String path = "E:\\upload\\" + curDate;// 保存路径
File file = new File(path);
if (!file.exists()) {
file.mkdirs();
}
if (uploads != null) {
for (int i = 0; i < uploads.size(); i++) {
java.io.InputStream is;
try {
String curTime = Tools.getTime("yyyyMMddHHmmss");
is = new java.io.FileInputStream(uploads.get(i));

java.io.OutputStream os = new java.io.FileOutputStream(path
+ "\\" + curTime + "_" + uploadsFileName.get(i));
byte buffer[] = new byte[8192];
int count = 0;
while ((count = is.read(buffer)) > 0) {
os.write(buffer, 0, count);
}
os.close();
is.close();

// 附件对象
Affix affix = new Affix();
affix.setAffixtype("2");
affix.setAttid(id);// 所属事务ID
affix.setAffixtitle(uploadsFileName.get(i));
affix.setAffixurl(path + "\\" + curTime + "_"
+ uploadsFileName.get(i));
affixService.saveAffix(affix);

} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}

/**
* 通过toid查询出订单的详细信息跳转至尾款添加
*
*/
public String listPaymentMessage(){
List list = null;
try {
list = orderService.getOrderRMB(toid);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if(list!=null){
for (int i = 0; i < list.size(); i++) {
if(((OrderRMB)list.get(i)).getFundtype().equals("3")){
msg = "已添加过尾款信息!";
return listPPayment();
}
}
}

try {
order=orderService.getOrderById(toid);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

return "listPaymentMessage";
}

/**
* 添加尾款
* @return
*/
public String addPament() {

User user=(User) request.getSession().getAttribute("loginUser");
orderRMB.setPayeeuserid(user.getUserid());
orderRMB.setPayeeuserbranch(user.getBranch());
orderRMB.setPayeeusercpy(user.getCpy());
orderRMB.setPayeeusergroup(user.getUgroup());
orderRMB.setPayeeusername(orderRMB.getPayeeusername());
orderRMB.setPayeeuserpresident(user.getPresident());
orderRMB.setOrdertype("2");
orderRMB.setFundtype("3");

//设置款项信息
if(orderRMB.getCollectiondate()!=null){
SDate.setDismantleDate(orderRMB, "collectiondate",orderRMB.getCollectiondate());
}
//保存款项
orderService.addOrderRMB(orderRMB);
return listPPayment();
}

/**
* 根据userid 获得下单的订单信息
* @return
*/
public String listAllOrderes() {

User user = (User) request.getSession().getAttribute("loginUser");
pageBean = PageBean.getPageInfo(request);
int page = pageBean.getPage();

if (request.getParameter("page") != null
&& !request.getParameter("page").equals("")) {
page = Integer.valueOf(request.getParameter("page"));
pageBean.setPage(page);
}

String cpy = request.getParameter("cpy");
String otype = request.getParameter("otype");

Hashtable hashtable = new Hashtable();

if (cpy != null && cpy.trim().length() > 0) {
hashtable.put("cpy", cpy);
request.setAttribute("cpy", cpy);
}
if (otype != null && otype.trim().length() > 0) {
hashtable.put("otype", otype);
request.setAttribute("otype", otype);
}

try {
orders = orderService.listAllOrdersByUserId(user.getUserid(), pageBean, hashtable);

} catch (Exception e) {
e.printStackTrace();
}
return "listAllOrderes";

}
public IOrderService getOrderService() {
return orderService;
}

public void setOrderService(IOrderService orderService) {
this.orderService = orderService;
}

public Order getOrder() {
return order;
}

public void setOrder(Order order) {
this.order = order;
}

public HttpServletRequest getRequest() {
return request;
}

public void setRequest(HttpServletRequest request) {
this.request = request;
}

public PageBean getPageBean() {
return pageBean;
}

public void setPageBean(PageBean pageBean) {
this.pageBean = pageBean;
}

public List getOrders() {
return orders;
}

public void setOrders(List orders) {
this.orders = orders;
}

public String getPage() {
return page;
}

public void setPage(String page) {
this.page = page;
}

public int getToid() {
return toid;
}

public void setToid(int toid) {
this.toid = toid;
}

public List getLinkPersons() {
return linkPersons;
}

public void setLinkPersons(List linkPersons) {
this.linkPersons = linkPersons;
}

public OrderRMB getOrderRMB() {
return orderRMB;
}

public void setOrderRMB(OrderRMB orderRMB) {
this.orderRMB = orderRMB;
}

public List getOrderRMBs() {
return orderRMBs;
}

public void setOrderRMBs(List orderRMBs) {
this.orderRMBs = orderRMBs;
}

public IAffairService getAffairService() {
return affairService;
}

public void setAffairService(IAffairService affairService) {
this.affairService = affairService;
}

public List getPreserves() {
return preserves;
}

public void setPreserves(List preserves) {
this.preserves = preserves;
}

public String getAreaInfo2() {
return areaInfo2;
}

public void setAreaInfo2(String areaInfo2) {
this.areaInfo2 = areaInfo2;
}

public String getMsg() {
return msg;
}

public void setMsg(String msg) {
this.msg = msg;
}

public Affix getAffix() {
return affix;
}

public void setAffix(Affix affix) {
this.affix = affix;
}

public java.util.List<File> getUploads() {
return uploads;
}

public void setUploads(java.util.List<File> uploads) {
this.uploads = uploads;
}

public java.util.List<String> getUploadsFileName() {
return uploadsFileName;
}

public void setUploadsFileName(java.util.List<String> uploadsFileName) {
this.uploadsFileName = uploadsFileName;
}

public java.util.List<String> getUploadsContentType() {
return uploadsContentType;
}

public void setUploadsContentType(java.util.List<String> uploadsContentType) {
this.uploadsContentType = uploadsContentType;
}

public IaffixService getAffixService() {
return affixService;
}

public void setAffixService(IaffixService affixService) {
this.affixService = affixService;
}

public String getTostate() {
return tostate;
}

public void setTostate(String tostate) {
this.tostate = tostate;
}
public String getAmount() {
return amount;
}

public void setAmount(String amount) {
this.amount = amount;
}

public String getReceipt() {
return receipt;
}

public void setReceipt(String receipt) {
this.receipt = receipt;
}

public IUserService getUserService() {
return userService;
}
public void setUserService(IUserService userService) {
this.userService = userService;
}

public String getOtype() {
return otype;
}

public void setOtype(String otype) {
this.otype = otype;
}
public LinkPerson getJclink() {
return jclink;
}

public void setJclink(LinkPerson jclink) {
this.jclink = jclink;
}

public LinkPerson getFzlink() {
return fzlink;
}

public void setFzlink(LinkPerson fzlink) {
this.fzlink = fzlink;
}
public List getAffixs() {
return affixs;
}

public void setAffixs(List affixs) {
this.affixs = affixs;
}
}

相关文章
  • s2sh调整带有配置文件 s2sh调整带有配置文件

    s2sh整合带有配置文件 <1>applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop

  • 转:hibernate+Spring学习】S2SH调整笔记-中文乱码

    转:hibernate+Spring学习]S2SH整合笔记--中文乱码 hibernate+Spring学习]S2SH整合笔记--中文乱码 (2008-11-20 14:23:32) 转载 标签: 杂谈 分类: Java ssh2+mysql中文乱码解决方法(统一使用UTF-8编码) 中文乱码,首先要区分是页面乱码.action乱码,还是数据库乱码.大致的原理是java使用unicode编码– >window使用gbk(gb2312的扩展集)–mysql默认使用utf-8(unicode的一种编

  • s2sh调整

    s2sh整合 最近的struts2-hibernate -spring整合开发 1.简单讲解spring和struts2整合 首先导入struts的jar,hibernate的jar,spring的jar,数据库的驱动包XX.jar放入lib包中. 接下来编写实体类 User.java package com.s2sh.mobel; import java.io.Serializable; public class User implements Serializable{ private st

  • S2SH调整级联删除

    S2SH整合级联删除 级联删除 最近正忙于 s2sh 项目的后台功能的实现,后台功能已基本实现,今天周末,闲来无事,给大家晒晒我写的级联删除,在写之前就被这四个字吓到了,还以为有多难,实现之后才知道也不过如此,也许还有更难的级联删除操作,不过暂时我还没有遇到 . 我喜欢用实例来阐述,这样说的明白,又容易理解.以订单为例我们来实现级联删除,首先我们先分析一下各个表之间的关系.. Orders( 订单表 ) 的字段如下: payments,employees,customers,number,rda

  • S2SH调整修改

    S2SH整合修改 S2SH修改整合修改操作 其实我并不认为这就是级联修改,它只涉及到一个表的改动并未涉及到其他的表,我认为级联操作是涉及到多个表的操作.在这里我勉强地称之为级联修改. Domain中的方法: public class Orders implements java.io.Serializable { /** * @author DXL_xiaoli */ private static final long serialVersionUID = 1L; //递增序列 private

  • s2sh调整(详细版)

    s2sh整合(详细版) 具体请点击:http://www.verydemo.com/demo_c143_i24269.html 创建项目s2sh 添加Hibernate 3.2 默认就可以,不要忘记将jar包加入到/WebRoot/WEB-INF/lib 接着next 实际上这里的hibernate.cfg.xml不起作用,因为该配置文件的内容由后面的spring配置文件进行管理,我们可以在创建之后将其删除 默认next 我们根本不用hibernate.cfg.xml,所以这里根本不需要进行数据

  • S2SH调整页面报错的解决方案

    S2SH整合页面报错的解决方案 图片是报错信息... 解决方案:由于struts2整合spring时,把所有的bean都交给了spring管理,当请求的action名和action同名时,如果action中有与之同名的属性时.spring会自动的把action名注入到属性中.主要是struts2-spring-plugin-2.2.1.1.jar这个jar引起的原因.解决办法:可以把action的名字或者action类中的属性名改掉基本就可以了,再解决不了的话就不用spring来注入

  • S2SH调整一&lt;所需JAR包&gt

    S2SH整合一<所需JAR包> 1.struts 2.x .spring 3.x .hibernate 3.x 开源框架jar包准备 struts 2.x struts2-core-2.1.6.jar freemarker-2.3.13.jar commons-logging.jar ognl-2.6.11.jar xwork-2.1.2.jar commons-fileupload.jar struts2-spring-plugin-2.0.11.1.jar hibernate 3.x Hb

  • spring+Jpa(hibernate)调整 初始化配置文件后 不会根据映射文件生成对应的数据库

    spring+Jpa(hibernate)整合 初始化配置文件后 不会根据映射文件生成对应的数据库 @Test public void save(){ new ClassPathXmlApplicationContext("beans.xml"); } 我是通过 单元测试 来初始化的 分享到: ------解决方案-------------------- 库要自己创建,表会自动生成.

  • s2sh调整 web.xml基础

    s2sh整合 web.xml基础 1.web.xml 基本的 <!--读取applicationContxt-*.xml文件::获得spring 的文件--> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/classes/applicationContext.xml </param-value> </co

  • S2SH调整JQuery+Ajax实现登录验证功能

    S2SH整合JQuery+Ajax实现登录验证功能 不多说了,上码 action package com.lk.action; import javax.annotation.Resource; import com.googlecode.jsonplugin.annotations.JSON; import com.lk.service.StudentControl; import com.opensymphony.xwork2.ActionSupport; public class Logi

  • s2sh调整中模糊查询功能实现

    s2sh整合中模糊查询功能实现 s2sh整合中模糊查询功能实现 上一篇文章我介绍了精确查询的操作实现,这篇文章我继续介绍模糊查询,其实精确查询与模糊查询大同小异,基本思路是一致的,只是操作语句有所改变.但在这里我并没有用到上篇中的form表单提交,而是使用的Jquery的ajax请求操作.下面我还是以实例案例来介绍. misty to search.jsp <%@ page language="java" import="java.util.*" pageEn

  • S2SH调整模版(强烈推荐)

    S2SH整合模版(强烈推荐) http://download.csdn.net/detail/jiangzaifu/4411331

  • s2sh调整完毕全代码+lib

    s2sh整合完毕全代码+lib s2sh整合完毕

  • s2sh调整中精确查询功能实现

    s2sh整合中精确查询功能实现 s2sh整合中精确查询功能实现 目前我正在做使用struts2,spring,hibernate三大框架的项目,在这个开发过程中我需要写一个根据条件进行查询功能,在此我将条件查询分为精确查询和模糊查询. 精确查询是指根据某一个数据库已存在的值进行查询,例如根据用户的名字进行查询 模糊查询是指根据某个字段的某个字母或数字进行查询,例如根据用户的名字当中的某个字进行查询.首先我们需要搭建开发环境,引入一些必要的类库等操作.由于我主要想介绍根据条件查询的操作,所以搭建开

  • s2sh调整所有jar包以及json整合

    s2sh整合所有jar包以及json整合 s2sh整合所有jar包以及json整合jar下载 详细配置..... ------------------------------- 后补jar包:common-annotations.jar 主要是spring注解使用

  • 8 核 32 内存服务器 lnmp 如何优化配置文件可以避免访问高峰期频繁 502?

    如题, 是一个 wordpress 图片站, 日均 ip1.5w, pv20w 左右 同时在线 500 人左右 就会频繁 502 cpu 达到 load average: 15.04, 15.60, 14.93 cpu 是 Intel(R) Xeon(R) CPU E3-1270 v3 @ 3.50GHz 8 核心独立服务器 内存 32GB 装有 wp-super cache 缓存插件 cengos 7 64 位, nginx mysql pphp 版本都是目前最新的稳定版. 用的是 lnmp

  • 怎么动态加载更新的配置文件

    如何动态加载更新的配置文件 当WEB应用在运行时,修改一个类只需将class文件替换就可以. 但对于XML配置文件(如spring/struts的配置),由于不是动态加载,通常的方法是重新启动应用.由于应用在调整,配置文件变新会比较频繁,这样重启对于正式上线的网站是很难接受的. 在网上搜了很久也没找到好的办法,不知大家有何建议? ------解决方案-------------------- 你们没有测试环境吗?不会把客户的空间当作测试环境吧-.- 全部测试更新完毕了再放上去 ------解决方案

  • 小规模低性能低流量网站设计原则 小规模低性能低流量网站设计原则

    偶然看到以前写过的这篇帖子<小规模低性能低流量网站设计原则> ,重新发到微博上引起了一点反响,觉得有必要以 Linode VPS 为例再做个简单的优化实践说明,免得总有人问我,也顺便赚点点击量. 假定现在你已经有了一个基本的 VPS 可用,基本内存 512MB .参考官方提供的各种安装指导将 LAMP 这个组合运行了起来,操作系统一般 Ubuntu ,Web 服务器 Apache ,数据库 MySQL ,然后是 PHP ,以及需要安装的应用软件,WordPress .Drupal 或是 Ope

  • Tuning Linode VPS-小规模低性能低流量网站优化实践 Tuning Linode VPS-小规模低性能低流量网站优化实践

    偶然看到以前写过的这篇帖子<小规模低性能低流量网站设计原则> ,重新发到微博上引起了一点反响,觉得有必要以 Linode VPS 为例再做个简单的优化实践说明,免得总有人问我,也顺便赚点点击量. 假定现在你已经有了一个基本的 VPS 可用,基本内存 512MB .参考官方提供的各种安装指导将 LAMP 这个组合运行了起来,操作系统一般 Ubuntu ,Web 服务器 Apache ,数据库 MySQL ,然后是 PHP ,以及需要安装的应用软件,WordPress .Drupal 或是 Ope

最新文章
  • 身体及秀发免费变美妙计 身体及秀发免费变美妙计

    不必大把花钱购置新货.只需一点小心思并持之以恒,你可以不花分文就变美. SKIN CARE护肤篇 保湿乳按摩活肤:不一定非要购买按摩霜来做按摩.英国面部美容师Nicholas Josse建议,每天涂抹保湿乳或乳霜的时间正是最好的肌肤按摩时机.涂上平日使用的保湿霜后,用指腹画圈按摩脸部肌肤数分钟,就能有效促进肌肤的胶原生成并加强肌肤弹力,令肌肤更具光泽. 冰镇眼部啫喱:不妨长期将眼部喱存放在冰箱中,在眼部浮肿或水分积聚严重时取出涂抹敷眼,更快速地为眼部肌肤降温,迅速渗透并舒缓滋润眼部肌肤,改善眼部

  • 谈面试经验

    1.面试前,你应当知道你即将接受面试的这家公司的基本情况. 2.从打电话预约面试开始,公司即开始考核求职者的表现,因此,以良好的态度询问可望予人留下较佳的印象. 3.面试的着装和仪容仪表要注意,注意你去的公司的要求,一般的要穿正装,不要轻易听信一些不确定的介绍.有的求职者就是看到一篇文章谈到网络公司员工都穿着随便,因而刻意打扮得很休闲,引起面试者的误解,而失去了工作的机会. 4.面试中,不要滔滔不绝地说,注意聆听,在回答问题时,要掌握好时间.自我介绍时要切合主题,并掌握几个具体要点如:人际关系.

  • 携程又一程

    3月7日,前携程投资者关系总监魏裕将自己的办公室从携程大楼里迁出,跟着她一起"出走"的还有300多名来自携程各个部门的员工. 别紧张,这并不是一场人事地震. 半个月以前,这家公司刚刚发布了自己的2010年财报.这份财报中,携程旅游度假业务正迎来最好的时期.它的全年业务营收3.8亿元人民币,占携程整体营收的12%-自2004年以来,这一比例第一次达到了两位数. 2010年全年增长了108%的旅游度假已成为携程增长最快的业务.在携程公司内部,CEO范敏将此形容为携程的"第二程&q

  • mac怎么玩qq游戏? mac怎么玩qq游戏?

    打开浏览器,输入"QQ游戏网页版",出来的第一条--web.3366.com,即是QQ游戏网页版本.打开之后你会发现很多在QQ游戏大厅当中有玩的游,例如欢乐斗地主.换了斗牛.英雄杀.保皇党等等都有哦! 登陆你的账号,随便选择一款游戏进入,例如--换了斗地主,点击开始,你就会察觉到 Mac 用户终于也能玩QQ游戏啦!虽然界面丑了点没有QQ游戏大厅这么美观,但是好歹能玩是吧!顾不上这么多了. 注:更多精彩教程请关注本站电脑教程栏目,本站电脑办公群:189034526欢迎你的加入

  • 优化Oracle索引 提高关联查询性能

    数据库性能优化是无止境的,无论哪种优化技术只是一种手段,但最重要的不是技术,而是思想,掌握了索引优化技术仅仅刚入门,只有融会贯通,举一反三才能成为高手. 本文引用一套实验室信息管理系统(LIS)使用的数据库,假设我们要查询2008年11月做检验的患者记录,条件是大于80岁,姓周的患者,最终结果按检查日期进行倒序排列.要使用的表有三个: ◆lis_report:报告主表,我们要用到的字段包括i_checkno(检查号),d_checkdate(检查日期),i_patientid(患者ID): ◆c

  • Jquery中$.ajax $.post load用法与区别

    在jquery中我们要实现无刷新页面可以使用有$.ajax $.post $(\'#xxx\').load(url,para)三个函数来实现,那么他三个的具体用法与区别是什么呢,下面我来一一介绍. $.ajax用法 代码如下 复制代码 function getVerify(){ if($('#regRuser').val()){ var m=$('#regRuser').val(); if(/^13d{9}$/g.test(m)||(/^15[0-35-9]d{8}$/g.test(m))||

  • 请问一个编码转换有关问题

    请教一个编码转换问题 我在linux下用g++编译一个文件,希望将一个字符串从utf8编码的文本中读出来,然后将其中的半角字符转化为全角字符,然后输出出来转化后的字符串.我的程序这么写的: string doRegularization(string& strIn) { string strNew = " "; for(int i = 0; i < strIn.length();i++) { char c = strIn[i]; if(c > ' ' &&a

  • Javascript学习笔记(3)基本概念

    Javascript学习笔记(三)基本概念 本篇主要总结<Javascript高级程序设计(第三版)>第三章基本概念中的ECMAScript(以下简称ES)语言核心. ES推荐标识符命名采用驼峰式. ES第五版引入了严格模式,严格模式需要在JS文件顶部或者函数内部第一行添加"use strict"这条编译指示开启.在严格模式下,很多JS中不确定的或者说不安全的操作将会报错. ES中变量用var跟变量名来声明,默认情况下赋值undefined.如果声明变量的同时不用var关键

  • mybatis 多对多照射关系 mybatis 多对多照射关系

    mybatis 多对多映射关系 xml映射文件:一个用户对应多个订单,一个订单对应多个订单明细,一个订单明细对应一个商品 可以推断出用户和商品是多对多的关系用户和商品的关系分析 可以发现一层套一层... <!-- #######################################多对多的关系映射####################################################### --> <resultMap type="cn.itcast.

  • 为什么是先inherited再赋值?高手帮忙看看解决思路

    为什么是先inherited再赋值?高手帮忙看看 今天看个改变程序类名的例子程序,有个疑问: procedure TForm1.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); Params.WinClassName := MYAPPNAME; end; 这段程序中为什么先inherited后才改变WinClassName呢? 这样调用CreateParams类名不是还没改变吗?但测试结果

热门推荐
  • 绝无仅有!33张你从未见过的震撼图片 绝无仅有!33张你从未见过的震撼图片 在这个世界上有太多千奇百怪的事情我们没能亲身体会,但是我们不应该忽视它.不管是蜥蜴蜕下来的完整的皮,又或者是一个乳牙还未脱落的孩子的颅骨,再或者是逼真的UFO云,见识远比你所认为的重要. 今天,小编为大家盘点全球33张匪夷所思的照片,保证你绝对没见过! 蜥蜴蜕皮之后完整保存的面部 阜康陨石 .水平螺旋砖打造的新潮餐厅 一个乳牙还未脱落的孩子的颅骨 彩色铅笔画出的海浪 自动铺砖机 这图有100万种颜色 硬币通过巧妙堆叠形成不可思议的延伸 荚状"飞碟云" 百慕大三角的沙滩导致16艘船搁浅
  • 繁华的城市,彼此路过的忧伤 繁华的城市,彼此路过的忧伤 在午夜里凝听夜落的声音,看不清整个城市的样子,在凌晨,倾听心碎的声响,昏黄的灯光照耀着黎明前的街道,我看到了过去行影孤单的影子和那些碎过的伤痕.以前,过得很幸福,因为自己太贪心了,想把幸福留在身边,所以,也因为追求幸福,活得很累.可是到如今,对幸福已经没有了什么期望,有时候有了一点幸福的希望,却害怕得只是想逃离. 当我们的生命随着落地的声响而结束时,那是一种怎么样的痛楚和留恋呢,我们都不是要学着勇敢和坚强么,我们还要继续什么呢.无病呻吟的悲伤已经不是这个时代的进行曲了,我们只有在这个季节听着悲伤
  • 自驾游行前必读指南10点 自驾游行前必读指南10点 自驾游行前必读指南 NO.1 结伴而行 远途旅行选择会开车又懂修车的旅伴最佳,女性人数不宜超过男性,最好几辆车同行,可以互相照应.旅游不是练车,不熟悉路况最容易出事.结伴而行会免去很多后顾之忧.可以考虑参加汽车俱乐部组织的自驾游,他们一般有丰富的经验和应付突发事件的办法. NO.2 车辆检查 出发前做好车辆保养和检查,比如手刹.刹车.轮胎及定位等,有隐患的车避免跑长途.工具也应齐备,比如警示架.备胎.地图.GPS卫星定位系统.对讲机.电池充电器,太阳镜.相机.电池.小型望远镜.手电等. NO.3
  • 五一促销:淡季良机, 空气能热水器经销商该怎样把握? 五一促销:淡季良机, 空气能热水器经销商该怎样把握? 伴随五一小长假的步步紧逼,空气能热水器市场五一促销大浪潮也逐渐被推向高潮.眼下,各大热泵企业正如火如荼地打出各种促销活动,而广大消费者也趁着促销季的实惠,争先恐后进行大抢购.顿时,空气能市场出现"两头热",这对处于企业与消费者之间的经销商来说,无疑是实现"马"上创富的天赐良机. 五一促销大风暴,给空气能热水器经销商带来无限商机,这不难理解.但商机来临,如何去抓取,又成为经销商们最迫切想要解决的问题.业内人士指出,五一促销,热泵企业大举促销,消费者在疯狂抢购.经销商作
  • 英国发现两性大脑差异图显示男性大脑比女性大 英国发现两性大脑差异图显示男性大脑比女性大 照片展示了这个大脑上面和下面的构造,揭示了灰质容积的差异.红色代表女人大脑较大容积区域,蓝色代表男人大脑较大容积区域. 这张照片展示了女人(红色)和男人(蓝色)大脑较大容积的区域.前者包括(b)右下脑回和额中回,额下回三角部和颞平面,(c)丘脑和右带状前回,(f)左右丘脑.后者包括(c)带状前回,(b)双侧扣带后回.楔前叶和左小脑,(e)扣带前回和扣带后回,(f)左右扁桃体.海马和海马旁回. 许多人都怀疑男人和女人的大脑有很大不同,现在剑桥大学研究人员发现,男人和女人的大脑确实存在差异.他们用2
  • Photoshop输出AI格式为什么在MAX里输不进 Photoshop输出AI格式为什么在MAX里输不进 PHOTOSHOP输出为AI格式的只能输出路径,用户可以进入MAX里面在添颜色.
  • 动车一等座和二等座的区别 动车一等座和二等座的区别 动车一等座和二等座有什么区别: 很多旅客在火车票网上订票官网预订动车车票时,对于选择一等座还是二等座表示疑惑,不知道动车一等座和二等座的区别,也不知道动车座位分布情况,下面小编就来为大家详细解答动车座位分布,动车一等座和二等座的区别. 1.动车一等座四个人一排,二等座五个人一排(一边两座一边三座),因而一等座的过道比二等座的过道宽,一等座整体给人一种宽敞舒适感,相对而言二等座让人感到压抑沉闷,空调也不如一等座舒适. 2.动车一等座前后有车载电视,车窗视野宽阔,旅客看到的风景比较明朗,二等座车窗视