| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.ZonedDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | |
| | | |
| | | @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")); |
| | |
| | | } |
| | | |
| | | |
| | | public void jdyPushCarUseBook(String dataInfo){ |
| | | JSONObject dataInfoJSON = JSONObject.parseObject(dataInfo); |
| | | if(dataInfoJSON.isEmpty()){ |
| | | return; |
| | | } |
| | | JSONObject dataJSON = dataInfoJSON.getJSONObject("data"); |
| | | String id = dataJSON.getString("_id"); |
| | | if(StringUtils.isEmpty(id)){ |
| | | return; |
| | | } |
| | | String carCode = dataJSON.getString("car_no"); |
| | | String startDate = dataJSON.getString("start_date"); |
| | | String endDate = dataJSON.getString("end_date"); |
| | | Integer status = dataJSON.getInteger("flowState"); |
| | | String typeInfo = dataJSON.getString("scope"); |
| | | String reason = dataJSON.getString("reason"); |
| | | String addr = dataJSON.getString("addr"); |
| | | JSONArray usersArray = dataJSON.getJSONArray("users"); |
| | | JSONObject driverJSON = dataJSON.getJSONObject("driver"); |
| | | if(!(Constants.equalsInteger(status,Constants.ONE)||Constants.equalsInteger(status,Constants.TWO))){ |
| | | |
| | | } |
| | | |
| | | CarUseBook carUseBook = carUseBookJoinMapper.selectOne(new QueryWrapper<CarUseBook>() |
| | | .lambda().eq(CarUseBook::getJdyId,id).last("limit 1")); |
| | | if(Objects.isNull(carUseBook)){ |
| | | carUseBook = new CarUseBook(); |
| | | carUseBook.setCreateDate(new Date()); |
| | | carUseBook.setCarCode(carCode); |
| | | carUseBook.setCarId(null); |
| | | carUseBook.setStartTime(DateUtil.fromStringToDate("yyyy-MM-dd HH:mm:ss",DateUtil.getDateStrOfUTCStr(startDate))); |
| | | carUseBook.setEndTime(DateUtil.fromStringToDate("yyyy-MM-dd HH:mm:ss",DateUtil.getDateStrOfUTCStr(endDate))); |
| | | |
| | | |
| | | }else{ |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |