|
|
@@ -18,7 +18,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.jzg.commons.constants.InvoiceTypeEnum;
|
|
|
-import com.jzg.commons.constants.ProductsType;
|
|
|
import com.jzg.commons.constants.SettlementIdentificationEnum;
|
|
|
import com.jzg.commons.constants.dict.InsOrderStatusEnum;
|
|
|
import com.jzg.commons.core.base.BaseController;
|
|
|
@@ -27,6 +26,7 @@ import com.jzg.commons.entity.Constant;
|
|
|
import com.jzg.commons.entity.finance.dto.*;
|
|
|
import com.jzg.commons.entity.finance.po.*;
|
|
|
import com.jzg.commons.entity.finance.vo.*;
|
|
|
+import com.jzg.commons.entity.finance.vo.importimcome.*;
|
|
|
import com.jzg.commons.entity.orders.po.InsOrderAdjust;
|
|
|
import com.jzg.commons.entity.po.*;
|
|
|
import com.jzg.commons.entity.quote.vo.orders.InsOrdersVo;
|
|
|
@@ -43,6 +43,7 @@ import com.jzg.organization.excel.listener.*;
|
|
|
import com.jzg.organization.mapper.*;
|
|
|
import com.jzg.organization.service.ReceivableService;
|
|
|
import com.jzg.organization.service.SysUserJzgInfoSalesmanService;
|
|
|
+import com.jzg.organization.service.importincome.ImportIncomeService;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
import org.redisson.api.RBucket;
|
|
|
@@ -88,6 +89,9 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(ReceivableServiceImpl.class);
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ImportIncomeService importIncomeService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private RedissonClient redissonClient;
|
|
|
|
|
|
@@ -2260,7 +2264,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
ImportResultVo resultVo = vo.checkEmpty();
|
|
|
if (!resultVo.isSuccess()) {
|
|
|
failedNumber++;
|
|
|
- vo.setErrorMessage(resultVo.getMessage());
|
|
|
+ vo.setErrorMessage(resultVo.getMessage().stream().collect(Collectors.joining(",")));
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
}
|
|
|
@@ -2384,7 +2388,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
if("10".equals(type)){
|
|
|
// 调用动态导出
|
|
|
return exportBaseService.upLoadFile(
|
|
|
- InvoiceReceivableExportExcelVo4Private.class,
|
|
|
+ ExcelContent4Private.class,
|
|
|
ListUtil.empty(),
|
|
|
"应收开票-导出模板(私有)-" + Instant.now()
|
|
|
);
|
|
|
@@ -2392,13 +2396,13 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
else if("20".equals(type) || StrUtil.isEmpty(type)){
|
|
|
// 调用动态导出
|
|
|
return exportBaseService.upLoadFile(
|
|
|
- InvoiceReceivableExportExcelVo4Platform.class,
|
|
|
+ ExcelContent4Platform.class,
|
|
|
ListUtil.empty(),
|
|
|
"应收开票-导出模板(平台)-" + Instant.now());
|
|
|
}
|
|
|
// 调用动态导出
|
|
|
return exportBaseService.upLoadFile(
|
|
|
- InvoiceReceivableExportExcelVo4Platform.class,
|
|
|
+ ExcelContent4Platform.class,
|
|
|
ListUtil.empty(),
|
|
|
"应收开票-导出模板(平台)-" + Instant.now());
|
|
|
}
|
|
|
@@ -2435,20 +2439,18 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
@Override
|
|
|
public ImportUpdateExcelResultVo importAccountsReceivableInvoice(MultipartFile file) {
|
|
|
String userName = baseController.getUserName();
|
|
|
- log.info("用户[{}]导入平台协议文件",userName);
|
|
|
- ImportUpdateExcelResultVo importExcelResultVo = new ImportUpdateExcelResultVo();
|
|
|
- List<InvoiceReceivableExportExcelVo4Private> receivableExportExcelVos = importInvoiceReceivableExcel(file);
|
|
|
- if (CollUtil.isEmpty(receivableExportExcelVos)){
|
|
|
+ log.info("用户[{}]导入私有应设有文件",userName);
|
|
|
+
|
|
|
+ List<ExcelContent4Private> excelContents = importIncomeService.parseImportExcel4Private(file);
|
|
|
+ if (CollUtil.isEmpty(excelContents)){
|
|
|
throw new SystemException("数据不能为空,导入失败");
|
|
|
}
|
|
|
- AssertionUtils.isEmpty(receivableExportExcelVos, "数据处理失败,导入失败");
|
|
|
- // 获取保司名称
|
|
|
- HttpResult<List<EsmInsCompany>> listHttpResult = esmInsCompanyClient.liveCompanyList();
|
|
|
- AssertionUtils.isFail(listHttpResult.getCode() != 200, listHttpResult.getMsg());
|
|
|
- List<EsmInsCompany> esmInsCompanyList = CollUtil.isNotEmpty(listHttpResult.getData()) ? listHttpResult.getData() : CollUtil.newArrayList();
|
|
|
+ AssertionUtils.isEmpty(excelContents, "数据处理失败,导入失败");
|
|
|
+ List<ImportContentExt> datas = importIncomeService.fillExcelContent4Private(excelContents);
|
|
|
|
|
|
- int failedNumber = 0;
|
|
|
- List<InvoiceReceivableExportExcelVo4Private> failedExcel = new ArrayList<>();
|
|
|
+
|
|
|
+ // int failedNumber = 0;
|
|
|
+ List<ImportContentExt> failedExcel = new ArrayList<>();
|
|
|
// 只存储需要【修改】的数据
|
|
|
List<InsPlyIncome> updateExcel = new ArrayList<>();
|
|
|
List<InsPlyIncome> insertExcel = new ArrayList<>();
|
|
|
@@ -2460,7 +2462,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
Set<String> repeatPolicyNoSet = new HashSet<>();
|
|
|
Set<String> existCompanyIdSet = new HashSet<>();
|
|
|
|
|
|
- for (InvoiceReceivableExportExcelVo4Private vo : receivableExportExcelVos) {
|
|
|
+ for (ImportContentExt vo : datas) {
|
|
|
String policyNo = vo.getJqPolicyNo();
|
|
|
if (existPolicyNoSet.contains(policyNo)) {
|
|
|
repeatPolicyNoSet.add(policyNo);
|
|
|
@@ -2476,19 +2478,17 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
|
|
|
// 处理数据
|
|
|
- for (InvoiceReceivableExportExcelVo4Private vo : receivableExportExcelVos) {
|
|
|
+ for (ImportContentExt vo : datas) {
|
|
|
// 1. 空数据校验
|
|
|
ImportResultVo resultVo = vo.checkEmpty();
|
|
|
if (!resultVo.isSuccess()) {
|
|
|
- failedNumber++;
|
|
|
- vo.setErrorMessage(resultVo.getMessage());
|
|
|
+ vo.setErrorMessage(resultVo.convert2Str());
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
// 2. Excel内部保单号重复
|
|
|
if (repeatPolicyNoSet.contains(vo.getJqPolicyNo())) {
|
|
|
- failedNumber++;
|
|
|
vo.setErrorMessage("保单号重复");
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
@@ -2498,7 +2498,6 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
HttpResult<InsOrdersVo> insOrdersVoHttpResult = insOrdersClient.selectById(vo.getOrderNo());
|
|
|
InsOrdersVo data = insOrdersVoHttpResult.getData();
|
|
|
if (null == data){
|
|
|
- failedNumber++;
|
|
|
vo.setErrorMessage("订单号不存在");
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
@@ -2510,60 +2509,22 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
|
|
|
// 数据库不存在 → 直接失败
|
|
|
if (Objects.isNull(ptlAgreement) || !"2".equals(ptlAgreement.getAgreementType().toString())) {
|
|
|
- failedNumber++;
|
|
|
vo.setErrorMessage("协议编码在协议中不存在");
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
// 查询数据库中是否已存在该保单号
|
|
|
- failedNumber = spliceData(vo, ptlAgreement, esmInsCompanyList, insertExcel, successOrderNoList, failedNumber, failedExcel, updateExcel);
|
|
|
+ ImportContentExt failedVO = importIncomeService.spliceData(vo, insertExcel, updateExcel);
|
|
|
+ if(failedVO != null){
|
|
|
+ failedExcel.add(failedVO);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- getDataManipulationResult(updateExcel, insertExcel, failedExcel, importExcelResultVo, failedNumber, successOrderNoList);
|
|
|
-
|
|
|
+ ImportUpdateExcelResultVo importExcelResultVo = importIncomeService.getDataManipulationResult(updateExcel, insertExcel, failedExcel);
|
|
|
+ log.info("私有应收:导入结果。importExcelResultVo=[{}]", JSONUtil.toJsonStr(importExcelResultVo));
|
|
|
return importExcelResultVo;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * <p>
|
|
|
- * 1. 获取保司名称
|
|
|
- * 2. 校验Excel内部保单号重复
|
|
|
- * 3. 处理数据
|
|
|
- * 4. 执行批量更新
|
|
|
- * 5. 生成失败数据下载链接
|
|
|
- * 6. 返回结果
|
|
|
- * </p>
|
|
|
- *
|
|
|
- * @return List<InvoiceReceivableExportExcelVo> 处理后的数据列表
|
|
|
- */
|
|
|
- private void getDataManipulationResult(List<InsPlyIncome> updateExcel, List<InsPlyIncome> insertExcel, List<InvoiceReceivableExportExcelVo4Private> failedExcel, ImportUpdateExcelResultVo importExcelResultVo, int failedNumber, List<String> successOrderNoList) {
|
|
|
- // 执行批量更新
|
|
|
- if (CollUtil.isNotEmpty(updateExcel)) {
|
|
|
- baseMapper.updateById(updateExcel);
|
|
|
- }else{
|
|
|
- baseMapper.insert(insertExcel);
|
|
|
- }
|
|
|
-
|
|
|
- // ===================== 生成失败数据下载链接 =====================
|
|
|
- String failFileUrl = "";
|
|
|
- if (CollUtil.isNotEmpty(failedExcel)) {
|
|
|
- failFileUrl = exportBaseService.upLoadFile(
|
|
|
- InvoiceReceivableExportExcelVo4Private.class,
|
|
|
- failedExcel,
|
|
|
- "平台协议应收-导入失败-" + Instant.now()
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- // 返回结果
|
|
|
- importExcelResultVo.setFailedData(failedExcel);
|
|
|
- importExcelResultVo.setFailFileUrl(failFileUrl);
|
|
|
- importExcelResultVo.setSuccessNumber(CollUtil.isNotEmpty(updateExcel) ? updateExcel.size() : insertExcel.size());
|
|
|
- importExcelResultVo.setFailedNumber(failedNumber);
|
|
|
- // 导出成功的orderNos
|
|
|
- importExcelResultVo.setOrderNos(successOrderNoList);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 导入平台的应收数据
|
|
|
* @param file
|
|
|
@@ -2572,32 +2533,28 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
@Override
|
|
|
public ImportUpdateExcelResultVo importPlatformReceivableInvoice(MultipartFile file) {
|
|
|
String userName = baseController.getUserName();
|
|
|
- log.info("用户[{}]导入平台协议文件",userName);
|
|
|
- ImportUpdateExcelResultVo importExcelResultVo = new ImportUpdateExcelResultVo();
|
|
|
- List<InvoiceReceivableExportExcelVo4Private> receivableExportExcelVos = importInvoiceReceivableExcel(file);
|
|
|
- if (CollUtil.isEmpty(receivableExportExcelVos)){
|
|
|
+ log.info("用户[{}]导入平台应收文件",userName);
|
|
|
+
|
|
|
+ List<ExcelContent4Platform> excelContents = importIncomeService.parseImportExcel4Platform(file);
|
|
|
+ log.info("从Excel文件中读取到[{}]条记录", CollUtil.size(excelContents));
|
|
|
+ if (CollUtil.isEmpty(excelContents)){
|
|
|
+ log.error("用户[{}]导入平台应收文件,数据不能为空,导入失败",userName);
|
|
|
throw new SystemException("数据不能为空,导入失败");
|
|
|
}
|
|
|
- AssertionUtils.isEmpty(receivableExportExcelVos, "数据处理失败,导入失败");
|
|
|
- // 获取保司名称
|
|
|
- HttpResult<List<EsmInsCompany>> listHttpResult = esmInsCompanyClient.liveCompanyList();
|
|
|
- AssertionUtils.isFail(listHttpResult.getCode() != 200, listHttpResult.getMsg());
|
|
|
- List<EsmInsCompany> esmInsCompanyList = CollUtil.isNotEmpty(listHttpResult.getData()) ? listHttpResult.getData() : CollUtil.newArrayList();
|
|
|
+ AssertionUtils.isEmpty(excelContents, "数据处理失败,导入失败");
|
|
|
+ List<ImportContentExt> datas = importIncomeService.fillExcelContent4Platform(excelContents);
|
|
|
|
|
|
- int failedNumber = 0;
|
|
|
- List<InvoiceReceivableExportExcelVo4Private> failedExcel = new ArrayList<>();
|
|
|
// 只存储需要【修改】的数据
|
|
|
List<InsPlyIncome> updateExcel = new ArrayList<>();
|
|
|
List<InsPlyIncome> insertExcel = new ArrayList<>();
|
|
|
- // 存储导入成功的订单号
|
|
|
- List<String> successOrderNoList = new ArrayList<>();
|
|
|
+ List<ImportContentExt> failedExcel = new ArrayList<>();
|
|
|
|
|
|
// 校验Excel内部保单号重复
|
|
|
Set<String> existPolicyNoSet = new HashSet<>();
|
|
|
Set<String> repeatPolicyNoSet = new HashSet<>();
|
|
|
Set<String> existCompanyIdSet = new HashSet<>();
|
|
|
|
|
|
- for (InvoiceReceivableExportExcelVo4Private vo : receivableExportExcelVos) {
|
|
|
+ for (ImportContentExt vo : datas) {
|
|
|
String policyNo = vo.getJqPolicyNo();
|
|
|
if (existPolicyNoSet.contains(policyNo)) {
|
|
|
repeatPolicyNoSet.add(policyNo);
|
|
|
@@ -2614,132 +2571,34 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
|
|
|
// 处理数据
|
|
|
- for (InvoiceReceivableExportExcelVo4Private vo : receivableExportExcelVos) {
|
|
|
+ for (ImportContentExt vo : datas) {
|
|
|
// 1. 空数据校验
|
|
|
ImportResultVo resultVo = vo.checkEmpty();
|
|
|
if (!resultVo.isSuccess()) {
|
|
|
- failedNumber++;
|
|
|
- vo.setErrorMessage(resultVo.getMessage());
|
|
|
+ vo.setErrorMessage(resultVo.convert2Str());
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
// 2. Excel内部保单号重复
|
|
|
if (repeatPolicyNoSet.contains(vo.getJqPolicyNo())) {
|
|
|
- failedNumber++;
|
|
|
vo.setErrorMessage("保单号重复");
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
- // 查询订单
|
|
|
- HttpResult<InsOrdersVo> insOrdersVoHttpResult = insOrdersClient.selectById(vo.getOrderNo());
|
|
|
- InsOrdersVo data = insOrdersVoHttpResult.getData();
|
|
|
- if (null == data){
|
|
|
- failedNumber++;
|
|
|
- vo.setErrorMessage("订单号不存在");
|
|
|
- failedExcel.add(vo);
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- // 查询数据库中是否已存在该协议
|
|
|
- PtlAgreement ptlAgreement = ptlAgreementMapper.selectOne(new LambdaQueryWrapper<PtlAgreement>()
|
|
|
- .eq(PtlAgreement::getId, data.getAgreementId()));
|
|
|
-
|
|
|
- // 数据库不存在 → 直接失败
|
|
|
- if (Objects.isNull(ptlAgreement) || !"1".equals(ptlAgreement.getAgreementType().toString())) {
|
|
|
- failedNumber++;
|
|
|
- vo.setErrorMessage("协议编码在协议中不存在");
|
|
|
- failedExcel.add(vo);
|
|
|
- continue;
|
|
|
+ ImportContentExt errVO = importIncomeService.spliceData(vo, insertExcel, updateExcel);
|
|
|
+ if(errVO != null){
|
|
|
+ failedExcel.add(errVO);
|
|
|
}
|
|
|
-
|
|
|
- failedNumber = spliceData(vo, ptlAgreement, esmInsCompanyList, insertExcel, successOrderNoList, failedNumber, failedExcel, updateExcel);
|
|
|
- continue;
|
|
|
}
|
|
|
|
|
|
// 执行批量更新
|
|
|
- getDataManipulationResult(updateExcel, insertExcel, failedExcel, importExcelResultVo, failedNumber, successOrderNoList);
|
|
|
+ ImportUpdateExcelResultVo importExcelResultVo = importIncomeService.getDataManipulationResult(updateExcel, insertExcel,failedExcel);
|
|
|
+ log.info("平台应收导入结果:importExcelResultVo=[{}]", JSONUtil.toJsonStr(importExcelResultVo));
|
|
|
|
|
|
return importExcelResultVo;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 批量处理数据
|
|
|
- * @param updateExcel
|
|
|
- * @param insertExcel
|
|
|
- * @param failedExcel
|
|
|
- * @param failedNumber
|
|
|
- * @param successOrderNoList
|
|
|
- */
|
|
|
- private int spliceData(InvoiceReceivableExportExcelVo4Private vo, PtlAgreement ptlAgreement, List<EsmInsCompany> esmInsCompanyList, List<InsPlyIncome> insertExcel, List<String> successOrderNoList, int failedNumber, List<InvoiceReceivableExportExcelVo4Private> failedExcel, List<InsPlyIncome> updateExcel) {
|
|
|
- // 查询数据库中是否已存在该保单号
|
|
|
- InsPlyIncome existIncome = baseMapper.selectOne(new LambdaQueryWrapper<InsPlyIncome>()
|
|
|
- .eq(InsPlyIncome::getJqPolicyNo, vo.getJqPolicyNo()));
|
|
|
-
|
|
|
- // 封装修改数据
|
|
|
- InsPlyIncome insPlyIncome = new InsPlyIncome();
|
|
|
- insPlyIncome.setId(IdGenerate.nextId());
|
|
|
- insPlyIncome.setLicenseNo(vo.getLicenseNo());
|
|
|
- insPlyIncome.setJqPolicyNo(vo.getJqPolicyNo());
|
|
|
- insPlyIncome.setJqSuperviseCostsProportion(vo.getJqSuperviseCostsProportion());
|
|
|
- insPlyIncome.setJqOtherCostsProportion(vo.getJqOtherCostsProportion());
|
|
|
- insPlyIncome.setSyPolicyNo(vo.getSyPolicyNo());
|
|
|
- insPlyIncome.setSySuperviseCostsProportion(vo.getSySuperviseCostsProportion());
|
|
|
- insPlyIncome.setSyOtherCostsProportion(vo.getSyOtherCostsProportion());
|
|
|
- insPlyIncome.setJyPolicyNo(vo.getJyPolicyNo());
|
|
|
- insPlyIncome.setJySuperviseCostsProportion(vo.getJySuperviseCostsProportion());
|
|
|
- insPlyIncome.setJyOtherCostsProportion(vo.getJyOtherCostsProportion());
|
|
|
- // 签单时间
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- insPlyIncome.setSigningTime(LocalDateTime.parse(vo.getSigningTime(), formatter));
|
|
|
- // 协议编号
|
|
|
- insPlyIncome.setAgreementId(ptlAgreement.getId());
|
|
|
- insPlyIncome.setAgreementName(ptlAgreement.getAgreementName());
|
|
|
- insPlyIncome.setAgreementType(ptlAgreement.getAgreementType().toString());
|
|
|
- insPlyIncome.setSystemCode(ptlAgreement.getSystemCode());
|
|
|
- // 险种编号
|
|
|
- insPlyIncome.setProductId(ProductsType.getCodeByDesc(vo.getProductName()));
|
|
|
- // 险种名称
|
|
|
- insPlyIncome.setProductName(vo.getProductName());
|
|
|
- // 被保险人姓名
|
|
|
- insPlyIncome.setInsuredPerson(vo.getInsuredPerson());
|
|
|
- // 对接人信息
|
|
|
- insPlyIncome.setContactPerson(vo.getContactPerson());
|
|
|
- insPlyIncome.setContactPersonPhone(vo.getContactPersonPhone());
|
|
|
-
|
|
|
- // 数据库不存在 → 直接失败
|
|
|
- if (Objects.isNull(existIncome)) {
|
|
|
- // 加入修改列表
|
|
|
- // 机构id
|
|
|
- insPlyIncome.setDeptId(baseController.getUserDeptId());
|
|
|
- EsmInsCompany esmInsCompany = esmInsCompanyList.stream().filter(company -> company.getName().equals(vo.getCompanyName())).findFirst().orElse(new EsmInsCompany());
|
|
|
- insPlyIncome.setCompanyId(esmInsCompany.getId());
|
|
|
- insPlyIncome.setOrderNo(vo.getOrderNo());
|
|
|
- insertExcel.add(insPlyIncome);
|
|
|
- // 新增成功,记录订单号
|
|
|
- successOrderNoList.add(vo.getOrderNo());
|
|
|
- }else{
|
|
|
- // 数据库已存在 → 继续后续校验
|
|
|
- // 判断已开票 / 已结算
|
|
|
- String settlementFlag = "1";
|
|
|
- if (settlementFlag.equals(existIncome.getSuperviseSettlement()) || settlementFlag.equals(existIncome.getOtherSettlement())
|
|
|
- || settlementFlag.equals(existIncome.getJySuperviseSettlement()) || settlementFlag.equals(existIncome.getJyOtherSettlement())
|
|
|
- || settlementFlag.equals(existIncome.getPlatformSuperviseSettlement()) || settlementFlag.equals(existIncome.getPlatformOtherSettlement())) {
|
|
|
- failedNumber++;
|
|
|
- vo.setErrorMessage("应收数据已结算");
|
|
|
- failedExcel.add(vo);
|
|
|
- return failedNumber;
|
|
|
- }
|
|
|
-
|
|
|
- insPlyIncome.setId(existIncome.getId());
|
|
|
- // 加入修改列表
|
|
|
- updateExcel.add(insPlyIncome);
|
|
|
- // 更新成功,记录订单号
|
|
|
- successOrderNoList.add(vo.getOrderNo());
|
|
|
- }
|
|
|
- return failedNumber;
|
|
|
- }
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -3090,18 +2949,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public List<InvoiceReceivableExportExcelVo4Private> importInvoiceReceivableExcel(MultipartFile file) {
|
|
|
- InvoiceReceivbleExcelListener listener = new InvoiceReceivbleExcelListener();
|
|
|
- try (InputStream inputStream = file.getInputStream()) {
|
|
|
- EasyExcel.read(inputStream, InvoiceReceivableExportExcelVo4Private.class, listener)
|
|
|
- .sheet()
|
|
|
- .doRead();
|
|
|
- return listener.getDataList();
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("importInvoiceReceivableExcel异常",e);
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public List<JyExcelVo> importJyExcel(MultipartFile file) {
|
|
|
@@ -3164,7 +3013,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
ImportResultVo resultVo = vo.checkEmpty();
|
|
|
if (!resultVo.isSuccess()) {
|
|
|
failedNumber++;
|
|
|
- vo.setErrorMessage(resultVo.getMessage());
|
|
|
+ vo.setErrorMessage(resultVo.convert2Str());
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
}
|
|
|
@@ -3300,7 +3149,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
ImportResultVo resultVo = vo.checkEmpty();
|
|
|
if (!resultVo.isSuccess()) {
|
|
|
failedNumber++;
|
|
|
- vo.setErrorMessage(resultVo.getMessage());
|
|
|
+ vo.setErrorMessage(resultVo.convert2Str());
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
}
|
|
|
@@ -3453,7 +3302,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
ImportResultVo resultVo = vo.checkEmpty();
|
|
|
if (!resultVo.isSuccess()) {
|
|
|
failedNumber++;
|
|
|
- vo.setErrorMessage(resultVo.getMessage());
|
|
|
+ vo.setErrorMessage(resultVo.convert2Str());
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
}
|
|
|
@@ -3607,7 +3456,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
ImportResultVo resultVo = vo.checkEmpty();
|
|
|
if (!resultVo.isSuccess()) {
|
|
|
failedNumber++;
|
|
|
- vo.setErrorMessage(resultVo.getMessage());
|
|
|
+ vo.setErrorMessage(resultVo.convert2Str());
|
|
|
failedExcel.add(vo);
|
|
|
continue;
|
|
|
}
|