|
@@ -9,18 +9,14 @@ import com.jzg.commons.constants.ProductsType;
|
|
|
import com.jzg.commons.core.base.BaseController;
|
|
import com.jzg.commons.core.base.BaseController;
|
|
|
import com.jzg.commons.core.page.HttpResult;
|
|
import com.jzg.commons.core.page.HttpResult;
|
|
|
import com.jzg.commons.entity.finance.po.InsPlyIncome;
|
|
import com.jzg.commons.entity.finance.po.InsPlyIncome;
|
|
|
-import com.jzg.commons.entity.finance.vo.importimcome.ExcelContent4PrivateSuperviseNoCar;
|
|
|
|
|
-import com.jzg.commons.entity.finance.vo.importimcome.ImportUpdateExcelResultVo;
|
|
|
|
|
-import com.jzg.commons.entity.finance.vo.importimcome.ExcelContent4Platform;
|
|
|
|
|
-import com.jzg.commons.entity.finance.vo.importimcome.ImportContentExt;
|
|
|
|
|
|
|
+import com.jzg.commons.entity.finance.vo.importimcome.*;
|
|
|
import com.jzg.commons.entity.orders.po.InsOrdersPolicy;
|
|
import com.jzg.commons.entity.orders.po.InsOrdersPolicy;
|
|
|
import com.jzg.commons.entity.quote.vo.orders.InsOrdersVo;
|
|
import com.jzg.commons.entity.quote.vo.orders.InsOrdersVo;
|
|
|
import com.jzg.commons.entity.vo.AgreementVo;
|
|
import com.jzg.commons.entity.vo.AgreementVo;
|
|
|
import com.jzg.commons.entity.vo.InsFeeOrdersVo;
|
|
import com.jzg.commons.entity.vo.InsFeeOrdersVo;
|
|
|
import com.jzg.commons.util.idgen.IdGenerate;
|
|
import com.jzg.commons.util.idgen.IdGenerate;
|
|
|
import com.jzg.organization.client.InsOrdersClient;
|
|
import com.jzg.organization.client.InsOrdersClient;
|
|
|
-import com.jzg.organization.excel.listener.InvoiceReceivbleExcel4PlatformListener;
|
|
|
|
|
-import com.jzg.organization.excel.listener.InvoiceReceivbleExcel4PrivateListener;
|
|
|
|
|
|
|
+import com.jzg.organization.excel.listener.InvoiceReceivbleExcel4AllListener;
|
|
|
import com.jzg.organization.mapper.InsOrdersPolicyMapper;
|
|
import com.jzg.organization.mapper.InsOrdersPolicyMapper;
|
|
|
import com.jzg.organization.mapper.InsPlyIncomeMapper;
|
|
import com.jzg.organization.mapper.InsPlyIncomeMapper;
|
|
|
import com.jzg.organization.mapper.PtlAgreementMapper;
|
|
import com.jzg.organization.mapper.PtlAgreementMapper;
|
|
@@ -196,18 +192,24 @@ public class ImportIncomeServiceImpl implements ImportIncomeService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 对表格中的内容进行扩展
|
|
* 对表格中的内容进行扩展
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * 支持同时传入不同的 {@link InsuranceData} 实现类集合(如平台、私有车险、私有非车险),
|
|
|
|
|
+ * 统一进行数据扩展处理。
|
|
|
|
|
+ * </p>
|
|
|
*
|
|
*
|
|
|
|
|
+ * @param excelContents {@link InsuranceData} 实现类集合
|
|
|
|
|
+ * @return 扩展后的数据列表
|
|
|
* @author lipf
|
|
* @author lipf
|
|
|
* @date 2026/8/4 9:22
|
|
* @date 2026/8/4 9:22
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public List<ImportContentExt> fillExcelContent4Platform(List<ExcelContent4Platform> excelContents) {
|
|
|
|
|
|
|
+ public <T extends InsuranceData> List<ImportContentExt> fillExcelContent4All(List<T> excelContents) {
|
|
|
log.info("填充excel中没有的内容: excelContents.size=[{}]", CollUtil.size(excelContents));
|
|
log.info("填充excel中没有的内容: excelContents.size=[{}]", CollUtil.size(excelContents));
|
|
|
if(CollUtil.isEmpty(excelContents)){
|
|
if(CollUtil.isEmpty(excelContents)){
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
List<ImportContentExt> res = new ArrayList<>();
|
|
List<ImportContentExt> res = new ArrayList<>();
|
|
|
- for (ExcelContent4Platform excelContent : excelContents) {
|
|
|
|
|
|
|
+ for (InsuranceData excelContent : excelContents) {
|
|
|
ImportContentExt ext = new ImportContentExt();
|
|
ImportContentExt ext = new ImportContentExt();
|
|
|
BeanUtil.copyProperties(excelContent,ext);
|
|
BeanUtil.copyProperties(excelContent,ext);
|
|
|
// 查询订单
|
|
// 查询订单
|
|
@@ -250,9 +252,11 @@ public class ImportIncomeServiceImpl implements ImportIncomeService {
|
|
|
ext.setSigningTime(data.getSigningTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
ext.setSigningTime(data.getSigningTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
}
|
|
}
|
|
|
String agreementId = data.getAgreementId();
|
|
String agreementId = data.getAgreementId();
|
|
|
- AgreementVo agreementVo = ptlAgreementMapper.queryById(agreementId);
|
|
|
|
|
- if(agreementVo != null){
|
|
|
|
|
- ext.setPartnerCompanyId(agreementVo.getPartnerCompanyId());
|
|
|
|
|
|
|
+ if(StrUtil.isNotEmpty(agreementId)){
|
|
|
|
|
+ AgreementVo agreementVo = ptlAgreementMapper.queryById(agreementId);
|
|
|
|
|
+ if(agreementVo != null){
|
|
|
|
|
+ ext.setPartnerCompanyId(agreementVo.getPartnerCompanyId());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
InsFeeOrdersVo feeOrdersVo = data.getFeeOrdersVo();
|
|
InsFeeOrdersVo feeOrdersVo = data.getFeeOrdersVo();
|
|
|
if(BeanUtil.isEmpty(feeOrdersVo)){
|
|
if(BeanUtil.isEmpty(feeOrdersVo)){
|
|
@@ -274,14 +278,14 @@ public class ImportIncomeServiceImpl implements ImportIncomeService {
|
|
|
* @date 2026/8/4 9:07
|
|
* @date 2026/8/4 9:07
|
|
|
*/
|
|
*/
|
|
|
public List<ExcelContent4Platform> parseImportExcel4Platform(MultipartFile file) {
|
|
public List<ExcelContent4Platform> parseImportExcel4Platform(MultipartFile file) {
|
|
|
- InvoiceReceivbleExcel4PlatformListener listener = new InvoiceReceivbleExcel4PlatformListener();
|
|
|
|
|
|
|
+ InvoiceReceivbleExcel4AllListener<ExcelContent4Platform> listener = new InvoiceReceivbleExcel4AllListener<>();
|
|
|
try (InputStream inputStream = file.getInputStream()) {
|
|
try (InputStream inputStream = file.getInputStream()) {
|
|
|
EasyExcel.read(inputStream, ExcelContent4Platform.class, listener)
|
|
EasyExcel.read(inputStream, ExcelContent4Platform.class, listener)
|
|
|
.sheet()
|
|
.sheet()
|
|
|
.doRead();
|
|
.doRead();
|
|
|
return listener.getDataList();
|
|
return listener.getDataList();
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("InvoiceReceivbleExcel4PlatformListenery读取文件异常",e);
|
|
|
|
|
|
|
+ log.error("InvoiceReceivbleExcel4AllListener处理平台应收数据读取文件异常",e);
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -292,15 +296,36 @@ public class ImportIncomeServiceImpl implements ImportIncomeService {
|
|
|
* @author lipf
|
|
* @author lipf
|
|
|
* @date 2026/8/4 9:07
|
|
* @date 2026/8/4 9:07
|
|
|
*/
|
|
*/
|
|
|
- public List<ExcelContent4PrivateSuperviseNoCar> parseImportExcel4Private(MultipartFile file) {
|
|
|
|
|
- InvoiceReceivbleExcel4PrivateListener listener = new InvoiceReceivbleExcel4PrivateListener();
|
|
|
|
|
|
|
+ public List<ExcelContent4PrivateSuperviseNoCar> parseImportExcel4PrivateNoCar(MultipartFile file) {
|
|
|
|
|
+ InvoiceReceivbleExcel4AllListener<ExcelContent4PrivateSuperviseNoCar> listener = new InvoiceReceivbleExcel4AllListener<>();
|
|
|
try (InputStream inputStream = file.getInputStream()) {
|
|
try (InputStream inputStream = file.getInputStream()) {
|
|
|
EasyExcel.read(inputStream, ExcelContent4PrivateSuperviseNoCar.class, listener)
|
|
EasyExcel.read(inputStream, ExcelContent4PrivateSuperviseNoCar.class, listener)
|
|
|
.sheet()
|
|
.sheet()
|
|
|
.doRead();
|
|
.doRead();
|
|
|
return listener.getDataList();
|
|
return listener.getDataList();
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("InvoiceReceivbleExcel4PlatformListenery读取文件异常",e);
|
|
|
|
|
|
|
+ log.error("InvoiceReceivbleExcel4AllListener处理私有非车险数据读取文件异常",e);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 私有车险数据导入
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param file
|
|
|
|
|
+ * @author lipf
|
|
|
|
|
+ * @date 2026/8/17 15:38
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<ExcelContent4PrivateSuperviseCar> parseImportExcel4PrivateCar(MultipartFile file) {
|
|
|
|
|
+ InvoiceReceivbleExcel4AllListener<ExcelContent4PrivateSuperviseCar> listener = new InvoiceReceivbleExcel4AllListener<>();
|
|
|
|
|
+ try (InputStream inputStream = file.getInputStream()) {
|
|
|
|
|
+ EasyExcel.read(inputStream, ExcelContent4PrivateSuperviseCar.class, listener)
|
|
|
|
|
+ .sheet()
|
|
|
|
|
+ .doRead();
|
|
|
|
|
+ return listener.getDataList();
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("parseImportExcel4PrivateCar读取文件异常",e);
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|