Commit 35b0fcc9 authored by hongguangwu's avatar hongguangwu

收入推送1

parent ec4ce452
......@@ -23,7 +23,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
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.TStatisticsCurrentReport;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsCurrentReportService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsCurrentReportSearchVo;
......@@ -107,18 +106,4 @@ public class TStatisticsCurrentReportController {
return R.ok(tStatisticsCurrentReportService.removeById(id));
}
/**
* @param
* @Description: 生成本期申报
* @Author: hgw
* @Date: 2022-8-19 17:03:20
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Inner
@Operation(description = "生成本期申报")
@PostMapping("/inner/doStatisticsCurrentReport")
public R<String> doStatisticsCurrentReport() {
return tStatisticsCurrentReportService.doStatisticsCurrentReportAuto();
}
}
......@@ -114,8 +114,9 @@ public class TStatisticsTaxSalaryController {
@Operation(description = "定时任务-年度报账+工资薪金+本期申报")
@PostMapping("/inner/doRefreshStatisticsTaxAuto")
public void doRefreshStatisticsTaxAuto() {
String settleMonth = DateUtil.addMonth(-1);
tStatisticsTaxSalaryTwoService.doRefreshStatisticsTaxAuto(settleMonth);
// 2022-8-31 16:04:22同徐梅、简洁改为申报月,实际数据为上个结算月的数据
String declareMonth = DateUtil.addMonth(0);
tStatisticsTaxSalaryTwoService.doRefreshStatisticsTaxAuto(declareMonth);
}
/**
......@@ -129,6 +130,7 @@ public class TStatisticsTaxSalaryController {
@PostMapping("/doRefreshStatisticsTaxAll")
@PreAuthorize("@pms.hasPermission('salary_tstatisticstaxsalary_refresh')")
public R<String> doRefreshStatisticsTaxAll(@RequestParam String settleMonth) {
// 2022-8-31 16:04:22同徐梅、简洁改为申报月,实际数据为上个结算月的数据
return tStatisticsTaxSalaryService.doRefreshStatisticsTaxAll(settleMonth);
}
......
......@@ -38,8 +38,8 @@ public interface TStatisticsCurrentReportMapper extends BaseMapper<TStatisticsCu
*/
IPage<TStatisticsCurrentReport> getTStatisticsCurrentReportPage(Page<TStatisticsCurrentReport> page, @Param("tStatisticsCurrentReport") TStatisticsCurrentReport tStatisticsCurrentReport);
int insertStatisticsCurrentReport(@Param("nowMonth") String nowMonth
, @Param("lastMonth") String lastMonth, @Param("nowYear") String nowYear);
int insertStatisticsCurrentReport(@Param("declareMonth") String declareMonth
, @Param("lastTwoMonth") String lastTwoMonth, @Param("lastTwoYear") String lastTwoYear);
/**
* @param yearMonth
......
......@@ -38,8 +38,8 @@ public interface TStatisticsTaxSalaryMapper extends BaseMapper<TStatisticsTaxSal
*/
IPage<TStatisticsTaxSalary> getTStatisticsTaxSalaryPage(Page<TStatisticsTaxSalary> page, @Param("tStatisticsTaxSalary") TStatisticsTaxSalary tStatisticsTaxSalary);
int insertStatisticsTaxSalaryByTableName(@Param("tableName") String tableName
, @Param("nowMonth") String nowMonth, @Param("lastYear") String lastYear);
int insertStatisticsTaxSalaryByTableName(@Param("tableName") String tableName, @Param("declareMonth") String declareMonth
, @Param("lastMonth") String lastMonth, @Param("lastYear") String lastYear);
/**
* @param yearMonth
......
......@@ -29,11 +29,11 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount2022;
*/
public interface TSalaryAccount2022Service extends IService<TSalaryAccount2022> {
/**
* @param settleMonth
* @param lastMonth 上月
* @Description: 根据结算月手动刷新
* @Author: hgw
* @Date: 2022/2/23 10:02
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
R<String> doRefreshSalaryAccountByMonth(String tableName, String settleMonth);
R<String> doRefreshSalaryAccountByMonth(String tableName, String lastMonth);
}
......@@ -20,14 +20,11 @@ package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsCurrentReport;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsCurrentReportSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 统计-本期申报
......@@ -51,24 +48,6 @@ public interface TStatisticsCurrentReportService extends IService<TStatisticsCur
**/
void listExport(HttpServletResponse response, TStatisticsCurrentReportSearchVo searchVo);
/**
* @param
* @Description: 生成-本期申报
* @Author: hgw
* @Date: 2020-6-15 18:02:35
* @return: com.yifu.cloud.v1.common.core.util.R
**/
R<String> doStatisticsCurrentReport(int monthNums);
/**
* @param
* @Description: 自动生成
* @Author: hgw
* @Date: 2022/2/21 17:53
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
R<String> doStatisticsCurrentReportAuto();
/**
* @param yearMonth
* @Description: 删除-按申报月份
......@@ -79,11 +58,11 @@ public interface TStatisticsCurrentReportService extends IService<TStatisticsCur
int deleteByYearMonth(String yearMonth);
/**
* @param settleMonth
* @param declareMonth
* @Description: 按结算月刷新本期申报
* @Author: hgw
* @Date: 2022/2/23 15:10
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
R<String> doRefreshStatisticsCurrentReport(String settleMonth);
R<String> doRefreshStatisticsCurrentReport(String declareMonth, String lastTwoMonth);
}
......@@ -43,12 +43,12 @@ public interface TStatisticsTaxSalaryService extends IService<TStatisticsTaxSala
void listExport(HttpServletResponse response, TStatisticsTaxSalarySearchVo searchVo);
/**
* @param settleMonth 结算
* @param declareMonth 申报
* @Description: 手动刷新-年度报账+工资薪金+本期申报
* @Author: hgw
* @Date: 2022/2/22 16:22
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
R<String> doRefreshStatisticsTaxAll(String settleMonth);
R<String> doRefreshStatisticsTaxAll(String declareMonth);
}
......@@ -14,21 +14,22 @@ public interface TStatisticsTaxSalaryTwoService extends IService<TStatisticsTaxS
/**
* @param tableName
* @param settleMonth
* @param declareMonth
* @Description: 生成工资薪金
* @Author: hgw
* @Date: 2022/2/25 10:30
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
R<String> doStatisticsTaxSalary(String tableName, String settleMonth);
R<String> doStatisticsTaxSalary(String tableName, String declareMonth, String lastMonth);
/**
* @param settleMonth
* @param declareMonth 申报月
* 2022-8-31 16:04:22同徐梅、简洁改为申报月,实际数据为上个结算月的数据
* @Description:
* @Author: hgw
* @Date: 2022/8/23 17:55
* @return: void
**/
void doRefreshStatisticsTaxAuto(String settleMonth);
void doRefreshStatisticsTaxAuto(String declareMonth);
}
......@@ -43,14 +43,14 @@ public class TSalaryAccount2022ServiceImpl extends ServiceImpl<TSalaryAccount202
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Override
public R<String> doRefreshSalaryAccountByMonth(String tableName, String settleMonth) {
public R<String> doRefreshSalaryAccountByMonth(String tableName, String lastMonth) {
if (Common.isEmpty(tableName)) {
tableName = "t_salary_account_" + settleMonth.substring(0, 4);
tableName = "t_salary_account_" + lastMonth.substring(0, 4);
}
baseMapper.createAccountYear(tableName);
int firstDelete = baseMapper.deleteSalaryAccountYearByMonth(tableName, settleMonth);
int firstDelete = baseMapper.deleteSalaryAccountYearByMonth(tableName, lastMonth);
if (firstDelete != -1) {
int firstCreate = baseMapper.insertIntoSalaryAccountYear(tableName, settleMonth);
int firstCreate = baseMapper.insertIntoSalaryAccountYear(tableName, lastMonth);
if (firstCreate != -1) {
return R.ok("已生成【年度报账】!");
} else {
......
......@@ -16,13 +16,8 @@
*/
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -30,19 +25,20 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsCurrentReport;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsCurrentReportMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsCurrentReportService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsCurrentReportSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsCurrentReportVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
......@@ -157,68 +153,25 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
return wrapper;
}
@Override
public R<String> doStatisticsCurrentReportAuto() {
String firstMonth = DateUtil.addMonth(0); //本月
int firstDelete = baseMapper.deleteByYearMonth(firstMonth);
String secondMonth = DateUtil.addMonth(-1); //上月
int secondDelete = baseMapper.deleteByYearMonth(secondMonth);
if (firstDelete != -2 && secondDelete != -2) {
this.doStatisticsCurrentReport(0);
this.doStatisticsCurrentReport(-1);
return R.ok("已生成!");
} else {
return R.failed("删除失败!");
}
}
@Override
public R<String> doStatisticsCurrentReport(int monthNums) {
String nowMonth = DateUtil.addMonth(monthNums); //本月
String nowYear = nowMonth.substring(0, 4); //年份
//关联减少的——回盘数据月份
String lastMonth = DateUtil.addMonth(monthNums - 1); //上上月(例:当前202007:工资薪金为1~6月数据,回盘数据应为5月)
baseMapper.insertStatisticsCurrentReport(nowMonth, lastMonth, nowYear);
return R.ok("已生成!");
}
@Override
public int deleteByYearMonth(String yearMonth) {
return baseMapper.deleteByYearMonth(yearMonth);
}
@Override
public R<String> doRefreshStatisticsCurrentReport(String settleMonth) {
int firstDelete = baseMapper.deleteByYearMonth(settleMonth);
public R<String> doRefreshStatisticsCurrentReport(String declareMonth, String lastTwoMonth) {
int firstDelete = baseMapper.deleteByYearMonth(declareMonth);
if (firstDelete != -2) {
baseMapper.insertStatisticsCurrentReport(settleMonth, this.getMonthCur(settleMonth), settleMonth.substring(0, 4));
String mons = declareMonth.substring(4, 6);
String lastTwoYear = lastTwoMonth.substring(0, 4);
if ("02".equals(mons)) {
lastTwoYear = "-";
}
baseMapper.insertStatisticsCurrentReport(declareMonth, lastTwoMonth, lastTwoYear);
return R.ok("已生成完毕!");
} else {
return R.failed("删除本期申报失败!");
}
}
/**
* @param settleMonth
* @Description: 根据年月,获取上个月
* @Author: hgw
* @Date: 2022/3/4 17:05
* @return: java.lang.String
**/
private String getMonthCur(String settleMonth) {
String years = settleMonth.substring(0, 4);
String mons = settleMonth.substring(4, 6);
int lastMons = Integer.parseInt(mons) - 1;
String lastYearMonth;
if (lastMons == 0) {
lastYearMonth = (Integer.parseInt(years) - 1) + "12";
} else if (lastMons < 10) {
lastYearMonth = years + "0" + lastMons;
} else {
lastYearMonth = years + lastMons;
}
return lastYearMonth;
}
}
......@@ -173,14 +173,14 @@ public class TStatisticsTaxSalaryServiceImpl extends ServiceImpl<TStatisticsTaxS
}
/**
* @param settleMonth 结算
* @param declareMonth 申报
* @Description: 手动刷新-年度报账+工资薪金+本期申报
* @Author: hgw
* @Date: 2022/8/19 17:18
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> doRefreshStatisticsTaxAll(String settleMonth) {
public R<String> doRefreshStatisticsTaxAll(String declareMonth) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
......@@ -203,13 +203,13 @@ public class TStatisticsTaxSalaryServiceImpl extends ServiceImpl<TStatisticsTaxS
rules.setCanRefreshNums(10);
rules.setCreateTime(LocalDateTime.now());
rules.setCreateBy(String.valueOf(user.getId()));
rules.setSettleMonth(settleMonth);
rules.setSettleMonth(declareMonth);
rules.setYearMonthDay(yearMonthDay);
tStatisticsTaxSalaryRuleService.save(rules);
}
// 异步执行
doStatisticsTask.doRefreshCore(settleMonth);
doStatisticsTask.doRefreshCore(declareMonth);
return R.ok("正在生成中,请稍后查看!");
}
......
......@@ -2,6 +2,8 @@ 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.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
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;
......@@ -29,39 +31,48 @@ public class TStatisticsTaxSalaryTwoServiceImpl extends ServiceImpl<TStatisticsT
private final TStatisticsCurrentReportService tStatisticsCurrentReportService;
/**
* @param tableName
* @param settleMonth
* @param declareMonth 申报月
* @param lastMonth 上个月的结算数据
* @Description: 刷新工资薪金
* @Author: hgw
* @Date: 2022/2/23 15:12
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Override
public R<String> doStatisticsTaxSalary(String tableName, String settleMonth) {
int deletes = baseMapper.deleteByYearMonth(settleMonth);
public R<String> doStatisticsTaxSalary(String tableName, String declareMonth, String lastMonth) {
int deletes = baseMapper.deleteByYearMonth(declareMonth);
if (deletes != -1) {
String settleYear = settleMonth.substring(0, 4);
baseMapper.insertStatisticsTaxSalaryByTableName(tableName, settleMonth, settleYear);
String settleYear = lastMonth.substring(0, 4);
baseMapper.insertStatisticsTaxSalaryByTableName(tableName, declareMonth, lastMonth, settleYear);
return R.ok("刷新工资薪金成功!");
}
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);
public void doRefreshStatisticsTaxAuto(String declareMonth) {
// 2022-8-31 16:26 本期申报变更:徐梅、简洁确认修改最终:
// 年度报账表,拉取上月数据(结算月为上月)
// 工资薪金表,申报月为当月,结算月为上月,上月的年数据
// 本期申报: 申报月为当月,减去上上月的回盘,拉取当月的申报对象
String lastMonth = DateUtil.addMonthByString(declareMonth, -1);
String lastTwoMonth = DateUtil.addMonthByString(declareMonth, -2);
if (Common.isNotNull(lastMonth)) {
String tableName = "t_salary_account_" + lastMonth.substring(0, 4);
// 刷新对应结算月的 年度报账
R<String> accountR = tSalaryAccount2020Service.doRefreshSalaryAccountByMonth(tableName, lastMonth);
if (accountR != null && accountR.getCode() == CommonConstants.SUCCESS) {
// 刷新对应结算月的 工资薪金
R<String> taxR = this.doStatisticsTaxSalary(tableName, declareMonth, lastMonth);
if (taxR.getCode() == CommonConstants.SUCCESS) {
// 刷新对应结算月的 本期申报
tStatisticsCurrentReportService.doRefreshStatisticsCurrentReport(declareMonth, lastTwoMonth);
} else {
log.error(taxR.getMsg());
}
} else {
log.error(taxR.getMsg());
log.error(accountR == null ? "刷新对应结算月的 年度报账-失败!" : accountR.getMsg());
}
} else {
log.error(accountR == null ? "刷新对应结算月的 年度报账-失败!" : accountR.getMsg());
}
}
......
......@@ -21,15 +21,15 @@ public class DoStatisticsTask {
private TStatisticsTaxSalaryTwoService tStatisticsTaxSalaryTwoService;
/**
* @param settleMonth
* @param declareMonth 申报月(实际数据为上个结算月)
* @Description: 核心刷新-年度报账、工资薪金、本期申报
* @Author: hgw
* @Date: 2022-2-25 10:29:28
* @return: void
**/
@Async
public void doRefreshCore(String settleMonth) {
tStatisticsTaxSalaryTwoService.doRefreshStatisticsTaxAuto(settleMonth);
public void doRefreshCore(String declareMonth) {
tStatisticsTaxSalaryTwoService.doRefreshStatisticsTaxAuto(declareMonth);
}
}
......@@ -208,7 +208,7 @@
<insert id="insertStatisticsCurrentReport">
insert into t_statistics_current_report (
select
concat(s.id,#{nowMonth}) id,
concat(s.id,#{declareMonth}) id,
s.INVOICE_TITLE,
s.SETTLE_DEPART_ID,
s.SETTLE_DEPART_NO,
......@@ -251,15 +251,16 @@
sum(ifnull(m.PERSONAL_UNEMPLOYMENT_MONEY,0)) PERSONAL_UNEMPLOYMENT_MONEY,
sum(ifnull(m.PERSONAL_PROVIDENT_FEE,0)) PERSONAL_PROVIDENT_FEE,
sum(ifnull(m.enterprise_annuity,0)) enterprise_annuity,
sum(if(m.declare_MONTH = #{lastMonth},all_income,0)) all_income,
sum(if(m.declare_MONTH = #{lastMonth},all_tax_prepaid,0)) all_tax_prepaid,
sum(if(m.declare_MONTH = #{lastMonth},all_tax_payable,0)) all_tax_payable
sum(if(m.declare_MONTH = #{lastTwoMonth},all_income,0)) all_income,
sum(if(m.declare_MONTH = #{lastTwoMonth},all_tax_prepaid,0)) all_tax_prepaid,
sum(if(m.declare_MONTH = #{lastTwoMonth},all_tax_payable,0)) all_tax_payable
from t_statistics_current_report_market m
where m.declare_MONTH <![CDATA[<=]]> #{lastMonth} and m.declare_MONTH like '${nowYear}%'
where m.declare_MONTH <![CDATA[<=]]> #{lastTwoMonth} and m.declare_MONTH like '${lastTwoYear}%'
GROUP BY m.EMP_IDCARD,m.INVOICE_TITLE
) m on m.EMP_IDCARD=s.EMP_IDCARD and m.INVOICE_TITLE = s.INVOICE_TITLE
left join t_statistics_declarer d on d.EMP_IDCARD=s.EMP_IDCARD and d.DECLARE_MONTH=#{lastMonth}
where s.DECLARE_MONTH = #{nowMonth} and (d.id is null or d.IS_DECLARE = '0')
left join t_statistics_declarer d on d.EMP_IDCARD=s.EMP_IDCARD and d.DECLARE_UNIT=s.INVOICE_TITLE
and d.OCCUPATION_TYPE='0' and d.DECLARE_MONTH=#{declareMonth}
where s.DECLARE_MONTH = #{declareMonth} and (d.id is null or d.IS_DECLARE = '0')
)
</insert>
......
......@@ -219,8 +219,8 @@
a.EMP_PHONE
from (
SELECT
concat(a.id,#{nowMonth}) id,
#{nowMonth} DECLARE_MONTH,
concat(a.id,#{declareMonth}) id,
#{declareMonth} DECLARE_MONTH,
a.INVOICE_TITLE,
a.EMP_ID,
a.EMP_NAME,
......@@ -258,7 +258,7 @@
a.CREATE_MONTH,
a.EMP_PHONE
FROM ${tableName} a
where a.SETTLEMENT_MONTH <![CDATA[ <= ]]> #{nowMonth} and a.SETTLEMENT_MONTH like concat(#{lastYear},'%')
where a.SETTLEMENT_MONTH <![CDATA[ <= ]]> #{lastMonth} and a.SETTLEMENT_MONTH like concat(#{lastYear},'%')
GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE ORDER BY a.settle_depart_id asc
) a
left join t_salary_tax_config c on c.MIN_INCOME <![CDATA[ < ]]> a.taxable and c.MAX_INCOME >= a.taxable and c.TYPE=0
......
......@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
import io.swagger.v3.oas.annotations.Operation;
......@@ -160,4 +161,18 @@ public class TIncomeController {
public void export(HttpServletResponse response, @RequestBody TIncomeSearchVo searchVo) {
tIncomeService.listExport(response, searchVo);
}
/**
* @Description: 新增收入明细-详情表,同时统计;
* @Author: hgw
* @Date: 2022/8/31 16:34
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Operation(summary = "新增收入明细-详细表,同时统计", description = "新增收入明细表")
@SysLog("新增收入明细-详细表,同时统计")
@PostMapping("/saveDetail")
public R<Boolean> saveDetail(@RequestBody TIncomeDetail tIncomeDetail) {
return R.ok(tIncomeService.saveDetail(tIncomeDetail));
}
}
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
import javax.servlet.http.HttpServletResponse;
......@@ -49,4 +50,13 @@ public interface TIncomeService extends IService<TIncome> {
void listExport(HttpServletResponse response, TIncomeSearchVo searchVo);
List<TIncome> noPageDiy(TIncomeSearchVo searchVo);
/**
* @Description: 新增收入明细-详情表,同时统计;
* @Author: hgw
* @Date: 2022/8/31 16:31
* @return: boolean
**/
boolean saveDetail(TIncomeDetail tIncomeDetail);
}
......@@ -32,12 +32,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -57,6 +61,10 @@ import java.util.List;
@Log4j2
@Service
public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> implements TIncomeService {
@Autowired
private TIncomeDetailService tIncomeDetailService;
/**
* 收入明细表简单分页查询
*
......@@ -244,4 +252,18 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
/**
* @Description: 新增收入明细-详情表,同时统计;
* @Author: hgw
* @Date: 2022/8/31 16:34
* @return: boolean
**/
@Override
public boolean saveDetail(TIncomeDetail tIncomeDetail) {
tIncomeDetailService.save(tIncomeDetail);
// TODO-获取对应信息的统计表,根据项目配置,判断是否可以加一条统计:
return true;
}
}
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