|
@@ -3,21 +3,14 @@ package com.ydtech.modules.inv.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
-import com.ydtech.core.page.HttpResult;
|
|
|
|
|
import com.ydtech.core.page.PageRequest;
|
|
import com.ydtech.core.page.PageRequest;
|
|
|
import com.ydtech.modules.esm.model.EsmInsCompany;
|
|
import com.ydtech.modules.esm.model.EsmInsCompany;
|
|
|
-import com.ydtech.modules.inv.dao.InvChannelAccountMapper;
|
|
|
|
|
import com.ydtech.modules.inv.dao.InvReceivableMapper;
|
|
import com.ydtech.modules.inv.dao.InvReceivableMapper;
|
|
|
import com.ydtech.modules.inv.dao.InvSettlementSourceMapper;
|
|
import com.ydtech.modules.inv.dao.InvSettlementSourceMapper;
|
|
|
import com.ydtech.modules.inv.dao.InvSourceMapper;
|
|
import com.ydtech.modules.inv.dao.InvSourceMapper;
|
|
|
-import com.ydtech.modules.inv.model.InvAccount;
|
|
|
|
|
-import com.ydtech.modules.inv.model.po.InvChannelAccount;
|
|
|
|
|
import com.ydtech.modules.inv.model.po.InvSettlementSource;
|
|
import com.ydtech.modules.inv.model.po.InvSettlementSource;
|
|
|
import com.ydtech.modules.inv.model.po.InvSource;
|
|
import com.ydtech.modules.inv.model.po.InvSource;
|
|
|
-import com.ydtech.modules.inv.model.po.QueryInvChannelAccount;
|
|
|
|
|
import com.ydtech.modules.inv.model.vo.*;
|
|
import com.ydtech.modules.inv.model.vo.*;
|
|
|
-import com.ydtech.modules.inv.service.InvChannelAccountService;
|
|
|
|
|
import com.ydtech.modules.inv.service.InvReceivableService;
|
|
import com.ydtech.modules.inv.service.InvReceivableService;
|
|
|
import com.ydtech.modules.inv.service.InvSourceService;
|
|
import com.ydtech.modules.inv.service.InvSourceService;
|
|
|
import com.ydtech.utils.idgen.IdGenerate;
|
|
import com.ydtech.utils.idgen.IdGenerate;
|
|
@@ -26,7 +19,6 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
|
-import java.time.MonthDay;
|
|
|
|
|
import java.time.YearMonth;
|
|
import java.time.YearMonth;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -36,10 +28,10 @@ import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
-* @author Administrator
|
|
|
|
|
-* @description 针对表【inv_channel_account(渠道账户表)】的数据库操作Service实现
|
|
|
|
|
-* @createDate 2024-01-20 10:29:30
|
|
|
|
|
-*/
|
|
|
|
|
|
|
+ * @author Administrator
|
|
|
|
|
+ * @description 针对表【inv_channel_account(渠道账户表)】的数据库操作Service实现
|
|
|
|
|
+ * @createDate 2024-01-20 10:29:30
|
|
|
|
|
+ */
|
|
|
@Service
|
|
@Service
|
|
|
public class InvReceivableServiceImpl implements InvReceivableService {
|
|
public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -55,13 +47,13 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
InvSettlementSourceMapper invSettlementSourceMapper;
|
|
InvSettlementSourceMapper invSettlementSourceMapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<ReceivableResultVo> getReceivableList(String startTime, String endTime,String insuranceId) {
|
|
|
|
|
- return invReceivableMapper.getReceivableList(startTime,endTime,insuranceId);
|
|
|
|
|
|
|
+ public List<ReceivableResultVo> getReceivableList(String startTime, String endTime, String insuranceId) {
|
|
|
|
|
+ return invReceivableMapper.getReceivableList(startTime, endTime, insuranceId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<SigningSourceResultVo> getSigningSourceResult(String yearMonthStr,String startTime, String endTime) {
|
|
|
|
|
- List<SigningSourceResultVo> signingSources = invReceivableMapper.getSigningSourceResult(startTime, endTime);
|
|
|
|
|
|
|
+ public List<SigningSourceResultVo> getSigningSourceResult(String yearMonthStr, String insuranceId, String startTime, String endTime) {
|
|
|
|
|
+ List<SigningSourceResultVo> signingSources = invReceivableMapper.getSigningSourceResult(startTime, endTime, insuranceId);
|
|
|
List<SigningSourceResultVo> signingSourceResult = new ArrayList<>();
|
|
List<SigningSourceResultVo> signingSourceResult = new ArrayList<>();
|
|
|
|
|
|
|
|
Float jqPremiumTax = 0f;
|
|
Float jqPremiumTax = 0f;
|
|
@@ -70,14 +62,13 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
Float writtenPremium = 0f;
|
|
Float writtenPremium = 0f;
|
|
|
Float settlementAmount = 0f;
|
|
Float settlementAmount = 0f;
|
|
|
|
|
|
|
|
- for(int i=1;i<=12;i++){
|
|
|
|
|
|
|
+ for (int i = 1; i <= 12; i++) {
|
|
|
//查找day是否有数据
|
|
//查找day是否有数据
|
|
|
String finalI = i < 10 ? "0" + String.valueOf(i) : String.valueOf(i);
|
|
String finalI = i < 10 ? "0" + String.valueOf(i) : String.valueOf(i);
|
|
|
boolean countBol = signingSources.stream().filter(x -> finalI.equals(x.getDay())).count() > 0 ? true : false;
|
|
boolean countBol = signingSources.stream().filter(x -> finalI.equals(x.getDay())).count() > 0 ? true : false;
|
|
|
- if(countBol)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (countBol) {
|
|
|
signingSourceResult.add(signingSources.stream().filter(x -> String.valueOf(finalI).equals(x.getDay())).findFirst().get());
|
|
signingSourceResult.add(signingSources.stream().filter(x -> String.valueOf(finalI).equals(x.getDay())).findFirst().get());
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
SigningSourceResultVo signingSourceResultVo = new SigningSourceResultVo();
|
|
SigningSourceResultVo signingSourceResultVo = new SigningSourceResultVo();
|
|
|
signingSourceResultVo.setDay(finalI);
|
|
signingSourceResultVo.setDay(finalI);
|
|
|
signingSourceResultVo.setYearmonth(yearMonthStr + "-" + finalI);
|
|
signingSourceResultVo.setYearmonth(yearMonthStr + "-" + finalI);
|
|
@@ -87,7 +78,7 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
|
|
|
|
|
|
|
|
|
|
//处理合计
|
|
//处理合计
|
|
|
- for(SigningSourceResultVo vo : signingSourceResult){
|
|
|
|
|
|
|
+ for (SigningSourceResultVo vo : signingSourceResult) {
|
|
|
jqPremiumTax = Float.parseFloat(vo.getJqPremiumTax()) + jqPremiumTax;
|
|
jqPremiumTax = Float.parseFloat(vo.getJqPremiumTax()) + jqPremiumTax;
|
|
|
syPremiumTax = Float.parseFloat(vo.getSyPremiumTax()) + syPremiumTax;
|
|
syPremiumTax = Float.parseFloat(vo.getSyPremiumTax()) + syPremiumTax;
|
|
|
nonCarPremiumTax = Float.parseFloat(vo.getNonCarPremiumTax()) + nonCarPremiumTax;
|
|
nonCarPremiumTax = Float.parseFloat(vo.getNonCarPremiumTax()) + nonCarPremiumTax;
|
|
@@ -106,8 +97,9 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<SigningSourceResultVo> getSigningSourceDayResult(String yearMonthStr, String startTime, String endTime,String insuranceId) {
|
|
|
|
|
- List<SigningSourceResultVo> signingSources = invReceivableMapper.getSigningSourceDayResult(startTime, endTime,insuranceId);
|
|
|
|
|
|
|
+ public List<SigningSourceResultVo> getSigningSourceDayResult(String yearMonthStr, String startTime, String endTime,
|
|
|
|
|
+ String insuranceId) {
|
|
|
|
|
+ List<SigningSourceResultVo> signingSources = invReceivableMapper.getSigningSourceDayResult(startTime, endTime, insuranceId);
|
|
|
List<SigningSourceResultVo> signingSourceResult = new ArrayList<>();
|
|
List<SigningSourceResultVo> signingSourceResult = new ArrayList<>();
|
|
|
// 定义日期时间格式
|
|
// 定义日期时间格式
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
@@ -120,14 +112,13 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
Float writtenPremium = 0f;
|
|
Float writtenPremium = 0f;
|
|
|
Float settlementAmount = 0f;
|
|
Float settlementAmount = 0f;
|
|
|
|
|
|
|
|
- for(int i=1;i<=maxDays;i++){
|
|
|
|
|
|
|
+ for (int i = 1; i <= maxDays; i++) {
|
|
|
//查找day是否有数据
|
|
//查找day是否有数据
|
|
|
String finalI = i < 10 ? "0" + String.valueOf(i) : String.valueOf(i);
|
|
String finalI = i < 10 ? "0" + String.valueOf(i) : String.valueOf(i);
|
|
|
boolean countBol = signingSources.stream().filter(x -> finalI.equals(x.getDay())).count() > 0 ? true : false;
|
|
boolean countBol = signingSources.stream().filter(x -> finalI.equals(x.getDay())).count() > 0 ? true : false;
|
|
|
- if(countBol)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (countBol) {
|
|
|
signingSourceResult.add(signingSources.stream().filter(x -> String.valueOf(finalI).equals(x.getDay())).findFirst().get());
|
|
signingSourceResult.add(signingSources.stream().filter(x -> String.valueOf(finalI).equals(x.getDay())).findFirst().get());
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
SigningSourceResultVo signingSourceResultVo = new SigningSourceResultVo();
|
|
SigningSourceResultVo signingSourceResultVo = new SigningSourceResultVo();
|
|
|
signingSourceResultVo.setDay(finalI);
|
|
signingSourceResultVo.setDay(finalI);
|
|
|
signingSourceResultVo.setYearmonth(yearMonthStr + "-" + finalI);
|
|
signingSourceResultVo.setYearmonth(yearMonthStr + "-" + finalI);
|
|
@@ -137,7 +128,7 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
|
|
|
|
|
|
|
|
|
|
//处理合计
|
|
//处理合计
|
|
|
- for(SigningSourceResultVo vo : signingSourceResult){
|
|
|
|
|
|
|
+ for (SigningSourceResultVo vo : signingSourceResult) {
|
|
|
jqPremiumTax = Float.parseFloat(vo.getJqPremiumTax()) + jqPremiumTax;
|
|
jqPremiumTax = Float.parseFloat(vo.getJqPremiumTax()) + jqPremiumTax;
|
|
|
syPremiumTax = Float.parseFloat(vo.getSyPremiumTax()) + syPremiumTax;
|
|
syPremiumTax = Float.parseFloat(vo.getSyPremiumTax()) + syPremiumTax;
|
|
|
nonCarPremiumTax = Float.parseFloat(vo.getNonCarPremiumTax()) + nonCarPremiumTax;
|
|
nonCarPremiumTax = Float.parseFloat(vo.getNonCarPremiumTax()) + nonCarPremiumTax;
|
|
@@ -174,11 +165,12 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
String[] next12MonthsDates = getNext12MonthsDates(yearMonth);
|
|
String[] next12MonthsDates = getNext12MonthsDates(yearMonth);
|
|
|
int maxDays = yearMonth.lengthOfMonth();
|
|
int maxDays = yearMonth.lengthOfMonth();
|
|
|
//获取签单数据
|
|
//获取签单数据
|
|
|
- List<SigningSourceResultVo> signingSources = invReceivableMapper.getSigningSourceDayResult(yearMonthStr + "-01", yearMonthStr + "-" + maxDays,insuranceId);
|
|
|
|
|
|
|
+ List<SigningSourceResultVo> signingSources = invReceivableMapper.getSigningSourceDayResult(yearMonthStr + "-01", yearMonthStr +
|
|
|
|
|
+ "-" + maxDays, insuranceId);
|
|
|
//转换类型
|
|
//转换类型
|
|
|
List<SettlementSourceResultVo> settlementSourcesTmp = new ArrayList<>();
|
|
List<SettlementSourceResultVo> settlementSourcesTmp = new ArrayList<>();
|
|
|
List<SettlementSourceResultVo> settlementSources = new ArrayList<>();
|
|
List<SettlementSourceResultVo> settlementSources = new ArrayList<>();
|
|
|
- signingSources.forEach(signing->{
|
|
|
|
|
|
|
+ signingSources.forEach(signing -> {
|
|
|
SettlementSourceResultVo settlementSourceResultVo = new SettlementSourceResultVo();
|
|
SettlementSourceResultVo settlementSourceResultVo = new SettlementSourceResultVo();
|
|
|
settlementSourceResultVo.setDay(signing.getDay());
|
|
settlementSourceResultVo.setDay(signing.getDay());
|
|
|
settlementSourceResultVo.setSignDate(signing.getYearmonth());
|
|
settlementSourceResultVo.setSignDate(signing.getYearmonth());
|
|
@@ -188,47 +180,44 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
settlementSourcesTmp.add(settlementSourceResultVo);
|
|
settlementSourcesTmp.add(settlementSourceResultVo);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- for(int i=1;i<=maxDays;i++)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ for (int i = 1; i <= maxDays; i++) {
|
|
|
//查找day是否有数据
|
|
//查找day是否有数据
|
|
|
String finalI = i < 10 ? "0" + String.valueOf(i) : String.valueOf(i);
|
|
String finalI = i < 10 ? "0" + String.valueOf(i) : String.valueOf(i);
|
|
|
boolean countBol = settlementSourcesTmp.stream().filter(x -> finalI.equals(x.getDay())).count() > 0 ? true : false;
|
|
boolean countBol = settlementSourcesTmp.stream().filter(x -> finalI.equals(x.getDay())).count() > 0 ? true : false;
|
|
|
- if(!countBol)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (!countBol) {
|
|
|
SettlementSourceResultVo settlementSourceResultVo = new SettlementSourceResultVo();
|
|
SettlementSourceResultVo settlementSourceResultVo = new SettlementSourceResultVo();
|
|
|
settlementSourceResultVo.setDay(finalI);
|
|
settlementSourceResultVo.setDay(finalI);
|
|
|
settlementSourceResultVo.setSignDate(yearMonthStr + "-" + finalI);
|
|
settlementSourceResultVo.setSignDate(yearMonthStr + "-" + finalI);
|
|
|
settlementSources.add(settlementSourceResultVo);
|
|
settlementSources.add(settlementSourceResultVo);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
settlementSources.add(settlementSourcesTmp.stream().filter(x -> finalI.equals(x.getDay())).findFirst().get());
|
|
settlementSources.add(settlementSourcesTmp.stream().filter(x -> finalI.equals(x.getDay())).findFirst().get());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int year = yearMonth.getYear();
|
|
int year = yearMonth.getYear();
|
|
|
//遍历结算数据
|
|
//遍历结算数据
|
|
|
- settlementSources.forEach(signing->{
|
|
|
|
|
|
|
+ settlementSources.forEach(signing -> {
|
|
|
// String startTime = String.valueOf(year) + "-01-01";
|
|
// String startTime = String.valueOf(year) + "-01-01";
|
|
|
// String endTime = String.valueOf(year) + "-12-31";
|
|
// String endTime = String.valueOf(year) + "-12-31";
|
|
|
String startTime = next12MonthsDates[0] + "-01";
|
|
String startTime = next12MonthsDates[0] + "-01";
|
|
|
int day = YearMonth.parse(next12MonthsDates[11], formatter).lengthOfMonth();
|
|
int day = YearMonth.parse(next12MonthsDates[11], formatter).lengthOfMonth();
|
|
|
String endTime = next12MonthsDates[11] + "-" + day;
|
|
String endTime = next12MonthsDates[11] + "-" + day;
|
|
|
List<SettlementSourceDataVo> settlementSourceResultTmp =
|
|
List<SettlementSourceDataVo> settlementSourceResultTmp =
|
|
|
- invReceivableMapper.getSettlementSourceResult(signing.getSignDate(),startTime, endTime, insuranceId);
|
|
|
|
|
|
|
+ invReceivableMapper.getSettlementSourceResult(signing.getSignDate(), startTime, endTime, insuranceId);
|
|
|
List<SettlementSourceDataVo> settlementSourceResult = new ArrayList<>();
|
|
List<SettlementSourceDataVo> settlementSourceResult = new ArrayList<>();
|
|
|
System.out.printf("1");
|
|
System.out.printf("1");
|
|
|
//补齐数据
|
|
//补齐数据
|
|
|
- for(int i=0;i<12;i++)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ for (int i = 0; i < 12; i++) {
|
|
|
//查找day是否有数据
|
|
//查找day是否有数据
|
|
|
String month = next12MonthsDates[i];
|
|
String month = next12MonthsDates[i];
|
|
|
- boolean countBol = settlementSourceResultTmp.stream().filter(x -> month.equals(x.getSettlementDate())).count() > 0 ? true : false;
|
|
|
|
|
- if(!countBol)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ boolean countBol = settlementSourceResultTmp.stream().filter(x -> month.equals(x.getSettlementDate())).count() > 0 ?
|
|
|
|
|
+ true : false;
|
|
|
|
|
+ if (!countBol) {
|
|
|
SettlementSourceDataVo settlementSourceData = new SettlementSourceDataVo();
|
|
SettlementSourceDataVo settlementSourceData = new SettlementSourceDataVo();
|
|
|
settlementSourceData.setDay(month);
|
|
settlementSourceData.setDay(month);
|
|
|
settlementSourceData.setSettlementDate(next12MonthsDates[i]);
|
|
settlementSourceData.setSettlementDate(next12MonthsDates[i]);
|
|
|
settlementSourceResult.add(settlementSourceData);
|
|
settlementSourceResult.add(settlementSourceData);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
settlementSourceResult.add(settlementSourceResultTmp.stream().filter(x -> month.equals(x.getSettlementDate())).findFirst().get());
|
|
settlementSourceResult.add(settlementSourceResultTmp.stream().filter(x -> month.equals(x.getSettlementDate())).findFirst().get());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -237,12 +226,12 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
|
|
|
|
|
|
|
|
|
|
//计算每个日期的签单保费 和代理人佣金
|
|
//计算每个日期的签单保费 和代理人佣金
|
|
|
- settlementSources.forEach(settlementSource->{
|
|
|
|
|
|
|
+ settlementSources.forEach(settlementSource -> {
|
|
|
int length = settlementSource.getSettlementData().size();
|
|
int length = settlementSource.getSettlementData().size();
|
|
|
BigDecimal settlementPremium = new BigDecimal(0);
|
|
BigDecimal settlementPremium = new BigDecimal(0);
|
|
|
BigDecimal agentCommission = new BigDecimal(0);
|
|
BigDecimal agentCommission = new BigDecimal(0);
|
|
|
//横向计算
|
|
//横向计算
|
|
|
- for(int i=0;i<length;i++){
|
|
|
|
|
|
|
+ for (int i = 0; i < length; i++) {
|
|
|
SettlementSourceDataVo settlementSourceData = settlementSource.getSettlementData().get(i);
|
|
SettlementSourceDataVo settlementSourceData = settlementSource.getSettlementData().get(i);
|
|
|
settlementPremium = settlementPremium.add(settlementSourceData.getSettlementPremium());
|
|
settlementPremium = settlementPremium.add(settlementSourceData.getSettlementPremium());
|
|
|
agentCommission = agentCommission.add(settlementSourceData.getAgentCommission());
|
|
agentCommission = agentCommission.add(settlementSourceData.getAgentCommission());
|
|
@@ -260,7 +249,7 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
// 计算每个日期的签单保费 和代理人佣金 竖向计算
|
|
// 计算每个日期的签单保费 和代理人佣金 竖向计算
|
|
|
List<SettlementSourceDataVo> settlementSourceDataSum = new ArrayList<>();
|
|
List<SettlementSourceDataVo> settlementSourceDataSum = new ArrayList<>();
|
|
|
|
|
|
|
|
- for(int i=0;i<12;i++){
|
|
|
|
|
|
|
+ for (int i = 0; i < 12; i++) {
|
|
|
//提取每个月的数据
|
|
//提取每个月的数据
|
|
|
// String finalI = i < 10 ? "0" + String.valueOf(i) : String.valueOf(i);
|
|
// String finalI = i < 10 ? "0" + String.valueOf(i) : String.valueOf(i);
|
|
|
String month = next12MonthsDates[i];
|
|
String month = next12MonthsDates[i];
|
|
@@ -269,11 +258,11 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
BigDecimal settlementPremium = new BigDecimal(0);
|
|
BigDecimal settlementPremium = new BigDecimal(0);
|
|
|
BigDecimal agentCommission = new BigDecimal(0);
|
|
BigDecimal agentCommission = new BigDecimal(0);
|
|
|
|
|
|
|
|
- for(int j=0;j<settlementSources.size();j++){
|
|
|
|
|
|
|
+ for (int j = 0; j < settlementSources.size(); j++) {
|
|
|
|
|
|
|
|
- List<SettlementSourceDataVo> collect = settlementSources.get(j).getSettlementData().stream().filter(x -> x.getSettlementDate() != null && x.getSettlementDate().equals(month)).collect(Collectors.toList());
|
|
|
|
|
- for(int k=0;k<collect.size();k++)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ List<SettlementSourceDataVo> collect =
|
|
|
|
|
+ settlementSources.get(j).getSettlementData().stream().filter(x -> x.getSettlementDate() != null && x.getSettlementDate().equals(month)).collect(Collectors.toList());
|
|
|
|
|
+ for (int k = 0; k < collect.size(); k++) {
|
|
|
settlementPremium = settlementPremium.add(collect.get(k).getAgentCommission());
|
|
settlementPremium = settlementPremium.add(collect.get(k).getAgentCommission());
|
|
|
agentCommission = agentCommission.add(collect.get(k).getAgentCommission());
|
|
agentCommission = agentCommission.add(collect.get(k).getAgentCommission());
|
|
|
}
|
|
}
|
|
@@ -287,7 +276,8 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
|
|
|
|
|
//未结算签单保费 与 已结算利润计算
|
|
//未结算签单保费 与 已结算利润计算
|
|
|
settlementSources.forEach(settlementSource -> {
|
|
settlementSources.forEach(settlementSource -> {
|
|
|
- SettlementSourceDataVo settlementSourceDataVo = settlementSource.getSettlementData().stream().filter(x -> !"合计".equals(x.getSettlementDate())).findFirst().get();
|
|
|
|
|
|
|
+ SettlementSourceDataVo settlementSourceDataVo =
|
|
|
|
|
+ settlementSource.getSettlementData().stream().filter(x -> !"合计".equals(x.getSettlementDate())).findFirst().get();
|
|
|
settlementSource.setUnCalculatedAmount(settlementSource.getSignPremium().subtract(settlementSourceDataVo.getSettlementPremium()));
|
|
settlementSource.setUnCalculatedAmount(settlementSource.getSignPremium().subtract(settlementSourceDataVo.getSettlementPremium()));
|
|
|
settlementSource.setSettledProfit(settlementSource.getSignReceivableAmount().subtract(settlementSourceDataVo.getAgentCommission()));
|
|
settlementSource.setSettledProfit(settlementSource.getSignReceivableAmount().subtract(settlementSourceDataVo.getAgentCommission()));
|
|
|
});
|
|
});
|
|
@@ -295,25 +285,29 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
//计算代理人佣金
|
|
//计算代理人佣金
|
|
|
List<HashMap> maxReceivable = invReceivableMapper.getMaxReceivable(yearMonthStr + "-01", yearMonthStr + "-" + maxDays);
|
|
List<HashMap> maxReceivable = invReceivableMapper.getMaxReceivable(yearMonthStr + "-01", yearMonthStr + "-" + maxDays);
|
|
|
settlementSources.forEach(settlementSource -> {
|
|
settlementSources.forEach(settlementSource -> {
|
|
|
- Boolean b = maxReceivable.stream().filter(x -> settlementSource.getSignDate().equals(x.get("yeatmonth"))).findFirst().isPresent();
|
|
|
|
|
- if(!b)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ Boolean b =
|
|
|
|
|
+ maxReceivable.stream().filter(x -> settlementSource.getSignDate().equals(x.get("yeatmonth"))).findFirst().isPresent();
|
|
|
|
|
+ if (!b) {
|
|
|
settlementSource.setAgentAmount(new BigDecimal(0));
|
|
settlementSource.setAgentAmount(new BigDecimal(0));
|
|
|
- }else{
|
|
|
|
|
- HashMap max = maxReceivable.stream().filter(x -> settlementSource.getSignDate().equals(x.get("yeatmonth"))).findFirst().get();
|
|
|
|
|
- SettlementSourceDataVo settlementSourceDataVo = settlementSource.getSettlementData().get(settlementSource.getSettlementData().size() - 1);
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ HashMap max =
|
|
|
|
|
+ maxReceivable.stream().filter(x -> settlementSource.getSignDate().equals(x.get("yeatmonth"))).findFirst().get();
|
|
|
|
|
+ SettlementSourceDataVo settlementSourceDataVo =
|
|
|
|
|
+ settlementSource.getSettlementData().get(settlementSource.getSettlementData().size() - 1);
|
|
|
settlementSource.setAgentAmount(new BigDecimal(max.get("receivable").toString()).subtract(settlementSourceDataVo.getAgentCommission()));
|
|
settlementSource.setAgentAmount(new BigDecimal(max.get("receivable").toString()).subtract(settlementSourceDataVo.getAgentCommission()));
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
//计算未结算利润测算
|
|
//计算未结算利润测算
|
|
|
- List<HashMap> unsettledProfitCalculation = invReceivableMapper.getUnsettledProfitCalculation(yearMonthStr + "-01", yearMonthStr + "-" + maxDays);
|
|
|
|
|
|
|
+ List<HashMap> unsettledProfitCalculation = invReceivableMapper.getUnsettledProfitCalculation(yearMonthStr + "-01",
|
|
|
|
|
+ yearMonthStr + "-" + maxDays);
|
|
|
settlementSources.forEach(settlementSource -> {
|
|
settlementSources.forEach(settlementSource -> {
|
|
|
- Boolean b = unsettledProfitCalculation.stream().filter(x -> settlementSource.getSignDate().equals(x.get("yeatmonth"))).findFirst().isPresent();
|
|
|
|
|
- if(!b)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ Boolean b =
|
|
|
|
|
+ unsettledProfitCalculation.stream().filter(x -> settlementSource.getSignDate().equals(x.get("yeatmonth"))).findFirst().isPresent();
|
|
|
|
|
+ if (!b) {
|
|
|
settlementSource.setUnsettledProfitCalculation(new BigDecimal(0));
|
|
settlementSource.setUnsettledProfitCalculation(new BigDecimal(0));
|
|
|
- }else{
|
|
|
|
|
- HashMap max = unsettledProfitCalculation.stream().filter(x -> settlementSource.getSignDate().equals(x.get("yeatmonth"))).findFirst().get();
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ HashMap max =
|
|
|
|
|
+ unsettledProfitCalculation.stream().filter(x -> settlementSource.getSignDate().equals(x.get("yeatmonth"))).findFirst().get();
|
|
|
settlementSource.setUnsettledProfitCalculation(new BigDecimal(max.get("unsettled_profit_calculation").toString()));
|
|
settlementSource.setUnsettledProfitCalculation(new BigDecimal(max.get("unsettled_profit_calculation").toString()));
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -338,7 +332,6 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//合计
|
|
//合计
|
|
|
SettlementSourceResultVo settlementSourceResultVo = new SettlementSourceResultVo();
|
|
SettlementSourceResultVo settlementSourceResultVo = new SettlementSourceResultVo();
|
|
|
settlementSourceResultVo.setSignDate("合计");
|
|
settlementSourceResultVo.setSignDate("合计");
|
|
@@ -359,14 +352,12 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
pageRequest.setPageNum(invSourceQueryVo.getPageNum());
|
|
pageRequest.setPageNum(invSourceQueryVo.getPageNum());
|
|
|
pageRequest.setPageSize(invSourceQueryVo.getPageSize());
|
|
pageRequest.setPageSize(invSourceQueryVo.getPageSize());
|
|
|
Page page = PageRequest.buildPageRequest(pageRequest);
|
|
Page page = PageRequest.buildPageRequest(pageRequest);
|
|
|
- if(invSourceQueryVo.getSigningTime() != null && !"".equals(invSourceQueryVo.getSigningTime()))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (invSourceQueryVo.getSigningTime() != null && !"".equals(invSourceQueryVo.getSigningTime())) {
|
|
|
String[] split = invSourceQueryVo.getSigningTime().split(",");
|
|
String[] split = invSourceQueryVo.getSigningTime().split(",");
|
|
|
invSourceQueryVo.setSigningTimeStartTime(split[0]);
|
|
invSourceQueryVo.setSigningTimeStartTime(split[0]);
|
|
|
invSourceQueryVo.setSigningTimeEndTime(split[1]);
|
|
invSourceQueryVo.setSigningTimeEndTime(split[1]);
|
|
|
}
|
|
}
|
|
|
- if(invSourceQueryVo.getClearingTime() != null && !"".equals(invSourceQueryVo.getClearingTime()))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (invSourceQueryVo.getClearingTime() != null && !"".equals(invSourceQueryVo.getClearingTime())) {
|
|
|
String[] split1 = invSourceQueryVo.getClearingTime().split(",");
|
|
String[] split1 = invSourceQueryVo.getClearingTime().split(",");
|
|
|
invSourceQueryVo.setClearingTimeStartTime(split1[0]);
|
|
invSourceQueryVo.setClearingTimeStartTime(split1[0]);
|
|
|
invSourceQueryVo.setClearingTimeEndTime(split1[1]);
|
|
invSourceQueryVo.setClearingTimeEndTime(split1[1]);
|
|
@@ -375,7 +366,7 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
|
|
|
|
|
Page<InvSource> pageData = invSourceMapper.getRecivablePage(page, invSourceQueryVo);
|
|
Page<InvSource> pageData = invSourceMapper.getRecivablePage(page, invSourceQueryVo);
|
|
|
List<InvSource> records = pageData.getRecords();
|
|
List<InvSource> records = pageData.getRecords();
|
|
|
- records.forEach(x->{
|
|
|
|
|
|
|
+ records.forEach(x -> {
|
|
|
x.setClearingState("0".equals(x.getClearingState()) ? "未结算" : "1".equals(x.getClearingState()) ? "已结算" :
|
|
x.setClearingState("0".equals(x.getClearingState()) ? "未结算" : "1".equals(x.getClearingState()) ? "已结算" :
|
|
|
"2".equals(x.getClearingState()) ? "孤儿单" : x.getClearingState());
|
|
"2".equals(x.getClearingState()) ? "孤儿单" : x.getClearingState());
|
|
|
x.setInsuranceClearingState("0".equals(x.getInsuranceClearingState()) ? "未结算" :
|
|
x.setInsuranceClearingState("0".equals(x.getInsuranceClearingState()) ? "未结算" :
|
|
@@ -387,21 +378,19 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<InvSource> getRecivableList(InvSourceQueryVo invSourceQueryVo) {
|
|
public List<InvSource> getRecivableList(InvSourceQueryVo invSourceQueryVo) {
|
|
|
- if(invSourceQueryVo.getSigningTime() != null && !"".equals(invSourceQueryVo.getSigningTime()))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (invSourceQueryVo.getSigningTime() != null && !"".equals(invSourceQueryVo.getSigningTime())) {
|
|
|
String[] split = invSourceQueryVo.getSigningTime().split(",");
|
|
String[] split = invSourceQueryVo.getSigningTime().split(",");
|
|
|
invSourceQueryVo.setSigningTimeStartTime(split[0]);
|
|
invSourceQueryVo.setSigningTimeStartTime(split[0]);
|
|
|
invSourceQueryVo.setSigningTimeEndTime(split[1]);
|
|
invSourceQueryVo.setSigningTimeEndTime(split[1]);
|
|
|
}
|
|
}
|
|
|
- if(invSourceQueryVo.getClearingTime() != null && !"".equals(invSourceQueryVo.getClearingTime()))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (invSourceQueryVo.getClearingTime() != null && !"".equals(invSourceQueryVo.getClearingTime())) {
|
|
|
String[] split1 = invSourceQueryVo.getClearingTime().split(",");
|
|
String[] split1 = invSourceQueryVo.getClearingTime().split(",");
|
|
|
invSourceQueryVo.setClearingTimeStartTime(split1[0]);
|
|
invSourceQueryVo.setClearingTimeStartTime(split1[0]);
|
|
|
invSourceQueryVo.setClearingTimeEndTime(split1[1]);
|
|
invSourceQueryVo.setClearingTimeEndTime(split1[1]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<InvSource> pageData = invSourceMapper.getRecivableList(invSourceQueryVo);
|
|
List<InvSource> pageData = invSourceMapper.getRecivableList(invSourceQueryVo);
|
|
|
- pageData.forEach(x->{
|
|
|
|
|
|
|
+ pageData.forEach(x -> {
|
|
|
x.setClearingState("0".equals(x.getClearingState()) ? "未结算" : "1".equals(x.getClearingState()) ? "已结算" :
|
|
x.setClearingState("0".equals(x.getClearingState()) ? "未结算" : "1".equals(x.getClearingState()) ? "已结算" :
|
|
|
"2".equals(x.getClearingState()) ? "孤儿单" : x.getClearingState());
|
|
"2".equals(x.getClearingState()) ? "孤儿单" : x.getClearingState());
|
|
|
x.setInsuranceClearingState("0".equals(x.getInsuranceClearingState()) ? "未结算" :
|
|
x.setInsuranceClearingState("0".equals(x.getInsuranceClearingState()) ? "未结算" :
|
|
@@ -414,11 +403,11 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
public Boolean updateRecivable(InvSource invSource) {
|
|
public Boolean updateRecivable(InvSource invSource) {
|
|
|
BigDecimal tax = BigDecimal.valueOf(1.06);
|
|
BigDecimal tax = BigDecimal.valueOf(1.06);
|
|
|
//处理交强不含税
|
|
//处理交强不含税
|
|
|
- invSource.setJqPremium(invSource.getJqPremiumTax().divide(tax,2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
+ invSource.setJqPremium(invSource.getJqPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
//处理商业不含税
|
|
//处理商业不含税
|
|
|
- invSource.setSyPremium(invSource.getSyPremiumTax().divide(tax,2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
+ invSource.setSyPremium(invSource.getSyPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
//处理非车不含税
|
|
//处理非车不含税
|
|
|
- invSource.setNonCarPremium(invSource.getNonCarPremiumTax().divide(tax,2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
+ invSource.setNonCarPremium(invSource.getNonCarPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
|
//处理非跟单比例
|
|
//处理非跟单比例
|
|
|
invSource.setJqNonCopyingRatio(invSource.getJqReceivableRatio().subtract(invSource.getJqPremiumRatio()));
|
|
invSource.setJqNonCopyingRatio(invSource.getJqReceivableRatio().subtract(invSource.getJqPremiumRatio()));
|
|
@@ -467,44 +456,40 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
pageRequest.setPageSize(invSettlementSourceQueryVo.getPageSize());
|
|
pageRequest.setPageSize(invSettlementSourceQueryVo.getPageSize());
|
|
|
Page page = PageRequest.buildPageRequest(pageRequest);
|
|
Page page = PageRequest.buildPageRequest(pageRequest);
|
|
|
LambdaQueryWrapper<InvSettlementSource> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<InvSettlementSource> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if(invSettlementSourceQueryVo.getLicenseno() != null && !"".equals(invSettlementSourceQueryVo.getLicenseno())){
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getLicenseno,invSettlementSourceQueryVo.getLicenseno());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getLicenseno() != null && !"".equals(invSettlementSourceQueryVo.getLicenseno())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getLicenseno, invSettlementSourceQueryVo.getLicenseno());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getJqPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getJqPolicyId())){
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getJqPolicyId,invSettlementSourceQueryVo.getJqPolicyId());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getJqPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getJqPolicyId())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getJqPolicyId, invSettlementSourceQueryVo.getJqPolicyId());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getSyPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getSyPolicyId())){
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getSyPolicyId,invSettlementSourceQueryVo.getSyPolicyId());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getSyPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getSyPolicyId())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getSyPolicyId, invSettlementSourceQueryVo.getSyPolicyId());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getNonCarPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getNonCarPolicyId())){
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getNonCarPolicyId,invSettlementSourceQueryVo.getNonCarPolicyId());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getNonCarPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getNonCarPolicyId())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getNonCarPolicyId, invSettlementSourceQueryVo.getNonCarPolicyId());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getInsuranceId() != null && !"".equals(invSettlementSourceQueryVo.getInsuranceId())){
|
|
|
|
|
- queryWrapper.in(InvSettlementSource::getInsuranceId,invSettlementSourceQueryVo.getInsuranceId());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getInsuranceId() != null && !"".equals(invSettlementSourceQueryVo.getInsuranceId())) {
|
|
|
|
|
+ queryWrapper.in(InvSettlementSource::getInsuranceId, invSettlementSourceQueryVo.getInsuranceId());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getInsuranceType() != null && !"".equals(invSettlementSourceQueryVo.getInsuranceType())){
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getInsuranceType,invSettlementSourceQueryVo.getInsuranceType());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getInsuranceType() != null && !"".equals(invSettlementSourceQueryVo.getInsuranceType())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getInsuranceType, invSettlementSourceQueryVo.getInsuranceType());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getSignDate() != null && !"".equals(invSettlementSourceQueryVo.getSignDate()))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getSignDate() != null && !"".equals(invSettlementSourceQueryVo.getSignDate())) {
|
|
|
String[] split = invSettlementSourceQueryVo.getSignDate().split(",");
|
|
String[] split = invSettlementSourceQueryVo.getSignDate().split(",");
|
|
|
- queryWrapper.between(InvSettlementSource::getSignDate,split[0],split[1]);
|
|
|
|
|
|
|
+ queryWrapper.between(InvSettlementSource::getSignDate, split[0], split[1]);
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getAgencySettlementTime() != null && !"".equals(invSettlementSourceQueryVo.getAgencySettlementTime()))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getAgencySettlementTime() != null && !"".equals(invSettlementSourceQueryVo.getAgencySettlementTime())) {
|
|
|
String[] split = invSettlementSourceQueryVo.getAgencySettlementTime().split(",");
|
|
String[] split = invSettlementSourceQueryVo.getAgencySettlementTime().split(",");
|
|
|
- queryWrapper.between(InvSettlementSource::getAgencySettlementTime,split[0],split[1]);
|
|
|
|
|
|
|
+ queryWrapper.between(InvSettlementSource::getAgencySettlementTime, split[0], split[1]);
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getChannel() != null && !"".equals(invSettlementSourceQueryVo.getChannel()))
|
|
|
|
|
- {
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getChannel,invSettlementSourceQueryVo.getChannel());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getChannel() != null && !"".equals(invSettlementSourceQueryVo.getChannel())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getChannel, invSettlementSourceQueryVo.getChannel());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getChannelClassification() != null && !"".equals(invSettlementSourceQueryVo.getChannelClassification()))
|
|
|
|
|
- {
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getChannelClassification,invSettlementSourceQueryVo.getChannelClassification());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getChannelClassification() != null && !"".equals(invSettlementSourceQueryVo.getChannelClassification())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getChannelClassification, invSettlementSourceQueryVo.getChannelClassification());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getInsuredName() != null && !"".equals(invSettlementSourceQueryVo.getInsuredName())){
|
|
|
|
|
- queryWrapper.like(InvSettlementSource::getInsuredName,invSettlementSourceQueryVo.getInsuredName());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getInsuredName() != null && !"".equals(invSettlementSourceQueryVo.getInsuredName())) {
|
|
|
|
|
+ queryWrapper.like(InvSettlementSource::getInsuredName, invSettlementSourceQueryVo.getInsuredName());
|
|
|
}
|
|
}
|
|
|
Page pageData = invSettlementSourceMapper.selectPage(page, queryWrapper);
|
|
Page pageData = invSettlementSourceMapper.selectPage(page, queryWrapper);
|
|
|
|
|
|
|
@@ -514,28 +499,27 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
@Override
|
|
@Override
|
|
|
public List<InvSettlementSource> getSettlementList(InvSettlementSourceQueryVo invSettlementSourceQueryVo) {
|
|
public List<InvSettlementSource> getSettlementList(InvSettlementSourceQueryVo invSettlementSourceQueryVo) {
|
|
|
LambdaQueryWrapper<InvSettlementSource> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<InvSettlementSource> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if(invSettlementSourceQueryVo.getLicenseno() != null && !"".equals(invSettlementSourceQueryVo.getLicenseno())){
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getLicenseno,invSettlementSourceQueryVo.getLicenseno());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getLicenseno() != null && !"".equals(invSettlementSourceQueryVo.getLicenseno())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getLicenseno, invSettlementSourceQueryVo.getLicenseno());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getJqPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getJqPolicyId())){
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getJqPolicyId,invSettlementSourceQueryVo.getJqPolicyId());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getJqPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getJqPolicyId())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getJqPolicyId, invSettlementSourceQueryVo.getJqPolicyId());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getSyPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getSyPolicyId())){
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getSyPolicyId,invSettlementSourceQueryVo.getSyPolicyId());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getSyPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getSyPolicyId())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getSyPolicyId, invSettlementSourceQueryVo.getSyPolicyId());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getNonCarPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getNonCarPolicyId())){
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getNonCarPolicyId,invSettlementSourceQueryVo.getNonCarPolicyId());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getNonCarPolicyId() != null && !"".equals(invSettlementSourceQueryVo.getNonCarPolicyId())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getNonCarPolicyId, invSettlementSourceQueryVo.getNonCarPolicyId());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getInsuranceId() != null && !"".equals(invSettlementSourceQueryVo.getInsuranceId())){
|
|
|
|
|
- queryWrapper.in(InvSettlementSource::getInsuranceId,invSettlementSourceQueryVo.getInsuranceId());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getInsuranceId() != null && !"".equals(invSettlementSourceQueryVo.getInsuranceId())) {
|
|
|
|
|
+ queryWrapper.in(InvSettlementSource::getInsuranceId, invSettlementSourceQueryVo.getInsuranceId());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getInsuranceType() != null && !"".equals(invSettlementSourceQueryVo.getInsuranceType())){
|
|
|
|
|
- queryWrapper.eq(InvSettlementSource::getInsuranceType,invSettlementSourceQueryVo.getInsuranceType());
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getInsuranceType() != null && !"".equals(invSettlementSourceQueryVo.getInsuranceType())) {
|
|
|
|
|
+ queryWrapper.eq(InvSettlementSource::getInsuranceType, invSettlementSourceQueryVo.getInsuranceType());
|
|
|
}
|
|
}
|
|
|
- if(invSettlementSourceQueryVo.getSignDate() != null && !"".equals(invSettlementSourceQueryVo.getSignDate()))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (invSettlementSourceQueryVo.getSignDate() != null && !"".equals(invSettlementSourceQueryVo.getSignDate())) {
|
|
|
String[] split = invSettlementSourceQueryVo.getSignDate().split(",");
|
|
String[] split = invSettlementSourceQueryVo.getSignDate().split(",");
|
|
|
- queryWrapper.between(InvSettlementSource::getSignDate,split[0],split[1]);
|
|
|
|
|
|
|
+ queryWrapper.between(InvSettlementSource::getSignDate, split[0], split[1]);
|
|
|
}
|
|
}
|
|
|
List<InvSettlementSource> pageData = invSettlementSourceMapper.selectList(queryWrapper);
|
|
List<InvSettlementSource> pageData = invSettlementSourceMapper.selectList(queryWrapper);
|
|
|
|
|
|
|
@@ -569,19 +553,21 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
Page page = new Page();
|
|
Page page = new Page();
|
|
|
page.setCurrent(receivableAndSettlementQueryVo.getPageNum());
|
|
page.setCurrent(receivableAndSettlementQueryVo.getPageNum());
|
|
|
page.setSize(receivableAndSettlementQueryVo.getPageSize());
|
|
page.setSize(receivableAndSettlementQueryVo.getPageSize());
|
|
|
- Page<ReceivableAndSettlementVo> receivableAndSettlementPage = invReceivableMapper.getReceivableAndSettlementPage(page, receivableAndSettlementQueryVo);
|
|
|
|
|
|
|
+ Page<ReceivableAndSettlementVo> receivableAndSettlementPage = invReceivableMapper.getReceivableAndSettlementPage(page,
|
|
|
|
|
+ receivableAndSettlementQueryVo);
|
|
|
return receivableAndSettlementPage;
|
|
return receivableAndSettlementPage;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<ReceivableAndSettlementVo> getReceivableAndSettlementList(ReceivableAndSettlementQueryVo receivableAndSettlementQueryVo) {
|
|
public List<ReceivableAndSettlementVo> getReceivableAndSettlementList(ReceivableAndSettlementQueryVo receivableAndSettlementQueryVo) {
|
|
|
- List<ReceivableAndSettlementVo> receivableAndSettlementVoList = invReceivableMapper.getReceivableAndSettlementPage(receivableAndSettlementQueryVo);
|
|
|
|
|
|
|
+ List<ReceivableAndSettlementVo> receivableAndSettlementVoList =
|
|
|
|
|
+ invReceivableMapper.getReceivableAndSettlementPage(receivableAndSettlementQueryVo);
|
|
|
return receivableAndSettlementVoList;
|
|
return receivableAndSettlementVoList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Boolean deleteReceivable(String[] ids) {
|
|
public Boolean deleteReceivable(String[] ids) {
|
|
|
- return invReceivableMapper.deleteReceivable(String.join(",",ids));
|
|
|
|
|
|
|
+ return invReceivableMapper.deleteReceivable(String.join(",", ids));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -616,11 +602,11 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
invSource.builder();
|
|
invSource.builder();
|
|
|
BigDecimal tax = new BigDecimal(1.06);
|
|
BigDecimal tax = new BigDecimal(1.06);
|
|
|
//处理交强不含税
|
|
//处理交强不含税
|
|
|
- invSource.setJqPremium(invSource.getJqPremiumTax().divide(tax,2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
+ invSource.setJqPremium(invSource.getJqPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
//处理商业不含税
|
|
//处理商业不含税
|
|
|
- invSource.setSyPremium(invSource.getSyPremiumTax().divide(tax,2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
+ invSource.setSyPremium(invSource.getSyPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
//处理非车不含税
|
|
//处理非车不含税
|
|
|
- invSource.setNonCarPremium(invSource.getNonCarPremiumTax().divide(tax,2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
+ invSource.setNonCarPremium(invSource.getNonCarPremiumTax().divide(tax, 2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
|
//处理非跟单比例
|
|
//处理非跟单比例
|
|
|
invSource.setJqNonCopyingRatio(invSource.getJqReceivableRatio().subtract(invSource.getJqPremiumRatio()));
|
|
invSource.setJqNonCopyingRatio(invSource.getJqReceivableRatio().subtract(invSource.getJqPremiumRatio()));
|
|
@@ -655,7 +641,7 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
invSource.getJqPremiumTax().multiply(invSource.getMaxJqReceivableRatio())
|
|
invSource.getJqPremiumTax().multiply(invSource.getMaxJqReceivableRatio())
|
|
|
.add(invSource.getSyPremiumTax().multiply(invSource.getMaxSyReceivableRatio()))
|
|
.add(invSource.getSyPremiumTax().multiply(invSource.getMaxSyReceivableRatio()))
|
|
|
.add(invSource.getNonCarPremiumTax().multiply(invSource.getMaxNonCarReceivableRatio())));
|
|
.add(invSource.getNonCarPremiumTax().multiply(invSource.getMaxNonCarReceivableRatio())));
|
|
|
- boolean save = invSourceMapper.insert (invSource) > 0 ? true : false;
|
|
|
|
|
|
|
+ boolean save = invSourceMapper.insert(invSource) > 0 ? true : false;
|
|
|
return save;
|
|
return save;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -669,7 +655,7 @@ public class InvReceivableServiceImpl implements InvReceivableService {
|
|
|
public Boolean deleteSettlement(String[] ids) {
|
|
public Boolean deleteSettlement(String[] ids) {
|
|
|
List<String> list = Arrays.asList(ids);
|
|
List<String> list = Arrays.asList(ids);
|
|
|
int i = invSettlementSourceMapper.deleteBatchIds(list);
|
|
int i = invSettlementSourceMapper.deleteBatchIds(list);
|
|
|
- return i>0?true:false;
|
|
|
|
|
|
|
+ return i > 0 ? true : false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|