| | |
| | | import com.doumee.core.haikang.model.param.request.VisitAppointmentRequest; |
| | | import com.doumee.core.haikang.model.param.respose.VisitAppointmentResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.dao.business.dao.*; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | |
| | | import com.doumee.dao.admin.response.InterestedListVO; |
| | | import com.doumee.dao.admin.response.PCWorkPlatformDataVO; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.CompanyMapper; |
| | | import com.doumee.dao.business.dao.MemberMapper; |
| | | import com.doumee.dao.business.dao.SmsConfigMapper; |
| | | import com.doumee.dao.business.dao.SmsEmailMapper; |
| | | import com.doumee.dao.business.dto.ResetPasswordDTO; |
| | | import com.doumee.dao.business.join.DeviceJoinMapper; |
| | | import com.doumee.dao.business.join.VisitsJoinMapper; |
| | |
| | | private RetentionMapper retentionMapper; |
| | | @Autowired |
| | | private VisitsJoinMapper visitsMapper; |
| | | @Autowired |
| | | private UserActionMapper userActionMapper; |
| | | @Autowired |
| | | private ApproveMapper approveMapper; |
| | | @Autowired |
| | |
| | | }else if(dataSyncConfig.getVisitorDataOrigin().equals(Constants.ZERO)){ |
| | | visits.setStatus(Constants.VisitStatus.waitCheck); |
| | | visitsMapper.updateById(visits); |
| | | approveService.createApproveFlow(visits.getType(),visits.getId(),visits.getReceptMemberId()); |
| | | approveService.createApproveFlow(visits.getType(),visits.getId(),visits.getReceptMemberId(),member); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,发起拜访审批申请失败!"); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | approveService.createApproveFlow(visits.getType(),visits.getId(),visits.getReceptMemberId()); |
| | | approveService.createApproveFlow(visits.getType(),visits.getId(),visits.getReceptMemberId(),null); |
| | | return visits.getId(); |
| | | } |
| | | |
| | |
| | | public void deleteById(Integer id) { |
| | | visitsMapper.deleteById(id); |
| | | } |
| | | @Override |
| | | @Transactional(rollbackFor ={BusinessException.class,Exception.class}) |
| | | public void deleteById(Integer id,LoginUserInfo user) { |
| | | Visits model = visitsMapper.selectById(id); |
| | | if(model ==null || Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | Date date = new Date(); |
| | | visitsMapper.update(null,new UpdateWrapper<Visits>().lambda() |
| | | .set(Visits::getIsdeleted,Constants.ONE) |
| | | .set(Visits::getEditDate,new Date()) |
| | | .set(Visits::getEditor,user.getId()) |
| | | .eq(Visits::getId,id)); |
| | | String[] params = new String[3]; |
| | | params[0] = user.getRealname(); |
| | | params[1]=DateUtil.getPlusTime2(date); |
| | | if(Constants.equalsInteger(model.getType(),Constants.TWO)){ |
| | | params[2]=model.getCarNos()+"-【单位:"+model.getCompanyName()+" "+model.getName()+" "+model.getPhone()+"】-【时间:"+DateUtil.getPlusTime2(model.getStarttime())+"-"+DateUtil.getPlusTime2(model.getEndtime())+"】"; |
| | | //记录删除访客报备日志 |
| | | UserActionServiceImpl.saveUserActionBiz(user,id,Constants.UserActionType.VISIT_DEL,userActionMapper,date,params, JSONObject.toJSONString(model)); |
| | | }else{ |
| | | params[2]=model.getCompanyName()+"-【访客:"+model.getName()+" "+model.getPhone()+"】-【时间:"+DateUtil.getPlusTime2(model.getStarttime())+"-"+DateUtil.getPlusTime2(model.getEndtime())+"】"; |
| | | //记录删除访客申请日志 |
| | | UserActionServiceImpl.saveUserActionBiz(user,id,Constants.UserActionType.VISIT_DEL,userActionMapper,date,params, JSONObject.toJSONString(model)); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Visits visits) { |
| | |
| | | queryWrapper.leftJoin("Member t3 on t.CREATE_MEMBER_ID=t3.id"); |
| | | |
| | | queryWrapper.eq(Visits::getId,id); |
| | | queryWrapper.eq(Visits::getIsdeleted,Constants.ZERO); |
| | | Visits result = visitsJoinMapper.selectJoinOne(Visits.class,queryWrapper); |
| | | |
| | | if(result!=null){ |
| | |
| | | List<DeviceRole> deviceRoleList= deviceRoleMapper.selectList(deviceQuery); |
| | | result.setDeviceRoleList(deviceRoleList); |
| | | } |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | |
| | | MPJLambdaWrapper<Visits> visitQuery = new MPJLambdaWrapper<>(); |
| | |
| | | @Override |
| | | public VisitDetailVO getVisitDetail(Integer id,Integer memberId){ |
| | | Visits visits = visitsMapper.selectById(id); |
| | | if(Objects.isNull(visits)){ |
| | | if(Objects.isNull(visits) || Constants.equalsInteger(visits.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | Member member = memberMapper.selectById(visits.getReceptMemberId()); |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!visits.getStatus().equals(Constants.VisitStatus.signin)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"访客记录状态错误,请刷新重试"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"仅支持【拜访中】状态进行该离场操作,请刷新重试"); |
| | | } |
| | | VisitAppointmentOutRequest request = new VisitAppointmentOutRequest(); |
| | | request.setOrderId(visits.getHkId()); |