Commit 5acd26bb authored by 赵啸非's avatar 赵啸非

修改本月统计

parent 025c8f14
...@@ -23,12 +23,14 @@ import com.mortals.xhx.base.system.user.service.UserService; ...@@ -23,12 +23,14 @@ import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.base.system.valid.service.ValidCodeService; import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.common.code.GoWorkResultEnum; import com.mortals.xhx.common.code.GoWorkResultEnum;
import com.mortals.xhx.common.code.OffWorkResultEnum; import com.mortals.xhx.common.code.OffWorkResultEnum;
import com.mortals.xhx.common.code.ProcessStatusEnum;
import com.mortals.xhx.common.code.SourceType; import com.mortals.xhx.common.code.SourceType;
import com.mortals.xhx.common.key.RedisKey; import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo; import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.common.pdu.user.UserPdu; import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.feign.user.IUserFeign; import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.attendance.model.*; import com.mortals.xhx.module.attendance.model.*;
import com.mortals.xhx.module.attendance.service.AttendanceLeaveRecordService;
import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService; import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService;
import com.mortals.xhx.module.attendance.service.AttendanceRecordService; import com.mortals.xhx.module.attendance.service.AttendanceRecordService;
import com.mortals.xhx.module.attendance.service.AttendanceVacationRecordService; import com.mortals.xhx.module.attendance.service.AttendanceVacationRecordService;
...@@ -80,6 +82,9 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -80,6 +82,9 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired @Autowired
private AttendanceVacationRecordService vacationRecordService; private AttendanceVacationRecordService vacationRecordService;
@Autowired
private AttendanceLeaveRecordService leaveRecordService;
@Autowired @Autowired
private StaffService staffService; private StaffService staffService;
@Autowired @Autowired
...@@ -233,10 +238,17 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -233,10 +238,17 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
.count(); .count();
AttendanceVacationRecordQuery vacationRecordQuery = new AttendanceVacationRecordQuery(); /* AttendanceVacationRecordQuery vacationRecordQuery = new AttendanceVacationRecordQuery();
vacationRecordQuery.setCreateTimeStart(DateUtil.beginOfMonth(new Date()).toDateStr()); vacationRecordQuery.setCreateTimeStart(DateUtil.beginOfMonth(new Date()).toDateStr());
vacationRecordQuery.setCreateTimeEnd(DateUtil.today()); vacationRecordQuery.setCreateTimeEnd(DateUtil.today());
int levealPersonNum = vacationRecordService.count(vacationRecordQuery, getContext()); int levealPersonNum = vacationRecordService.count(vacationRecordQuery, getContext());*/
AttendanceLeaveRecordQuery leaveRecordQuery = new AttendanceLeaveRecordQuery();
leaveRecordQuery.setCreateTimeStart(DateUtil.beginOfMonth(new Date()).toDateStr());
leaveRecordQuery.setCreateTimeEnd(DateUtil.today());
leaveRecordQuery.setProcessStatus(ProcessStatusEnum.已处理.getValue());
int levealPersonNum = leaveRecordService.count(leaveRecordQuery, getContext());
//总打卡记录 //总打卡记录
long totalAttend = attendanceRecordEntities.parallelStream().flatMap(item -> item.getAttendanceRecordDetailList().stream()).count(); long totalAttend = attendanceRecordEntities.parallelStream().flatMap(item -> item.getAttendanceRecordDetailList().stream()).count();
......
...@@ -87,8 +87,8 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService { ...@@ -87,8 +87,8 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
eventTypes.add(196891); eventTypes.add(196891);
doorEventReq.setEventTypes(eventTypes); doorEventReq.setEventTypes(eventTypes);
// 获取当天的开始时间 // 获取当天的开始时间
// Date todayStart = DateUtil.offsetHour(new Date(), -5).toJdkDate(); // Date todayStart = DateUtil.offsetHour(new Date(), -5).toJdkDate();
Date todayStart = DateUtil.beginOfDay(new Date()); Date todayStart = DateUtil.beginOfDay(new Date());
// 获取当天的结束时间 // 获取当天的结束时间
Date todayEnd = DateUtil.endOfDay(new Date()); Date todayEnd = DateUtil.endOfDay(new Date());
doorEventReq.setStartTime(todayStart); doorEventReq.setStartTime(todayStart);
...@@ -106,7 +106,7 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService { ...@@ -106,7 +106,7 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
doorEventReq.setPageNo(i); doorEventReq.setPageNo(i);
doorEventReq.setPageSize(1000); doorEventReq.setPageSize(1000);
doorEventsRest = hikDoorService.getDoorEvents(doorEventReq); doorEventsRest = hikDoorService.getDoorEvents(doorEventReq);
log.info("doorEventsRest:{} msg:{},page:{}", doorEventsRest.getCode(), doorEventsRest.getMsg(), doorEventReq.getPageNo()); // log.info("doorEventsRest:{} msg:{},page:{}", doorEventsRest.getCode(), doorEventsRest.getMsg(), doorEventReq.getPageNo());
getDoorEvents(doorEventsRest); getDoorEvents(doorEventsRest);
} }
} }
...@@ -117,6 +117,12 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService { ...@@ -117,6 +117,12 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
List<AttendanceRecordHikEntity> attRecords = doorEventsRest.getData().getList().stream().map(item -> { List<AttendanceRecordHikEntity> attRecords = doorEventsRest.getData().getList().stream().map(item -> {
AttendanceRecordHikEntity recordHikEntity = new AttendanceRecordHikEntity(); AttendanceRecordHikEntity recordHikEntity = new AttendanceRecordHikEntity();
recordHikEntity.initAttrValue(); recordHikEntity.initAttrValue();
if (ObjectUtils.isEmpty(item.getJobNo())) {
log.info("jobNo is null ");
return null;
}
StaffEntity staffCache = staffService.getExtCache(StrUtil.padPre(item.getJobNo(), 8, "0")); StaffEntity staffCache = staffService.getExtCache(StrUtil.padPre(item.getJobNo(), 8, "0"));
if (ObjectUtils.isEmpty(staffCache)) { if (ObjectUtils.isEmpty(staffCache)) {
log.info("staff is null !staffCode:{}", item.getJobNo()); log.info("staff is null !staffCode:{}", item.getJobNo());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment