Commit c2bef9dc authored by hongguangwu's avatar hongguangwu

本期申报,定时任务

parent d495c826
......@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsTaxSalary;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsTaxSalaryService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsTaxSalaryTwoService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsTaxSalarySearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -48,6 +49,7 @@ import javax.servlet.http.HttpServletResponse;
public class TStatisticsTaxSalaryController {
private final TStatisticsTaxSalaryService tStatisticsTaxSalaryService;
private final TStatisticsTaxSalaryTwoService tStatisticsTaxSalaryTwoService;
/**
......@@ -111,9 +113,9 @@ public class TStatisticsTaxSalaryController {
@Inner
@Operation(description = "定时任务-年度报账+工资薪金+本期申报")
@PostMapping("/inner/doRefreshStatisticsTaxAuto")
public R<String> doRefreshStatisticsTaxAuto() {
public void doRefreshStatisticsTaxAuto() {
String settleMonth = DateUtil.addMonth(-1);
return tStatisticsTaxSalaryService.doRefreshStatisticsTaxAll(settleMonth);
tStatisticsTaxSalaryTwoService.doRefreshStatisticsTaxAuto(settleMonth);
}
/**
......
......@@ -22,4 +22,13 @@ public interface TStatisticsTaxSalaryTwoService extends IService<TStatisticsTaxS
**/
R<String> doStatisticsTaxSalary(String tableName, String settleMonth);
/**
* @param settleMonth
* @Description:
* @Author: hgw
* @Date: 2022/8/23 17:55
* @return: void
**/
void doRefreshStatisticsTaxAuto(String settleMonth);
}
......@@ -36,13 +36,13 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsTaxSalary;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsTaxSalaryRule;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsTaxSalaryMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsTaxSalaryRuleService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsTaxSalaryService;
import com.yifu.cloud.plus.v1.yifu.salary.service.*;
import com.yifu.cloud.plus.v1.yifu.salary.util.DoStatisticsTask;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsTaxSalarySearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsTaxSalaryVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
......
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsTaxSalary;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsTaxSalaryMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccount2022Service;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsCurrentReportService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsTaxSalaryTwoService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
......@@ -20,6 +24,9 @@ import org.springframework.stereotype.Service;
@Service("tStatisticsTaxSalaryTwoService")
public class TStatisticsTaxSalaryTwoServiceImpl extends ServiceImpl<TStatisticsTaxSalaryMapper, TStatisticsTaxSalary> implements TStatisticsTaxSalaryTwoService {
private final TSalaryAccount2022Service tSalaryAccount2020Service;
private final TStatisticsCurrentReportService tStatisticsCurrentReportService;
/**
* @param tableName
* @param settleMonth
......@@ -39,4 +46,23 @@ public class TStatisticsTaxSalaryTwoServiceImpl extends ServiceImpl<TStatisticsT
return R.failed("刷新工资薪金失败!");
}
@Override
public void doRefreshStatisticsTaxAuto(String settleMonth) {
String tableName = "t_salary_account_" + settleMonth.substring(0, 4);
// 刷新对应结算月的 年度报账
R<String> accountR = tSalaryAccount2020Service.doRefreshSalaryAccountByMonth(tableName, settleMonth);
if (accountR != null && accountR.getCode() == CommonConstants.SUCCESS) {
// 刷新对应结算月的 工资薪金
R<String> taxR = this.doStatisticsTaxSalary(tableName, settleMonth);
if (taxR.getCode() == CommonConstants.SUCCESS) {
// 刷新对应结算月的 本期申报
tStatisticsCurrentReportService.doRefreshStatisticsCurrentReport(settleMonth);
} else {
log.error(taxR.getMsg());
}
} else {
log.error(accountR == null ? "刷新对应结算月的 年度报账-失败!" : accountR.getMsg());
}
}
}
package com.yifu.cloud.plus.v1.yifu.salary.util;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccount2022Service;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsCurrentReportService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsTaxSalaryTwoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -24,12 +20,6 @@ public class DoStatisticsTask {
@Autowired
private TStatisticsTaxSalaryTwoService tStatisticsTaxSalaryTwoService;
@Autowired
private TSalaryAccount2022Service tSalaryAccount2020Service;
@Autowired
private TStatisticsCurrentReportService tStatisticsCurrentReportService;
/**
* @param settleMonth
* @Description: 核心刷新-年度报账、工资薪金、本期申报
......@@ -39,21 +29,7 @@ public class DoStatisticsTask {
**/
@Async
public void doRefreshCore(String settleMonth) {
String tableName = "t_salary_account_" + settleMonth.substring(0, 4);
// 刷新对应结算月的 年度报账
R<String> accountR = tSalaryAccount2020Service.doRefreshSalaryAccountByMonth(tableName, settleMonth);
if (accountR != null && accountR.getCode() == CommonConstants.SUCCESS) {
// 刷新对应结算月的 工资薪金
R<String> taxR = tStatisticsTaxSalaryTwoService.doStatisticsTaxSalary(tableName, settleMonth);
if (taxR.getCode() == CommonConstants.SUCCESS) {
// 刷新对应结算月的 本期申报
tStatisticsCurrentReportService.doRefreshStatisticsCurrentReport(settleMonth);
} else {
log.error(taxR.getMsg());
}
} else {
log.error(accountR == null ? "刷新对应结算月的 年度报账-失败!" : accountR.getMsg());
}
tStatisticsTaxSalaryTwoService.doRefreshStatisticsTaxAuto(settleMonth);
}
}
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