Commit b034b1b3 authored by R10's avatar R10

Merge branch 'release_gdghg' of ssh://gitlab.gsstcloud.com:10022/poc/poc-api into release_gdghg

parents 4f0b5efb f8f0935e
......@@ -13,6 +13,8 @@ public class BizLongTextSummaryCacheConvert {
entity.setSummary(model.getSummary());
entity.setFileUrl(model.getFileUrl());
entity.setFileMd5(model.getFileMd5());
entity.setKeyword(model.getKeyword());
entity.setMindmap(model.getMindmap());
entity.setIsDeleted(model.getIsDeleted());
entity.setCreator(model.getCreator());
entity.setCreatedTime(model.getCreatedTime());
......@@ -27,6 +29,8 @@ public class BizLongTextSummaryCacheConvert {
model.setId(entity.getId());
model.setCorePoint(entity.getCorePoint());
model.setSummary(entity.getSummary());
model.setKeyword(entity.getKeyword());
model.setMindmap(entity.getMindmap());
model.setFileUrl(entity.getFileUrl());
model.setFileMd5(entity.getFileMd5());
model.setIsDeleted(entity.getIsDeleted());
......
package cn.com.poc.long_document.domain;
import java.util.List;
/**
* @author alex.yao
* @date 2025/8/29
*/
public class MindMap {
private String id;
private String topic;
private Boolean root;
private List<MindMap> children;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTopic() {
return topic;
}
public void setTopic(String topic) {
this.topic = topic;
}
public Boolean getRoot() {
return root;
}
public void setRoot(Boolean root) {
this.root = root;
}
public List<MindMap> getChildren() {
return children;
}
public void setChildren(List<MindMap> children) {
this.children = children;
}
}
package cn.com.poc.long_document.dto;
import cn.com.poc.long_document.domain.MindMap;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.List;
/**
* @author alex.yao
* @date 2025/6/18
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class LongTextSummaryDto {
private String summary;
private String corePoint;
private List<String> keyword;
private MindMap mindMap;
public List<String> getKeyword() {
return keyword;
}
public void setKeyword(List<String> keyword) {
this.keyword = keyword;
}
public MindMap getMindMap() {
return mindMap;
}
public void setMindMap(MindMap mindMap) {
this.mindMap = mindMap;
}
public String getSummary() {
return summary;
}
......
package cn.com.poc.long_document.entity;
package cn.com.poc.long_document.entity;
import javax.persistence.Column;
public class BizLongTextSummaryCacheEntity {
private static final long serialVersionUID = 1L;
......@@ -40,6 +42,34 @@ public class BizLongTextSummaryCacheEntity {
public void setSummary(java.lang.String summary){
this.summary = summary;
}
/** keyword
*关键词
*/
private java.lang.String keyword;
public java.lang.String getKeyword(){
return this.keyword;
}
public void setKeyword(java.lang.String keyword){
this.keyword = keyword;
}
/** mindmap
*思维导图
*/
private java.lang.String mindmap;
public java.lang.String getMindmap(){
return this.mindmap;
}
public void setMindmap(java.lang.String mindmap){
this.mindmap = mindmap;
}
/** file_url
*文件地址
*/
......
......@@ -72,6 +72,38 @@ public class BizLongTextSummaryCacheModel extends BaseModelClass implements Seri
this.summary = summary;
super.addValidField("summary");
}
/** keyword
*关键词
*/
private java.lang.String keyword;
@Column(name = "keyword",length = 2147483647)
public java.lang.String getKeyword(){
return this.keyword;
}
public void setKeyword(java.lang.String keyword){
this.keyword = keyword;
super.addValidField("keyword");
}
/** mindmap
*思维导图
*/
private java.lang.String mindmap;
@Column(name = "mindmap",length = 2147483647)
public java.lang.String getMindmap(){
return this.mindmap;
}
public void setMindmap(java.lang.String mindmap){
this.mindmap = mindmap;
super.addValidField("mindmap");
}
/** file_url
......
package cn.com.poc.long_document.service.impl;
package cn.com.poc.long_document.service.impl;
import cn.com.yict.framemax.core.service.impl.BaseServiceImpl;
import cn.com.poc.long_document.service.BizLongTextSummaryCacheService;
......@@ -10,103 +10,111 @@ import cn.com.yict.framemax.data.model.PagingInfo;
import org.springframework.stereotype.Service;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.stream.Collectors;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.util.Assert;
@Service
public class BizLongTextSummaryCacheServiceImpl extends BaseServiceImpl
implements BizLongTextSummaryCacheService {
@Resource
private BizLongTextSummaryCacheRepository repository;
public BizLongTextSummaryCacheEntity get(java.lang.Long id) throws Exception{
implements BizLongTextSummaryCacheService {
@Resource
private BizLongTextSummaryCacheRepository repository;
public BizLongTextSummaryCacheEntity get(java.lang.Long id) throws Exception {
Assert.notNull(id);
BizLongTextSummaryCacheModel model = this.repository.get(id);
if (model == null){
BizLongTextSummaryCacheModel model = this.repository.get(id);
if (model == null) {
return null;
}
if ("Y".equals(model.getIsDeleted())){
if ("Y".equals(model.getIsDeleted())) {
return null;
}
return BizLongTextSummaryCacheConvert.modelToEntity(model);
}
}
public List<BizLongTextSummaryCacheEntity> findByExample(BizLongTextSummaryCacheEntity example,PagingInfo pagingInfo) throws Exception{
List<BizLongTextSummaryCacheEntity> result = new ArrayList<BizLongTextSummaryCacheEntity>();
public List<BizLongTextSummaryCacheEntity> findByExample(BizLongTextSummaryCacheEntity example, PagingInfo pagingInfo) throws Exception {
List<BizLongTextSummaryCacheEntity> result = new ArrayList<BizLongTextSummaryCacheEntity>();
BizLongTextSummaryCacheModel model = new BizLongTextSummaryCacheModel();
if (example != null){
if (example != null) {
model = BizLongTextSummaryCacheConvert.entityToModel(example);
}
model.setIsDeleted("N");
List<BizLongTextSummaryCacheModel> models = this.repository.findByExample(model,pagingInfo);
List<BizLongTextSummaryCacheModel> models = this.repository.findByExample(model, pagingInfo);
if (CollectionUtils.isNotEmpty(models)) {
result = models.stream().map(BizLongTextSummaryCacheConvert::modelToEntity).collect(Collectors.toList());
}
return result;
}
public BizLongTextSummaryCacheEntity save(BizLongTextSummaryCacheEntity entity) throws Exception{
public BizLongTextSummaryCacheEntity save(BizLongTextSummaryCacheEntity entity) throws Exception {
Assert.notNull(entity);
entity.setId(null);
entity.setIsDeleted("N");
BizLongTextSummaryCacheModel model = BizLongTextSummaryCacheConvert.entityToModel(entity);
BizLongTextSummaryCacheModel saveModel = this.repository.save(model);
BizLongTextSummaryCacheModel saveModel = this.repository.save(model);
return BizLongTextSummaryCacheConvert.modelToEntity(saveModel);
}
public BizLongTextSummaryCacheEntity update(BizLongTextSummaryCacheEntity entity) throws Exception{
public BizLongTextSummaryCacheEntity update(BizLongTextSummaryCacheEntity entity) throws Exception {
Assert.notNull(entity);
Assert.notNull(entity.getId(),"update pk can not be null");
Assert.notNull(entity.getId(), "update pk can not be null");
BizLongTextSummaryCacheModel model = this.repository.get(entity.getId());
if (entity.getCorePoint() != null){
model.setCorePoint(entity.getCorePoint());
}
if (entity.getSummary() != null){
model.setSummary(entity.getSummary());
}
if (entity.getFileUrl() != null){
model.setFileUrl(entity.getFileUrl());
}
if (entity.getFileMd5() != null){
model.setFileMd5(entity.getFileMd5());
}
if (entity.getIsDeleted() != null){
model.setIsDeleted(entity.getIsDeleted());
}
if (entity.getCreator() != null){
model.setCreator(entity.getCreator());
}
if (entity.getCreatedTime() != null){
model.setCreatedTime(entity.getCreatedTime());
}
if (entity.getModifier() != null){
model.setModifier(entity.getModifier());
}
if (entity.getModifiedTime() != null){
model.setModifiedTime(entity.getModifiedTime());
}
if (entity.getSysVersion() != null){
model.setSysVersion(entity.getSysVersion());
}
BizLongTextSummaryCacheModel saveModel = this.repository.save(model);
if (entity.getCorePoint() != null) {
model.setCorePoint(entity.getCorePoint());
}
if (entity.getSummary() != null) {
model.setSummary(entity.getSummary());
}
if (entity.getFileUrl() != null) {
model.setFileUrl(entity.getFileUrl());
}
if (entity.getMindmap() != null) {
model.setMindmap(entity.getMindmap());
}
if (entity.getKeyword() != null) {
model.setKeyword(entity.getKeyword());
}
if (entity.getFileMd5() != null) {
model.setFileMd5(entity.getFileMd5());
}
if (entity.getIsDeleted() != null) {
model.setIsDeleted(entity.getIsDeleted());
}
if (entity.getCreator() != null) {
model.setCreator(entity.getCreator());
}
if (entity.getCreatedTime() != null) {
model.setCreatedTime(entity.getCreatedTime());
}
if (entity.getModifier() != null) {
model.setModifier(entity.getModifier());
}
if (entity.getModifiedTime() != null) {
model.setModifiedTime(entity.getModifiedTime());
}
if (entity.getSysVersion() != null) {
model.setSysVersion(entity.getSysVersion());
}
BizLongTextSummaryCacheModel saveModel = this.repository.save(model);
return BizLongTextSummaryCacheConvert.modelToEntity(saveModel);
}
public void deletedById(java.lang.Long id) throws Exception{
public void deletedById(java.lang.Long id) throws Exception {
Assert.notNull(id);
BizLongTextSummaryCacheModel model = this.repository.get(id);
if (model != null){
if ("N".equals(model.getIsDeleted())){
BizLongTextSummaryCacheModel model = this.repository.get(id);
if (model != null) {
if ("N".equals(model.getIsDeleted())) {
model.setIsDeleted("Y");
this.repository.save(model);
}
}
}
}
}
}
\ No newline at end of file
......@@ -70,19 +70,15 @@ public class KeyWordAnalyzer extends MeetingContentAnalysisAbstract<List<String>
double progress = ((double) (i + 1) / segmentationResultList.size()) * 100D;
logger.info("-------------关键词提取进度 {} %--------------", progress);
}
int start = generateContent.lastIndexOf("[");
int end = generateContent.lastIndexOf("]");
List<String> res = JsonUtils.deSerialize(generateContent.substring(start, end + 1), new TypeReference<List<String>>() {
}.getType());
return res;
} catch (Exception e) {
logger.error("关键词提取失败", e);
return Collections.emptyList();
}
if (StringUtils.isBlank(generateContent)) {
return Collections.emptyList();
}
// 转换格式 json to list
int start = generateContent.lastIndexOf("[");
int end = generateContent.lastIndexOf("]");
List<String> res = JsonUtils.deSerialize(generateContent.substring(start, end + 1), new TypeReference<List<String>>() {
}.getType());
return res;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment