From e83db5d645106ed93a6c8aff154b1b17ab984891 Mon Sep 17 00:00:00 2001 From: k94314517 <8417338+k94314517@user.noreply.gitee.com> Date: 星期二, 06 五月 2025 14:27:44 +0800 Subject: [PATCH] 代码初始化 --- server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java | 67 +++++++++++++++------------------ 1 files changed, 31 insertions(+), 36 deletions(-) diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java index 8cf3245..070d493 100644 --- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java +++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java @@ -1814,11 +1814,7 @@ //浠婃棩鍦ㄥ洯浜烘暟 pcWorkPlatformDataVO.setTodayInParkUserNum( - inoutRecordMapper.selectCount(new QueryWrapper<InoutRecord>().lambda() - .isNotNull(InoutRecord::getMemberPhone) - .isNull(InoutRecord::getCarCode) - .apply( " DATE(TIME_INFO) = CURDATE() " )) - //retentionList.stream().filter(i->!Constants.equalsInteger(i.getType(),Constants.THREE)).count() + retentionList.stream().filter(i->!Constants.equalsInteger(i.getType(),Constants.THREE)).count() ); pcWorkPlatformDataVO.setTodayInUserNum(Constants.ZERO); @@ -1826,13 +1822,7 @@ //鍦ㄥ洯闀挎湡鐩稿叧鏂逛汉鏁� pcWorkPlatformDataVO.setInParkLwUserNum( - inoutRecordMapper.selectCount(new QueryWrapper<InoutRecord>().lambda() - .eq(InoutRecord::getMemberType,Constants.TWO) - .isNotNull(InoutRecord::getMemberPhone) - .isNull(InoutRecord::getCarCode) - .apply( " DATE(TIME_INFO) = CURDATE() " )) -// retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) -// && Constants.equalsInteger(i.getCompanyType(),Constants.ZERO)).count() + retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FOUR)).count() ); pcWorkPlatformDataVO.setLwUserInNum(Constants.ZERO); pcWorkPlatformDataVO.setLwUserOutNum(Constants.ZERO); @@ -1840,30 +1830,18 @@ //鍦ㄥ洯璁垮鏁伴噺 pcWorkPlatformDataVO.setInParkVisitUserNum( - inoutRecordMapper.selectCount(new QueryWrapper<InoutRecord>().lambda() - .eq(InoutRecord::getMemberType,Constants.ZERO) - .isNotNull(InoutRecord::getMemberPhone) - .isNull(InoutRecord::getCarCode) - .apply( " DATE(TIME_INFO) = CURDATE() " )) - //retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&Objects.isNull(i.getCompanyType())).count() + retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&Objects.isNull(i.getCompanyType())).count() ); pcWorkPlatformDataVO.setVisitUserNum(Constants.ZERO); pcWorkPlatformDataVO.setSignLevelNum(Constants.ZERO); //鍦ㄥ洯璐ц繍杞﹁締鍙告満 - pcWorkPlatformDataVO.setInParkDriverUserNum(inoutRecordMapper.selectCount(new QueryWrapper<InoutRecord>().lambda() - .eq(InoutRecord::getMemberType,Constants.THREE) - .isNotNull(InoutRecord::getMemberPhone) - .isNull(InoutRecord::getCarCode) - .apply( " DATE(TIME_INFO) = CURDATE() " ))); + pcWorkPlatformDataVO.setInParkDriverUserNum( + retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FIVE)&&Objects.isNull(i.getCompanyType())).count()); //鍦ㄥ洯杞﹁締 pcWorkPlatformDataVO.setTodayInParkCarNum( - inoutRecordMapper.selectCount(new QueryWrapper<InoutRecord>().lambda() - .isNotNull(InoutRecord::getCarCode) - .isNull(InoutRecord::getMemberPhone) - .apply( " DATE(TIME_INFO) = CURDATE() " )) - //retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)).count() + retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)).count() ); pcWorkPlatformDataVO.setTodayInCarNum(Constants.ZERO); pcWorkPlatformDataVO.setTodayOutCarNum(Constants.ZERO); @@ -1894,6 +1872,11 @@ .apply(" STARTTIME > CURDATE() - INTERVAL 7 DAY " ) ); + List<InoutRecord> inoutRecordList = inoutRecordMapper.selectList(new QueryWrapper<InoutRecord>().lambda() + .eq(InoutRecord::getInOrOut,Constants.ZERO).eq(InoutRecord::getIsdeleted,Constants.ZERO) + .apply(" STARTTIME > CURDATE() - INTERVAL 7 DAY " ) + ); + List<CarEvent> carEventList = carEventMapper.selectList(new QueryWrapper<CarEvent>().lambda() .in(CarEvent::getEventType,"771760131","771760130") .apply(" STR_TO_DATE(happen_time, '%Y-%m-%dT%H:%i:%s') > CURDATE() - INTERVAL 7 DAY " ) @@ -1902,10 +1885,17 @@ for (String days:weekDays) { InterestedListVO visitVO = new InterestedListVO(); visitVO.setName(days); - if(CollectionUtils.isNotEmpty(visitsList)){ + if(CollectionUtils.isNotEmpty(inoutRecordList)){ //澶勭悊璁垮浜哄憳鏁伴噺 - List<Visits> daysList = visitsList.stream().filter(i->Objects.nonNull(i.getStarttime())&&DateUtil.dateToString(i.getStarttime(),"yyyy-MM-dd").equals(days)).collect(Collectors.toList()); - List<String> memberIds = daysList.stream().map(i->i.getMemberId().toString()).collect(Collectors.toList()); +// List<Visits> daysList = visitsList.stream().filter(i->Objects.nonNull(i.getStarttime())&&DateUtil.dateToString(i.getStarttime(),"yyyy-MM-dd").equals(days)).collect(Collectors.toList()); +// List<String> memberIds = daysList.stream().map(i->i.getMemberId().toString()).collect(Collectors.toList()); + + List<String> memberIds = inoutRecordList.stream().filter(i-> + Objects.isNull(i.getCarCode())&& + Objects.nonNull(i.getMemberPhone())&&DateUtil.dateToString(i.getTimeInfo(),"yyyy-MM-dd").equals(days) + ) + .map(i->i.getMemberPhone()) + .collect(Collectors.toList()); if(CollectionUtils.isNotEmpty(memberIds)){ visitVO.setNum(new HashSet<String>(memberIds).size()); } @@ -1919,11 +1909,16 @@ InterestedListVO carVO = new InterestedListVO(); carVO.setName(days); - - if(CollectionUtils.isNotEmpty(carEventList)){ + if(CollectionUtils.isNotEmpty(inoutRecordList)){ //澶勭悊璁垮浜哄憳鏁伴噺 - List<CarEvent> daysList = carEventList.stream().filter(i->StringUtils.isNotBlank(i.getHappenTime()) && i.getHappenTime().substring(0,10).equals(days)).collect(Collectors.toList()); - List<String> carCodeList = daysList.stream().map(i->i.getPlateNos()).collect(Collectors.toList()); +// List<CarEvent> daysList = carEventList.stream().filter(i->StringUtils.isNotBlank(i.getHappenTime()) && i.getHappenTime().substring(0,10).equals(days)).collect(Collectors.toList()); +// List<String> carCodeList = daysList.stream().map(i->i.getPlateNos()).collect(Collectors.toList()); + List<String> carCodeList = inoutRecordList.stream().filter(i-> + Objects.isNull(i.getCarCode())&& + Objects.nonNull(i.getMemberPhone())&&DateUtil.dateToString(i.getTimeInfo(),"yyyy-MM-dd").equals(days) + ) + .map(i->i.getMemberPhone()) + .collect(Collectors.toList()); if(CollectionUtils.isNotEmpty(carCodeList)){ carVO.setNum(new HashSet<String>(carCodeList).size()); } @@ -1950,7 +1945,7 @@ List<Integer> lwCompanyIds = lwCompanyList.stream().map(i->i.getId()).collect(Collectors.toList()); List<Retention> retentionList = retentionMapper.selectList( new QueryWrapper<Retention>().lambda() - .eq(Retention::getType,Constants.TWO) + .eq(Retention::getType,Constants.FOUR) .in(Retention::getCompanyId,lwCompanyIds) ); for (Company company:lwCompanyList) { -- Gitblit v1.9.3