|
|
@@ -2,6 +2,7 @@ package com.jzg.organization.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
+import com.alibaba.nacos.common.utils.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -54,6 +55,7 @@ import java.util.concurrent.TimeUnit;
|
|
|
import java.util.function.BiConsumer;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
+
|
|
|
/**
|
|
|
* @author tz
|
|
|
* @description 财务应收模块Service实现
|
|
|
@@ -115,28 +117,28 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public InsPlyIncome getUnauditedOrder(ReceivableQueryVo receivableQueryVo){
|
|
|
- InsPlyIncome auditedOrder = baseMapper.getAuditedOrder(receivableQueryVo.getOrderNo(), receivableQueryVo.getQueryType(), InsOrderStatusEnum.UNDERWRITED.getCode(),receivableQueryVo.getAgreementType());
|
|
|
- if (receivableQueryVo.getQueryType().equals("3") || receivableQueryVo.getQueryType().equals("4")){
|
|
|
- if(Objects.isNull(auditedOrder.getJyPolicyNo()) && auditedOrder.getJyPolicyNo().equals("")){
|
|
|
+ public InsPlyIncome getUnauditedOrder(ReceivableQueryVo receivableQueryVo) {
|
|
|
+ InsPlyIncome auditedOrder = baseMapper.getAuditedOrder(receivableQueryVo.getOrderNo(), receivableQueryVo.getQueryType(), InsOrderStatusEnum.UNDERWRITED.getCode(), receivableQueryVo.getAgreementType());
|
|
|
+ if (receivableQueryVo.getQueryType().equals("3") || receivableQueryVo.getQueryType().equals("4")) {
|
|
|
+ if (Objects.isNull(auditedOrder.getJyPolicyNo()) && auditedOrder.getJyPolicyNo().equals("")) {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
- return baseMapper.getAuditedOrder(receivableQueryVo.getOrderNo(), InsOrderStatusEnum.UNDERWRITED.getCode(), "0",receivableQueryVo.getAgreementType());
|
|
|
+ return baseMapper.getAuditedOrder(receivableQueryVo.getOrderNo(), InsOrderStatusEnum.UNDERWRITED.getCode(), "0", receivableQueryVo.getAgreementType());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public boolean saveAuditedOrder(List<String> orderNos) {
|
|
|
|
|
|
- List<InsPlyIncome> auditedOrder = this.getUnauditOrderList(orderNos, InsOrderStatusEnum.UNDERWRITED.getCode(),"0");
|
|
|
- AssertionUtils.isEmpty(auditedOrder,"订单不存在");
|
|
|
+ List<InsPlyIncome> auditedOrder = this.getUnauditOrderList(orderNos, InsOrderStatusEnum.UNDERWRITED.getCode(), "0");
|
|
|
+ AssertionUtils.isEmpty(auditedOrder, "订单不存在");
|
|
|
// 查看当前表是否已经存在了已审核订单数据
|
|
|
// Long count = baseMapper.selectCount(new LambdaQueryWrapper<InsPlyIncome>().eq(InsPlyIncome::getOrderNo, order.getOrderNo()));
|
|
|
// // 订单已经录入成功了
|
|
|
// if (count > 0){
|
|
|
// return false;
|
|
|
// }
|
|
|
- auditedOrder.forEach(item->{
|
|
|
+ auditedOrder.forEach(item -> {
|
|
|
item.setId(IdGenerate.nextId());
|
|
|
});
|
|
|
return saveBatch(auditedOrder);
|
|
|
@@ -149,7 +151,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
|
|
|
@Override
|
|
|
public Page<InsPlyIncome> getReceivablePage(ReceivableQueryVo receivableQueryVo) {
|
|
|
- return baseMapper.getReceivablePage(receivableQueryVo.getPage(),receivableQueryVo);
|
|
|
+ return baseMapper.getReceivablePage(receivableQueryVo.getPage(), receivableQueryVo);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -163,20 +165,20 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
RKeys keys = redissonClient.getKeys();
|
|
|
Iterable<String> allKeys = null;
|
|
|
String redisKey = null;
|
|
|
- if (invoicingVo.getInvoiceType().equals("1")){
|
|
|
+ if (invoicingVo.getInvoiceType().equals("1")) {
|
|
|
redisKey = CAR_INVOICING_COMMISSION_LOCK;
|
|
|
- }else if (invoicingVo.getInvoiceType().equals("2")){
|
|
|
+ } else if (invoicingVo.getInvoiceType().equals("2")) {
|
|
|
redisKey = CAR_INVOICING_OTHER_LOCK;
|
|
|
- }else if (invoicingVo.getInvoiceType().equals("3")){
|
|
|
+ } else if (invoicingVo.getInvoiceType().equals("3")) {
|
|
|
redisKey = JY_INVOICING_COMMISSION_LOCK;
|
|
|
- }else if (invoicingVo.getInvoiceType().equals("4")){
|
|
|
+ } else if (invoicingVo.getInvoiceType().equals("4")) {
|
|
|
redisKey = JY_INVOICING_OTHER_LOCK;
|
|
|
}
|
|
|
allKeys = keys.getKeysByPattern(redisKey + "*");
|
|
|
//提取所有redis的key 然后遍历是否存在重复的id
|
|
|
for (String key : allKeys) {
|
|
|
// 过滤掉自己的redis key
|
|
|
- if (!key.equals(key+baseController.getUserName())) {
|
|
|
+ if (!key.equals(key + baseController.getUserName())) {
|
|
|
RBucket<Object> bucket = redissonClient.getBucket(key);
|
|
|
String incomeIds = bucket.get().toString();
|
|
|
incomeIds = incomeIds.substring(1, incomeIds.length() - 1);
|
|
|
@@ -188,7 +190,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (count == 0){
|
|
|
+ if (count == 0) {
|
|
|
// 设置缓存
|
|
|
RBucket<Object> bucket = redissonClient.getBucket(redisKey + baseController.getUserName());
|
|
|
bucket.set(invoicingVo.getIncomeIds(), 10, TimeUnit.MINUTES);
|
|
|
@@ -201,20 +203,20 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
public BigDecimal getReceivableAmount(InvoicingVo invoicingVo) {
|
|
|
String invoiceType = invoicingVo.getInvoiceType();
|
|
|
// 私有手续费 应收金额
|
|
|
- if(invoiceType.equals("1")){
|
|
|
- List<String> incomeIds = invoicingVo.getIncomeIds();
|
|
|
- incomeIds = incomeIds.stream()
|
|
|
+ if (invoiceType.equals("1")) {
|
|
|
+ List<String> orderNos = invoicingVo.getOrderNos();
|
|
|
+ orderNos = orderNos.stream()
|
|
|
.filter(s -> s != null && !s.trim().isEmpty())
|
|
|
.map(String::trim)
|
|
|
.distinct() // 可选,去重
|
|
|
.collect(Collectors.toList());
|
|
|
- String jqSumReceivable = baseMapper.getJqSumReceivable(incomeIds);
|
|
|
+ String jqSumReceivable = baseMapper.getJqSumReceivable(orderNos);
|
|
|
return new BigDecimal(jqSumReceivable);
|
|
|
- }else if(invoiceType.equals("2")){
|
|
|
+ } else if (invoiceType.equals("2")) {
|
|
|
|
|
|
- }else if(invoiceType.equals("3")){
|
|
|
+ } else if (invoiceType.equals("3")) {
|
|
|
|
|
|
- }else if(invoiceType.equals("4")){
|
|
|
+ } else if (invoiceType.equals("4")) {
|
|
|
|
|
|
}
|
|
|
return null;
|
|
|
@@ -222,6 +224,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
|
|
|
/**
|
|
|
* 添加发票
|
|
|
+ *
|
|
|
* @param invoicingVo
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -255,7 +258,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
result.setInvoiceId(invoice.getId());
|
|
|
result.setSumPrice(invoicingVo.getReceivablePremium().toString());
|
|
|
return result;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
// 回滚事务
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return null;
|
|
|
@@ -277,28 +280,28 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean updateIncomeSettlementStatus(String invoiceType,List<String> invoiceIds) {
|
|
|
+ public boolean updateIncomeSettlementStatus(String invoiceType, List<String> invoiceIds) {
|
|
|
long result = 0;
|
|
|
- switch(invoiceType){
|
|
|
+ switch (invoiceType) {
|
|
|
case "1":
|
|
|
result = baseMapper.update(new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
- .in(InsPlyIncome::getId,invoiceIds)
|
|
|
- .set(InsPlyIncome::getSuperviseSettlement,"1"));
|
|
|
+ .in(InsPlyIncome::getId, invoiceIds)
|
|
|
+ .set(InsPlyIncome::getSuperviseSettlement, "1"));
|
|
|
break;
|
|
|
case "2":
|
|
|
result = baseMapper.update(new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
- .in(InsPlyIncome::getId,invoiceIds)
|
|
|
- .set(InsPlyIncome::getOtherSettlement,"1"));
|
|
|
+ .in(InsPlyIncome::getId, invoiceIds)
|
|
|
+ .set(InsPlyIncome::getOtherSettlement, "1"));
|
|
|
break;
|
|
|
case "3":
|
|
|
result = baseMapper.update(new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
- .in(InsPlyIncome::getId,invoiceIds)
|
|
|
- .set(InsPlyIncome::getJySuperviseSettlement,"1"));
|
|
|
+ .in(InsPlyIncome::getId, invoiceIds)
|
|
|
+ .set(InsPlyIncome::getJySuperviseSettlement, "1"));
|
|
|
break;
|
|
|
case "4":
|
|
|
result = baseMapper.update(new LambdaUpdateWrapper<InsPlyIncome>()
|
|
|
- .in(InsPlyIncome::getId,invoiceIds)
|
|
|
- .set(InsPlyIncome::getJyOtherSettlement,"1"));
|
|
|
+ .in(InsPlyIncome::getId, invoiceIds)
|
|
|
+ .set(InsPlyIncome::getJyOtherSettlement, "1"));
|
|
|
break;
|
|
|
default:
|
|
|
result = 0;
|
|
|
@@ -328,16 +331,18 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
InsPlyIncomeInvoiceSettlement settlement = new InsPlyIncomeInvoiceSettlement(settlementVo.getInvoicingId(), settlementVo.getActualReceivedAmount().toString(), DateTime.now());
|
|
|
insPlyIncomeInvoiceSettlementMapper.insert(settlement);
|
|
|
|
|
|
- // 添加发票附件
|
|
|
- List<InsPlyIncomeInvoiceSettlementFile> files = new ArrayList<>();
|
|
|
- for (String fileId : settlementVo.getAttachmentIds()) {
|
|
|
- InsPlyIncomeInvoiceSettlementFile file = new InsPlyIncomeInvoiceSettlementFile();
|
|
|
- file.setId(IdGenerate.nextId());
|
|
|
- file.setSettlementId(settlement.getId());
|
|
|
- file.setFileId(fileId);
|
|
|
- files.add(file);
|
|
|
+ if (CollectionUtils.isNotEmpty(settlementVo.getAttachmentIds())) {
|
|
|
+ // 添加发票附件
|
|
|
+ List<InsPlyIncomeInvoiceSettlementFile> files = new ArrayList<>();
|
|
|
+ for (String fileId : settlementVo.getAttachmentIds()) {
|
|
|
+ InsPlyIncomeInvoiceSettlementFile file = new InsPlyIncomeInvoiceSettlementFile();
|
|
|
+ file.setId(IdGenerate.nextId());
|
|
|
+ file.setSettlementId(settlement.getId());
|
|
|
+ file.setFileId(fileId);
|
|
|
+ files.add(file);
|
|
|
+ }
|
|
|
+ insPlyIncomeInvoiceSettlementFileMapper.insert(files);
|
|
|
}
|
|
|
- insPlyIncomeInvoiceSettlementFileMapper.insert(files);
|
|
|
|
|
|
// 判断是否已经结算完成
|
|
|
if (surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) == 0) {
|
|
|
@@ -357,7 +362,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
- }catch(Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return false;
|
|
|
}
|
|
|
@@ -420,21 +425,21 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
ImportExcelResultVo importExcelResultVo = new ImportExcelResultVo();
|
|
|
|
|
|
List<SuperviseExcelVo> superviseExcelVos = importSuperviseExcel(file);
|
|
|
- AssertionUtils.isEmpty(superviseExcelVos,"数据处理失败,导入失败");
|
|
|
+ AssertionUtils.isEmpty(superviseExcelVos, "数据处理失败,导入失败");
|
|
|
|
|
|
// 获取保司名称
|
|
|
HttpResult<List<EsmInsCompany>> listHttpResult = esmInsCompanyClient.liveCompanyList();
|
|
|
- AssertionUtils.isFail(listHttpResult.getCode() != 200,listHttpResult.getMsg());
|
|
|
+ AssertionUtils.isFail(listHttpResult.getCode() != 200, listHttpResult.getMsg());
|
|
|
List<EsmInsCompany> esmInsCompanies = listHttpResult.getData();
|
|
|
|
|
|
int failedNumber = 0;
|
|
|
List<Object> failedExcel = new ArrayList<>();
|
|
|
List<InsPlyIncome> successExcel = new ArrayList<>();
|
|
|
// 处理数据
|
|
|
- for(SuperviseExcelVo vo : superviseExcelVos){
|
|
|
+ for (SuperviseExcelVo vo : superviseExcelVos) {
|
|
|
// 出现空数据则失败
|
|
|
ImportResultVo resultVo = vo.checkEmpty();
|
|
|
- if(!resultVo.isSuccess()) {
|
|
|
+ if (!resultVo.isSuccess()) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage(resultVo.getMessage());
|
|
|
failedExcel.add(vo);
|
|
|
@@ -444,7 +449,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
//匹配协议号
|
|
|
PtlAgreement ptlAgreement = ptlAgreementMapper.selectOne(new LambdaQueryWrapper<PtlAgreement>()
|
|
|
.eq(PtlAgreement::getAgreementCode, vo.getAgreementCode()));
|
|
|
- if (Objects.isNull(ptlAgreement)){
|
|
|
+ if (Objects.isNull(ptlAgreement)) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("匹配协议编号失败");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -455,7 +460,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
try {
|
|
|
// 解析签单时间
|
|
|
signDate = LocalDateTime.parse(vo.getSignDate(), DateTimeFormatter.ofPattern("yyyy-M-d H:m:s"));
|
|
|
- }catch (DateTimeParseException e){
|
|
|
+ } catch (DateTimeParseException e) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("解析签单时间失败");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -465,10 +470,10 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
|
|
|
//匹配保司名称
|
|
|
EsmInsCompany matchCompany = esmInsCompanies.stream()
|
|
|
- .filter(x -> Objects.equals(x.getName(), vo.getInsuranceCompany()))
|
|
|
- .findFirst().orElse(null);
|
|
|
+ .filter(x -> Objects.equals(x.getName(), vo.getInsuranceCompany()))
|
|
|
+ .findFirst().orElse(null);
|
|
|
// 保司匹配失败
|
|
|
- if (Objects.isNull(matchCompany)){
|
|
|
+ if (Objects.isNull(matchCompany)) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("匹配保司名称失败");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -478,7 +483,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
// 检测是否有重复的保单号
|
|
|
InsPlyIncome checkInsPlyIncome = baseMapper.selectOne(new LambdaQueryWrapper<InsPlyIncome>()
|
|
|
.eq(InsPlyIncome::getJqPolicyNo, vo.getJqPolicyNo()));
|
|
|
- if(!Objects.isNull(checkInsPlyIncome)){
|
|
|
+ if (!Objects.isNull(checkInsPlyIncome)) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("交强保单号重复");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -514,21 +519,21 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
ImportExcelResultVo importExcelResultVo = new ImportExcelResultVo();
|
|
|
|
|
|
List<OtherExcelVo> otherExcelVos = importOtherExcel(file);
|
|
|
- AssertionUtils.isEmpty(otherExcelVos,"数据处理失败,导入失败");
|
|
|
+ AssertionUtils.isEmpty(otherExcelVos, "数据处理失败,导入失败");
|
|
|
|
|
|
// 获取保司名称
|
|
|
HttpResult<List<EsmInsCompany>> listHttpResult = esmInsCompanyClient.liveCompanyList();
|
|
|
- AssertionUtils.isFail(listHttpResult.getCode() != 200,listHttpResult.getMsg());
|
|
|
+ AssertionUtils.isFail(listHttpResult.getCode() != 200, listHttpResult.getMsg());
|
|
|
List<EsmInsCompany> esmInsCompanies = listHttpResult.getData();
|
|
|
|
|
|
int failedNumber = 0;
|
|
|
List<Object> failedExcel = new ArrayList<>();
|
|
|
List<InsPlyIncome> successExcel = new ArrayList<>();
|
|
|
// 处理数据
|
|
|
- for(OtherExcelVo vo : otherExcelVos){
|
|
|
+ for (OtherExcelVo vo : otherExcelVos) {
|
|
|
// 出现空数据则失败
|
|
|
ImportResultVo resultVo = vo.checkEmpty();
|
|
|
- if(!resultVo.isSuccess()) {
|
|
|
+ if (!resultVo.isSuccess()) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage(resultVo.getMessage());
|
|
|
failedExcel.add(vo);
|
|
|
@@ -538,7 +543,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
//匹配协议号
|
|
|
PtlAgreement ptlAgreement = ptlAgreementMapper.selectOne(new LambdaQueryWrapper<PtlAgreement>()
|
|
|
.eq(PtlAgreement::getAgreementCode, vo.getAgreementCode()));
|
|
|
- if (Objects.isNull(ptlAgreement)){
|
|
|
+ if (Objects.isNull(ptlAgreement)) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("匹配协议编号失败");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -549,7 +554,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
try {
|
|
|
// 解析签单时间
|
|
|
signDate = LocalDateTime.parse(vo.getSignDate(), DateTimeFormatter.ofPattern("yyyy-M-d H:m:s"));
|
|
|
- }catch (DateTimeParseException e){
|
|
|
+ } catch (DateTimeParseException e) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("解析签单时间失败");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -562,7 +567,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
.filter(x -> Objects.equals(x.getName(), vo.getInsuranceCompany()))
|
|
|
.findFirst().orElse(null);
|
|
|
// 保司匹配失败
|
|
|
- if (Objects.isNull(matchCompany)){
|
|
|
+ if (Objects.isNull(matchCompany)) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("匹配保司名称失败");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -572,7 +577,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
// 检测是否有重复的保单号
|
|
|
InsPlyIncome checkInsPlyIncome = baseMapper.selectOne(new LambdaQueryWrapper<InsPlyIncome>()
|
|
|
.eq(InsPlyIncome::getJqPolicyNo, vo.getJqPolicyNo()));
|
|
|
- if(!Objects.isNull(checkInsPlyIncome)){
|
|
|
+ if (!Objects.isNull(checkInsPlyIncome)) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("车险保单号重复");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -607,21 +612,21 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
ImportExcelResultVo importExcelResultVo = new ImportExcelResultVo();
|
|
|
|
|
|
List<JyExcelVo> jyExcelVos = importJyExcel(file);
|
|
|
- AssertionUtils.isEmpty(jyExcelVos,"数据处理失败,导入失败");
|
|
|
+ AssertionUtils.isEmpty(jyExcelVos, "数据处理失败,导入失败");
|
|
|
|
|
|
// 获取保司名称
|
|
|
HttpResult<List<EsmInsCompany>> listHttpResult = esmInsCompanyClient.liveCompanyList();
|
|
|
- AssertionUtils.isFail(listHttpResult.getCode() != 200,listHttpResult.getMsg());
|
|
|
+ AssertionUtils.isFail(listHttpResult.getCode() != 200, listHttpResult.getMsg());
|
|
|
List<EsmInsCompany> esmInsCompanies = listHttpResult.getData();
|
|
|
|
|
|
int failedNumber = 0;
|
|
|
List<Object> failedExcel = new ArrayList<>();
|
|
|
List<InsPlyIncome> successExcel = new ArrayList<>();
|
|
|
// 处理数据
|
|
|
- for(JyExcelVo vo : jyExcelVos){
|
|
|
+ for (JyExcelVo vo : jyExcelVos) {
|
|
|
// 出现空数据则失败
|
|
|
ImportResultVo resultVo = vo.checkEmpty();
|
|
|
- if(!resultVo.isSuccess()) {
|
|
|
+ if (!resultVo.isSuccess()) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage(resultVo.getMessage());
|
|
|
failedExcel.add(vo);
|
|
|
@@ -631,7 +636,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
//匹配协议号
|
|
|
PtlAgreement ptlAgreement = ptlAgreementMapper.selectOne(new LambdaQueryWrapper<PtlAgreement>()
|
|
|
.eq(PtlAgreement::getAgreementCode, vo.getAgreementCode()));
|
|
|
- if (Objects.isNull(ptlAgreement)){
|
|
|
+ if (Objects.isNull(ptlAgreement)) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("匹配协议编号失败");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -642,7 +647,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
try {
|
|
|
// 解析签单时间
|
|
|
signDate = LocalDateTime.parse(vo.getSignDate(), DateTimeFormatter.ofPattern("yyyy-M-d H:m:s"));
|
|
|
- }catch (DateTimeParseException e){
|
|
|
+ } catch (DateTimeParseException e) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("解析签单时间失败");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -655,7 +660,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
.filter(x -> Objects.equals(x.getName(), vo.getInsuranceCompany()))
|
|
|
.findFirst().orElse(null);
|
|
|
// 保司匹配失败
|
|
|
- if (Objects.isNull(matchCompany)){
|
|
|
+ if (Objects.isNull(matchCompany)) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("匹配保司名称失败");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -665,7 +670,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
// 检测是否有重复的保单号
|
|
|
InsPlyIncome checkInsPlyIncome = baseMapper.selectOne(new LambdaQueryWrapper<InsPlyIncome>()
|
|
|
.eq(InsPlyIncome::getJyPolicyNo, vo.getJyPolicyNo()));
|
|
|
- if(!Objects.isNull(checkInsPlyIncome)){
|
|
|
+ if (!Objects.isNull(checkInsPlyIncome)) {
|
|
|
failedNumber++;
|
|
|
vo.setErrorMessage("驾意保单号重复");
|
|
|
failedExcel.add(vo);
|
|
|
@@ -701,11 +706,11 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
public boolean batchModify(BatchModifyVo batchModifyVo) {
|
|
|
List<InsPlyIncome> updateInsPlyIncome = new ArrayList<>();
|
|
|
|
|
|
- for (String incomeId : batchModifyVo.getIncomeIds()){
|
|
|
+ for (String incomeId : batchModifyVo.getIncomeIds()) {
|
|
|
InsPlyIncome insPlyIncome = baseMapper.selectById(incomeId);
|
|
|
- if (Objects.nonNull(insPlyIncome)){
|
|
|
+ if (Objects.nonNull(insPlyIncome)) {
|
|
|
if (Objects.nonNull(batchModifyVo.getJqSuperviseCostsProportion()) && batchModifyVo.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- BigDecimal superviseReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJqPremium()),batchModifyVo.getJqSuperviseCostsProportion());
|
|
|
+ BigDecimal superviseReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJqPremium()), batchModifyVo.getJqSuperviseCostsProportion());
|
|
|
insPlyIncome.setJqSuperviseCostsPremiums(superviseReceivablePremium.toString());
|
|
|
}
|
|
|
if (Objects.nonNull(batchModifyVo.getSySuperviseCostsProportion()) && batchModifyVo.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
@@ -714,7 +719,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
|
|
|
if (Objects.nonNull(batchModifyVo.getJqOtherCostsProportion()) && batchModifyVo.getJqOtherCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- BigDecimal otherReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJqPremium()),batchModifyVo.getJqOtherCostsProportion());
|
|
|
+ BigDecimal otherReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJqPremium()), batchModifyVo.getJqOtherCostsProportion());
|
|
|
insPlyIncome.setJqOtherCostsPremiums(otherReceivablePremium.toString());
|
|
|
}
|
|
|
if (Objects.nonNull(batchModifyVo.getSyOtherCostsProportion()) && batchModifyVo.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
@@ -723,7 +728,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
|
|
|
if (Objects.nonNull(batchModifyVo.getJySuperviseCostsProportion()) && batchModifyVo.getJySuperviseCostsProportion().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- BigDecimal jySuperviseReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJyPremium()),batchModifyVo.getJySuperviseCostsProportion());
|
|
|
+ BigDecimal jySuperviseReceivablePremium = calcReceivableAmount(new BigDecimal(insPlyIncome.getJyPremium()), batchModifyVo.getJySuperviseCostsProportion());
|
|
|
insPlyIncome.setJySuperviseCostsPremiums(jySuperviseReceivablePremium.toString());
|
|
|
}
|
|
|
if (Objects.nonNull(batchModifyVo.getJySuperviseCostsProportion()) && batchModifyVo.getJySuperviseCostsProportion().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
@@ -757,25 +762,25 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public BigDecimal calcReceivableAmount(BigDecimal premium,BigDecimal ratio) {
|
|
|
+ public BigDecimal calcReceivableAmount(BigDecimal premium, BigDecimal ratio) {
|
|
|
return premium.multiply(ratio);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Page<InsPlyIncome> getPlatFormReceivableList(ReceivableQueryVo receivableQueryVo) {
|
|
|
- Page<InsPlyIncome> page = baseMapper.getReceivablePage(receivableQueryVo.getPage(),receivableQueryVo);
|
|
|
+ Page<InsPlyIncome> page = baseMapper.getReceivablePage(receivableQueryVo.getPage(), receivableQueryVo);
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Page<InvoiceRecordResult> getInvoiceRecordList(InvoiceRecordQueryVo invoiceRecordQueryVo) {
|
|
|
- return baseMapper.getInvoiceRecordList(invoiceRecordQueryVo.getPage(),invoiceRecordQueryVo);
|
|
|
+ return baseMapper.getInvoiceRecordList(invoiceRecordQueryVo.getPage(), invoiceRecordQueryVo);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<InsPlyIncomeInvoiceSettlement> getInvoiceRecordDetail(String id) {
|
|
|
List<InsPlyIncomeInvoiceSettlement> insPlyIncomeInvoiceSettlements = insPlyIncomeInvoiceSettlementMapper.selectList(new LambdaQueryWrapper<InsPlyIncomeInvoiceSettlement>().eq(InsPlyIncomeInvoiceSettlement::getInvoiceId, id));
|
|
|
- return insPlyIncomeInvoiceSettlements;
|
|
|
+ return insPlyIncomeInvoiceSettlements;
|
|
|
}
|
|
|
|
|
|
private void verifyUploadPath() throws IOException {
|
|
|
@@ -788,6 +793,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
|
|
|
/**
|
|
|
* 导出应收手续费数据 (车险)
|
|
|
+ *
|
|
|
* @param receivableQueryVo
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -798,7 +804,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
List<ExportSuperviseExcelDto> dtoList = receivableList.stream()
|
|
|
.map(this::convertToDto)
|
|
|
.toList();
|
|
|
- EasyExcelUtils.exportForWeb(ServletUtils.getResponse(),ExportSuperviseExcelDto.class,dtoList, "车险手续费应收明细");
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportSuperviseExcelDto.class, dtoList, "车险手续费应收明细");
|
|
|
}
|
|
|
|
|
|
// 过滤不需要的字段
|
|
|
@@ -841,17 +847,18 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
case "3" -> dto.setEntryStatus("补录订单");
|
|
|
}
|
|
|
});
|
|
|
- EasyExcelUtils.exportForWeb(ServletUtils.getResponse(),ExportSuperviseJyExcelDto.class,exportSuperviseJyExcelDtos, "车险手续费结算明细");
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportSuperviseJyExcelDto.class, exportSuperviseJyExcelDtos, "车险手续费结算明细");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 应收手续费结算记录
|
|
|
+ *
|
|
|
* @param settlementQueryVo
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public Page<ExportSuperviseSettlementExcelDto> superviseSettlementExcel(Page page,SettlementQueryVo settlementQueryVo) {
|
|
|
- Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.superviseSettlementExcelDtos(page,settlementQueryVo);
|
|
|
+ public Page<ExportSuperviseSettlementExcelDto> superviseSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) {
|
|
|
+ Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.superviseSettlementExcelDtos(page, settlementQueryVo);
|
|
|
exportSuperviseSettlementExcelDtos.getRecords().forEach(dto -> {
|
|
|
if (dto.getInvoiceParty().equals("1")) {
|
|
|
dto.setInvoiceParty("我方开票");
|
|
|
@@ -866,7 +873,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
SysUploadFiles file = sysUploadFilesMapper.selectById(dto.getFileId());
|
|
|
if (file != null) {
|
|
|
- dto.setFileUrl(MinioUtils.getPresignedObjectUrl("jzg",file.getFileName()));
|
|
|
+ dto.setFileUrl(MinioUtils.getPresignedObjectUrl("jzg", file.getFileName()));
|
|
|
}
|
|
|
});
|
|
|
return exportSuperviseSettlementExcelDtos;
|
|
|
@@ -874,12 +881,13 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
|
|
|
/**
|
|
|
* 导出应收手续费结算记录
|
|
|
+ *
|
|
|
* @param settlementQueryVo
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public void exportSuperviseSettlementExcel(Page page,SettlementQueryVo settlementQueryVo) {
|
|
|
- Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.superviseSettlementExcelDtos(page,settlementQueryVo);
|
|
|
+ public void exportSuperviseSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) {
|
|
|
+ Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.superviseSettlementExcelDtos(page, settlementQueryVo);
|
|
|
exportSuperviseSettlementExcelDtos.getRecords().forEach(dto -> {
|
|
|
if (dto.getInvoiceParty().equals("1")) {
|
|
|
dto.setInvoiceParty("我方开票");
|
|
|
@@ -894,12 +902,12 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
});
|
|
|
List<ExportSuperviseSettlementExcelDto> list = exportSuperviseSettlementExcelDtos.getRecords();
|
|
|
- EasyExcelUtils.exportForWeb(ServletUtils.getResponse(),ExportSuperviseSettlementExcelDto.class,list, "车险手续费结算明细");
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportSuperviseSettlementExcelDto.class, list, "车险手续费结算明细");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Page<ExportSuperviseSettlementDetailExcelDto> superviseSettlementDetailExcel(Page page, SettlementQueryVo settlementQueryVo) {
|
|
|
- Page<ExportSuperviseSettlementDetailExcelDto> exportSuperviseSettlementDetailExcelDtos = baseMapper.getSuperviseSettlementDetailExcelDtos(page,settlementQueryVo);
|
|
|
+ Page<ExportSuperviseSettlementDetailExcelDto> exportSuperviseSettlementDetailExcelDtos = baseMapper.getSuperviseSettlementDetailExcelDtos(page, settlementQueryVo);
|
|
|
exportSuperviseSettlementDetailExcelDtos.getRecords().forEach(dto -> {
|
|
|
if (dto.getInvoiceParty().equals("1")) {
|
|
|
dto.setInvoiceParty("我方开票");
|
|
|
@@ -917,13 +925,14 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
|
|
|
/**
|
|
|
* 导出应收手续费结算记录明细
|
|
|
+ *
|
|
|
* @param settlementQueryVo
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public void exportSuperviseSettlementDetailExcel(Page page,SettlementQueryVo settlementQueryVo) throws IOException {
|
|
|
+ public void exportSuperviseSettlementDetailExcel(Page page, SettlementQueryVo settlementQueryVo) throws IOException {
|
|
|
verifyUploadPath();
|
|
|
- Page<ExportSuperviseSettlementDetailExcelDto> exportSuperviseSettlementDetailExcelDtos = baseMapper.getSuperviseSettlementDetailExcelDtos(page,settlementQueryVo);
|
|
|
+ Page<ExportSuperviseSettlementDetailExcelDto> exportSuperviseSettlementDetailExcelDtos = baseMapper.getSuperviseSettlementDetailExcelDtos(page, settlementQueryVo);
|
|
|
exportSuperviseSettlementDetailExcelDtos.getRecords().forEach(dto -> {
|
|
|
if (dto.getInvoiceParty().equals("1")) {
|
|
|
dto.setInvoiceParty("我方开票");
|
|
|
@@ -937,18 +946,19 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
});
|
|
|
List<ExportSuperviseSettlementDetailExcelDto> list = exportSuperviseSettlementDetailExcelDtos.getRecords();
|
|
|
- EasyExcelUtils.exportForWeb(ServletUtils.getResponse(),ExportSuperviseSettlementDetailExcelDto.class,list, "车险手续费结算明细");
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportSuperviseSettlementDetailExcelDto.class, list, "车险手续费结算明细");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导出应收手续费结算记录明细(非车)
|
|
|
+ *
|
|
|
* @param settlementQueryVo
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public void exportSuperviseSettlementDetailJyExcel(Page page,SettlementQueryVo settlementQueryVo) throws IOException {
|
|
|
+ public void exportSuperviseSettlementDetailJyExcel(Page page, SettlementQueryVo settlementQueryVo) throws IOException {
|
|
|
verifyUploadPath();
|
|
|
- Page<ExportSuperviseSettlementDetailJyExcelDto> exportSuperviseSettlementDetailJyExcelDtos = baseMapper.getSuperviseSettlementDetailJyExcelDtos(page,settlementQueryVo);
|
|
|
+ Page<ExportSuperviseSettlementDetailJyExcelDto> exportSuperviseSettlementDetailJyExcelDtos = baseMapper.getSuperviseSettlementDetailJyExcelDtos(page, settlementQueryVo);
|
|
|
exportSuperviseSettlementDetailJyExcelDtos.getRecords().forEach(dto -> {
|
|
|
if (dto.getInvoiceParty().equals("1")) {
|
|
|
dto.setInvoiceParty("我方开票");
|
|
|
@@ -962,7 +972,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
});
|
|
|
List<ExportSuperviseSettlementDetailJyExcelDto> list = exportSuperviseSettlementDetailJyExcelDtos.getRecords();
|
|
|
- EasyExcelUtils.exportForWeb(ServletUtils.getResponse(),ExportSuperviseSettlementDetailJyExcelDto.class,list, "车险手续费结算明细(非车)");
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportSuperviseSettlementDetailJyExcelDto.class, list, "车险手续费结算明细(非车)");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -979,7 +989,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
case "3" -> dto.setEntryStatus("补录订单");
|
|
|
}
|
|
|
});
|
|
|
- EasyExcelUtils.exportForWeb(ServletUtils.getResponse(),ExportOtherExcelDto.class,exportOtherExcelDtos, "车险跟单费应收");
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportOtherExcelDto.class, exportOtherExcelDtos, "车险跟单费应收");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -996,12 +1006,12 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
case "3" -> dto.setEntryStatus("补录订单");
|
|
|
}
|
|
|
});
|
|
|
- EasyExcelUtils.exportForWeb(ServletUtils.getResponse(),ExportOtherJyExcelDto.class,exportOtherJyExcelDtos, "车险跟单费应收(非车险)");
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportOtherJyExcelDto.class, exportOtherJyExcelDtos, "车险跟单费应收(非车险)");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page<ExportOtherSettlementExcelDto> exportOtherSettlement(Page page,SettlementQueryVo settlementQueryVo) {
|
|
|
- Page<ExportOtherSettlementExcelDto> exportOtherSettlementExcelDtos = baseMapper.getOtherSettlementExcelDtos(page,settlementQueryVo);
|
|
|
+ public Page<ExportOtherSettlementExcelDto> exportOtherSettlement(Page page, SettlementQueryVo settlementQueryVo) {
|
|
|
+ Page<ExportOtherSettlementExcelDto> exportOtherSettlementExcelDtos = baseMapper.getOtherSettlementExcelDtos(page, settlementQueryVo);
|
|
|
exportOtherSettlementExcelDtos.getRecords().forEach(dto -> {
|
|
|
if (dto.getInvoiceParty().equals("1")) {
|
|
|
dto.setInvoiceParty("我方开票");
|
|
|
@@ -1016,7 +1026,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
SysUploadFiles file = sysUploadFilesMapper.selectById(dto.getFileId());
|
|
|
if (file != null) {
|
|
|
- dto.setFileUrl(MinioUtils.getPresignedObjectUrl("jzg",file.getFileName()));
|
|
|
+ dto.setFileUrl(MinioUtils.getPresignedObjectUrl("jzg", file.getFileName()));
|
|
|
}
|
|
|
});
|
|
|
return exportOtherSettlementExcelDtos;
|
|
|
@@ -1026,9 +1036,9 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
* 导出车险跟单费结算记录
|
|
|
*/
|
|
|
@Override
|
|
|
- public void exportOtherSettlementExcel(Page page,SettlementQueryVo settlementQueryVo) throws IOException {
|
|
|
+ public void exportOtherSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) throws IOException {
|
|
|
verifyUploadPath();
|
|
|
- Page<ExportOtherSettlementExcelDto> exportOtherSettlementExcelDtos = baseMapper.getOtherSettlementExcelDtos(page,settlementQueryVo);
|
|
|
+ Page<ExportOtherSettlementExcelDto> exportOtherSettlementExcelDtos = baseMapper.getOtherSettlementExcelDtos(page, settlementQueryVo);
|
|
|
exportOtherSettlementExcelDtos.getRecords().forEach(dto -> {
|
|
|
if (dto.getInvoiceParty().equals("1")) {
|
|
|
dto.setInvoiceParty("我方开票");
|
|
|
@@ -1043,12 +1053,12 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
});
|
|
|
List<ExportOtherSettlementExcelDto> list = exportOtherSettlementExcelDtos.getRecords();
|
|
|
- EasyExcelUtils.exportForWeb(ServletUtils.getResponse(),ExportOtherSettlementExcelDto.class, list, "车险跟单费结算记录");
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportOtherSettlementExcelDto.class, list, "车险跟单费结算记录");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page<ExportOtherSettlementDetailExcelDto> otherSettlementDetail(Page page,SettlementQueryVo settlementQueryVo) {
|
|
|
- Page<ExportOtherSettlementDetailExcelDto> otherSettlementDetail = baseMapper.getOtherSettlementDetailExcelDtos(page,settlementQueryVo);
|
|
|
+ public Page<ExportOtherSettlementDetailExcelDto> otherSettlementDetail(Page page, SettlementQueryVo settlementQueryVo) {
|
|
|
+ Page<ExportOtherSettlementDetailExcelDto> otherSettlementDetail = baseMapper.getOtherSettlementDetailExcelDtos(page, settlementQueryVo);
|
|
|
otherSettlementDetail.getRecords().forEach(dto -> {
|
|
|
if (dto.getInvoiceParty().equals("1")) {
|
|
|
dto.setInvoiceParty("我方开票");
|
|
|
@@ -1068,9 +1078,9 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
* 导出应收跟单费结算记录明细(车险)
|
|
|
*/
|
|
|
@Override
|
|
|
- public void exportOtherSettlementDetailExcel(Page page,SettlementQueryVo settlementQueryVo) throws IOException {
|
|
|
+ public void exportOtherSettlementDetailExcel(Page page, SettlementQueryVo settlementQueryVo) throws IOException {
|
|
|
verifyUploadPath();
|
|
|
- Page<ExportOtherSettlementDetailExcelDto> exportOtherSettlementDetailExcelDtos = baseMapper.getOtherSettlementDetailExcelDtos(page,settlementQueryVo);
|
|
|
+ Page<ExportOtherSettlementDetailExcelDto> exportOtherSettlementDetailExcelDtos = baseMapper.getOtherSettlementDetailExcelDtos(page, settlementQueryVo);
|
|
|
exportOtherSettlementDetailExcelDtos.getRecords().forEach(dto -> {
|
|
|
if (dto.getInvoiceParty().equals("1")) {
|
|
|
dto.setInvoiceParty("我方开票");
|
|
|
@@ -1084,11 +1094,12 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
});
|
|
|
List<ExportOtherSettlementDetailExcelDto> list = exportOtherSettlementDetailExcelDtos.getRecords();
|
|
|
- EasyExcelUtils.exportForWeb(ServletUtils.getResponse(),ExportOtherSettlementDetailExcelDto.class, list, "车险应收跟单费结算记录明细");
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportOtherSettlementDetailExcelDto.class, list, "车险应收跟单费结算记录明细");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导出车险应收跟单费结算记录明细(非车险)
|
|
|
+ *
|
|
|
* @param settlementQueryVo
|
|
|
* @return
|
|
|
* @throws IOException
|
|
|
@@ -1096,7 +1107,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
@Override
|
|
|
public void exportOtherSettlementDetailJyExcel(Page page, SettlementQueryVo settlementQueryVo) throws IOException {
|
|
|
verifyUploadPath();
|
|
|
- Page<ExportOtherSettlementDetailJyExcelDto> exportOtherSettlementDetailJyExcelDtos = baseMapper.getOtherSettlementDetailJyExcelDtos(page,settlementQueryVo);
|
|
|
+ Page<ExportOtherSettlementDetailJyExcelDto> exportOtherSettlementDetailJyExcelDtos = baseMapper.getOtherSettlementDetailJyExcelDtos(page, settlementQueryVo);
|
|
|
exportOtherSettlementDetailJyExcelDtos.getRecords().forEach(dto -> {
|
|
|
if (dto.getInvoiceParty().equals("1")) {
|
|
|
dto.setInvoiceParty("我方开票");
|
|
|
@@ -1110,7 +1121,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
});
|
|
|
List<ExportOtherSettlementDetailJyExcelDto> list = exportOtherSettlementDetailJyExcelDtos.getRecords();
|
|
|
- EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportOtherSettlementDetailJyExcelDto.class, list,"非车险跟单费结算明细");
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ExportOtherSettlementDetailJyExcelDto.class, list, "非车险跟单费结算明细");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -1132,26 +1143,26 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
List<CompanySuperviseSettlementReportDto> companySuperviseSettlementReportDtos = baseMapper.selectRootCompanies(settlementReportQueryVo);
|
|
|
for (CompanySuperviseSettlementReportDto companySuperviseSettlementReportDto : companySuperviseSettlementReportDtos) {
|
|
|
// 递归设置子公司数据
|
|
|
- setChildren(companySuperviseSettlementReportDto,settlementReportQueryVo);
|
|
|
+ setChildren(companySuperviseSettlementReportDto, settlementReportQueryVo);
|
|
|
updateUnInvoicedAmount(companySuperviseSettlementReportDto, invoicingAmountMap);
|
|
|
}
|
|
|
|
|
|
return companySuperviseSettlementReportDtos;
|
|
|
}
|
|
|
|
|
|
- private void setChildren(CompanySuperviseSettlementReportDto companySuperviseSettlementReportDto,SettlementReportQueryVo settlementReportQueryVo) {
|
|
|
+ private void setChildren(CompanySuperviseSettlementReportDto companySuperviseSettlementReportDto, SettlementReportQueryVo settlementReportQueryVo) {
|
|
|
// 构建查手续费类型的数组
|
|
|
List<String> invoiceTypes = new ArrayList<>();
|
|
|
invoiceTypes.add("1");
|
|
|
invoiceTypes.add("3");
|
|
|
// 获取子公司数据
|
|
|
- List<CompanySuperviseSettlementReportDto> children = baseMapper.selectChildrenByParentId(companySuperviseSettlementReportDto.getCompanyId(),settlementReportQueryVo);
|
|
|
+ List<CompanySuperviseSettlementReportDto> children = baseMapper.selectChildrenByParentId(companySuperviseSettlementReportDto.getCompanyId(), settlementReportQueryVo);
|
|
|
// 如果子公司存在,递归设置每个子公司的children
|
|
|
if (children != null && !children.isEmpty()) {
|
|
|
companySuperviseSettlementReportDto.setChildren(children);
|
|
|
// 递归调用,设置每个子公司的children
|
|
|
for (CompanySuperviseSettlementReportDto child : children) {
|
|
|
- setChildren(child,settlementReportQueryVo);
|
|
|
+ setChildren(child, settlementReportQueryVo);
|
|
|
|
|
|
// 将子公司的数据加到父公司
|
|
|
companySuperviseSettlementReportDto.setTotalReceivable(
|
|
|
@@ -1197,6 +1208,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 用于加总字符串金额
|
|
|
private String addAmounts(String amount1, String amount2) {
|
|
|
BigDecimal value1 = new BigDecimal(amount1 != null ? amount1 : "0");
|
|
|
@@ -1205,13 +1217,13 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page<ReceiverSettlementReportDto> receiverSettlementReport(Page page,SettlementReportQueryVo settlementReportQueryVo) {
|
|
|
- return baseMapper.getReceiverSettlementReport(page,settlementReportQueryVo);
|
|
|
+ public Page<ReceiverSettlementReportDto> receiverSettlementReport(Page page, SettlementReportQueryVo settlementReportQueryVo) {
|
|
|
+ return baseMapper.getReceiverSettlementReport(page, settlementReportQueryVo);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void exportReceiverSettlementReportExcel(Page page, SettlementReportQueryVo settlementReportQueryVo) {
|
|
|
- Page<ReceiverSettlementReportDto> receiverSettlementReport = baseMapper.getReceiverSettlementReport(page,settlementReportQueryVo);
|
|
|
+ Page<ReceiverSettlementReportDto> receiverSettlementReport = baseMapper.getReceiverSettlementReport(page, settlementReportQueryVo);
|
|
|
List<ReceiverSettlementReportDto> receiverSettlementReportDtos = receiverSettlementReport.getRecords();
|
|
|
EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ReceiverSettlementReportDto.class, receiverSettlementReportDtos, "对接人结算报表");
|
|
|
}
|
|
|
@@ -1266,12 +1278,14 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
AGREEMENT_TYPE_PLATFORM, RATIO_1_06);
|
|
|
this.save(restockIncome);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 通用计算费用(手续费/跟单费)并设置到对象
|
|
|
- * @param income 目标对象
|
|
|
- * @param premium 保费
|
|
|
+ *
|
|
|
+ * @param income 目标对象
|
|
|
+ * @param premium 保费
|
|
|
* @param proportionGetter 比例获取器
|
|
|
- * @param costSetter 费用设置器
|
|
|
+ * @param costSetter 费用设置器
|
|
|
*/
|
|
|
private void calculateAndSetCosts(InsPlyIncome income, BigDecimal premium,
|
|
|
Function<InsPlyIncome, String> proportionGetter,
|