|
|
@ -137,7 +137,6 @@ public class AlCollectionStatisticsServiceImpl extends ServiceImpl<AlCollectionS |
|
|
|
String year = generateReq.getYear(); |
|
|
|
String year = generateReq.getYear(); |
|
|
|
List<Integer> personLiableIds = generateReq.getPersonLiableIds(); |
|
|
|
List<Integer> personLiableIds = generateReq.getPersonLiableIds(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//有人员id生成数据
|
|
|
|
//有人员id生成数据
|
|
|
|
if (personLiableIds.size() > 0){ |
|
|
|
if (personLiableIds.size() > 0){ |
|
|
|
List<AlReimbursement> reimbursementList = reimbursementMapper.selectListByYear(year,personLiableIds); |
|
|
|
List<AlReimbursement> reimbursementList = reimbursementMapper.selectListByYear(year,personLiableIds); |
|
|
@ -156,7 +155,7 @@ public class AlCollectionStatisticsServiceImpl extends ServiceImpl<AlCollectionS |
|
|
|
// BigDecimal guaranteeAmount = alInsuranceList.getGuaranteeAmount();
|
|
|
|
// BigDecimal guaranteeAmount = alInsuranceList.getGuaranteeAmount();
|
|
|
|
//统计业务还款记录清收现金和资产
|
|
|
|
//统计业务还款记录清收现金和资产
|
|
|
|
QueryWrapper<AlRepaymentEntry> repaymentEntryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<AlRepaymentEntry> repaymentEntryWrapper = new QueryWrapper<>(); |
|
|
|
repaymentEntryWrapper.eq("insurance_id",insuranceId).orderByAsc("id"); |
|
|
|
repaymentEntryWrapper.eq("insurance_id",insuranceId).last("and YEAR(actual_repayment_date) = '"+year+"' "); |
|
|
|
List<AlRepaymentEntry> repaymentEntryList = repaymentEntryMapper.selectList(repaymentEntryWrapper); |
|
|
|
List<AlRepaymentEntry> repaymentEntryList = repaymentEntryMapper.selectList(repaymentEntryWrapper); |
|
|
|
//清收现金
|
|
|
|
//清收现金
|
|
|
|
BigDecimal repaymentCash = new BigDecimal(0); |
|
|
|
BigDecimal repaymentCash = new BigDecimal(0); |
|
|
@ -164,8 +163,8 @@ public class AlCollectionStatisticsServiceImpl extends ServiceImpl<AlCollectionS |
|
|
|
BigDecimal repaymentAssets = new BigDecimal(0); |
|
|
|
BigDecimal repaymentAssets = new BigDecimal(0); |
|
|
|
StringBuilder note = new StringBuilder(); |
|
|
|
StringBuilder note = new StringBuilder(); |
|
|
|
for (AlRepaymentEntry repaymentEntry: repaymentEntryList){ |
|
|
|
for (AlRepaymentEntry repaymentEntry: repaymentEntryList){ |
|
|
|
//无实际还款日不加入年度统计
|
|
|
|
//无实际还款日不加入年度统计或不在此年度不加入该年度统计
|
|
|
|
if (repaymentEntry.getActualRepaymentDate()==null){ |
|
|
|
if (!year.equals(repaymentEntry.getActualRepaymentDate().substring(0,4))){ |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if (repaymentEntry.getRepaymentCash()!=null){ |
|
|
|
if (repaymentEntry.getRepaymentCash()!=null){ |
|
|
@ -186,6 +185,7 @@ public class AlCollectionStatisticsServiceImpl extends ServiceImpl<AlCollectionS |
|
|
|
|
|
|
|
|
|
|
|
collectionStatistics.setGroupId(collectionGroupId); |
|
|
|
collectionStatistics.setGroupId(collectionGroupId); |
|
|
|
collectionStatistics.setInsuranceId(insuranceId); |
|
|
|
collectionStatistics.setInsuranceId(insuranceId); |
|
|
|
|
|
|
|
collectionStatistics.setActualRepaymentDate(year); |
|
|
|
collectionStatistics.setPersonLiable(personLiable); |
|
|
|
collectionStatistics.setPersonLiable(personLiable); |
|
|
|
collectionStatistics.setPersonLiableId(personLiableId); |
|
|
|
collectionStatistics.setPersonLiableId(personLiableId); |
|
|
|
collectionStatistics.setJobNumber(jobNumber); |
|
|
|
collectionStatistics.setJobNumber(jobNumber); |
|
|
@ -343,7 +343,7 @@ public class AlCollectionStatisticsServiceImpl extends ServiceImpl<AlCollectionS |
|
|
|
* 还款添加或编辑或删除,根据还款记录id查询保后业务数据更新年度清收数据 |
|
|
|
* 还款添加或编辑或删除,根据还款记录id查询保后业务数据更新年度清收数据 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void updateCompleteStatistics(Integer insuranceId) { |
|
|
|
public void updateCompleteStatistics(Integer insuranceId,String year) { |
|
|
|
//查询清收代偿信息
|
|
|
|
//查询清收代偿信息
|
|
|
|
QueryWrapper<AlReimbursement> wrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<AlReimbursement> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq("insurance_id",insuranceId); |
|
|
|
wrapper.eq("insurance_id",insuranceId); |
|
|
@ -363,17 +363,17 @@ public class AlCollectionStatisticsServiceImpl extends ServiceImpl<AlCollectionS |
|
|
|
String customerName = alInsuranceList.getCustomerName(); |
|
|
|
String customerName = alInsuranceList.getCustomerName(); |
|
|
|
//统计该业务下还款记录清收现金和资产
|
|
|
|
//统计该业务下还款记录清收现金和资产
|
|
|
|
QueryWrapper<AlRepaymentEntry> repaymentEntryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<AlRepaymentEntry> repaymentEntryWrapper = new QueryWrapper<>(); |
|
|
|
repaymentEntryWrapper.eq("insurance_id",insuranceId).orderByAsc("id"); |
|
|
|
repaymentEntryWrapper.eq("insurance_id",insuranceId).last("and YEAR(actual_repayment_date) = '"+year+"' "); |
|
|
|
List<AlRepaymentEntry> repaymentEntryList = repaymentEntryMapper.selectList(repaymentEntryWrapper); |
|
|
|
List<AlRepaymentEntry> repaymentEntryList = repaymentEntryMapper.selectList(repaymentEntryWrapper); |
|
|
|
//无还款记录则删除该年度业务统计
|
|
|
|
//无还款记录则删除该年度业务统计
|
|
|
|
if (ObjectUtil.isNull(repaymentEntryList)){ |
|
|
|
if (ObjectUtil.isNull(repaymentEntryList)||repaymentEntryList.size()==0){ |
|
|
|
QueryWrapper<AlCollectionStatistics> deleteWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<AlCollectionStatistics> deleteWrapper = new QueryWrapper<>(); |
|
|
|
deleteWrapper.eq("insurance_id",insuranceId).eq("group_id",groupId); |
|
|
|
deleteWrapper.eq("insurance_id",insuranceId).eq("group_id",groupId).eq("actual_repayment_date",year); |
|
|
|
baseMapper.delete(deleteWrapper); |
|
|
|
baseMapper.delete(deleteWrapper); |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
//先清空之前数据
|
|
|
|
//先清空之前数据
|
|
|
|
QueryWrapper<AlCollectionStatistics> deleteWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<AlCollectionStatistics> deleteWrapper = new QueryWrapper<>(); |
|
|
|
deleteWrapper.eq("insurance_id",insuranceId).eq("group_id",groupId); |
|
|
|
deleteWrapper.eq("insurance_id",insuranceId).eq("group_id",groupId).eq("actual_repayment_date",year); |
|
|
|
baseMapper.delete(deleteWrapper); |
|
|
|
baseMapper.delete(deleteWrapper); |
|
|
|
//清收现金
|
|
|
|
//清收现金
|
|
|
|
BigDecimal repaymentCash = new BigDecimal(0); |
|
|
|
BigDecimal repaymentCash = new BigDecimal(0); |
|
|
@ -382,8 +382,8 @@ public class AlCollectionStatisticsServiceImpl extends ServiceImpl<AlCollectionS |
|
|
|
|
|
|
|
|
|
|
|
StringBuilder note = new StringBuilder(); |
|
|
|
StringBuilder note = new StringBuilder(); |
|
|
|
for (AlRepaymentEntry repayment: repaymentEntryList){ |
|
|
|
for (AlRepaymentEntry repayment: repaymentEntryList){ |
|
|
|
//无实际还款日不加入年度统计
|
|
|
|
//无实际还款日不加入年度统计或不在此年度不加入该年度统计
|
|
|
|
if (repayment.getActualRepaymentDate()==null){ |
|
|
|
if (!year.equals(repayment.getActualRepaymentDate().substring(0,4))){ |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if (repayment.getRepaymentCash()!=null){ |
|
|
|
if (repayment.getRepaymentCash()!=null){ |
|
|
@ -404,6 +404,7 @@ public class AlCollectionStatisticsServiceImpl extends ServiceImpl<AlCollectionS |
|
|
|
//添加年度数据
|
|
|
|
//添加年度数据
|
|
|
|
collectionStatistics.setGroupId(groupId); |
|
|
|
collectionStatistics.setGroupId(groupId); |
|
|
|
collectionStatistics.setInsuranceId(insuranceId); |
|
|
|
collectionStatistics.setInsuranceId(insuranceId); |
|
|
|
|
|
|
|
collectionStatistics.setActualRepaymentDate(year); |
|
|
|
collectionStatistics.setPersonLiable(personLiable); |
|
|
|
collectionStatistics.setPersonLiable(personLiable); |
|
|
|
collectionStatistics.setPersonLiableId(personLiableId); |
|
|
|
collectionStatistics.setPersonLiableId(personLiableId); |
|
|
|
collectionStatistics.setJobNumber(jobNumber); |
|
|
|
collectionStatistics.setJobNumber(jobNumber); |
|
|
|