| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.service.business.impl.hksync.HkSyncVisitServiceImpl; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | getHkDeviceRoles(visits,isERP); |
| | | //检验拜访人是否合法 |
| | | Member visitMember = isValideVisitedUser(visits.getReceptMemberId()); |
| | | if(Constants.equalsInteger(Constants.ZERO, visits.getIdcardType())&&visits.getIdcardNo().length()!=18 |
| | | if(Constants.equalsInteger(Constants.ZERO, visits.getIdcardType()) |
| | | &&visits.getIdcardNo().length()!=18 |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,身份证号码有误,请核实后重试!"); |
| | | } |
| | |
| | | initWithVisitInfo(visits); |
| | | updateProblemLog(visits,problemLog,member); |
| | | //创建审批记录 |
| | | // createApprove(visits,visitMember); |
| | | createApprove(visits,visitMember); |
| | | |
| | | return visits.getId(); |
| | | } |
| | |
| | | VisitDetailVO visitDetailVO = new VisitDetailVO(); |
| | | visitDetailVO.setCreateTime(visits.getCreateDate()); |
| | | visitDetailVO.setStatus(visits.getStatus()); |
| | | if(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.xfSuccess) |
| | | || Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.xfFail) |
| | | || Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.signin) |
| | | || Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.signout) |
| | | || Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.invalid)){ |
| | | visitDetailVO.setBusinessStatus(Constants.VisitStatus.pass); |
| | | }else{ |
| | | visitDetailVO.setBusinessStatus(visits.getStatus()); |
| | | } |
| | | visitDetailVO.setCarNos(visits.getCarNos()); |
| | | visitDetailVO.setPhone(visits.getPhone()); |
| | | visitDetailVO.setVisitUserName(member.getName()); |
| | |
| | | .eq(Visits::getParentId,id))); |
| | | |
| | | |
| | | if(Objects.nonNull(memberId)){ |
| | | // if(Objects.nonNull(memberId)){ |
| | | visitDetailVO.setApproveDateVO( |
| | | approveService.arrangeApprovedData(id, |
| | | visits.getType(), |
| | | memberId) |
| | | ); |
| | | } |
| | | // } |
| | | return visitDetailVO; |
| | | } |
| | | |
| | |
| | | .eq(Retention::getType,Constants.memberType.visitor) |
| | | .eq(Retention::getMemberId,visits.getMemberId())); |
| | | } |
| | | @Override |
| | | public void visitResend(Integer visitId) { |
| | | MPJLambdaWrapper<Visits> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(Visits.class); |
| | | queryWrapper.selectAs(Member::getName,Visits::getReceptMemberName) |
| | | .selectAs(Member::getHkId,Visits::getReceptMemberHkId) |
| | | .leftJoin(Member.class,Member::getId,Visits::getReceptMemberId) |
| | | .eq(Visits::getId,visitId)//未同步到海康 |
| | | .last("limit 1"); |
| | | Visits visits = visitsMapper.selectJoinOne(Visits.class,queryWrapper); |
| | | if(Objects.isNull(visits)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!visits.getStatus().equals(Constants.VisitStatus.xfFail)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"访客记录状态错误,请刷新重试"); |
| | | } |
| | | List<DeviceRole> roleList = deviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda() |
| | | .eq(DeviceRole::getType, Constants.ONE)); |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | |
| | | HkSyncVisitServiceImpl.getUpdateModelByResponseIccm(visits,new Date(),roleList,path); |
| | | if(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.xfSuccess)){ |
| | | //如果下发成功, |
| | | visitsMapper.updateById(visits); |
| | | if(Objects.isNull(visits.getParentId())){ |
| | | wxPlatNotice.sendVisitAuditTemplateNotice(visits, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_PREFIX).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_AUDIT_VISIT).getCode()); |
| | | } |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"重新下发会失败!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |