Commit c9c0ab66 authored by wangyecheng's avatar wangyecheng

策略管理追加干线日计划回显

parent 56c487f0
......@@ -147,7 +147,7 @@ public class StrategyPriorityController {
return jsonView;
}
@ApiOperation(value = "策略管理-策略计划表批量保存", notes = "批量保存", produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,hidden = false)
@ApiOperation(value = "策略管理-策略计划表路口干线批量保存", notes = "批量保存", produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,hidden = false)
@ApiImplicitParams({
@ApiImplicitParam(name = "dailyPlanDetails", value = "日计划配置数据", required = false, dataType = "String"),
})
......@@ -164,15 +164,18 @@ public class StrategyPriorityController {
return jsonView;
}
@ApiOperation(value = "策略管理-计划配置数据回显", notes = "数据回显", produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,hidden = false)
@ApiOperation(value = "策略管理-计划配置路口干线数据回显", notes = "数据回显", produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,hidden = false)
@ApiImplicitParams({
@ApiImplicitParam(name = "crossId", value = "路口id", required = true, dataType = "String")
@ApiImplicitParam(name = "crossId", value = "路口id", required = false, dataType = "String"),
@ApiImplicitParam(name = "greenId", value = "干线id", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "Integer"),
})
@GetMapping("/getPlanConfigData")
public JsonViewObject getPlanConfigData(@RequestParam(required = true) String crossId){
public JsonViewObject getPlanConfigData(@RequestParam(required = false) String crossId,@RequestParam(required = false) Integer greenId,
@RequestParam(required = true) Integer type){
JsonViewObject jsonView = JsonViewObject.newInstance();
try {
List<StrategyPriorityDailyInfo>list=strategyPriorityService.getPlanConfigData(crossId);
List<StrategyPriorityDailyInfo>list=strategyPriorityService.getPlanConfigData(crossId,greenId,type);
jsonView.success(list);
} catch (Exception e) {
jsonView.fail(I18nResourceBundle.getConstants("SAVE_FAILED_MSG"));
......
......@@ -80,7 +80,7 @@ public interface StrategyPriorityMapper extends BaseMapper<StrategyPriorityDaily
void deletePlanConfig(String crossId);
List<StrategyPriorityDailyInfo> getPlanConfigData(String crossId);
List<StrategyPriorityDailyInfo> getPlanConfigData(@Param("crossId") String crossId,@Param("type")Integer type);
List<StrategyParameterConfig> paramterConfigTable(String crossId);
......@@ -104,5 +104,7 @@ public interface StrategyPriorityMapper extends BaseMapper<StrategyPriorityDaily
List<StrategyPriorityDailyInfo> selectGreenPlanTable(Integer greenId);
void deleteGreenPlanConfig(Integer greenId);
List<StrategyPriorityDailyInfo> getGreenPlanConfigData(@Param("greenId") Integer greenId,@Param("type")Integer type);
}
......@@ -2,6 +2,7 @@ package net.wanji.opt.servicev2.strategy;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.swagger.models.auth.In;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.entity.strategy.StrategyParameterConfig;
import net.wanji.opt.entity.strategy.StrategyPriorityDailyInfo;
......@@ -39,7 +40,7 @@ public interface StrategyPriorityService extends IService<StrategyPriorityDailyI
void savePlanConfig(List<StrategyPriorityGroup> dailyPlanDetails) throws JsonProcessingException;
List<StrategyPriorityDailyInfo> getPlanConfigData(String crossId);
List<StrategyPriorityDailyInfo> getPlanConfigData(String crossId, Integer greenId,Integer type);
void saveParamterConfig(StrategyPriorityGroup strategyPriorityGroup) throws JsonProcessingException;
......
......@@ -288,11 +288,26 @@ import java.util.stream.Collectors;
throw e;
}
}
/*
* 日计划回显接口
* */
@Override
public List<StrategyPriorityDailyInfo> getPlanConfigData(String crossId) {
public List<StrategyPriorityDailyInfo> getPlanConfigData(String crossId,Integer greenId,Integer type) {
//type: 1路口 2干线
List<StrategyPriorityDailyInfo> planList =new ArrayList<>();
if (type==1){
if (crossId.isEmpty()){
throw new IllegalArgumentException("crossId cannot be null");
}
planList = strategyPriorityMapper.getPlanConfigData(crossId,type);
}else if (type==2){
if (greenId==null){
throw new IllegalArgumentException("greenId cannot be null");
}
planList = strategyPriorityMapper.getGreenPlanConfigData(greenId,type);
}
List<StrategyPriorityDailyInfo> planList = strategyPriorityMapper.getPlanConfigData(crossId);
return planList;
}
/*
......
......@@ -302,6 +302,23 @@
<if test="crossId!=null and crossId!=''">
and cross_id = #{crossId}
</if>
<if test="type!=null and type!=''">
and type = #{type}
</if>
</select>
<select id="getGreenPlanConfigData" parameterType="map" resultType="net.wanji.opt.entity.strategy.StrategyPriorityDailyInfo">
SELECT
id,daily_plan_id,week_execute,daily_plan_details,cross_id
FROM
t_strategy_priority_daily_info
WHERE
1=1
<if test="greenId!=null and greenId!=''">
and green_id = #{greenId}
</if>
<if test="type!=null and type!=''">
and type = #{type}
</if>
</select>
<select id="paramterConfigTable" parameterType="map" resultType="net.wanji.opt.entity.strategy.StrategyParameterConfig">
SELECT
......
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