Commit 9d455366 by huluobin

同步折扣券折扣率定时任务

parent 4dcf484e
...@@ -50,4 +50,9 @@ public interface CouponCustomerRelevanceMapper extends BaseMapper<CouponCustomer ...@@ -50,4 +50,9 @@ public interface CouponCustomerRelevanceMapper extends BaseMapper<CouponCustomer
* @return * @return
*/ */
List<CouponCustomerRelevance> getOrderCoupon(@Param("currentCustomerId") Integer currentCustomerId, @Param("departmentId") Integer departmentId); List<CouponCustomerRelevance> getOrderCoupon(@Param("currentCustomerId") Integer currentCustomerId, @Param("departmentId") Integer departmentId);
/**
* 每分钟同步卡券折扣率
*/
void syncCouponCustomerRelDiscountPercent();
} }
...@@ -714,4 +714,14 @@ public class Schedule { ...@@ -714,4 +714,14 @@ public class Schedule {
storeTechnicianMapper.syncTechnicianJobs(); storeTechnicianMapper.syncTechnicianJobs();
log.info("每天凌晨3点同步美甲师jobs 结束"); log.info("每天凌晨3点同步美甲师jobs 结束");
} }
/**
* 每分钟同步卡券折扣率
*/
@Scheduled(cron = "0 0/1 * * * *")
public void syncCouponCustomerRelDiscountPercent() {
log.info("每分钟同步卡券折扣信息 开始");
couponCustomerRelevanceDao.syncCouponCustomerRelDiscountPercent();
log.info("每分钟同步卡券折扣信息 结束");
}
} }
...@@ -55,4 +55,11 @@ ...@@ -55,4 +55,11 @@
where state = 1 where state = 1
and #{nowDate,jdbcType=TIMESTAMP} > valid_end_time and #{nowDate,jdbcType=TIMESTAMP} > valid_end_time
</update> </update>
<update id="syncCouponCustomerRelDiscountPercent">
update coupon_customer_relevance t1
LEFT JOIN coupon t2 on t1.coupon_id = t2.id
set t1.discount_percent = t2.discount_rate
where t1.type = 5
and t1.discount_percent is null;
</update>
</mapper> </mapper>
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