|
@@ -349,7 +349,14 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
insPlyIncome.setJqOtherCostsProportion(insFeeOrderNew.getJqOtherCostsProportion()); //交强跟单费比例
|
|
insPlyIncome.setJqOtherCostsProportion(insFeeOrderNew.getJqOtherCostsProportion()); //交强跟单费比例
|
|
|
insPlyIncome.setSyOtherCostsProportion(insFeeOrderNew.getSyOtherCostsProportion()); //商业跟单费比例
|
|
insPlyIncome.setSyOtherCostsProportion(insFeeOrderNew.getSyOtherCostsProportion()); //商业跟单费比例
|
|
|
insPlyIncome.setNoOtherCostsProportion(insFeeOrderNew.getNoOtherCostsProportion()); //非车跟单费比例
|
|
insPlyIncome.setNoOtherCostsProportion(insFeeOrderNew.getNoOtherCostsProportion()); //非车跟单费比例
|
|
|
|
|
+ insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
|
|
|
|
|
+ insPlyIncome.setSyPremium(insFeeOrderNew.getSyPremium());
|
|
|
|
|
+ insPlyIncome.setNoPremium(insFeeOrderNew.getNoPremium());
|
|
|
|
|
+ insPlyIncome.setJqNoTaxPremium(insFeeOrderNew.getJqNoTaxPremium());
|
|
|
|
|
+ insPlyIncome.setSyNoTaxPremium(insFeeOrderNew.getSyNoTaxPremium());
|
|
|
|
|
+ insPlyIncome.setNoNoTaxPremium(insFeeOrderNew.getNoNoTaxPremium());
|
|
|
insPlyIncome.setUserId(insFeeOrderNew.getUserId());
|
|
insPlyIncome.setUserId(insFeeOrderNew.getUserId());
|
|
|
|
|
+ this.saveRiskCode(order.getProductid(),insPlyIncome);
|
|
|
insPlyIncome.setInsuredName(order.getInsuredname());
|
|
insPlyIncome.setInsuredName(order.getInsuredname());
|
|
|
this.saveByCompanyId(insFeeOrderNew ,insAreaCompany.getCompanyId(),insPlyIncome);
|
|
this.saveByCompanyId(insFeeOrderNew ,insAreaCompany.getCompanyId(),insPlyIncome);
|
|
|
baseMapper.insert(insPlyIncome);
|
|
baseMapper.insert(insPlyIncome);
|
|
@@ -370,7 +377,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
if(StringUtils.isNotEmpty(ptlAgreementQueryVo.getInsuranceCompanyId())){
|
|
if(StringUtils.isNotEmpty(ptlAgreementQueryVo.getInsuranceCompanyId())){
|
|
|
String insuranceCompanyId = ptlAgreementQueryVo.getInsuranceCompanyId();
|
|
String insuranceCompanyId = ptlAgreementQueryVo.getInsuranceCompanyId();
|
|
|
EsmInsCompany esmInsCompany = EsmInsCompanyService.getById(insuranceCompanyId);
|
|
EsmInsCompany esmInsCompany = EsmInsCompanyService.getById(insuranceCompanyId);
|
|
|
- String name = esmInsCompany.getName(); //保险公司名称
|
|
|
|
|
|
|
+ String name = esmInsCompany.getNamesimple(); //保险公司名称 简称
|
|
|
insPlyIncome.setCompanyName(name);
|
|
insPlyIncome.setCompanyName(name);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -602,32 +609,66 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param multipartFile
|
|
|
|
|
+ * @return totalAmount 总金额
|
|
|
|
|
+ * totalHandingAmount 总手续费金额
|
|
|
|
|
+ * totalOtherAmount 总跟单费金额
|
|
|
|
|
+ * resultHashMap 返回 ids 已经上面的金额
|
|
|
|
|
+ * resultNoSelect 未匹配的车牌号
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- public void importData(MultipartFile multipartFile) {
|
|
|
|
|
- List<InsPlyIncome> list = null;
|
|
|
|
|
|
|
+ public HashMap<String, Object> importData(MultipartFile multipartFile) {
|
|
|
|
|
+ BigDecimal totalAmount=BigDecimal.ZERO;
|
|
|
|
|
+ BigDecimal totalHandingAmount=BigDecimal.ZERO;
|
|
|
|
|
+ BigDecimal totalOtherAmount=BigDecimal.ZERO;
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
|
|
+ HashMap<String, Object> resultHashMap = new HashMap<>();
|
|
|
|
|
+ ArrayList<HashMap<String,Object>> resultNoSelect = new ArrayList<>();
|
|
|
|
|
+ StringBuffer strBuilder = new StringBuffer();
|
|
|
try {
|
|
try {
|
|
|
List<InsPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(multipartFile, InsPlyIncomeExcelDto.class, 0, 1, 1);
|
|
List<InsPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(multipartFile, InsPlyIncomeExcelDto.class, 0, 1, 1);
|
|
|
for (InsPlyIncomeExcelDto excelItem : dtoList) {
|
|
for (InsPlyIncomeExcelDto excelItem : dtoList) {
|
|
|
params.clear();
|
|
params.clear();
|
|
|
- String licenseno = excelItem.getLicenseno();//车牌号
|
|
|
|
|
- params.put("licenseno",licenseno);
|
|
|
|
|
- String policyno = excelItem.getPolicyno(); //交强保单号
|
|
|
|
|
- params.put("policyno",policyno);
|
|
|
|
|
- String syPolicyno = excelItem.getSyPolicyno(); //商业保单号
|
|
|
|
|
- params.put("syPolicyno",syPolicyno);
|
|
|
|
|
- String noPolicyno = excelItem.getNoPolicyno(); //非车保单号
|
|
|
|
|
- params.put("noPolicyno",noPolicyno);
|
|
|
|
|
- if(ObjectUtils.isNotEmpty(licenseno)){
|
|
|
|
|
- List<InsPlyIncome> insPlyIncome=baseMapper.findByLicenseno(params);
|
|
|
|
|
- for (InsPlyIncome item : insPlyIncome) {
|
|
|
|
|
- if(ObjectUtils.isNotEmpty(item)){
|
|
|
|
|
- item.setHandlingFeesStatus("1"); //已结算
|
|
|
|
|
- baseMapper.updateById(item);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(excelItem.getLicenseno())){
|
|
|
|
|
+ params.put("licenseno",excelItem.getLicenseno());//车牌号
|
|
|
|
|
+ }
|
|
|
|
|
+ if(StringUtils.isNotEmpty(excelItem.getPolicyno())){
|
|
|
|
|
+ params.put("policyno",excelItem.getPolicyno()); //交强保单号
|
|
|
|
|
+ }
|
|
|
|
|
+ if(StringUtils.isNotEmpty(excelItem.getSyPolicyno())){
|
|
|
|
|
+ params.put("syPolicyno", excelItem.getSyPolicyno());//商业保单号
|
|
|
|
|
+ }
|
|
|
|
|
+ if(StringUtils.isNotEmpty(excelItem.getNoPolicyno())){
|
|
|
|
|
+ params.put("noPolicyno",excelItem.getNoPolicyno()); //非车保单号
|
|
|
|
|
+ }
|
|
|
|
|
+ InsPlyIncome insPlyIncome=baseMapper.findByLicenseno(params);
|
|
|
|
|
+ if(ObjectUtils.isNotEmpty(insPlyIncome)){
|
|
|
|
|
+ strBuilder.append(insPlyIncome.getId()).append(",");
|
|
|
|
|
+ if(insPlyIncome.getAllFeeValue()!=null && insPlyIncome.getAllFeeValue().compareTo(BigDecimal.ZERO)!=0){
|
|
|
|
|
+ totalAmount = totalAmount.add(insPlyIncome.getAllFeeValue()); //总金额
|
|
|
|
|
+ }
|
|
|
|
|
+ if(insPlyIncome.getCommissionFeevalue()!=null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO)!=0){
|
|
|
|
|
+ totalHandingAmount=totalHandingAmount.add(insPlyIncome.getCommissionFeevalue()); //总手续费
|
|
|
|
|
+ }
|
|
|
|
|
+ if(insPlyIncome.getOtherFeevalue()!=null && insPlyIncome.getOtherFeevalue().compareTo(BigDecimal.ZERO)!=0){
|
|
|
|
|
+ totalOtherAmount=totalOtherAmount.add(insPlyIncome.getOtherFeevalue()); //总跟单费
|
|
|
}
|
|
}
|
|
|
|
|
+ }else {
|
|
|
|
|
+ resultNoSelect.add(params); // 添加未匹配的车牌号
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if(strBuilder.length() >0){
|
|
|
|
|
+ String ids = strBuilder.deleteCharAt(strBuilder.length() - 1).toString();
|
|
|
|
|
+ resultHashMap.put("ids",ids);
|
|
|
|
|
+ }
|
|
|
|
|
+ resultHashMap.put("totalAmount",totalAmount);
|
|
|
|
|
+ resultHashMap.put("totalHandingAmount",totalHandingAmount);
|
|
|
|
|
+ resultHashMap.put("totalOtherAmount",totalOtherAmount);
|
|
|
|
|
+ resultHashMap.put("resultList",resultNoSelect);
|
|
|
|
|
+ return resultHashMap;
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
throw new SystemException("导入失败!");
|
|
throw new SystemException("导入失败!");
|
|
|
}
|
|
}
|
|
@@ -889,7 +930,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(insPlyIncomeVo.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
if(insPlyIncomeVo.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
- BigDecimal nohandingFee = noNoTaxPremium.multiply(insPlyIncomeVo.getSySuperviseCostsProportion().divide(new BigDecimal(100)));
|
|
|
|
|
|
|
+ BigDecimal nohandingFee = noNoTaxPremium.multiply(insPlyIncomeVo.getNoSuperviseCostsProportion().divide(new BigDecimal(100)));
|
|
|
insPlyIncome.setNoSuperviseCostsPremiums(nohandingFee);
|
|
insPlyIncome.setNoSuperviseCostsPremiums(nohandingFee);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -900,7 +941,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
|
|
|
|
|
if(insPlyIncomeVo.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
if(insPlyIncomeVo.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
|
BigDecimal syother = syNoTaxPremium.multiply(insPlyIncomeVo.getSyOtherCostsProportion().divide(new BigDecimal(100)));//交强跟单费 按照思路 交强不含税保费* 交强跟单比例 = 交强跟单金额
|
|
BigDecimal syother = syNoTaxPremium.multiply(insPlyIncomeVo.getSyOtherCostsProportion().divide(new BigDecimal(100)));//交强跟单费 按照思路 交强不含税保费* 交强跟单比例 = 交强跟单金额
|
|
|
- insPlyIncome.setJqOtherCostsPremium(syother);
|
|
|
|
|
|
|
+ insPlyIncome.setSyOtherCostsPremium(syother);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(insPlyIncomeVo.getNoOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
if(insPlyIncomeVo.getNoOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0){
|
|
@@ -925,7 +966,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getJqSuperviseCostsPremiums(),insPlyIncome.getSySuperviseCostsPremiums(),null)); // 手续费
|
|
insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getJqSuperviseCostsPremiums(),insPlyIncome.getSySuperviseCostsPremiums(),null)); // 手续费
|
|
|
insPlyIncome.setCommissionFeerate(this.calculateTotal(insPlyIncome.getJqSuperviseCostsProportion(),insPlyIncome.getSySuperviseCostsProportion(),null));//手续费比例
|
|
insPlyIncome.setCommissionFeerate(this.calculateTotal(insPlyIncome.getJqSuperviseCostsProportion(),insPlyIncome.getSySuperviseCostsProportion(),null));//手续费比例
|
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getCommissionFeevalue(),null,null));//总金额
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getCommissionFeevalue(),null,null));//总金额
|
|
|
- }else { //保险跟单费 交强跟单+商业跟单
|
|
|
|
|
|
|
+ }else if ("1".equals(insPlyIncomeVo.getIsNotDocumentary()) && "0".equals(insPlyIncomeVo.getIsNotCar())){ //保险跟单费 交强跟单+商业跟单
|
|
|
insPlyIncome.setOtherFeevalue(this.calculateTotal(insPlyIncome.getJqOtherCostsPremium(),insPlyIncome.getSyOtherCostsPremium(),null));
|
|
insPlyIncome.setOtherFeevalue(this.calculateTotal(insPlyIncome.getJqOtherCostsPremium(),insPlyIncome.getSyOtherCostsPremium(),null));
|
|
|
insPlyIncome.setOtherFeerate(this.calculateTotal(insPlyIncome.getJqOtherCostsProportion(),insPlyIncome.getSyOtherCostsProportion(),null));
|
|
insPlyIncome.setOtherFeerate(this.calculateTotal(insPlyIncome.getJqOtherCostsProportion(),insPlyIncome.getSyOtherCostsProportion(),null));
|
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getOtherFeevalue(),null,null));//总金额
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getOtherFeevalue(),null,null));//总金额
|
|
@@ -935,9 +976,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getNoSuperviseCostsPremiums(),null,null)); // 非车手续费
|
|
insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getNoSuperviseCostsPremiums(),null,null)); // 非车手续费
|
|
|
insPlyIncome.setCommissionFeerate(this.calculateTotal(insPlyIncome.getNoSuperviseCostsProportion(),null,null)); //非车比例
|
|
insPlyIncome.setCommissionFeerate(this.calculateTotal(insPlyIncome.getNoSuperviseCostsProportion(),null,null)); //非车比例
|
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getCommissionFeevalue(),null,null));//总金额
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getCommissionFeevalue(),null,null));//总金额
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }else { //非车跟单
|
|
|
|
|
|
|
+ }else if ("1".equals(insPlyIncomeVo.getIsNotDocumentary()) && "1".equals(insPlyIncomeVo.getIsNotCar())){ //非车跟单
|
|
|
insPlyIncome.setOtherFeevalue(this.calculateTotal(insPlyIncome.getNoOtherCostsPremium(),null,null)); //非车跟单金额
|
|
insPlyIncome.setOtherFeevalue(this.calculateTotal(insPlyIncome.getNoOtherCostsPremium(),null,null)); //非车跟单金额
|
|
|
insPlyIncome.setOtherFeerate(this.calculateTotal(insPlyIncome.getNoOtherCostsProportion(),null,null)); // 非车跟单比例
|
|
insPlyIncome.setOtherFeerate(this.calculateTotal(insPlyIncome.getNoOtherCostsProportion(),null,null)); // 非车跟单比例
|
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getOtherFeevalue(),null,null));//总金额
|
|
insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getOtherFeevalue(),null,null));//总金额
|
|
@@ -1106,6 +1145,11 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param insPlyIncomeVo
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<InsPlyIncome> totalBxAmount(InsPlyIncomeVo insPlyIncomeVo) {
|
|
public List<InsPlyIncome> totalBxAmount(InsPlyIncomeVo insPlyIncomeVo) {
|
|
@@ -1113,9 +1157,35 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
params=this.saveParams(insPlyIncomeVo,params);
|
|
params=this.saveParams(insPlyIncomeVo,params);
|
|
|
params.remove("handlingFeesStatus");
|
|
params.remove("handlingFeesStatus");
|
|
|
List<InsPlyIncome> resultList = baseMapper.totalBxAmount(params);
|
|
List<InsPlyIncome> resultList = baseMapper.totalBxAmount(params);
|
|
|
|
|
+// 数据库数据太多是 用sql拼接id会丢失 所以只能逻辑拼接
|
|
|
|
|
+ List<InsPlyIncome> idList=baseMapper.getIncomeIdList(params);
|
|
|
|
|
+ if(!CollectionUtils.isEmpty(idList) && !ObjectUtils.isNotEmpty(resultList)){
|
|
|
|
|
+ this.splicingIds(idList,resultList);
|
|
|
|
|
+ }
|
|
|
return resultList;
|
|
return resultList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param idList 要开票的数据集合
|
|
|
|
|
+ * @param resultList 总返回数据
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+ private void splicingIds(List<InsPlyIncome> idList, List<InsPlyIncome> resultList) {
|
|
|
|
|
+ // 使用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());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (InsPlyIncome resultItem : resultList) {
|
|
|
|
|
+ List<String> ids = idMap.getOrDefault(resultItem.getAgreementId(), Collections.emptyList());
|
|
|
|
|
+ String idsString = String.join(",", ids);
|
|
|
|
|
+ resultItem.setIds(idsString);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public HttpResult<Object> batchInvoicing(InsPlyIncomeVo insPlyIncomeVo) {
|
|
public HttpResult<Object> batchInvoicing(InsPlyIncomeVo insPlyIncomeVo) {
|
|
@@ -1177,14 +1247,66 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
return HttpResult.ok(insPlyIncome);
|
|
return HttpResult.ok(insPlyIncome);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param insPlyIncomeVo
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult<List<InsPlyIncome>> allOtherAmount(InsPlyIncomeVo insPlyIncomeVo) {
|
|
public HttpResult<List<InsPlyIncome>> allOtherAmount(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
- params=this.saveParams(insPlyIncomeVo,params);
|
|
|
|
|
- List<InsPlyIncome> result= baseMapper.allOtherAmount(params);
|
|
|
|
|
|
|
+ params = this.saveParams(insPlyIncomeVo, params);
|
|
|
|
|
+ List<InsPlyIncome> result = baseMapper.allOtherAmount(params);
|
|
|
|
|
+ List<HashMap<String, Object>> otherIds = baseMapper.getOtherIds(params);
|
|
|
|
|
+ List<HashMap<String, Object>> invoicIds = settlementDocumentaryFeesService.getInvoicIds(params);
|
|
|
|
|
+ this.splicingOtherIds(result,otherIds,invoicIds);
|
|
|
return HttpResult.ok(result);
|
|
return HttpResult.ok(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param result 返回的数据
|
|
|
|
|
+ * @param otherIds ins_ply_income 跟单费
|
|
|
|
|
+ * @param invoicIds settlement_documentary_fees 开票ids
|
|
|
|
|
+ */
|
|
|
|
|
+ private void splicingOtherIds(List<InsPlyIncome> result, List<HashMap<String, Object>> otherIds, List<HashMap<String, Object>> invoicIds) {
|
|
|
|
|
+ // 创建两个映射来分别存储companyId到ids和setIncomeIds的映射
|
|
|
|
|
+ Map<String, List<String>> companyIdToIdsMap = new HashMap<>();
|
|
|
|
|
+ Map<String, List<String>> companyIdToSetIncomeIdsMap = new HashMap<>();
|
|
|
|
|
+
|
|
|
|
|
+// 处理otherIds,填充companyId到ids的映射
|
|
|
|
|
+ for (HashMap<String, Object> idMap : otherIds) {
|
|
|
|
|
+ String companyId = (String) idMap.get("companyId");
|
|
|
|
|
+ String id = idMap.get("id").toString(); // 假设id是一个String,而不是List<String>
|
|
|
|
|
+ if (companyId != null && id != null) {
|
|
|
|
|
+ companyIdToIdsMap.computeIfAbsent(companyId, k -> new ArrayList<>()).add(id); // 将id添加到列表中
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+// 处理invoicIds,填充companyId到setIncomeIds的映射(假设结构相同)
|
|
|
|
|
+ for (HashMap<String, Object> idMap : invoicIds) {
|
|
|
|
|
+ String companyId = (String) idMap.get("companyId");
|
|
|
|
|
+ String setIncomeId = idMap.get("id").toString(); // 假设这里也是单个id,键名可能不同,例如"setIncomeId"
|
|
|
|
|
+ if (companyId != null && setIncomeId != null) {
|
|
|
|
|
+ companyIdToSetIncomeIdsMap.computeIfAbsent(companyId, 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());
|
|
|
|
|
+
|
|
|
|
|
+ // 合并ids和setIncomeIds(如果需要,可以先去重),但在此处我们直接拼接
|
|
|
|
|
+ String idsString = String.join(",", ids);
|
|
|
|
|
+ String incomeIdsString = String.join(",", setIncomeIds);
|
|
|
|
|
+
|
|
|
|
|
+ // 设置拼接后的ids和incomeIds到InsPlyIncome对象中
|
|
|
|
|
+ resultItem.setIds(idsString);
|
|
|
|
|
+ resultItem.setIncomeIds(incomeIdsString); // 假设InsPlyIncome有这个方法
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public HttpResult<Object> batchInvoic(InsPlyIncomeVo insPlyIncomeVo) {
|
|
public HttpResult<Object> batchInvoic(InsPlyIncomeVo insPlyIncomeVo) {
|