From 0ddf64959252ef28c6050bbe0c0c64f99468ed25 Mon Sep 17 00:00:00 2001 From: k94314517 <8417338+k94314517@user.noreply.gitee.com> Date: 星期五, 18 十月 2024 11:21:40 +0800 Subject: [PATCH] 代码初始化 --- server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java | 109 +++++++++++++++++++++++++++++++++--------------------- 1 files changed, 66 insertions(+), 43 deletions(-) diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java index 9d76f27..45a748e 100644 --- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java +++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java @@ -22,6 +22,7 @@ import com.doumee.dao.business.join.VisitsJoinMapper; import com.doumee.dao.business.model.*; import com.doumee.dao.web.reqeust.SavePlatformWarnEventDTO; +import com.doumee.service.business.PlatformJobService; import com.doumee.service.business.impl.PlatformWarnEventServiceImpl; import com.github.yulichang.wrapper.MPJLambdaWrapper; import lombok.extern.slf4j.Slf4j; @@ -86,6 +87,8 @@ private PlatformLogMapper platformLogMapper; @Autowired private PlatformWarnEventServiceImpl platformWarnEventService; + @Autowired + private PlatformJobService platformJobService; /** * 娴峰悍闂ㄧ浜嬩欢鎺ㄩ�� * @param param @@ -822,55 +825,75 @@ .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() + + if(Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.PARK_PASS_IN.getKey()){ + 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 if(Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.PARK_PASS_OUT.getKey()){ + //绂诲満鍒ゆ柇鏄惁瀛樺湪鏈鍦虹殑璁㈠崟鏁版嵁 澶勭悊璁㈠崟鏁版嵁 + List<PlatformJob> platformJobList = platformJobMapper.selectList(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); + Constants.PlatformJobStatus.DONE.getKey(), + Constants.PlatformJobStatus.AUTHED_LEAVE.getKey() + )); + if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobList)){ + for (PlatformJob platformJob:platformJobList) { + platformJob.setStatus(Constants.PlatformJobStatus.LEAVED.getKey()); + platformJob.setOutDate(new Date()); + platformJob.setEditDate(new Date()); + platformJob.setOutType(Constants.ZERO); + platformJobMapper.updateById(platformJob); + //娓呯┖鎺堟潈 + platformJobService.cancelInPark(platformJob); } - platformJobMapper.updateById(platformJob); } } - }; - - - }else{ Visits visits = visitsMapper.selectOne(new QueryWrapper<Visits>().lambda() .eq(Visits::getCarNos,event.getPlateNos()) -- Gitblit v1.9.3