| | |
| | | import cc.mrbird.febs.common.utils.HttpCurlUtil; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.common.utils.SpringContextHolder; |
| | | import cc.mrbird.febs.mall.entity.MallMemberCoupon; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberCouponMapper; |
| | | import cc.mrbird.febs.mall.service.MallInvoiceService; |
| | | import cc.mrbird.febs.pay.util.WechatConfigure; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | |
| | | |
| | | @Autowired |
| | | private RedisUtils redisUtils; |
| | | @Autowired |
| | | private MallMemberCouponMapper mallMemberCouponMapper; |
| | | @Autowired |
| | | private MallInvoiceService mallInvoiceService; |
| | | @Resource |
| | | RestTemplate restTemplate; |
| | | // @Autowired |
| | |
| | | */ |
| | | @Scheduled(cron = "0 0 0/1 * * ? ") |
| | | public void getAccessToken() throws IOException { |
| | | log.info("执行access_token刷新"); |
| | | String appId = xcxProperties.getXcxAppid(); |
| | | String appSecret = xcxProperties.getXcxSecret(); |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appId + "&secret=" + appSecret; |
| | |
| | | |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 0/1 * * ? ") |
| | | public void expireCoupon() { |
| | | List<MallMemberCoupon> mallMemberCoupons = mallMemberCouponMapper.selectListByExpireTime(DateUtil.date()); |
| | | if(CollUtil.isEmpty(mallMemberCoupons)){ |
| | | return; |
| | | } |
| | | for(MallMemberCoupon mallMemberCoupon : mallMemberCoupons){ |
| | | mallMemberCoupon.setState(3); |
| | | mallMemberCouponMapper.updateById(mallMemberCoupon); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 更新发票记录表数据 |
| | | * 定时,每天凌晨一点 |
| | | * 已完成的订单,更新到发票记录中 |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ?") |
| | | public void mallInvoiceJob() { |
| | | mallInvoiceService.mallInvoiceJob(); |
| | | } |
| | | |
| | | } |