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

s2sh调整带有配置文件

日期:2014-11-30 阅读:0num
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

最新文章
  • 乔帮主的理念过时了吗?详解 iPhone SE 人体工学设计 乔帮主的理念过时了吗?详解 iPhone SE 人体工学设计

    在 2016 年春季发布会上,新一代产品 iPhone SE 亮相了.这是时隔两年多后,苹果再度推出的 4 英寸屏幕手机.这一回,苹果展示了这样的标语:「一小部的一大步--深得人心的 4 英寸设计,于你掌间亲密贴合」.苹果的产品永远像在流水里被打磨光滑的鹅卵石,铝金属表面经过喷砂工艺处理,犹如绸缎般的质感,让这款小巧.轻便的 iPhone SE 握持时手感非常舒适. 这一幕似曾相识.六年前,当竞争对手们都在疯狂开发超大屏手机,乔布斯对着他们连开嘲讽:「握不住的手机,为何要买它?」乔帮主极力推崇人

  • dell 2007fp 这款显示器该选择PVA面板还是是S-IPS面板的啊

    如题. 纠结 --cut-- meteor在2012-04-18 15:02:0回答到: 这款显示有2种面板可以选择? adown在2012-04-18 22:49:3回答到: @meteor 必须有... 晕啊

  • Openwrt ChinaDNS 服务器设置 2 个就只返回 IPV6 地址 Openwrt ChinaDNS 服务器设置 2 个就只返回 IPV6 地址

    2个dns服务器地址,随便设置哪一个都正常返回ipv6+ipv4地址,如果设置2个dns就只返回IPV6地址, 求解. --cut-- LazyZhu在2015-02-24 14:22:3回答到: 升级最新版

  • 人人公司副总裁吴疆:SNS网站是LBS的天然载体

    新浪科技讯 7月28日下午消息,人人公司副总裁吴疆今日表示,SNS网站是LBS服务的天然载体,不只是一个应用,而是一个与SNS深度集成的平台." 早在去年下半年,人人网就推出了"人人报到",首次在移动客户端引入LBS的概念.此后,人人网在LBS领域持续发力,在手机客户端中相继增加了发状态.拍照片添加位置信息等功能,将单调的位置服务与社交属性深度结合,向LBS服务的实用性.多样性更近一步. 此前,LBS服务被业界认为"叫座不叫好",尚未找到清晰的盈利模式.对

  • 历史十大奸臣盘点:秦桧魏忠贤和珅领衔 历史十大奸臣盘点:秦桧魏忠贤和珅领衔

    自从中国有历史记载起,就有奸臣,他们每每祸国殃民,其罪行令人发指,或横征暴敛,挟天子以令诸侯,或偷奸耍滑,陷害忠良于不义,或当权干政,视国库民脂为己出,而往往是兼而有之,败坏朝纲,祸害忠良,贪赃枉法,卖官鬻爵是他们的共同本质,而结局是民怨鼎沸,国力日衰,最终闹得是国将不国,当然,这些巨贪大腐之人,无不是千古罪人,他们的下场也多得到了报应! 1中国历代十大奸臣之秦桧(宋朝) 江宁人,进士出身.北宋末为御史中丞.曾主抗金和反对立张邦昌为帝,被俘至北方.成为金太宗之弟完颜昌之亲信.公元1130年,昌放

  • 你是我的谁歌词 你是我的谁歌词

    你是我的谁 - 覃桢 词:李岩,郑小小 曲:覃桢 你爱白喵我爱白狗 周末都宅家爱电动 朋友约不想出去走 你笑点偏左我偏右 当中的默契却都懂 你简直是翻版的我 我和你就像牛奶咖啡一样的绝配 没有人跟我们能一样如此的对味 我们懂彼此快乐 和伤悲 如果有人来问我 问你是我的谁 我会淡淡地 翘起我的嘴 I want to say 你是我的那个谁 朋友亲人或宝贝 叫什么无所谓 I want to say 我也是你那个谁 你唯一那个谁 你懂的就OK 爱是种感觉 说不出来 心照不宣的滋味 爱是别管谁是谁的谁

  • 2015十一西安旅游攻略 2015十一西安旅游攻略

    2015十一西安旅游攻略 其实西安是个非常适合自助游的城市,整个西安分为几条线路,先简单说明一下. 1. 著名的东线:华清池.临潼博物馆.秦始皇陵.秦始皇地宫.骊山.秦始皇兵马俑等 2. 西线:咸阳博物馆.茂陵.乾陵.昭陵.杨贵妃墓,唐墓.法门寺等 3. 北线:黄帝陵.壶口瀑布.延安革命旧址等 本站阅读配图 4. 西安市内:大.小雁塔(这是俩地方,离得远).钟.鼓楼(这是俩地方,但离得近). 陕西历史博物馆.大唐芙蓉园.古城墙.碑林博物馆.大清真寺等. 但是,时间有限,咱只能顾着最著名的几个来了

  • 10个帮你启发设计灵感的APP 10个帮你启发设计灵感的APP

    国内外能汲取设计灵感的App 几乎都在这个合集了[email protected]最美应用官方微博 这篇App 推荐是专门为设计师写的,毕竟是给设计师用的,这些App 的设计和体验也都非常棒,下载后可以把碎片时间用起来,积攒自己的灵感库! 上周在 ProductHunt 上发现一个有趣的网站,在设计师在缺乏灵感时会给一些有趣实用的小建议,但是缺少灵感这种事不只是设计尸要面对的问题,比如产品狗被一个需求憋死,运营喵整不方案,编辑对着键盘发呆,嗯!说的就是小美自己,已经发了一下午呆了!救命啊!小美决定做一系列「灵感」专题来普渡众

  • 经典小户型客厅装修设计 经典小户型客厅装修设计

    小户型装修最主要的就在于它空间布局以及家具搭配,对于经典的小户型装饰,一样可以有新潮的设计.创意的家居,将有限的空间得到合理的利用,做到小而全的生活空间,从而体现出一种更精致更玲珑的家居生活. 将沙发置于居室一角,这对与小户型的空间布局来说是最好的设计,利用空间不足的缺陷,同时也给居住者带来一种安全感.清新的田园风格空间装饰整个家居倍感舒适温暖,浅绿色的客厅主色调营造出自然田园的生活氛围. 以冷色为空间主色调的客厅设计让这个小户型客厅体现出一丝沉稳的空间气息,原木色的地板,清新的木材纹理映照出主

  • 天天酷跑新版上线 金枪小帅极速世界详细介绍 天天酷跑新版上线 金枪小帅极速世界详细介绍

    传闻已久的腾讯手游天天酷跑新版本今日终于正式上线.此次更新内容众多,不仅新增了角色.坐骑,同时还加入了全新游戏模式--极速世界,此外还有全新的每日任务系统,玩家通过完成每日任务即可获得相应的钻石奖励. 新版本增加了音速小飞,价格为680钻石,而金枪小帅价格则为88888金币.此外,两角色还开启了更高等级上限,音速小飞最高等级为80级,而金枪小帅最高等级则高达120级.刀锋宝贝和猫小萌的最高等级也相应提升到60级. 在坐骑方面,此次并没有应验传言,只增加了雷焰狮王一款坐骑,价格为600钻石.等级上

热门推荐
  • 立春吃韭菜提高免疫力 立春吃韭菜提高免疫力 本站阅读配图 "春初早韭,秋末晚菘",这"韭"自然就是韭菜了.初春时节的韭菜品质最佳,晚秋的次之,夏季的最差,有"春食则香,夏食则臭"之说. 随着温度的升高,各种蔬菜质量有所上升.叶类菜质量近日上升幅度较大,韭菜质量上升最大,由之前的90.2%上升至95.2%,提高5个百分点. 韭菜又叫起阳草,味道非常鲜美,还有其独特的香味.韭菜的独特辛香味是其所含的硫化物形成的,这些硫化物有一定的杀菌消炎作用,有助于人体提高自身免疫力.韭菜中这些硫化物还能帮助
  • 英妇人17次遭遇外星人获封UFO磁铁称号 英妇人17次遭遇外星人获封UFO磁铁称号 据英国<每日邮报>日前报道,英国一名家庭主妇因为声称40年来至少17度获外星人造访,其中包括5次面对面的第三类接触,因此获得UFO磁铁的封号. 40岁的布丽姬葛兰特外貌跟普通家庭主妇没什么两样.但是她不平凡的经历,让她被UFO界认可为接触过最多外星人的英国女人. 英国<太阳报>引述她的话说:为什么会是我?我不知道.我也不了解,但我需要答案.我无法解释发生在我身上的事.我为我亲眼目睹的事感到高兴. 葛兰特透露,她第一次遇到外星人在33年前,当时她只有7岁:还不晓得这趟奇遇的重要性.他
  • 指甲月牙大小暗示什么 指甲月牙大小暗示什么 是不是发现自己手指甲上的"月牙儿"变小了?指甲也不像以前那么硬了,好不容易才留长的指甲,正准备周末去美甲的,没想到洗了两件衣服就折了.指甲壁上还总起皮皮,嫌不好看忍着痛把皮皮揪掉,十有八九还会流血-- 人的手指甲上都有个半月形的"小月亮"--半月痕,是人体气血营养是否充沛的刻度表.从中医的角度看,"肝,其华在爪",意思是如果肝血充足的话,内在的光华就会表现在指甲上,也就是说,指甲是人体健康的外在表现,从指甲的表现能看出肝的好坏. 具体怎么看呢?一
  • B站直播魅族李楠当mSupport客服 倾听用户声音 B站直播魅族李楠当mSupport客服 倾听用户声音 魅族mSupport,是国内手机行业首个远程支援服务,用户可以足不出户,让客服专员操作自己的手机,解决问题,上线一段时间以来,获得了用户的大量好评.一直以来,大家都习惯客服专员是声音甜美的女生或者磁性十足的男生,然而,魅族mSupport的客服专员将有一位新人加入,他竟然是魅族副总裁李楠,同时,他的mSupport客服首秀,将在哔哩哔哩直播! 微博截图 今天,魅族科技微博发布了微博称"魅族@李楠或kkk先生将化身mSupport远程服务技术顾问,为用户解答手机使用问题,并在哔哩哔哩全程直播&qu
  • 年货广告词大全 年货广告词大全 春节即将来临,现在正是年货甩卖的季节,来看看各个厂家年货倾销的宣传广告词吧. 2016年货节广告语.宣传语: 1.应有尽有年货节,省钱省心新农都. 2.缘·来新农都,享·往年货节. 3.辞旧迎新年味浓,精彩纷呈新农都. 4.逛庙会"庙"不可言,新农都"农"情无限. 5."新"在新鲜,"农"在生态,"都"在一起. 6.新·年味道,农·情相约,都·汇天下. 7.新天·新地·新农都,年俗·年味·年货节. 8.新农