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

修改本月统计

parent 025c8f14
......@@ -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.common.code.GoWorkResultEnum;
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.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.feign.user.IUserFeign;
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.AttendanceRecordService;
import com.mortals.xhx.module.attendance.service.AttendanceVacationRecordService;
......@@ -80,6 +82,9 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired
private AttendanceVacationRecordService vacationRecordService;
@Autowired
private AttendanceLeaveRecordService leaveRecordService;
@Autowired
private StaffService staffService;
@Autowired
......@@ -233,10 +238,17 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
.count();
AttendanceVacationRecordQuery vacationRecordQuery = new AttendanceVacationRecordQuery();
/* AttendanceVacationRecordQuery vacationRecordQuery = new AttendanceVacationRecordQuery();
vacationRecordQuery.setCreateTimeStart(DateUtil.beginOfMonth(new Date()).toDateStr());
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();
......
......@@ -106,7 +106,7 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
doorEventReq.setPageNo(i);
doorEventReq.setPageSize(1000);
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);
}
}
......@@ -117,6 +117,12 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
List<AttendanceRecordHikEntity> attRecords = doorEventsRest.getData().getList().stream().map(item -> {
AttendanceRecordHikEntity recordHikEntity = new AttendanceRecordHikEntity();
recordHikEntity.initAttrValue();
if (ObjectUtils.isEmpty(item.getJobNo())) {
log.info("jobNo is null ");
return null;
}
StaffEntity staffCache = staffService.getExtCache(StrUtil.padPre(item.getJobNo(), 8, "0"));
if (ObjectUtils.isEmpty(staffCache)) {
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