Commit 5b82279e authored by huyuchen's avatar huyuchen

年终奖测算工具修改

parent ee9450c9
......@@ -1261,6 +1261,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId());
successList.add(detail);
//生成收入数据
createInsuranceInfo(detail);
}else {
//按天
//计算起止时间的天数
......@@ -1293,10 +1295,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId());
successList.add(detail);
}
//生成收入数据
createInsuranceInfo(detail);
}
}
//实缴
if(detail.getSettleType() == CommonConstants.ONE_INT){
if (detail.getBuyType() == CommonConstants.THREE_INT){
......@@ -5732,7 +5734,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
incomeDetail.setDeptNo(insuranceDetail.getDeptNo());
incomeDetail.setSourceType(CommonConstants.THREE_STRING);
R<TIncomeDetailReturnVo> detailList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if(Common.isNotNull(detailList) && detailList.getCode() == CommonConstants.SUCCESS){
if(Common.isNotNull(detailList) && detailList.getCode() == CommonConstants.SUCCESS
&& detailList.getData().getDetailList().size() > 0){
isExist = true;
}
......@@ -5820,7 +5823,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setSourceId(insuranceDetail.getId());
detail.setSourceType(CommonConstants.THREE_STRING);
detail.setCreateMonth(DateUtil.getYearAndMonth(insuranceDetail.getHandledTime(),0));
detail.setPayMonth(insuranceDetail.getSettleMonth());
detail.setPayMonth(insuranceDetail.getSettleMonth().replace("-",""));
detail.setMoney(money);
detail.setFeeType(feeType);
detail.setFeeMode(feeMode);
......
......@@ -533,16 +533,27 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
if (sumI.compareTo(sub.getMinIncome()) == SalaryConstants.MORE_THAN
&& sumI.compareTo(sub.getMaxIncome()) != SalaryConstants.MORE_THAN) {
//sumI = realDeduSalary * ((double) ((i.getTaxRate() * 1.0) / 100)) - sumTax - sub.getQuick();
//累计个税
res = BigDecimalUtils.safeSubtract(sumI.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)), sub.getQuickDeducation());
//本次个税
BigDecimal bcTax = res.subtract(BigDecimalUtils.safeAdd(sumTax,twlSalaryTax));
if (bcTax.compareTo(BigDecimal.ZERO) == SalaryConstants.MORE_THAN ||
bcTax.compareTo(BigDecimal.ZERO) == SalaryConstants.EQUAL) {
res = BigDecimalUtils.safeAdd(bcTax,twlSalaryTax);
} else {
res = BigDecimalUtils.safeAdd(twlSalaryTax,sumTax);
}
res = BigDecimalUtils.safeSubtract(sumI.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)),
BigDecimalUtils.safeAdd(sumTax,sub.getQuickDeducation()));
break;
}
}
} else {
res = twlSalaryTax;
}
BigDecimal a = BigDecimal.ZERO;
a = BigDecimalUtils.safeAdd(res,twlSalaryTax);
log.info("薪资个税:" + a.toString());
log.info("薪资个税:" + res.toString());
//计算年终奖税
//年终奖
if (annous != null && annous.compareTo(SalaryConstants.B_ZERO) == SalaryConstants.MORE_THAN
......@@ -558,11 +569,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
break;
}
}
}
log.info("年终奖应发:" + annous.toString());
log.info("年终奖个税:" + anRes.toString());
}
zySalary.add(BigDecimalUtils.safeAdd(res,anRes,twlSalaryTax));
map.put(BigDecimalUtils.safeAdd(res,anRes,twlSalaryTax).toString(),i);
zySalary.add(BigDecimalUtils.safeAdd(res,anRes));
map.put(BigDecimalUtils.safeAdd(res,anRes).toString(),i);
}
BigDecimal salary = BigDecimal.ZERO;
if (Common.isNotNull(zySalary)) {
......
......@@ -288,4 +288,13 @@ public class TForecastLibraryController {
tForecastLibraryService.createForecastFundInfo();
}
@PostMapping("/createFundInfo")
public void createFundInfo() {
tForecastLibraryService.createForecastFundInfo();
}
@PostMapping("/createSocialInfo")
public void createSocialInfo() {
tForecastLibraryService.createForecastInfo();
}
}
......@@ -341,6 +341,16 @@ public class TPaymentInfoController {
tPaymentInfoService.createPaymentFundInfo();
}
@PostMapping("/createFundInfo")
public void createFundInfo() {
tPaymentInfoService.createPaymentFundInfo();
}
@PostMapping("/createSocialInfo")
public void createSocialInfo() {
tPaymentInfoService.createPaymentSocialInfo();
}
/**
* @Description: 定时生成缴费库的收入数据
* @Author: huyc
......
......@@ -2209,6 +2209,20 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
public List<String> initEkpPushSocialParam(List<TForecastLibrary> unPushInfo) {
List<String> pushList = new ArrayList<>();
for (TForecastLibrary library:unPushInfo) {
//获取项目信息
TSettleDomain settleDomain = new TSettleDomain();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(library.getSettleDomainId());
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo :settleDomainR) {
BeanUtils.copyProperties(vo,settleDomain);
}
}
}
EkpPushSocialParam socialParam = new EkpPushSocialParam();
//员工姓名
socialParam.setFd_3adfe8c79989d4(library.getEmpName());
......@@ -2298,13 +2312,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
//社保缴纳月份
if (Common.isNotNull(library.getSocialPayMonth())) {
socialParam.setFd_3adfe8cf632700(library.getSocialPayMonth());
socialParam.setFd_3adfe8cf632700(dateStringInsert(library.getSocialPayMonth()));
} else {
socialParam.setFd_3adfe8cf632700(CommonConstants.EMPTY_STRING);
}
//社保生成月份
if (Common.isNotNull(library.getSocialCreateMonth())) {
socialParam.setFd_3adfe8cb96c41e(library.getSocialCreateMonth());
socialParam.setFd_3adfe8cb96c41e(dateStringInsert(library.getSocialCreateMonth()));
} else {
socialParam.setFd_3adfe8cb96c41e(CommonConstants.EMPTY_STRING);
}
......@@ -2313,7 +2327,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
//是否有预估
socialParam.setFd_3add9de0be85e4(CommonConstants.IS_TRUE);
//与工资合并结算
socialParam.setFd_3add9e1a670144(CommonConstants.EMPTY_STRING);
socialParam.setFd_3add9e1a670144(CommonConstants.IS_FALSE);
//项目编码
socialParam.setFd_3adfe8c70d3fd4(library.getDeptNo());
//项目名称
......@@ -2321,7 +2335,11 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
if (Common.isNotNull(settleDomain.getCustomerNo())) {
socialParam.setFd_3adfe8c73cb5a4(settleDomain.getCustomerNo());
}else {
socialParam.setFd_3adfe8c73cb5a4(CommonConstants.EMPTY_STRING);
}
//客户名称
socialParam.setFd_3adfe8c81a0e42(library.getUnitName());
//社保户
......@@ -2419,6 +2437,20 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
public List<String> initEkpPushFundParam(List<TForecastLibrary> unPushInfo) {
List<String> pushList = new ArrayList<>();
for (TForecastLibrary library:unPushInfo) {
//获取项目信息
TSettleDomain settleDomain = new TSettleDomain();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(library.getSettleDomainId());
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo :settleDomainR) {
BeanUtils.copyProperties(vo,settleDomain);
}
}
}
EkpPushFundParam fundParam = new EkpPushFundParam();
//员工姓名
fundParam.setFd_3adfe8c79989d4(library.getEmpName());
......@@ -2438,13 +2470,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
//缴纳月份
if (Common.isNotNull(library.getSocialPayMonth())) {
fundParam.setFd_3adfe8cf632700(library.getSocialPayMonth());
fundParam.setFd_3adfe8cf632700(dateStringInsert(library.getSocialPayMonth()));
} else {
fundParam.setFd_3adfe8cf632700(CommonConstants.EMPTY_STRING);
}
//生成月份
if (Common.isNotNull(library.getSocialCreateMonth())) {
fundParam.setFd_3adfe8cb96c41e(library.getSocialCreateMonth());
fundParam.setFd_3adfe8cb96c41e(dateStringInsert(library.getSocialCreateMonth()));
} else {
fundParam.setFd_3adfe8cb96c41e(CommonConstants.EMPTY_STRING);
}
......@@ -2463,7 +2495,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
//是否有预估
fundParam.setFd_3add9de0be85e4(CommonConstants.IS_TRUE);
//与工资合并结算
fundParam.setFd_3add9e1a670144(CommonConstants.EMPTY_STRING);
fundParam.setFd_3add9e1a670144(CommonConstants.IS_FALSE);
//项目编码
fundParam.setFd_3adfe8c70d3fd4(library.getDeptNo());
//项目名称
......@@ -2471,7 +2503,11 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
//单号
fundParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
if (Common.isNotNull(settleDomain.getCustomerNo())) {
fundParam.setFd_3adfe8c73cb5a4(settleDomain.getCustomerNo());
} else {
fundParam.setFd_3adfe8c73cb5a4(CommonConstants.EMPTY_STRING);
}
//单位代缴
fundParam.setFd_3adfeb52fbe966(CommonConstants.EMPTY_STRING);
//个人代缴
......@@ -2543,7 +2579,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
String sourceType = "";
if (Common.isNotNull(library.getProvidentId())) {
sourceType = CommonConstants.TWO_STRING;
} else {
}else if (Common.isNotNull(library.getSocialId())) {
sourceType = CommonConstants.ONE_STRING;
}
......@@ -2565,8 +2601,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
int isSum = 0;
if (Common.isNotNull(settleDomain)) {
// 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && (settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING)
|| settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING))) {
if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING))
&& CommonConstants.ONE_STRING.equals(sourceType))) {
//预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
......@@ -2597,8 +2634,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
}
if (Common.isNotNull(settleDomain.getRiskServerItem()) && (settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING)
|| settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING))) {
if (Common.isNotNull(settleDomain.getRiskServerItem()) && ((settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING))
&& CommonConstants.ONE_STRING.equals(sourceType))) {
//预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType()) &&
CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
......@@ -2651,7 +2689,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (CommonConstants.ONE_STRING.equals(sourceType)) {
detail.setCreateMonth(library.getSocialCreateMonth());
detail.setPayMonth(library.getSocialPayMonth());
} else {
} else if (CommonConstants.TWO_STRING.equals(sourceType)) {
detail.setCreateMonth(library.getProvidentCreateMonth());
detail.setPayMonth(library.getProvidentPayMonth());
}
......@@ -2664,4 +2702,11 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
incomeService.saveDetail(detail);
}
public String dateStringInsert(String month) {
StringBuilder sb = new StringBuilder(month);
sb.insert(4, "-");
String replaceMonth = sb.toString();
return replaceMonth;
}
}
......@@ -64,6 +64,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentHeFeiVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import lombok.extern.log4j.Log4j2;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -2311,6 +2312,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public List<String> initEkpPushSocialParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>();
for (TPaymentInfo library:unPushInfo) {
//获取项目信息
TSettleDomain settleDomain = new TSettleDomain();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(library.getSettleDomainId());
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo :settleDomainR) {
BeanUtils.copyProperties(vo,settleDomain);
}
}
}
EkpPushSocialParam socialParam = new EkpPushSocialParam();
//员工姓名
socialParam.setFd_3adfe8c79989d4(library.getEmpName());
......@@ -2352,22 +2368,27 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
//社保缴纳月份
if (Common.isNotNull(library.getSocialPayMonth())) {
socialParam.setFd_3adfe8cf632700(library.getSocialPayMonth());
socialParam.setFd_3adfe8cf632700(dateStringInsert(library.getSocialPayMonth()));
} else {
socialParam.setFd_3adfe8cf632700(CommonConstants.EMPTY_STRING);
}
//社保生成月份
if (Common.isNotNull(library.getSocialCreateMonth())) {
socialParam.setFd_3adfe8cb96c41e(library.getSocialCreateMonth());
socialParam.setFd_3adfe8cb96c41e(dateStringInsert(library.getSocialCreateMonth()));
} else {
socialParam.setFd_3adfe8cb96c41e(CommonConstants.EMPTY_STRING);
}
//订单类型
socialParam.setFd_3add9dd7833db8(SocialConstants.DIFF_TYPE_THR);
//是否有预估
socialParam.setFd_3add9de0be85e4(CommonConstants.EMPTY_STRING);
if (Common.isNotNull(settleDomain.getMrSettleType()) &&
CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
socialParam.setFd_3add9de0be85e4(CommonConstants.IS_TRUE);
} else {
socialParam.setFd_3add9de0be85e4(CommonConstants.IS_FALSE);
}
//与工资合并结算
socialParam.setFd_3add9e1a670144(CommonConstants.EMPTY_STRING);
socialParam.setFd_3add9e1a670144(CommonConstants.IS_FALSE);
//项目编码
socialParam.setFd_3adfe8c70d3fd4(library.getSettleDomainCode());
//项目名称
......@@ -2375,9 +2396,17 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
if (Common.isNotNull(settleDomain.getCustomerNo())) {
socialParam.setFd_3adfe8c73cb5a4(settleDomain.getCustomerNo());
} else {
socialParam.setFd_3adfe8c73cb5a4(CommonConstants.EMPTY_STRING);
}
//客户名称
if (Common.isNotNull(library.getUnitName())) {
socialParam.setFd_3adfe8c81a0e42(library.getUnitName());
} else {
socialParam.setFd_3adfe8c81a0e42(CommonConstants.EMPTY_STRING);
}
//社保户
if (Common.isNotNull(library.getSocialHousehold())) {
socialParam.setFd_3aeafa25916e82(library.getSocialHousehold());
......@@ -2521,6 +2550,20 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public List<String> initEkpPushFundParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>();
for (TPaymentInfo library:unPushInfo) {
//获取项目信息
TSettleDomain settleDomain = new TSettleDomain();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(library.getSettleDomainId());
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo :settleDomainR) {
BeanUtils.copyProperties(vo,settleDomain);
}
}
}
EkpPushFundParam fundParam = new EkpPushFundParam();
//员工姓名
fundParam.setFd_3adfe8c79989d4(library.getEmpName());
......@@ -2532,13 +2575,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
fundParam.setFd_3adfeb52a4d2e2(CommonConstants.EMPTY_STRING);
//缴纳月份
if (Common.isNotNull(library.getProvidentPayMonth())) {
fundParam.setFd_3adfe8cf632700(library.getProvidentPayMonth());
fundParam.setFd_3adfe8cf632700(dateStringInsert(library.getProvidentPayMonth()));
} else {
fundParam.setFd_3adfe8cf632700(CommonConstants.EMPTY_STRING);
}
//生成月份
if (Common.isNotNull(library.getProvidentCreateMonth())) {
fundParam.setFd_3adfe8cb96c41e(library.getProvidentCreateMonth());
fundParam.setFd_3adfe8cb96c41e(dateStringInsert(library.getProvidentCreateMonth()));
} else {
fundParam.setFd_3adfe8cb96c41e(CommonConstants.EMPTY_STRING);
}
......@@ -2555,9 +2598,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//订单类型
fundParam.setFd_3add9dd7833db8(SocialConstants.DIFF_TYPE_THR);
//是否有预估
fundParam.setFd_3add9de0be85e4(CommonConstants.EMPTY_STRING);
if (Common.isNotNull(settleDomain.getMrSettleType()) &&
CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
fundParam.setFd_3add9de0be85e4(CommonConstants.IS_TRUE);
} else {
fundParam.setFd_3add9de0be85e4(CommonConstants.IS_FALSE);
}
//与工资合并结算
fundParam.setFd_3add9e1a670144(CommonConstants.EMPTY_STRING);
fundParam.setFd_3add9e1a670144(CommonConstants.IS_FALSE);
//项目编码
fundParam.setFd_3adfe8c70d3fd4(library.getSettleDomainCode());
//项目名称
......@@ -2565,7 +2613,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//单号
fundParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
if (Common.isNotNull(settleDomain.getCustomerNo())) {
fundParam.setFd_3adfe8c73cb5a4(settleDomain.getCustomerNo());
} else {
fundParam.setFd_3adfe8c73cb5a4(CommonConstants.EMPTY_STRING);
}
//单位代缴
if (Common.isNotNull(library.getUnitProvidentSum())) {
fundParam.setFd_3adfeb52fbe966(library.getUnitProvidentSum().toString());
......@@ -2771,4 +2823,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
detail.setId(CommonConstants.NULL);
incomeService.saveDetail(detail);
}
public String dateStringInsert(String month) {
StringBuilder sb = new StringBuilder(month);
sb.insert(4, "-");
String replaceMonth = sb.toString();
return replaceMonth;
}
}
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