| | |
| | | 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; |
| | |
| | | .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 |