|  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private CarUseBookMapper carUseBookMapper; | 
 |  |  |     @Autowired | 
 |  |  |     private ApproveMapper approveMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private UserActionMapper userActionMapper; | 
 |  |  | 
 |  |  |             wxPlatNotice.sendCarUseBookTemplateNotice(systemDictDataBiz, | 
 |  |  |                     wxNoticeConfigMapper,carUseBook, | 
 |  |  |                     WxPlatConstants.carUseBookContent.carUseBookUpload, | 
 |  |  |                     systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), | 
 |  |  |                     Arrays.asList(systemUser.getOpenid().split(",")),0); | 
 |  |  |         } | 
 |  |  |         return carUseBook.getId(); | 
 |  |  | 
 |  |  |         params[2]=model.getCarCode()+"-【乘车人:"+model.getMemberNames()+" 】-【预约人:"+model.getMemberName()+"】-【时间:"+DateUtil.getPlusTime2(model.getStartTime())+"-"+DateUtil.getPlusTime2(model.getEndTime())+"】"; | 
 |  |  |         //记录删除日志 | 
 |  |  |         UserActionServiceImpl.saveUserActionBiz(user,id,Constants.UserActionType.CAR_BOOK_DEL,userActionMapper,date,params, JSONObject.toJSONString(model)); | 
 |  |  |  | 
 |  |  |         VisitsServiceImpl.dealCancelNoticesData(noticesJoinMapper,approveMapper,"系统删除",model.getId(), | 
 |  |  |                 Constants.equalsInteger(model.getType(),Constants.ZERO)?Constants.approveObjectType.cityUseCar:Constants.approveObjectType.unCityUseCar, | 
 |  |  |                 Constants.noticesObjectType.useCar | 
 |  |  |         ); | 
 |  |  |     } | 
 |  |  |     @Override | 
 |  |  |     public void delete(CarUseBook carUseBook) { | 
 |  |  | 
 |  |  |         queryWrapper.select("t4.company_name_path",CarUseBook::getCompanyName); | 
 |  |  |         queryWrapper.leftJoin(Member.class,Member::getId,CarUseBook::getMemberId) | 
 |  |  |                     .leftJoin(Member.class,Member::getId,CarUseBook::getDriverId) | 
 |  |  |                     .leftJoin("company t4 on t1.company_id=t4.id");   //数据权限开始--------------------start---------------- | 
 |  |  |                     .leftJoin("company t4 on t1.company_id=t4.id"); | 
 |  |  |         //数据权限开始--------------------start---------------- | 
 |  |  |         LoginUserInfo userInfo =pageWrap.getModel().getLoginUserInfo(); | 
 |  |  |         if(userInfo!=null && userInfo.getCompanyIdList()!=null){ | 
 |  |  |             if( userInfo.getCompanyIdList().size() ==0){ | 
 |  |  | 
 |  |  |                 .set(Approve::getStatus,Constants.FOUR) | 
 |  |  |                 .set(Approve::getCheckInfo,"用车申请取消") | 
 |  |  |                 .in(Approve::getStatus,Constants.ZERO,Constants.ONE) | 
 |  |  |                .in(Approve::getObjType,Constants.approveObjectType.cityUseCar,Constants.approveObjectType.unCityUseCar) | 
 |  |  |                 .in(Approve::getObjType,Constants.approveObjectType.cityUseCar,Constants.approveObjectType.unCityUseCar) | 
 |  |  |                 .eq(Approve::getObjId,id) | 
 |  |  |         ); | 
 |  |  |  | 
 |  |  | 
 |  |  |                         wxNoticeConfigMapper, | 
 |  |  |                         carUseBook, | 
 |  |  |                         WxPlatConstants.carUseBookContent.carUseBookCancel, | 
 |  |  |                         systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), | 
 |  |  |                         Arrays.asList(systemUser.getOpenid().split(",")), | 
 |  |  |                         Constants.TWO); | 
 |  |  |             } | 
 |  |  | 
 |  |  |             //申请人可以撤销自己申请中的申请记录 | 
 |  |  |             return  Constants.ONE; | 
 |  |  |         } | 
 |  |  |         if(Constants.equalsInteger(carUseBook.getStatus(),Constants.TWO) && carUseBook.getStartTime()!=null | 
 |  |  |         if(Constants.equalsInteger(carUseBook.getStatus(),Constants.TWO) | 
 |  |  |                  && carUseBook.getStartTime()!=null | 
 |  |  |                  && System.currentTimeMillis() >= carUseBook.getStartTime().getTime()){ | 
 |  |  |             //审批通过,但是 已到发车时间,不可以撤销 | 
 |  |  |             return Constants.ZERO; | 
 |  |  |         } | 
 |  |  |         if(!(Constants.equalsInteger(carUseBook.getStatus(),Constants.ZERO)) | 
 |  |  |         if((Constants.equalsInteger(carUseBook.getStatus(),Constants.ZERO)) | 
 |  |  |                 ||Constants.equalsInteger(carUseBook.getStatus(),Constants.ONE) | 
 |  |  |                 ||Constants.equalsInteger(carUseBook.getStatus(),Constants.TWO)){ | 
 |  |  |             //审批人可以撤销 自己审批的申请记录 | 
 |  |  |             Approve approve = approveJoinMapper.selectOne(new QueryWrapper<Approve>().lambda() | 
 |  |  |                     .eq(Approve::getIsdeleted,Constants.ZERO) | 
 |  |  |                     .ge(Approve::getLevel,Constants.ZERO) | 
 |  |  |                     .eq(Approve::getChekorId,loginUserInfo.getId()) | 
 |  |  |                     .eq(Approve::getChekorId,loginUserInfo.getMemberId()) | 
 |  |  |                     .eq(Approve::getObjId,carUseBook.getId()) | 
 |  |  |                     .eq(Approve::getObjType,carUseBook.getType()==0?3:4) | 
 |  |  |                     .last("limit 1")); |