|
|
@@ -9,6 +9,7 @@ import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
|
|
|
import com.ydtech.modules.fnc.entity.ImportResult;
|
|
|
import com.ydtech.modules.fnc.entity.InsPlyIncome;
|
|
|
import com.ydtech.modules.fnc.service.ImportAsyncService;
|
|
|
+import com.ydtech.modules.fnc.service.IncomeTaskRelationshipService;
|
|
|
import com.ydtech.modules.fnc.vo.ImportResultVo;
|
|
|
import com.ydtech.modules.inv.model.dto.*;
|
|
|
import com.ydtech.modules.inv.utils.EasyExcelUtils;
|
|
|
@@ -39,6 +40,8 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
|
|
|
|
|
|
@Autowired
|
|
|
private InsPlyIncomeMapper insPlyIncomeMapper;
|
|
|
+ @Autowired
|
|
|
+ private IncomeTaskRelationshipService incomeTaskRelationshipService;
|
|
|
|
|
|
@Autowired
|
|
|
private InsUploadFilesService insUploadFilesService;
|
|
|
@@ -54,6 +57,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
|
|
|
public void importasync(List<InsBxPlyIncomeExcelDto> dtoList, String isNotCar, String taskId) {
|
|
|
BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
+ List<String> idList= new ArrayList<>();
|
|
|
List<InsImportResult> insImportResultsExcel = new ArrayList<>();
|
|
|
String companyId ="";
|
|
|
String partnerCompaniesId ="";
|
|
|
@@ -155,11 +159,10 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
|
|
|
agreementId = insPlyIncome.getAgreementId(); //协议id
|
|
|
}
|
|
|
if (ObjectUtils.isNotEmpty(insPlyIncome)) { // 比配上汇总金额 未匹配则返回到数据当中
|
|
|
-
|
|
|
+ idList.add(insPlyIncome.getId());
|
|
|
if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue()); //添加总手续费
|
|
|
}
|
|
|
-
|
|
|
insPlyIncomeMapper.updateById(insPlyIncome);
|
|
|
} else {
|
|
|
InsImportResult insImportResult = new InsImportResult();
|
|
|
@@ -196,6 +199,9 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
|
|
|
endTask.setStatus("complete");
|
|
|
if(!CollectionUtils.isEmpty(insImportResultsExcel)){
|
|
|
endTask.setUploadUrl("/upload/excel/" + taskId + "/" + fileName);
|
|
|
+ }else {
|
|
|
+ //则生成 结算任务关系表
|
|
|
+ incomeTaskRelationshipService.saveByIncomeIdList(taskId,idList);
|
|
|
}
|
|
|
endTask.setCompanyId(companyId);
|
|
|
endTask.setAgreementId(agreementId);
|
|
|
@@ -472,6 +478,8 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
|
|
|
BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
List<InsImportResult> insImportResultsExcel = new ArrayList<>();
|
|
|
+ List<String> idList= new ArrayList<>();
|
|
|
+
|
|
|
String companyId ="";
|
|
|
String partnerCompaniesId ="";
|
|
|
String agreementId ="";
|
|
|
@@ -527,6 +535,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
|
|
|
agreementId = insPlyIncome.getAgreementId(); //协议id
|
|
|
}
|
|
|
if (ObjectUtils.isNotEmpty(insPlyIncome)) { // 比配上汇总金额 未匹配则返回到数据当中
|
|
|
+ idList.add(insPlyIncome.getId());
|
|
|
if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue()); //添加总手续费
|
|
|
}
|
|
|
@@ -566,13 +575,14 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
|
|
|
endTask.setStatus("complete");
|
|
|
if(!CollectionUtils.isEmpty(insImportResultsExcel)){
|
|
|
endTask.setUploadUrl("/upload/excel/" + taskId + "/" + fileName);
|
|
|
+ }else {
|
|
|
+ //则生成 结算任务关系表
|
|
|
+ incomeTaskRelationshipService.saveByIncomeIdList(taskId,idList);
|
|
|
}
|
|
|
endTask.setCompanyId(companyId);
|
|
|
endTask.setAgreementId(agreementId);
|
|
|
endTask.setPartnerCompaniesId(partnerCompaniesId);
|
|
|
endTask.setHandStatus("3");
|
|
|
baseMapper.updateById(endTask);
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|