Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
Overview
Overview
Details
Activity
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
huluobin
gogirl-miniapp-backend
Commits
662075f9
Commit
662075f9
authored
Apr 09, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务计划修改
parent
b28d3bd6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
207 deletions
+20
-207
pom.xml
pom.xml
+0
-0
ControllerLog.java
...ogirl/infrastructure/common/annotation/ControllerLog.java
+0
-10
GogirlMember.java
...gogirl/infrastructure/common/annotation/GogirlMember.java
+0
-4
GogirlShop.java
...m/gogirl/infrastructure/common/annotation/GogirlShop.java
+0
-4
LogAspect.java
...va/com/gogirl/infrastructure/common/aspect/LogAspect.java
+0
-172
CloneUtil.java
...java/com/gogirl/infrastructure/common/util/CloneUtil.java
+3
-1
Swagger2Config.java
...java/com/gogirl/infrastructure/config/Swagger2Config.java
+2
-2
Schedule.java
...ain/java/com/gogirl/infrastructure/schedule/Schedule.java
+15
-14
No files found.
pom.xml
View file @
662075f9
This diff is collapsed.
Click to expand it.
src/main/java/com/gogirl/infrastructure/common/annotation/ControllerLog.java
deleted
100644 → 0
View file @
b28d3bd6
package
com
.
gogirl
.
infrastructure
.
common
.
annotation
;
import
java.lang.annotation.*
;
@Target
({
ElementType
.
METHOD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
public
@interface
ControllerLog
{
}
src/main/java/com/gogirl/infrastructure/common/annotation/GogirlMember.java
deleted
100755 → 0
View file @
b28d3bd6
package
com
.
gogirl
.
infrastructure
.
common
.
annotation
;
public
@interface
GogirlMember
{
}
src/main/java/com/gogirl/infrastructure/common/annotation/GogirlShop.java
deleted
100755 → 0
View file @
b28d3bd6
package
com
.
gogirl
.
infrastructure
.
common
.
annotation
;
public
@interface
GogirlShop
{
}
src/main/java/com/gogirl/infrastructure/common/aspect/LogAspect.java
deleted
100644 → 0
View file @
b28d3bd6
package
com
.
gogirl
.
infrastructure
.
common
.
aspect
;
//package com.gogirl.infrastructure.common.aspect;
//
//import com.alibaba.fastjson.JSON;
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.annotation.*;
//import org.springframework.context.annotation.Configuration;
//
//import java.util.Arrays;
//
//@Aspect
//@Configuration
//@Slf4j
//public class LogAspect {
//
//
// /**
// * Controller层切点
// */
// @Pointcut("@annotation(com.xxxx.utils.logs.annotation.ControllerLogs)")
// public void controllerAspect() {
//
// }
//
// /**
// * 前置通知 用于拦截Controller层记录用户的操作
// *
// * @param joinPoint 切点
// */
// @Before("controllerAspect()")
// public void doBefore(JoinPoint joinPoint) {
// try {
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// //类名
// String className = joinPoint.getTarget().getClass().getName();
// //请求方法
// String method = joinPoint.getSignature().getName() + "()";
// //方法参数
// String methodParam = JSON.toJSONString(joinPoint.getArgs());
// //方法描述
// String methodDescription = getControllerMethodDescription(joinPoint);
// StringBuilder sb = new StringBuilder(1000);
// sb.append("\n");
// sb.append("*********************************Request请求***************************************");
// sb.append("\n");
// sb.append("ClassName : ").append(className).append("\n");
// sb.append("RequestMethod : ").append(method).append("\n");
// sb.append("RequestParams : ").append(methodParam).append("\n");
// sb.append("RequestType : ").append(request.getMethod()).append("\n");
// sb.append("Description : ").append(methodDescription).append("\n");
// sb.append("serverAddr : ").append(request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()).append("\n");
// sb.append("RemoteAddr : ").append(IpUtils.getRemoteAddr(request)).append("\n");
// UserAgent userAgent = UserAgentUtils.getUserAgent(request);
// sb.append("DeviceName : ").append(userAgent.getOperatingSystem().getName()).append("\n");
// sb.append("BrowserName : ").append(userAgent.getBrowser().getName()).append("\n");
// sb.append("UserAgent : ").append(request.getHeader("User-Agent")).append("\n");
// sb.append("RequestUri : ").append(StringUtils.abbr(request.getRequestURI(), 255)).append("\n");
// log.info(sb.toString());
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//
// @AfterReturning(returning = "ret", pointcut = "controllerAspect()")
// public void doAfterReturning(Object ret) throws Throwable {
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// //请求方法
// String method = StringUtils.abbr(request.getRequestURI(), 255);
// StringBuilder sb = new StringBuilder(1000);
// // 处理完请求,返回内容
// sb.append("\n");
// sb.append("Result : ").append(ret);
// log.info(sb.toString());
// }
//
//
// /**
// * 异常通知 用于拦截service层记录异常日志
// *
// * @param joinPoint
// * @param ex
// */
// @AfterThrowing(pointcut = "serviceAspect()", throwing = "ex")
// public void doAfterThrowing(JoinPoint joinPoint, Throwable ex) {
// try {
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// //类名
// String className = joinPoint.getTarget().getClass().getName();
// //请求方法
// String method = (joinPoint.getTarget().getClass().getName() + "." + joinPoint.getSignature().getName() + "()");
// //方法参数
// String methodParam = Arrays.toString(joinPoint.getArgs());
// //方法描述
// String methodDescription = getServiceMthodDescription(joinPoint);
// //获取用户请求方法的参数并序列化为JSON格式字符串
// String params = "";
// if (joinPoint.getArgs() != null && joinPoint.getArgs().length > 0) {
// for (int i = 0; i < joinPoint.getArgs().length; i++) {
// params += JSON.toJSONString(joinPoint.getArgs()[i]) + ";";
// }
// }
// StringBuilder sb = new StringBuilder(1000);
// sb.append("\n");
// sb.append("*********************************Service异常***************************************");
// sb.append("\n");
// sb.append("ClassName : ").append(className).append("\n");
// sb.append("Method : ").append(method).append("\n");
// sb.append("Params : ").append("[" + params + "]").append("\n");
// sb.append("Description : ").append(methodDescription).append("\n");
// sb.append("ExceptionName : ").append(ex.getClass().getName()).append("\n");
// sb.append("ExceptionMessage : ").append(ex.getMessage()).append("\n");
// log.info(sb.toString());
// } catch (Exception e1) {
// e1.printStackTrace();
// }
// }
//
// /**
// * 获取注解中对方法的描述信息 用于service层注解
// *
// * @param joinPoint 切点
// * @return 方法描述
// * @throws Exception
// */
// public static String getServiceMthodDescription(JoinPoint joinPoint)
// throws Exception {
// String targetName = joinPoint.getTarget().getClass().getName();
// String methodName = joinPoint.getSignature().getName();
// Object[] arguments = joinPoint.getArgs();
// Class targetClass = Class.forName(targetName);
// Method[] methods = targetClass.getMethods();
// String description = "";
// for (Method method : methods) {
// if (method.getName().equals(methodName)) {
// Class[] clazzs = method.getParameterTypes();
// if (clazzs.length == arguments.length) {
// description = method.getAnnotation(ServiceLogs.class).description();
// break;
// }
// }
// }
// return description;
// }
//
// /**
// * 获取注解中对方法的描述信息 用于Controller层注解
// *
// * @param joinPoint 切点
// * @return 方法描述
// * @throws Exception
// */
// public static String getControllerMethodDescription(JoinPoint joinPoint) throws Exception {
// String targetName = joinPoint.getTarget().getClass().getName();
// String methodName = joinPoint.getSignature().getName();
// Object[] arguments = joinPoint.getArgs();
// Class targetClass = Class.forName(targetName);
// Method[] methods = targetClass.getMethods();
// String description = "";
// for (Method method : methods) {
// if (method.getName().equals(methodName)) {
// Class[] clazzs = method.getParameterTypes();
// if (clazzs.length == arguments.length) {
// description = method.getAnnotation(ControllerLogs.class).description();
// break;
// }
// }
// }
// return description;
// }
//
//
//}
src/main/java/com/gogirl/infrastructure/common/util/CloneUtil.java
View file @
662075f9
package
com
.
gogirl
.
infrastructure
.
common
.
util
;
import
org.apache.commons.lang3.SerializationUtils
;
import
java.io.*
;
public
class
CloneUtil
{
public
class
CloneUtil
extends
SerializationUtils
{
public
static
<
T
>
T
deepClone
(
T
sourceObj
)
{
ByteArrayOutputStream
byteArrayOutputStream
=
null
;
...
...
src/main/java/com/gogirl/
Swagger2
.java
→
src/main/java/com/gogirl/
infrastructure/config/Swagger2Config
.java
View file @
662075f9
package
com
.
gogirl
;
package
com
.
gogirl
.
infrastructure
.
config
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -19,7 +19,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
*/
@Configuration
@EnableSwagger2
public
class
Swagger2
{
public
class
Swagger2
Config
{
/**
* 创建API应用
...
...
src/main/java/com/gogirl/infrastructure/schedule/Schedule.java
View file @
662075f9
...
...
@@ -114,9 +114,8 @@ public class Schedule {
*/
private
final
GogirlProperties
gogirlProperties
;
/**
* 每天
定时任务,判断优惠券是否过期
* 每天
3点判断优惠券是否过期。
*/
@Scheduled
(
cron
=
"0 0 3 * * ?"
)
public
void
setCouponExpireJob
()
{
...
...
@@ -126,7 +125,7 @@ public class Schedule {
}
/**
* 每天
定时设置推荐人:当天服务的技师为推荐人
* 每天
23:50设置推荐人:当天服务的技师为推荐人。
*/
@Scheduled
(
cron
=
"0 50 23 * * *"
)
public
void
setChargeReferees
()
{
...
...
@@ -187,9 +186,9 @@ public class Schedule {
}
/**
* 提前一小时通知客户到店服务
*
每15分钟
提前一小时通知客户到店服务
*/
@Scheduled
(
cron
=
"0
1/2
* * * *"
)
@Scheduled
(
cron
=
"0
0/15
* * * *"
)
public
void
notifyCustomerToShopService
()
{
log
.
debug
(
"提前一个小时通知客户到店服务** 任务开始"
);
...
...
@@ -288,7 +287,7 @@ public class Schedule {
}
/**
* 同步商品销量
*
每天3点
同步商品销量
*/
@Scheduled
(
cron
=
"0 0 3 * * ?"
)
public
void
syncProduceSales
()
{
...
...
@@ -321,15 +320,16 @@ public class Schedule {
/**
* 每分钟同步订单实际时间
*/
@Scheduled
(
cron
=
"0 0/1 * * * *"
)
@Scheduled
(
cron
=
"0 0/2 * * * *"
)
@Deprecated
public
void
syncOrderTimes
()
{
orderServeMapper
.
syncOrderServeTimes
();
}
/**
* 同步闲时预约周信息
*
每天0点定时
同步闲时预约周信息
*/
@Scheduled
(
cron
=
"0 0
/1 *
* * *"
)
@Scheduled
(
cron
=
"0 0
0
* * *"
)
public
void
weekTest
()
{
log
.
debug
(
"同步闲时折扣周"
);
weekConfigMapper
.
delete
(
new
LambdaQueryWrapper
<>());
...
...
@@ -347,9 +347,9 @@ public class Schedule {
}
/**
* 定时同步美甲师成长历程
*
每天0点
定时同步美甲师成长历程
*/
@Scheduled
(
cron
=
"0 0
/1 *
* * *"
)
@Scheduled
(
cron
=
"0 0
0
* * *"
)
public
void
syncTechnicianCareer
()
{
log
.
info
(
"定时同步美甲师成长历程** 任务开始"
);
...
...
@@ -503,9 +503,9 @@ public class Schedule {
}
/**
* 定时同步门店数据
*
每天0点
定时同步门店数据
*/
@Scheduled
(
cron
=
"0 0
/1 *
* * *"
)
@Scheduled
(
cron
=
"0 0
0
* * *"
)
public
void
syncStoreData
()
{
log
.
info
(
"定时同步门店数据** 任务开始"
);
...
...
@@ -600,8 +600,9 @@ public class Schedule {
/**
* 每30分钟一次评价提醒图推送
*/
@Scheduled
(
cron
=
"0 0/
1
* * * *"
)
@Scheduled
(
cron
=
"0 0/
30
* * * *"
)
public
void
testPaper
()
{
log
.
info
(
"评价提醒推送定时任务开始"
);
Date
date
=
new
Date
(
System
.
currentTimeMillis
()
-
gogirlProperties
.
getTestPaperTime
()
*
60000L
);
...
...
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