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 {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
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;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.feign.pojo.entity.JsonViewObject;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.LaneIdDTO;
import net.wanji.web.dto.LightIdDTO;
import net.wanji.web.dto.SaveSchemeConfigDTO;
......@@ -73,4 +74,18 @@ public class SchemeConfigController {
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 {
public static class PhaseListElement {
@ApiModelProperty(value = "相位号", required = true)
private String phaseNo;
@ApiModelProperty(value = "相位序号", required = false)
private Integer sort;
@ApiModelProperty(value = "相位类型 1实相位 2虚相位 3伴随相位", required = true)
private Integer phaseType;
@ApiModelProperty(value = "最小绿灯时间", required = true)
......@@ -75,13 +73,13 @@ public class SaveSchemeConfigDTO {
@ApiModelProperty(value = "红灯时间", required = true)
private Integer redTime;
@ApiModelProperty(value = "是否黄闪 0否 1是", required = true)
private Integer yellowFlash;
private Integer yellowFlash = 0;
@ApiModelProperty(value = "是否红灯 0否 1是", required = true)
private Integer isRed;
private Integer isRed = 0;
@ApiModelProperty(value = "是否绿灯 0否 1是", required = true)
private Integer isGreen;
private Integer isGreen = 0;
@ApiModelProperty(value = "是否绿闪 0否 1是", required = true)
private Integer greenFlash;
private Integer greenFlash = 0;
@ApiModelProperty(value = "母相位号列表", required = true)
List<String> accompanyPhaseNoList;
private List<DirListElement> dirList; // 方向列表
......@@ -92,7 +90,7 @@ public class SaveSchemeConfigDTO {
@ApiModelProperty(value = "车道进口方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北", required = true)
private Integer dir;
@ApiModelProperty(value = "是否有行人相位:0否;1是", required = true)
private Integer hasPersonPhase;
private Integer hasPersonPhase = 0;
private List<LaneListElement> laneList; // 车道列表
}
......
......@@ -15,4 +15,6 @@ public interface CrossAccompanyPhaseMapper {
void deleteByCrossId(@Param("crossId") String crossId);
void insertBatch(@Param("entities") List<CrossAccompanyPhasePO> entities);
List<Integer> selectByPhaseId(@Param("phaseId") Integer phaseId);
}
......@@ -24,4 +24,6 @@ public interface CrossLaneLightsMapper {
List<CrossLaneLightsPO> selectLanesByLightId(@Param("crossId") String crossId,
@Param("lightId") Integer lightId);
List<CrossLaneLightsPO> selectByLightsId(@Param("lightsId") Integer lightsId);
}
......@@ -23,4 +23,9 @@ public interface CrossLightsMapper {
List<CrossLightsPO> selectByCrossId(@Param("crossId") String crossId);
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;
import net.wanji.web.po.scheme.CrossPhaseLightsPO;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Set;
/**
......@@ -16,4 +17,8 @@ public interface CrossPhaseLightsMapper {
void deleteByCrossId(@Param("crossId") String crossId);
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;
import net.wanji.web.po.scheme.CrossPhasePO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 相位基础信息;(t_base_cross_phase)表数据库访问层
* @author : hanbing
......@@ -19,4 +21,20 @@ public interface CrossPhaseMapper {
void insertOne(CrossPhasePO crossPhasePO);
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 {
void updateCoordPhase(@Param("crossId") String crossId,
@Param("schemeNo") String schemeNo,
@Param("phaseId") Integer phaseId);
List<CrossSchemePO> selectByCrossId(@Param("crossId") String crossId);
}
......@@ -28,4 +28,6 @@ public interface LaneInfoMapper {
@Param("dir") Integer dir,
@Param("turn") Integer turn,
@Param("category") Integer category);
List<LaneInfoPO> selectByLaneIds(@Param("laneIds") List<String> laneIds);
}
package net.wanji.web.service.scheme;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.LaneIdDTO;
import net.wanji.web.dto.LightIdDTO;
import net.wanji.web.dto.SaveSchemeConfigDTO;
......@@ -16,4 +17,6 @@ public interface SchemeConfigService {
LightIdVO getLightByLane(LaneIdDTO laneIdDTO);
LaneIdsVO getLanesByLight(LightIdDTO lightIdDTO);
SaveSchemeConfigDTO listSchemeConfig(CrossIdDTO crossIdDTO);
}
......@@ -25,5 +25,11 @@
where cross_id = #{crossId}
</delete>
<select id="selectByPhaseId" resultType="java.lang.Integer">
select super_id
from t_base_cross_accompany_phase
where phase_id = #{phaseId}
</select>
</mapper>
......@@ -56,5 +56,12 @@
where cross_id = #{crossId} and lights_id = #{lightId}
</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>
......@@ -48,4 +48,21 @@
where cross_id = #{crossId} and dir = #{dir}
</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>
......@@ -25,5 +25,19 @@
where cross_id = #{crossId}
</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>
......@@ -41,5 +41,44 @@
where cross_id = #{crossId} and plan_id = #{schemeId} and phase_no = #{coordPhaseNo}
</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>
......@@ -41,5 +41,12 @@
where cross_id = #{crossId} and scheme_no = #{schemeNo}
</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>
......@@ -60,4 +60,14 @@
limit 1
</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>
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