Commit e5e16eac authored by duanruiming's avatar duanruiming

[add] 策略库优化

parent 36891dbf
......@@ -7,6 +7,7 @@ import net.wanji.opt.synthesis.pojo.StrategyControlDataEntity;
import net.wanji.opt.synthesis.pojo.StrategyControlDetailList;
import net.wanji.opt.synthesis.pojo.StrategyFactoryEntity;
import net.wanji.opt.synthesis.pojo.vo.StrategyControlVO;
import net.wanji.opt.synthesis.pojo.vo.StrategyFactoryQueryVO;
import net.wanji.opt.synthesis.service.StrategyControlService;
import org.apache.ibatis.annotations.Param;
import org.springframework.validation.annotation.Validated;
......@@ -137,15 +138,15 @@ public class StrategyControlController {
return strategyControlService.strategyPlanSave(list);
}
@ApiOperation(value = "策略库查询列表", notes = "策略库查询列表",
@ApiOperation(value = "策略库分页查询列表", notes = "策略库分页查询列表",
response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/strategyFactoryList")
@PostMapping(value = "/strategyFactoryList")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = StrategyFactoryEntity.class),
})
public JsonViewObject strategyFactoryList() throws Exception {
return strategyControlService.strategyFactoryList();
public JsonViewObject strategyFactoryList(@RequestBody StrategyFactoryQueryVO vo) throws Exception {
return strategyControlService.strategyFactoryList(vo);
}
@ApiOperation(value = "策略管理计划保存", notes = "策略管理计划列表查询",
......@@ -161,7 +162,7 @@ public class StrategyControlController {
}
@ApiOperation(value = "策略管理计划保存", notes = "策略管理计划列表查询",
@ApiOperation(value = "策略管理计划删除", notes = "策略管理计划删除",
response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/strategyFactoryDel")
......
......@@ -31,7 +31,7 @@ public class StrategyFactoryEntity {
@ApiModelProperty("算法厂商")
@TableField("company")
private String company;
@ApiModelProperty("备注")
@ApiModelProperty("策略详情")
@TableField("mark")
private String mark;
}
package net.wanji.opt.synthesis.pojo.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author duanruiming
* @date 2025/01/16 16:52
*/
@Data
public class StrategyFactoryQueryVO {
@ApiModelProperty("场景")
private Integer scene;
@ApiModelProperty("策略")
private String strategyName;
@ApiModelProperty("策略编号")
private String strategyNo;
@ApiModelProperty("算法厂商")
private String company;
@ApiModelProperty("当前页")
private int currentPage;
@ApiModelProperty("每页数量")
private int pageSize;
}
......@@ -5,6 +5,8 @@ import net.wanji.opt.synthesis.pojo.StrategyControlDataEntity;
import net.wanji.opt.synthesis.pojo.StrategyControlDetailList;
import net.wanji.opt.synthesis.pojo.vo.StrategyControlVO;
import net.wanji.opt.synthesis.pojo.StrategyFactoryEntity;
import net.wanji.opt.synthesis.pojo.vo.StrategyFactoryQueryVO;
import org.apache.ibatis.annotations.Param;
/**
* @author duanruiming
......@@ -22,7 +24,7 @@ public interface StrategyControlService {
JsonViewObject strategyPlanDetail(String crossId) throws Exception;
JsonViewObject strategyPush(StrategyControlDetailList list) throws Exception;
JsonViewObject strategyPlanSave(StrategyControlDetailList list) throws Exception;
JsonViewObject strategyFactoryList() throws Exception;
JsonViewObject strategyFactoryList(StrategyFactoryQueryVO vo) throws Exception;
JsonViewObject strategyFactorySave(StrategyFactoryEntity entity) throws Exception;
JsonViewObject strategyFactoryDel(Integer id) throws Exception;
}
......@@ -25,10 +25,7 @@ import net.wanji.opt.po.StrategyGreenOptHistEntity;
import net.wanji.opt.po.trend.HoloEventInfoPO;
import net.wanji.opt.synthesis.enums.StrategyCrossAlgoEnum;
import net.wanji.opt.synthesis.pojo.*;
import net.wanji.opt.synthesis.pojo.vo.StrategyControlDataVO;
import net.wanji.opt.synthesis.pojo.vo.StrategyControlHistVO;
import net.wanji.opt.synthesis.pojo.vo.StrategyControlVO;
import net.wanji.opt.synthesis.pojo.vo.StrategyOptTimesVO;
import net.wanji.opt.synthesis.pojo.vo.*;
import net.wanji.opt.synthesis.service.PushStrategyControlService;
import net.wanji.opt.synthesis.service.StrategyControlService;
import org.apache.commons.lang3.StringUtils;
......@@ -870,10 +867,24 @@ public class StrategyControlServiceImpl implements StrategyControlService {
}
@Override
public JsonViewObject strategyFactoryList() throws Exception {
List<StrategyFactoryEntity> strategyFactoryEntities = strategyFactoryMapper.selectList(null);
public JsonViewObject strategyFactoryList(StrategyFactoryQueryVO vo) throws Exception {
Page<StrategyFactoryEntity> page = new Page<>(vo.getCurrentPage(), vo.getPageSize());
LambdaQueryWrapper<StrategyFactoryEntity> queryWrapper = new LambdaQueryWrapper<>();
if (Objects.nonNull(vo.getScene())) {
queryWrapper.eq(StrategyFactoryEntity::getScene, vo.getScene());
}
if (StringUtils.isNotBlank(vo.getStrategyName())) {
queryWrapper.eq(StrategyFactoryEntity::getStrategyName, vo.getStrategyName());
}
if (StringUtils.isNotBlank(vo.getStrategyNo())) {
queryWrapper.eq(StrategyFactoryEntity::getStrategyNo, vo.getStrategyNo());
}
if (StringUtils.isNotBlank(vo.getCompany())) {
queryWrapper.eq(StrategyFactoryEntity::getCompany, vo.getCompany());
}
Page<StrategyFactoryEntity> strategyFactoryEntityPage = strategyFactoryMapper.selectPage(page, queryWrapper);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
jsonViewObject.success(strategyFactoryEntities);
jsonViewObject.success(strategyFactoryEntityPage);
return jsonViewObject;
}
......
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