查询联行号

This commit is contained in:
2025-12-30 09:19:37 +08:00
parent c09d2d5590
commit 6361342e5a
8 changed files with 89 additions and 6 deletions

View File

@ -1,5 +1,6 @@
package com.xjrsoft.module.mdm.client;
import java.util.List;
import java.util.Map;
import org.springframework.cloud.openfeign.FeignClient;
@ -7,6 +8,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
/**
* @author: ksy
@ -21,4 +23,7 @@ public interface ILngBankClient {
@GetMapping("/getTranById")
String getTranById(@RequestParam("id")String id);
@GetMapping("/getTranByCodes")
List<UpdateLngBBankDto> getTranByCodes(@RequestParam("codes") List<String> codes);
}

View File

@ -38,7 +38,7 @@ public class LngCustomerBankVo {
* 银行
*/
@ApiModelProperty("银行")
@Trans(type = TransType.LNG_BANK, transToFieldName = "bankName")
//@Trans(type = TransType.LNG_BANK, transToFieldName = "bankName")
private String bankCode;
/**
@ -125,7 +125,11 @@ public class LngCustomerBankVo {
private Long ruleUserId;
/**
* 联行号
*/
@ApiModelProperty("联行号")
private String interBankCode;
}

View File

@ -38,7 +38,7 @@ public class LngSupplierBankVo {
* 银行
*/
@ApiModelProperty("银行")
@Trans(type = TransType.LNG_BANK, transToFieldName = "bankName")
//@Trans(type = TransType.LNG_BANK, transToFieldName = "bankName")
private String bankCode;
/**
@ -123,6 +123,12 @@ public class LngSupplierBankVo {
*/
@ApiModelProperty("数据权限id")
private Long ruleUserId;
/**
* 数据权限id
*/
@ApiModelProperty("联行号")
private String interBankCode;

View File

@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.TenantUtil;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.entity.LngBBank;
import com.xjrsoft.module.mdm.entity.LngBStationLng;
import com.xjrsoft.module.mdm.service.IBankService;
@ -26,7 +27,7 @@ import lombok.AllArgsConstructor;
@RestController
@RequestMapping(GlobalConstant.CLIENT_API_PRE + GlobalConstant.MDM_MODULE_PREFIX + "/tran/lngBank")
@AllArgsConstructor
public class LngBankClientImpl implements ILngStationClient {
public class LngBankClientImpl implements ILngBankClient {
private final IBankService lngBankService;
@ -49,4 +50,9 @@ public class LngBankClientImpl implements ILngStationClient {
return bank!=null?bank.getFullName():null;
}
@Override
public List<UpdateLngBBankDto> getTranByCodes(List<String> codes) {
return lngBankService.getByCodes(codes);
}
}

View File

@ -1,6 +1,9 @@
package com.xjrsoft.module.mdm.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.entity.LngBBank;
/**
@ -13,4 +16,6 @@ import com.xjrsoft.module.mdm.entity.LngBBank;
public interface IBankService extends IService<LngBBank> {
LngBBank getByCode(String code);
List<UpdateLngBBankDto> getByCodes(List<String> codes);
}

View File

@ -1,13 +1,17 @@
package com.xjrsoft.module.mdm.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.entity.LngBBank;
import com.xjrsoft.module.mdm.mapper.LngBBankMapper;
import com.xjrsoft.module.mdm.service.IBankService;
import cn.hutool.core.bean.BeanUtil;
import lombok.AllArgsConstructor;
/**
@ -26,6 +30,15 @@ public class BankServiceImpl extends ServiceImpl<LngBBankMapper, LngBBank> imple
queryWrapper.eq(LngBBank::getCode,code);
return baseMapper.selectOne(queryWrapper);
}
@Override
public List<UpdateLngBBankDto> getByCodes(List<String> codes) {
LambdaQueryWrapper<LngBBank> queryWrapper = new LambdaQueryWrapper<LngBBank>();
queryWrapper.in(LngBBank::getCode,codes);
List<LngBBank> bankList = baseMapper.selectList(queryWrapper);
List<UpdateLngBBankDto> bankDtoList = BeanUtil.copyToList(bankList, UpdateLngBBankDto.class);
return bankDtoList;
}
}

View File

@ -1,6 +1,7 @@
package com.xjrsoft.module.sales.service.impl;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@ -10,6 +11,8 @@ import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.xjrsoft.module.mdm.client.ILngBankClient;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.sales.entity.LngCustomer;
import com.xjrsoft.module.sales.entity.LngCustomerAttrPower;
import com.xjrsoft.module.sales.entity.LngCustomerBank;
@ -21,6 +24,7 @@ import com.xjrsoft.module.sales.mapper.LngCustomerContactMapper;
import com.xjrsoft.module.sales.mapper.LngCustomerDocMapper;
import com.xjrsoft.module.sales.mapper.LngCustomerMapper;
import com.xjrsoft.module.sales.service.ICustomerService;
import com.xjrsoft.module.sales.vo.LngCustomerBankVo;
import com.xjrsoft.module.sales.vo.LngCustomerDocVo;
import com.xjrsoft.module.sales.vo.LngCustomerVo;
import com.xjrsoft.module.system.client.IFileClient;
@ -28,6 +32,7 @@ import com.xjrsoft.module.system.vo.LngFileUploadVo;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
/**
@ -47,6 +52,8 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
private final LngCustomerContactMapper lngCustomerContactMapper;
private final IFileClient fileClient;
private final ILngBankClient bankClient;
@ -72,13 +79,29 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
if(lngCustomer == null) {
return null;
}
LngCustomerVo vo = BeanUtil.toBean(lngCustomer, LngCustomerVo.class);
if(CollectionUtil.isNotEmpty(vo.getLngCustomerBankList())) {
List<String> codes = vo.getLngCustomerBankList().stream().map(LngCustomerBankVo::getBankCode).collect(Collectors.toList());
List<UpdateLngBBankDto> bankList = bankClient.getTranByCodes(codes);
Map<String, UpdateLngBBankDto> codeMap = bankList.stream()
.collect(Collectors.toMap(UpdateLngBBankDto::getCode,dto -> dto));
for(LngCustomerBankVo bank: vo.getLngCustomerBankList()) {
if(StrUtil.isNotBlank(bank.getBankCode()) && codeMap.containsKey(bank.getBankCode())) {
UpdateLngBBankDto temp =codeMap.get(bank.getBankCode());
bank.setBankName(temp.getFullName());
//联行号
bank.setInterBankCode(temp.getBankCode());
}
}
}
if(CollectionUtil.isNotEmpty(vo.getLngCustomerDocList())) {
for(LngCustomerDocVo lngCustomerDoc: vo.getLngCustomerDocList()) {
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_customer_doc", "fileList", lngCustomerDoc.getId());
lngCustomerDoc.setFileList(fileList);
}
}
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_customer", "lngFileUploadList", vo.getId());
vo.setLngFileUploadList(fileList);
return vo;

View File

@ -1,6 +1,8 @@
package com.xjrsoft.module.supplier.service.impl;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -8,8 +10,9 @@ import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.xjrsoft.module.sales.entity.LngCustomer;
import com.xjrsoft.module.supplier.dto.UpdateLngSupplierDto;
import com.xjrsoft.module.mdm.client.ILngBankClient;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.sales.vo.LngCustomerBankVo;
import com.xjrsoft.module.supplier.entity.LngSupplier;
import com.xjrsoft.module.supplier.entity.LngSupplierBank;
import com.xjrsoft.module.supplier.entity.LngSupplierContact;
@ -19,6 +22,7 @@ import com.xjrsoft.module.supplier.mapper.LngSupplierContactMapper;
import com.xjrsoft.module.supplier.mapper.LngSupplierDocMapper;
import com.xjrsoft.module.supplier.mapper.LngSupplierMapper;
import com.xjrsoft.module.supplier.service.ISupplierService;
import com.xjrsoft.module.supplier.vo.LngSupplierBankVo;
import com.xjrsoft.module.supplier.vo.LngSupplierDocVo;
import com.xjrsoft.module.supplier.vo.LngSupplierVo;
import com.xjrsoft.module.system.client.IFileClient;
@ -26,6 +30,7 @@ import com.xjrsoft.module.system.vo.LngFileUploadVo;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
/**
@ -44,6 +49,8 @@ public class SupplierServiceImpl extends MPJBaseServiceImpl<LngSupplierMapper, L
private final LngSupplierDocMapper supplierLngSupplierDocMapper;
private final IFileClient fileClient;
private final ILngBankClient bankClient;
@Override
@Transactional(rollbackFor = Exception.class)
@ -63,6 +70,20 @@ public class SupplierServiceImpl extends MPJBaseServiceImpl<LngSupplierMapper, L
return null;
}
LngSupplierVo vo = BeanUtil.toBean(lngSupplier, LngSupplierVo.class);
if(CollectionUtil.isNotEmpty(vo.getLngSupplierBankList())) {
List<String> codes = vo.getLngSupplierBankList().stream().map(LngSupplierBankVo::getBankCode).collect(Collectors.toList());
List<UpdateLngBBankDto> bankList = bankClient.getTranByCodes(codes);
Map<String, UpdateLngBBankDto> codeMap = bankList.stream()
.collect(Collectors.toMap(UpdateLngBBankDto::getCode,dto -> dto));
for(LngSupplierBankVo bank: vo.getLngSupplierBankList()) {
if(StrUtil.isNotBlank(bank.getBankCode()) && codeMap.containsKey(bank.getBankCode())) {
UpdateLngBBankDto temp =codeMap.get(bank.getBankCode());
bank.setBankName(temp.getFullName());
//联行号
bank.setInterBankCode(temp.getBankCode());
}
}
}
if(CollectionUtil.isNotEmpty(vo.getLngSupplierDocList())) {
for(LngSupplierDocVo lngSupplierDoc: vo.getLngSupplierDocList()) {
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_Supplier_doc", "fileList", lngSupplierDoc.getId());