xiao547607 4 년 전
부모
커밋
d40b117ee6

+ 5 - 0
common/src/main/java/com/jpsoft/bus/modules/base/entity/RegionInfo.java

@@ -47,4 +47,9 @@ public class RegionInfo {
     private Double latitude;
     @ApiModelProperty(value = "半径(米)")
     private Integer radius;
+    @ApiModelProperty(value = "排序")
+    private Integer sortNo;
+    @ApiModelProperty(value = "上级名称")
+    private String parentName;
+
 }

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dto/RouteInfoDTO.java

@@ -34,4 +34,6 @@ public class RouteInfoDTO {
     private String regionId;
     @ApiModelProperty(value = "地区翻译")
     private String regionName;
+    @ApiModelProperty(value = "间隔时间(分钟)")
+    private Integer interval;
 }

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dto/StationInfoDTO.java

@@ -44,4 +44,6 @@ public class StationInfoDTO {
 
     @ApiModelProperty(value = "是否删除")
     private Boolean delFlag;
+    @ApiModelProperty(value = "半径(米)")
+    private Integer radius;
 }

+ 19 - 4
common/src/main/resources/mapper/base/RegionInfo.xml

@@ -17,6 +17,9 @@
         <result property="longitude" column="longitude_" />
         <result property="latitude" column="latitude_" />
         <result property="radius" column="radius_" />
+        <result property="sortNo" column="sort_no" />
+        <result property="parentName" column="parent_name" />
+
     </resultMap>
     <insert id="insert" parameterType="com.jpsoft.bus.modules.base.entity.RegionInfo">
         <!--
@@ -27,7 +30,7 @@
         <![CDATA[
 		insert into base_region_info
 	    (id_,name_,parent_id,remark_,create_by,create_time,update_by,update_time,del_flag,full_name,
-	    longitude_,latitude_,radius_)
+	    longitude_,latitude_,radius_,sort_no)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -43,6 +46,7 @@
 ,#{longitude,jdbcType=DOUBLE}
 ,#{latitude,jdbcType=DOUBLE}
 ,#{radius,jdbcType= NUMERIC }
+,#{sortNo,jdbcType= NUMERIC }
 		)
 	]]>
     </insert>
@@ -88,6 +92,9 @@
             <if test="radius!=null">
                 radius_=#{radius,jdbcType= NUMERIC },
             </if>
+            <if test="sortNo!=null">
+                sort_no=#{sortNo,jdbcType= NUMERIC },
+            </if>
         </set>
         where id_=#{id}
     </update>
@@ -102,12 +109,20 @@
 	</select>
     <select id="search" parameterType="hashmap" resultMap="RegionInfoMap">
         <![CDATA[
-			select * from base_region_info
+			SELECT
+                a.*,
+                b.name_ AS parent_name
+            FROM
+                base_region_info a
+                LEFT JOIN base_region_info b ON a.parent_id = b.id_
 		]]>
         <where>
-            and del_flag = 0
+            and a.del_flag = 0
             <if test="searchParams.id != null">
-                and ID_ like #{searchParams.id}
+                and a.ID_ like #{searchParams.id}
+            </if>
+            <if test="searchParams.name != null">
+                and a.name_ like #{searchParams.name}
             </if>
         </where>
         <foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 5 - 9
web/src/main/java/com/jpsoft/bus/modules/base/controller/RegionInfoController.java

@@ -199,8 +199,7 @@ public class RegionInfoController {
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
             String id,
-            @RequestParam(value="sceneId",defaultValue="") String sceneId,
-            @RequestParam(value="useEnable",defaultValue="") String useEnable,
+            @RequestParam(value="name",defaultValue="") String name,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -213,18 +212,15 @@ public class RegionInfoController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("a.create_time","asc"));
+        sortList.add(new Sort("b.sort_no","asc"));
+        sortList.add(new Sort("a.sort_no","asc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
         }
 
-        if (StringUtils.isNotEmpty(sceneId)) {
-            searchParams.put("sceneId",sceneId);
-        }
-
-        if (StringUtils.isNotEmpty(useEnable)) {
-            searchParams.put("useEnable",useEnable);
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name","%" + name + "%");
         }
 
         Page<RegionInfo> page = regionInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);

+ 3 - 0
web/src/main/java/com/jpsoft/bus/modules/bus/controller/RouteInfoController.java

@@ -180,6 +180,7 @@ public class RouteInfoController {
                     String classifyName = dataDictionaryService.findNameByCatalogNameAndValue("站点类型",stationInfo.getClassify().toString());
                     stationInfoDTO.setClassifyName(classifyName);
                     stationInfoDTO.setRouteId(stationInfo.getRouteId());
+                    stationInfoDTO.setRadius(stationInfo.getRadius());
                     stationInfoDTO.setSortNo(stationInfo.getSortNo());
                     stationInfoDTO.setDelFlag(stationInfo.getDelFlag());
 
@@ -234,6 +235,7 @@ public class RouteInfoController {
             routeInfo.setStartTime(dto.getStartTime());
             routeInfo.setEndTime(dto.getEndTime());
             routeInfo.setRegionId(dto.getRegionId());
+            routeInfo.setInterval(dto.getInterval());
             routeInfo.setUpdateBy(subject);
             routeInfo.setUpdateTime(new Date());
 
@@ -263,6 +265,7 @@ public class RouteInfoController {
                                 }
                             }
 
+                            stationInfo.setRadius(stationInfoDTO.getRadius());
                             stationInfo.setSortNo(stationInfoDTO.getSortNo());
                             stationInfo.setUpdateBy(subject);
                             stationInfo.setUpdateTime(new Date());