8 changed files with 79 additions and 13 deletions
@ -0,0 +1,14 @@ |
|||
package com.project.information.domain.enums; |
|||
|
|||
import com.project.base.domain.enums.HasValueEnum; |
|||
import lombok.Getter; |
|||
import lombok.RequiredArgsConstructor; |
|||
|
|||
@RequiredArgsConstructor |
|||
@Getter |
|||
public enum KnowlegeTypeEnum implements HasValueEnum<Integer> { |
|||
Accurate_Grasp(0 , "精准掌握") , |
|||
Vague_Grasp(1 , "模糊掌握"); |
|||
private final Integer value; |
|||
private final String desc; |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.project.information.domain.service; |
|||
|
|||
import com.project.base.domain.result.Result; |
|||
import com.project.information.domain.dto.KnowledgePointStatisticsDTO; |
|||
|
|||
public interface GetStatisticsKnowledgePointDomainService { |
|||
|
|||
Result<KnowledgePointStatisticsDTO> getStatistics(Long subLineId) throws Exception; |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.project.information.domain.service.impl; |
|||
|
|||
import com.project.base.domain.result.Result; |
|||
import com.project.information.domain.dto.KnowledgePointStatisticsDTO; |
|||
import com.project.information.domain.entity.InformationEntity; |
|||
import com.project.information.domain.service.GetStatisticsKnowledgePointDomainService; |
|||
import com.project.information.domain.service.InformationBaseService; |
|||
import com.project.information.mapper.KnowledgePointMapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class GetStatisticsKnowledgePointDomainServiceImpl implements GetStatisticsKnowledgePointDomainService { |
|||
|
|||
@Autowired |
|||
private KnowledgePointMapper knowledgePointMapper; |
|||
@Autowired |
|||
private InformationBaseService informationBaseService; |
|||
@Override |
|||
public Result<KnowledgePointStatisticsDTO> getStatistics(Long subLineId) throws Exception { |
|||
KnowledgePointStatisticsDTO dto = knowledgePointMapper.selectBySubLineId(subLineId); |
|||
List<Long> relatedDocumentList = informationBaseService.lambdaQuery().select(InformationEntity::getId) |
|||
.eq(InformationEntity::getSubLineId, subLineId).list() |
|||
.stream().map(InformationEntity::getId).toList(); |
|||
dto.setRelatedDocumentList(relatedDocumentList); |
|||
return Result.success(dto); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue