| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 访客权限组信息表Service实现 |
| | |
| | | .last("limit 1" )); |
| | | if(cars!=null){ |
| | | event.setMemberId(cars.getMemberId()); |
| | | //自有车 查询当前是否有待签到的任务 |
| | | if(carsMapper.selectCount(new QueryWrapper<Cars>() |
| | | .lambda().eq(Cars::getCode,event.getPlateNos()) |
| | | .eq(Cars::getType,Constants.ONE) |
| | | .eq(Cars::getIsdeleted,Constants.ZERO) |
| | | )>Constants.ZERO){ |
| | | //查询车辆当前是否存在进行中的任务 |
| | | if( platformJobMapper.selectCount(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getCarCodeFront,event.getPlateNos()) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getStatus, |
| | | Constants.PlatformJobStatus.IN_WAIT.getKey(), |
| | | Constants.PlatformJobStatus.CALLED.getKey(), |
| | | Constants.PlatformJobStatus.WORKING.getKey(), |
| | | Constants.PlatformJobStatus.DONE.getKey(), |
| | | Constants.PlatformJobStatus.TRANSFERING.getKey(), |
| | | Constants.PlatformJobStatus.EXCEPTION.getKey(), |
| | | Constants.PlatformJobStatus.AUTHED_LEAVE.getKey() |
| | | ) |
| | | )<Constants.ZERO){ |
| | | PlatformJob platformJob = platformJobMapper.selectOne(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getCarCodeFront,event.getPlateNos()) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getStatus, |
| | | Constants.PlatformJobStatus.WAIT_CONFIRM.getKey(), |
| | | Constants.PlatformJobStatus.WART_SIGN_IN.getKey() |
| | | ) |
| | | .orderByAsc(PlatformJob::getCreateDate) |
| | | .last(" limit 1") |
| | | ); |
| | | if(Objects.nonNull(platformJob)){ |
| | | platformJob.setStatus(Constants.PlatformJobStatus.WAIT_CALL.getKey()); |
| | | platformJob.setArriveDate(new Date()); |
| | | platformJob.setSingType(Constants.TWO); |
| | | platformJob.setSignDate(new Date()); |
| | | List<PlatformJob> signList = platformJobMapper.selectList(new QueryWrapper<PlatformJob>().lambda().apply(" DATE(SIGN_DATE) = DATE(NOW()) and sign_date is not null ")); |
| | | if(CollectionUtils.isEmpty(signList)){ |
| | | platformJob.setSignNum(Constants.ONE); |
| | | } else{ |
| | | int maxNumber = Collections.max(signList.stream().map(i->i.getSignNum()).collect(Collectors.toList())); |
| | | platformJob.setSignNum(maxNumber + Constants.ONE); |
| | | } |
| | | platformJobMapper.updateById(platformJob); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | }else{ |
| | | Visits visits = visitsMapper.selectOne(new QueryWrapper<Visits>().lambda() |
| | | .eq(Visits::getCarNos,event.getPlateNos()) |