Răsfoiți Sursa

Merge branch 'fix/视图已完成文档时间范围查询字段不一致' into 'wrdp'

[数据中心]修复视图查询的bug-详见描述

See merge request o2oa/o2oa!2750
o2null 5 ani în urmă
părinte
comite
4e116d3f7a

+ 5 - 4
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/DateRangeEntry.java

@@ -58,7 +58,8 @@ public class DateRangeEntry extends GsonPropertyObject {
 			if (StringUtils.isEmpty(year)) {
 				year = DateTools.format(now, DateTools.format_yyyy);
 			}
-			if (null == season) {
+			/*0表示当前季度*/
+			if (null == season || season == 0) {
 				season = DateTools.season(now);
 			}
 			this.start = DateTools.floorSeason(year, season, adjust);
@@ -102,13 +103,13 @@ public class DateRangeEntry extends GsonPropertyObject {
 			//2019-07-17 O2LEE 优化:不能全部为空。但如果有一个为空,可能前推或者后延一年。
 			if (null == this.start  && null == this.completed) {
 				throw new Exception("begin and end can not be all null when dateRangeEntry on type appoint.");
-			}			
+			}
 			//2019-07-17 O2LEE 优化:如果开始时间不为空,结束时间为空,那么按开始时间后推一年为结束时间
 			if( null != this.start ) {
 				if( null == this.completed ) {
 					this.completed = DateTools.getDateAfterYearAdjust( this.start , 1, 0, 0);
 				}
-			}			
+			}
 			//2019-07-17 O2LEE 优化:如果结束时间不为空,开始时间为空,那么按结束时间前推一年为开始时间
 			if( null != this.completed ) {
 				if( null == this.start ) {
@@ -127,4 +128,4 @@ public class DateRangeEntry extends GsonPropertyObject {
 		}
 	}
 
-}
+}

+ 3 - 3
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/ProcessPlatformPlan.java

@@ -480,13 +480,13 @@ public class ProcessPlatformPlan extends Plan {
 				return null;
 			}
 			if (null == this.dateRange.start) {
-				return cb.lessThanOrEqualTo(root.get(WorkCompleted_.completedTime), this.dateRange.completed);
+				return cb.lessThanOrEqualTo(root.get(WorkCompleted_.startTime), this.dateRange.completed);
 			} else if (null == this.dateRange.completed) {
 				return cb.greaterThanOrEqualTo(root.get(WorkCompleted_.startTime), this.dateRange.start);
 			} else {
 				return cb.and(cb.greaterThanOrEqualTo(root.get(WorkCompleted_.startTime), this.dateRange.start),
-						cb.lessThanOrEqualTo(root.get(WorkCompleted_.completedTime), this.dateRange.completed));
+						cb.lessThanOrEqualTo(root.get(WorkCompleted_.startTime), this.dateRange.completed));
 			}
 		}
 	}
-}
+}