diff --git a/src/main/java/com/ai/da/mapper/primary/DesignMapper.java b/src/main/java/com/ai/da/mapper/primary/DesignMapper.java index 85c69f70..2cc69ef9 100644 --- a/src/main/java/com/ai/da/mapper/primary/DesignMapper.java +++ b/src/main/java/com/ai/da/mapper/primary/DesignMapper.java @@ -18,7 +18,8 @@ public interface DesignMapper extends CommonMapper { //返回插入数据后生成的主键 Long insertDesign(Design design); - List getDesignStatistic(String startTime, String endTime, List ids, String email, String role); + List getDesignStatistic(String startTime, String endTime, List ids, String email, + String role, String organizationName); List selectDeleteList(); } diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 72e2b4b9..49f28f48 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -3427,26 +3427,30 @@ public class AccountServiceImpl extends ServiceImpl impl null ).sheet().doReadSync(); + // 只有当前子账号数量为0时允许批量上传 + QueryWrapper qw = new QueryWrapper<>(); + qw.lambda().eq(Account::getSystemUser, 8) + .eq(Account::getOrganizationName, parent.getOrganizationName()); + List accounts = accountMapper.selectList(qw); + if (!accounts.isEmpty()){ + throw new BusinessException("permit.bulk.creation", ResultEnum.PROMPT.getCode()); + } + if (importList.size() > parent.getSubAccountNum() - 1){ + throw new BusinessException("Action required: You cannot create [" +importList.size() + "] sub-accounts (Current quota: [" + (parent.getSubAccountNum() - 1) + "])."); + } // 示例:打印或保存 for (SubAccountImportDTO dto : importList) { - // 只有当前子账号数量为0时允许批量上传 - QueryWrapper qw = new QueryWrapper<>(); - qw.lambda().eq(Account::getSystemUser, 8) - .eq(Account::getOrganizationName, parent.getOrganizationName()); - List accounts = accountMapper.selectList(qw); - if (!accounts.isEmpty()){ - throw new BusinessException("permit.bulk.creation", ResultEnum.PROMPT.getCode()); - } - if (importList.size() > parent.getSubAccountNum() - 1){ - throw new BusinessException("Action required: You cannot create [" +importList.size() + "] sub-accounts (Current quota: [" + (parent.getSubAccountNum() - 1) + "])."); - } AddSubAccountDTO addSubAccountDTO = new AddSubAccountDTO(); addSubAccountDTO.setUserEmail(dto.getEmail()); addSubAccountDTO.setUserName(dto.getEmail().substring(0, dto.getEmail().indexOf("@"))); addSubAccountDTO.setUserPassword(md5(parent.getOrganizationName().toLowerCase() + "abc")); // 添加用户 - addSubAccount(addSubAccountDTO); + try { + addSubAccount(addSubAccountDTO); + } catch (BusinessException e){ + log.warn("批量导入业务报错, {}", e.getMsg()); + } } return true; diff --git a/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java b/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java index d9f23c23..f71be2f9 100644 --- a/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java @@ -163,7 +163,7 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl>> [asyncInitialize] 当前线程:" + Thread.currentThread().getName()); String progressKey = String.valueOf(brandId); - ProgressDTO progressDTO = new ProgressDTO(0, 0, false, null); - redisUtil.setTaskProgressDTO(progressKey, progressDTO); + ProgressDTO progressDTO = redisUtil.getTaskProgressDTO(progressKey); + + if (Objects.isNull(progressDTO)) { + progressDTO = new ProgressDTO(0, 0, false, null); + redisUtil.setTaskProgressDTO(progressKey, progressDTO); + } try { List brandRelLibraries = brandRelLibraryMapper.selectList( diff --git a/src/main/resources/mapper/primary/DesignMapper.xml b/src/main/resources/mapper/primary/DesignMapper.xml index 34c86c92..4fa43310 100644 --- a/src/main/resources/mapper/primary/DesignMapper.xml +++ b/src/main/resources/mapper/primary/DesignMapper.xml @@ -45,6 +45,9 @@ a.system_user IN (0, 1, 2, 3, 4) + + AND a.organization_name = #{organizationName} + AND b.create_date between #{startTime} and #{endTime}