Commit db754279 authored by hanbing's avatar hanbing

[update] 路口管理,行政区划编号改为区域ID

parent 374dffcb
......@@ -18,8 +18,8 @@ import java.util.List;
@ApiModel(value = "树形区域目录实体", description = "树形区域目录实体")
public class AreaTreePO {
@ApiModelProperty(value = "行政区划代码")
private Integer areaCode;
@ApiModelProperty(value = "区域ID")
private Integer areaId;
@ApiModelProperty(value = "行政区划名称")
private String areaName;
......
......@@ -106,18 +106,18 @@ public class CrossInfoService {
IdWorker idWorker = new IdWorker(0, 0);
crossInfoPO.setId(String.valueOf(idWorker.nextId()));
}
if (crossInfoPO.getAreaCode() == null) {
if (crossInfoPO.getAreaId() == null) {
QueryWrapper<TBaseAreaInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(TBaseAreaInfo::getName, crossInfoPO.getAreaName());
// 查询areaCode
// 查询areaId
List<TBaseAreaInfo> tBaseAreaInfos = areaInfoMapper.selectList(queryWrapper);
if (tBaseAreaInfos != null && tBaseAreaInfos.size() > 0) {
crossInfoPO.setAreaCode(tBaseAreaInfos.get(0).getCode());
crossInfoPO.setAreaId(tBaseAreaInfos.get(0).getId());
}
}
if (crossInfoPO.getAreaName() == null) {
QueryWrapper<TBaseAreaInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(TBaseAreaInfo::getCode, crossInfoPO.getAreaCode());
queryWrapper.lambda().eq(TBaseAreaInfo::getCode, crossInfoPO.getAreaId());
List<TBaseAreaInfo> tBaseAreaInfos = areaInfoMapper.selectList(queryWrapper);
if (tBaseAreaInfos != null && tBaseAreaInfos.size() > 0) {
crossInfoPO.setAreaName(tBaseAreaInfos.get(0).getName());
......@@ -168,7 +168,7 @@ public class CrossInfoService {
Map<Integer, List<AreaTreePO>> parentCodeMap = infos.stream().collect(Collectors.groupingBy(AreaTreePO::getParentCode));
for (AreaTreePO info : infos) {
for (Integer parentCode : parentCodeMap.keySet()) {
if (info.getAreaCode().equals(parentCode)) {
if (info.getAreaId().equals(parentCode)) {
info.setChildren(parentCodeMap.get(parentCode));
break;
}
......
......@@ -49,9 +49,9 @@ public class BaseCrossInfoVO {
/**
* 行政区划代码
*/
@ApiModelProperty(value = "行政区划代码")
@ApiModelProperty(value = "区域ID")
//@NotNull(message = "行政区划代码不可为空", groups = {Save.class, Update.class})
private Integer areaCode;
private Integer areaId;
/**
* 行政区划名称
......
package net.wanji.opt.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Pattern;
import java.util.List;
/**
* @author Kent HAN
* @date 2023/6/9 13:52
*/
@Data
@ApiModel(value = "AddOrUpdateAreaBO", description = "新增/修改子区")
public class AddOrUpdateAreaBO {
@ApiModelProperty(value = "子区ID")
private Integer areaId;
@ApiModelProperty(value = "子区名称")
@Pattern(regexp = "^[\\u4E00-\\u9FA5\\w\\-]{0,20}$", message = "子区名称只能包含中文、英文、数字、下划线和中横线,0~20个字符")
private String areaName;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "路口ID数组")
private List<String> crossIdList;
}
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.bo.AddOrUpdateAreaBO;
import net.wanji.opt.bo.PolygonBO;
import net.wanji.opt.service.impl.CrossManageServiceImpl;
import net.wanji.opt.vo.CrossIdAndNameVO;
......@@ -44,4 +45,16 @@ public class CrossController {
return JsonViewObject.newInstance().success(res);
}
@ApiOperation(value = "新增/修改子区", notes = "新增/修改子区,传ID为修改,不传ID为新增", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/addOrUpdateArea",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class),
})
public JsonViewObject addOrUpdateArea(@RequestBody AddOrUpdateAreaBO addOrUpdateAreaBO) {
// crossManageService.addOrUpdateArea(addOrUpdateAreaBO);
return JsonViewObject.newInstance().success();
}
}
\ No newline at end of file
......@@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author hfx
* @date 2023/1/12 09:11
......@@ -27,8 +25,8 @@ public class CrossInfoDTO {
@ApiModelProperty(name = "路口级别",notes = "")
private Integer level;
@ApiModelProperty(name = "行政区划代码",notes = "")
private Integer areaCode;
@ApiModelProperty(name = "区域Id",notes = "")
private Integer areaId;
@ApiModelProperty(name = "路口位置",notes = "")
private String location;
......
......@@ -38,7 +38,7 @@ public class BaseCrossInfoPO {
/**
* 行政区划代码
*/
private Integer areaCode;
private Integer areaId;
/**
* 行政区划名称
......
......@@ -53,8 +53,8 @@ public class TBaseCrossInfo implements Serializable {
/**
* 行政区划代码
*/
@TableField("area_code")
private Integer areaCode;
@TableField("area_id")
private Integer areaId;
/**
* 路口位置
......
......@@ -21,8 +21,8 @@ public class CrossInfoVO {
/**
* 行政区划代码
*/
@ApiModelProperty(value = "行政区划代码", required = true)
private Integer areaCode;
@ApiModelProperty(value = "区域ID", required = true)
private Integer areaId;
/**
* 行政区划名称
......
......@@ -6,7 +6,7 @@
<result column="name" property="name" jdbcType="VARCHAR"/>
<result column="type" property="type" jdbcType="TINYINT"/>
<result column="level" property="level" jdbcType="TINYINT"/>
<result column="area_code" property="areaCode" jdbcType="INTEGER"/>
<result column="area_id" property="areaId" jdbcType="INTEGER"/>
<result column="location" property="location" jdbcType="VARCHAR"/>
<result column="is_signal" property="isSignal" jdbcType="TINYINT"/>
<result column="is_start" property="isStart" jdbcType="TINYINT"/>
......@@ -19,7 +19,7 @@
<result column="name" property="name" jdbcType="VARCHAR"/>
<result column="type" property="type" jdbcType="TINYINT"/>
<result column="level" property="level" jdbcType="TINYINT"/>
<result column="area_code" property="areaCode" jdbcType="INTEGER"/>
<result column="area_id" property="areaId" jdbcType="INTEGER"/>
<result column="area_name" property="areaName" jdbcType="VARCHAR"/>
<result column="location" property="location" jdbcType="VARCHAR"/>
<result column="is_signal" property="isSignal" jdbcType="TINYINT"/>
......@@ -30,7 +30,7 @@
</resultMap>
<sql id="baseColumn">
id, name, type, level, area_code, location, is_signal, is_start, is_send, gmt_create, gmt_modified
id, name, type, level, area_id, location, is_signal, is_start, is_send, gmt_create, gmt_modified
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
......@@ -46,11 +46,11 @@
</delete>
<insert id="insert" parameterType="net.wanji.databus.po.TBaseCrossInfo">
insert into t_base_cross_info (id, name, type,
level, area_code, location,
level, area_id, location,
is_signal, is_start, is_send,
gmt_create, gmt_modified)
values (#{id,jdbcType=CHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT},
#{level,jdbcType=TINYINT}, #{areaCode,jdbcType=INTEGER}, #{location,jdbcType=VARCHAR},
#{level,jdbcType=TINYINT}, #{areaId,jdbcType=INTEGER}, #{location,jdbcType=VARCHAR},
#{isSignal,jdbcType=TINYINT}, #{isStart,jdbcType=TINYINT}, #{isSend,jdbcType=TINYINT},
#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP})
</insert>
......@@ -69,8 +69,8 @@
<if test="level != null">
level,
</if>
<if test="areaCode != null">
area_code,
<if test="areaId != null">
area_id,
</if>
<if test="location != null">
location,
......@@ -104,8 +104,8 @@
<if test="level != null">
#{level,jdbcType=TINYINT},
</if>
<if test="areaCode != null">
#{areaCode,jdbcType=INTEGER},
<if test="areaId != null">
#{areaId,jdbcType=INTEGER},
</if>
<if test="location != null">
#{location,jdbcType=VARCHAR},
......@@ -139,8 +139,8 @@
<if test="level != null">
level = #{level,jdbcType=TINYINT},
</if>
<if test="areaCode != null">
area_code = #{areaCode,jdbcType=INTEGER},
<if test="areaId != null">
area_id = #{areaId,jdbcType=INTEGER},
</if>
<if test="location != null">
location = #{location,jdbcType=VARCHAR},
......@@ -168,7 +168,7 @@
set name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
level = #{level,jdbcType=TINYINT},
area_code = #{areaCode,jdbcType=INTEGER},
area_id = #{areaId,jdbcType=INTEGER},
location = #{location,jdbcType=VARCHAR},
is_signal = #{isSignal,jdbcType=TINYINT},
is_start = #{isStart,jdbcType=TINYINT},
......@@ -179,16 +179,16 @@
</update>
<select id="selectAll" parameterType="net.wanji.databus.vo.CrossInfoPageVO" resultMap="SelectAllMap">
<bind name="startNum" value="(pageNum - 1) * pageSize"/>
select c.id,c.name,c.type,c.level,c.area_code,a.name
select c.id,c.name,c.type,c.level,c.area_id,a.name
area_name,c.location,c.is_signal,c.is_start,c.is_send,c.gmt_create,c.gmt_modified
from t_base_cross_info c
left join t_base_area_info a on c.area_code=a.code
left join t_base_area_info a on c.area_id=a.code
<where>
<if test="name != null and name != ''">
and c.name like concat('%',#{name},'%')
</if>
<if test="areaCode != null and areaCode != ''">
and a.code = #{areaCode}
<if test="areaId != null and areaId != ''">
and a.id = #{areaId}
</if>
<if test="areaName != null and areaName != ''">
and a.name = #{areaName}
......@@ -210,13 +210,13 @@
<select id="countSelectAll" parameterType="net.wanji.databus.vo.CrossInfoPageVO" resultType="integer">
select count(1)
from t_base_cross_info c
left join t_base_area_info a on c.area_code=a.code
left join t_base_area_info a on c.area_id=a.id
<where>
<if test="name != null and name != ''">
and c.name like concat('%',#{name},'%')
</if>
<if test="areaCode != null and areaCode != ''">
and a.code = #{areaCode}
<if test="areaId != null and areaId != ''">
and a.id = #{areaId}
</if>
<if test="areaName != null and areaName != ''">
and a.name = #{areaName}
......
......@@ -19,7 +19,7 @@
<result property="sort" column="sort"/>
<result property="trend" column="trend"/>
<result property="level" column="level"/>
<result property="areaCode" column="area_code"/>
<result property="areaCode" column="area_id"/>
<result property="length" column="length"/>
<result property="width" column="width"/>
<result property="isOneway" column="is_oneway"/>
......@@ -34,7 +34,7 @@
<sql id="Base_Column_List">
id,name,road_id,road_name,road_dir_id,start_cross_id,end_cross_id,out_dir,in_dir,start_angle,end_angle,
direction,sort,trend,level,area_code,length,width,is_oneway,type,wkt,sc_id,sc_name,sc_sort,gmt_create,gmt_modified
direction,sort,trend,level,area_id,length,width,is_oneway,type,wkt,sc_id,sc_name,sc_sort,gmt_create,gmt_modified
</sql>
<select id="selectRoadLength" resultType="java.lang.Double">
......@@ -71,7 +71,7 @@
<select id="selectByEndInDir" resultType="net.wanji.databus.dao.entity.RidInfoEntity">
SELECT t1.id,t1.name,t1.road_id,t1.road_name,t1.road_dir_id,t1.start_cross_id,t1.end_cross_id,t1.out_dir,
t1.in_dir,t1.start_angle,t1.end_angle,t1.direction,t1.sort,t1.trend,t1.level,t1.area_code,t1.length,
t1.in_dir,t1.start_angle,t1.end_angle,t1.direction,t1.sort,t1.trend,t1.level,t1.area_id,t1.length,
t1.width,t1.is_oneway,t1.type,t1.wkt,t1.sc_id,t1.sc_name,t1.sc_sort,t1.gmt_create,t1.gmt_modified
FROM t_base_rid_info t1 JOIN t_base_cross_info t2 ON t1.start_cross_id = t2.id
WHERE t1.end_cross_id = #{endCrossId} and t1.in_dir = #{spilloverDirInt} and t2.is_signal = 1
......
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