Commit 3bf9fc65 authored by zhouleilei's avatar zhouleilei

Merge remote-tracking branch 'origin/master'

parents e1876760 b5a033ef
...@@ -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;
......
package net.wanji.opt.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wanji.opt.synthesis.pojo.StrategyDailyPlanInfoEntity;
/**
* @author duanruiming
* @date 2024/11/08 10:15
*/
public interface StrategyDailyPlanInfoMapper extends BaseMapper<StrategyDailyPlanInfoEntity> {
}
package net.wanji.opt.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wanji.opt.synthesis.pojo.StrategyPlanInfoEntity;
/**
* @author duanruiming
* @date 2024/11/08 10:14
*/
public interface StrategyPlanInfoMapper extends BaseMapper<StrategyPlanInfoEntity> {
}
...@@ -6,13 +6,12 @@ import io.swagger.annotations.ApiResponse; ...@@ -6,13 +6,12 @@ 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.StrategyControlVO; import net.wanji.opt.synthesis.pojo.StrategyControlVO;
import net.wanji.opt.synthesis.service.StrategyControlService; import net.wanji.opt.synthesis.service.StrategyControlService;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
...@@ -56,4 +55,37 @@ public class StrategyControlController { ...@@ -56,4 +55,37 @@ public class StrategyControlController {
return strategyControlService.strategyInfoPageList(entity); return strategyControlService.strategyInfoPageList(entity);
} }
@ApiOperation(value = "策略控制查询列表", notes = "策略控制查询列表",
response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/crossStrategyInfoList")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = StrategyControlDataEntity.class),
})
public JsonViewObject crossStrategyInfoList(@RequestParam Integer type) throws Exception {
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 = "策略管理计划列表查询",
response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/strategyPlanSave",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = StrategyControlDetailList.class),
})
public JsonViewObject strategyPlanSave(@RequestBody @Validated StrategyControlDetailList list) throws Exception {
return strategyControlService.strategyPlanSave(list);
}
} }
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;
......
...@@ -35,6 +35,8 @@ public class StrategyControlDataVO { ...@@ -35,6 +35,8 @@ public class StrategyControlDataVO {
private Integer status; private Integer status;
@ApiModelProperty(value = "操作(insert=新增,update=更新,delete=删除)") @ApiModelProperty(value = "操作(insert=新增,update=更新,delete=删除)")
private String action; private String action;
@ApiModelProperty(value = "模式1定时任务 2自适应")
private Integer model;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
......
package net.wanji.opt.synthesis.pojo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.Date;
import java.util.List;
/**
* @author duanruiming
* @date 2024/11/08 0:24
*/
@Data
public class StrategyControlDetailList {
private String crossId;
@NotEmpty
private List<ExecutePlan> plans;
@NotEmpty
private List<DailyPlan> dailyPlans;
@Data
public static class ExecutePlan {
private String crossId;
private Integer type;
private Integer planId;
private String company;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
private List<PlanDetail> planDetails;
@Data
public static class PlanDetail {
private Integer dailyPlanId;
private List<Integer> weeks;
}
}
@Data
public static class DailyPlan {
private String crossId;
private Integer dailyPlanId;
private List<DailyPlanDetail> dailyPlanDetails;
@Data
public static class DailyPlanDetail {
private Integer strategy;
private List<String> times;
}
}
}
package net.wanji.opt.synthesis.pojo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author duanruiming
* @date 2024/11/08 10:10
*/
@TableName("t_strategy_daily_plan_info")
@ApiModel(value = "StrategyDailyPlanInfoEntity", description = "策略管理日计划管理实体")
@Data
public class StrategyDailyPlanInfoEntity {
@ApiModelProperty("id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("dailyPlanId")
@TableField("daily_plan_id")
private Integer dailyPlanId;
@ApiModelProperty("crossId")
@TableField("cross_id")
private String crossId;
@ApiModelProperty("dailyPlanDetails")
@TableField("daily_plan_details")
private String dailyPlanDetails;
}
package net.wanji.opt.synthesis.pojo;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author duanruiming
* @date 2024/11/08 13:12
*/
@Data
public class StrategyPlanDTO {
private String crossId;
private Integer planId;
private Integer dailyPlanId;
private Integer strategy;
private List<String> times;
private List<Integer> weeks;
private Date startTime;
private Date endTime;
}
package net.wanji.opt.synthesis.pojo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author duanruiming
* @date 2024/11/08 10:02
* @description 策略管理运行计划管理实体
*/
@TableName("t_strategy_plan_info")
@ApiModel(value = "StrategyPlanInfoEntity", description = "策略管理运行计划管理实体")
@Data
public class StrategyPlanInfoEntity {
@ApiModelProperty("id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("planId")
@TableField("plan_id")
private Integer planId;
@ApiModelProperty("crossId")
@TableField("cross_id")
private String crossId;
@ApiModelProperty("type")
@TableField("type")
private Integer type;
@ApiModelProperty("startTime")
@TableField("start_time")
private Date startTime;
@ApiModelProperty("endTime")
@TableField("end_time")
private Date endTime;
private String company;
@ApiModelProperty("planDetails")
@TableField("plan_details")
private String planDetails;
}
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.StrategyControlVO; import net.wanji.opt.synthesis.pojo.StrategyControlVO;
/** /**
...@@ -12,4 +13,8 @@ public interface StrategyControlService { ...@@ -12,4 +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;
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,
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.opt.dao.mapper.StrategyDailyPlanInfoMapper">
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.opt.dao.mapper.StrategyPlanInfoMapper">
</mapper>
\ No newline at end of file
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