| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理待审核、审核中、已审核的数据取消业务 |
| | | * 2025年3月25日14:10:10 |
| | | */ |
| | | @Override |
| | | public void visitsCancel(Integer visitId,LoginUserInfo loginUserInfo){ |
| | | public void visitsSelfCancel(Integer visitId,Integer memberId){ |
| | | Visits visits = visitsMapper.selectById(visitId); |
| | | if(Objects.isNull(visits)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!(Constants.equalsInteger(loginUserInfo.getMemberId(),visits.getMemberId()) || |
| | | Constants.equalsInteger(loginUserInfo.getMemberId(),visits.getCreateMemberId()) || |
| | | ( CollectionUtils.isNotEmpty(loginUserInfo.getPermissions()) && |
| | | loginUserInfo.getPermissions().stream().filter(i->i.equals("business:visits:cancel")).collect(Collectors.toList()).size()>0))){ |
| | | if(!(Constants.equalsInteger(memberId,visits.getMemberId()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无此操作权限"); |
| | | } |
| | | this.visitsCancelBiz(visits); |
| | | } |
| | | |
| | | @Override |
| | | public void visitsCancel(Integer visitId,LoginUserInfo loginUserInfo) { |
| | | Visits visits = visitsMapper.selectById(visitId); |
| | | if (Objects.isNull(visits)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!( |
| | | CollectionUtils.isNotEmpty(loginUserInfo.getPermissions()) && |
| | | loginUserInfo.getPermissions().stream().filter(i->i.equals("business:visits:cancel")).collect(Collectors.toList()).size()>0)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无此操作权限"); |
| | | } |
| | | this.visitsCancelBiz(visits); |
| | | } |
| | | /** |
| | | * 处理待审核、审核中、已审核的数据取消业务 |
| | | * 2025年3月25日14:10:10 |
| | | */ |
| | | public void visitsCancelBiz(Visits visits){ |
| | | UpdateWrapper<Visits> updateWrapper = new UpdateWrapper(); |
| | | updateWrapper.lambda().set(Visits::getStatus,Constants.VisitStatus.cancel) |
| | | .set(Visits::getEditDate,DateUtil.getCurrDateTime()) |
| | | .set(Visits::getEditor,loginUserInfo.getId()) |
| | | .eq(Visits::getId,visitId); |
| | | .set(Visits::getEditor,visits.getEditor()) |
| | | .eq(Visits::getId,visits.getId()); |
| | | //访客报备 |
| | | if(Constants.equalsInteger(visits.getType(),Constants.TWO)){ |
| | | if(!(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.waitCheck)||Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.submitCheck) |
| | |
| | | .set(Notices::getInfo,"手动取消") |
| | | // .set(Notices::getStatus,Constants.ONE) |
| | | .set(Notices::getParam2,Constants.FOUR)//已取消 |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getStatus,Constants.ZERO) |
| | | .eq(Notices::getParam2,Constants.ZERO)//待处理 |
| | | .eq(Notices::getObjId,visits.getId()) |
| | |
| | | .set(Notices::getEditDate,new Date()) |
| | | .set(Notices::getInfo,info) |
| | | .set(Notices::getParam2,Constants.FOUR)//已取消 |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getStatus,Constants.ZERO) |
| | | .eq(Notices::getParam2,Constants.ZERO)//待处理 |
| | | .eq(Notices::getObjId,objId) |