| | |
| | | if (erpVisitDTO.getEndtime().getTime() <= erpVisitDTO.getStarttime().getTime()) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,预约结束时间必须大于开始时间!"); |
| | | } |
| | | if (Constants.equalsInteger(Constants.ZERO, erpVisitDTO.getIdcardType()) && erpVisitDTO.getIdcardNo().length() != 18 |
| | | if (StringUtils.isNotBlank(erpVisitDTO.getIdcardNo()) && Constants.equalsInteger(Constants.ZERO, erpVisitDTO.getIdcardType()) && erpVisitDTO.getIdcardNo().length() != 18 |
| | | //&&!IdcardUtil.isValidCard(visits.getIdcardNo()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,身份证号码有误,请核实后重试!"); |
| | |
| | | getHkDeviceRoles(visits,isERP); |
| | | //检验拜访人是否合法 |
| | | Member visitMember = isValideVisitedUser(visits.getReceptMemberId()); |
| | | if(Constants.equalsInteger(Constants.ZERO, visits.getIdcardType()) |
| | | &&visits.getIdcardNo().length()!=18 |
| | | ){ |
| | | if(StringUtils.isNotBlank(visits.getIdcardNo()) && Constants.equalsInteger(Constants.ZERO, visits.getIdcardType()) |
| | | &&visits.getIdcardNo().length()!=18 ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,身份证号码有误,请核实后重试!"); |
| | | } |
| | | Date date = new Date(); |
| | |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper,visits, |
| | | Constants.equalsInteger(visits.getType(),Constants.TWO)?WxPlatConstants.visitReportContent.visitReportUpload:WxPlatConstants.visitContent.visitUpload, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Constants.equalsInteger(visits.getType(),Constants.TWO)?WxPlatConstants.visitReportContent.visitReportUpload:WxPlatConstants.visitContent.visitUpload, |
| | | Arrays.asList(visits.getOpenid().split(",")) |
| | | ); |
| | | } |
| | |
| | | |
| | | return visits.getId(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | |
| | | wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper,visits, |
| | | Constants.equalsInteger(visits.getType(),Constants.TWO)?WxPlatConstants.visitReportContent.visitReportUpload:WxPlatConstants.visitContent.visitUpload, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(systemUser.getOpenid().split(",")) |
| | | ); |
| | | } |
| | |
| | | queryWrapper.isNull(Visits::getParentId); |
| | | queryWrapper.eq(Objects.nonNull(pageWrap.getModel().getMemberId()),Visits::getMemberId,pageWrap.getModel().getMemberId()); |
| | | queryWrapper.eq(Objects.nonNull(pageWrap.getModel().getReceptMemberId()),Visits::getReceptMemberId,pageWrap.getModel().getReceptMemberId()); |
| | | queryWrapper.ge(Objects.nonNull(pageWrap.getModel().getQueryStarttime()),Visits::getStarttime,Utils.Date.getStart(pageWrap.getModel().getQueryStarttime())); |
| | | queryWrapper.le(Objects.nonNull(pageWrap.getModel().getQueryEndtime()),Visits::getStarttime,Utils.Date.getEnd(pageWrap.getModel().getQueryEndtime())); |
| | | |
| | | |
| | | if(Objects.nonNull(pageWrap.getModel().getBusinessStatus())){ |
| | | if(Constants.equalsInteger(pageWrap.getModel().getBusinessStatus(),Constants.TWO)){ |
| | |
| | | .eq(Notices::getStatus,Constants.ZERO) |
| | | .eq(Notices::getParam2,Constants.ZERO)//待处理 |
| | | .eq(Notices::getObjId,visits.getId()) |
| | | .eq(Notices::getObjType,Constants.equalsInteger(visits.getType(),Constants.ZERO)?Constants.noticesObjectType.visit:Constants.noticesObjectType.visitReporting) |
| | | .eq(Notices::getObjType,!Constants.equalsInteger(visits.getType(),Constants.TWO)? |
| | | Constants.noticesObjectType.visit:Constants.noticesObjectType.visitReporting) |
| | | ); |
| | | |
| | | Approve approve = new Approve(); |
| | |
| | | List<InterestedListVO> weekVisitList = new ArrayList<>(); |
| | | List<InterestedListVO> weekCarList = new ArrayList<>(); |
| | | List<InterestedListVO> lwList = new ArrayList<>(); |
| | | List<InterestedListVO> internalList = new ArrayList<>(); |
| | | //查询七天前的访客记录数量 |
| | | List<Visits> visitsList = visitsMapper.selectList(new QueryWrapper<Visits>().lambda().in(Visits::getStatus, |
| | | Constants.VisitStatus.signin,Constants.VisitStatus.signout) |
| | |
| | | .eq(Company::getIsdeleted,Constants.ZERO) |
| | | ); |
| | | |
| | | |
| | | |
| | | if(CollectionUtils.isNotEmpty(companyList)){ |
| | | List<Integer> companyIds = companyList.stream().map(i->i.getId()).collect(Collectors.toList()); |
| | | List<Retention> retentionList = retentionMapper.selectList( |
| | | new QueryWrapper<Retention>().lambda() |
| | | .eq(Retention::getType,Constants.TWO) |
| | | .in(Retention::getCompanyId,companyIds) |
| | | ); |
| | | for (Company company:companyList) { |
| | | Integer count = retentionList.stream().filter(i->Constants.equalsInteger(i.getCompanyId(),company.getId())).collect(Collectors.toList()).size(); |
| | | if(count>0){ |
| | | InterestedListVO lw = new InterestedListVO(); |
| | | lw.setNum(count); |
| | | lw.setName(company.getName()); |
| | | lwList.add(lw); |
| | | List<Company> lwCompanyList = companyList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ZERO)).collect(Collectors.toList()); |
| | | if(CollectionUtils.isNotEmpty(lwCompanyList)){ |
| | | 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) |
| | | .in(Retention::getCompanyId,lwCompanyIds) |
| | | ); |
| | | for (Company company:lwCompanyList) { |
| | | Integer count = retentionList.stream().filter(i->Constants.equalsInteger(i.getCompanyId(),company.getId())).collect(Collectors.toList()).size(); |
| | | if(count>0){ |
| | | InterestedListVO lw = new InterestedListVO(); |
| | | lw.setNum(count); |
| | | lw.setName(company.getName()); |
| | | lwList.add(lw); |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<Company> internalCompanyList = companyList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)).collect(Collectors.toList()); |
| | | if(CollectionUtils.isNotEmpty(internalCompanyList)){ |
| | | List<Integer> internalCompanyIds = internalCompanyList.stream().map(i->i.getId()).collect(Collectors.toList()); |
| | | List<Retention> retentionList = retentionMapper.selectList( |
| | | new QueryWrapper<Retention>().lambda() |
| | | .eq(Retention::getType,Constants.TWO) |
| | | .in(Retention::getCompanyId,internalCompanyIds) |
| | | ); |
| | | for (Company company:internalCompanyList) { |
| | | Integer count = retentionList.stream().filter(i->Constants.equalsInteger(i.getCompanyId(),company.getId())).collect(Collectors.toList()).size(); |
| | | if(count>0){ |
| | | InterestedListVO lw = new InterestedListVO(); |
| | | lw.setNum(count); |
| | | lw.setName(company.getName()); |
| | | internalList.add(lw); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | pcWorkPlatformDataVO.setLwList(lwList ); |
| | | pcWorkPlatformDataVO.setInternalList(internalList); |
| | | pcWorkPlatformDataVO.setLwList(lwList); |
| | | }else if(Constants.equalsInteger(queryType,Constants.THREE)) { |
| | | if (Objects.isNull(loginUserInfo.getMemberId())) { |
| | | pcWorkPlatformDataVO.setNoticesList(new ArrayList<>()); |
| | |
| | | List<Visits> visitsList = visitsMapper.selectList(new QueryWrapper<Visits>().lambda() |
| | | .eq(Visits::getStatus,Constants.VisitStatus.signin) |
| | | .eq(Visits::getSendTimeOutNotice,Constants.ZERO) |
| | | .eq(Visits::getIsdeleted,Constants.ZERO) |
| | | .apply(" now() >= DATE_ADD(ENDTIME,INTERVAL -"+times+" MINUTE) ") |
| | | ); |
| | | Integer visitTimeCount = 0; |