BUGFIX:1.生成的图案在design时未加入到library
2.获取组织名时出现空字符串 TASK:1. 允许超级管理员按组织名查询用户design频次
This commit is contained in:
@@ -52,7 +52,8 @@ public class ConvenientInquiryController {
|
|||||||
@ApiOperation("获取指定时间区间内所有用户design的使用情况")
|
@ApiOperation("获取指定时间区间内所有用户design的使用情况")
|
||||||
@GetMapping("/getDesignStatistic")
|
@GetMapping("/getDesignStatistic")
|
||||||
public Response<List<UserDesignStatisticDTO>> getDesignStatistic(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,
|
public Response<List<UserDesignStatisticDTO>> getDesignStatistic(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,
|
||||||
@RequestParam(required = false) List<Long> ids, @RequestParam(required = false) String email) {
|
@RequestParam(required = false) List<Long> ids, @RequestParam(required = false) String email,
|
||||||
|
@RequestParam(required = false) String organizationName) {
|
||||||
/*Long accountId = UserContext.getUserHolder().getId();
|
/*Long accountId = UserContext.getUserHolder().getId();
|
||||||
String userEmail = accountService.getById(accountId).getUserEmail();
|
String userEmail = accountService.getById(accountId).getUserEmail();
|
||||||
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L)
|
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L)
|
||||||
@@ -75,7 +76,7 @@ public class ConvenientInquiryController {
|
|||||||
} else {
|
} else {
|
||||||
return Response.fail("Sorry, you don't have permission");
|
return Response.fail("Sorry, you don't have permission");
|
||||||
}*/
|
}*/
|
||||||
return Response.success(convenientInquiryService.getDesignStatistic(startTime, endTime, ids, email));
|
return Response.success(convenientInquiryService.getDesignStatistic(startTime, endTime, ids, email, organizationName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ public class ProjectQueryDTO extends PageQueryBaseVo {
|
|||||||
private Integer intersection;
|
private Integer intersection;
|
||||||
|
|
||||||
// todo 获取历史列表,允许传入多个类型
|
// todo 获取历史列表,允许传入多个类型
|
||||||
// private List<String> process;
|
private List<String> process;
|
||||||
private String process;
|
// private String process;
|
||||||
|
|
||||||
private Integer asc;
|
private Integer asc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -244,4 +244,6 @@ public interface AccountService extends IService<Account> {
|
|||||||
void checkEduAdminExpireStatus();
|
void checkEduAdminExpireStatus();
|
||||||
|
|
||||||
void setEduAdminToExpire(Account adminAccount);
|
void setEduAdminToExpire(Account adminAccount);
|
||||||
|
|
||||||
|
String getOrganizationTypeByRole(Integer roleNum);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ public interface ConvenientInquiryService extends IService<Questionnaire> {
|
|||||||
|
|
||||||
IPage<TrialOrder> getTrial(QueryUserConditionsVO queryUserConditionsVO);
|
IPage<TrialOrder> getTrial(QueryUserConditionsVO queryUserConditionsVO);
|
||||||
|
|
||||||
List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime, List<Long> ids, String email);
|
List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime, List<Long> ids,
|
||||||
|
String email, String organizationName);
|
||||||
|
|
||||||
QuestionnaireFeedbackVO getQuestionnaireInfo();
|
QuestionnaireFeedbackVO getQuestionnaireInfo();
|
||||||
|
|
||||||
|
|||||||
@@ -3570,6 +3570,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
@Override
|
@Override
|
||||||
public Set<String> organizationNameSearch(String type, String name) {
|
public Set<String> organizationNameSearch(String type, String name) {
|
||||||
QueryWrapper<Account> qw = new QueryWrapper<>();
|
QueryWrapper<Account> qw = new QueryWrapper<>();
|
||||||
|
qw.lambda().ne(Account::getOrganizationName, "").isNotNull(Account::getOrganizationName);
|
||||||
if (!StringUtil.isNullOrEmpty(name)) {
|
if (!StringUtil.isNullOrEmpty(name)) {
|
||||||
qw.lambda().like(Account::getOrganizationName, name);
|
qw.lambda().like(Account::getOrganizationName, name);
|
||||||
}
|
}
|
||||||
@@ -3657,6 +3658,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (Objects.isNull(organization)){
|
||||||
|
organization = convenientInquiryService.addOrganization(adminAcc.getOrganizationName(), getOrganizationTypeByRole(adminAcc.getSystemUser()));
|
||||||
|
}
|
||||||
if (isActive){
|
if (isActive){
|
||||||
organization.setStatus(1);
|
organization.setStatus(1);
|
||||||
} else {
|
} else {
|
||||||
@@ -3666,4 +3670,19 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
organizationMapper.updateById(organization);
|
organizationMapper.updateById(organization);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOrganizationTypeByRole(Integer roleNum){
|
||||||
|
String type;
|
||||||
|
switch (roleNum){
|
||||||
|
case 5:
|
||||||
|
type = "Enterprise";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
type = "Education";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
type = null;
|
||||||
|
}
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -581,13 +581,20 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
while (sketchIterator.hasNext()) {
|
while (sketchIterator.hasNext()) {
|
||||||
CollectionSketchDTO sketchBoard = sketchIterator.next();
|
CollectionSketchDTO sketchBoard = sketchIterator.next();
|
||||||
String level2Type = sketchBoard.getLevel2Type();
|
String level2Type = sketchBoard.getLevel2Type();
|
||||||
String level3Type = "";
|
String level3Type = null;
|
||||||
if ("Collection".equals(sketchBoard.getDesignType())) {
|
if ("Collection".equals(sketchBoard.getDesignType())) {
|
||||||
level3Type = collectionElementMapper.selectOne(new LambdaQueryWrapper<CollectionElement>().eq(CollectionElement::getId, sketchBoard.getSketchBoardId()).select(CollectionElement::getLevel3Type)).getLevel3Type();
|
level3Type = collectionElementMapper.selectOne(new LambdaQueryWrapper<CollectionElement>().eq(CollectionElement::getId, sketchBoard.getSketchBoardId()).select(CollectionElement::getLevel3Type)).getLevel3Type();
|
||||||
} else if ("Library".equals(sketchBoard.getDesignType())){
|
} else if ("Library".equals(sketchBoard.getDesignType())){
|
||||||
level3Type = libraryService.getById(sketchBoard.getSketchBoardId()).getLevel3Type();
|
level3Type = libraryService.getById(sketchBoard.getSketchBoardId()).getLevel3Type();
|
||||||
|
} else if ("Generate".equals(sketchBoard.getDesignType())){
|
||||||
|
GenerateDetail generateDetail = generateDetailMapper.selectById(sketchBoard.getSketchBoardId());
|
||||||
|
assert generateDetail != null;
|
||||||
|
Generate generate = generateMapper.selectById(generateDetail.getGenerateId());
|
||||||
|
assert generate != null;
|
||||||
|
level3Type = GenerateServiceImpl.extractGender(generate.getGenerateType());
|
||||||
}
|
}
|
||||||
//判断性别和当前project性别是否一致,不一致则移除
|
//判断性别和当前project性别是否一致,不一致则移除
|
||||||
|
assert level3Type != null;
|
||||||
if (!level3Type.equalsIgnoreCase(designDTO.getModelSex())) {
|
if (!level3Type.equalsIgnoreCase(designDTO.getModelSex())) {
|
||||||
sketchIterator.remove();
|
sketchIterator.remove();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime, List<Long> ids,
|
public List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime, List<Long> ids,
|
||||||
String email) {
|
String email, String organizationName) {
|
||||||
Long accountId = UserContext.getUserHolder().getId();
|
Long accountId = UserContext.getUserHolder().getId();
|
||||||
Account account = accountService.getById(accountId);
|
Account account = accountService.getById(accountId);
|
||||||
// 允许查看数据的用户id
|
// 允许查看数据的用户id
|
||||||
@@ -166,6 +166,8 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
role = "prsn";
|
role = "prsn";
|
||||||
|
// 如果时个人版的管理员,允许查看所有人的信息,并可以查看指定组织的design数据
|
||||||
|
account.setOrganizationName(organizationName);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
|
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
|
||||||
@@ -654,7 +656,8 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
|||||||
if (Objects.nonNull(organization)){
|
if (Objects.nonNull(organization)){
|
||||||
account.setOrganizationId(organization.getId());
|
account.setOrganizationId(organization.getId());
|
||||||
} else {
|
} else {
|
||||||
organization = addOrganization(accountAddDTO.getOrganizationName(), organization.getType());
|
String type = accountService.getOrganizationTypeByRole(account.getSystemUser());
|
||||||
|
organization = addOrganization(accountAddDTO.getOrganizationName(), type);
|
||||||
account.setOrganizationName(accountAddDTO.getOrganizationName());
|
account.setOrganizationName(accountAddDTO.getOrganizationName());
|
||||||
account.setOrganizationId(organization.getId());
|
account.setOrganizationId(organization.getId());
|
||||||
}
|
}
|
||||||
@@ -1124,12 +1127,13 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
|||||||
private OrganizationMapper organizationMapper;
|
private OrganizationMapper organizationMapper;
|
||||||
|
|
||||||
public Organization addOrganization(String name, String type) {
|
public Organization addOrganization(String name, String type) {
|
||||||
Long accountId = UserContext.getUserHolder().getId();
|
// 用户登录时没有携带token,故无法获取用户信息
|
||||||
|
/*Long accountId = UserContext.getUserHolder().getId();
|
||||||
Account account = accountService.getById(accountId);
|
Account account = accountService.getById(accountId);
|
||||||
// 允许查看数据的用户id
|
// 允许查看数据的用户id
|
||||||
if (!ADMIN_IDS.contains(account.getId())) {
|
if (!ADMIN_IDS.contains(account.getId())) {
|
||||||
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
|
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
|
||||||
}
|
}*/
|
||||||
Organization organization = new Organization();
|
Organization organization = new Organization();
|
||||||
organization.setName(name);
|
organization.setName(name);
|
||||||
organization.setType(type);
|
organization.setType(type);
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import com.google.common.collect.Lists;
|
|||||||
import io.netty.util.internal.StringUtil;
|
import io.netty.util.internal.StringUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import okhttp3.*;
|
import okhttp3.*;
|
||||||
import org.apache.catalina.User;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -389,7 +388,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
|
|
||||||
// 生成library - 根据设计元素生成设计库信息
|
// 生成library - 根据设计元素生成设计库信息
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
String ageGroup = getAgeGroupByCollectionId(collectionId);
|
String ageGroup = getAgeGroupByProjectOrCollectionId(designDTO.getProjectId(), collectionId);
|
||||||
generateLibrary(elementVO, designDTO.getTimeZone(), ageGroup);
|
generateLibrary(elementVO, designDTO.getTimeZone(), ageGroup);
|
||||||
//处理关联关系,修复element覆盖得情况
|
//处理关联关系,修复element覆盖得情况
|
||||||
// List<CollectionElement> relationElements = collectionElementService.getByOnlyCollectionId(collectionId);
|
// List<CollectionElement> relationElements = collectionElementService.getByOnlyCollectionId(collectionId);
|
||||||
@@ -420,14 +419,21 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
return requestId;
|
return requestId;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getAgeGroupByCollectionId(Long collectionId){
|
private String getAgeGroupByProjectOrCollectionId(Long projectId, Long collectionId){
|
||||||
List<CollectionElement> byCollectionId = collectionElementService.getByCollectionId(collectionId);
|
if (Objects.nonNull(projectId)){
|
||||||
if (byCollectionId != null && !byCollectionId.isEmpty()){
|
Workspace workspace = workspaceService.getWSByProjectId(projectId);
|
||||||
Long projectId = byCollectionId.get(0).getProjectId();
|
if (workspace != null && !StringUtil.isNullOrEmpty(workspace.getAgeGroup())){
|
||||||
if (projectId != null && projectId != 0L){
|
return workspace.getAgeGroup();
|
||||||
Workspace workspace = workspaceService.getWSByProjectId(projectId);
|
}
|
||||||
if (workspace != null && !StringUtil.isNullOrEmpty(workspace.getAgeGroup())){
|
} else if (Objects.nonNull(collectionId) && collectionId != 0){
|
||||||
return workspace.getAgeGroup();
|
List<CollectionElement> byCollectionId = collectionElementService.getByCollectionId(collectionId);
|
||||||
|
if (byCollectionId != null && !byCollectionId.isEmpty()){
|
||||||
|
projectId = byCollectionId.get(0).getProjectId();
|
||||||
|
if (projectId != null && projectId != 0L){
|
||||||
|
Workspace workspace = workspaceService.getWSByProjectId(projectId);
|
||||||
|
if (workspace != null && !StringUtil.isNullOrEmpty(workspace.getAgeGroup())){
|
||||||
|
return workspace.getAgeGroup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -706,6 +712,9 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
if (!CollectionUtils.isEmpty(elementVO.getMarketingSketchElements())) {
|
if (!CollectionUtils.isEmpty(elementVO.getMarketingSketchElements())) {
|
||||||
elements.addAll(elementVO.getMarketingSketchElements());
|
elements.addAll(elementVO.getMarketingSketchElements());
|
||||||
}
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(elementVO.getGenerateCollectionElements())) {
|
||||||
|
elements.addAll(elementVO.getGenerateCollectionElements());
|
||||||
|
}
|
||||||
collectionElementService.saveLibraryByCollectionElement(elements, timeZone, elementVO.getModelSex(), ageGroup);
|
collectionElementService.saveLibraryByCollectionElement(elements, timeZone, elementVO.getModelSex(), ageGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2516,7 +2525,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
log.info("design python端运行时间:" + totalTimeInSeconds + " 秒");
|
log.info("design python端运行时间:" + totalTimeInSeconds + " 秒");
|
||||||
//生成library
|
//生成library
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
String ageGroup = getAgeGroupByCollectionId(collectionId);
|
String ageGroup = getAgeGroupByProjectOrCollectionId(designDTO.getProjectId(), collectionId);
|
||||||
generateLibrary(elementVO, designDTO.getTimeZone(), ageGroup);
|
generateLibrary(elementVO, designDTO.getTimeZone(), ageGroup);
|
||||||
//处理关联关系,修复element覆盖得情况
|
//处理关联关系,修复element覆盖得情况
|
||||||
// List<CollectionElement> relationElements = collectionElementService.getByOnlyCollectionId(collectionId);
|
// List<CollectionElement> relationElements = collectionElementService.getByOnlyCollectionId(collectionId);
|
||||||
|
|||||||
@@ -1929,11 +1929,11 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
if (Objects.nonNull(query.getEndDate())) {
|
if (Objects.nonNull(query.getEndDate())) {
|
||||||
queryWrapper.le("update_time", new Date(query.getEndDate()));
|
queryWrapper.le("update_time", new Date(query.getEndDate()));
|
||||||
}
|
}
|
||||||
// if (Objects.nonNull(query.getProcess()) && !query.getProcess().isEmpty()) {
|
if (Objects.nonNull(query.getProcess()) && !query.getProcess().isEmpty()) {
|
||||||
if (!StringUtils.isEmpty(query.getProcess())) {
|
// if (!StringUtils.isEmpty(query.getProcess())) {
|
||||||
// todo 获取历史列表,允许传入多个类型
|
// todo 获取历史列表,允许传入多个类型
|
||||||
// queryWrapper.in("process", query.getProcess());
|
queryWrapper.in("process", query.getProcess());
|
||||||
queryWrapper.eq("process", query.getProcess());
|
// queryWrapper.eq("process", query.getProcess());
|
||||||
}
|
}
|
||||||
// 新增分类过滤
|
// 新增分类过滤
|
||||||
if (CollectionUtil.isNotEmpty(query.getClassificationIdList())) {
|
if (CollectionUtil.isNotEmpty(query.getClassificationIdList())) {
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
server.port=5567
|
server.port=5567
|
||||||
|
|
||||||
spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver
|
spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
#spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
|
spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida_back?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
#spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/test_aida_3.1?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
#spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/test_aida_3.1?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
spring.datasource.primary.username=aida_con
|
spring.datasource.primary.username=aida_con
|
||||||
spring.datasource.primary.password=123456
|
spring.datasource.primary.password=123456
|
||||||
|
|||||||
@@ -41,9 +41,9 @@
|
|||||||
<when test="role == 'edu'">
|
<when test="role == 'edu'">
|
||||||
a.system_user IN (7, 8)
|
a.system_user IN (7, 8)
|
||||||
</when>
|
</when>
|
||||||
<when test="role == 'prsn'">
|
<!--<when test="role == 'prsn'">
|
||||||
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 != ''">
|
<if test="organizationName != null and organizationName != ''">
|
||||||
AND a.organization_name = #{organizationName}
|
AND a.organization_name = #{organizationName}
|
||||||
|
|||||||
Reference in New Issue
Block a user