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
c63c7180
Commit
c63c7180
authored
Jul 13, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
导入会员列表 与 删除
parents
776de38c
7fb092c5
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
689 additions
and
72 deletions
+689
-72
pom.xml
ace-common/pom.xml
+18
-0
CommonLogService.java
.../github/wxiaoqi/security/common/log/CommonLogService.java
+64
-0
CommonLogServiceImpl.java
...xiaoqi/security/common/log/Impl/CommonLogServiceImpl.java
+137
-0
XxLogInterceptor.java
.../github/wxiaoqi/security/common/log/XxLogInterceptor.java
+158
-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
SmsTemplateDTO.java
.../java/com/xxfc/platform/universal/dto/SmsTemplateDTO.java
+22
-0
ThirdFeign.java
...in/java/com/xxfc/platform/universal/feign/ThirdFeign.java
+4
-0
CCPRestSmsUtils.java
...va/com/xxfc/platform/universal/utils/CCPRestSmsUtils.java
+40
-0
UniversalApplication.java
...ava/com/xxfc/platform/universal/UniversalApplication.java
+2
-1
CCPRestSmsBiz.java
...n/java/com/xxfc/platform/universal/biz/CCPRestSmsBiz.java
+42
-0
SmsController.java
...com/xxfc/platform/universal/controller/SmsController.java
+18
-0
CertificationService.java
...xxfc/platform/universal/service/CertificationService.java
+20
-8
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 @
c63c7180
...
...
@@ -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 @
c63c7180
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
,
Object
result
);
/**
* 初始化日志后半部分(String)
* @param xxLogEntity
* @param result
*/
void
initCommonLogLastPart
(
XxLogEntity
xxLogEntity
,
String
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 @
c63c7180
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
,
Object
result
)
{
initCommonLogLastPart
(
xxLogEntity
,
JSON
.
toJSONString
(
result
));
}
@Override
public
void
initCommonLogLastPart
(
XxLogEntity
xxLogEntity
,
String
result
)
{
LocalDateTime
endTime
=
LocalDateTime
.
now
();
//结束时间
xxLogEntity
.
setEndDate
(
endTime
.
toString
());
xxLogEntity
.
setResponseData
(
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 @
c63c7180
package
com
.
github
.
wxiaoqi
.
security
.
common
.
log
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
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
lombok.extern.slf4j.Slf4j
;
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
@Slf4j
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
)
{
try
{
xxLogEntity
.
setRequestData
(
JSON
.
toJSONString
(
params
[
0
]));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
}
Object
result
=
new
Object
();
try
{
//###################上面代码为方法执行前#####################
result
=
pjp
.
proceed
();
//执行方法,获取返回参数
//###################下面代码为方法执行后#####################
if
(
result
instanceof
JSONObject
)
{
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
((
JSONObject
)
result
).
toJSONString
());
}
else
{
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
result
);
}
}
catch
(
BaseException
e
){
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
ObjectRestResponse
.
createFailedResult
(
e
.
getStatus
(),
e
.
getMessage
()));
}
catch
(
Exception
e
){
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
ObjectRestResponse
.
createFailedResult
(
500
,
e
.
getMessage
()));
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 @
c63c7180
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 @
c63c7180
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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
#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-api/src/main/java/com/xxfc/platform/universal/dto/SmsTemplateDTO.java
0 → 100644
View file @
c63c7180
package
com
.
xxfc
.
platform
.
universal
.
dto
;
import
lombok.Data
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/3 17:51
*/
@Data
public
class
SmsTemplateDTO
{
//类型:1-租车订单通知(普通用户),2-租车订单短信(会员权益),3-旅游订单短信,4-加入会员通知
private
Integer
type
;
//手机号码(多个短信逗号隔开)
private
String
phoneNumbers
;
//参数
private
String
[]
params
;
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/feign/ThirdFeign.java
View file @
c63c7180
...
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.universal.feign;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.universal.dto.RegionDTO
;
import
com.xxfc.platform.universal.dto.SmsTemplateDTO
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.entity.OrderRefund
;
import
com.xxfc.platform.universal.vo.*
;
...
...
@@ -29,6 +30,9 @@ public interface ThirdFeign {
@RequestMapping
(
value
=
"/sms/app/unauth/sendCode"
,
method
=
RequestMethod
.
GET
)
//发送短信模板消息
public
JSONObject
sendCode
(
@RequestParam
(
"phone"
)
String
phone
,
@RequestParam
(
"code"
)
String
code
,
@RequestParam
(
"templateCode"
)
String
templateCode
);
//云通讯短信机
@RequestMapping
(
value
=
"/app/unauth/sendTemplate"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
sendTemplate
(
SmsTemplateDTO
smsTemplateDTO
);
@RequestMapping
(
value
=
"/file/app/unauth/uploadFiles"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
uploadFiles
(
@RequestParam
(
value
=
"files"
)
MultipartFile
[]
files
);
@RequestMapping
(
value
=
"/pay/app/wx"
,
method
=
RequestMethod
.
POST
)
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/utils/CCPRestSmsUtils.java
0 → 100644
View file @
c63c7180
package
com
.
xxfc
.
platform
.
universal
.
utils
;
import
com.cloopen.rest.sdk.CCPRestSmsSDK
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Set
;
public
class
CCPRestSmsUtils
{
public
static
CCPRestSmsSDK
restAPI
;
static
{
restAPI
=
new
CCPRestSmsSDK
();
restAPI
.
init
(
"app.cloopen.com"
,
"8883"
);
restAPI
.
setAccount
(
"8aaf070865e6b6eb0165ecd776700559"
,
"3fe5e2f053674f23b029a9a9fc9503f0"
);
restAPI
.
setAppId
(
"8a216da86812593601684bec10581ab5"
);
}
public
static
Map
<
String
,
Object
>
sendTemplateSMS
(
String
phoneNumbers
,
String
[]
params
,
String
templateId
)
{
HashMap
<
String
,
Object
>
result
=
null
;
result
=
restAPI
.
sendTemplateSMS
(
phoneNumbers
,
templateId
,
params
);
System
.
out
.
println
(
"SDKTestGetSubAccounts result="
+
result
);
if
(
"000000"
.
equals
(
result
.
get
(
"statusCode"
)))
{
// 正常返回输出data包体信息(map)
HashMap
<
String
,
Object
>
data
=
(
HashMap
<
String
,
Object
>)
result
.
get
(
"data"
);
Set
<
String
>
keySet
=
data
.
keySet
();
for
(
String
key
:
keySet
)
{
Object
object
=
data
.
get
(
key
);
System
.
out
.
println
(
key
+
" = "
+
object
);
}
}
else
{
// 异常返回输出错误码和错误信息
System
.
out
.
println
(
"错误码="
+
result
.
get
(
"statusCode"
)
+
" 错误信息= "
+
result
.
get
(
"statusMsg"
));
}
return
result
;
}
}
\ No newline at end of file
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/UniversalApplication.java
View file @
c63c7180
...
...
@@ -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/java/com/xxfc/platform/universal/biz/CCPRestSmsBiz.java
0 → 100644
View file @
c63c7180
package
com
.
xxfc
.
platform
.
universal
.
biz
;
import
com.xxfc.platform.universal.utils.CCPRestSmsUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
@Service
@Slf4j
public
class
CCPRestSmsBiz
{
//租车订单通知(普通用户)1
public
static
final
String
TEMPLATE_ID_ORDER
=
"457270"
;
//租车订单短信(会员权益)2
public
static
final
String
TEMPLATE_ID_ORDER_MEMBER
=
"457271"
;
//旅游订单短信3
public
static
final
String
TEMPLATE_ID_ORDER_TOUR
=
"457272"
;
//加入会员通知4
public
static
final
String
TEMPLATE_ID_MEMBER
=
"457273"
;
//发送模板消息
public
void
sendTemplateSMS
(
Integer
type
,
String
phoneNumbers
,
String
[]
params
){
switch
(
type
){
case
1
:
CCPRestSmsUtils
.
sendTemplateSMS
(
phoneNumbers
,
params
,
TEMPLATE_ID_ORDER
);
break
;
case
2
:
CCPRestSmsUtils
.
sendTemplateSMS
(
phoneNumbers
,
params
,
TEMPLATE_ID_ORDER_MEMBER
);
break
;
case
3
:
CCPRestSmsUtils
.
sendTemplateSMS
(
phoneNumbers
,
params
,
TEMPLATE_ID_ORDER_TOUR
);
break
;
case
4
:
CCPRestSmsUtils
.
sendTemplateSMS
(
phoneNumbers
,
params
,
TEMPLATE_ID_MEMBER
);
break
;
}
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/SmsController.java
View file @
c63c7180
...
...
@@ -3,7 +3,10 @@ package com.xxfc.platform.universal.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
com.xxfc.platform.universal.biz.CCPRestSmsBiz
;
import
com.xxfc.platform.universal.dto.SmsTemplateDTO
;
import
com.xxfc.platform.universal.service.SmsService
;
import
com.xxfc.platform.universal.service.UploadService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -29,6 +32,9 @@ public class SmsController {
@Autowired
SmsService
smsService
;
@Autowired
CCPRestSmsBiz
smsBiz
;
@RequestMapping
(
value
=
"/app/unauth/send"
,
method
=
RequestMethod
.
GET
)
//匹配的是href中的download请求
public
JSONObject
sendSms
(
@RequestParam
(
"phone"
)
String
phone
)
throws
Exception
{
return
smsService
.
smsCode
(
phone
);
...
...
@@ -40,5 +46,17 @@ public class SmsController {
@RequestParam
(
"templateCode"
)
String
templateCode
)
throws
Exception
{
return
smsService
.
smsByCode
(
phone
,
code
,
templateCode
);
}
@RequestMapping
(
value
=
"/app/unauth/sendTemplate"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
sendTemplate
(
SmsTemplateDTO
smsTemplateDTO
)
throws
Exception
{
if
(
smsTemplateDTO
==
null
){
return
ObjectRestResponse
.
createDefaultFail
();
}
Integer
type
=
smsTemplateDTO
.
getType
();
String
[]
params
=
smsTemplateDTO
.
getParams
();
String
phoneNumbers
=
smsTemplateDTO
.
getPhoneNumbers
();
smsBiz
.
sendTemplateSMS
(
type
,
phoneNumbers
,
params
);
return
ObjectRestResponse
.
succ
();
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/CertificationService.java
View file @
c63c7180
...
...
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -347,18 +348,29 @@ public class CertificationService {
return
ObjectRestResponse
.
succ
();
}
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
formatter
.
setLenient
(
false
);
Date
expirationDate
=
null
;
try
{
expirationDate
=
formatter
.
parse
(
endDate
);
}
catch
(
ParseException
e
)
{
Date
expirationDate
=
new
Date
();
if
(!
Validation
.
isDate
(
endDate
))
{
Date
date
=
new
Date
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
c
.
add
(
Calendar
.
YEAR
,
100
);
expirationDate
=
c
.
getTime
();
e
.
printStackTrace
();
return
ObjectRestResponse
.
createDefaultFail
();
}
else
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
formatter
.
setLenient
(
false
);
try
{
expirationDate
=
formatter
.
parse
(
endDate
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
idInformation
.
setExpirationDate
(
expirationDate
);
Boolean
aBoolean
=
addIdInformation
(
idInformation
);
...
...
xx-universal/xx-universal-server/src/main/resources/bootstrap.yml
View file @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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 @
c63c7180
...
...
@@ -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