|
|
@@ -2,15 +2,13 @@ package com.kxs.user.biz.task;
|
|
|
|
|
|
import cn.hutool.core.date.DatePattern;
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
|
|
-import com.kxs.common.mybatis.handler.MonthTableNameHandler;
|
|
|
+import com.kxs.common.security.annotation.Inner;
|
|
|
import com.kxs.user.biz.mapper.KxsUserAmountLogMapper;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.scheduling.annotation.Async;
|
|
|
-import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
-import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
-import org.springframework.scheduling.annotation.Scheduled;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
|
@@ -20,11 +18,10 @@ import java.time.LocalDate;
|
|
|
* @author 没秃顶的码农
|
|
|
* @date 2024-03-13
|
|
|
*/
|
|
|
-@Component
|
|
|
-@EnableAsync
|
|
|
-@EnableScheduling
|
|
|
@RequiredArgsConstructor
|
|
|
@Slf4j
|
|
|
+@RestController
|
|
|
+@RequestMapping("user-job")
|
|
|
public class KxsUserTaskJob {
|
|
|
|
|
|
private final KxsUserAmountLogMapper kxsUserAmountLogMapper;
|
|
|
@@ -34,10 +31,20 @@ public class KxsUserTaskJob {
|
|
|
* 自动表创建任务
|
|
|
* 每个月15号建立下个月的收支日志表
|
|
|
*/
|
|
|
- @Async(value = "getAsyncExecutor")
|
|
|
- @Scheduled(cron = "0 15 10 15 * ?")
|
|
|
+ @Inner
|
|
|
+ @GetMapping("/automaticTableCreationTasks")
|
|
|
public void automaticTableCreationTasks() {
|
|
|
String thisMoth = LocalDateTimeUtil.format(LocalDate.now().plusMonths(1L), DatePattern.SIMPLE_MONTH_PATTERN);
|
|
|
kxsUserAmountLogMapper.automaticTableCreationTasks("kxs_user_amount_log_" +thisMoth);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 每天凌晨执行:
|
|
|
+ * 1.扫创客合伙人可提现额度,若有合伙人可提现额度,则扣除可提现额度,最大扣除金额=欠款总金额,扣除后减少欠款总金额,同时在前端增加扣除记录,备注为「预借款项还款」
|
|
|
+ * 2.扫创客盟主可提现余额,若有盟主可提现余额,则扣除可提现余额,最大扣除金额=欠款总金额,扣除后减少欠款总金额,同时在前端增加扣除记录,备注为「预借款项还款」
|
|
|
+ */
|
|
|
+ @Inner
|
|
|
+ @GetMapping("/userTotalDebtSub")
|
|
|
+ public void userTotalDebtSub(){
|
|
|
+ }
|
|
|
}
|