|  |  | 
 |  |  |     @Autowired | 
 |  |  |     private RetentionMapper retentionMapper; | 
 |  |  |     @Autowired | 
 |  |  |     private VisitsMapper visitsMapper; | 
 |  |  |     private VisitsJoinMapper visitsMapper; | 
 |  |  |     @Autowired | 
 |  |  |     private ApproveMapper approveMapper; | 
 |  |  |     @Autowired | 
 |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = {BusinessException.class,Exception.class}) | 
 |  |  |     public Integer createFk(Visits visits,Boolean isERP,Integer source) { | 
 |  |  |         visits.setId(null); | 
 |  |  |         isValidBaseParam(visits); | 
 |  |  |         //检查是否必须答题,并且符合答题要求 | 
 |  |  |         ProblemLog problemLog = isValidProblemLog(visits,source); | 
 |  |  | 
 |  |  |         //初始化访客信息 | 
 |  |  | //        initVisitInfo(visits,date); | 
 |  |  |         visitsMapper.insert(visits); | 
 |  |  |         if(Objects.nonNull(visits.getLoginUserInfo())){ | 
 |  |  |             SystemUser systemUser = systemUserMapper.selectById(visits.getLoginUserInfo().getId()); | 
 |  |  |             if(Objects.nonNull(systemUser)&&StringUtils.isNotBlank(systemUser.getOpenid())){ | 
 |  |  |                 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(), | 
 |  |  |                         Arrays.asList(systemUser.getOpenid().split(",")) | 
 |  |  |                 ); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         approveService.createApproveFlow(visits.getType(),visits.getId(),visits.getReceptMemberId()); | 
 |  |  |         return visits.getId(); | 
 |  |  |     } | 
 |  |  | 
 |  |  |             result.setBusinessStatus(result.getStatus()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         Notices notices = noticesJoinMapper.selectOne(new QueryWrapper<Notices>().lambda() | 
 |  |  |                 .eq(Notices::getObjId,id) | 
 |  |  |                 .eq(Notices::getType,Constants.equalsInteger(result.getType(),Constants.TWO)?Constants.noticesObjectType.visitReporting:Constants.noticesObjectType.visit) | 
 |  |  |                 .eq(Notices::getUserId,memberId) | 
 |  |  |                 .eq(Notices::getSendacopy,Constants.ZERO) | 
 |  |  |                 .orderByDesc(Notices::getId).last(" limit 1 ")); | 
 |  |  |         if(Objects.nonNull(notices)){ | 
 |  |  |             if(Constants.equalsInteger(notices.getStatus(),Constants.ZERO)){ | 
 |  |  |                 result.setInfo("待我处理"); | 
 |  |  |             }else{ | 
 |  |  |                 result.setInfo(notices.getInfo()); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         return result; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |                             memberId) | 
 |  |  |             ); | 
 |  |  | //        } | 
 |  |  |  | 
 |  |  |         Notices notices = noticesJoinMapper.selectOne(new QueryWrapper<Notices>().lambda() | 
 |  |  |                 .eq(Notices::getObjId,id) | 
 |  |  |                 .eq(Notices::getType,Constants.equalsInteger(visits.getType(),Constants.TWO)?Constants.noticesObjectType.visitReporting:Constants.noticesObjectType.visit) | 
 |  |  |                 .eq(Notices::getUserId,memberId) | 
 |  |  |                 .eq(Notices::getSendacopy,Constants.ZERO) | 
 |  |  |                 .orderByDesc(Notices::getId).last(" limit 1 ")); | 
 |  |  |         if(Objects.nonNull(notices)){ | 
 |  |  |             if(Constants.equalsInteger(notices.getStatus(),Constants.ZERO)){ | 
 |  |  |                 visitDetailVO.setInfo("待我处理"); | 
 |  |  |             }else{ | 
 |  |  |                 visitDetailVO.setInfo(notices.getInfo()); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         return visitDetailVO; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |                 SmsEmailServiceImpl.sendVisitTimeOutSms(systemDictDataBiz, | 
 |  |  |                         emayService,smsEmailMapper,smsConfigMapper, | 
 |  |  |                         SmsConstants.visitContent.visitTimeOutSignOutNum, | 
 |  |  |                         visitReportTimeCount.toString(),Arrays.asList(mobile.split(",")) | 
 |  |  |                         visitTimeCount.toString(),Arrays.asList(mobile.split(",")) | 
 |  |  |                 ); | 
 |  |  |             } | 
 |  |  |         } |