Commit 35383dab authored by hanbing's avatar hanbing

修改渠化配置rid处理方式

parent 0f849f2d
...@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -5,7 +5,6 @@ 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.common.exception.LightLaneConflictException;
import net.wanji.web.dto.CrossIdDTO; import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.SaveLaneInfoDTO; import net.wanji.web.dto.SaveLaneInfoDTO;
import net.wanji.web.service.scheme.impl.CrossConfigServiceImpl; import net.wanji.web.service.scheme.impl.CrossConfigServiceImpl;
...@@ -40,11 +39,7 @@ public class CrossConfigController { ...@@ -40,11 +39,7 @@ public class CrossConfigController {
@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class), @ApiResponse(code = 200, message = "OK", response = JsonViewObject.class),
}) })
public JsonViewObject saveLaneInfo(@RequestBody SaveLaneInfoDTO saveLaneInfoDTO) { public JsonViewObject saveLaneInfo(@RequestBody SaveLaneInfoDTO saveLaneInfoDTO) {
try { crossConfigService.saveLaneInfo(saveLaneInfoDTO);
crossConfigService.saveLaneInfo(saveLaneInfoDTO);
} catch (Exception e) {
throw new LightLaneConflictException("灯组设置与车道配置冲突");
}
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(); return jsonViewObject.success();
......
...@@ -15,7 +15,7 @@ public class RidInfoPO { ...@@ -15,7 +15,7 @@ public class RidInfoPO {
/** 路段编号(开始路口编号+结束路口编号+顺序号0) */ /** 路段编号(开始路口编号+结束路口编号+顺序号0) */
@Id @Id
@ApiModelProperty(name = "路段编号(开始路口编号+结束路口编号+顺序号0)",notes = "") @ApiModelProperty(name = "路段编号(开始路口编号+结束路口编号+顺序号0)",notes = "")
private String rid ; private String rid = "";
/** 路段名称 */ /** 路段名称 */
@ApiModelProperty(name = "路段名称",notes = "") @ApiModelProperty(name = "路段名称",notes = "")
private String name ; private String name ;
......
...@@ -58,12 +58,12 @@ public class LaneInfoPO { ...@@ -58,12 +58,12 @@ public class LaneInfoPO {
* 车道长度 * 车道长度
*/ */
@ApiModelProperty(name = "车道长度", notes = "") @ApiModelProperty(name = "车道长度", notes = "")
private Double length; private Double length = 0.0;
/** /**
* 车道宽度 * 车道宽度
*/ */
@ApiModelProperty(name = "车道宽度", notes = "") @ApiModelProperty(name = "车道宽度", notes = "")
private Double width; private Double width = 0.0;
/** /**
* 创建时间 * 创建时间
*/ */
......
package net.wanji.web.service.scheme.impl; package net.wanji.web.service.scheme.impl;
import net.wanji.web.common.enums.LightsAddressEnum; import net.wanji.web.common.enums.LightsAddressEnum;
import net.wanji.web.common.exception.LightLaneConflictException;
import net.wanji.web.dto.CrossIdDTO; import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.DirListElement; import net.wanji.web.dto.DirListElement;
import net.wanji.web.dto.LaneListElement; import net.wanji.web.dto.LaneListElement;
...@@ -104,14 +105,18 @@ public class CrossConfigServiceImpl implements CrossConfigService { ...@@ -104,14 +105,18 @@ public class CrossConfigServiceImpl implements CrossConfigService {
// 保存渠化数据 // 保存渠化数据
handleLaneData(saveLaneInfoDTO); handleLaneData(saveLaneInfoDTO);
} else { } else {
// 前端传过来的所有灯组代码列表 try {
Set<String> lightCodeSet = new HashSet<>(); // 前端传过来的所有灯组代码列表
// 保存灯组设置 Set<String> lightCodeSet = new HashSet<>();
handleLightsData(saveLaneInfoDTO, ledConfigList, lightCodeSet); // 保存灯组设置
// 保存车道配置(灯组-车道关系表) handleLightsData(saveLaneInfoDTO, ledConfigList, lightCodeSet);
handleLaneConfig(saveLaneInfoDTO, lightCodeSet); // 保存车道配置(灯组-车道关系表)
if (lightCodeSet.size() != 0) { handleLaneConfig(saveLaneInfoDTO, lightCodeSet);
throw new RuntimeException("存在未配置的灯组号"); if (lightCodeSet.size() != 0) {
throw new RuntimeException("存在未配置的灯组号");
}
} catch (Exception e) {
throw new LightLaneConflictException("灯组设置与车道配置冲突");
} }
} }
} }
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
</resultMap> </resultMap>
<insert id="insertBatch"> <insert id="insertBatch">
insert into t_base_lane_info(id,code,sort,type,dir,turn,category,cross_id) insert into t_base_lane_info(id,code,sort,type,dir,turn,category,cross_id,rid,length,width)
values values
<foreach collection="entities" item="entity" separator=","> <foreach collection="entities" item="entity" separator=",">
(#{entity.id},#{entity.code},#{entity.sort},#{entity.type},#{entity.dir},#{entity.turn},#{entity.category},#{entity.crossId}) (#{entity.id},#{entity.code},#{entity.sort},#{entity.type},#{entity.dir},#{entity.turn},#{entity.category},#{entity.crossId},#{entity.rid},#{entity.length},#{entity.width})
</foreach> </foreach>
</insert> </insert>
......
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