Commit ff4d6787 authored by wangyecheng's avatar wangyecheng

修改策略管理参数配置追加策略编号回显

parent 1d70fddd
...@@ -210,10 +210,10 @@ public class StrategyPriorityController { ...@@ -210,10 +210,10 @@ public class StrategyPriorityController {
}) })
@GetMapping("/getParamConfigData") @GetMapping("/getParamConfigData")
public JsonViewObject getParamConfigData(@RequestParam(required = false) String crossId,@RequestParam(required = false) Integer greenId, public JsonViewObject getParamConfigData(@RequestParam(required = false) String crossId,@RequestParam(required = false) Integer greenId,
@RequestParam(required = true) Integer type){ @RequestParam(required = true) Integer type,@RequestParam(required = true) String strategyNo){
JsonViewObject jsonView = JsonViewObject.newInstance(); JsonViewObject jsonView = JsonViewObject.newInstance();
try { try {
List<StrategyParameterConfig>list=strategyPriorityService.getParamConfigData(crossId,greenId,type); List<StrategyParameterConfig>list=strategyPriorityService.getParamConfigData(crossId,greenId,type,strategyNo);
jsonView.success(list); jsonView.success(list);
} catch (Exception e) { } catch (Exception e) {
jsonView.fail(I18nResourceBundle.getConstants("SAVE_FAILED_MSG")); jsonView.fail(I18nResourceBundle.getConstants("SAVE_FAILED_MSG"));
......
...@@ -89,7 +89,7 @@ public interface StrategyPriorityMapper extends BaseMapper<StrategyPriorityDaily ...@@ -89,7 +89,7 @@ public interface StrategyPriorityMapper extends BaseMapper<StrategyPriorityDaily
void saveParamConfig(@Param("savePlanList") List<StrategyParameterConfig> savePlanList); void saveParamConfig(@Param("savePlanList") List<StrategyParameterConfig> savePlanList);
List<StrategyParameterConfig> getParamConfigData(@Param("crossId") String crossId,@Param("type")Integer type); List<StrategyParameterConfig> getParamConfigData(@Param("crossId") String crossId,@Param("type")Integer type,@Param("strategyNo") String strategyNo);
List<StrategyPriorityDailyInfo> getStrategyGreenWave(); List<StrategyPriorityDailyInfo> getStrategyGreenWave();
...@@ -111,6 +111,6 @@ public interface StrategyPriorityMapper extends BaseMapper<StrategyPriorityDaily ...@@ -111,6 +111,6 @@ public interface StrategyPriorityMapper extends BaseMapper<StrategyPriorityDaily
void deleteGreenParamterConfig(Integer greenId); void deleteGreenParamterConfig(Integer greenId);
List<StrategyParameterConfig> getGreenParamConfigData(@Param("greenId") Integer greenId, @Param("type") Integer type); List<StrategyParameterConfig> getGreenParamConfigData(@Param("greenId") Integer greenId, @Param("type") Integer type,@Param("strategyNo") String strategyNo);
} }
...@@ -44,7 +44,7 @@ public interface StrategyPriorityService extends IService<StrategyPriorityDailyI ...@@ -44,7 +44,7 @@ public interface StrategyPriorityService extends IService<StrategyPriorityDailyI
void saveParamterConfig(StrategyPriorityGroup strategyPriorityGroup) throws Exception; void saveParamterConfig(StrategyPriorityGroup strategyPriorityGroup) throws Exception;
List<StrategyParameterConfig> getParamConfigData(String crossId,Integer greenId, Integer type); List<StrategyParameterConfig> getParamConfigData(String crossId,Integer greenId, Integer type,String strategyNo);
List<StrategyPriorityDailyInfo> getStrategyGreenWave(); List<StrategyPriorityDailyInfo> getStrategyGreenWave();
} }
...@@ -416,7 +416,7 @@ import java.util.stream.Collectors; ...@@ -416,7 +416,7 @@ import java.util.stream.Collectors;
* 策略参数配置干线路口数据回显 * 策略参数配置干线路口数据回显
* */ * */
@Override @Override
public List<StrategyParameterConfig> getParamConfigData(String crossId,Integer greenId, Integer type) { public List<StrategyParameterConfig> getParamConfigData(String crossId,Integer greenId, Integer type,String strategyNo) {
try { try {
List<StrategyParameterConfig> paraterConfigList=new ArrayList<>(); List<StrategyParameterConfig> paraterConfigList=new ArrayList<>();
//type: 1路口 2干线 //type: 1路口 2干线
...@@ -424,12 +424,12 @@ import java.util.stream.Collectors; ...@@ -424,12 +424,12 @@ import java.util.stream.Collectors;
if (crossId.isEmpty()){ if (crossId.isEmpty()){
throw new IllegalArgumentException("crossId cannot be null"); throw new IllegalArgumentException("crossId cannot be null");
} }
paraterConfigList = strategyPriorityMapper.getParamConfigData(crossId,type); paraterConfigList = strategyPriorityMapper.getParamConfigData(crossId,type,strategyNo);
}else if(type==2){ }else if(type==2){
if (greenId==null){ if (greenId==null){
throw new IllegalArgumentException("greenId cannot be null"); throw new IllegalArgumentException("greenId cannot be null");
} }
paraterConfigList = strategyPriorityMapper.getGreenParamConfigData(greenId,type); paraterConfigList = strategyPriorityMapper.getGreenParamConfigData(greenId,type,strategyNo);
} }
return paraterConfigList; return paraterConfigList;
}catch (Exception e){ }catch (Exception e){
......
...@@ -372,6 +372,10 @@ ...@@ -372,6 +372,10 @@
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
and type = #{type} and type = #{type}
</if> </if>
<if test="strategyNo!=null and strategyNo!=''">
and strategy_no = #{strategyNo}
</if>
</select> </select>
<select id="getGreenParamConfigData" parameterType="map" resultType="net.wanji.opt.entity.strategy.StrategyParameterConfig"> <select id="getGreenParamConfigData" parameterType="map" resultType="net.wanji.opt.entity.strategy.StrategyParameterConfig">
SELECT SELECT
...@@ -386,6 +390,9 @@ ...@@ -386,6 +390,9 @@
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
and type = #{type} and type = #{type}
</if> </if>
<if test="strategyNo!=null and strategyNo!=''">
and strategy_no = #{strategyNo}
</if>
</select> </select>
<select id="getStrategyGreenWave" parameterType="map" resultType="net.wanji.opt.entity.strategy.StrategyPriorityDailyInfo"> <select id="getStrategyGreenWave" parameterType="map" resultType="net.wanji.opt.entity.strategy.StrategyPriorityDailyInfo">
......
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