Commit b5a033ef authored by duanruiming's avatar duanruiming

[add] 策略管理页面接口

parent fbfc162a
...@@ -10,7 +10,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; ...@@ -10,7 +10,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
/** /**
* @author * @author
*/ */
@SpringBootApplication(scanBasePackages = {"net.wanji.opt", "net.wanji.databus", "net.wanji.common"}) @SpringBootApplication(scanBasePackages = {"net.wanji.opt", "net.wanji.databus", "net.wanji.common",
"net.wanji.opt.controller","net.wanji.opt.synthesis.controller"})
@MapperScan(basePackages = {"net.wanji.opt.dao.mapper", "net.wanji.databus.dao.mapper"}) @MapperScan(basePackages = {"net.wanji.opt.dao.mapper", "net.wanji.databus.dao.mapper"})
@EnableTransactionManagement @EnableTransactionManagement
@EnableScheduling @EnableScheduling
......
package net.wanji.opt.config; package net.wanji.opt.config;
import com.google.common.base.Predicates;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
...@@ -21,7 +22,8 @@ public class Swagger2 { ...@@ -21,7 +22,8 @@ public class Swagger2 {
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.select() .select()
//为当前包路径 //为当前包路径
.apis(RequestHandlerSelectors.basePackage("net.wanji.opt.controller")) .apis(Predicates.or(RequestHandlerSelectors.basePackage("net.wanji.opt.controller"),
RequestHandlerSelectors.basePackage("net.wanji.opt.synthesis.controller")))
.paths(PathSelectors.any()) .paths(PathSelectors.any())
.build(); .build();
} }
......
package net.wanji.opt.dao.mapper; package net.wanji.opt.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wanji.opt.po.StrategyControlDataEntity; import net.wanji.opt.synthesis.pojo.StrategyControlDataEntity;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
......
...@@ -6,7 +6,7 @@ import io.swagger.annotations.ApiResponse; ...@@ -6,7 +6,7 @@ import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.dao.mapper.SynthesisOptimizeLogInfoMapper; import net.wanji.opt.dao.mapper.SynthesisOptimizeLogInfoMapper;
import net.wanji.opt.po.StrategyControlDataEntity; import net.wanji.opt.synthesis.pojo.StrategyControlDataEntity;
import net.wanji.opt.synthesis.pojo.StrategyControlDetailList; import net.wanji.opt.synthesis.pojo.StrategyControlDetailList;
import net.wanji.opt.synthesis.pojo.StrategyControlVO; import net.wanji.opt.synthesis.pojo.StrategyControlVO;
import net.wanji.opt.synthesis.service.StrategyControlService; import net.wanji.opt.synthesis.service.StrategyControlService;
...@@ -55,16 +55,26 @@ public class StrategyControlController { ...@@ -55,16 +55,26 @@ public class StrategyControlController {
return strategyControlService.strategyInfoPageList(entity); return strategyControlService.strategyInfoPageList(entity);
} }
@ApiOperation(value = "策略管理计划列表查询", notes = "策略管理计划列表查询", @ApiOperation(value = "策略控制查询列表", notes = "策略控制查询列表",
response = JsonViewObject.class, response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/strategyPlanList", @GetMapping(value = "/crossStrategyInfoList")
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = StrategyControlDataEntity.class), @ApiResponse(code = 200, message = "OK", response = StrategyControlDataEntity.class),
}) })
public JsonViewObject strategyPlanList(@RequestParam String crossId) throws Exception { public JsonViewObject crossStrategyInfoList(@RequestParam Integer type) throws Exception {
return strategyControlService.strategyPlanList(crossId); return strategyControlService.crossStrategyInfoList(type);
}
@ApiOperation(value = "策略管理计划详情查询", notes = "策略管理计划详情查询",
response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/strategyPlanDetail")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = StrategyControlDetailList.class),
})
public JsonViewObject strategyPlanDetail(@RequestParam String crossId) throws Exception {
return strategyControlService.strategyPlanDetail(crossId);
} }
@ApiOperation(value = "策略管理计划保存", notes = "策略管理计划列表查询", @ApiOperation(value = "策略管理计划保存", notes = "策略管理计划列表查询",
......
package net.wanji.opt.po; package net.wanji.opt.synthesis.pojo;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
......
...@@ -13,6 +13,7 @@ import java.util.List; ...@@ -13,6 +13,7 @@ import java.util.List;
*/ */
@Data @Data
public class StrategyControlDetailList { public class StrategyControlDetailList {
private String crossId;
@NotEmpty @NotEmpty
private List<ExecutePlan> plans; private List<ExecutePlan> plans;
@NotEmpty @NotEmpty
......
package net.wanji.opt.synthesis.service; package net.wanji.opt.synthesis.service;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.po.StrategyControlDataEntity; import net.wanji.opt.synthesis.pojo.StrategyControlDataEntity;
import net.wanji.opt.synthesis.pojo.StrategyControlDetailList; import net.wanji.opt.synthesis.pojo.StrategyControlDetailList;
import net.wanji.opt.synthesis.pojo.StrategyControlVO; import net.wanji.opt.synthesis.pojo.StrategyControlVO;
...@@ -13,13 +13,8 @@ public interface StrategyControlService { ...@@ -13,13 +13,8 @@ public interface StrategyControlService {
JsonViewObject strategyInfoOperation(StrategyControlVO strategyControlVO) throws Exception; JsonViewObject strategyInfoOperation(StrategyControlVO strategyControlVO) throws Exception;
JsonViewObject strategyInfoPageList(StrategyControlDataEntity entity) throws Exception; JsonViewObject strategyInfoPageList(StrategyControlDataEntity entity) throws Exception;
JsonViewObject crossStrategyInfoList(Integer type) throws Exception;
/** JsonViewObject strategyPlanDetail(String crossId) throws Exception;
* 策略管理查询
* @param crossId
* @return
* @throws Exception
*/
JsonViewObject strategyPlanList(String crossId) throws Exception;
JsonViewObject strategyPlanSave(StrategyControlDetailList list) throws Exception; JsonViewObject strategyPlanSave(StrategyControlDetailList list) throws Exception;
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<mapper namespace="net.wanji.opt.dao.mapper.StrategyControlInfoMapper"> <mapper namespace="net.wanji.opt.dao.mapper.StrategyControlInfoMapper">
<insert id="insertBatch" parameterType="net.wanji.opt.po.StrategyControlDataEntity"> <insert id="insertBatch" parameterType="net.wanji.opt.synthesis.pojo.StrategyControlDataEntity">
INSERT INTO t_strategy_control_info ( INSERT INTO t_strategy_control_info (
biz_id, biz_id,
biz_type, biz_type,
......
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