tuqin
2026-10-21 fd5ff7ce41f402720c79546617842bbf679e576e
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -370,6 +370,9 @@
                if (StringUtils.isEmpty(contractNo)) {
                    continue;
                }
                if (contractNo.length() > 50) {
                    return AjaxResult.error("销售单号【" + contractNo + "】长度不能超过50个字符");
                }
                if (!importContractNos.add(contractNo)) {
                    duplicateContractNos.add(contractNo);
                }
@@ -411,7 +414,7 @@
                        .map(SysUser::getUserId)
                        .orElse(null);
                if (aLong == null)
                    throw new RuntimeException("录入人:" + salesLedger.getEntryPerson() + ",无对应用户!");
                    throw new RuntimeException("录入人:" + salesLedger.getEntryPerson() + ",无对应用户!请填写系统用户的昵称(不是登录账号)");
                salesLedger.setEntryPerson(aLong.toString());
                // 销售产品数据绑定,通过销售单号获取对应销售产品数据
                List<SalesLedgerProductImportDto> salesLedgerProductImportDtos = salesLedgerProductImportDtoList.stream()
@@ -616,6 +619,9 @@
        // 3. 销售合同号唯一校验(支持字母、数字及特殊字符,不做字符集限制)
        String contractNo = StringUtils.trim(salesLedger.getSalesContractNo());
        if (StringUtils.isNotEmpty(contractNo)) {
            if (contractNo.length() > 50) {
                throw new BaseException("销售合同号长度不能超过50个字符");
            }
            checkSalesContractNoUnique(contractNo, salesLedger.getId());
            salesLedger.setSalesContractNo(contractNo);
        }