Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
fe70118f
Commit
fe70118f
authored
Jul 12, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日志代码, 修改租车列表和确认订单bug
parent
7f8c0e78
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
517 additions
and
64 deletions
+517
-64
pom.xml
ace-common/pom.xml
+18
-0
CommonLogService.java
.../github/wxiaoqi/security/common/log/CommonLogService.java
+57
-0
CommonLogServiceImpl.java
...xiaoqi/security/common/log/Impl/CommonLogServiceImpl.java
+132
-0
XxLogInterceptor.java
.../github/wxiaoqi/security/common/log/XxLogInterceptor.java
+144
-0
LogEntity.java
.../github/wxiaoqi/security/common/log/entity/LogEntity.java
+40
-0
XxLogEntity.java
...ithub/wxiaoqi/security/common/log/entity/XxLogEntity.java
+40
-0
bootstrap.yml
...ivity/xx-activity-server/src/main/resources/bootstrap.yml
+2
-1
AppApplication.java
...r/src/main/java/com/xxfc/platform/app/AppApplication.java
+2
-1
bootstrap.yml
xx-app/xx-app-server/src/main/resources/bootstrap.yml
+2
-1
CampSiteApplication.java
.../java/com/xxfc/platform/campsite/CampSiteApplication.java
+2
-1
bootstrap.yml
...psite/xx-campsite-server/src/main/resources/bootstrap.yml
+2
-0
pom.xml
xx-common/xx-common-platform-web/pom.xml
+7
-0
pom.xml
xx-im/xx-im-server/pom.xml
+0
-4
ImApplication.java
...ver/src/main/java/com/xxfc/platform/im/ImApplication.java
+2
-1
OrderApplication.java
...c/main/java/com/xxfc/platform/order/OrderApplication.java
+2
-1
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+1
-1
bootstrap.yml
xx-order/xx-order-server/src/main/resources/bootstrap.yml
+2
-2
bootstrap.yml
xx-tour/xx-tour-server/src/main/resources/bootstrap.yml
+45
-44
UniversalApplication.java
...ava/com/xxfc/platform/universal/UniversalApplication.java
+2
-1
bootstrap.yml
...rsal/xx-universal-server/src/main/resources/bootstrap.yml
+2
-1
VehicleApplication.java
...in/java/com/xxfc/platform/vehicle/VehicleApplication.java
+2
-1
WebConfiguration.java
...va/com/xxfc/platform/vehicle/config/WebConfiguration.java
+8
-1
bootstrap.yml
...ehicle/xx-vehicle-server/src/main/resources/bootstrap.yml
+1
-1
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+2
-2
No files found.
ace-common/pom.xml
View file @
fe70118f
...
...
@@ -170,6 +170,24 @@
<optional>
true
</optional>
</dependency>
<!-- mongodb -->
<dependency>
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-mongodb
</artifactId>
<version>
2.1.5.RELEASE
</version>
<scope>
compile
</scope>
<exclusions>
<exclusion>
<artifactId>
mongo-java-driver
</artifactId>
<groupId>
org.mongodb
</groupId>
</exclusion>
<exclusion>
<artifactId>
jcl-over-slf4j
</artifactId>
<groupId>
org.slf4j
</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/log/CommonLogService.java
0 → 100644
View file @
fe70118f
package
com
.
github
.
wxiaoqi
.
security
.
common
.
log
;
import
com.github.wxiaoqi.security.common.log.entity.LogEntity
;
import
com.github.wxiaoqi.security.common.log.entity.XxLogEntity
;
import
com.github.wxiaoqi.security.common.msg.BaseResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Method
;
public
interface
CommonLogService
{
/**
* 记录日志
* @param logEntity
*/
void
log
(
LogEntity
logEntity
);
/**
* 记录日志
* @param xxLogEntity
*/
void
commonLog
(
XxLogEntity
xxLogEntity
);
/**
* 初始化日志前半部分
* @param xxLogEntity
* @param request
*/
void
initCommonLogPrePart
(
XxLogEntity
xxLogEntity
,
HttpServletRequest
request
,
ProceedingJoinPoint
pjp
);
/**
* 初始化日志后半部分
* @param xxLogEntity
* @param result
*/
void
initCommonLogLastPart
(
XxLogEntity
xxLogEntity
,
BaseResponse
result
);
/**
* 初始化FeignClient日志前半部分
* @param xxLogEntity
* @param targetMethod
*/
void
initFeignClientLogPrePart
(
XxLogEntity
xxLogEntity
,
Method
targetMethod
);
/**
* 初始化mq消息日志前半部分
* @param xxLogEntity
* @param targetMethod
*/
void
initMqLogPrePart
(
XxLogEntity
xxLogEntity
,
Method
targetMethod
);
}
ace-common/src/main/java/com/github/wxiaoqi/security/common/log/Impl/CommonLogServiceImpl.java
0 → 100644
View file @
fe70118f
package
com
.
github
.
wxiaoqi
.
security
.
common
.
log
.
Impl
;
import
com.alibaba.fastjson.JSON
;
import
com.github.wxiaoqi.security.common.log.CommonLogService
;
import
com.github.wxiaoqi.security.common.log.entity.LogEntity
;
import
com.github.wxiaoqi.security.common.log.entity.XxLogEntity
;
import
com.github.wxiaoqi.security.common.msg.BaseResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Method
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
@Service
public
class
CommonLogServiceImpl
implements
CommonLogService
{
@Value
(
"${spring.application.name}"
)
private
String
applicationName
;
// 获取当前cpu个数
private
static
int
corePoolSize
=
Runtime
.
getRuntime
().
availableProcessors
();
// 设置任务队列,长度无限制
private
static
BlockingQueue
blockingQueue
=
new
LinkedBlockingQueue
<>();
// 定义线程池,初始化线程数为cpu个数,最大线程数为cpu个数*2, 档队列类型为LinkedBlockingQueue,maximumPoolSize 参数无效
private
static
ThreadPoolExecutor
threadPoolExecutor
=
new
ThreadPoolExecutor
(
corePoolSize
,
corePoolSize
*
2
,
60L
,
TimeUnit
.
SECONDS
,
blockingQueue
);
@Autowired
private
MongoTemplate
mongoTemplate
;
@Override
public
void
log
(
LogEntity
logEntity
){
threadPoolExecutor
.
execute
(
new
SycnLog
(
logEntity
)
);
}
class
SycnLog
implements
Runnable
{
private
LogEntity
logEntity
;
public
SycnLog
()
{
super
();
}
public
SycnLog
(
LogEntity
logEntity
)
{
super
();
this
.
logEntity
=
logEntity
;
}
@Override
public
void
run
()
{
mongoTemplate
.
insert
(
logEntity
);
}
}
@Override
public
void
commonLog
(
XxLogEntity
xxLogEntity
){
threadPoolExecutor
.
execute
(
new
SycnCommonLog
(
xxLogEntity
)
);
}
class
SycnCommonLog
implements
Runnable
{
private
XxLogEntity
xxLogEntity
;
public
SycnCommonLog
()
{
super
();
}
public
SycnCommonLog
(
XxLogEntity
xxLogEntity
)
{
super
();
this
.
xxLogEntity
=
xxLogEntity
;
}
@Override
public
void
run
()
{
mongoTemplate
.
insert
(
xxLogEntity
,
xxLogEntity
.
getMongoKey
());
}
}
@Override
public
void
initCommonLogPrePart
(
XxLogEntity
xxLogEntity
,
HttpServletRequest
request
,
ProceedingJoinPoint
pjp
)
{
//request 获得头部
xxLogEntity
.
setApp
(
request
.
getHeader
(
"app"
));
LocalDateTime
startTime
=
LocalDateTime
.
now
();
//开始时间
xxLogEntity
.
setCreateDate
(
startTime
.
toString
());
xxLogEntity
.
setServletPath
(
request
.
getServletPath
());
MethodSignature
signature
=
(
MethodSignature
)
pjp
.
getSignature
();
xxLogEntity
.
setMethod
(
signature
.
getMethod
().
toString
());
xxLogEntity
.
setMongoKey
(
applicationName
+
":"
+
request
.
getServletPath
());
}
@Override
public
void
initCommonLogLastPart
(
XxLogEntity
xxLogEntity
,
BaseResponse
result
)
{
LocalDateTime
endTime
=
LocalDateTime
.
now
();
//结束时间
xxLogEntity
.
setEndDate
(
endTime
.
toString
());
xxLogEntity
.
setResponseData
(
JSON
.
toJSONString
(
result
));
}
@Override
public
void
initFeignClientLogPrePart
(
XxLogEntity
xxLogEntity
,
Method
targetMethod
)
{
PostMapping
postMapping
=
targetMethod
.
getAnnotation
(
PostMapping
.
class
);
String
header
=
postMapping
.
headers
()[
0
];
xxLogEntity
.
setApp
(
header
.
substring
(
header
.
lastIndexOf
(
"app="
)
+
4
,
header
.
length
()));
LocalDateTime
startTime
=
LocalDateTime
.
now
();
//开始时间
xxLogEntity
.
setCreateDate
(
startTime
.
toString
());
xxLogEntity
.
setServletPath
(
postMapping
.
value
()[
0
]);
xxLogEntity
.
setMongoKey
(
applicationName
+
":"
+
"feignClient"
);
}
@Override
public
void
initMqLogPrePart
(
XxLogEntity
xxLogEntity
,
Method
targetMethod
)
{
PostMapping
postMapping
=
targetMethod
.
getAnnotation
(
PostMapping
.
class
);
String
header
=
postMapping
.
headers
()[
0
];
LocalDateTime
startTime
=
LocalDateTime
.
now
();
//开始时间
xxLogEntity
.
setCreateDate
(
startTime
.
toString
());
xxLogEntity
.
setServletPath
(
postMapping
.
value
()[
0
]);
xxLogEntity
.
setMongoKey
(
applicationName
+
":"
+
"mqSender"
);
}
}
ace-common/src/main/java/com/github/wxiaoqi/security/common/log/XxLogInterceptor.java
0 → 100644
View file @
fe70118f
package
com
.
github
.
wxiaoqi
.
security
.
common
.
log
;
import
com.alibaba.fastjson.JSON
;
import
com.github.wxiaoqi.security.common.log.CommonLogService
;
import
com.github.wxiaoqi.security.common.log.entity.XxLogEntity
;
import
com.github.wxiaoqi.security.common.msg.BaseResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
/**
* Created by zhoujianwei
* cas 项目注解相关拦截器
* Date : 2018/6/6.
* Time : 18:13
*/
@Aspect
@Component
public
class
XxLogInterceptor
{
@Autowired
CommonLogService
commonLogService
;
//触发条件为:com.xxfc.platform包下面所有controller
@Around
(
"within(com.xxfc.platform.*.rest..* || com.xxfc.platform.*.controller..*)"
)
public
Object
doAroundXxControllerLog
(
ProceedingJoinPoint
pjp
)
throws
Throwable
{
ServletRequestAttributes
servletRequestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
HttpServletRequest
request
=
servletRequestAttributes
.
getRequest
();
//获取request
HttpServletResponse
response
=
servletRequestAttributes
.
getResponse
();
//获取response
//request 获得头部
XxLogEntity
xxLogEntity
=
new
XxLogEntity
();
commonLogService
.
initCommonLogPrePart
(
xxLogEntity
,
request
,
pjp
);
Object
[]
params
=
pjp
.
getArgs
();
//获取请求参数
MethodSignature
signature
=
(
MethodSignature
)
pjp
.
getSignature
();
if
(
params
!=
null
&&
params
.
length
>
0
)
{
xxLogEntity
.
setRequestData
(
JSON
.
toJSONString
(
params
[
0
]));
}
Object
result
=
new
Object
();
try
{
//###################上面代码为方法执行前#####################
result
=
pjp
.
proceed
();
//执行方法,获取返回参数
//###################下面代码为方法执行后#####################
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
(
BaseResponse
)
result
);
}
catch
(
Exception
e
){
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
(
BaseResponse
)
result
);
xxLogEntity
.
setResponseData
(
JSON
.
toJSONString
(
ObjectRestResponse
.
createDefaultFail
()));
throw
e
;
}
finally
{
commonLogService
.
commonLog
(
xxLogEntity
);
}
return
result
;
}
// @Around("within(com.github.wxiaoqi.security.security.gate.filter..*)")
// public Object doAroundXxControllerLog(ProceedingJoinPoint pjp) throws Throwable {
//
// }
// //casEipMsgErrDeal:外联报错消息处理
// @AfterReturning(value = "within(com.ht.cas.*.*.*.*) && @annotation(casEipMsgErrDeal)", returning = "result")
// public Result doAfterCasEipMsgErrDeal(JoinPoint jp, Result result, CasEipMsgErrDeal casEipMsgErrDeal) {
// String msg = result.getMsg();
// if(StringUtils.isBlank(msg)) {
// msg = result.getCodeDesc();
// }
// //returnCode不为EIP_SUCCESS_CODE 并且 msg 没有信息
// if(!CommonConstant.EIP_SUCCESS_CODE.equals(result.getReturnCode())) {
// result.setData(null);
// if(StringUtils.isBlank(msg)) {
// Map map = ((List<Map>)result.getData()).get(0);
// msg = map.get("field").toString() + " " + map.get("defaultMessage");
// }
// }
// result.setMsg(msg);
// return result;
// }
//
// //casMqSenderLog:mq发送消息
// @Around(value = "within(com.ht.cas..*) && @annotation(casMqSenderLog)")
// public void doAfterCasMqSenderLog(ProceedingJoinPoint pjp, CasMqSenderLog casMqSenderLog) {
//
// }
//
// //casMqSenderLog:mq接收消息
// @Around(value = "within(com.ht.cas..*) && @annotation(casMqReceiverLog)")
// public void doAfterCasMqLog(ProceedingJoinPoint pjp, CasMqReceiverLog casMqReceiverLog) {
//
// }
//
//
// // defined aop pointcut
// @Pointcut("execution(* com.ht.cas.common.feignClient.*.*(..))")
// public void casFeignClientLog() {
// }
//
//
// //@Around("casFeignClientLog()")
// public Object doAroundCasFeignClientLog(ProceedingJoinPoint pjp) throws Throwable {
// //request 获得头部
// Signature signature = pjp.getSignature();
// MethodSignature methodSignature = (MethodSignature)signature;
// Method targetMethod = methodSignature.getMethod();
//
// XxLogEntity xxLogEntity = new XxLogEntity();
// commonLogService.initFeignClientLogPrePart(xxLogEntity, targetMethod);
//
// Object[] params = pjp.getArgs();//获取请求参数
//
// if(params != null && params.length > 0) {
// xxLogEntity.setRequestData(JSON.toJSONString(params[0]));
// }
// Object result = new Object();
// try{
// //###################上面代码为方法执行前#####################
// result = pjp.proceed();//执行方法,获取返回参数
// //###################下面代码为方法执行后#####################
// commonLogService.initCommonLogLastPart(xxLogEntity, (Result) result);
// }catch (Exception e){
// commonLogService.initCommonLogLastPart(xxLogEntity, (Result) result);
// xxLogEntity.setResponseData(JSON.toJSONString(ResultHelper.buildFail(e.getMessage())));
// throw e;
// }finally {
// commonLogService.commonLog(xxLogEntity);
// }
//
// return result;
// }
}
ace-common/src/main/java/com/github/wxiaoqi/security/common/log/entity/LogEntity.java
0 → 100644
View file @
fe70118f
package
com
.
github
.
wxiaoqi
.
security
.
common
.
log
.
entity
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.UUID
;
/**
* 日誌信息
*/
@Data
public
class
LogEntity
implements
Serializable
{
public
LogEntity
(){
super
();
}
public
LogEntity
(
String
businessCode
,
String
url
,
String
app
,
String
appName
,
String
requestData
,
String
responseData
,
Date
createDate
,
Date
endDate
)
{
super
();
this
.
businessCode
=
businessCode
;
this
.
url
=
url
;
this
.
app
=
app
;
this
.
appName
=
appName
;
this
.
requestData
=
requestData
;
this
.
responseData
=
responseData
;
this
.
createDate
=
createDate
;
this
.
endDate
=
endDate
;
}
private
String
businessCode
;
private
String
url
;
private
String
app
;
private
String
appName
;
private
String
requestData
;
private
String
responseData
;
private
Date
createDate
;
private
Date
endDate
;
}
ace-common/src/main/java/com/github/wxiaoqi/security/common/log/entity/XxLogEntity.java
0 → 100644
View file @
fe70118f
package
com
.
github
.
wxiaoqi
.
security
.
common
.
log
.
entity
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* Created by zhoujianwei
* Date : 2018/6/6.
* Time : 16:59
*/
@Data
public
class
XxLogEntity
implements
Serializable
{
private
String
app
;
private
String
servletPath
;
private
String
requestData
;
private
String
responseData
;
private
String
createDate
;
private
String
endDate
;
private
String
requestPath
;
private
String
method
;
private
String
mongoKey
;
public
XxLogEntity
()
{
super
();
}
public
XxLogEntity
(
String
app
,
String
servletPath
,
String
requestData
,
String
responseData
,
String
createDate
,
String
endDate
,
String
requestPath
,
String
mongoKey
)
{
this
.
app
=
app
;
this
.
servletPath
=
servletPath
;
this
.
requestData
=
requestData
;
this
.
responseData
=
responseData
;
this
.
createDate
=
createDate
;
this
.
endDate
=
endDate
;
this
.
requestPath
=
requestPath
;
this
.
mongoKey
=
mongoKey
;
}
}
xx-activity/xx-activity-server/src/main/resources/bootstrap.yml
View file @
fe70118f
...
...
@@ -24,7 +24,8 @@ spring:
nacos
:
config
:
server-addr
:
127.0.0.1:8848
#共用配置,暂定一个
shared-dataids
:
common-dev.yaml,mongodb-log-dev.yaml
---
spring
:
profiles
:
pro
...
...
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/AppApplication.java
View file @
fe70118f
...
...
@@ -11,7 +11,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
(
scanBasePackages
=
{
"com.xxfc.platform"
,
"com.github.wxiaoqi.*"
"com.github.wxiaoqi.security.common.handler"
,
"com.github.wxiaoqi.security.common.log"
})
@EnableDiscoveryClient
@EnableScheduling
...
...
xx-app/xx-app-server/src/main/resources/bootstrap.yml
View file @
fe70118f
...
...
@@ -24,7 +24,8 @@ spring:
nacos
:
config
:
server-addr
:
127.0.0.1:8848
#共用配置,暂定一个
shared-dataids
:
common-dev.yaml,mongodb-log-dev.yaml
---
spring
:
profiles
:
pro
...
...
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/CampSiteApplication.java
View file @
fe70118f
...
...
@@ -19,7 +19,8 @@ import tk.mybatis.spring.annotation.MapperScan;
*/
@SpringBootApplication
(
scanBasePackages
=
{
"com.xxfc.platform"
,
"com.github.wxiaoqi.*"
"com.github.wxiaoqi.security.common.handler"
,
"com.github.wxiaoqi.security.common.log"
})
@EnableDiscoveryClient
@EnableAceAuthClient
...
...
xx-campsite/xx-campsite-server/src/main/resources/bootstrap.yml
View file @
fe70118f
...
...
@@ -14,6 +14,8 @@ spring:
nacos
:
config
:
server-addr
:
127.0.0.1:8848
#共用配置,暂定一个
shared-dataids
:
common-dev.yaml,mongodb-log-dev.yaml
---
spring
:
...
...
xx-common/xx-common-platform-web/pom.xml
View file @
fe70118f
...
...
@@ -120,6 +120,13 @@
<artifactId>
swagger-spring-boot-starter
</artifactId>
<version>
1.8.0.RELEASE
</version>
</dependency>
<!-- mongodb -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-mongodb
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
xx-im/xx-im-server/pom.xml
View file @
fe70118f
...
...
@@ -49,10 +49,6 @@
</dependency>
<!--mongodb-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-mongodb
</artifactId>
</dependency>
<dependency>
<groupId>
org.mongodb.morphia
</groupId>
<artifactId>
morphia
</artifactId>
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/ImApplication.java
View file @
fe70118f
...
...
@@ -13,7 +13,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
(
scanBasePackages
=
{
"com.xxfc.platform"
,
"com.github.wxiaoqi.*"
"com.github.wxiaoqi.security.common.handler"
,
"com.github.wxiaoqi.security.common.log"
},
exclude
=
DataSourceAutoConfiguration
.
class
)
@EnableDiscoveryClient
@EnableScheduling
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/OrderApplication.java
View file @
fe70118f
...
...
@@ -13,7 +13,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
(
scanBasePackages
=
{
"com.xxfc.platform"
,
"com.github.wxiaoqi.*"
"com.github.wxiaoqi.security.common.handler"
,
"com.github.wxiaoqi.security.common.log"
})
@EnableDiscoveryClient
@EnableScheduling
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
fe70118f
...
...
@@ -208,7 +208,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
}
//商品价格
goodsAmount
=
goodsAmount
.
add
(
vehicleAmount
).
add
(
driverAmount
);
goodsAmount
=
goodsAmount
.
add
(
vehicleAmount
).
add
(
driverAmount
)
.
add
(
damageSafeAmount
)
;
//总价格(包含押金)
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
vehicleModel
.
getDeposit
());
...
...
xx-order/xx-order-server/src/main/resources/bootstrap.yml
View file @
fe70118f
...
...
@@ -14,8 +14,8 @@ spring:
nacos
:
config
:
server-addr
:
127.0.0.1:8848
#共用配置,
暂定一个
shared-dataids
:
common
aaa
-dev.yaml
#共用配置,
+ mongodb日志配置
shared-dataids
:
common
-dev.yaml,mongodb-log
-dev.yaml
#---
#spring:
...
...
xx-tour/xx-tour-server/src/main/resources/bootstrap.yml
View file @
fe70118f
#spring:
# application:
# name: vehicle
# cloud:
# nacos:
# config:
# server-addr: 127.0.0.1:8848
# file-extension: yaml
# profiles:
# active: dev
spring
:
profiles
:
active
:
dev
application
:
name
:
xx-tour
cloud
:
nacos
:
config
:
file-extension
:
yaml
debug
:
true
feign
:
compression
:
response
:
enabled
:
true
request
:
enabled
:
true
logging
:
level
:
com.github.wxiaoqi
:
debug
com.xxfc
:
debug
---
spring
:
profiles
:
dev
cloud
:
nacos
:
config
:
server-addr
:
127.0.0.1:8848
---
spring
:
profiles
:
pro
cloud
:
nacos
:
config
:
#spring:
# application:
# name: vehicle
# cloud:
# nacos:
# config:
# server-addr: 127.0.0.1:8848
# file-extension: yaml
# profiles:
# active: dev
spring
:
profiles
:
active
:
dev
application
:
name
:
xx-tour
cloud
:
nacos
:
config
:
file-extension
:
yaml
debug
:
true
feign
:
compression
:
response
:
enabled
:
true
request
:
enabled
:
true
logging
:
level
:
com.github.wxiaoqi
:
debug
com.xxfc
:
debug
---
spring
:
profiles
:
dev
cloud
:
nacos
:
config
:
server-addr
:
127.0.0.1:8848
#共用配置,暂定一个
shared-dataids
:
common-dev.yaml,mongodb-log-dev.yaml
---
spring
:
profiles
:
pro
cloud
:
nacos
:
config
:
server-addr
:
10.5.52.2:8848
\ No newline at end of file
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/UniversalApplication.java
View file @
fe70118f
...
...
@@ -13,7 +13,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication
(
scanBasePackages
=
{
"com.xxfc.platform"
,
"com.github.wxiaoqi.*"
"com.github.wxiaoqi.security.common.handler"
,
"com.github.wxiaoqi.security.common.log"
})
@EnableDiscoveryClient
@EnableAceAuthClient
...
...
xx-universal/xx-universal-server/src/main/resources/bootstrap.yml
View file @
fe70118f
...
...
@@ -24,7 +24,8 @@ spring:
nacos
:
config
:
server-addr
:
127.0.0.1:8848
#共用配置,暂定一个
shared-dataids
:
common-dev.yaml,mongodb-log-dev.yaml
---
spring
:
profiles
:
pro
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/VehicleApplication.java
View file @
fe70118f
...
...
@@ -11,7 +11,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
(
scanBasePackages
=
{
"com.xxfc.platform"
,
"com.github.wxiaoqi.*"
"com.github.wxiaoqi.security.common.handler"
,
"com.github.wxiaoqi.security.common.log"
})
@EnableDiscoveryClient
@EnableScheduling
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/config/WebConfiguration.java
View file @
fe70118f
...
...
@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.auth.client.interceptor.ServiceAuthRestInterc
import
com.github.wxiaoqi.security.auth.client.interceptor.UserAuthRestInterceptor
;
import
com.github.wxiaoqi.security.common.handler.GlobalExceptionHandler
;
import
com.github.wxiaoqi.security.common.interceptor.CorsInterceptor
;
import
com.github.wxiaoqi.security.common.log.XxLogInterceptor
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
...
...
@@ -33,7 +34,6 @@ public class WebConfiguration implements WebMvcConfigurer {
*/
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
getCorsInterceptor
()).
addPathPatterns
(
"/**"
);
registry
.
addInterceptor
(
getServiceAuthRestInterceptor
()).
addPathPatterns
(
getIncludePathPatterns
());
...
...
@@ -41,6 +41,13 @@ public class WebConfiguration implements WebMvcConfigurer {
addPathPatterns
(
getIncludePathPatterns
());
}
// @Bean
// XxLogInterceptor getXxLogInterceptor() {
// return new XxLogInterceptor();
// }
@Bean
ServiceAuthRestInterceptor
getServiceAuthRestInterceptor
()
{
return
new
ServiceAuthRestInterceptor
();
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/bootstrap.yml
View file @
fe70118f
...
...
@@ -25,7 +25,7 @@ spring:
config
:
server-addr
:
127.0.0.1:8848
#共用配置,暂定一个
shared-dataids
:
common-dev.yaml
shared-dataids
:
common-dev.yaml
,mongodb-log-dev.yaml
---
spring
:
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
fe70118f
...
...
@@ -365,7 +365,7 @@
</if>
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
,(
,
max
(
<foreach
collection=
"yearMonthAndParam"
index=
"yearMonth"
item=
"andOperation"
separator=
"and"
>
<include
refid=
"yearMonthAndParamSql"
></include>
</foreach>
...
...
@@ -380,7 +380,7 @@
and bc.id is not null
GROUP BY model_id, company_id
<if
test=
"lon != null and lat != null"
>
, distance
</if>
<
if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
, hasVehicle
</if
>
<
!--<if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true">, hasVehicle</if>--
>
<!-- 循环 相同父级 数据做并集, 不同父级做或集 -->
<if
test=
" catas != null "
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment