Commit 71ef381e authored by huyuchen's avatar huyuchen

生成收入接口修改

parent bf195c6c
......@@ -57,6 +57,14 @@ public interface TIncomeService extends IService<TIncome> {
**/
boolean saveDetail(TIncomeDetail tIncomeDetail);
/**
* @Description: 新增收入明细-详情表,同时统计;
* @Author: huyc
* @Date: 2022/9/9 11:42
* @return:
**/
void saveBathDetail(List<TIncomeDetail> tIncomeDetail);
void pushDetail();
}
......@@ -4029,7 +4029,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
//判断是否存在当月的社保或公积金收入数据
//判断是否存在当月的公积金收入数据
Boolean isExist = false;
TIncomeDetail incomeDetail = new TIncomeDetail();
incomeDetail.setEmpIdcard(library.getEmpIdcard());
......@@ -4047,6 +4047,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
int isSum = 0;
if (Common.isNotNull(settleDomain)) {
// 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem()
......@@ -4067,11 +4068,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else {
isSum = 1;
gMoney = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
}
if (!isExist) {
if (!isExist || isSum == 1) {
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), gMoney);
}
......@@ -4093,14 +4095,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
BigDecimal money = BigDecimal.ZERO;
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else {
isSum = 2;
money = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
}
if (!isExist) {
if (!isExist || isSum == 2) {
createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(), money);
}
......
......@@ -2183,22 +2183,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
isSaveAndUpdate = true;
}
if ((Common.isNotNull(socialFundInfo.getSocialId())
//社保收入
if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus()))
|| (Common.isNotNull(socialFundInfo.getFundId())
&& CommonConstants.THREE_STRING.equals(socialFundInfo.getFundStatus()))) {
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
//获取所有的预估数据
List<TForecastLibrary> librarySocialInfoList = null;
librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain())
.and(obj -> obj
.in(TForecastLibrary::getSocialPayMonth, payMonthList)
.or()
.in(TForecastLibrary::getProvidentPayMonth, payMonthList))
);
.in(TForecastLibrary::getSocialPayMonth, payMonthList));
if (Common.isNotNull(librarySocialInfoList)) {
for (TForecastLibrary library : librarySocialInfoList) {
......@@ -2207,6 +2202,25 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
}
//公积金收入
if (Common.isNotNull(socialFundInfo.getFundId())
&& CommonConstants.THREE_STRING.equals(socialFundInfo.getFundStatus())) {
//获取所有的预估数据
List<TForecastLibrary> libraryFundInfoList = null;
libraryFundInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain())
.in(TForecastLibrary::getProvidentPayMonth, payMonthList));
if (Common.isNotNull(libraryFundInfoList)) {
for (TForecastLibrary library : libraryFundInfoList) {
//办理成功生成收入
createIncomeInfo(library);
}
}
}
if (isSaveAndUpdate) {
return R.ok(null, "执行成功!");
} else {
......@@ -2288,6 +2302,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
public void initEkpPushSocialParam(List<TForecastLibrary> unPushInfo) {
List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>();
Map<String,String> idMap = new HashMap<>();
for (TForecastLibrary library : unPushInfo) {
//获取项目信息
TSettleDomain settleDomain = new TSettleDomain();
......@@ -2520,6 +2535,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (map.get(body) > 0) {
int i = map.get(body) + 1;
map.put(body,i);
idMap.put(body,library.getId());
//单个异常超过十次,保存异常内容
if (i >= 10) {
baseMapper.updatePushStatus(pushList);
......@@ -2531,30 +2547,25 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
error.setLinkId(library.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
}
break;
}
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else {
map.put(body,1);
idMap.put(body,library.getId());
}
}
}
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(1);
tSendEkpErrorService.saveError(error);
}
}
error.setTitle(key);
error.setLinkId(idMap.get(key));
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
//更新推送状态
if (Common.isNotNull(pushList)) {
......@@ -2565,6 +2576,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
public void initEkpPushFundParam(List<TForecastLibrary> unPushInfo) {
List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>();
Map<String,String> idMap = new HashMap<>();
for (TForecastLibrary library : unPushInfo) {
//获取项目信息
TSettleDomain settleDomain = new TSettleDomain();
......@@ -2693,6 +2705,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (map.get(body) > 0) {
int i = map.get(body) + 1;
map.put(body,i);
idMap.put(body,library.getId());
//单个异常超过十次,保存异常内容
if (i >= 10) {
baseMapper.updatePushStatus(pushList);
......@@ -2704,30 +2717,25 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
error.setLinkId(library.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
}
break;
}
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else {
map.put(body,1);
idMap.put(body,library.getId());
}
}
}
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(1);
tSendEkpErrorService.saveError(error);
}
}
error.setLinkId(idMap.get(key));
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.save(error);
}
//更新推送状态
if (Common.isNotNull(pushList)) {
......@@ -2780,6 +2788,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
int isSum = 0;
if (Common.isNotNull(settleDomain)) {
// 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING)
......@@ -2800,11 +2809,12 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else {
isSum = 1;
gMoney = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
}
if (!isExist) {
if (!isExist || isSum == 1) {
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, sourceType);
......@@ -2828,14 +2838,15 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
BigDecimal money;
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else {
isSum = 2;
money = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
}
if (!isExist) {
if (!isExist || isSum == 2) {
createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, sourceType);
......
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