BUGFIX:子账号批量导入、brand dna返回计算时间、按权限范围查询design频次
This commit is contained in:
@@ -18,7 +18,8 @@ public interface DesignMapper extends CommonMapper<Design> {
|
|||||||
//返回插入数据后生成的主键
|
//返回插入数据后生成的主键
|
||||||
Long insertDesign(Design 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();
|
List<Design> selectDeleteList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3427,26 +3427,30 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
null
|
null
|
||||||
).sheet().doReadSync();
|
).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) {
|
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 addSubAccountDTO = new AddSubAccountDTO();
|
||||||
addSubAccountDTO.setUserEmail(dto.getEmail());
|
addSubAccountDTO.setUserEmail(dto.getEmail());
|
||||||
addSubAccountDTO.setUserName(dto.getEmail().substring(0, dto.getEmail().indexOf("@")));
|
addSubAccountDTO.setUserName(dto.getEmail().substring(0, dto.getEmail().indexOf("@")));
|
||||||
addSubAccountDTO.setUserPassword(md5(parent.getOrganizationName().toLowerCase() + "abc"));
|
addSubAccountDTO.setUserPassword(md5(parent.getOrganizationName().toLowerCase() + "abc"));
|
||||||
// 添加用户
|
// 添加用户
|
||||||
addSubAccount(addSubAccountDTO);
|
try {
|
||||||
|
addSubAccount(addSubAccountDTO);
|
||||||
|
} catch (BusinessException e){
|
||||||
|
log.warn("批量导入业务报错, {}", e.getMsg());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
|||||||
default:
|
default:
|
||||||
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
|
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 {
|
} else {
|
||||||
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
|
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,8 +58,12 @@ public class ProductImageServiceImpl implements ProductImageService {
|
|||||||
System.out.println(">>> [asyncInitialize] 当前线程:" + Thread.currentThread().getName());
|
System.out.println(">>> [asyncInitialize] 当前线程:" + Thread.currentThread().getName());
|
||||||
|
|
||||||
String progressKey = String.valueOf(brandId);
|
String progressKey = String.valueOf(brandId);
|
||||||
ProgressDTO progressDTO = new ProgressDTO(0, 0, false, null);
|
ProgressDTO progressDTO = redisUtil.getTaskProgressDTO(progressKey);
|
||||||
redisUtil.setTaskProgressDTO(progressKey, progressDTO);
|
|
||||||
|
if (Objects.isNull(progressDTO)) {
|
||||||
|
progressDTO = new ProgressDTO(0, 0, false, null);
|
||||||
|
redisUtil.setTaskProgressDTO(progressKey, progressDTO);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<BrandRelLibrary> brandRelLibraries = brandRelLibraryMapper.selectList(
|
List<BrandRelLibrary> brandRelLibraries = brandRelLibraryMapper.selectList(
|
||||||
|
|||||||
@@ -45,6 +45,9 @@
|
|||||||
a.system_user IN (0, 1, 2, 3, 4)
|
a.system_user IN (0, 1, 2, 3, 4)
|
||||||
</when>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
|
<if test="organizationName != null and organizationName != ''">
|
||||||
|
AND a.organization_name = #{organizationName}
|
||||||
|
</if>
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
AND b.create_date between #{startTime} and #{endTime}
|
AND b.create_date between #{startTime} and #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user