Commit f50328f2 authored by huyuchen's avatar huyuchen

生成收入接口修改

parent 474bc11c
......@@ -5875,6 +5875,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setCharges(charges);
detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ZERO_STRING);
socialDaprUtils.createTIncomeDetail(detail);
}
......@@ -5887,14 +5888,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for (TIncomeDetail detail : detailList.getData().getDetailList()) {
TIncomeDetail detail1 = new TIncomeDetail();
BeanCopyUtils.copyProperties(detail, detail1);
socialDaprUtils.deleteById(detail);
//已推送的数据生成红冲数据
if (settle.getIsEstimatePush() == CommonConstants.ONE_INT ||
settle.getIsActualPush() == CommonConstants.ONE_INT) {
detail1.setId(CommonConstants.NULL);
detail1.setRedData(CommonConstants.ONE_STRING);
detail1.setMoney(detail1.getMoney().negate());
socialDaprUtils.createTIncomeDetail(detail1);
}
}
}
}
}
......@@ -37,6 +37,7 @@ import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpFundUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSocialUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
......@@ -1553,11 +1554,21 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
baseMapper.deleteById(library.getId());
}
//删除停缴月以后的收入数据
detailService.remove(Wrappers.<TIncomeDetail>query().lambda().eq(TIncomeDetail::getEmpIdcard,library.getEmpIdcard())
List<TIncomeDetail> updateList = detailService.list(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard,library.getEmpIdcard())
.eq(TIncomeDetail::getDeptId,library.getSettleDomainId())
.eq(TIncomeDetail::getSourceType,CommonConstants.ONE_STRING)
.eq(TIncomeDetail::getPayMonth,library.getSocialPayMonth()));
if (Common.isNotNull(updateList)) {
for (TIncomeDetail upd : updateList) {
TIncomeDetail detail = new TIncomeDetail();
BeanCopyUtils.copyProperties(upd, detail);
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ONE_STRING);
detail.setMoney(detail.getMoney().negate());
incomeService.saveDetail(detail);
}
}
}
private void calculateFundType(BigDecimal zero, TForecastLibrary library) {
......@@ -1581,10 +1592,21 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
//删除停缴月以后的收入数据
detailService.remove(Wrappers.<TIncomeDetail>query().lambda().eq(TIncomeDetail::getEmpIdcard,library.getEmpIdcard())
List<TIncomeDetail> updateList = detailService.list(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard,library.getEmpIdcard())
.eq(TIncomeDetail::getDeptId,library.getSettleDomainId())
.eq(TIncomeDetail::getSourceType,CommonConstants.TWO_STRING)
.eq(TIncomeDetail::getPayMonth,library.getSocialPayMonth()));
if (Common.isNotNull(updateList)) {
for (TIncomeDetail upd : updateList) {
TIncomeDetail detail = new TIncomeDetail();
BeanCopyUtils.copyProperties(upd, detail);
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ONE_STRING);
detail.setMoney(detail.getMoney().negate());
incomeService.saveDetail(detail);
}
}
}
/**
......@@ -1790,7 +1812,23 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
isSaveAndUpdate = true;
}
}
}
if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
//获取所有的预估数据
List<TForecastLibrary> librarySocialInfoList = null;
librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getSettleDomainId,socialFundInfo.getSettleDomain())
.in(TForecastLibrary::getSocialPayMonth, payMonthList));
if (Common.isNotNull(librarySocialInfoList)) {
for (TForecastLibrary library :librarySocialInfoList) {
//办理成功生成收入
createIncomeInfo(library);
}
......@@ -2114,11 +2152,27 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
library.setCreateName("定时生成");
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
}
isSaveAndUpdate = true;
}
if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
//获取所有的预估数据
List<TForecastLibrary> librarySocialInfoList = null;
librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getSettleDomainId,socialFundInfo.getSettleDomain())
.in(TForecastLibrary::getSocialPayMonth, payMonthList));
if (Common.isNotNull(librarySocialInfoList)) {
for (TForecastLibrary library :librarySocialInfoList) {
//办理成功生成收入
createIncomeInfo(library);
}
isSaveAndUpdate = true;
}
}
if (isSaveAndUpdate) {
return R.ok(null, "执行成功!");
......@@ -2475,14 +2529,14 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
fundParam.setFd_3adfeb52a4d2e2(CommonConstants.EMPTY_STRING);
}
//缴纳月份
if (Common.isNotNull(library.getSocialPayMonth())) {
fundParam.setFd_3adfe8cf632700(dateStringInsert(library.getSocialPayMonth()));
if (Common.isNotNull(library.getProvidentPayMonth())) {
fundParam.setFd_3adfe8cf632700(dateStringInsert(library.getProvidentPayMonth()));
} else {
fundParam.setFd_3adfe8cf632700(CommonConstants.EMPTY_STRING);
}
//生成月份
if (Common.isNotNull(library.getSocialCreateMonth())) {
fundParam.setFd_3adfe8cb96c41e(dateStringInsert(library.getSocialCreateMonth()));
if (Common.isNotNull(library.getProvidentCreateMonth())) {
fundParam.setFd_3adfe8cb96c41e(dateStringInsert(library.getProvidentCreateMonth()));
} else {
fundParam.setFd_3adfe8cb96c41e(CommonConstants.EMPTY_STRING);
}
......@@ -2600,16 +2654,22 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
incomeDetail.setSourceType(sourceType);
List<TIncomeDetail> detailList = detailService.getTIncomeDetailList(incomeDetail);
if (Common.isNotNull(detailList)) {
BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : detailList) {
sumMoney = BigDecimalUtils.safeAdd(income.getMoney(),sumMoney);
}
if (sumMoney.compareTo(BigDecimal.ZERO) == CommonConstants.ONE_INT) {
isExist = true;
}
}
//判断是否为按人次收费
int isSum = 0;
if (Common.isNotNull(settleDomain)) {
// 含有社保,则计算收入
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))) {
&& CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(sourceType)))) {
//预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
......@@ -2641,8 +2701,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
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))) {
&& CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(sourceType)))) {
//预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType()) &&
CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
......@@ -2704,6 +2764,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
detail.setFeeMode(feeMode);
detail.setCharges(charges);
detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setRedData(CommonConstants.ZERO_STRING);
detail.setId(CommonConstants.NULL);
incomeService.saveDetail(detail);
}
......
......@@ -28,12 +28,9 @@ 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.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
......@@ -48,8 +45,6 @@ import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpFundUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSocialUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
......@@ -64,7 +59,6 @@ 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;
......@@ -2693,25 +2687,29 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
Boolean exitFlag = false;
TIncomeDetail exitIncome = new TIncomeDetail();
List<TIncomeDetail> exitIncome = new ArrayList<>();
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
exitIncome = detailMapper.selectOne(Wrappers.<TIncomeDetail>query().lambda()
exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
.eq(TIncomeDetail::getPayMonth, paymentInfo.getSocialPayMonth())
.eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.ONE_STRING)
.last(CommonConstants.LAST_ONE_SQL));
.eq(TIncomeDetail::getSourceType, CommonConstants.ONE_STRING));
} else {
exitIncome = detailMapper.selectOne(Wrappers.<TIncomeDetail>query().lambda()
exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
.eq(TIncomeDetail::getPayMonth, paymentInfo.getSocialPayMonth())
.eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
.eq(TIncomeDetail::getSourceType, CommonConstants.TWO_STRING));
}
if (Common.isNotNull(exitIncome)) {
BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : exitIncome) {
sumMoney = BigDecimalUtils.safeAdd(income.getMoney(),sumMoney);
}
if (sumMoney.compareTo(BigDecimal.ZERO) == CommonConstants.ONE_INT) {
exitFlag = true;
}
}
//判断是否为按人次收费
int isSum = 0;
......@@ -2821,6 +2819,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
detail.setCharges(charges);
detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ZERO_STRING);
incomeService.saveDetail(detail);
}
......
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