Commit 5ab9c052 authored by fangxinjiang's avatar fangxinjiang

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

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