Commit 13585937 authored by hanbing's avatar hanbing

方案管理-获取方案配置列表

parent 69a0745d
package net.wanji.web.common.exception;
/**
* 路段关系异常
*
* @author Kent HAN
* @date 2022/11/10 9:09
*/
public class LightsModifyException extends RuntimeException {
public LightsModifyException(String message) {
super(message);
}
public LightsModifyException(String message, Exception e) {
super(message,e);
}
}
...@@ -23,4 +23,10 @@ public class SignalGlobalExceptionHandler { ...@@ -23,4 +23,10 @@ public class SignalGlobalExceptionHandler {
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.fail(e); return jsonViewObject.fail(e);
} }
@ExceptionHandler(value = LightsModifyException.class)
public JsonViewObject lightsModifyExceptionHandler(LightsModifyException e) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.fail(e);
}
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import net.wanji.feign.pojo.entity.JsonViewObject; import net.wanji.feign.pojo.entity.JsonViewObject;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.LaneIdDTO; import net.wanji.web.dto.LaneIdDTO;
import net.wanji.web.dto.LightIdDTO; import net.wanji.web.dto.LightIdDTO;
import net.wanji.web.dto.SaveSchemeConfigDTO; import net.wanji.web.dto.SaveSchemeConfigDTO;
...@@ -73,4 +74,18 @@ public class SchemeConfigController { ...@@ -73,4 +74,18 @@ public class SchemeConfigController {
return jsonViewObject.success(laneIdsVO); return jsonViewObject.success(laneIdsVO);
} }
@ApiOperation(value = "方案配置列表", notes = "方案配置列表", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/listSchemeConfig",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = SaveSchemeConfigDTO.class),
})
public JsonViewObject listSchemeConfig(@RequestBody CrossIdDTO crossIdDTO) {
SaveSchemeConfigDTO saveSchemeConfigDTO = schemeConfigService.listSchemeConfig(crossIdDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(saveSchemeConfigDTO);
}
} }
...@@ -54,8 +54,6 @@ public class SaveSchemeConfigDTO { ...@@ -54,8 +54,6 @@ public class SaveSchemeConfigDTO {
public static class PhaseListElement { public static class PhaseListElement {
@ApiModelProperty(value = "相位号", required = true) @ApiModelProperty(value = "相位号", required = true)
private String phaseNo; private String phaseNo;
@ApiModelProperty(value = "相位序号", required = false)
private Integer sort;
@ApiModelProperty(value = "相位类型 1实相位 2虚相位 3伴随相位", required = true) @ApiModelProperty(value = "相位类型 1实相位 2虚相位 3伴随相位", required = true)
private Integer phaseType; private Integer phaseType;
@ApiModelProperty(value = "最小绿灯时间", required = true) @ApiModelProperty(value = "最小绿灯时间", required = true)
...@@ -75,13 +73,13 @@ public class SaveSchemeConfigDTO { ...@@ -75,13 +73,13 @@ public class SaveSchemeConfigDTO {
@ApiModelProperty(value = "红灯时间", required = true) @ApiModelProperty(value = "红灯时间", required = true)
private Integer redTime; private Integer redTime;
@ApiModelProperty(value = "是否黄闪 0否 1是", required = true) @ApiModelProperty(value = "是否黄闪 0否 1是", required = true)
private Integer yellowFlash; private Integer yellowFlash = 0;
@ApiModelProperty(value = "是否红灯 0否 1是", required = true) @ApiModelProperty(value = "是否红灯 0否 1是", required = true)
private Integer isRed; private Integer isRed = 0;
@ApiModelProperty(value = "是否绿灯 0否 1是", required = true) @ApiModelProperty(value = "是否绿灯 0否 1是", required = true)
private Integer isGreen; private Integer isGreen = 0;
@ApiModelProperty(value = "是否绿闪 0否 1是", required = true) @ApiModelProperty(value = "是否绿闪 0否 1是", required = true)
private Integer greenFlash; private Integer greenFlash = 0;
@ApiModelProperty(value = "母相位号列表", required = true) @ApiModelProperty(value = "母相位号列表", required = true)
List<String> accompanyPhaseNoList; List<String> accompanyPhaseNoList;
private List<DirListElement> dirList; // 方向列表 private List<DirListElement> dirList; // 方向列表
...@@ -92,7 +90,7 @@ public class SaveSchemeConfigDTO { ...@@ -92,7 +90,7 @@ public class SaveSchemeConfigDTO {
@ApiModelProperty(value = "车道进口方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北", required = true) @ApiModelProperty(value = "车道进口方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北", required = true)
private Integer dir; private Integer dir;
@ApiModelProperty(value = "是否有行人相位:0否;1是", required = true) @ApiModelProperty(value = "是否有行人相位:0否;1是", required = true)
private Integer hasPersonPhase; private Integer hasPersonPhase = 0;
private List<LaneListElement> laneList; // 车道列表 private List<LaneListElement> laneList; // 车道列表
} }
......
...@@ -15,4 +15,6 @@ public interface CrossAccompanyPhaseMapper { ...@@ -15,4 +15,6 @@ public interface CrossAccompanyPhaseMapper {
void deleteByCrossId(@Param("crossId") String crossId); void deleteByCrossId(@Param("crossId") String crossId);
void insertBatch(@Param("entities") List<CrossAccompanyPhasePO> entities); void insertBatch(@Param("entities") List<CrossAccompanyPhasePO> entities);
List<Integer> selectByPhaseId(@Param("phaseId") Integer phaseId);
} }
...@@ -24,4 +24,6 @@ public interface CrossLaneLightsMapper { ...@@ -24,4 +24,6 @@ public interface CrossLaneLightsMapper {
List<CrossLaneLightsPO> selectLanesByLightId(@Param("crossId") String crossId, List<CrossLaneLightsPO> selectLanesByLightId(@Param("crossId") String crossId,
@Param("lightId") Integer lightId); @Param("lightId") Integer lightId);
List<CrossLaneLightsPO> selectByLightsId(@Param("lightsId") Integer lightsId);
} }
...@@ -23,4 +23,9 @@ public interface CrossLightsMapper { ...@@ -23,4 +23,9 @@ public interface CrossLightsMapper {
List<CrossLightsPO> selectByCrossId(@Param("crossId") String crossId); List<CrossLightsPO> selectByCrossId(@Param("crossId") String crossId);
List<CrossLightsPO> selectByCrossIdAndDir(@Param("crossId") String crossId, @Param("dir") Integer dir); List<CrossLightsPO> selectByCrossIdAndDir(@Param("crossId") String crossId, @Param("dir") Integer dir);
CrossLightsPO selectById(@Param("id") Integer id);
List<CrossLightsPO> selectByLightsIdsAndDir(@Param("lightsIds") List<Integer> lightsIds,
@Param("dir") Integer dir);
} }
...@@ -4,6 +4,7 @@ import io.lettuce.core.dynamic.annotation.Param; ...@@ -4,6 +4,7 @@ import io.lettuce.core.dynamic.annotation.Param;
import net.wanji.web.po.scheme.CrossPhaseLightsPO; import net.wanji.web.po.scheme.CrossPhaseLightsPO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Set; import java.util.Set;
/** /**
...@@ -16,4 +17,8 @@ public interface CrossPhaseLightsMapper { ...@@ -16,4 +17,8 @@ public interface CrossPhaseLightsMapper {
void deleteByCrossId(@Param("crossId") String crossId); void deleteByCrossId(@Param("crossId") String crossId);
void insertBatchBySet(@Param("entities") Set<CrossPhaseLightsPO> entities); void insertBatchBySet(@Param("entities") Set<CrossPhaseLightsPO> entities);
List<CrossPhaseLightsPO> selectByPhaseId(@Param("phaseId") Integer phaseId);
List<CrossPhaseLightsPO> selectByLightsId(@Param("lightsId") Integer lightsId);
} }
...@@ -4,6 +4,8 @@ import io.lettuce.core.dynamic.annotation.Param; ...@@ -4,6 +4,8 @@ import io.lettuce.core.dynamic.annotation.Param;
import net.wanji.web.po.scheme.CrossPhasePO; import net.wanji.web.po.scheme.CrossPhasePO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* 相位基础信息;(t_base_cross_phase)表数据库访问层 * 相位基础信息;(t_base_cross_phase)表数据库访问层
* @author : hanbing * @author : hanbing
...@@ -19,4 +21,20 @@ public interface CrossPhaseMapper { ...@@ -19,4 +21,20 @@ public interface CrossPhaseMapper {
void insertOne(CrossPhasePO crossPhasePO); void insertOne(CrossPhasePO crossPhasePO);
void deleteByCrossId(@Param("crossId") String crossId); void deleteByCrossId(@Param("crossId") String crossId);
CrossPhasePO selectById(@Param("coordPhaseId") Integer coordPhaseId);
List<Integer> selectRingNumbersByCrossIdAndSchemeId(@Param("crossId") String crossId,
@Param("schemeId") Integer schemeId);
List<Integer> selectGroupNumbers(@Param("crossId") String crossId,
@Param("schemeId") Integer schemeId,
@Param("ringNo") Integer ringNo);
List<CrossPhasePO> selectByGroupNo(@Param("crossId") String crossId,
@Param("schemeId") Integer schemeId,
@Param("ringNo") Integer ringNo,
@Param("groupNumber") Integer groupNumber);
List<CrossPhasePO> selectByIds(@Param("ids") List<Integer> ids);
} }
...@@ -23,4 +23,6 @@ public interface CrossSchemeMapper { ...@@ -23,4 +23,6 @@ public interface CrossSchemeMapper {
void updateCoordPhase(@Param("crossId") String crossId, void updateCoordPhase(@Param("crossId") String crossId,
@Param("schemeNo") String schemeNo, @Param("schemeNo") String schemeNo,
@Param("phaseId") Integer phaseId); @Param("phaseId") Integer phaseId);
List<CrossSchemePO> selectByCrossId(@Param("crossId") String crossId);
} }
...@@ -28,4 +28,6 @@ public interface LaneInfoMapper { ...@@ -28,4 +28,6 @@ public interface LaneInfoMapper {
@Param("dir") Integer dir, @Param("dir") Integer dir,
@Param("turn") Integer turn, @Param("turn") Integer turn,
@Param("category") Integer category); @Param("category") Integer category);
List<LaneInfoPO> selectByLaneIds(@Param("laneIds") List<String> laneIds);
} }
package net.wanji.web.service.scheme; package net.wanji.web.service.scheme;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.LaneIdDTO; import net.wanji.web.dto.LaneIdDTO;
import net.wanji.web.dto.LightIdDTO; import net.wanji.web.dto.LightIdDTO;
import net.wanji.web.dto.SaveSchemeConfigDTO; import net.wanji.web.dto.SaveSchemeConfigDTO;
...@@ -16,4 +17,6 @@ public interface SchemeConfigService { ...@@ -16,4 +17,6 @@ public interface SchemeConfigService {
LightIdVO getLightByLane(LaneIdDTO laneIdDTO); LightIdVO getLightByLane(LaneIdDTO laneIdDTO);
LaneIdsVO getLanesByLight(LightIdDTO lightIdDTO); LaneIdsVO getLanesByLight(LightIdDTO lightIdDTO);
SaveSchemeConfigDTO listSchemeConfig(CrossIdDTO crossIdDTO);
} }
...@@ -25,5 +25,11 @@ ...@@ -25,5 +25,11 @@
where cross_id = #{crossId} where cross_id = #{crossId}
</delete> </delete>
<select id="selectByPhaseId" resultType="java.lang.Integer">
select super_id
from t_base_cross_accompany_phase
where phase_id = #{phaseId}
</select>
</mapper> </mapper>
...@@ -56,5 +56,12 @@ ...@@ -56,5 +56,12 @@
where cross_id = #{crossId} and lights_id = #{lightId} where cross_id = #{crossId} and lights_id = #{lightId}
</select> </select>
<select id="selectByLightsId" resultMap="BaseResultMap">
select
id,lights_id,lane_id,cross_id,gmt_create,gmt_modified
from t_base_cross_lane_lights
where lights_id = #{lightsId}
</select>
</mapper> </mapper>
...@@ -48,4 +48,21 @@ ...@@ -48,4 +48,21 @@
where cross_id = #{crossId} and dir = #{dir} where cross_id = #{crossId} and dir = #{dir}
</select> </select>
<select id="selectById" resultMap="BaseResultMap">
select
id,lights_no,type,dir,sort,cross_id,gmt_create,gmt_modified
from t_base_cross_lights
where id = #{id}
</select>
<select id="selectByLightsIdsAndDir" resultMap="BaseResultMap">
select
id,lights_no,type,dir,sort,cross_id,gmt_create,gmt_modified
from t_base_cross_lights
where dir = #{dir} and id in
<foreach collection="lightsIds" item="lightsId" separator="," open="(" close=")">
#{lightsId}
</foreach>
</select>
</mapper> </mapper>
...@@ -25,5 +25,19 @@ ...@@ -25,5 +25,19 @@
where cross_id = #{crossId} where cross_id = #{crossId}
</delete> </delete>
<select id="selectByPhaseId" resultMap="BaseResultMap">
select
id,lights_id,phase_id,cross_id,gmt_create,gmt_modified
from t_base_cross_phase_lights
where phase_id = #{phaseId}
</select>
<select id="selectByLightsId" resultMap="BaseResultMap">
select
id,lights_id,phase_id,cross_id,gmt_create,gmt_modified
from t_base_cross_phase_lights
where lights_id = #{lightsId}
</select>
</mapper> </mapper>
...@@ -41,5 +41,44 @@ ...@@ -41,5 +41,44 @@
where cross_id = #{crossId} and plan_id = #{schemeId} and phase_no = #{coordPhaseNo} where cross_id = #{crossId} and plan_id = #{schemeId} and phase_no = #{coordPhaseNo}
</select> </select>
<select id="selectById" resultMap="BaseResultMap">
select
id,phase_no,name,sort,cross_id,plan_id,ring_no,group_no,phase_type,control_mode,phase_time,green_time,green_flash_time,yellow_flash_time,red_flash_time,ped_flash_time,yellow_time,red_time,min_green_time,max_green_time,gmt_create,gmt_modified
from t_base_cross_phase
where id = #{coordPhaseId}
</select>
<select id="selectRingNumbersByCrossIdAndSchemeId" resultType="java.lang.Integer">
select distinct ring_no
from t_base_cross_phase
where cross_id = #{crossId} and plan_id = #{schemeId}
order by ring_no
</select>
<select id="selectGroupNumbers" resultType="java.lang.Integer">
select distinct group_no
from t_base_cross_phase
where cross_id = #{crossId} and plan_id = #{schemeId} and ring_no = #{ringNo}
order by group_no
</select>
<select id="selectByGroupNo" resultMap="BaseResultMap">
select
id,phase_no,name,sort,cross_id,plan_id,ring_no,group_no,phase_type,control_mode,phase_time,green_time,green_flash_time,yellow_flash_time,red_flash_time,ped_flash_time,yellow_time,red_time,min_green_time,max_green_time,gmt_create,gmt_modified
from t_base_cross_phase
where cross_id = #{crossId} and plan_id = #{schemeId} and ring_no = #{ringNo} and group_no = #{groupNumber}
order by sort
</select>
<select id="selectByIds" resultMap="BaseResultMap">
select
id,phase_no,name,sort,cross_id,plan_id,ring_no,group_no,phase_type,control_mode,phase_time,green_time,green_flash_time,yellow_flash_time,red_flash_time,ped_flash_time,yellow_time,red_time,min_green_time,max_green_time,gmt_create,gmt_modified
from t_base_cross_phase
where id in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</select>
</mapper> </mapper>
...@@ -41,5 +41,12 @@ ...@@ -41,5 +41,12 @@
where cross_id = #{crossId} and scheme_no = #{schemeNo} where cross_id = #{crossId} and scheme_no = #{schemeNo}
</select> </select>
<select id="selectByCrossId" resultMap="BaseResultMap">
select
id,scheme_no,name,cross_id,cycle,coord_phase,offset,source,is_deleted,gmt_create,gmt_modified
from t_base_cross_scheme
where cross_id = #{crossId}
</select>
</mapper> </mapper>
...@@ -60,4 +60,14 @@ ...@@ -60,4 +60,14 @@
limit 1 limit 1
</select> </select>
<select id="selectByLaneIds" resultMap="BaseResultMap">
select id,code,sort,type,dir,turn,category,cross_id,rid,length,width,gmt_create,gmt_modified
from t_base_lane_info
where id in
<foreach collection="laneIds" item="laneId" separator="," open="(" close=")">
#{laneId}
</foreach>
order by sort
</select>
</mapper> </mapper>
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