提交 107e2609 作者: 925993793@qq.com

调试修改

上级 19ce910b
......@@ -288,6 +288,10 @@ public class FileController {
*/
@PostMapping("/importDataInfo")
public Result<?> importDataInfo(HttpServletRequest request){
String subjectId = request.getParameter("subjectId");
if (StringUtils.isBlank(subjectId)) {
return Result.FAIL(500, "专题id不能为空");
}
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
if (fileMap.size() < 1) {
......@@ -298,7 +302,7 @@ public class FileController {
String fileSuffix = multipartFile.getOriginalFilename().substring(index + 1);
if ("xls".equals(fileSuffix) || "xlsx".equals(fileSuffix)) {
CompletableFuture.runAsync(() -> {
String subjectId = request.getParameter("subjectId");
try {
byte[] fileData = multipartFile.getBytes();
//读取文件内容
......
package com.zzsn.event.controller;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONObject;
......@@ -12,10 +11,9 @@ import com.obs.services.model.PutObjectResult;
import com.zzsn.event.constant.Result;
import com.zzsn.event.entity.*;
import com.zzsn.event.es.EsService;
import com.zzsn.event.feign.api.RemoteModelService;
import com.zzsn.event.service.*;
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.es.SpecialInformation;
import com.zzsn.event.xxljob.entity.XxlJobInfo;
......@@ -27,7 +25,6 @@ import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -37,7 +34,10 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
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.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
......@@ -91,6 +91,8 @@ public class SubjectManageController {
private KafkaTemplate<String, String> kafkaTemplate;
@Autowired
private PythonUtil pythonUtil;
@Autowired
private RemoteModelService remoteModelService;
@Value("${kafka.topic.subject.run:}")
......@@ -564,9 +566,13 @@ public class SubjectManageController {
@PostMapping("/configScoreModel")
public Result<?> configScoreModel(@RequestBody ScoreModelVo scoreModelVo) {
scoreModelService.addOrUpdate(scoreModelVo, 1);
//调用接口,重新打分
CompletableFuture.runAsync(() -> remoteModelService.reScoreRequest(scoreModelVo.getSubjectId(), "1887695061047672834"));
return Result.OK();
}
/**
* 专题打分模型配置信息详情
*
......
package com.zzsn.event.controller;
import cn.hutool.http.HttpUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zzsn.event.constant.Result;
......@@ -12,7 +11,6 @@ import com.zzsn.event.xxljob.service.IXxlJobInfoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.util.List;
......
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);
}
......@@ -379,6 +379,7 @@ public class InformationServiceImpl implements InformationService {
}
//处理时间格式
specialInformation.setPublishDate(EsDateUtil.esFieldDateFormat(specialInformation.getPublishDate()));
specialInformation.setCreateDate(EsDateUtil.esFieldDateFormat(specialInformation.getCreateDate()));
specialInformation.setUpdateDate(EsDateUtil.esFieldDateFormat(DateUtil.dateToString(new Date())));
ESData esData = new ESData();
BeanUtil.copyProperties(specialInformation, esData);
......
......@@ -28,6 +28,7 @@ import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo;
import com.zzsn.event.vo.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -674,7 +675,9 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
}
}
}
redisUtil.rpushMultipleValues(Constants.HISTORY_DATE_QUEUE + subject.getSubjectCode(), newDateList.toArray(new String[0]));
if (CollectionUtils.isNotEmpty(newDateList)) {
redisUtil.rpushMultipleValues(Constants.HISTORY_DATE_QUEUE + subject.getSubjectCode(), newDateList.toArray(new String[0]));
}
}
}
}
......
......@@ -75,8 +75,6 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
private static final String KEYWORDS_TYPE_ID = "1476498704680194050";
//默认项目
private static final String PROJECT_ID = "1476527644425682945";
//默认绑定TPU流程
private static final String[] DEFAULT_ARRANGE_ID = {"1877652205629173761","1887695061047672834"};
@Override
......@@ -92,13 +90,16 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
modifyKeyword(subjectId, subject.getSubjectName(), keywords);
//默认绑定tpu流程
List<ClbModelArrangeSubjectMap> tpuList = new ArrayList<>();
for (String arrangeId : DEFAULT_ARRANGE_ID) {
ClbModelArrangeSubjectMap tpu = new ClbModelArrangeSubjectMap();
tpu.setSubjectId(subject.getId());
tpu.setArrangeId(arrangeId);
tpu.setType("baseDateToSubject");
tpuList.add(tpu);
}
ClbModelArrangeSubjectMap tpu = new ClbModelArrangeSubjectMap();
tpu.setSubjectId(subject.getId());
tpu.setArrangeId("1877652205629173761");
tpu.setType("baseDateToSubject");
tpuList.add(tpu);
ClbModelArrangeSubjectMap tpu1 = new ClbModelArrangeSubjectMap();
tpu1.setSubjectId(subject.getId());
tpu1.setArrangeId("1887436365952548866");
tpu1.setType("yjzxPlatFormToSubject");
tpuList.add(tpu1);
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}]}]";
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论