فهرست منبع

修改考勤编译不通过的问题

o2lee 5 سال پیش
والد
کامیت
1fc1d144bc
14فایلهای تغییر یافته به همراه140 افزوده شده و 619 حذف شده
  1. 15 15
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/AttendanceDetailStatisticQueue.java
  2. 11 9
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/PersonAttendanceDetailAnalyseQueue.java
  3. 0 532
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailAnalyseCoreService.java
  4. 2 2
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailAnalyseService.java
  5. 0 13
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailAnalyseServiceAdv.java
  6. 1 2
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailMobileAnalyseServiceAdv.java
  7. 4 0
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticRequireLogServiceAdv.java
  8. 20 1
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticServiceAdv.java
  9. 18 24
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticalCycleService.java
  10. 21 6
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticalCycleServiceAdv.java
  11. 4 0
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceWorkDayConfigServiceAdv.java
  12. 34 14
      o2server/x_attendance_core_entity/src/main/java/com/x/attendance/entity/AttendanceScheduleSetting.java
  13. 1 1
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSConfigSettingService.java
  14. 9 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSForumSubjectStatisticService.java

+ 15 - 15
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/AttendanceDetailStatisticQueue.java

@@ -18,17 +18,17 @@ import java.util.Map;
  */
 public class AttendanceDetailStatisticQueue extends AbstractQueue<String> {
 
-    protected Ehcache cache = ApplicationCache.instance().getCache( AttendanceStatisticalCycle.class);
-    private AttendanceStatisticRequireLogServiceAdv statisticRequireLogServiceAdv = new AttendanceStatisticRequireLogServiceAdv();
-    private AttendanceWorkDayConfigService workDayConfigService = new AttendanceWorkDayConfigService();
-    private AttendanceStatisticRequireLogService statisticRequireLogService = new AttendanceStatisticRequireLogService();
-    private AttendanceStatisticService statisticService = new AttendanceStatisticService();
-    private AttendanceStatisticalCycleService statisticalCycleService = new AttendanceStatisticalCycleService();
     private static final Logger logger = LoggerFactory.getLogger(AttendanceDetailStatisticQueue.class);
 
     @Override
     protected void execute( String logId ) throws Exception {
+        AttendanceStatisticRequireLogServiceAdv statisticRequireLogServiceAdv = new AttendanceStatisticRequireLogServiceAdv();
+        AttendanceWorkDayConfigServiceAdv workDayConfigServiceAdv = new AttendanceWorkDayConfigServiceAdv();
+        AttendanceStatisticServiceAdv statisticServiceAdv = new AttendanceStatisticServiceAdv();
+        AttendanceStatisticalCycleServiceAdv statisticalCycleServiceAdv = new AttendanceStatisticalCycleServiceAdv();
         AttendanceStatisticRequireLog log = statisticRequireLogServiceAdv.get(logId);
+
+        Ehcache cache = ApplicationCache.instance().getCache( AttendanceStatisticalCycle.class);
         if( log != null ){
             logger.debug("system try to statistic attendance detail, logId:" + logId );
             AttendanceStatisticalCycle attendanceStatisticalCycle  = null;
@@ -37,14 +37,14 @@ public class AttendanceDetailStatisticQueue extends AbstractQueue<String> {
             Map<String, Map<String, List<AttendanceStatisticalCycle>>> statisticalCycleMap = null;
 
             try {//先查询所有的法定节假日和工作日配置列表
-                workDayConfigList = workDayConfigService.getAllWorkDayConfigWithCache(false );
+                workDayConfigList = workDayConfigServiceAdv.getAllWorkDayConfigWithCache(false );
             } catch ( Exception e ) {
                 logger.warn("【统计】系统在查询当月有打卡记录的员工姓名列表时发生异常!" );
                 logger.error(e);
             }
 
             try{//查询所有的考勤统计周期信息,并且组织成MAP
-                statisticalCycleMap = statisticalCycleService.getAllStatisticalCycleMapWithCache(false);
+                statisticalCycleMap = statisticalCycleServiceAdv.getAllStatisticalCycleMapWithCache(false);
             }catch(Exception e){
                 logger.warn( "【统计】系统在查询并且组织所有的考勤统计周期信息时发生异常。" );
                 logger.error(e);
@@ -53,7 +53,7 @@ public class AttendanceDetailStatisticQueue extends AbstractQueue<String> {
             //先处理所有的统计错误
             try {
                 logger.debug( false, "准备处理恢复的统计错误信息, 所有错误统计将会重新计算......" );
-                statisticRequireLogService.resetStatisticError();
+                statisticRequireLogServiceAdv.resetStatisticError();
             } catch (Exception e) {
                 logger.warn("【统计】系统在重置统计错误信息时发生异常!" );
                 logger.error(e);
@@ -63,14 +63,14 @@ public class AttendanceDetailStatisticQueue extends AbstractQueue<String> {
             if( StringUtils.equals( "PERSON_PER_MONTH", log.getStatisticType() )){
                 logger.debug( false, "系统准备统计[员工每月统计], 员工:" + log.getStatisticKey() + ", 统计月份:" + log.getStatisticYear() + "-" +log.getStatisticMonth() );
                 try {
-                    attendanceStatisticalCycle = statisticalCycleService.getStatisticCycleByEmployee( log, statisticalCycleMap, false );
+                    attendanceStatisticalCycle = statisticalCycleServiceAdv.getStatisticCycleByEmployee( log, statisticalCycleMap, false );
                 } catch (Exception e) {
                     logger.warn("【统计】系统在根据统计需求记录信息查询统计周期信息时发生异常!" );
                     logger.error(e);
                 }
                 if( attendanceStatisticalCycle != null ){
                     try{
-                        statisticService.statisticEmployeeAttendanceForMonth( log, attendanceStatisticalCycle, workDayConfigList, statisticalCycleMap);
+                        statisticServiceAdv.statisticEmployeeAttendanceForMonth( log, attendanceStatisticalCycle, workDayConfigList, statisticalCycleMap);
                     }catch(Exception e){
                         logger.warn( "【统计】系统在根据需求进行员工月度打卡记录分析结果统计时发生异常。" );
                         logger.error(e);
@@ -79,7 +79,7 @@ public class AttendanceDetailStatisticQueue extends AbstractQueue<String> {
             } else if ( StringUtils.equals( "UNIT_PER_MONTH", log.getStatisticType() )){
                 logger.debug( false, "系统准备统计[组织每月统计], 组织:" + log.getStatisticKey() + ", 统计月份:" + log.getStatisticYear() + "-" +log.getStatisticMonth() );
                 try{
-                    statisticService.statisticUnitAttendanceForMonth( log, workDayConfigList, statisticalCycleMap );
+                    statisticServiceAdv.statisticUnitAttendanceForMonth( log, workDayConfigList, statisticalCycleMap );
                 }catch(Exception e){
                     logger.warn( "【统计】系统在根据需求进行员工月度打卡记录分析结果统计时发生异常。" );
                     logger.error(e);
@@ -87,7 +87,7 @@ public class AttendanceDetailStatisticQueue extends AbstractQueue<String> {
             } else if ( StringUtils.equals( "TOPUNIT_PER_MONTH", log.getStatisticType() )){
                 logger.debug( false, "系统准备统计[顶层组织每月统计], 顶层组织:" + log.getStatisticKey() + ", 统计月份:" + log.getStatisticYear() + "-" +log.getStatisticMonth() );
                 try{
-                    statisticService.statisticTopUnitAttendanceForMonth( log, workDayConfigList, statisticalCycleMap);
+                    statisticServiceAdv.statisticTopUnitAttendanceForMonth( log, workDayConfigList, statisticalCycleMap);
                 }catch(Exception e){
                     logger.warn( "【统计】系统在根据需求进行员工月度打卡记录分析结果统计时发生异常。" );
                     logger.error(e);
@@ -95,7 +95,7 @@ public class AttendanceDetailStatisticQueue extends AbstractQueue<String> {
             } else if ( StringUtils.equals( "UNIT_PER_DAY", log.getStatisticType() )){
                 logger.debug( false, "系统准备统计[组织每月统计], 组织:" + log.getStatisticKey() + ", 统计日期:" + log.getStatisticDay() );
                 try{
-                    statisticService.statisticUnitAttendanceForDay( log, workDayConfigList, statisticalCycleMap, false );
+                    statisticServiceAdv.statisticUnitAttendanceForDay( log, workDayConfigList, statisticalCycleMap, false );
                 }catch(Exception e){
                     logger.warn( "【统计】系统在根据需求进行组织每日打卡记录分析结果统计时发生异常。" );
                     logger.error(e);
@@ -103,7 +103,7 @@ public class AttendanceDetailStatisticQueue extends AbstractQueue<String> {
             } else if ( StringUtils.equals( "TOPUNIT_PER_DAY", log.getStatisticType() )){
                 logger.debug( false, "系统准备统计[顶层组织每月统计], 顶层组织:" + log.getStatisticKey() + ", 统计日期:" + log.getStatisticDay() );
                 try{
-                    statisticService.statisticTopUnitAttendanceForDay( log, workDayConfigList, statisticalCycleMap );
+                    statisticServiceAdv.statisticTopUnitAttendanceForDay( log, workDayConfigList, statisticalCycleMap );
                 }catch(Exception e){
                     logger.warn( "【统计】系统在根据需求进行顶层组织每日打卡记录分析结果统计时发生异常。" );
                     logger.error(e);

+ 11 - 9
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/PersonAttendanceDetailAnalyseQueue.java

@@ -4,35 +4,37 @@ import com.x.attendance.assemble.control.service.AttendanceDetailAnalyseServiceA
 import com.x.attendance.assemble.control.service.AttendanceDetailServiceAdv;
 import com.x.attendance.assemble.control.service.AttendanceStatisticalCycleServiceAdv;
 import com.x.attendance.assemble.control.service.AttendanceWorkDayConfigServiceAdv;
-import com.x.attendance.entity.*;
+import com.x.attendance.entity.AttendanceDetail;
+import com.x.attendance.entity.AttendanceStatisticalCycle;
+import com.x.attendance.entity.AttendanceWorkDayConfig;
 import com.x.base.core.project.cache.ApplicationCache;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.queue.AbstractQueue;
 import net.sf.ehcache.Ehcache;
 import net.sf.ehcache.Element;
-import java.util.*;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * 对单个员工的打卡信息进行分析的队列
  */
 public class PersonAttendanceDetailAnalyseQueue extends AbstractQueue<String> {
 
-    protected Ehcache cache = ApplicationCache.instance().getCache( AttendanceStatisticalCycle.class);
-
-    private AttendanceWorkDayConfigServiceAdv attendanceWorkDayConfigServiceAdv = new AttendanceWorkDayConfigServiceAdv();
-    private AttendanceStatisticalCycleServiceAdv statisticalCycleServiceAdv = new AttendanceStatisticalCycleServiceAdv();
-    private AttendanceDetailAnalyseServiceAdv detailAnalyseServiceAdv = new AttendanceDetailAnalyseServiceAdv();
-    private AttendanceDetailServiceAdv detailServiceAdv = new AttendanceDetailServiceAdv();
     private static final Logger logger = LoggerFactory.getLogger(PersonAttendanceDetailAnalyseQueue.class);
 
     @Override
     protected void execute( String detailId ) throws Exception {
+        AttendanceWorkDayConfigServiceAdv attendanceWorkDayConfigServiceAdv = new AttendanceWorkDayConfigServiceAdv();
+        AttendanceStatisticalCycleServiceAdv statisticalCycleServiceAdv = new AttendanceStatisticalCycleServiceAdv();
+        AttendanceDetailAnalyseServiceAdv detailAnalyseServiceAdv = new AttendanceDetailAnalyseServiceAdv();
+        AttendanceDetailServiceAdv detailServiceAdv = new AttendanceDetailServiceAdv();
         AttendanceDetail record = detailServiceAdv.get( detailId );
         if( record != null ){
             logger.debug("system try to analyse attendance detail for person, Id:" + record.getId() );
 
-
+            Ehcache cache = ApplicationCache.instance().getCache( AttendanceStatisticalCycle.class);
             String cacheKey = ApplicationCache.concreteCacheKey( "map#all" );
             Element element = cache.get(cacheKey);
             try {

+ 0 - 532
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailAnalyseCoreService.java

@@ -1,532 +0,0 @@
-package com.x.attendance.assemble.control.service;
-
-import com.x.attendance.assemble.common.date.DateOperation;
-import com.x.attendance.assemble.control.Business;
-import com.x.attendance.assemble.control.factory.AttendanceStatisticRequireLogFactory;
-import com.x.attendance.assemble.control.jaxrs.attendancedetail.AttendanceCycles;
-import com.x.attendance.entity.*;
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.annotation.CheckPersistType;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.*;
-
-/**
- * 考勤打卡记录分析服务类
- * @author LIYI
- *
- */
-class AttendanceDetailAnalyseCoreService {
-	
-	private static  Logger logger = LoggerFactory.getLogger( AttendanceDetailAnalyseCoreService.class );
-	private AttendanceSelfHolidayService attendanceSelfHolidayService = new AttendanceSelfHolidayService();
-	private AttendanceScheduleSettingService attendanceScheduleSettingService = new AttendanceScheduleSettingService();
-	private AttendanceStatisticalCycleService attendanceStatisticalCycleService = new AttendanceStatisticalCycleService();
-	private DateOperation dateOperation = new DateOperation();
-	private UserManagerService userManagerService = new UserManagerService();
-
-
-	/**
-	 * 打卡记录分析核心方法,分析一条打卡记录信息<br/>
-		<b>迟到</b>:晚于最迟“迟到起算时间”,(当天为非周末非节假日正常上班日,并且未请假,或者当天是调休的工作日)<br/>
-		<b>早退</b>:下班打卡时间早于“迟到起算时间”,并且工作当日时间不满9个小时,(当天为非周末非节假日正常上班日,并且未请假,或者当天是调休的工作日)<br/>
-		<b>异常</b>:缺少签到退中的1条打卡数据 或者 上下班打卡时间都在最迟起算时间内,不满9个小时,(当天为非周末非节假日正常上班日,并且未请假,或者当天是调休的工作日)<br/>
-		<b>缺勤</b>:当天没有打卡数据,并且当天是工作日(当天为非周末非节假日正常上班日,并且未请假,或者当天是调休的工作日)
-	 * @param detail
-	 * @param attendanceScheduleSetting
-	 * @param dateOperation
-	 * @throws Exception 
-	 */
-	AttendanceDetail analyseCore( AttendanceDetail detail, AttendanceScheduleSetting attendanceScheduleSetting, DateOperation dateOperation, Boolean debugger ) throws Exception {
-		if( dateOperation == null ){
-			dateOperation = new DateOperation();
-		}
-		if( detail == null ){
-			throw new Exception("detail is null!" );
-		}
-		//排班规则 早上9:00 - 晚上18:00
-		/**
-		 * 新规则
-		 * 早上9:00 - 中午12:00
-		 * 中午13:00 - 晚上18:00
-		 */
-		if( attendanceScheduleSetting == null ){
-			throw new Exception("attendanceScheduleSetting is null, empName:" + detail.getEmpName() );
-		}
-
-		Date onDutyTime = null, offDutyTime = null, middleDutyTime = null;
-		//上班签到时间
-		Date onWorkTime = null, offWorkTime = null, middleWorkStartTime = null, middleWorkEndTime = null;
-		Date lateStartTime = null, leaveEarlyStartTime = null, absenceStartTime = null;
-		Date morningEndTime = null;
-
-		//考勤异常时段
-//		StringBuffer abnormalDutyDayTime = new StringBuffer();
-		
-		//先初始化当前打卡信息中的上下班时间要求,该要求是是根据员工所在组织排班信息获取到的
-		//中午打卡时间要求 13:30
-		try {
-			logger.debug( debugger, ">>>>>>>>>>格式化[上班签到时间]onWorkTime=" +  detail.getRecordDateString() + " " + detail.getOnWorkTime() );
-			onWorkTime = dateOperation.getDateFromString( detail.getRecordDateString() + " " + detail.getOnWorkTime() );
-		} catch (Exception e) {
-			detail.setDescription( detail.getDescription() + "; 系统进行时间转换时发生异常,onWorkTime=" + detail.getRecordDateString() + " " + detail.getOnWorkTime() );
-			onWorkTime = null;
-			logger.debug( debugger, ">>>>>>>>>>系统进行时间转换时发生异常,onWorkTime=" + detail.getRecordDateString() + " " + detail.getOnWorkTime());
-			logger.error(e);
-		}
-
-		try {
-			logger.debug(debugger, ">>>>>>>>>>格式化[中午开始时间]middleStartTime=" + detail.getRecordDateString() + " " + attendanceScheduleSetting.getMiddayRestStartTime());
-			middleWorkStartTime = dateOperation.getDateFromString(detail.getRecordDateString() + " " + detail.getMiddayRestStartTime());
-			logger.debug(debugger, ">>>>>>>>>>格式化[中午结束时间]middleEndTime=" + detail.getRecordDateString() + " " + attendanceScheduleSetting.getMiddayRestEndTime());
-			middleWorkEndTime = dateOperation.getDateFromString(detail.getRecordDateString() + " " + detail.getMiddayRestEndTime());
-		} catch (Exception e) {
-			detail.setDescription(detail.getDescription() + "; 系统进行时间转换时发生异常,onWorkTime=" + detail.getRecordDateString() + " " + attendanceScheduleSetting.getMiddayRestStartTime() + " - " + attendanceScheduleSetting.getMiddayRestEndTime());
-			onWorkTime = null;
-			logger.debug(debugger, ">>>>>>>>>>系统进行时间转换时发生异常,onWorkTime=" + detail.getRecordDateString() + " " + attendanceScheduleSetting.getMiddayRestStartTime() + " - " + attendanceScheduleSetting.getMiddayRestEndTime());
-			logger.error(e);
-		}
-
-		try {
-			logger.debug( debugger, ">>>>>>>>>>格式化[下班签退时间]offWorkTime=" +  detail.getRecordDateString() + " " + detail.getOffWorkTime() );
-			offWorkTime = dateOperation.getDateFromString( detail.getRecordDateString() + " " + detail.getOffWorkTime() );
-		} catch (Exception e) {
-			detail.setDescription( detail.getDescription() + "; 系统进行时间转换时发生异常,offWorkTime=" + detail.getRecordDateString() + " " + detail.getOffWorkTime() );
-			offWorkTime = null;
-			logger.debug( debugger, ">>>>>>>>>>系统进行时间转换时发生异常,offWorkTime=" + detail.getRecordDateString() + " " + detail.getOffWorkTime() );
-			logger.error(e);
-		}
-		
-		if( StringUtils.isNotEmpty( attendanceScheduleSetting.getLateStartTime() ) ){
-			try {
-				lateStartTime = dateOperation.getDateFromString( detail.getRecordDateString() + " " + attendanceScheduleSetting.getLateStartTime() );
-			} catch (Exception e) {
-				detail.setDescription( detail.getDescription() + "; 系统进行时间转换时发生异常,lateStartTime=" + detail.getRecordDateString() + " " + attendanceScheduleSetting.getLateStartTime() );
-				lateStartTime = null;
-				logger.warn( "系统进行时间转换时发生异常,lateStartTime=" + detail.getRecordDateString() + " " + attendanceScheduleSetting.getLateStartTime());
-				logger.error(e);
-			}
-		}else{
-			logger.debug( debugger, ">>>>>>>>>>迟到时间设置为空!系统将不判断迟到情况");
-		}
-		
-		if( StringUtils.isNotEmpty( attendanceScheduleSetting.getLeaveEarlyStartTime() ) ){
-			try {
-				logger.debug( debugger, ">>>>>>>>>>格式化[早退起算时间]leaveEarlyStartTime=" +  detail.getRecordDateString() + " " + attendanceScheduleSetting.getLeaveEarlyStartTime() );
-				leaveEarlyStartTime = dateOperation.getDateFromString( detail.getRecordDateString() + " " + attendanceScheduleSetting.getLeaveEarlyStartTime() );
-			} catch (Exception e) {
-				detail.setDescription( detail.getDescription() + "; 系统进行时间转换时发生异常,leaveEarlyStartTime=" + detail.getRecordDateString() + " " + attendanceScheduleSetting.getLeaveEarlyStartTime() );
-				leaveEarlyStartTime = null;
-				logger.warn( "系统进行时间转换时发生异常,leaveEarlyStartTime=" + detail.getRecordDateString() + " " + attendanceScheduleSetting.getLeaveEarlyStartTime() );
-				logger.error(e);
-			}
-		}else{
-			logger.debug( debugger, ">>>>>>>>>>早退时间设置为空!系统将不判断早退情况");
-		}
-		
-		if( StringUtils.isNotEmpty( attendanceScheduleSetting.getAbsenceStartTime() ) ){
-			try {
-				logger.debug( debugger, ">>>>>>>>>>格式化[缺勤起算时间]absenceStartTime=" +  detail.getRecordDateString() + " " + attendanceScheduleSetting.getAbsenceStartTime() );
-				absenceStartTime = dateOperation.getDateFromString( detail.getRecordDateString() + " " + attendanceScheduleSetting.getAbsenceStartTime() );
-			} catch (Exception e) {
-				detail.setDescription( detail.getDescription() + "; 系统进行时间转换时发生异常,absenceStartTime=" + detail.getRecordDateString() + " " + attendanceScheduleSetting.getAbsenceStartTime() );
-				absenceStartTime = null;
-				logger.warn( "系统进行时间转换时发生异常,absenceStartTime=" + detail.getRecordDateString() + " " + attendanceScheduleSetting.getAbsenceStartTime() );
-				logger.error(e);
-			}
-		}else{
-			logger.debug( debugger, ">>>>>>>>>>上午缺勤时间设置为空!系统将不判上午缺勤情况");
-		}
-		
-		try {
-			//上午工作结束时间取中午打卡开始时间
-
-			logger.debug(debugger, ">>>>>>>>>>格式化[上午工作结束时间]morningEndTime=" + attendanceScheduleSetting.getMiddayRestStartTime());
-			morningEndTime = dateOperation.getDateFromString(detail.getRecordDateString() + " " + detail.getMiddayRestStartTime());
-		} catch (Exception e) {
-			detail.setDescription(detail.getDescription() + "; 系统进行时间转换时发生异常,morningEndTime=" + detail.getRecordDateString() + attendanceScheduleSetting.getMiddayRestStartTime());
-			morningEndTime = null;
-			logger.warn("系统进行时间转换时发生异常,morningEndTime=" + detail.getRecordDateString() + attendanceScheduleSetting.getMiddayRestStartTime());
-			logger.error(e);
-		}
-
-		//规则:上午打卡时间、下班打卡时间、中午开始时间、中午结束时间
-		if (onWorkTime != null && offWorkTime != null && middleWorkStartTime != null && middleWorkEndTime != null) {
-			logger.debug( debugger, ">>>>>>>>>>上下班排班信息获取正常:onWorkTime=" +  onWorkTime + ", offWorkTime="+offWorkTime );
-			//获取员工签到时间(签到规则,上午9:00)
-			try {
-				if( detail.getOnDutyTime() == null || detail.getOnDutyTime().isEmpty() ){
-					logger.debug( debugger, ">>>>>>>>>>onDutyTime 为空 " );
-					onDutyTime = null;
-				}else{
-					logger.debug( debugger, ">>>>>>>>>>格式化onDutyTime=" + detail.getRecordDateString() + " " + detail.getOnDutyTime() );
-					onDutyTime = dateOperation.getDateFromString( detail.getRecordDateString() + " " + detail.getOnDutyTime() );
-				}
-			} catch (Exception e) {
-				onDutyTime = null;
-				logger.warn( "系统进行时间转换时发生异常,onDutyTime=" + detail.getRecordDateString() + " " + detail.getOnDutyTime() );
-				logger.error(e);
-			}
-
-			//获取员工中午签到时间---------------------------------------------
-			try {
-				if ( StringUtils.isEmpty(detail.getMiddayRestStartTime())) {
-					logger.debug(debugger, "middayRestStartTime 为空 ");
-					middleDutyTime = null;
-				} else {
-					logger.debug(debugger, "middayRestStartTime=" + detail.getRecordDateString() + " " + detail.getOnDutyTime());
-					middleDutyTime = dateOperation.getDateFromString(detail.getRecordDateString() + " " + detail.getMiddayRestStartTime());
-				}
-			} catch (Exception e) {
-				middleDutyTime = null;
-				logger.warn("系统进行时间转换时发生异常,middayRestStartTime=" + detail.getRecordDateString() + " " + detail.getOnDutyTime());
-				logger.error(e);
-			}
-
-			//获取员工签退时间(签退规则,下午18:00)
-			try {
-				if( detail.getOffDutyTime() == null || detail.getOffDutyTime().isEmpty() ){
-					logger.debug( debugger, ">>>>>>>>>>offDutyTime 为空" );
-					offDutyTime = null;
-				}else{
-					logger.debug( debugger, ">>>>>>>>>>格式化offDutyTime=" + detail.getRecordDateString() + " " + detail.getOffDutyTime() );
-					offDutyTime = dateOperation.getDateFromString( detail.getRecordDateString() + " " + detail.getOffDutyTime() );
-				}
-			} catch (Exception e) {
-				offDutyTime = null;
-				logger.warn( "系统进行时间转换时发生异常,offDutyTime=" + detail.getRecordDateString() + " " + detail.getOffDutyTime() );
-				logger.error(e);
-			}
-
-			
-			//=========================================================================================================
-			//=====如果员工没有签到并且没有签退,一条打卡时间都没有,那么是算缺勤的========================================
-			//=========================================================================================================
-			if (onDutyTime == null && offDutyTime == null && middleDutyTime == null) {
-				//if( detail.getIsGetSelfHolidays()  && "全天".equalsIgnoreCase( detail.getSelfHolidayDayTime() ) ){
-				if( detail.getIsGetSelfHolidays()  ){
-					logger.debug( debugger, ">>>>>>>>>>请幸运,全天请假不计缺勤。" );
-					detail.setAttendance( 0.0 );
-					detail.setIsAbsent( false );
-					detail.setAbsence( 0.0 );
-					detail.setAbsentDayTime("无");
-					detail.setWorkTimeDuration( 0L );
-				}else{
-					if( ( detail.getIsWeekend() && !detail.getIsWorkday()) //周末,并且未调休为工作日
-						|| detail.getIsHoliday() //或者是节假日
-					){
-						logger.debug( debugger, ">>>>>>>>>>未请假,不是工作日,不计缺勤。" );
-						detail.setAttendance( 0.0 );
-						detail.setIsAbsent( false );
-						detail.setAbsence( 0.0 );
-						detail.setAbsentDayTime("无");
-						detail.setWorkTimeDuration( 0L );
-					}else{
-						logger.debug( debugger, ">>>>>>>>>>未请假,工作日,计缺勤1天。" );
-						detail.setAttendance( 0.0 );
-						detail.setIsAbsent( true );
-						detail.setAbsence( 1.0 );
-						detail.setAbsentDayTime("全天");
-						detail.setWorkTimeDuration( 0L );
-					}
-				}
-			}else{
-				//=========================================================================================================
-				//=====上午  如果员工已经签到================================================================================
-				//=========================================================================================================
-				if( onDutyTime != null ){
-					logger.debug( debugger, ">>>>>>>>>>上午打过卡,时间:onDutyTime=" + onDutyTime + ", 上午工作结束时间:morningEndTime=" + morningEndTime );					
-					//absenceStartTimes可以不配置,如果不配置,则为null
-					//上午签到过了,如果排班设置里已经配置过了旷工起算时间,那么判断员工是否已经缺勤,如果未休假,则视为缺勤半天
-					if( absenceStartTime != null && onDutyTime.after( absenceStartTime )){
-						logger.debug( debugger, ">>>>>>>>>>上午打卡时间晚于缺勤计时时间......" );
-						if( detail.getIsGetSelfHolidays()  && ("上午".equalsIgnoreCase(detail.getSelfHolidayDayTime()) || "全天".equalsIgnoreCase( detail.getSelfHolidayDayTime() ))){
-							logger.debug( debugger, ">>>>>>>>>>请幸运,请假不计考勤,出勤只算半天,但请过假了不算缺勤" );
-							detail.setIsAbsent( false );
-							detail.setAbsence(0.0);
-						}else{
-							if( ( detail.getIsWeekend() && !detail.getIsWorkday()) //周末,并且未调休为工作日
-									|| detail.getIsHoliday() //或者是节假日
-								){
-								logger.debug( debugger, ">>>>>>>>>>休息天,不算缺勤,出勤最多只能算半天" );
-								detail.setIsAbsent( false );
-								detail.setAbsence(0.0);
-							}else{
-								logger.debug( debugger, ">>>>>>>>>>呵呵,没请假,缺勤半天,出勤最多只能算半天" );
-								detail.setIsAbsent( true );
-								composeAbsenceStatusForAttendanceDetail(detail);
-								detail.setAbsentDayTime("上午");
-							}
-						}
-						//缺勤直接扣半天出勤, 请假不算出勤,所以也只有半天
-						composeAttendanceStatusForAttendanceDetail(detail);
-					}else if( lateStartTime != null && onDutyTime.after( lateStartTime )){ 
-						//上午签到过了,如果排班设置里已经配置过了迟到起算时间,那么判断员工是否已经迟到,如果未休假
-						detail.setAttendance( 1.0 );//迟到没关系,出勤时间不用扣半天
-						logger.debug( debugger, ">>>>>>>>>>上午打卡时间晚于迟到计时时间......" );
-						if( detail.getIsGetSelfHolidays()  && ("上午".equalsIgnoreCase(detail.getSelfHolidayDayTime()) || "全天".equalsIgnoreCase( detail.getSelfHolidayDayTime() ))
-						){
-							logger.debug( debugger, ">>>>>>>>>>请幸运,请过假了不算迟到" );
-							detail.setLateTimeDuration( 0L ); //请假了不算迟到
-							detail.setIsLate(false );//请假了不算迟到
-						}else{
-							if( ( detail.getIsWeekend()  && !detail.getIsWorkday()) //周末,并且未调休为工作日
-									|| detail.getIsHoliday() //或者是节假日
-								){
-								detail.setLateTimeDuration( 0L );
-								detail.setIsLate( false );
-								logger.debug( debugger, ">>>>>>>>>>休息天,不算迟到" );
-							}else{
-								if( onDutyTime == null || offDutyTime == null ){
-									detail.setIsAbnormalDuty( true );
-								}else{
-									long minutes = dateOperation.getMinutes( onWorkTime, onDutyTime ); //迟到计算从上班时间开始计算,不是迟到起算时间
-									detail.setLateTimeDuration( minutes );//没请假算迟到时长 
-									detail.setIsLate( true );//没请假算迟到
-									logger.debug( debugger, ">>>>>>>>>>呵呵,没请假,计迟到一次,迟到时长:minutes=" + minutes );
-								}
-							}
-						}
-						long minutes = dateOperation.getMinutes( onDutyTime, morningEndTime );
-						logger.debug( debugger, ">>>>>>>>>>上午工作时长, 从"+onDutyTime+"到"+morningEndTime+" :minutes=" + minutes + "分钟。" );
-						detail.setWorkTimeDuration( minutes );//记录上午的工作时长
-					}else{//上午正常打卡
-						long minutes = dateOperation.getMinutes( onWorkTime, morningEndTime );
-						logger.debug( debugger, ">>>>>>>>>>上午工作时长, 从"+onDutyTime+"到"+morningEndTime+" :minutes=" + minutes + "分钟。" );
-						detail.setWorkTimeDuration( minutes );//记录上午的工作时长
-					}
-
-				}else{
-					logger.debug( debugger, ">>>>>>>>>>员工上午未打卡,异常状态......" );
-					if( detail.getIsGetSelfHolidays() && ("上午".equalsIgnoreCase( detail.getSelfHolidayDayTime()) || "全天".equalsIgnoreCase( detail.getSelfHolidayDayTime() ))
-					){
-						logger.debug( debugger, ">>>>>>>>>>请幸运,请假不计考勤,不需要打卡,不算异常" );
-						detail.setIsAbsent( false );
-					}else{
-						if( ( detail.getIsWeekend()&& !detail.getIsWorkday() ) //周末,并且未调休为工作日
-								|| detail.getIsHoliday() //或者是节假日
-							){
-							logger.debug( debugger, ">>>>>>>>>>休息天,不算打卡异常,本来就不需要打卡" );
-							detail.setAbnormalDutyDayTime("无");
-							detail.setIsAbnormalDuty( false );
-						}else{
-							logger.debug(debugger, ">>>>>>>>>>呵呵,没请假,算缺勤。");
-							//========================== 是否异常 =================================
-//							abnormalDutyDayTime.append("上午");
-//							detail.setAbnormalDutyDayTime(abnormalDutyDayTime.toString());
-//							detail.setIsAbnormalDuty(true);
-							//===================== 记录缺勤 =========================
-							detail.setIsAbsent(true);
-							composeAbsenceStatusForAttendanceDetail(detail);
-							detail.setAbsentDayTime("上午");
-							//===================== 记录出勤 =========================
-							composeAttendanceStatusForAttendanceDetail(detail);
-							//detail.setAttendance( 0.5 ); //上午打卡异常,不知道算不算出勤时间
-						}
-					}
-					logger.debug( debugger, ">>>>>>>>>>上午工作时长, 未打卡:minutes= 0 分钟。" );
-					detail.setWorkTimeDuration( 0L );//记录上午的工作时长
-				}
-
-
-				//=========================================================================================================
-				//=====中午  如果员工已经签到================================================================================
-				//=========================================================================================================
-				if(middleDutyTime == null || !middleWorkStartTime.before(middleDutyTime) || !middleWorkEndTime.after(middleDutyTime)){
-//					===============  异常  ===============
-					/*if(abnormalDutyDayTime.length() > 0){
-						detail.setAbnormalDutyDayTime("|中午");
-					}else {
-						detail.setAbnormalDutyDayTime("中午");
-					}
-
-					detail.setIsAbnormalDuty(true);*/
-					if (detail.getIsGetSelfHolidays() && ("上午".equalsIgnoreCase(detail.getSelfHolidayDayTime()) || "全天".equalsIgnoreCase(detail.getSelfHolidayDayTime()))) {
-						logger.debug(debugger, ">>>>>>>>>>很幸运,请假不计考勤,出勤只算半天,但请过假了不算缺勤");
-						detail.setIsAbsent(false);
-						detail.setAbsence(0.0);
-					} else {
-						if ((detail.getIsWeekend() && !detail.getIsWorkday()) //周末,并且未调休为工作日
-								|| detail.getIsHoliday() //或者是节假日
-						) {
-							logger.debug(debugger, ">>>>>>>>>>休息天,不算缺勤,出勤最多只能算半天");
-							detail.setIsAbsent(false);
-							detail.setAbsence(0.0);
-						} else {
-							logger.debug(debugger, ">>>>>>>>>>呵呵,没请假,缺勤半天,出勤最多只能算半天");
-							//===================== 记录缺勤 =========================
-							detail.setIsAbsent(true);
-							composeAbsenceStatusForAttendanceDetail(detail);
-							detail.setAbsentDayTime("中午");
-							//===================== 记录出勤 =========================
-							composeAttendanceStatusForAttendanceDetail(detail);
-							detail.setAbnormalDutyDayTime("中午");
-							detail.setIsAbnormalDuty(true);
-
-						}
-					}
-
-				}
-
-				//=========================================================================================================
-				//=====下午  如果员工已经签退================================================================================
-				//=========================================================================================================
-				if( offDutyTime != null ){
-					logger.debug( debugger, ">>>>>>>>>>早退计时时间:leaveEarlyStartTime=" + leaveEarlyStartTime );
-					long minutes = dateOperation.getMinutes( morningEndTime, offDutyTime);
-					logger.debug( debugger, ">>>>>>>>>>下午工作时长, 从"+morningEndTime+"到"+offDutyTime+" :minutes=" + minutes + "分钟。" );
-					detail.setWorkTimeDuration( detail.getWorkTimeDuration() + minutes );//记录上午的工作时长 + 下午工作时长
-					logger.debug( debugger, ">>>>>>>>>>全天工作时长, :minutes=" + detail.getWorkTimeDuration() + "分钟。" );
-					if( leaveEarlyStartTime != null && offDutyTime.before( leaveEarlyStartTime )){
-						logger.debug( debugger, ">>>>>>>>>>下午打卡时间早于早退计时时间......" );
-						if( detail.getIsGetSelfHolidays() && ("下午".equalsIgnoreCase(detail.getSelfHolidayDayTime()) || "全天".equalsIgnoreCase( detail.getSelfHolidayDayTime() ))){
-							logger.debug( debugger, ">>>>>>>>>>请幸运,请假不计考勤,出勤只算半天,但请过假了不算早退" );
-							detail.setLeaveEarlierTimeDuration( 0L );
-							detail.setIsLeaveEarlier( false );
-							//detail.setAttendance( detail.getAttendance() - 0.5 );//早退了,不知道算不算出勤时间
-						}else{
-							if( ( detail.getIsWeekend() && !detail.getIsWorkday() ) //周末,并且未调休为工作日
-									|| detail.getIsHoliday() //或者是节假日
-							){
-								logger.debug( debugger, ">>>>>>>>>>休息天,不算早退" );
-								detail.setLeaveEarlierTimeDuration( 0L );
-								detail.setIsLeaveEarlier( false );
-								//detail.setAttendance( detail.getAttendance() - 0.5 );//早退了,不知道算不算出勤
-							}else{
-//								minutes = dateOperation.getMinutes( offDutyTime, leaveEarlyStartTime );
-								minutes = dateOperation.getMinutes( offDutyTime, offWorkTime );
-								detail.setLeaveEarlierTimeDuration(minutes); //早退时间
-//								detail.setIsLeaveEarlier( true );
-								//===================== 记录缺勤 =========================
-								detail.setIsAbsent(true);
-								composeAbsenceStatusForAttendanceDetail(detail);
-								detail.setAbsentDayTime("下午");
-								//detail.setAttendance( detail.getAttendance() - 0.5 );//早退了,不知道算不算出勤
-								//=========================== 记录出勤 =========================
-								composeAttendanceStatusForAttendanceDetail(detail);
-							}
-						}
-						//在早退起算之后,并在下班时间之前
-					} else if ((leaveEarlyStartTime != null && offDutyTime.after(leaveEarlyStartTime)) && offDutyTime.before(offWorkTime)) {
-						logger.debug(debugger, ">>>>>>>>>>下午打卡时间晚于早退计时时间早于下班时间......");
-						if (detail.getIsGetSelfHolidays() && ("下午".equalsIgnoreCase(detail.getSelfHolidayDayTime()) || "全天".equalsIgnoreCase(detail.getSelfHolidayDayTime()))) {
-							logger.debug(debugger, ">>>>>>>>>>请幸运,请假不计考勤,出勤只算半天,但请过假了不算早退");
-							detail.setLeaveEarlierTimeDuration(0L);
-							detail.setIsLeaveEarlier(false);
-							//detail.setAttendance( detail.getAttendance() - 0.5 );//早退了,不知道算不算出勤时间
-						} else {
-							if ((detail.getIsWeekend() && !detail.getIsWorkday()) //周末,并且未调休为工作日
-									|| detail.getIsHoliday() //或者是节假日
-							) {
-								logger.debug(debugger, ">>>>>>>>>>休息天,不算早退");
-								detail.setLeaveEarlierTimeDuration(0L);
-								detail.setIsLeaveEarlier(false);
-								//detail.setAttendance( detail.getAttendance() - 0.5 );//早退了,不知道算不算出勤
-							} else {
-//								minutes = dateOperation.getMinutes(offDutyTime, leaveEarlyStartTime);
-								minutes = dateOperation.getMinutes(offDutyTime, offWorkTime);
-								detail.setLeaveEarlierTimeDuration(minutes); //早退时间
-								detail.setIsLeaveEarlier(true);
-
-							}
-						}
-					}
-				}else{
-					//如果打卡是今天,但是还没有到下班打卡时间
-					if(  detail.getRecordDateString().equals( dateOperation.getNowDate() )  && dateOperation.getDateFromString( detail.getRecordDateString() + " " + detail.getOffWorkTime()).after( new Date() ) ) {
-						detail.setAbnormalDutyDayTime("无");
-						detail.setIsAbnormalDuty(false);
-						logger.debug( debugger, ">>>>>>>>>>还没有到下班打卡时间,先不分析结果。" );
-					}else {
-						logger.debug( debugger, ">>>>>>>>>>员工下午未打卡,属于异常状态......" );
-						//员工未签退,算缺勤了半天,出勤率: - 0.5
-						if( detail.getIsGetSelfHolidays()  && ("下午".equalsIgnoreCase(detail.getSelfHolidayDayTime()) || "全天".equalsIgnoreCase( detail.getSelfHolidayDayTime() ))){
-							logger.debug( debugger, ">>>>>>>>>>请幸运,请假不计考勤,不需要打卡,不算异常状态" );
-							detail.setLeaveEarlierTimeDuration( 0L );
-							detail.setIsLeaveEarlier( false );
-							composeAttendanceStatusForAttendanceDetail(detail);
-							//detail.setAttendance( detail.getAttendance() - 0.5 );
-						}else{
-							if( ( detail.getIsWeekend() && !detail.getIsWorkday()) //周末,并且未调休为工作日
-									|| detail.getIsHoliday() //或者是节假日
-								){
-								logger.debug( debugger, ">>>>>>>>>>休息天,不算异常" );
-								detail.setAbnormalDutyDayTime("无");
-								detail.setIsAbnormalDuty(false);
-							}else{
-//								if(abnormalDutyDayTime.length() > 0){
-//									detail.setAbnormalDutyDayTime("|下午");
-//								}else {
-//									detail.setAbnormalDutyDayTime("下午");
-//								}
-								//===================== 记录缺勤 =========================
-								detail.setIsAbsent(true);
-								composeAbsenceStatusForAttendanceDetail(detail);
-								detail.setAbsentDayTime("下午");
-								//=========================== 记录出勤 =========================
-								composeAttendanceStatusForAttendanceDetail(detail);
-								detail.setIsAbnormalDuty(true);
-								logger.debug( debugger, ">>>>>>>>>>呵呵,没请假,未打卡,算异常状态。" );
-							}
-						}						
-					}
-					logger.debug( debugger, ">>>>>>>>>>全天工作时长,[下午未打卡,只算上午的工作时长] :minutes=" + detail.getWorkTimeDuration() + "分钟。" );
-				}
-			}
-			
-			
-			//=========================================================================================================
-			//=====如果上下班都打卡了,但是工作时间没有9小时,那么属于工时不足(如果迟到了,就算迟到,不算工时不足)========================================
-			//=========================================================================================================
-			if( onDutyTime != null && offDutyTime != null){
-				if( ( detail.getIsWeekend() && !detail.getIsWorkday() ) //周末,并且未调休为工作日
-						|| detail.getIsHoliday() //或者是节假日
-					){
-					//没事
-				}else{
-					if( !detail.getIsGetSelfHolidays() ){ // 没请假
-						//计算工时
-						long minutes = dateOperation.getMinutes( onDutyTime, offDutyTime);
-						if( minutes < (60*9)){
-							logger.debug( debugger, ">>>>>>>>>>签到时间["+onDutyTime+"],签退时间["+offDutyTime+"],工作时间:"+minutes+"分钟!工时不足!" );
-							if( !detail.getIsLate() ){
-								detail.setIsLackOfTime(true);//工时不足
-							}
-						}
-					}
-				}
-			}
-			
-			detail.setRecordStatus( 1 );
-		}
-		return detail;
-	}
-
-	/**
-	 * 分析打卡信息,为打卡数据计算缺勤天数信息
-	 * @param detail
-	 */
-	private void composeAbsenceStatusForAttendanceDetail(AttendanceDetail detail) {
-		Double absence = detail.getAbsence();
-		if (absence < 1.0) {
-			detail.setAbsence(absence + 0.5);
-		}
-	}
-
-	//
-
-	/**
-	 * 分析打卡信息,为打卡数据计算出勤天数信息
-	 * @param detail
-	 */
-	private void composeAttendanceStatusForAttendanceDetail(AttendanceDetail detail) {
-		Double attendance = detail.getAttendance();
-		if (attendance > 0.0) {
-			detail.setAttendance(attendance - 0.5);
-		}
-	}
-
-}

+ 2 - 2
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailAnalyseService.java

@@ -41,7 +41,7 @@ public class AttendanceDetailAnalyseService {
 	private AttendanceScheduleSettingService attendanceScheduleSettingService = new AttendanceScheduleSettingService();
 	private AttendanceStatisticalCycleService statisticalCycleService = new AttendanceStatisticalCycleService();
 	private AttendanceWorkDayConfigService workDayConfigService = new AttendanceWorkDayConfigService();
-	private AttendanceDetailAnalyseCoreService attendanceDetailAnalyseCoreService = new AttendanceDetailAnalyseCoreService();
+//	private AttendanceDetailAnalyseCoreService attendanceDetailAnalyseCoreService = new AttendanceDetailAnalyseCoreService();
 	private DateOperation dateOperation = new DateOperation();
 	private UserManagerService userManagerService = new UserManagerService();
 
@@ -390,7 +390,7 @@ public class AttendanceDetailAnalyseService {
 			if( check ){
 				try{
 					//使用分析核心算法进行考勤状态分析
-					detail = attendanceDetailAnalyseCoreService.analyseCore( detail, scheduleSetting, dateOperation, debugger );
+//					detail = attendanceDetailAnalyseCoreService.analyseCore( detail, scheduleSetting, dateOperation, debugger );
 				}catch( Exception e ){
 					check = false;
 					logger.warn( "system analyse detail by on and off work time for advance analyse got an exception." + detail.getEmpName() );

+ 0 - 13
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailAnalyseServiceAdv.java

@@ -1,18 +1,8 @@
 package com.x.attendance.assemble.control.service;
 
-import com.x.attendance.assemble.common.date.DateOperation;
-import com.x.attendance.assemble.control.Business;
-import com.x.attendance.assemble.control.factory.AttendanceStatisticRequireLogFactory;
 import com.x.attendance.entity.*;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.annotation.CheckPersistType;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.tools.ListTools;
-import net.sf.ehcache.Ehcache;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -23,9 +13,6 @@ import java.util.Map;
  *
  */
 public class AttendanceDetailAnalyseServiceAdv {
-	private AttendanceWorkDayConfigServiceAdv attendanceWorkDayConfigServiceAdv = new AttendanceWorkDayConfigServiceAdv();
-	private AttendanceStatisticalCycleServiceAdv statisticalCycleServiceAdv = new AttendanceStatisticalCycleServiceAdv();
-	private AttendanceDetailServiceAdv detailServiceAdv = new AttendanceDetailServiceAdv();
 	private AttendanceDetailAnalyseService detailAnalyseService = new AttendanceDetailAnalyseService();
 
 	/**

+ 1 - 2
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailMobileAnalyseServiceAdv.java

@@ -20,7 +20,6 @@ import com.x.base.core.entity.annotation.CheckPersistType;
  */
 public class AttendanceDetailMobileAnalyseServiceAdv {
 	private AttendanceDetailAnalyseService attendanceDetailAnalyseService = new AttendanceDetailAnalyseService();
-	private AttendanceStatisticalCycleService statisticalCycleService = new AttendanceStatisticalCycleService();
 	private AttendanceDetailMobileAnalyseService attendanceDetailMobileAnalyseService = new AttendanceDetailMobileAnalyseService();
 	
 	/**
@@ -45,7 +44,7 @@ public class AttendanceDetailMobileAnalyseServiceAdv {
 				attendanceDetail = attendanceDetailMobileAnalyseService.composeAttendanceDetailMobile( emc, id );
 				if( attendanceDetail != null ){
 					if( StringUtils.isNotEmpty( attendanceDetail.getOffDutyTime() ) ){
-						attendanceDetailAnalyseService.analyseAttendanceDetail(emc, attendanceDetail, debugger );
+//						attendanceDetailAnalyseService.analyseAttendanceDetail(emc, attendanceDetail, debugger );
 					}
 				}
 				

+ 4 - 0
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticRequireLogServiceAdv.java

@@ -42,4 +42,8 @@ public class AttendanceStatisticRequireLogServiceAdv {
 			throw e;
 		}
 	}
+
+    public void resetStatisticError() throws Exception {
+		attendanceStatisticRequireLogService.resetStatisticError();
+	}
 }

+ 20 - 1
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticServiceAdv.java

@@ -453,5 +453,24 @@ public class AttendanceStatisticServiceAdv {
 			throw e;
 		}
 	}
-	
+
+    public void statisticEmployeeAttendanceForMonth(AttendanceStatisticRequireLog log, AttendanceStatisticalCycle attendanceStatisticalCycle, List<AttendanceWorkDayConfig> workDayConfigList, Map<String, Map<String, List<AttendanceStatisticalCycle>>> statisticalCycleMap) throws Exception {
+		attendanceStatisticService.statisticEmployeeAttendanceForMonth( log, attendanceStatisticalCycle, workDayConfigList, statisticalCycleMap);
+	}
+
+	public void statisticUnitAttendanceForMonth(AttendanceStatisticRequireLog log, List<AttendanceWorkDayConfig> workDayConfigList, Map<String, Map<String, List<AttendanceStatisticalCycle>>> statisticalCycleMap) throws Exception {
+		attendanceStatisticService.statisticUnitAttendanceForMonth( log, workDayConfigList, statisticalCycleMap );
+	}
+
+	public void statisticTopUnitAttendanceForMonth(AttendanceStatisticRequireLog log, List<AttendanceWorkDayConfig> workDayConfigList, Map<String, Map<String, List<AttendanceStatisticalCycle>>> statisticalCycleMap) throws Exception {
+		attendanceStatisticService.statisticTopUnitAttendanceForMonth( log, workDayConfigList, statisticalCycleMap);
+	}
+
+	public void statisticUnitAttendanceForDay(AttendanceStatisticRequireLog log, List<AttendanceWorkDayConfig> workDayConfigList, Map<String, Map<String, List<AttendanceStatisticalCycle>>> statisticalCycleMap, boolean b) throws Exception {
+		attendanceStatisticService.statisticUnitAttendanceForDay( log, workDayConfigList, statisticalCycleMap, false );
+	}
+
+	public void statisticTopUnitAttendanceForDay(AttendanceStatisticRequireLog log, List<AttendanceWorkDayConfig> workDayConfigList, Map<String, Map<String, List<AttendanceStatisticalCycle>>> statisticalCycleMap) throws Exception {
+		attendanceStatisticService.statisticTopUnitAttendanceForDay( log, workDayConfigList, statisticalCycleMap );
+	}
 }

+ 18 - 24
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticalCycleService.java

@@ -65,22 +65,22 @@ public class AttendanceStatisticalCycleService {
 	}
 
 
-
 	/**
-	 * TODO 将所有的统计周期配置信息组织成一个大的Map
+	 * 将所有的统计周期配置信息组织成一个大的Map
 	 * @param emc
-	 * @param cycles
+	 * @param debugger
 	 * @return
 	 * @throws Exception
 	 */
 	public Map<String, Map<String, List<AttendanceStatisticalCycle>>> getCycleMapFormAllCycles( EntityManagerContainer emc, Boolean debugger ) throws Exception{
 		return getCycleMapFormAllCycles( emc, listAll(emc), debugger );
 	}
-	
+
 	/**
-	 * TODO 将指定的统计周期配置信息列表组织成一个大的Map
+	 * 将指定的统计周期配置信息列表组织成一个大的Map
 	 * @param emc
 	 * @param cycles
+	 * @param debugger
 	 * @return
 	 * @throws Exception
 	 */
@@ -111,14 +111,12 @@ public class AttendanceStatisticalCycleService {
 	}
 
 	/**
-	 * TODO 根据顶层组织,组织,年月获取一个统计周期配置
-	 * 如果不存在,则新建一个周期配置
-	 * 
+	 * 根据顶层组织,组织,年月获取一个统计周期配置 如果不存在,则新建一个周期配置
 	 * @param q_topUnitName
 	 * @param q_unitName
-	 * @param startDate
-	 * @param endDate
+	 * @param recordDate
 	 * @param topUnitAttendanceStatisticalCycleMap
+	 * @param debugger
 	 * @return
 	 * @throws Exception
 	 */
@@ -137,7 +135,7 @@ public class AttendanceStatisticalCycleService {
 		if( topUnitAttendanceStatisticalCycleMap != null ){
 			unitCycleInfoEntity = analyseStatisticCycleWithUnitName( q_topUnitName, q_unitName, topUnitAttendanceStatisticalCycleMap, debugger );
 		}else{
-			logger.debug( debugger, ">>>>>>>>>>统计周期配置为空,顶层组织为*组织为*,系统中没有任何配置");
+			logger.debug( debugger, "统计周期配置为空,顶层组织为*组织为*,系统中没有任何配置");
 			unitCycleInfoEntity = new UnitCycleInfoEntity();
 			unitCycleInfoEntity.setTopUnitName( "*" );
 			unitCycleInfoEntity.setUnitName( "*" );
@@ -149,13 +147,13 @@ public class AttendanceStatisticalCycleService {
 				cycleStartDate = temp.getCycleStartDate();
 				cycleEndDate = temp.getCycleEndDate();
 				if( recordDate.getTime() >= cycleStartDate.getTime() && recordDate.getTime() <= cycleEndDate.getTime() ){
-					logger.debug( debugger, ">>>>>>>>>>根据时间对比获取到合适的周期:" + recordDate + "," + cycleStartDate + " ~ " + cycleEndDate);
+					logger.debug( debugger, "根据时间对比获取到合适的周期:" + recordDate + "," + cycleStartDate + " ~ " + cycleEndDate);
 					return temp;
 				}
 			}
 		}
 		if( !hasConfig ){
-			logger.debug( debugger, ">>>>>>>>>>未查询到合适的周期,根据打卡信息创建一条自然月的周期");
+			logger.debug( debugger, "未查询到合适的周期,根据打卡信息创建一条自然月的周期");
 			//说明没有找到任何相关的配置,那么新创建一条配置
 			//创建并且持久化一条统计周期配置
 			attendanceStatisticalCycle = createNewCycleInfo( recordDate, q_topUnitName, q_unitName );			
@@ -191,7 +189,7 @@ public class AttendanceStatisticalCycleService {
 		if( topUnitAttendanceStatisticalCycleMap != null ){
 			unitCycleInfoEntity = analyseStatisticCycleWithUnitName( q_topUnitName, q_unitName, topUnitAttendanceStatisticalCycleMap, debugger );
 		}else{
-			logger.debug( debugger, ">>>>>>>>>>统计周期配置为空,顶层组织为*组织为*,系统中没有任何配置");
+			logger.debug( debugger, "统计周期配置为空,顶层组织为*组织为*,系统中没有任何配置");
 			unitCycleInfoEntity = new UnitCycleInfoEntity();
 			unitCycleInfoEntity.setTopUnitName( "*" );
 			unitCycleInfoEntity.setUnitName( "*" );
@@ -206,11 +204,11 @@ public class AttendanceStatisticalCycleService {
 				}
 			}
 		}else{
-			logger.debug( debugger, ">>>>>>>>>>根据顶层组织[" +topUnitName+ "]和组织["+unitName+"]未获取到任何周期数据,需要创建新的统计周期数据......");
+			logger.debug( debugger, "根据顶层组织[" +topUnitName+ "]和组织["+unitName+"]未获取到任何周期数据,需要创建新的统计周期数据......");
 		}
 		
 		if( !hasConfig ){
-			logger.debug( debugger, ">>>>>>>>>>未查询到合适的周期,根据打卡信息创建一条自然月的周期");
+			logger.debug( debugger, "未查询到合适的周期,根据打卡信息创建一条自然月的周期");
 			//说明没有找到任何相关的配置,那么新创建一条配置
 			Date day = dateOperation.getDateFromString( cycleYear + "-" + cycleMonth + "-01");
 			//创建并且持久化一条统计周期配置
@@ -220,16 +218,12 @@ public class AttendanceStatisticalCycleService {
 		}
 		return null;
 	}
-	
+
 	/**
-	 * 根据顶层组织,组织,年月获取一个统计周期配置
-	 * 如果不存在,则新建一个周期配置
-	 * 
-	 * @param q_topUnitName
-	 * @param q_unitName
-	 * @param cycleYear
-	 * @param cycleMonth
+	 * 根据顶层组织,组织,年月获取一个统计周期配置 如果不存在,则新建一个周期配置
+	 * @param attendanceStatisticRequireLog
 	 * @param topUnitAttendanceStatisticalCycleMap
+	 * @param debugger
 	 * @return
 	 * @throws Exception
 	 */

+ 21 - 6
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticalCycleServiceAdv.java

@@ -8,6 +8,7 @@ import java.util.Map;
 
 import com.x.attendance.assemble.common.date.DateOperation;
 import com.x.attendance.entity.AttendanceDetail;
+import com.x.attendance.entity.AttendanceStatisticRequireLog;
 import com.x.attendance.entity.AttendanceStatisticalCycle;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
@@ -278,16 +279,14 @@ public class AttendanceStatisticalCycleServiceAdv {
 		}
 		return null;
 	}
-	
+
 	/**
-	 * 根据顶层组织,组织,年月获取一个统计周期配置
-	 * 如果不存在,则新建一个周期配置
-	 * 
-	 * @param q_topUnitName
-	 * @param q_unitName
+	 * 根据顶层组织,组织,年月获取一个统计周期配置 如果不存在,则新建一个周期配置
+	 * @param employeeName
 	 * @param cycleYear
 	 * @param cycleMonth
 	 * @param topUnitAttendanceStatisticalCycleMap
+	 * @param debugger
 	 * @return
 	 * @throws Exception
 	 */
@@ -448,5 +447,21 @@ public class AttendanceStatisticalCycleServiceAdv {
 		unitCycles.add( cycle );
 		return unitCycles;
 	}
+
+    public Map<String, Map<String, List<AttendanceStatisticalCycle>>> getAllStatisticalCycleMapWithCache(boolean debugger) throws Exception {
+		return attendanceStatisticCycleService.getAllStatisticalCycleMapWithCache(debugger);
+    }
+
+	/**
+	 * 根据顶层组织,组织,年月获取一个统计周期配置 如果不存在,则新建一个周期配置
+	 * @param attendanceStatisticRequireLog
+	 * @param topUnitAttendanceStatisticalCycleMap
+	 * @param debugger
+	 * @return
+	 * @throws Exception
+	 */
+	public AttendanceStatisticalCycle getStatisticCycleByEmployee( AttendanceStatisticRequireLog attendanceStatisticRequireLog, Map<String, Map<String, List<AttendanceStatisticalCycle>>> topUnitAttendanceStatisticalCycleMap, Boolean debugger ) throws Exception{
+		return attendanceStatisticCycleService.getStatisticCycleByEmployee( attendanceStatisticRequireLog, topUnitAttendanceStatisticalCycleMap, debugger);
+	}
 }
 

+ 4 - 0
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceWorkDayConfigServiceAdv.java

@@ -40,4 +40,8 @@ public class AttendanceWorkDayConfigServiceAdv {
 			throw e;
 		}
 	}
+
+    public List<AttendanceWorkDayConfig> getAllWorkDayConfigWithCache(Boolean debugger) throws Exception {
+		return attendanceWorkDayConfigService.getAllWorkDayConfigWithCache(debugger);
+    }
 }

+ 34 - 14
o2server/x_attendance_core_entity/src/main/java/com/x/attendance/entity/AttendanceScheduleSetting.java

@@ -81,53 +81,65 @@ public class AttendanceScheduleSetting extends SliceJpaObject {
 	private String unitOu;
 
 	public static final String onDutyTime_FIELDNAME = "onDutyTime";
-	@FieldDescribe("上班时间")
+	@FieldDescribe("上午上班时间")
 	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + onDutyTime_FIELDNAME )
 	@CheckPersist(allowEmpty = true)
 	private String onDutyTime;
 
 	public static final String middayRestStartTime_FIELDNAME = "middayRestStartTime";
-	@FieldDescribe("午休开始时间")
-	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + onDutyTime_FIELDNAME )
+	@FieldDescribe("午休开始时间|上午下班时间")
+	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + middayRestStartTime_FIELDNAME )
 	@CheckPersist(allowEmpty = true)
 	private String middayRestStartTime;
 
 	public static final String middayRestEndTime_FIELDNAME = "middayRestEndTime";
-	@FieldDescribe("午休结束时间")
-	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + offDutyTime_FIELDNAME )
+	@FieldDescribe("午休结束时间|下午上班时间")
+	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + middayRestEndTime_FIELDNAME )
 	@CheckPersist(allowEmpty = true)
 	private String middayRestEndTime;
 
 	public static final String offDutyTime_FIELDNAME = "offDutyTime";
-	@FieldDescribe("下班时间")
+	@FieldDescribe("下午下班时间")
 	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + offDutyTime_FIELDNAME )
 	@CheckPersist(allowEmpty = true)
 	private String offDutyTime;
 
-	public static final String middayRestOpen_FIELDNAME = "middayRestOpen";
-	@FieldDescribe("是否启用午休:0-不启用 1-启用")
+	public static final String signProxy_FIELDNAME = "signProxy";
+	@FieldDescribe("打卡策略:1-两次打卡(上午上班,下午下班) 2-三次打卡(上午上班,下午下班加中午一次共三次) 3-四次打卡(上午下午都打上班下班卡)")
 	@Column( name = ColumnNamePrefix + lateStartTime_FIELDNAME )
 	@CheckPersist(allowEmpty = true)
-	private Integer middayRestOpen = 0;
+	private Integer signProxy = 0;
 
 	public static final String lateStartTime_FIELDNAME = "lateStartTime";
-	@FieldDescribe("迟到起算时间")
+	@FieldDescribe("上午上班迟到起算时间")
 	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + lateStartTime_FIELDNAME )
 	@CheckPersist(allowEmpty = true)
 	private String lateStartTime;
 
+	public static final String lateStartTimeAfternoon_FIELDNAME = "lateStartTimeAfternoon";
+	@FieldDescribe("下午上班迟到起算时间")
+	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + lateStartTimeAfternoon_FIELDNAME )
+	@CheckPersist(allowEmpty = true)
+	private String lateStartTimeAfternoon;
+
 	public static final String absenceStartTime_FIELDNAME = "absenceStartTime";
-	@FieldDescribe("缺勤起算时间")
+	@FieldDescribe("缺勤起算时间:第一次打卡在什么时间算是当天缺勤")
 	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + absenceStartTime_FIELDNAME )
 	@CheckPersist(allowEmpty = true)
 	private String absenceStartTime;
 
 	public static final String leaveEarlyStartTime_FIELDNAME = "leaveEarlyStartTime";
-	@FieldDescribe("早退起算时间")
+	@FieldDescribe("下午早退起算时间")
 	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + leaveEarlyStartTime_FIELDNAME )
 	@CheckPersist(allowEmpty = true)
 	private String leaveEarlyStartTime;
 
+	public static final String leaveEarlyStartTimeMorning_FIELDNAME = "leaveEarlyStartTimeMorning";
+	@FieldDescribe("上午早退起算时间")
+	@Column( length = JpaObject.length_32B, name = ColumnNamePrefix + leaveEarlyStartTime_FIELDNAME )
+	@CheckPersist(allowEmpty = true)
+	private String leaveEarlyStartTimeMorning;
+
 	public String getUnitName() {
 		return unitName;
 	}
@@ -156,9 +168,9 @@ public class AttendanceScheduleSetting extends SliceJpaObject {
 
 	public void setMiddayRestEndTime(String middayRestEndTime) { this.middayRestEndTime = middayRestEndTime; }
 
-	public Integer getMiddayRestOpen() { return middayRestOpen; }
+	public Integer getSignProxy() { return signProxy; }
 
-	public void setMiddayRestOpen(Integer middayRestOpen) { this.middayRestOpen = middayRestOpen; }
+	public void setSignProxy(Integer signProxy) { this.signProxy = signProxy; }
 
 	public String getOffDutyTime() { return offDutyTime; }
 
@@ -195,4 +207,12 @@ public class AttendanceScheduleSetting extends SliceJpaObject {
 	public void setTopUnitName(String topUnitName) {
 		this.topUnitName = topUnitName;
 	}
+
+	public String getLateStartTimeAfternoon() { return lateStartTimeAfternoon; }
+
+	public void setLateStartTimeAfternoon(String lateStartTimeAfternoon) { this.lateStartTimeAfternoon = lateStartTimeAfternoon; }
+
+	public String getLeaveEarlyStartTimeMorning() { return leaveEarlyStartTimeMorning; }
+
+	public void setLeaveEarlyStartTimeMorning(String leaveEarlyStartTimeMorning) { this.leaveEarlyStartTimeMorning = leaveEarlyStartTimeMorning; }
 }

+ 1 - 1
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSConfigSettingService.java

@@ -262,7 +262,7 @@ public class BBSConfigSettingService{
 		type = "text";
 		selectContent = null;
 		isMultiple = false;
-		description = "论坛标题Tail:全站网页标题内容的后缀内容。默认' - O2OA办公软件管理系统',可以为空。";
+		description = "论坛标题Tail:全站网页标题内容的后缀内容。可以为空。";
 		try {
 			checkAndInitSystemConfig("BBS_TITLE_TAIL", "论坛标题Tail", value, description, type, selectContent, isMultiple,  ++ordernumber );
 		} catch (Exception e) {

+ 9 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSForumSubjectStatisticService.java

@@ -44,9 +44,11 @@ public class BBSForumSubjectStatisticService {
 								sectionInfo.setSubjectTotalToday( count.longValue() );
 								count = business.replyInfoFactory().countReplyForTodayBySectionId( mainSectionInfo.getId() );
 								sectionInfo.setReplyTotalToday( count.longValue() );
+
 								if( StringUtils.isEmpty( sectionInfo.getReplyMessageNotifyType() )){
 									sectionInfo.setReplyMessageNotifyType("0,0,0");
 								}
+
 								emc.check( sectionInfo, CheckPersistType.all );
 							}
 						}
@@ -59,9 +61,11 @@ public class BBSForumSubjectStatisticService {
 						mainSectionInfo.setSubjectTotalToday( count.longValue() );
 						count = business.replyInfoFactory().countReplyForTodayBySectionId( mainSectionInfo.getId() );
 						mainSectionInfo.setReplyTotalToday( count.longValue() );
+
 						if( StringUtils.isEmpty( mainSectionInfo.getReplyMessageNotifyType() )){
 							mainSectionInfo.setReplyMessageNotifyType("0,0,0");
 						}
+
 						emc.check( mainSectionInfo, CheckPersistType.all );
 					}
 				}
@@ -78,6 +82,11 @@ public class BBSForumSubjectStatisticService {
 				f.setSubjectTotalToday( count.longValue() );
 				count = business.replyInfoFactory().countForTodayByForumId( f.getId() );
 				f.setReplyTotalToday( count.longValue() );
+
+				if( StringUtils.isEmpty( f.getReplyMessageNotifyType() )){
+					f.setReplyMessageNotifyType("0,0,0");
+				}
+
 				emc.check( f, CheckPersistType.all );
 				emc.commit();
 			}catch( Exception e ){