Commit 270fc608 by huluobin

to autowired

parent c9e842d3
......@@ -65,8 +65,6 @@ public class BaseProduceServiceImpl extends ServiceImpl<BaseProduceMapper, BaseP
List<PraiseRecord> mapPraiseRecordList = map.get(baseProduce.getId());
if (ListUtil.isNotEmpty(mapPraiseRecordList)) {
baseProduce.setPraiseRecord(mapPraiseRecordList.stream().findAny().orElse(null));
} else {
baseProduce.setPraiseRecord(new PraiseRecord());
}
});
......
......@@ -46,4 +46,6 @@ public interface OrderServeMapper extends BaseMapper<OrderServe> {
@Param("technicianId") Integer technicianId,
@Param("type") String type,
@Param("month") String month);
void syncOrderServeTimes();
}
......@@ -21,6 +21,7 @@ import com.gogirl.domain.user.customer.CustomerBalanceRecord;
import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper;
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.ScheduleServeMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseFeaturesMapper;
......@@ -73,11 +74,12 @@ public class Schedule {
private final ProduceSalesService produceSalesService;
private final FeaturesMappingService featuresMappingService;
private final OrderServeMapper orderServeMapper;
/**
* 每天定时任务,判断优惠券是否过期
*/
@Scheduled(cron = "0 0 3 * * ?")
public void setCouponExpireJob() {
log.debug("每天定时任务,判断优惠券是否过期开始");
couponCustomerRelevanceDao.setCouponExpire(new Date());
......@@ -239,6 +241,9 @@ public class Schedule {
log.debug("定时检查有无过期的商城订单** 任务结束");
}
/**
* 同步商品销量
*/
@Scheduled(cron = "0 0/5 * * * *")
public void syncProduceSales() {
log.debug("同步商品销量** 任务开始");
......@@ -267,4 +272,12 @@ public class Schedule {
log.debug("同步商品销量** 任务结束");
}
/**
* 每分钟同步订单实际时间
*/
@Scheduled(cron = "0 0/1 * * * *")
public void syncOrderTimes() {
orderServeMapper.syncOrderServeTimes();
}
}
......@@ -9,8 +9,8 @@ spring:
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
redis:
timeout: 0
# redis:
# timeout: 0
#mybatis 配置
......
......@@ -127,6 +127,19 @@
</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 t1.*,
t3.nickname,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment