BUGFIX:子账号批量导入、brand dna返回计算时间、按权限范围查询design频次

This commit is contained in:
2025-08-26 15:49:02 +08:00
parent 3cc329f983
commit 83ba69c950
5 changed files with 28 additions and 16 deletions

View File

@@ -18,7 +18,8 @@ public interface DesignMapper extends CommonMapper<Design> {
//返回插入数据后生成的主键
Long insertDesign(Design design);
List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime, List<Long> ids, String email, String role);
List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime, List<Long> ids, String email,
String role, String organizationName);
List<Design> selectDeleteList();
}

View File

@@ -3427,26 +3427,30 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
null
).sheet().doReadSync();
// 只有当前子账号数量为0时允许批量上传
QueryWrapper<Account> qw = new QueryWrapper<>();
qw.lambda().eq(Account::getSystemUser, 8)
.eq(Account::getOrganizationName, parent.getOrganizationName());
List<Account> 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<Account> qw = new QueryWrapper<>();
qw.lambda().eq(Account::getSystemUser, 8)
.eq(Account::getOrganizationName, parent.getOrganizationName());
List<Account> 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;

View File

@@ -163,7 +163,7 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
default:
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
}
return designMapper.getDesignStatistic(startTime, endTime, ids, email, role);
return designMapper.getDesignStatistic(startTime, endTime, ids, email, role, account.getOrganizationName());
} else {
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
}

View File

@@ -58,8 +58,12 @@ public class ProductImageServiceImpl implements ProductImageService {
System.out.println(">>> [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<BrandRelLibrary> brandRelLibraries = brandRelLibraryMapper.selectList(

View File

@@ -45,6 +45,9 @@
a.system_user IN (0, 1, 2, 3, 4)
</when>
</choose>
<if test="organizationName != null and organizationName != ''">
AND a.organization_name = #{organizationName}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND b.create_date between #{startTime} and #{endTime}
</if>