Commit 35383dab authored by hanbing's avatar hanbing

修改渠化配置rid处理方式

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