| | |
| | | @Autowired |
| | | private ApproveMapper approveMapper; |
| | | @Autowired |
| | | private NoticesJoinMapper noticesJoinMapper; |
| | | @Autowired |
| | | private ApproveParamMapper approveParamMapper; |
| | | @Autowired |
| | | private DeviceRoleMapper deviceRoleMapper; |
| | |
| | | private SystemUserMapper systemUserMapper; |
| | | @Autowired |
| | | private ApproveService approveService; |
| | | @Autowired |
| | | private NoticesJoinMapper noticesJoinMapper; |
| | | @Autowired |
| | | private InoutDayCountMapper inoutDayCountMapper; |
| | | @Autowired |
| | |
| | | @Override |
| | | public void visitNoCheckCancel(){ |
| | | List<Visits> visitsList = visitsMapper.selectList(new QueryWrapper<Visits>().lambda() |
| | | .eq(Visits::getIsdeleted,Constants.ONE) |
| | | .eq(Visits::getIsdeleted,Constants.ZERO) |
| | | .eq(Visits::getStatus,Constants.VisitStatus.waitCheck) |
| | | .apply(" now() >= ENDTIME ") |
| | | ); |
| | | if(visitsList!=null){ |
| | | Date date =new Date(); |
| | | for(Visits s :visitsList){ |
| | | visitsMapper.update(null,new UpdateWrapper<Visits>().lambda() |
| | | .set(Visits::getIsdeleted,Constants.VisitStatus.cancel) |
| | | .set(Visits::getEditDate,date) |
| | | .set(Visits::getRemark,"预约截止时间已过未审批,系统自动取消") |
| | | .eq(Visits::getId,s.getId())); |
| | | dealAutoCancelBiz(s,date); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Transactional |
| | | private void dealAutoCancelBiz(Visits s, Date date) { |
| | | visitsMapper.update(null,new UpdateWrapper<Visits>().lambda() |
| | | .set(Visits::getStatus,Constants.VisitStatus.cancel) |
| | | .set(Visits::getEditDate,date) |
| | | .set(Visits::getRemark,"预约截止时间已过未审批,系统自动取消") |
| | | .eq(Visits::getId,s.getId())); |
| | | //更新审批中的记录为取消 |
| | | approveMapper.update(null, |
| | | new UpdateWrapper<Approve>().lambda() |
| | | .set(Approve::getEditDate,date) |
| | | .set(Approve::getStatus,Constants.approveStatus.cancel) |
| | | .eq(Approve::getIsdeleted,Constants.ZERO) |
| | | .eq(Approve::getStatusInfo,"已取消") |
| | | .eq(Approve::getCheckInfo,"访问时间已过,系统自动取消") |
| | | .in(Approve::getStatus,Constants.approveStatus.auditIng,Constants.approveStatus.wait) |
| | | .eq(Approve::getObjId,s.getId()) |
| | | .eq(Approve::getObjType,s.getType())); |
| | | noticesJoinMapper.update(null, |
| | | new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getEditDate,date) |
| | | .set(Notices::getInfo,"已取消") |
| | | // .set(Notices::getStatus,Constants.ONE) |
| | | .set(Notices::getParam2,Constants.FOUR)//已取消 |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getStatus,Constants.ZERO) |
| | | .eq(Notices::getParam2,Constants.ZERO)//待处理 |
| | | .eq(Notices::getObjId,s.getId()) |
| | | .eq(Notices::getObjType,Constants.equalsInteger(s.getType(),Constants.ZERO)?Constants.noticesObjectType.visit:Constants.noticesObjectType.visitReporting) |
| | | ); |
| | | } |
| | | |
| | | |
| | | } |