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

修改考勤自动审核

parent f7f3ddbf
...@@ -86,8 +86,8 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService { ...@@ -86,8 +86,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);
......
...@@ -86,8 +86,8 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService { ...@@ -86,8 +86,8 @@ public class SyncDoorsEventTaskImpl 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);
......
...@@ -63,16 +63,17 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -63,16 +63,17 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
@Override @Override
protected void saveBefore(PerformAttendRecordEntity entity, Context context) throws AppException { protected void saveBefore(PerformAttendRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity, context);
} }
@Override @Override
protected void updateBefore(PerformAttendRecordEntity entity, Context context) throws AppException { protected void updateBefore(PerformAttendRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity, context);
} }
private void updateStaffRuleNames(PerformAttendRecordEntity entity) { private void updateStaffRuleNames(PerformAttendRecordEntity entity, Context context) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) { if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString()); PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity == null ? "" : rulesEntity.getName()); entity.setRuleName(rulesEntity == null ? "" : rulesEntity.getName());
...@@ -84,6 +85,9 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -84,6 +85,9 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName()); entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
} }
entity.setErrorResult(entity.getRuleName()); entity.setErrorResult(entity.getRuleName());
entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
if (!ObjectUtils.isEmpty(entity.getAttendanceGroupId())) { if (!ObjectUtils.isEmpty(entity.getAttendanceGroupId())) {
AttendanceGroupEntity attendanceGroupEntity = attendanceGroupService.get(entity.getAttendanceGroupId()); AttendanceGroupEntity attendanceGroupEntity = attendanceGroupService.get(entity.getAttendanceGroupId());
entity.setAttendanceGroupName(attendanceGroupEntity == null ? "" : attendanceGroupEntity.getGroupName()); entity.setAttendanceGroupName(attendanceGroupEntity == null ? "" : attendanceGroupEntity.getGroupName());
...@@ -128,7 +132,8 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -128,7 +132,8 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
entity.setGoOffTimeStr(""); entity.setGoOffTimeStr("");
} }
} }
} else if (TypeEnum.自由工时.getValue() == attendanceGroupEntity.getType()) { }
else if (TypeEnum.自由工时.getValue() == attendanceGroupEntity.getType()) {
} else if (TypeEnum.排班制.getValue() == attendanceGroupEntity.getType()) { } else if (TypeEnum.排班制.getValue() == attendanceGroupEntity.getType()) {
...@@ -152,13 +157,13 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -152,13 +157,13 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
String goWorkStr = ""; String goWorkStr = "";
String offWorkStr = ""; String offWorkStr = "";
if (!ObjectUtils.isEmpty(classDetailEntity.getGoWorkDate())) { if (!ObjectUtils.isEmpty(classDetailEntity.getGoWorkDate())) {
goWorkStr = DateUtil.formatTime(classDetailEntity.getGoWorkDate()); goWorkStr = DateUtil.format(classDetailEntity.getGoWorkDate(),"HH:mm");
} }
if (!ObjectUtils.isEmpty(classDetailEntity.getOffWorkDate())) { if (!ObjectUtils.isEmpty(classDetailEntity.getOffWorkDate())) {
offWorkStr = DateUtil.formatTime(classDetailEntity.getOffWorkDate()); offWorkStr = DateUtil.format(classDetailEntity.getOffWorkDate(),"HH:mm");
} }
goOffWorkSb.append(goWorkStr); goOffWorkSb.append(goWorkStr);
goOffWorkSb.append("~~"); goOffWorkSb.append("~");
goOffWorkSb.append(offWorkStr); goOffWorkSb.append(offWorkStr);
goOffWorkSb.append(" \n"); goOffWorkSb.append(" \n");
} }
......
...@@ -45,25 +45,30 @@ public class PerformComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Pe ...@@ -45,25 +45,30 @@ public class PerformComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Pe
@Override @Override
protected void saveBefore(PerformComplainRecordEntity entity, Context context) throws AppException { protected void saveBefore(PerformComplainRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity,context);
} }
@Override @Override
protected void updateBefore(PerformComplainRecordEntity entity, Context context) throws AppException { protected void updateBefore(PerformComplainRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity,context);
} }
private void updateStaffRuleNames(PerformComplainRecordEntity entity) { private void updateStaffRuleNames(PerformComplainRecordEntity entity, Context context) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) { if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString()); PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName()); entity.setRuleName(rulesEntity.getName());
entity.setSubAddType(rulesEntity == null ? 2 : rulesEntity.getSubAddType());
} }
if (!ObjectUtils.isEmpty(entity.getStaffId())) { if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString()); StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName()); entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName()); entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
} }
entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
} }
@Override @Override
......
...@@ -45,25 +45,29 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -45,25 +45,29 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
@Override @Override
protected void saveBefore(PerformEffectRecordEntity entity, Context context) throws AppException { protected void saveBefore(PerformEffectRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity,context);
} }
@Override @Override
protected void updateBefore(PerformEffectRecordEntity entity, Context context) throws AppException { protected void updateBefore(PerformEffectRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity,context);
} }
private void updateStaffRuleNames(PerformEffectRecordEntity entity) { private void updateStaffRuleNames(PerformEffectRecordEntity entity, Context context) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) { if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString()); PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName()); entity.setRuleName(rulesEntity.getName());
entity.setSubAddType(rulesEntity == null ? 1 : rulesEntity.getSubAddType());
} }
if (!ObjectUtils.isEmpty(entity.getStaffId())) { if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString()); StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName()); entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName()); entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
} }
entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
} }
@Override @Override
......
...@@ -44,25 +44,29 @@ public class PerformGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -44,25 +44,29 @@ public class PerformGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
@Override @Override
protected void saveBefore(PerformGoworkRecordEntity entity, Context context) throws AppException { protected void saveBefore(PerformGoworkRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity,context);
} }
@Override @Override
protected void updateBefore(PerformGoworkRecordEntity entity, Context context) throws AppException { protected void updateBefore(PerformGoworkRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity,context);
} }
private void updateStaffRuleNames(PerformGoworkRecordEntity entity) { private void updateStaffRuleNames(PerformGoworkRecordEntity entity, Context context) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) { if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString()); PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName()); entity.setRuleName(rulesEntity.getName());
entity.setSubAddType(rulesEntity == null ? 1 : rulesEntity.getSubAddType());
} }
if (!ObjectUtils.isEmpty(entity.getStaffId())) { if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString()); StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName()); entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName()); entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
} }
entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
} }
@Override @Override
......
...@@ -44,25 +44,30 @@ public class PerformOtherRecordServiceImpl extends AbstractCRUDServiceImpl<Perfo ...@@ -44,25 +44,30 @@ public class PerformOtherRecordServiceImpl extends AbstractCRUDServiceImpl<Perfo
@Override @Override
protected void saveBefore(PerformOtherRecordEntity entity, Context context) throws AppException { protected void saveBefore(PerformOtherRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity,context);
} }
@Override @Override
protected void updateBefore(PerformOtherRecordEntity entity, Context context) throws AppException { protected void updateBefore(PerformOtherRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity,context);
} }
private void updateStaffRuleNames(PerformOtherRecordEntity entity) { private void updateStaffRuleNames(PerformOtherRecordEntity entity, Context context) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) { if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString()); PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName()); entity.setRuleName(rulesEntity.getName());
entity.setSubAddType(rulesEntity == null ? 1 : rulesEntity.getSubAddType());
} }
if (!ObjectUtils.isEmpty(entity.getStaffId())) { if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString()); StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName()); entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName()); entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
} }
entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
} }
@Override @Override
......
...@@ -45,25 +45,29 @@ public class PerformReviewRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -45,25 +45,29 @@ public class PerformReviewRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
@Override @Override
protected void saveBefore(PerformReviewRecordEntity entity, Context context) throws AppException { protected void saveBefore(PerformReviewRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity, context);
} }
@Override @Override
protected void updateBefore(PerformReviewRecordEntity entity, Context context) throws AppException { protected void updateBefore(PerformReviewRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity, context);
} }
private void updateStaffRuleNames(PerformReviewRecordEntity entity) { private void updateStaffRuleNames(PerformReviewRecordEntity entity, Context context) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) { if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString()); PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName()); entity.setRuleName(rulesEntity.getName());
entity.setSubAddType(rulesEntity == null ? 1 : rulesEntity.getSubAddType());
} }
if (!ObjectUtils.isEmpty(entity.getStaffId())) { if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString()); StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName()); entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName()); entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
} }
entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
} }
@Override @Override
......
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