Commit b20b4ed3 authored by huyuchen's avatar huyuchen

申报修改

parent ca438a8b
......@@ -972,27 +972,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
return backList;
}
/**
* @param itemList
* @param settleMonth
* @Description: 循环获取符合条件的报账
* @Author: hgw
* @Date: 2022/1/27 17:32
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.TSalaryAccountItem>
**/
private List<TSalaryAccountItem> getRemuAsList(List<TSalaryAccountItem> itemList, String settleMonth) {
List<TSalaryAccountItem> backList = new ArrayList<>();
if (itemList != null && !itemList.isEmpty()) {
for (TSalaryAccountItem item : itemList) {
if (("4".equals(item.getFormType()))
&& settleMonth.equals(item.getSettlementMonth())) {
backList.add(item);
}
}
}
return backList;
}
/**
* @param realSalary 应发工资
* @param saiList 报账详情表list
......@@ -1841,7 +1820,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List<TSalaryAccount> aList = new ArrayList<>();
TSalaryAccount a;//定库:
BigDecimal relaySalarySum = BigDecimal.ZERO; //工资应发
List<TSalaryAccountItem> asList; //累计扣税
int size = savList.size();
// 自有员工人数
int ownNum = 0;
......@@ -1891,14 +1869,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
}
//累计扣税list
asList = this.getRemuAsList(itemMap.get(a.getEmpIdcard()), a.getSettlementMonth());
// 实发稿酬,按月累计扣税
this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculationRemu(saiList, asList
, saiList, a), CommonConstants.ZERO_INT);
calculationRemu(saiList, saiList, a), CommonConstants.ZERO_INT);
// 自有员工以及自有员工应发金额
if (Common.isNotNull(a.getOwnFlag()) && a.getOwnFlag() == 1) {
......@@ -1957,15 +1931,14 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
/**
* @param itemList
* @param itemHistoryList
* @param saiList
* @Description: 计算劳务费个税、应发
* @Author: hgw
* @Date: 2022/3/3 11:30
* @return: java.math.BigDecimal
**/
private static BigDecimal calculationRemu(List<TSalaryAccountItem> itemList, List<TSalaryAccountItem> itemHistoryList,
List<TSalaryAccountItem> saiList, TSalaryAccount a) {
private static BigDecimal calculationRemu(List<TSalaryAccountItem> itemList, List<TSalaryAccountItem> saiList,
TSalaryAccount a) {
// 本次实发
BigDecimal actualSalarySumNow = BigDecimal.ZERO;
// 历史个税合计
......@@ -1981,7 +1954,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimal relaySalary;
nowTaxT = getNowTaxRemu(actualSalarySumNow);
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
relaySalary = BigDecimalUtils.safeSubtract(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
a.setSalaryTax(nowTaxT);
a.setActualSalary(relaySalary);
a.setRelaySalaryUnit(actualSalarySumNow);
......
......@@ -29,20 +29,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
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.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsDeclarerMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsDeclarerService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsDeclarerSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsDeclarerVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -60,12 +54,8 @@ import java.util.List;
*/
@Log4j2
@Service
@EnableConfigurationProperties(DaprArchivesProperties.class)
public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDeclarerMapper, TStatisticsDeclarer> implements TStatisticsDeclarerService {
@Autowired
private DaprArchivesProperties archivesProperties;
/**
* 申报对象表简单分页查询
* @param tStatisticsDeclarer 申报对象表
......@@ -186,18 +176,6 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
String lastYear = lastMonth.substring(0,4);
List<TStatisticsDeclarer> stdvoList = baseMapper.doStatisticsTaxDeclarer(nowMonth,lastYear);
for (TStatisticsDeclarer declarer : stdvoList) {
if (Common.isNotNull(declarer.getDeclareUnit())) {
R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
, "/tsettledomain/inner/getSettleDomainVoById", declarer.getDeclareUnit(), TSettleDomainSelectVo.class, SecurityConstants.FROM_IN);
// 结算主体
TSettleDomainSelectVo dept = null;
if (sdr != null && sdr.getData() != null) {
dept = sdr.getData();
}
if (Common.isNotNull(dept)) {
declarer.setDeclareUnit(dept.getBusinessSubjectName());
}
}
this.save(declarer);
}
return R.ok();
......
......@@ -106,7 +106,7 @@
<!--统计-->
<select id="doStatisticsBonus" resultMap="tStatisticsBonusMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,b.UNIT_NAME DECLARE_UNIT,
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,a.INVOICE_TITLE DECLARE_UNIT,
sum(annualbonus.SALARY_MONEY) ANNUAL_BONUS,sum(tax.SALARY_MONEY) BONUS_TAX
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
......
......@@ -96,7 +96,7 @@
<!--统计-->
<select id="doStatisticsTaxDeclarer" resultMap="tStatisticsDeclarerMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,a.EMP_PHONE,b.UNIT_ID DECLARE_UNIT,
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,a.EMP_PHONE,a.INVOICE_TITLE DECLARE_UNIT,
if(a.FORM_TYPE=0,'雇员',if(a.FORM_TYPE=3 or a.FORM_TYPE=4,'其他','-')) OCCUPATION_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
......
......@@ -92,7 +92,7 @@
<select id="doStatisticsLabor" resultMap="tStatisticsLaborMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX) PERSONAL_TAX,sum(a.ACTUAL_SALARY) INCOME,
b.UNIT_NAME DECLARE_UNIT,'一般劳务报酬所得' INCOME_ITEM,'居民身份证' CARD_TYPE
a.INVOICE_TITLE DECLARE_UNIT,'一般劳务报酬所得' INCOME_ITEM,'居民身份证' CARD_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = '1' and a.SETTLEMENT_MONTH like '${lastYear}%' and a.FORM_TYPE = '3'
......
......@@ -88,7 +88,7 @@
<select id="doStatisticsRemuneration" resultMap="tStatisticsRemunerationMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX) PERSONAL_TAX,
sum(a.ACTUAL_SALARY) INCOME,b.UNIT_NAME DECLARE_UNIT,'居民身份证' CARD_TYPE
sum(a.ACTUAL_SALARY) INCOME,a.INVOICE_TITLE DECLARE_UNIT,'居民身份证' CARD_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = '1' and a.SETTLEMENT_MONTH like '${lastYear}%' and a.FORM_TYPE = '4'
......
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