Commit 3d747b5d authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents 758cd098 5442fbe9
......@@ -1295,10 +1295,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId());
successList.add(detail);
if (detail.getBuyType() != CommonConstants.FOUR_INT) {
//生成收入数据
createInsuranceInfo(detail);
}
}else {
//按天
//计算起止时间的天数
......@@ -1331,12 +1329,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId());
successList.add(detail);
if (detail.getBuyType() != CommonConstants.FOUR_INT) {
//生成收入数据
createInsuranceInfo(detail);
}
}
}
//实缴
if(detail.getSettleType() == CommonConstants.ONE_INT){
if (detail.getBuyType() == CommonConstants.THREE_INT){
......@@ -6119,11 +6115,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : incomeDetailList) {
sumMoney = BigDecimalUtils.safeAdd(income.getMoney(), sumMoney);
}
if (sumMoney.compareTo(BigDecimal.ZERO) > 0) {
isExist = true;
}
}
}
//预估或者实缴保费
BigDecimal fee;
......
......@@ -185,7 +185,7 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc
List<THaveSalaryNoSocialExportVo> list = new ArrayList<>();
// TODO
List<String> settleDomainIds =null;
List<String> ids = null;
List<String> ids = Common.getList(searchVo.getIds());
String sql = null;
int count = noPageCountDiy(searchVo,settleDomainIds,ids,sql);
ServletOutputStream out = null;
......
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
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.BigDecimalUtils;
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;
......@@ -95,6 +96,10 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
if (Common.isNotNull(list)) {
ExcelUtil<TSalaryAccount> util = new ExcelUtil<>(TSalaryAccount.class);
for (TSalaryAccount vo : list) {
if (CommonConstants.THREE_STRING.equals(vo.getFormType())){
vo.setRelaySalary(vo.getRelaySalaryUnit());
vo.setSalaryTax(BigDecimalUtils.safeAdd(vo.getSalaryTax(),vo.getSalaryTaxUnit()));
}
util.convertEntity(vo, null, null, null);
}
}
......
......@@ -317,6 +317,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
, fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund, false);
if (coreR != null) return coreR;
boolean isSaveAndUpdate = false;
TSocialFundInfo socialFundInfo;
TSocialFundInfo socialFundInfoF;
List<TForecastLibrary> libraryFundInfoListSocial = new ArrayList<>();
List<TForecastLibrary> libraryFundInfoListFund = new ArrayList<>();
for (TForecastLibrary library : saveLibraryMap.values()) {
if (Common.isEmpty(library.getSocialId()) && Common.isEmpty(library.getProvidentId())) {
continue;
......@@ -333,30 +340,40 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
//生成社保收入
TSocialFundInfo socialFundInfo = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
socialFundInfo = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getEmpIdcard, empIdCard)
.eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId())
.eq(TSocialFundInfo::getSocialHousehold, library.getSocialHousehold()));
if (Common.isNotNull(socialFundInfo)) {
if (Common.isNotNull(socialFundInfo.getSocialId())
if (Common.isNotNull(socialFundInfo) && Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
//办理成功生成收入
createIncomeInfo(library);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListSocial.add(library);
}
}
//生成公积金收入
TSocialFundInfo socialFundInfoF = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
socialFundInfoF = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getEmpIdcard, empIdCard)
.eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId())
.eq(TSocialFundInfo::getProvidentHousehold, library.getProvidentHousehold()));
if (Common.isNotNull(socialFundInfoF)) {
if (Common.isNotNull(socialFundInfoF.getFundId())
if (Common.isNotNull(socialFundInfoF) && Common.isNotNull(socialFundInfoF.getFundId())
&& CommonConstants.THREE_STRING.equals(socialFundInfoF.getFundStatus())) {
//办理成功生成收入
createIncomeInfo(library);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListFund.add(library);
}
}
}
//推送社保明细
if (Common.isNotNull(libraryFundInfoListSocial)) {
pushForecastInfo(libraryFundInfoListSocial);
}
//推送公积金明细
if (Common.isNotNull(libraryFundInfoListFund)) {
pushForecastFundInfo(libraryFundInfoListFund);
}
if (isSaveAndUpdate) {
return R.ok(null, "执行成功!");
......@@ -1498,6 +1515,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
@Override
public R<String> updateForecastLibaryByDispatchReduce(TSocialFundInfo socialFundInfo, int forecastFlag) {
String empIdCard = socialFundInfo.getEmpIdcard();
List<TForecastLibrary> libraryFundInfoListSocial = new ArrayList<>();
List<TForecastLibrary> libraryFundInfoListFund = new ArrayList<>();
if (Common.isNotNull(empIdCard)) {
Date minStartDate = this.getMinSocialDate(socialFundInfo);
BigDecimal zero = BigDecimal.ZERO;
......@@ -1514,11 +1533,11 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (socialReduceDate != null) {
// 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据
if (DateUtil.formatDateInt(socialReduceDate) <= Integer.parseInt(library.getSocialPayMonth())) {
this.calculateSocialType(zero, library);
this.calculateSocialType(zero, library, libraryFundInfoListSocial);
}
} else {
if (DateUtil.formatDateInt(minStartDate) <= Integer.parseInt(library.getSocialPayMonth())) {
this.calculateSocialType(zero, library);
this.calculateSocialType(zero, library, libraryFundInfoListSocial);
}
}
}
......@@ -1539,22 +1558,30 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (fundReduceDate != null) {
// 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据
if (DateUtil.formatDateInt(fundReduceDate) <= Integer.parseInt(library.getProvidentPayMonth())) {
this.calculateFundType(zero, library);
this.calculateFundType(zero, library,libraryFundInfoListFund);
}
} else {
if (DateUtil.formatDateInt(minStartDate) <= Integer.parseInt(library.getProvidentPayMonth())) {
this.calculateFundType(zero, library);
this.calculateFundType(zero, library,libraryFundInfoListFund);
}
}
}
}
}
}
//推送社保明细
if (Common.isNotNull(libraryFundInfoListSocial)) {
pushForecastInfo(libraryFundInfoListSocial);
}
//推送公积金明细
if (Common.isNotNull(libraryFundInfoListFund)) {
pushForecastFundInfo(libraryFundInfoListFund);
}
}
return R.ok();
}
private void calculateSocialType(BigDecimal zero, TForecastLibrary library) {
private void calculateSocialType(BigDecimal zero, TForecastLibrary library,List<TForecastLibrary> libraryFundInfoListSocial) {
if (library.getDataPush() == CommonConstants.ONE_INT || CommonConstants.ONE_STRING.equals(library.getSalarySocialFlag())) {
// 加负数
TForecastLibrary negateLib = new TForecastLibrary();
......@@ -1580,6 +1607,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
negateLib.setSumAll(BigDecimalUtils.safeSubtract(false, zero, library.getSumAll()));
negateLib.setDiffType(SocialConstants.DIFF_TYPE_TWO);
baseMapper.insert(negateLib);
libraryFundInfoListSocial.add(negateLib);
} else {
// 删除
baseMapper.deleteById(library.getId());
......@@ -1603,7 +1631,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
private void calculateFundType(BigDecimal zero, TForecastLibrary library) {
private void calculateFundType(BigDecimal zero, TForecastLibrary library, List<TForecastLibrary> libraryFundInfoListFund) {
if (library.getDataPush() == CommonConstants.ONE_INT || CommonConstants.ONE_STRING.equals(library.getSalaryFundFlag())) {
// 加负数
TForecastLibrary negateLib = new TForecastLibrary();
......@@ -1617,7 +1645,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
negateLib.setPersonalFundSum(BigDecimalUtils.safeSubtract(false, zero, library.getPersonalFundSum()));
negateLib.setSumAll(BigDecimalUtils.safeSubtract(false, zero, library.getSumAll()));
negateLib.setDiffType(SocialConstants.DIFF_TYPE_TWO);
baseMapper.insert(negateLib);
libraryFundInfoListFund.add(negateLib);
} else {
// 删除
baseMapper.deleteById(library.getId());
......@@ -2192,13 +2220,15 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
isSaveAndUpdate = true;
}
List<TForecastLibrary> libraryFundInfoListSocial = new ArrayList<>();
List<TForecastLibrary> libraryFundInfoListFund = new ArrayList<>();
//社保收入
if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
//获取所有的预估数据
List<TForecastLibrary> librarySocialInfoList = null;
List<TForecastLibrary> librarySocialInfoList;
librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain())
......@@ -2208,6 +2238,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
for (TForecastLibrary library : librarySocialInfoList) {
//办理成功生成收入
createIncomeInfo(library);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListSocial.add(library);
}
}
}
}
......@@ -2217,7 +2250,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
&& CommonConstants.THREE_STRING.equals(socialFundInfo.getFundStatus())) {
//获取所有的预估数据
List<TForecastLibrary> libraryFundInfoList = null;
List<TForecastLibrary> libraryFundInfoList;
libraryFundInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain())
......@@ -2227,8 +2260,19 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
for (TForecastLibrary library : libraryFundInfoList) {
//办理成功生成收入
createIncomeInfo(library);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListFund.add(library);
}
}
}
}
//推送社保明细
if (Common.isNotNull(libraryFundInfoListSocial)) {
pushForecastInfo(libraryFundInfoListSocial);
}
//推送公积金明细
if (Common.isNotNull(libraryFundInfoListFund)) {
pushForecastFundInfo(libraryFundInfoListFund);
}
if (isSaveAndUpdate) {
return R.ok(null, "执行成功!");
......
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