|
|
@@ -1087,12 +1087,15 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<BCorps> getFeeCenterCorpIds(Long billId, String dc, String type, String accBillNo) {
|
|
|
+ public List<FinAccBills> getFeeCenterCorpIds(Long billId, String dc, String type, String accBillNo) {
|
|
|
List<Long> psFeeIds = new ArrayList<>();
|
|
|
psFeeIds.add(220L);
|
|
|
psFeeIds.add(623L);
|
|
|
|
|
|
+ List<FinAccBills> accBills = null;
|
|
|
+
|
|
|
if (ObjectUtils.isNotNull(accBillNo) && "1".equals(accBillNo)) {
|
|
|
+ // 提取账单号的客户
|
|
|
List<FeeCenter> feeCenterList = baseMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
|
|
|
.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(FeeCenter::getIsDeleted, 0)
|
|
|
@@ -1101,6 +1104,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
.eq(FeeCenter::getDc, dc)
|
|
|
.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds)
|
|
|
);
|
|
|
+ /*
|
|
|
List<BCorps> bCorpsList = new ArrayList<>();
|
|
|
if (!feeCenterList.isEmpty()) {
|
|
|
List<String> accBillNoList = feeCenterList.stream().map(FeeCenter::getAccBillNo).filter(Objects::nonNull)
|
|
|
@@ -1118,8 +1122,56 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
bCorpsList.add(bCorps);
|
|
|
}
|
|
|
}
|
|
|
- return bCorpsList;
|
|
|
+ */
|
|
|
+
|
|
|
+ if (!feeCenterList.isEmpty()) {
|
|
|
+ List<Long> accBillIdList = feeCenterList.stream().map(FeeCenter::getAccBillId).filter(Objects::nonNull)
|
|
|
+ .distinct().collect(Collectors.toList());
|
|
|
+ if(ObjectUtils.isNotNull(accBillIdList) && accBillIdList.size()>0){
|
|
|
+ accBills = finAccBillsMapper.selectList(new LambdaQueryWrapper<FinAccBills>()
|
|
|
+ .eq(FinAccBills::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(FinAccBills::getIsDeleted, 0)
|
|
|
+ .in(FinAccBills::getId, accBillIdList));
|
|
|
+ }
|
|
|
+ List<Long> corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull)
|
|
|
+ .distinct().collect(Collectors.toList());
|
|
|
+ List<BCorps> corps = null;
|
|
|
+ if(ObjectUtils.isNotNull(corpIds) && corpIds.size()>0) {
|
|
|
+ corps = bCorpsService.list(new LambdaQueryWrapper<BCorps>()
|
|
|
+ .eq(BCorps::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(BCorps::getIsDeleted, 0)
|
|
|
+ .in(BCorps::getId, corpIds));
|
|
|
+ }else{
|
|
|
+ corps = new ArrayList<>();
|
|
|
+ }
|
|
|
+ if(ObjectUtils.isNotNull(accBills)){
|
|
|
+ for (FinAccBills accBill : accBills) {
|
|
|
+ List<BCorps> cps = corps.stream().filter(e-> Objects.equals(e.getId(), accBill.getCorpId())).collect(Collectors.toList());
|
|
|
+ if(ObjectUtils.isNotNull(cps) && !cps.isEmpty()){
|
|
|
+ accBill.setCode(cps.get(0).getCode());
|
|
|
+ accBill.setCorpCode(cps.get(0).getCode());
|
|
|
+ accBill.setShortName(cps.get(0).getShortName());
|
|
|
+ accBill.setCorpShortName(cps.get(0).getShortName());
|
|
|
+ accBill.setCnName(cps.get(0).getCnName());
|
|
|
+ accBill.setEnName(cps.get(0).getEnName());
|
|
|
+ }else {
|
|
|
+ List<FeeCenter> feeCenters = feeCenterList.stream().filter(e -> e.getAccBillId().equals(accBill.getId())).collect(Collectors.toList());
|
|
|
+ if (!feeCenters.isEmpty()) {
|
|
|
+ accBill.setCode("");
|
|
|
+ accBill.setCorpCode("");
|
|
|
+ accBill.setShortName(feeCenters.get(0).getShortName());
|
|
|
+ accBill.setCorpShortName(feeCenters.get(0).getShortName());
|
|
|
+ accBill.setCnName(feeCenters.get(0).getCorpCnName());
|
|
|
+ accBill.setEnName(feeCenters.get(0).getCorpEnName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return accBills;
|
|
|
} else {
|
|
|
+ // 提取非账单号的客户
|
|
|
List<Long> corpIds = new ArrayList<>();
|
|
|
if ("HYCK".equals(type) || "HYJK".equals(type)) {
|
|
|
Bills bills = billsMapper.selectById(billId);
|
|
|
@@ -1247,16 +1299,37 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (!corpIds.isEmpty()) {
|
|
|
- return bCorpsService.list(new LambdaQueryWrapper<BCorps>()
|
|
|
+ List<BCorps> corps = bCorpsService.list(new LambdaQueryWrapper<BCorps>()
|
|
|
.eq(BCorps::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(BCorps::getIsDeleted, 0)
|
|
|
.in(BCorps::getId, corpIds));
|
|
|
+
|
|
|
+ accBills = new ArrayList<>();
|
|
|
+ if(ObjectUtils.isNotNull(corps)){
|
|
|
+ for (BCorps bCorps : corps) {
|
|
|
+ FinAccBills accBill = new FinAccBills();
|
|
|
+ accBill.setId(0L);
|
|
|
+ accBill.setAccountDc(dc);
|
|
|
+ accBill.setBillNo("");
|
|
|
+ accBill.setCurCode("");
|
|
|
+ accBill.setCorpId(bCorps.getId());
|
|
|
+ accBill.setCode(bCorps.getCode());
|
|
|
+ accBill.setCorpCode(bCorps.getCode());
|
|
|
+ accBill.setShortName(bCorps.getShortName());
|
|
|
+ accBill.setCorpShortName(bCorps.getShortName());
|
|
|
+ accBill.setCnName(bCorps.getCnName());
|
|
|
+ accBill.setEnName(bCorps.getEnName());
|
|
|
+
|
|
|
+ accBills.add(accBill);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return accBills;
|
|
|
} else {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|