Commit 10bc0cdb authored by hongguangwu's avatar hongguangwu

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

parents 8ba0f10d d9da776d
......@@ -7,8 +7,10 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -71,7 +73,7 @@ public class SocialDaprUtils {
/**
* @Author huyc
* @Description 更新缴费库
* @Description 更新社保公积金明细
* @Date 2022/8/15
* @Param
* @return
......@@ -82,13 +84,17 @@ public class SocialDaprUtils {
/**
* @Author huyc
* @Description 生成收入数据
* @Description 查询人员收入数据
* @Date 2022/9/2
* @Param
* @return
**/
public void createTIncomeDetail(TIncomeDetail infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/createTIncomeDetail", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN);
public R<TIncomeDetailReturnVo> getTIncomeDetailList(TIncomeDetail infoVo) {
R<TIncomeDetailReturnVo> listVo = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/getTIncomeDetailList", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(listVo)){
return R.failed("查询人员收入数据失败!");
}
return listVo;
}
/**
......@@ -98,11 +104,33 @@ public class SocialDaprUtils {
* @Param
* @return
**/
public R<TIncomeDetailReturnVo> getTIncomeDetailList(TIncomeDetail infoVo) {
R<TIncomeDetailReturnVo> listVo = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/getTIncomeDetailList", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN);
public R<Boolean> createTIncomeDetail(TIncomeDetail infoVo) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/saveDetail", JSON.toJSONString(infoVo), Boolean.class, SecurityConstants.FROM_IN);
}
/**
* @Author huyc
* @Description 查询人员缴费库数据
* @Date 2022/9/2
* @Param
* @return
**/
public R<TPaymentVo> getPaymentSocialAndFound(TPaymentInfo infoVo) {
R<TPaymentVo> listVo = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/getPaymentSocialAndFound", JSON.toJSONString(infoVo), TPaymentInfo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(listVo)){
return R.failed("查询人员收入数据失败!");
return R.failed("查询人员缴费库数据失败!");
}
return listVo;
}
/**
* @Author huyc
* @Description 通过收入id删除收入数据
* @Date 2022/9/2
* @Param
* @return
**/
public void deleteById(TIncomeDetail infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/deleteById", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN);
}
}
......@@ -28,7 +28,9 @@ public class PersonAttributesMapper implements AttributesMapper<PersonVo> {
if (null != attributes.get("ou")) {
personVo.setDeptName((String) attributes.get("ou").get());
}
personVo.setPassword((String) attributes.get("uid").get());
if (null != attributes.get("userPassword")) {
personVo.setPassword((String) attributes.get("userPassword").get());
}
return personVo;
}
}
......@@ -105,9 +105,9 @@ public class SocialTask {
* @return: void
**/
public void createPaymentInfoIncome() {
log.info("------------定时生成缴费库的收入数据-定时任务开始------------");
log.info("------------定时生成缴费库社保的收入数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tpaymentinfo/inner/createPaymentInfoIncome","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成缴费库的收入数据-定时任务结束------------");
log.info("------------定时生成缴费库社保的收入数据-定时任务结束------------");
}
/**
......@@ -117,8 +117,20 @@ public class SocialTask {
* @return: void
**/
public void createPaymentFundIncome() {
log.info("------------定时生成缴费库的收入数据-定时任务开始------------");
log.info("------------定时生成缴费库公积金的收入数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tpaymentinfo/inner/createPaymentFundIncome","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成缴费库的收入数据-定时任务结束------------");
log.info("------------定时生成缴费库公积金的收入数据-定时任务结束------------");
}
/**
* @Description: 定时任务生成统计表数据
* @Author: huyc
* @Date: 2022/8/30
* @return: void
**/
public void pushDetail() {
log.info("------------定时任务生成统计表数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/pushDetail","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时任务生成统计表数据-定时任务结束------------");
}
}
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import lombok.Data;
import java.util.List;
......@@ -12,4 +13,6 @@ import java.util.List;
@Data
public class TPaymentVo {
List<TPaymentBySalaryVo> paymentList;
List<TPaymentInfo> paymentInfoList;
}
......@@ -162,4 +162,15 @@ public class TIncomeController {
return tIncomeService.saveDetail(tIncomeDetail);
}
/**
* @Description: 定时任务统计表未推送数据推送;
* @Author: huyc
* @Date: 2022/9/5 16:34
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Inner
@PostMapping("/inner/pushDetail")
public void pushDetail() {
tIncomeService.pushDetail();
}
}
......@@ -56,4 +56,26 @@ public class TIncomeDetailController {
return vo;
}
/**
* @Description: 生成收入数据
* @Author: huyc
* @Date: 2022-9-2
**/
@Inner
@PostMapping("/inner/createTIncomeDetail")
public void createTIncomeDetail(@RequestBody TIncomeDetail detail) {
tIncomeDetailService.save(detail);
}
/**
* 通过id删除收入明细表
*
* @param tIncomeDetail
* @return R
*/
@Inner
@PostMapping("/deleteById")
public void deleteById(@RequestBody TIncomeDetail tIncomeDetail) {
tIncomeDetailService.removeById(tIncomeDetail.getId());
}
}
......@@ -368,4 +368,17 @@ public class TPaymentInfoController {
public void createPaymentFundIncome() {
tPaymentInfoService.createPaymentFundIncome();
}
/**
* @param info
* @Description: 查询缴费库
* @Author: huyc
* @Date: 2022/8/25
* @return: int
**/
@Inner
@PostMapping("/inner/getPaymentSocialAndFound")
public TPaymentVo getPaymentSocialAndFound(@RequestBody TPaymentInfo info) {
return tPaymentInfoService.getPaymentSocialAndFound(info);
}
}
......@@ -57,4 +57,6 @@ public interface TIncomeService extends IService<TIncome> {
**/
boolean saveDetail(TIncomeDetail tIncomeDetail);
void pushDetail();
}
......@@ -137,4 +137,7 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
void createPaymentInfoIncome();
void createPaymentFundIncome();
TPaymentVo getPaymentSocialAndFound(TPaymentInfo info);
}
......@@ -33,6 +33,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
......@@ -54,6 +55,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
......@@ -102,6 +104,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private final TForecastLibraryService forecastLibraryService;
private final TIncomeDetailMapper detailMapper;
/**
* 派单信息记录表简单分页查询
*
......@@ -3313,6 +3317,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
|| CommonConstants.THREE_STRING.equals(sf.getSocialStatus())){
forecastLibraryService.updateForecastLibaryByDispatch(sf);
}
//公积金办理成功增加收入
if (Common.isNotNull(dis.getFundId()) &&
CommonConstants.THREE_STRING.equals(sf.getFundStatus())){
int monthDiff;
// 获取最小的起缴月
Date minStartDate = this.getMinDate(sf);
// 再计算月份
monthDiff = DateUtil.getMonthDiff(minStartDate, new Date()) + 2;
for (int i = 0; i < monthDiff; i++) {
//生成收入
createIncomeInfo(sf,DateUtil.addMonth(1 - i));
}
}
}
// 2.派减办理成功 处理预估 (不管社保还是公积金办理失败)
......@@ -3944,4 +3961,96 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return baseMapper.getFundRecordCount(searchVo,settleDomains,Common.getList(idStr),sql);
}
/**
* @param socialFundInfo
* @Description: 获取最小起缴日
* @Author: hgw
* @Date: 2022/7/29 11:06
* @return: java.util.Date
**/
private Date getMinDate(TSocialFundInfo socialFundInfo) {
Date minStartDate = null;
if (socialFundInfo.getSocialStartDate() != null) {
minStartDate = socialFundInfo.getSocialStartDate();
if (socialFundInfo.getUnitPersionMoney() != null && socialFundInfo.getPensionStart() != null && socialFundInfo.getPensionStart().before(minStartDate)) {
minStartDate = socialFundInfo.getPensionStart();
}
if (socialFundInfo.getUnitMedicalMoney() != null && socialFundInfo.getMedicalStart() != null && socialFundInfo.getMedicalStart().before(minStartDate)) {
minStartDate = socialFundInfo.getMedicalStart();
}
if (socialFundInfo.getUnitUnemploymentMoney() != null && socialFundInfo.getUnemployStart() != null && socialFundInfo.getUnemployStart().before(minStartDate)) {
minStartDate = socialFundInfo.getUnemployStart();
}
if (socialFundInfo.getUnitInjuryMoney() != null && socialFundInfo.getWorkInjuryStart() != null && socialFundInfo.getWorkInjuryStart().before(minStartDate)) {
minStartDate = socialFundInfo.getWorkInjuryStart();
}
if (socialFundInfo.getUnitBirthMoney() != null && socialFundInfo.getBirthStart() != null && socialFundInfo.getBirthStart().before(minStartDate)) {
minStartDate = socialFundInfo.getBirthStart();
}
}
if (socialFundInfo.getProvidentStart() != null
&& (null == minStartDate || socialFundInfo.getProvidentStart().before(minStartDate))) {
minStartDate = socialFundInfo.getProvidentStart();
}
if (null == minStartDate) {
minStartDate = new Date();
}
return minStartDate;
}
public void createIncomeInfo(TSocialFundInfo library, String createMonth) {
//获取项目信息
TSettleDomain settleDomain = new TSettleDomain();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(library.getSettleDomain());
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);
}
}
}
//生成收入数据
TIncomeDetail detail = new TIncomeDetail();
detail.setCreateTime(DateUtil.getCurrentDateTime());
detail.setDeptName(library.getSettleDomainName());
detail.setDeptNo(library.getSettleDomainCode());
detail.setDeptId(library.getSettleDomain());
detail.setEmpIdcard(library.getEmpIdcard());
detail.setEmpName(library.getEmpName());
detail.setUnitNo(settleDomain.getCustomerNo());
detail.setUnitId(library.getUnitId());
detail.setUnitName(library.getUnitName());
detail.setDataCreateMonth(DateUtil.addMonth(0));
detail.setSourceId(library.getId());
detail.setSourceType(CommonConstants.TWO_STRING);
detail.setCreateMonth(createMonth);
detail.setPayMonth(createMonth);
detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setMoney(BigDecimalUtils.safeAdd(library.getUnitFundSum(),library.getPersonalFundSum()));
//管理费和风险金收取
managemeRisk(settleDomain,detail);
}
public void managemeRisk(TSettleDomain settleDomain,TIncomeDetail detail) {
//管理费和风险金是否收取
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
detail.setFeeType(CommonConstants.ONE_STRING);
detail.setFeeMode(settleDomain.getManagementType());
detail.setCharges(settleDomain.getManagementFee().toString());
detail.setId(CommonConstants.NULL);
detailMapper.insert(detail);
}
if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
detail.setFeeType(CommonConstants.TWO_STRING);
detail.setFeeMode(settleDomain.getRiskFundType());
detail.setCharges(settleDomain.getRiskFundFee().toString());
detail.setId(CommonConstants.NULL);
detailMapper.insert(detail);
}
}
}
......@@ -25,15 +25,14 @@ 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.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.common.core.constant.CommonConstants;
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.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.ekp.config.EkpIncomeProperties;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpIncomeUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParam;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAgentConfig;
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;
......@@ -44,10 +43,8 @@ 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.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......@@ -275,6 +272,24 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
}
}
@Override
public void pushDetail() {
List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda()
.eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING));
for (TIncome income : list) {
EkpIncomeParam sendParam = new EkpIncomeParam();
this.copyToEkp(income, sendParam);
String sendBack = ekpIncomeUtil.sendToEKP(sendParam, income.getFeeType());
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
}
this.updateById(income);
}
}
// 复制并保存
private boolean saveIncome(TIncomeDetail tIncomeDetail) {
TIncome income = new TIncome();
......
......@@ -58,6 +58,7 @@ import com.yifu.cloud.plus.v1.yifu.social.constants.PaymentConstants;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentHeFeiVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
......@@ -123,6 +124,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Autowired
private TIncomeDetailMapper detailMapper;
@Autowired
private TIncomeService incomeService;
@Autowired
private ArchivesDaprUtil archivesDaprUtil;
......@@ -2293,6 +2297,17 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
@Override
public TPaymentVo getPaymentSocialAndFound(TPaymentInfo info) {
List<TPaymentInfo> sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getEmpIdcard, info.getEmpIdcard())
.eq(TPaymentInfo::getSettleDomainId, info.getSettleDomainId())
.eq(TPaymentInfo::getSocialCreateMonth, "202212"));
TPaymentVo paymentVo = new TPaymentVo();
paymentVo.setPaymentInfoList(sumList);
return paymentVo;
}
public List<String> initEkpPushSocialParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>();
for (TPaymentInfo library:unPushInfo) {
......@@ -2646,73 +2661,114 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
exitFlag = true;
}
//判断是否为按人次收费
int isSum = 0;
if (Common.isNotNull(settleDomain)) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
//按金额计算的话要看缴纳月有没有收入数据
if (!exitFlag) {
// 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && (settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING)
|| settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING))) {
//预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
//预估模式只有按人次和人数收费
if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
isSum = 1;
}
if (!exitFlag || isSum == 1) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
settleDomain.getManagementFee(), socialFundFlag);
}
}
} else {
BigDecimal gMoney = BigDecimal.ZERO;
if (CommonConstants.ONE_STRING.equals(settleDomain.getManagementType())) {
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
isSum = 2;
} else {
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(), settleDomain.getManagementFee());
} else {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(), settleDomain.getManagementFee());
}
} else {
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
gMoney = paymentInfo.getSocialSum();
} else {
gMoney = paymentInfo.getProvidentSum();
}
createIncomeRiskInfo(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), gMoney, socialFundFlag);
}
if (!exitFlag || isSum == 2) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag);
}
}
if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
BigDecimal money = BigDecimal.ZERO;
if (CommonConstants.ONE_STRING.equals(settleDomain.getRiskFundType())) {
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
money = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(), settleDomain.getRiskFundFee());
}
if (Common.isNotNull(settleDomain.getRiskServerItem()) && (settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING)
|| settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING))) {
//预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType()) &&
CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
isSum = 3;
}
if (!exitFlag || isSum == 3) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
settleDomain.getRiskFundFee(), socialFundFlag);
}
} else {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
BigDecimal money = BigDecimal.ZERO;
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
money = settleDomain.getRiskFundFee();
isSum = 4;
} else {
money = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(), settleDomain.getRiskFundFee());
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
money = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(), settleDomain.getRiskFundFee());
} else {
money = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(), settleDomain.getRiskFundFee());
}
}
} else {
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
money = paymentInfo.getSocialSum();
} else {
money = paymentInfo.getProvidentSum();
if (!exitFlag || isSum == 4) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, socialFundFlag);
}
}
createIncomeRiskInfo(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(), money, socialFundFlag);
}
}
}
}
public void createIncomeRiskInfo(TPaymentInfo paymentInfo,TSettleDomain settleDomain,String feeType,
String charges, String feeMode,BigDecimal money,String sourceType) {
public void createIncomeInsurance(TPaymentInfo library, TSettleDomain settleDomain, String feeType,
String charges, String feeMode, BigDecimal money,String sourceType) {
//生成收入数据
TIncomeDetail detail = new TIncomeDetail();
detail.setCreateTime(DateUtil.getCurrentDateTime());
detail.setDeptName(paymentInfo.getSettleDomainName());
detail.setDeptNo(paymentInfo.getSettleDomainCode());
detail.setDeptId(paymentInfo.getSettleDomainId());
detail.setEmpIdcard(paymentInfo.getEmpIdcard());
detail.setEmpName(paymentInfo.getEmpName());
detail.setDeptName(settleDomain.getDepartName());
detail.setDeptNo(settleDomain.getDepartNo());
detail.setDeptId(settleDomain.getId());
detail.setEmpIdcard(library.getEmpIdcard());
detail.setEmpName(library.getEmpName());
detail.setUnitNo(settleDomain.getCustomerNo());
detail.setUnitId(paymentInfo.getUnitId());
detail.setUnitName(paymentInfo.getUnitName());
detail.setUnitId(settleDomain.getCustomerId());
detail.setUnitName(settleDomain.getCustomerName());
detail.setDataCreateMonth(DateUtil.addMonth(0));
detail.setSourceId(paymentInfo.getId());
detail.setSourceId(library.getId());
detail.setSourceType(sourceType);
detail.setCreateMonth(paymentInfo.getSocialCreateMonth());
detail.setPayMonth(paymentInfo.getSocialPayMonth());
if (CommonConstants.ONE_STRING.equals(sourceType)) {
detail.setCreateMonth(library.getSocialCreateMonth());
detail.setPayMonth(library.getSocialPayMonth());
} else {
detail.setCreateMonth(library.getProvidentCreateMonth());
detail.setPayMonth(library.getProvidentPayMonth());
}
detail.setMoney(money);
detail.setFeeType(feeType);
detail.setFeeMode(feeMode);
detail.setCharges(charges);
detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setId(CommonConstants.NULL);
detailMapper.insert(detail);
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