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
270fc608
Commit
270fc608
authored
Mar 13, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
to autowired
parent
c9e842d3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
5 deletions
+31
-5
BaseProduceServiceImpl.java
...pplication/product/serve/impl/BaseProduceServiceImpl.java
+0
-2
OrderServeMapper.java
...l/infrastructure/mapper/order/serve/OrderServeMapper.java
+2
-0
Schedule.java
...ain/java/com/gogirl/infrastructure/schedule/Schedule.java
+14
-1
application.yml
src/main/resources/application.yml
+2
-2
OrderServeMapper.xml
src/main/resources/mapper/order/OrderServeMapper.xml
+13
-0
No files found.
src/main/java/com/gogirl/application/product/serve/impl/BaseProduceServiceImpl.java
View file @
270fc608
...
@@ -65,8 +65,6 @@ public class BaseProduceServiceImpl extends ServiceImpl<BaseProduceMapper, BaseP
...
@@ -65,8 +65,6 @@ public class BaseProduceServiceImpl extends ServiceImpl<BaseProduceMapper, BaseP
List
<
PraiseRecord
>
mapPraiseRecordList
=
map
.
get
(
baseProduce
.
getId
());
List
<
PraiseRecord
>
mapPraiseRecordList
=
map
.
get
(
baseProduce
.
getId
());
if
(
ListUtil
.
isNotEmpty
(
mapPraiseRecordList
))
{
if
(
ListUtil
.
isNotEmpty
(
mapPraiseRecordList
))
{
baseProduce
.
setPraiseRecord
(
mapPraiseRecordList
.
stream
().
findAny
().
orElse
(
null
));
baseProduce
.
setPraiseRecord
(
mapPraiseRecordList
.
stream
().
findAny
().
orElse
(
null
));
}
else
{
baseProduce
.
setPraiseRecord
(
new
PraiseRecord
());
}
}
});
});
...
...
src/main/java/com/gogirl/infrastructure/mapper/order/serve/OrderServeMapper.java
View file @
270fc608
...
@@ -46,4 +46,6 @@ public interface OrderServeMapper extends BaseMapper<OrderServe> {
...
@@ -46,4 +46,6 @@ public interface OrderServeMapper extends BaseMapper<OrderServe> {
@Param
(
"technicianId"
)
Integer
technicianId
,
@Param
(
"technicianId"
)
Integer
technicianId
,
@Param
(
"type"
)
String
type
,
@Param
(
"type"
)
String
type
,
@Param
(
"month"
)
String
month
);
@Param
(
"month"
)
String
month
);
void
syncOrderServeTimes
();
}
}
src/main/java/com/gogirl/infrastructure/schedule/Schedule.java
View file @
270fc608
...
@@ -21,6 +21,7 @@ import com.gogirl.domain.user.customer.CustomerBalanceRecord;
...
@@ -21,6 +21,7 @@ import com.gogirl.domain.user.customer.CustomerBalanceRecord;
import
com.gogirl.infrastructure.common.util.ListUtil
;
import
com.gogirl.infrastructure.common.util.ListUtil
;
import
com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper
;
import
com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper
;
import
com.gogirl.infrastructure.mapper.order.mall.MallOrderMapper
;
import
com.gogirl.infrastructure.mapper.order.mall.MallOrderMapper
;
import
com.gogirl.infrastructure.mapper.order.serve.OrderServeMapper
;
import
com.gogirl.infrastructure.mapper.order.serve.ScheduleManageMapper
;
import
com.gogirl.infrastructure.mapper.order.serve.ScheduleManageMapper
;
import
com.gogirl.infrastructure.mapper.order.serve.ScheduleServeMapper
;
import
com.gogirl.infrastructure.mapper.order.serve.ScheduleServeMapper
;
import
com.gogirl.infrastructure.mapper.product.serve.BaseFeaturesMapper
;
import
com.gogirl.infrastructure.mapper.product.serve.BaseFeaturesMapper
;
...
@@ -73,11 +74,12 @@ public class Schedule {
...
@@ -73,11 +74,12 @@ public class Schedule {
private
final
ProduceSalesService
produceSalesService
;
private
final
ProduceSalesService
produceSalesService
;
private
final
FeaturesMappingService
featuresMappingService
;
private
final
FeaturesMappingService
featuresMappingService
;
private
final
OrderServeMapper
orderServeMapper
;
/**
/**
* 每天定时任务,判断优惠券是否过期
* 每天定时任务,判断优惠券是否过期
*/
*/
@Scheduled
(
cron
=
"0 0 3 * * ?"
)
@Scheduled
(
cron
=
"0 0 3 * * ?"
)
public
void
setCouponExpireJob
()
{
public
void
setCouponExpireJob
()
{
log
.
debug
(
"每天定时任务,判断优惠券是否过期开始"
);
log
.
debug
(
"每天定时任务,判断优惠券是否过期开始"
);
couponCustomerRelevanceDao
.
setCouponExpire
(
new
Date
());
couponCustomerRelevanceDao
.
setCouponExpire
(
new
Date
());
...
@@ -239,6 +241,9 @@ public class Schedule {
...
@@ -239,6 +241,9 @@ public class Schedule {
log
.
debug
(
"定时检查有无过期的商城订单** 任务结束"
);
log
.
debug
(
"定时检查有无过期的商城订单** 任务结束"
);
}
}
/**
* 同步商品销量
*/
@Scheduled
(
cron
=
"0 0/5 * * * *"
)
@Scheduled
(
cron
=
"0 0/5 * * * *"
)
public
void
syncProduceSales
()
{
public
void
syncProduceSales
()
{
log
.
debug
(
"同步商品销量** 任务开始"
);
log
.
debug
(
"同步商品销量** 任务开始"
);
...
@@ -267,4 +272,12 @@ public class Schedule {
...
@@ -267,4 +272,12 @@ public class Schedule {
log
.
debug
(
"同步商品销量** 任务结束"
);
log
.
debug
(
"同步商品销量** 任务结束"
);
}
}
/**
* 每分钟同步订单实际时间
*/
@Scheduled
(
cron
=
"0 0/1 * * * *"
)
public
void
syncOrderTimes
()
{
orderServeMapper
.
syncOrderServeTimes
();
}
}
}
src/main/resources/application.yml
View file @
270fc608
...
@@ -9,8 +9,8 @@ spring:
...
@@ -9,8 +9,8 @@ spring:
jackson
:
jackson
:
date-format
:
yyyy-MM-dd HH:mm:ss
date-format
:
yyyy-MM-dd HH:mm:ss
time-zone
:
GMT+8
time-zone
:
GMT+8
redis
:
#
redis:
timeout
:
0
#
timeout: 0
#mybatis 配置
#mybatis 配置
...
...
src/main/resources/mapper/order/OrderServeMapper.xml
View file @
270fc608
...
@@ -127,6 +127,19 @@
...
@@ -127,6 +127,19 @@
</sql>
</sql>
<update
id=
"syncOrderServeTimes"
>
update order_serve t1
LEFT JOIN order_manage t2 on t1.order_id = t2.id
LEFT JOIN scheduled_manage t3 on t2.id = t3.order_id
LEFT JOIN scheduled_serve t4 on t3.id = t4.sch_id and t1.serve_id = t4.serve_id
set t1.start_time=t4.actual_start_time,
t1.end_time=t4.actual_end_time
where t2.create_time > '2020-02-26'
and (t4.actual_end_time != t1.start_time
or t4.actual_start_time != t1.end_time)
</update>
<select
id=
"queryPageAchieve"
resultType=
"com.gogirl.domain.order.serve.OrderServe"
>
<select
id=
"queryPageAchieve"
resultType=
"com.gogirl.domain.order.serve.OrderServe"
>
SELECT t1.*,
SELECT t1.*,
t3.nickname,
t3.nickname,
...
...
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