Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
107e2609
提交
107e2609
authored
2月 07, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调试修改
上级
19ce910b
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
47 行增加
和
13 行删除
+47
-13
FileController.java
src/main/java/com/zzsn/event/controller/FileController.java
+5
-1
SubjectManageController.java
...va/com/zzsn/event/controller/SubjectManageController.java
+11
-5
SubjectSimpleController.java
...va/com/zzsn/event/controller/SubjectSimpleController.java
+0
-2
RemoteModelService.java
...ain/java/com/zzsn/event/feign/api/RemoteModelService.java
+21
-0
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+1
-0
SubjectServiceImpl.java
.../java/com/zzsn/event/service/impl/SubjectServiceImpl.java
+3
-0
SubjectSimpleServiceImpl.java
...com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
+6
-5
没有找到文件。
src/main/java/com/zzsn/event/controller/FileController.java
浏览文件 @
107e2609
...
@@ -288,6 +288,10 @@ public class FileController {
...
@@ -288,6 +288,10 @@ public class FileController {
*/
*/
@PostMapping
(
"/importDataInfo"
)
@PostMapping
(
"/importDataInfo"
)
public
Result
<?>
importDataInfo
(
HttpServletRequest
request
){
public
Result
<?>
importDataInfo
(
HttpServletRequest
request
){
String
subjectId
=
request
.
getParameter
(
"subjectId"
);
if
(
StringUtils
.
isBlank
(
subjectId
))
{
return
Result
.
FAIL
(
500
,
"专题id不能为空"
);
}
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
Map
<
String
,
MultipartFile
>
fileMap
=
multipartRequest
.
getFileMap
();
Map
<
String
,
MultipartFile
>
fileMap
=
multipartRequest
.
getFileMap
();
if
(
fileMap
.
size
()
<
1
)
{
if
(
fileMap
.
size
()
<
1
)
{
...
@@ -298,7 +302,7 @@ public class FileController {
...
@@ -298,7 +302,7 @@ public class FileController {
String
fileSuffix
=
multipartFile
.
getOriginalFilename
().
substring
(
index
+
1
);
String
fileSuffix
=
multipartFile
.
getOriginalFilename
().
substring
(
index
+
1
);
if
(
"xls"
.
equals
(
fileSuffix
)
||
"xlsx"
.
equals
(
fileSuffix
))
{
if
(
"xls"
.
equals
(
fileSuffix
)
||
"xlsx"
.
equals
(
fileSuffix
))
{
CompletableFuture
.
runAsync
(()
->
{
CompletableFuture
.
runAsync
(()
->
{
String
subjectId
=
request
.
getParameter
(
"subjectId"
);
try
{
try
{
byte
[]
fileData
=
multipartFile
.
getBytes
();
byte
[]
fileData
=
multipartFile
.
getBytes
();
//读取文件内容
//读取文件内容
...
...
src/main/java/com/zzsn/event/controller/SubjectManageController.java
浏览文件 @
107e2609
package
com
.
zzsn
.
event
.
controller
;
package
com
.
zzsn
.
event
.
controller
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.alibaba.fastjson2.JSONObject
;
...
@@ -12,10 +11,9 @@ import com.obs.services.model.PutObjectResult;
...
@@ -12,10 +11,9 @@ import com.obs.services.model.PutObjectResult;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.feign.api.RemoteModelService
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.user.AuthUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
com.zzsn.event.xxljob.entity.XxlJobInfo
;
import
com.zzsn.event.xxljob.entity.XxlJobInfo
;
...
@@ -27,7 +25,6 @@ import org.apache.poi.hwpf.HWPFDocument;
...
@@ -27,7 +25,6 @@ import org.apache.poi.hwpf.HWPFDocument;
import
org.apache.poi.hwpf.extractor.WordExtractor
;
import
org.apache.poi.hwpf.extractor.WordExtractor
;
import
org.apache.poi.xwpf.extractor.XWPFWordExtractor
;
import
org.apache.poi.xwpf.extractor.XWPFWordExtractor
;
import
org.apache.poi.xwpf.usermodel.XWPFDocument
;
import
org.apache.poi.xwpf.usermodel.XWPFDocument
;
import
org.apache.poi.xwpf.usermodel.XWPFParagraph
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -37,7 +34,10 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -37,7 +34,10 @@ import org.springframework.web.multipart.MultipartFile;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.time.temporal.ChronoUnit
;
import
java.time.temporal.ChronoUnit
;
...
@@ -91,6 +91,8 @@ public class SubjectManageController {
...
@@ -91,6 +91,8 @@ public class SubjectManageController {
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
@Autowired
@Autowired
private
PythonUtil
pythonUtil
;
private
PythonUtil
pythonUtil
;
@Autowired
private
RemoteModelService
remoteModelService
;
@Value
(
"${kafka.topic.subject.run:}"
)
@Value
(
"${kafka.topic.subject.run:}"
)
...
@@ -564,9 +566,13 @@ public class SubjectManageController {
...
@@ -564,9 +566,13 @@ public class SubjectManageController {
@PostMapping
(
"/configScoreModel"
)
@PostMapping
(
"/configScoreModel"
)
public
Result
<?>
configScoreModel
(
@RequestBody
ScoreModelVo
scoreModelVo
)
{
public
Result
<?>
configScoreModel
(
@RequestBody
ScoreModelVo
scoreModelVo
)
{
scoreModelService
.
addOrUpdate
(
scoreModelVo
,
1
);
scoreModelService
.
addOrUpdate
(
scoreModelVo
,
1
);
//调用接口,重新打分
CompletableFuture
.
runAsync
(()
->
remoteModelService
.
reScoreRequest
(
scoreModelVo
.
getSubjectId
(),
"1887695061047672834"
));
return
Result
.
OK
();
return
Result
.
OK
();
}
}
/**
/**
* 专题打分模型配置信息详情
* 专题打分模型配置信息详情
*
*
...
...
src/main/java/com/zzsn/event/controller/SubjectSimpleController.java
浏览文件 @
107e2609
package
com
.
zzsn
.
event
.
controller
;
package
com
.
zzsn
.
event
.
controller
;
import
cn.hutool.http.HttpUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.constant.Result
;
...
@@ -12,7 +11,6 @@ import com.zzsn.event.xxljob.service.IXxlJobInfoService;
...
@@ -12,7 +11,6 @@ import com.zzsn.event.xxljob.service.IXxlJobInfoService;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.List
;
...
...
src/main/java/com/zzsn/event/feign/api/RemoteModelService.java
0 → 100644
浏览文件 @
107e2609
package
com
.
zzsn
.
event
.
feign
.
api
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
//feign调用
@FeignClient
(
value
=
"service-model"
)
public
interface
RemoteModelService
{
/**
* 重新打分请求
*
* @param subjectId 专题id
* @param flowId TPU流程id
* @author lkg
* @date 2025/2/7
*/
@GetMapping
(
"/modelArrange/clbBiz/detailSubjectDataWithFlow"
)
String
reScoreRequest
(
@RequestParam
(
"subjectId"
)
String
subjectId
,
@RequestParam
(
"flowId"
)
String
flowId
);
}
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
107e2609
...
@@ -379,6 +379,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -379,6 +379,7 @@ public class InformationServiceImpl implements InformationService {
}
}
//处理时间格式
//处理时间格式
specialInformation
.
setPublishDate
(
EsDateUtil
.
esFieldDateFormat
(
specialInformation
.
getPublishDate
()));
specialInformation
.
setPublishDate
(
EsDateUtil
.
esFieldDateFormat
(
specialInformation
.
getPublishDate
()));
specialInformation
.
setCreateDate
(
EsDateUtil
.
esFieldDateFormat
(
specialInformation
.
getCreateDate
()));
specialInformation
.
setUpdateDate
(
EsDateUtil
.
esFieldDateFormat
(
DateUtil
.
dateToString
(
new
Date
())));
specialInformation
.
setUpdateDate
(
EsDateUtil
.
esFieldDateFormat
(
DateUtil
.
dateToString
(
new
Date
())));
ESData
esData
=
new
ESData
();
ESData
esData
=
new
ESData
();
BeanUtil
.
copyProperties
(
specialInformation
,
esData
);
BeanUtil
.
copyProperties
(
specialInformation
,
esData
);
...
...
src/main/java/com/zzsn/event/service/impl/SubjectServiceImpl.java
浏览文件 @
107e2609
...
@@ -28,6 +28,7 @@ import com.zzsn.event.util.user.UserUtil;
...
@@ -28,6 +28,7 @@ import com.zzsn.event.util.user.UserUtil;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -674,9 +675,11 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
...
@@ -674,9 +675,11 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
}
}
}
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
newDateList
))
{
redisUtil
.
rpushMultipleValues
(
Constants
.
HISTORY_DATE_QUEUE
+
subject
.
getSubjectCode
(),
newDateList
.
toArray
(
new
String
[
0
]));
redisUtil
.
rpushMultipleValues
(
Constants
.
HISTORY_DATE_QUEUE
+
subject
.
getSubjectCode
(),
newDateList
.
toArray
(
new
String
[
0
]));
}
}
}
}
}
}
}
}
}
src/main/java/com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
浏览文件 @
107e2609
...
@@ -75,8 +75,6 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -75,8 +75,6 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
private
static
final
String
KEYWORDS_TYPE_ID
=
"1476498704680194050"
;
private
static
final
String
KEYWORDS_TYPE_ID
=
"1476498704680194050"
;
//默认项目
//默认项目
private
static
final
String
PROJECT_ID
=
"1476527644425682945"
;
private
static
final
String
PROJECT_ID
=
"1476527644425682945"
;
//默认绑定TPU流程
private
static
final
String
[]
DEFAULT_ARRANGE_ID
=
{
"1877652205629173761"
,
"1887695061047672834"
};
@Override
@Override
...
@@ -92,13 +90,16 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -92,13 +90,16 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
modifyKeyword
(
subjectId
,
subject
.
getSubjectName
(),
keywords
);
modifyKeyword
(
subjectId
,
subject
.
getSubjectName
(),
keywords
);
//默认绑定tpu流程
//默认绑定tpu流程
List
<
ClbModelArrangeSubjectMap
>
tpuList
=
new
ArrayList
<>();
List
<
ClbModelArrangeSubjectMap
>
tpuList
=
new
ArrayList
<>();
for
(
String
arrangeId
:
DEFAULT_ARRANGE_ID
)
{
ClbModelArrangeSubjectMap
tpu
=
new
ClbModelArrangeSubjectMap
();
ClbModelArrangeSubjectMap
tpu
=
new
ClbModelArrangeSubjectMap
();
tpu
.
setSubjectId
(
subject
.
getId
());
tpu
.
setSubjectId
(
subject
.
getId
());
tpu
.
setArrangeId
(
arrangeId
);
tpu
.
setArrangeId
(
"1877652205629173761"
);
tpu
.
setType
(
"baseDateToSubject"
);
tpu
.
setType
(
"baseDateToSubject"
);
tpuList
.
add
(
tpu
);
tpuList
.
add
(
tpu
);
}
ClbModelArrangeSubjectMap
tpu1
=
new
ClbModelArrangeSubjectMap
();
tpu1
.
setSubjectId
(
subject
.
getId
());
tpu1
.
setArrangeId
(
"1887436365952548866"
);
tpu1
.
setType
(
"yjzxPlatFormToSubject"
);
tpuList
.
add
(
tpu1
);
clbModelArrangeSubjectMapService
.
saveBatch
(
tpuList
);
clbModelArrangeSubjectMapService
.
saveBatch
(
tpuList
);
//默认通用打分配置
//默认通用打分配置
String
defaultConfig
=
"[{\"id\": \"1-1\", \"name\": \"信息源组\", \"children\": [], \"indexWeight\": 10}, {\"id\": \"1-2\", \"name\": \"文章长度\", \"indexWeight\": 15, \"keyWordsTopLimit\": 2500, \"keyWordsLowerLimit\": 500}, {\"id\": \"1-3\", \"name\": \"内容\", \"children\": [{\"id\": \"1-3-1\", \"name\": \"内容-关键词\", \"keyWords\": \"KEY_WORD\", \"indexWeight\": 75, \"titleWeight\": 10, \"keyWordsTopLimit\": 15, \"keyWordsLowerLimit\": 3}]}]"
;
String
defaultConfig
=
"[{\"id\": \"1-1\", \"name\": \"信息源组\", \"children\": [], \"indexWeight\": 10}, {\"id\": \"1-2\", \"name\": \"文章长度\", \"indexWeight\": 15, \"keyWordsTopLimit\": 2500, \"keyWordsLowerLimit\": 500}, {\"id\": \"1-3\", \"name\": \"内容\", \"children\": [{\"id\": \"1-3-1\", \"name\": \"内容-关键词\", \"keyWords\": \"KEY_WORD\", \"indexWeight\": 75, \"titleWeight\": 10, \"keyWordsTopLimit\": 15, \"keyWordsLowerLimit\": 3}]}]"
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论