old mode 100644
new mode 100755
| | |
| | | package com.java110.core.aop; |
| | | |
| | | import com.java110.core.factory.Java110TransactionalFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.dto.order.OrderDto; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.*; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | |
| | | logger.debug("请求头信息 key= " + key+",value = "+value); |
| | | |
| | | key = key.toLowerCase(); |
| | | if (CommonConstant.APP_ID.equals(key)) { |
| | | if (CommonConstant.APP_ID.equals(key) || CommonConstant.HTTP_APP_ID.equals(key)) { |
| | | orderDto.setAppId(value); |
| | | } |
| | | if (CommonConstant.TRANSACTION_ID.equals(key)) { |
| | | if (CommonConstant.TRANSACTION_ID.equals(key)|| CommonConstant.HTTP_TRANSACTION_ID.equals(key)) { |
| | | orderDto.setExtTransactionId(value); |
| | | } |
| | | if (CommonConstant.REQUEST_TIME.equals(key)) { |
| | | if (CommonConstant.REQUEST_TIME.equals(key)|| CommonConstant.HTTP_REQ_TIME.equals(key)) { |
| | | orderDto.setRequestTime(value); |
| | | } |
| | | if (OrderDto.O_ID.equals(key)) { |
| | | orderDto.setoId(value); |
| | | } |
| | | if (CommonConstant.USER_ID.equals(key)) { |
| | | if (CommonConstant.USER_ID.equals(key)|| CommonConstant.HTTP_USER_ID.equals(key)) { |
| | | orderDto.setUserId(value); |
| | | } |
| | | } |
| | |
| | | Java110TransactionalFactory.fallbackOId(); |
| | | //return new BusinessDto(BusinessDto.CODE_ERROR, "内部异常" + e.getLocalizedMessage()); |
| | | throw e; |
| | | }finally { |
| | | //清理事务信息 |
| | | Java110TransactionalFactory.clearOId(); |
| | | } |
| | | } |
| | | } |