| | |
| | | } |
| | | |
| | | /** |
| | | * 解析客户编号,基于客户名称 |
| | | * 解析客户编号,基于客户名称(选填:客户名称留空时返回 null,表示该检验单不关联客户) |
| | | */ |
| | | public Long resolveClientId(String clientName) { |
| | | if (StrUtil.isBlank(clientName)) { |
| | | throw new IllegalArgumentException("客户名称不能为空:请填写模板中该行的「客户名称」列"); |
| | | return null; |
| | | } |
| | | if (customerNameMap == null) { |
| | | customerNameMap = new HashMap<>(); |
| | |
| | | * 出货检验单列表按客户数据权限过滤,权限外的客户导入后本人在列表中看不到该单据,因此提前拦截。 |
| | | */ |
| | | public void validateClientPermission(Long clientId, String clientName) { |
| | | // 客户选填:未填写客户的检验单不属于任何客户,不受客户数据权限限制 |
| | | if (clientId == null) { |
| | | return; |
| | | } |
| | | if (!clientPermissionLoaded) { |
| | | List<Long> permittedIds = crmCustomerApi.getPermittedCustomerIds(); |
| | | permittedClientIds = permittedIds == null ? null : new HashSet<>(permittedIds); |