Commit 25bb1b7b authored by hezhen's avatar hezhen

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform into base-modify

parents f6a7b78a e451f2af
......@@ -6,6 +6,7 @@ package com.github.wxiaoqi.security.common.constant;
public class CommonConstants {
public static final Integer SYS_TRUE = 1;
public static final Integer SYS_FALSE = 0;
public static final Integer SYS_JSON_TRUE = 200;
public final static String RESOURCE_TYPE_MENU = "menu";
public final static String RESOURCE_TYPE_BTN = "button";
// 用户token异常
......
......@@ -53,12 +53,8 @@ public class BaseException extends RuntimeException {
this.status = code;
}
// public BaseException(int code, Map<String, Object> map) {
// String msg = ResultCode.getMsg(code);
// if(null != map && map.size() > 0){
// for(String)
//
// }
// this.status = code;
// }
public BaseException(int code, Map<String, Object> map) {
super(ResultCode.getMsg(code) + (map == null? "" : map.toString()));
this.status = code;
}
}
......@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.constant.CommonConstants;
import com.github.wxiaoqi.security.common.context.BaseContextHandler;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
......@@ -251,6 +252,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
rentVehicleBookDTO.setModelId(detail.getModelId());
rentVehicleBookDTO.setUserName(BaseContextHandler.getName());
ObjectRestResponse<VehicleBookRecord> orr = vehicleFeign.rentApplyVehicle(rentVehicleBookDTO);
if(! CommonConstants.SYS_JSON_TRUE.equals(orr.getStatus())) {
throw new BaseException(orr.getMessage(), orr.getStatus());
}
detail.setVehicleId(orr.getData().getVehicleId());
detail.setBookRecordId(orr.getData().getId());
}
......
......@@ -5,7 +5,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
//@RestControllerAdvice
public class BaseExceptionHandler {
@ExceptionHandler(BaseException.class)
......
......@@ -401,7 +401,9 @@ public class VehicleController extends BaseController<VehicleBiz> {
//查询可车辆信息
PageDataVO<Vehicle> pageDataVO = vehicleBiz.searchUsableVehicle(dto);
if (pageDataVO.getData().size() <= 0) {
throw new BaseException(ResultCode.NOTEXIST_CODE);
throw new BaseException(ResultCode.NOTEXIST_CODE, new HashMap<String, Object>(){{
put("可用车辆", "不存在");
}});
}
bookVehicleVo.setVehicleId(pageDataVO.getData().get(0).getId());
......
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