Răsfoiți Sursa

'1.查询帖子列表增加根据日期进行过滤,2.样式修改x_program_center/src/main/webapp/jest/list.html'

o2wwx 5 ani în urmă
părinte
comite
d4b2f64003

+ 20 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/factory/BBSSubjectInfoFactory.java

@@ -263,7 +263,7 @@ public class BBSSubjectInfoFactory extends AbstractFactory {
 	}
 	}
 	
 	
 	//@MethodDescribe( "根据版块ID, 主版块ID,版块ID,创建者姓名查询符合要求所有主题列表,不包括子版块内的主题数量" )
 	//@MethodDescribe( "根据版块ID, 主版块ID,版块ID,创建者姓名查询符合要求所有主题列表,不包括子版块内的主题数量" )
-	public Long countSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, List<String> viewSectionIds ) throws Exception {
+	public Long countSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, List<String> viewSectionIds , Date startTime , Date endTime) throws Exception {
 		EntityManager em = this.entityManagerContainer().get(BBSSubjectInfo.class);
 		EntityManager em = this.entityManagerContainer().get(BBSSubjectInfo.class);
 		CriteriaBuilder cb = em.getCriteriaBuilder();
 		CriteriaBuilder cb = em.getCriteriaBuilder();
 		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
 		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
@@ -298,13 +298,22 @@ public class BBSSubjectInfoFactory extends AbstractFactory {
 		if( StringUtils.isNotEmpty( searchTitle ) ){
 		if( StringUtils.isNotEmpty( searchTitle ) ){
 			p = cb.and( p, cb.like( root.get( BBSSubjectInfo_.title ), searchTitle ) );
 			p = cb.and( p, cb.like( root.get( BBSSubjectInfo_.title ), searchTitle ) );
 		}
 		}
+		
+		if(startTime!= null) {
+			   p = cb.and(p, cb.greaterThanOrEqualTo(root.get(BBSSubjectInfo_.createTime), startTime));
+		}
+			
+		if(endTime!= null) {
+			   p = cb.and(p, cb.lessThanOrEqualTo(root.get(BBSSubjectInfo_.createTime), endTime));
+		}
+		
 		cq.select( cb.count( root ) );
 		cq.select( cb.count( root ) );
 		//SELECT COUNT(b) FROM BBSSubjectInfo b WHERE ((b.id IS NOT NULL AND b.sectionId IN ('1c1d9dfc-0034-4d9a-adc7-bb4b3925bbd5')) AND b.title LIKE 'Count')
 		//SELECT COUNT(b) FROM BBSSubjectInfo b WHERE ((b.id IS NOT NULL AND b.sectionId IN ('1c1d9dfc-0034-4d9a-adc7-bb4b3925bbd5')) AND b.title LIKE 'Count')
 		return em.createQuery(cq.where(p)).getSingleResult();
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
 	}
 	
 	
 	//@MethodDescribe( "根据版块ID, 主版块ID,版块ID,创建者姓名查询符合要求所有主题列表,不包括子版块内的主题" )
 	//@MethodDescribe( "根据版块ID, 主版块ID,版块ID,创建者姓名查询符合要求所有主题列表,不包括子版块内的主题" )
-	public List<BBSSubjectInfo> listSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, Integer maxRecordCount, List<String> viewSectionIds ) throws Exception {
+	public List<BBSSubjectInfo> listSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, Integer maxRecordCount, List<String> viewSectionIds, Date startTime , Date endTime) throws Exception {
 		if( maxRecordCount == null ){
 		if( maxRecordCount == null ){
 			throw new Exception( "maxRecordCount is null." );
 			throw new Exception( "maxRecordCount is null." );
 		}
 		}
@@ -341,6 +350,15 @@ public class BBSSubjectInfoFactory extends AbstractFactory {
 		if( StringUtils.isNotEmpty( searchTitle ) ){
 		if( StringUtils.isNotEmpty( searchTitle ) ){
 			p = cb.and( p, cb.like( root.get( BBSSubjectInfo_.title ), searchTitle ) );
 			p = cb.and( p, cb.like( root.get( BBSSubjectInfo_.title ), searchTitle ) );
 		}
 		}
+		
+		if(startTime!= null) {
+			   p = cb.and(p, cb.greaterThanOrEqualTo(root.get(BBSSubjectInfo_.createTime), startTime));
+		}
+			
+		if(endTime!= null) {
+			   p = cb.and(p, cb.lessThanOrEqualTo(root.get(BBSSubjectInfo_.createTime), endTime));
+		}
+			
 		cq.orderBy( cb.desc( root.get( BBSSubjectInfo_.latestReplyTime ) ) );
 		cq.orderBy( cb.desc( root.get( BBSSubjectInfo_.latestReplyTime ) ) );
 		return em.createQuery(cq.where(p)).setMaxResults( maxRecordCount ).getResultList();
 		return em.createQuery(cq.where(p)).setMaxResults( maxRecordCount ).getResultList();
 	}	
 	}	

+ 2 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectListForBBSIndex.java

@@ -136,7 +136,7 @@ public class ActionSubjectListForBBSIndex extends BaseAction {
 		if( check ){
 		if( check ){
 			if( selectTotal > 0 ){
 			if( selectTotal > 0 ){
 				try{
 				try{
-					total = subjectInfoServiceAdv.countSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), null, viewSectionIds );
+					total = subjectInfoServiceAdv.countSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), null, viewSectionIds,null,null);
 				} catch (Exception e) {
 				} catch (Exception e) {
 					check = false;
 					check = false;
 					Exception exception = new ExceptionSubjectFilter( e );
 					Exception exception = new ExceptionSubjectFilter( e );
@@ -155,7 +155,7 @@ public class ActionSubjectListForBBSIndex extends BaseAction {
 
 
 				try{
 				try{
 					//内存分页
 					//内存分页
-					subjectInfoList = subjectInfoServiceAdv.listSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), null, selectTotal, viewSectionIds );
+					subjectInfoList = subjectInfoServiceAdv.listSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), null, selectTotal, viewSectionIds ,null,null);
 					if(ListTools.isNotEmpty( subjectInfoList ) ){
 					if(ListTools.isNotEmpty( subjectInfoList ) ){
 						try {
 						try {
 							wraps_out = Wo.copier.copy( subjectInfoList );
 							wraps_out = Wo.copier.copy( subjectInfoList );

+ 24 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectListForPage.java

@@ -1,6 +1,7 @@
 package com.x.bbs.assemble.control.jaxrs.subjectinfo;
 package com.x.bbs.assemble.control.jaxrs.subjectinfo;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
@@ -172,7 +173,7 @@ public class ActionSubjectListForPage extends BaseAction {
 			selectTopInSection = false; //置顶贴的处理已经在前面处理过了,置顶贴已经放到一个List里,不需要再次查询出来了,后续的查询过滤置顶贴
 			selectTopInSection = false; //置顶贴的处理已经在前面处理过了,置顶贴已经放到一个List里,不需要再次查询出来了,后续的查询过滤置顶贴
 			if( selectTotal > 0 ){
 			if( selectTotal > 0 ){
 				try{
 				try{
-					total = subjectInfoServiceAdv.countSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), selectTopInSection, viewSectionIds );
+					total = subjectInfoServiceAdv.countSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), selectTopInSection, viewSectionIds ,wrapIn.getStartTime() ,  wrapIn.getEndTime());
 				} catch (Exception e) {
 				} catch (Exception e) {
 					check = false;
 					check = false;
 					Exception exception = new ExceptionSubjectFilter( e );
 					Exception exception = new ExceptionSubjectFilter( e );
@@ -185,7 +186,7 @@ public class ActionSubjectListForPage extends BaseAction {
 		if( check ){
 		if( check ){
 			if( selectTotal > 0 && total > 0 ){
 			if( selectTotal > 0 && total > 0 ){
 				try{
 				try{
-					subjectInfoList = subjectInfoServiceAdv.listSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), selectTopInSection, selectTotal, viewSectionIds );
+					subjectInfoList = subjectInfoServiceAdv.listSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), selectTopInSection, selectTotal, viewSectionIds ,  wrapIn.getStartTime() ,  wrapIn.getEndTime() );
 					if( subjectInfoList != null ){
 					if( subjectInfoList != null ){
 						try {
 						try {
 							wraps_nonTop = Wo.copier.copy( subjectInfoList );
 							wraps_nonTop = Wo.copier.copy( subjectInfoList );
@@ -308,6 +309,12 @@ public class ActionSubjectListForPage extends BaseAction {
 		@FieldDescribe( "是否包含置顶贴." )
 		@FieldDescribe( "是否包含置顶贴." )
 		private Boolean withTopSubject = false; // 是否包含置顶贴
 		private Boolean withTopSubject = false; // 是否包含置顶贴
 		
 		
+		@FieldDescribe( "创建日期开始." )
+		private Date startTime = null; 
+		
+		@FieldDescribe( "创建日期结束." )
+		private Date endTime = null; 
+		
 		public static List<String> Excludes = new ArrayList<String>( JpaObject.FieldsUnmodify );
 		public static List<String> Excludes = new ArrayList<String>( JpaObject.FieldsUnmodify );
 	
 	
 		
 		
@@ -413,6 +420,21 @@ public class ActionSubjectListForPage extends BaseAction {
 			return sb.toString();
 			return sb.toString();
 		}
 		}
 		
 		
+		public Date getStartTime() {
+			return startTime;
+		}
+		public void setStartTime(Date startTime) {
+			this.startTime = startTime;
+		}
+		public Date getEndTime() {
+			return endTime;
+		}
+		public void setEndTime(Date endTime) {
+			this.endTime = endTime;
+		}
+		
+		
+		
 	}
 	}
 	
 	
 	public static class Wo extends BBSSubjectInfo{
 	public static class Wo extends BBSSubjectInfo{

+ 2 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoService.java

@@ -651,7 +651,7 @@ public class BBSSubjectInfoService {
 		Business business = null;
 		Business business = null;
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 			business = new Business(emc);
 			business = new Business(emc);
-			return business.subjectInfoFactory().listSubjectInSectionForPage( searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, maxRecordCount, viewSectionIds );
+			return business.subjectInfoFactory().listSubjectInSectionForPage( searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, maxRecordCount, viewSectionIds,null,null );
 		}catch( Exception e ){
 		}catch( Exception e ){
 			throw e;
 			throw e;
 		}
 		}
@@ -664,7 +664,7 @@ public class BBSSubjectInfoService {
 		Business business = null;
 		Business business = null;
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 			business = new Business(emc);
 			business = new Business(emc);
-			return business.subjectInfoFactory().countSubjectInSectionForPage( searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, viewSectionIds );
+			return business.subjectInfoFactory().countSubjectInSectionForPage( searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, viewSectionIds ,null,null );
 		}catch( Exception e ){
 		}catch( Exception e ){
 			throw e;
 			throw e;
 		}
 		}

+ 4 - 4
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoServiceAdv.java

@@ -329,7 +329,7 @@ public class BBSSubjectInfoServiceAdv {
 		}
 		}
 	}
 	}
 
 
-	public List<BBSSubjectInfo> listSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, Integer maxRecordCount, List<String> viewSectionIds ) throws Exception {
+	public List<BBSSubjectInfo> listSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, Integer maxRecordCount, List<String> viewSectionIds,Date startTime , Date endTime ) throws Exception {
 		if( viewSectionIds == null || viewSectionIds.isEmpty() ){
 		if( viewSectionIds == null || viewSectionIds.isEmpty() ){
 			return null;
 			return null;
 		}
 		}
@@ -339,7 +339,7 @@ public class BBSSubjectInfoServiceAdv {
 		Business business = null;
 		Business business = null;
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 			business = new Business(emc);
 			business = new Business(emc);
-			return business.subjectInfoFactory().listSubjectInSectionForPage( searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, maxRecordCount, viewSectionIds );
+			return business.subjectInfoFactory().listSubjectInSectionForPage(searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, maxRecordCount, viewSectionIds , startTime , endTime);
 		}catch( Exception e ){
 		}catch( Exception e ){
 			throw e;
 			throw e;
 		}
 		}
@@ -347,7 +347,7 @@ public class BBSSubjectInfoServiceAdv {
 	
 	
 	public Long countSubjectInSectionForPage( String searchTitle,
 	public Long countSubjectInSectionForPage( String searchTitle,
 			String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, 
 			String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, 
-			List<String> viewSectionIds ) throws Exception {
+			List<String> viewSectionIds , Date startTime , Date endTime) throws Exception {
 		if( viewSectionIds == null || viewSectionIds.isEmpty() ){
 		if( viewSectionIds == null || viewSectionIds.isEmpty() ){
 			return 0L;
 			return 0L;
 		}
 		}
@@ -355,7 +355,7 @@ public class BBSSubjectInfoServiceAdv {
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 			business = new Business(emc);
 			business = new Business(emc);
 			return business.subjectInfoFactory().countSubjectInSectionForPage( searchTitle,
 			return business.subjectInfoFactory().countSubjectInSectionForPage( searchTitle,
-					forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, viewSectionIds );
+					forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, viewSectionIds ,  startTime ,  endTime);
 		}catch( Exception e ){
 		}catch( Exception e ){
 			throw e;
 			throw e;
 		}
 		}

+ 5 - 4
o2server/x_program_center/src/main/webapp/jest/list.html

@@ -123,6 +123,7 @@
 				if (json.type == 'success') {
 				if (json.type == 'success') {
 					if (json.data) {
 					if (json.data) {
 						var str = '<table border="1" id = "apiTable" >';
 						var str = '<table border="1" id = "apiTable" >';
+                        str += '<tr><td colspan="3"><center id="title" style="font-size:32px; font-weight:bold;">O2OA Service API URL</center></td></tr>';
 						$.each(json.data, function(index, o) {
 						$.each(json.data, function(index, o) {
 							str += '<tr>';
 							str += '<tr>';
 							str += '<td>' + o.name + '</td>';
 							str += '<td>' + o.name + '</td>';
@@ -149,9 +150,9 @@
 
 
 </head>
 </head>
 
 
-<body style="font-size: 12px; font-family: Microsoft Yahei; margin: 0px">
-<center id="title" style="font-size:32px; font-weight:bold;">O2OA Service API URL</center>
-<div id="content" style="margin-top:10px;margin-left: 50px;float: left;">&nbsp;</div>
-<div id="contentTable" style="margin-top:20px;margin-left: 50px;float: left;">&nbsp;</div>
+<body style="font-size: 12px; font-family: Microsoft Yahei; margin-top: 50px">
+<center id="title" style="font-size:32px; font-weight:bold;"></center>
+<div id="content" style="margin-top:10px;margin-left: 50px;">&nbsp;</div>
+<div id="contentTable" style="margin-top:20px;margin-left: 50px;">&nbsp;</div>
 </body>
 </body>
 </html>
 </html>