|
|
@@ -1222,8 +1222,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
// 使用Map来存储agreementId到其id列表的映射
|
|
|
Map<String, List<String>> idMap = new HashMap<>();
|
|
|
for (InsPlyIncome idItem : idList) {
|
|
|
- String agreementId = idItem.getAgreementId();
|
|
|
- idMap.computeIfAbsent(agreementId, k -> new ArrayList<>()).add(idItem.getId());
|
|
|
+ String partnerCompaniesId = idItem.getPartnerCompaniesId();
|
|
|
+ idMap.computeIfAbsent(partnerCompaniesId, k -> new ArrayList<>()).add(idItem.getId());
|
|
|
}
|
|
|
|
|
|
for (InsPlyIncome resultItem : resultList) {
|
|
|
@@ -1323,26 +1323,26 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
|
|
|
// 处理otherIds,填充companyId到ids的映射
|
|
|
for (HashMap<String, Object> idMap : otherIds) {
|
|
|
- String companyId = (String) idMap.get("companyId");
|
|
|
+ String partnerCompaniesId = (String) idMap.get("partnerCompaniesId");
|
|
|
String id = idMap.get("id").toString(); // 假设id是一个String,而不是List<String>
|
|
|
- if (companyId != null && id != null) {
|
|
|
- companyIdToIdsMap.computeIfAbsent(companyId, k -> new ArrayList<>()).add(id); // 将id添加到列表中
|
|
|
+ if (partnerCompaniesId != null && id != null) {
|
|
|
+ companyIdToIdsMap.computeIfAbsent(partnerCompaniesId, k -> new ArrayList<>()).add(id); // 将id添加到列表中
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 处理invoicIds,填充companyId到setIncomeIds的映射(假设结构相同)
|
|
|
for (HashMap<String, Object> idMap : invoicIds) {
|
|
|
- String companyId = (String) idMap.get("companyId");
|
|
|
+ String partnerCompaniesId = (String) idMap.get("partnerCompaniesId");
|
|
|
String setIncomeId = idMap.get("id").toString(); // 假设这里也是单个id,键名可能不同,例如"setIncomeId"
|
|
|
- if (companyId != null && setIncomeId != null) {
|
|
|
- companyIdToSetIncomeIdsMap.computeIfAbsent(companyId, k -> new ArrayList<>()).add(setIncomeId);
|
|
|
+ if (partnerCompaniesId != null && setIncomeId != null) {
|
|
|
+ companyIdToSetIncomeIdsMap.computeIfAbsent(partnerCompaniesId, k -> new ArrayList<>()).add(setIncomeId);
|
|
|
}
|
|
|
}
|
|
|
// 遍历result列表,为每个InsPlyIncome对象设置拼接后的ids和incomeIds
|
|
|
for (InsPlyIncome resultItem : result) {
|
|
|
- String companyId = resultItem.getCompanyId();
|
|
|
- List<String> ids = companyIdToIdsMap.getOrDefault(companyId, Collections.emptyList());
|
|
|
- List<String> setIncomeIds = companyIdToSetIncomeIdsMap.getOrDefault(companyId, Collections.emptyList());
|
|
|
+ String partnerCompaniesId = resultItem.getPartnerCompaniesId();
|
|
|
+ List<String> ids = companyIdToIdsMap.getOrDefault(partnerCompaniesId, Collections.emptyList());
|
|
|
+ List<String> setIncomeIds = companyIdToSetIncomeIdsMap.getOrDefault(partnerCompaniesId, Collections.emptyList());
|
|
|
|
|
|
// 合并ids和setIncomeIds(如果需要,可以先去重),但在此处我们直接拼接
|
|
|
String idsString = String.join(",", ids);
|
|
|
@@ -1359,18 +1359,18 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
public HttpResult<Object> batchInvoic(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
// 通过ids 查出跟单非结算单
|
|
|
String ids = insPlyIncomeVo.getIds();
|
|
|
- if(StringUtils.isNotEmpty(ids)){
|
|
|
- String[] split = ids.split(",");
|
|
|
- for (int i =0; i <split.length ; i++) {
|
|
|
- String id = split[i];
|
|
|
- InsPlyIncome insPlyIncome = baseMapper.selectById(id);
|
|
|
- insPlyIncome.setInvoicId(insPlyIncomeVo.getContractId()); // 开票号
|
|
|
- insPlyIncome.setContractFileId(insPlyIncomeVo.getContractFileId());
|
|
|
- insPlyIncome.setVoucherNumber(insPlyIncomeVo.getVoucherNumber());
|
|
|
- insPlyIncome.setSettlementTime(LocalDate.now());
|
|
|
- baseMapper.updateById(insPlyIncome);
|
|
|
- }
|
|
|
- }
|
|
|
+// if(StringUtils.isNotEmpty(ids)){
|
|
|
+// String[] split = ids.split(",");
|
|
|
+// for (int i =0; i <split.length ; i++) {
|
|
|
+// String id = split[i];
|
|
|
+// InsPlyIncome insPlyIncome = baseMapper.selectById(id);
|
|
|
+// insPlyIncome.setInvoicId(insPlyIncomeVo.getContractId()); // 开票号
|
|
|
+// insPlyIncome.setContractFileId(insPlyIncomeVo.getContractFileId());
|
|
|
+// insPlyIncome.setVoucherNumber(insPlyIncomeVo.getVoucherNumber());
|
|
|
+// insPlyIncome.setSettlementTime(LocalDate.now());
|
|
|
+// baseMapper.updateById(insPlyIncome);
|
|
|
+// }
|
|
|
+// }
|
|
|
SettlementDocumentaryFeesVo settlementDocumentaryFeesVo = new SettlementDocumentaryFeesVo(); // 生成跟单费结算表
|
|
|
if(StringUtils.isNotEmpty(insPlyIncomeVo.getYear())){
|
|
|
settlementDocumentaryFeesVo.setTimeFrame(insPlyIncomeVo.getYear());//年度
|
|
|
@@ -1385,6 +1385,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
settlementDocumentaryFeesVo.setDay(insPlyIncomeVo.getDay());
|
|
|
}
|
|
|
settlementDocumentaryFeesVo.setCompanyId(insPlyIncomeVo.getCompanyId());// 保险公司id
|
|
|
+ settlementDocumentaryFeesVo.setPartnerCompaniesId(insPlyIncomeVo.getPartnerCompaniesId());
|
|
|
settlementDocumentaryFeesVo.setTotalAmount(insPlyIncomeVo.getOtherFeevalue()); //其他费用金额
|
|
|
settlementDocumentaryFeesVo.setUnsettledAmount(insPlyIncomeVo.getNoInvoicCommissionFeevalue().subtract(insPlyIncomeVo.getSettlementAmount())); //未结算
|
|
|
settlementDocumentaryFeesVo.setSettlementAmount(insPlyIncomeVo.getSettlementAmount());//已经开票
|
|
|
@@ -1392,7 +1393,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
settlementDocumentaryFeesVo.setIds(insPlyIncomeVo.getIncomeIds());
|
|
|
settlementDocumentaryFeesVo.setSettlementStatus("1");
|
|
|
settlementDocumentaryFeesVo.setIsNotCar(insPlyIncomeVo.getIsNotCar());
|
|
|
- settlementDocumentaryFeesVo.setInvoiceId(insPlyIncomeVo.getContractId());
|
|
|
+ settlementDocumentaryFeesVo.setInvoiceId(insPlyIncomeVo.getContractId()); //开票号
|
|
|
return settlementDocumentaryFeesService.inertSettle(settlementDocumentaryFeesVo);
|
|
|
}
|
|
|
|