Commit 3a5f4727 authored by libin's avatar libin

Merge remote-tracking branch 'origin/dev' into dev

parents c173d5c7 a5918261
package com.github.wxiaoqi.security.common.util;
import org.apache.commons.lang3.StringUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringToolsUtil {
/**
* 验证手机号码
* @param mobiles
* @return
*/
public static boolean isMobileNO( String mobiles){
boolean flag = false;
try{
if(StringUtils.isBlank(mobiles)) {
flag = false;
}
Pattern regex = Pattern.compile("^((16[0-9])|(13[0-9])|(15[^4,\\D])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$");
Matcher m = regex .matcher(mobiles);
flag = m.matches();
}catch(Exception e){
flag = false;
}
return flag;
}
/**
* 校验身份证
*
* @param idCard
* @return 校验通过返回true,否则返回false
*/
public static boolean isIDCard(String idCard) {
if(StringUtils.isBlank(idCard)) {
return false;
}
String REGEX_ID_CARD = "(^\\d{18}$)|(^\\d{15}$)";
return Pattern.matches(REGEX_ID_CARD, idCard);
}
}
...@@ -35,4 +35,10 @@ public interface UserRestInterface { ...@@ -35,4 +35,10 @@ public interface UserRestInterface {
return null; return null;
} }
} }
default void checkAdminUser(){
if(null == getAdminUserInfo()) {
throw new BaseException(ResultCode.DB_OPERATION_FAIL_CODE);
}
}
} }
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
select `parent_id` as `parentId`,`user_id`as `userId`,`bind_time` as `bindTime` from `app_user_relation` where `parent_id`=#{leaderId} and `is_del`=0 order by `bind_time` DESC select `parent_id` as `parentId`,`user_id`as `userId`,`bind_time` as `bindTime` from `app_user_relation` where `parent_id`=#{leaderId} and `is_del`=0 order by `bind_time` DESC
</select> </select>
<select id="countByParentId"> <select id="countByParentId" resultType="Integer">
select count(*) from `app_user_relation` where select count(*) from `app_user_relation` where
`parent_id`=#{parentId} and `is_del`=0 `parent_id`=#{parentId} and `is_del`=0
<if test="bindTime!='' and bindTime!=null and bindTime>0"> <if test="bindTime!='' and bindTime!=null and bindTime>0">
and (is_forever=2 or bind_time>#{bindTime}) and (is_forever=1 or bind_time>#{bindTime})
</if> </if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -323,7 +323,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> { ...@@ -323,7 +323,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
setOrderId(baseOrder.getId()); setOrderId(baseOrder.getId());
}}); }});
//车辆预定审核通过 //车辆预定审核通过
RestResponse<Integer> result = vehicleFeign.proveVehicleBooking(orvd.getBookRecordId()); RestResponse<Integer> result = vehicleFeign.rentProveVehicleBooking(orvd.getBookRecordId());
//确认免费天数 //确认免费天数
if (orvd.getFreeDays() > 0) { if (orvd.getFreeDays() > 0) {
......
package com.xxfc.platform.order.biz.inner; package com.xxfc.platform.order.biz.inner;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.util.IntervalUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.order.biz.*; import com.xxfc.platform.order.biz.*;
import com.xxfc.platform.order.contant.enumerate.*; import com.xxfc.platform.order.contant.enumerate.*;
import com.xxfc.platform.order.entity.*; import com.xxfc.platform.order.entity.*;
import com.xxfc.platform.order.pojo.mq.OrderMQDTO; import com.xxfc.platform.order.pojo.mq.OrderMQDTO;
import com.xxfc.platform.tour.feign.TourFeign; import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.universal.dto.SmsTemplateDTO;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign; import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.universal.vo.OrderRefundVo;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.feign.VehicleFeign; import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.jexl2.MapContext;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -28,7 +20,6 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -28,7 +20,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.xxfc.platform.universal.constant.DictionaryKey.*; import static com.xxfc.platform.universal.constant.DictionaryKey.*;
...@@ -182,8 +173,8 @@ public class OrderCancelBiz { ...@@ -182,8 +173,8 @@ public class OrderCancelBiz {
//取消租车预定 //取消租车预定
//已支付,并且是待出行状态,取消预约 //已支付,并且是待出行状态,取消预约
if(OrderStatusEnum.ORDER_TOSTART.equals(baseOrder.getType()) && SYS_TRUE.equals(baseOrder.getHasPay())){ if(OrderStatusEnum.ORDER_TOSTART.equals(baseOrder.getStatus()) && SYS_TRUE.equals(baseOrder.getHasPay())){
vehicleFeign.unbookVehicle(orvd.getBookRecordId()); vehicleFeign.rentUnbookVehicle(orvd.getBookRecordId());
}else { }else {
//未支付,拒绝之前的预约 //未支付,拒绝之前的预约
RestResponse<Integer> restResponse = vehicleFeign.rentRejectVehicleBooking(orvd.getBookRecordId()); RestResponse<Integer> restResponse = vehicleFeign.rentRejectVehicleBooking(orvd.getBookRecordId());
......
...@@ -264,6 +264,21 @@ public class BackStageOrderController extends CommonBaseController implements Us ...@@ -264,6 +264,21 @@ public class BackStageOrderController extends CommonBaseController implements Us
return new ObjectRestResponse<>().data(page.getData().get(0)); return new ObjectRestResponse<>().data(page.getData().get(0));
} }
@ApiOperation("更換車輛")
@RequestMapping(value = "/bg/change-vehicle", method = RequestMethod.POST)
@IgnoreClientToken
@ResponseBody
public ObjectRestResponse<OrderPageVO> changeVehicle(@RequestBody ChangeVehicleDTO dto) {
checkAdminUser();
return ObjectRestResponse.succ();
}
@Data
public static class ChangeVehicleDTO {
String no;
String numberPlate;
}
private Query initCompanyQuery(String no) { private Query initCompanyQuery(String no) {
BackStageOrderController.QueryOrderDetailDTO qodd = new BackStageOrderController.QueryOrderDetailDTO(); BackStageOrderController.QueryOrderDetailDTO qodd = new BackStageOrderController.QueryOrderDetailDTO();
//查询公司id //查询公司id
......
...@@ -24,6 +24,8 @@ public enum ResCode { ...@@ -24,6 +24,8 @@ public enum ResCode {
VEHICLE_BOOKED_RECORD_STATUS_CHANGED(103002,"车辆预定申请状态已变更"), VEHICLE_BOOKED_RECORD_STATUS_CHANGED(103002,"车辆预定申请状态已变更"),
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED(103003,"请输入仪表盘内当前显示的公里数"), VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED(103003,"请输入仪表盘内当前显示的公里数"),
CHECKUSER_AND_PHONE_NOT_NULL(103999, "收车或交车人姓名和电话不能为空"),
USERNAME_AND_TELE_NOT_NULL(104000, "使用人和电话不能为空"),
VEHICLE_DEPARTURE_VEHICLE_UNEXIST(104001,"车辆不存在"), VEHICLE_DEPARTURE_VEHICLE_UNEXIST(104001,"车辆不存在"),
VEHICLE_DEPARTURE_VEHICLE_DISABLE(104002,"车辆不可用"), VEHICLE_DEPARTURE_VEHICLE_DISABLE(104002,"车辆不可用"),
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE(104003,"车辆未出车"), VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE(104003,"车辆未出车"),
......
...@@ -54,12 +54,12 @@ public interface VehicleFeign { ...@@ -54,12 +54,12 @@ public interface VehicleFeign {
public RestResponse<Integer> rentRejectVehicleBooking(@PathVariable(value = "bookRecordId") Long bookRecordId); public RestResponse<Integer> rentRejectVehicleBooking(@PathVariable(value = "bookRecordId") Long bookRecordId);
//取消预约 //取消预约
@RequestMapping(value = "/vehicleInfo/unbook/4employee/{bookRecordId}", method = RequestMethod.DELETE) @RequestMapping(value = "/vehicleInfo/rent/unbook/{bookRecordId}", method = RequestMethod.DELETE)
public RestResponse<Integer> unbookVehicle(@PathVariable(value = "bookRecordId") Long bookRecordId); public RestResponse<Integer> rentUnbookVehicle(@PathVariable(value = "bookRecordId") Long bookRecordId);
//通过预约 //通过预约
@RequestMapping(value = "/vehicleInfo/book/4employee/prove/{bookRecordId}", method = RequestMethod.PUT) @RequestMapping(value = "/vehicleInfo/rent/book/prove/{bookRecordId}", method = RequestMethod.PUT)
public RestResponse<Integer> proveVehicleBooking(@PathVariable(value = "bookRecordId") Long bookRecordId); public RestResponse<Integer> rentProveVehicleBooking(@PathVariable(value = "bookRecordId") Long bookRecordId);
//获取分公司列表 //获取分公司列表
@GetMapping("/branchCompany/all") @GetMapping("/branchCompany/all")
......
...@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.constant.VehicleStatus; ...@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.constant.VehicleStatus;
import com.xxfc.platform.vehicle.entity.*; import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.mapper.*; import com.xxfc.platform.vehicle.mapper.*;
import com.xxfc.platform.vehicle.pojo.*; import com.xxfc.platform.vehicle.pojo.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -55,6 +56,14 @@ public class VehicleActiveService { ...@@ -55,6 +56,14 @@ public class VehicleActiveService {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode());
} }
if(StringUtils.isBlank(departureVo.getUser()) || StringUtils.isBlank(departureVo.getUserTel())) {
throw new BaseException(ResCode.USERNAME_AND_TELE_NOT_NULL.getDesc(),
ResCode.USERNAME_AND_TELE_NOT_NULL.getCode());
}
if(StringUtils.isBlank(departureVo.getCheckMan()) || StringUtils.isBlank(departureVo.getCheckManTel())) {
throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(),
ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode());
}
if (!vehicle.getStatus().equals(VehicleStatus.NORMAL.getCode())) { if (!vehicle.getStatus().equals(VehicleStatus.NORMAL.getCode())) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode());
...@@ -155,6 +164,10 @@ public class VehicleActiveService { ...@@ -155,6 +164,10 @@ public class VehicleActiveService {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode());
} }
if(StringUtils.isBlank(arrivalVo.getRecycleMan()) || StringUtils.isBlank(arrivalVo.getRecycleManTel())) {
throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(),
ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode());
}
if (!vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) { if (!vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
......
...@@ -94,7 +94,7 @@ public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, Vehic ...@@ -94,7 +94,7 @@ public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, Vehic
try { try {
QueryVehicleWarningMsgVo queryVehicleWarningMsgVo = JSON.parseObject(queryVehicleWarningMsgVoJson, QueryVehicleWarningMsgVo.class); QueryVehicleWarningMsgVo queryVehicleWarningMsgVo = JSON.parseObject(queryVehicleWarningMsgVoJson, QueryVehicleWarningMsgVo.class);
PageHelper.startPage(queryVehicleWarningMsgVo.getPage(),queryVehicleWarningMsgVo.getLimit()); PageHelper.startPage(queryVehicleWarningMsgVo.getPage(),queryVehicleWarningMsgVo.getLimit());
List<VehicleWarningMsg> vehicleWarningMsgs = mapper.getByPages(queryVehicleWarningMsgVo); List<VehicleWarningMsg> vehicleWarningMsgs = mapper.getByPage(queryVehicleWarningMsgVo);
PageInfo<VehicleWarningMsg> vehicleWarningMsgPageInfo = new PageInfo<>(vehicleWarningMsgs); PageInfo<VehicleWarningMsg> vehicleWarningMsgPageInfo = new PageInfo<>(vehicleWarningMsgs);
return RestResponse.data(PageDataVO.pageInfo(vehicleWarningMsgPageInfo)); return RestResponse.data(PageDataVO.pageInfo(vehicleWarningMsgPageInfo));
} catch (JSONException ex) { } catch (JSONException ex) {
......
package com.xxfc.platform.vehicle.rest;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.common.context.BaseContextHandler;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.xxfc.platform.vehicle.biz.*;
import com.xxfc.platform.vehicle.common.BaseController;
import com.xxfc.platform.vehicle.common.CustomIllegalParamException;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.BookType;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleBookInfo;
import com.xxfc.platform.vehicle.entity.VehicleBookRecord;
import com.xxfc.platform.vehicle.jobhandler.VehicleJobHandler;
import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP;
import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP_NAME;
@RestController
@RequestMapping("/vehicleInfo")
@Slf4j
@IgnoreClientToken
@Api(value="租车相关车辆管理controller",tags={"租车相关车辆管理接口"})
public class RentVehicleController extends BaseController<VehicleBiz> implements UserRestInterface {
@Autowired
private VehiclePlatCataBiz vehiclePlatCataBiz;
@Autowired
UserFeign userFeign;
@Autowired
VehicleBiz vehicleBiz;
public UserFeign getUserFeign() {
return userFeign;
}
/**
* 租车拒绝预定车辆申请
*
* @param bookRecordId
* @return
*/
@RequestMapping(value = "/rent/book/reject/{bookRecordId}", method = RequestMethod.PUT)
@ApiOperation(value = "租车拒绝预定车辆")
@IgnoreUserToken
public RestResponse<Integer> rentRejectVehicleBooking(@PathVariable Long bookRecordId) throws Exception {
//默认USER_APP 预约
Integer operatorId = USER_APP;
String userName = USER_APP_NAME;
return baseBiz.reviewVehicleBooking(operatorId, bookRecordId, VehicleBookRecordStatus.REJECTED.getCode(), userName);
}
/**
* 取消车辆预订
*
* @param bookRecordId
* @return
*/
@RequestMapping(value = "/rent/unbook/{bookRecordId}", method = RequestMethod.DELETE)
@ApiOperation(value = "取消预定车辆")
public RestResponse<Integer> rentUnbookVehicle(@PathVariable Long bookRecordId) throws Exception {
//默认USER_APP 预约
Integer operatorId = USER_APP;
String userName = USER_APP_NAME;
return baseBiz.unbookVehicle4Employee(operatorId, bookRecordId, userName);
}
/**
* 批准预定车辆预定
*
* @param bookRecordId
* @return
*/
@RequestMapping(value = "/rent/book/prove/{bookRecordId}", method = RequestMethod.PUT)
@ApiOperation(value = "预定车辆审核通过")
public RestResponse<Integer> rentProveVehicleBooking(@PathVariable Long bookRecordId) throws Exception {
//默认USER_APP 预约
Integer operatorId = USER_APP;
String userName = USER_APP_NAME;
return baseBiz.reviewVehicleBooking(operatorId, bookRecordId, VehicleBookRecordStatus.APPROVE.getCode(), userName);
}
/**
* 可用车辆查询
*
* @param dto
* @return
*/
@ApiOperation("可用车辆查询")
@RequestMapping(value = "/rent/usable-vehicle", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse<PageDataVO<UsableVehicleModelVO>> rentUsableVehicle(UsableVeicleDTO dto) throws Exception {
//根据时间 获得 可用车辆
//结合车型
if (StringUtils.isNotBlank(dto.getCatasStr())) {
dto.setCatas(vehiclePlatCataBiz.groupCatasByParent(dto.getCatasStr()));
}
//设置显示是否有车
dto.setYearNo4Where(Boolean.TRUE);
return ObjectRestResponse.succ(vehicleBiz.searchUsableModel(dto));
}
/**
* 热门车型
*
* @param dto
* @return
*/
@ApiOperation("热门车型")
@RequestMapping(value = "/rent/hot-vehicle", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse<PageDataVO<UsableVehicleModelVO>> hotVehicle(HotVeicleDTO dto) throws Exception {
return ObjectRestResponse.succ(vehicleBiz.hotModel(dto));
}
/**
* 租车触发的申请预定车辆
*
* @param dto
* @return
*/
@ApiOperation("租车触发的申请预定车辆")
@RequestMapping(value = "/rent/book/vehicle", method = RequestMethod.POST)
@IgnoreClientToken
@IgnoreUserToken
public ObjectRestResponse<VehicleBookRecord> rentApplyVehicle(@RequestBody RentVehicleBookDTO dto) throws Exception {
//默认USER_APP 预约
Integer operatorId = USER_APP;
String userName = dto.getUserName();
//BaseContextHandler.getName();
dto.setLimit(1);
dto.setPage(1);
//查询可车辆信息
PageDataVO<Vehicle> pageDataVO = vehicleBiz.searchUsableVehicle(dto);
if (pageDataVO.getData().size() <= 0) {
throw new BaseException(ResultCode.NOTEXIST_CODE, new HashSet<String>(){{
add("可用车辆不存在");
}});
}
dto.setBookStartDate(dto.getBookStartDate()+ " 00:00:00");
dto.setBookEndDate(dto.getBookEndDate()+ " 23:59:59");
BookVehicleVO bookVehicleVo = BeanUtil.toBean(dto, BookVehicleVO.class);
bookVehicleVo.setBookType(BookType.USER_RENT.getCode());
bookVehicleVo.setVehicleId(pageDataVO.getData().get(0).getId());
bookVehicleVo.setStatus(VehicleBookRecordStatus.APPLY.getCode());
VehicleBookRecord vehicleBookRecord = baseBiz.applyVehicle(operatorId, bookVehicleVo, userName);
return ObjectRestResponse.succ(vehicleBookRecord);
}
}
...@@ -267,23 +267,6 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -267,23 +267,6 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
return baseBiz.reviewVehicleBooking(operatorId, bookRecordId, VehicleBookRecordStatus.REJECTED.getCode(), userName); return baseBiz.reviewVehicleBooking(operatorId, bookRecordId, VehicleBookRecordStatus.REJECTED.getCode(), userName);
} }
/**
* 租车拒绝预定车辆申请
*
* @param bookRecordId
* @return
*/
@RequestMapping(value = "/rent/book/reject/{bookRecordId}", method = RequestMethod.PUT)
@ApiOperation(value = "租车拒绝预定车辆")
@IgnoreUserToken
public RestResponse<Integer> rentRejectVehicleBooking(@PathVariable Long bookRecordId) throws Exception {
//默认USER_APP 预约
Integer operatorId = USER_APP;
String userName = USER_APP_NAME;
return baseBiz.reviewVehicleBooking(operatorId, bookRecordId, VehicleBookRecordStatus.REJECTED.getCode(), userName);
}
// /** // /**
// * 车辆归还 // * 车辆归还
// * @param bookRecordId // * @param bookRecordId
...@@ -377,82 +360,12 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -377,82 +360,12 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
return vehicleBookRecordBiz.retVehicle(operatorId, userName, retVehicleVo); return vehicleBookRecordBiz.retVehicle(operatorId, userName, retVehicleVo);
} }
/**
* 可用车辆查询
*
* @param dto
* @return
*/
@ApiOperation("可用车辆查询")
@RequestMapping(value = "/rent/usable-vehicle", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse<PageDataVO<UsableVehicleModelVO>> rentUsableVehicle(UsableVeicleDTO dto) throws Exception {
//根据时间 获得 可用车辆
//结合车型
if (StringUtils.isNotBlank(dto.getCatasStr())) {
dto.setCatas(vehiclePlatCataBiz.groupCatasByParent(dto.getCatasStr()));
}
//设置显示是否有车
dto.setYearNo4Where(Boolean.TRUE);
return ObjectRestResponse.succ(vehicleBiz.searchUsableModel(dto));
}
@ApiOperation("根据权限获取所有车辆") @ApiOperation("根据权限获取所有车辆")
@GetMapping(value = "/info/getVehicle") @GetMapping(value = "/info/getVehicle")
public ObjectRestResponse<PageDataVO<VehicleAndModelInfoVo>> getVehicle(VehiclePlanDto vehiclePlanDto) { public ObjectRestResponse<PageDataVO<VehicleAndModelInfoVo>> getVehicle(VehiclePlanDto vehiclePlanDto) {
return vehicleBiz.getVehicle(vehiclePlanDto); return vehicleBiz.getVehicle(vehiclePlanDto);
} }
/**
* 热门车型
*
* @param dto
* @return
*/
@ApiOperation("热门车型")
@RequestMapping(value = "/rent/hot-vehicle", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse<PageDataVO<UsableVehicleModelVO>> hotVehicle(HotVeicleDTO dto) throws Exception {
return ObjectRestResponse.succ(vehicleBiz.hotModel(dto));
}
/**
* 租车触发的申请预定车辆
*
* @param dto
* @return
*/
@ApiOperation("租车触发的申请预定车辆")
@RequestMapping(value = "/rent/book/vehicle", method = RequestMethod.POST)
@IgnoreClientToken
@IgnoreUserToken
public ObjectRestResponse<VehicleBookRecord> rentApplyVehicle(@RequestBody RentVehicleBookDTO dto) throws Exception {
//默认USER_APP 预约
Integer operatorId = USER_APP;
String userName = dto.getUserName();
//BaseContextHandler.getName();
dto.setLimit(1);
dto.setPage(1);
//查询可车辆信息
PageDataVO<Vehicle> pageDataVO = vehicleBiz.searchUsableVehicle(dto);
if (pageDataVO.getData().size() <= 0) {
throw new BaseException(ResultCode.NOTEXIST_CODE, new HashSet<String>(){{
add("可用车辆不存在");
}});
}
dto.setBookStartDate(dto.getBookStartDate()+ " 00:00:00");
dto.setBookEndDate(dto.getBookEndDate()+ " 23:59:59");
BookVehicleVO bookVehicleVo = BeanUtil.toBean(dto, BookVehicleVO.class);
bookVehicleVo.setBookType(BookType.USER_RENT.getCode());
bookVehicleVo.setVehicleId(pageDataVO.getData().get(0).getId());
bookVehicleVo.setStatus(VehicleBookRecordStatus.APPLY.getCode());
VehicleBookRecord vehicleBookRecord = baseBiz.applyVehicle(operatorId, bookVehicleVo, userName);
return ObjectRestResponse.succ(vehicleBookRecord);
}
@RequestMapping(value = "/app/unauth/getVehiclePlanList", method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/getVehiclePlanList", method = RequestMethod.GET)
@ApiOperation(value = "获取排车信息") @ApiOperation(value = "获取排车信息")
@IgnoreClientToken @IgnoreClientToken
......
...@@ -389,7 +389,7 @@ ...@@ -389,7 +389,7 @@
<if test="zoneId !=null"> <if test="zoneId !=null">
and bc2.zone_id = #{zoneId} and bc2.zone_id = #{zoneId}
</if> </if>
and is_del != 1 and v1.is_del != 1
</where> </where>
</select> </select>
...@@ -412,7 +412,7 @@ ...@@ -412,7 +412,7 @@
#{id} #{id}
</foreach> </foreach>
</if> </if>
and is_del != 1 and v1.is_del != 1
</where> </where>
ORDER BY parkCompanyName ORDER BY parkCompanyName
</select> </select>
...@@ -490,7 +490,7 @@ ...@@ -490,7 +490,7 @@
#{id} #{id}
</foreach> </foreach>
</if> </if>
and v1.is_del != 1 and v2.is_del != 1
</where> </where>
</select> </select>
......
...@@ -22,9 +22,11 @@ ...@@ -22,9 +22,11 @@
and v.number_plate = #{numberPlate} and v.number_plate = #{numberPlate}
</if> </if>
<if test="type != null"> <if test="type != null">
and type = #{type} and v.type = #{type}
</if>
<if test="colorType != null">
and color_type = #{colorType}
</if> </if>
</select> </select>
<select id="getMsgByVehicle" parameterType="java.util.Map" resultType="com.xxfc.platform.vehicle.entity.VehicleWarningMsg" > <select id="getMsgByVehicle" parameterType="java.util.Map" resultType="com.xxfc.platform.vehicle.entity.VehicleWarningMsg" >
...@@ -73,12 +75,6 @@ ...@@ -73,12 +75,6 @@
<if test="numberPlate != null and numberPlate != '' "> <if test="numberPlate != null and numberPlate != '' ">
and number_plate = #{numberPlate} and number_plate = #{numberPlate}
</if> </if>
<if test="type != null">
and type = #{type}
</if>
<if test="colorType != null">
and color_type = #{colorType}
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment