|
@@ -9,6 +9,7 @@ import api.common.pojo.param.project.SceneScoreParam;
|
|
|
import api.common.pojo.param.project.SimulationManualProjectKafkaParam;
|
|
|
import api.common.pojo.param.project.SimulationManualProjectParam;
|
|
|
import api.common.pojo.param.system.DictParam;
|
|
|
+import api.common.pojo.po.algorithm.AlgorithmPO;
|
|
|
import api.common.pojo.po.project.*;
|
|
|
import api.common.pojo.po.scene.ScenePackageSublistPO;
|
|
|
import api.common.pojo.vo.project.*;
|
|
@@ -29,6 +30,7 @@ import com.css.simulation.resource.system.service.DictService;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import lombok.SneakyThrows;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -42,6 +44,7 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
@Autowired
|
|
@@ -78,6 +81,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
int add = simulationProjectMapper.add(po);
|
|
|
if(add > 0){
|
|
|
+ //第三方算法存到算发表(索为)
|
|
|
+// insertOtherAlgorithm(param);
|
|
|
+
|
|
|
return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,ResponseBodyVO.Response.SUCCESS.getMessage(),po.getId());
|
|
|
}
|
|
|
return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"添加失败");
|
|
@@ -92,6 +98,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
po.updatePo(AuthUtil.getCurrentUserId());
|
|
|
int update = simulationProjectMapper.update(po);
|
|
|
if(update > 0){
|
|
|
+ //第三方算法存到算发表(索为)
|
|
|
+// insertOtherAlgorithm(param);
|
|
|
return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,ResponseBodyVO.Response.SUCCESS.getMessage(),po.getId());
|
|
|
}
|
|
|
|
|
@@ -199,6 +207,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
@SneakyThrows
|
|
|
@Override
|
|
|
public ResponseBodyVO updateProjectNowRunState(SimulationManualProjectParam param) {
|
|
|
+ log.info("updateProjectNowRunState_id:"+param.getId());
|
|
|
+ log.info("updateProjectNowRunState_nowRunState:"+param.getNowRunState());
|
|
|
|
|
|
SimulationManualProjectPo po = simulationProjectMapper.selectProjectById(param);
|
|
|
|
|
@@ -245,6 +255,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
kafkaParameter.setTopic(ProjectConstants.RUN_TASK_TOPIC);
|
|
|
String data = JsonUtil.beanToJson(kafkaParam);
|
|
|
kafkaParameter.setData(data);
|
|
|
+ log.info("推送消息到kafka:"+data);
|
|
|
kafkaService.send(kafkaParameter);
|
|
|
}
|
|
|
|
|
@@ -759,6 +770,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
//po.setRuleView(param.getRuleView());
|
|
|
po.setIsChoiceGpu(param.getIsChoiceGpu());
|
|
|
po.setNowRunState(param.getNowRunState());
|
|
|
+ po.setAlgorithmType(param.getAlgorithmType());
|
|
|
return po;
|
|
|
|
|
|
}
|
|
@@ -1839,4 +1851,24 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
params.put("createUserId", AuthUtil.getCurrentUserId());
|
|
|
return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, simulationProjectMapper.selectEvaluationLevel(params));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private void insertOtherAlgorithm(SimulationManualProjectParam param){
|
|
|
+ if(ProjectConstants.SY_ALGORITHM_TYPE.equals(param.getAlgorithmType())){
|
|
|
+ AlgorithmPO po = new AlgorithmPO();
|
|
|
+ po.setId(param.getAlgorithm());
|
|
|
+ po.setAlgorithmName(param.getAlgorithmName());
|
|
|
+ AlgorithmPO po1 = simulationProjectMapper.selectalgorithmByQuery(po);
|
|
|
+ if(po1 == null){
|
|
|
+ simulationProjectMapper.insertOtherAlgorithm(po);
|
|
|
+ }else{
|
|
|
+ if(!po1.getAlgorithmName().equals(param.getAlgorithmName())){
|
|
|
+ simulationProjectMapper.updateOtherAlgorithm(po);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|