Commit 76db2a7d authored by jiaorz's avatar jiaorz

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

parents 205db241 e0ee846c
......@@ -13,7 +13,7 @@ import tk.mybatis.spring.annotation.MapperScan;
*/
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(defaultConfiguration = HeaderConfig.class)
@EnableFeignClients
@MapperScan("com.github.wxiaoqi.security.auth.mapper")
//@EnableAutoConfiguration
public class AuthBootstrap {
......
......@@ -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;
}
}
......@@ -240,6 +240,7 @@ public class AppPermissionService {
userLogin.setImUserid(imUserId);
userLogin.setUsername(username);
appUserLoginBiz.updateSelectiveById(userLogin);
log.info(username+"----userLogin updateSelectiveById---username====="+username+"----imPassword===="+imPassword);
}
data.put("imToken",access_token);
data.put("imUserId",imUserId);
......
......@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.api.vo.config;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
......@@ -17,6 +18,7 @@ import java.util.Enumeration;
* @description 设置请求头部信息,防止微服务之间调用请求头部信息丢失
* @data 2019/6/25 16:22
*/
@Slf4j
public class HeaderConfig implements RequestInterceptor {
@Override
......@@ -31,6 +33,7 @@ public class HeaderConfig implements RequestInterceptor {
while (headerNames.hasMoreElements()){
String headerName = headerNames.nextElement();
String headerValue = request.getHeader(headerName);
log.info("----headerName===="+headerName+"----headerValue===="+headerValue);
template.header(headerName,headerValue);
}
}
......
......@@ -61,6 +61,7 @@ public class OrderTourVerificationBiz{
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "订单不是已支付状态");
}
Integer orderId=baseOrder.getId();
Integer version=baseOrder.getVersion();
OrderTourDetail tourDetail=new OrderTourDetail();
tourDetail.setOrderId(orderId);
tourDetail=tourDetailBiz.selectOne(tourDetail);
......@@ -81,6 +82,7 @@ public class OrderTourVerificationBiz{
baseOrder=new BaseOrder();
baseOrder.setId(orderId);
baseOrder.setStatus(OrderStatusEnum.ORDER_FINISH.getCode());
baseOrder.setVersion(version);
baseOrderBiz.updateSelectiveById(baseOrder);
tourDetail.setVerificationUser(userDTO.getId());
tourDetail.setVerificationName(userDTO.getName());
......
......@@ -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