|
@@ -14,6 +14,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Comparator;
|
|
import java.util.Comparator;
|
|
@@ -35,12 +36,13 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
@Service
|
|
|
public class InsuranceHandlingSettlementMonthServiceImpl extends ServiceImpl<InsuranceHandlingSettlementMonthMapper, InsuranceHandlingSettlementMonthEntity> implements InsuranceHandlingSettlementMonthService {
|
|
public class InsuranceHandlingSettlementMonthServiceImpl extends ServiceImpl<InsuranceHandlingSettlementMonthMapper, InsuranceHandlingSettlementMonthEntity> implements InsuranceHandlingSettlementMonthService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- private InsPlyIncomeService insPlyIncomeService;
|
|
|
|
|
|
|
+ private InsPlyIncomeService insPlyIncomeService;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public List<InsuranceHandlingSettlementMonthDto> queryList(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
|
|
public List<InsuranceHandlingSettlementMonthDto> queryList(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
|
|
|
- List<InsuranceHandlingSettlementMonthDto> incomeList= insPlyIncomeService.getInvociAmount(insuranceHandlingSettlementMonthVo);
|
|
|
|
|
|
|
+ List<InsuranceHandlingSettlementMonthDto> incomeList = insPlyIncomeService.getInvociAmount(insuranceHandlingSettlementMonthVo);
|
|
|
List<InsuranceHandlingSettlementMonthDto> resultList = baseMapper.queryList(insuranceHandlingSettlementMonthVo);
|
|
List<InsuranceHandlingSettlementMonthDto> resultList = baseMapper.queryList(insuranceHandlingSettlementMonthVo);
|
|
|
- if(resultList.size()>0){
|
|
|
|
|
|
|
+ if (!resultList.isEmpty()) {
|
|
|
Map<String, InsuranceHandlingSettlementMonthDto> latestByTaskId = resultList.stream()
|
|
Map<String, InsuranceHandlingSettlementMonthDto> latestByTaskId = resultList.stream()
|
|
|
.collect(Collectors.toMap(
|
|
.collect(Collectors.toMap(
|
|
|
InsuranceHandlingSettlementMonthDto::getIncomeSigningTime, // 用于生成Map的键
|
|
InsuranceHandlingSettlementMonthDto::getIncomeSigningTime, // 用于生成Map的键
|
|
@@ -52,9 +54,15 @@ public class InsuranceHandlingSettlementMonthServiceImpl extends ServiceImpl<Ins
|
|
|
for (InsuranceHandlingSettlementMonthDto incomeItem : incomeList){
|
|
for (InsuranceHandlingSettlementMonthDto incomeItem : incomeList){
|
|
|
String incomeSigningTime = incomeItem.getIncomeSigningTime();
|
|
String incomeSigningTime = incomeItem.getIncomeSigningTime();
|
|
|
InsuranceHandlingSettlementMonthDto insuranceHandlingSettlementMonthDto = latestByTaskId.get(incomeSigningTime);
|
|
InsuranceHandlingSettlementMonthDto insuranceHandlingSettlementMonthDto = latestByTaskId.get(incomeSigningTime);
|
|
|
- incomeItem.setRemainingAmount(insuranceHandlingSettlementMonthDto.getRemainingAmount());
|
|
|
|
|
- incomeItem.setTotalAmount(insuranceHandlingSettlementMonthDto.getTotalAmount());
|
|
|
|
|
|
|
+ if(ObjectUtils.isEmpty(insuranceHandlingSettlementMonthDto)){
|
|
|
|
|
+ incomeItem.setRemainingAmount(incomeItem.getTotalAmount());
|
|
|
|
|
+ incomeItem.setTotalAmount(incomeItem.getTotalAmount());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ incomeItem.setRemainingAmount(insuranceHandlingSettlementMonthDto.getRemainingAmount());
|
|
|
|
|
+ incomeItem.setTotalAmount(insuranceHandlingSettlementMonthDto.getTotalAmount());
|
|
|
|
|
+ }
|
|
|
incomeItem.setCreateTime(null);
|
|
incomeItem.setCreateTime(null);
|
|
|
|
|
+
|
|
|
if( incomeItem.getSettlementAmount() ==null || incomeItem.getSettlementAmount().compareTo(BigDecimal.ZERO)==0){
|
|
if( incomeItem.getSettlementAmount() ==null || incomeItem.getSettlementAmount().compareTo(BigDecimal.ZERO)==0){
|
|
|
incomeItem.setSettlementAmount(new BigDecimal("0.00"));
|
|
incomeItem.setSettlementAmount(new BigDecimal("0.00"));
|
|
|
|
|
|