|
@@ -1,7 +1,11 @@
|
|
|
package com.tzld.piaoquan.longarticle.job;
|
|
|
|
|
|
+import com.tzld.piaoquan.longarticle.dao.mapper.crawler.ArticleUseGroupMapper;
|
|
|
+import com.tzld.piaoquan.longarticle.model.po.crawler.ArticleUseGroup;
|
|
|
+import com.tzld.piaoquan.longarticle.model.po.crawler.ArticleUseGroupExample;
|
|
|
import com.tzld.piaoquan.longarticle.service.local.CoreService;
|
|
|
import com.tzld.piaoquan.longarticle.service.local.CoverService;
|
|
|
+import com.tzld.piaoquan.longarticle.utils.DateUtil;
|
|
|
import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
|
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
@@ -21,7 +25,7 @@ public class PlanAccountJob {
|
|
|
private CoverService coverService;
|
|
|
|
|
|
@Autowired
|
|
|
- private RedisTemplate<String, Object> redisTemplate;
|
|
|
+ private ArticleUseGroupMapper articleUseGroupMapper;
|
|
|
|
|
|
@XxlJob("initAccountSpecialSettingsJob")
|
|
|
public ReturnT<String> initAccountSpecialSettings(String param) {
|
|
@@ -89,4 +93,21 @@ public class PlanAccountJob {
|
|
|
}
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
+
|
|
|
+ @XxlJob("updateRemainingCountJob")
|
|
|
+ public ReturnT<String> updateRemainingCount(String param) {
|
|
|
+ try {
|
|
|
+ int dayOfMonth = DateUtil.getDayOfMonth();
|
|
|
+ if (dayOfMonth == 1) {
|
|
|
+ ArticleUseGroup articleUseGroup = new ArticleUseGroup();
|
|
|
+ articleUseGroup.setRemainingCount(4);
|
|
|
+ ArticleUseGroupExample example = new ArticleUseGroupExample();
|
|
|
+ example.createCriteria().andIdGreaterThan(0L);
|
|
|
+ articleUseGroupMapper.updateByExampleSelective(articleUseGroup, example);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("updateRemainingCount error", e);
|
|
|
+ }
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
+ }
|
|
|
}
|