Commit 134f2d14 authored by hkl's avatar hkl

feat:1.首页代码提交

parent d3301b9c
...@@ -8,11 +8,11 @@ import org.jeecg.modules.homePage.dto.DiseaseDTO; ...@@ -8,11 +8,11 @@ import org.jeecg.modules.homePage.dto.DiseaseDTO;
import org.jeecg.modules.homePage.face.HomePageFace; import org.jeecg.modules.homePage.face.HomePageFace;
import org.jeecg.modules.homePage.vo.DiseaseVO; import org.jeecg.modules.homePage.vo.DiseaseVO;
import org.jeecg.modules.homePage.vo.ToDoVO; import org.jeecg.modules.homePage.vo.ToDoVO;
import org.jeecg.modules.homePage.vo.HomeSearchInfoVO;
import org.jeecg.modules.subwayNetwork.vo.SectionStationNode; import org.jeecg.modules.subwayNetwork.vo.SectionStationNode;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -31,8 +31,15 @@ public class HomePageController { ...@@ -31,8 +31,15 @@ public class HomePageController {
@Resource @Resource
private HomePageFace homePageFace; private HomePageFace homePageFace;
@AutoLog(value = "首页-获取线路下面所有的(区间-站点)树") @AutoLog(value = "首页-获取检索信息")
@ApiOperation(value = "首页-获取线路下面所有的(区间-站点)树", notes = "首页-获取线路下面所有的(区间-站点)树") @ApiOperation(value = "首页-获取检索信息", notes = "首页-获取检索信息")
@GetMapping(value = "/searchInfo")
public Result<List<HomeSearchInfoVO>> searchInfo(String query) {
return Result.OK(homePageFace.searchInfo(query));
}
@AutoLog(value = "首页-获取线路下面所有的(区间-站点)树-弃用")
@ApiOperation(value = "首页-获取线路下面所有的(区间-站点)树-弃用", notes = "首页-获取线路下面所有的(区间-站点)树")
@GetMapping(value = "/getTree") @GetMapping(value = "/getTree")
public Result<List<SectionStationNode>> getTree() { public Result<List<SectionStationNode>> getTree() {
return Result.OK(homePageFace.getTree()); return Result.OK(homePageFace.getTree());
......
...@@ -4,6 +4,7 @@ package org.jeecg.modules.homePage.face; ...@@ -4,6 +4,7 @@ package org.jeecg.modules.homePage.face;
import org.jeecg.modules.homePage.dto.DiseaseDTO; import org.jeecg.modules.homePage.dto.DiseaseDTO;
import org.jeecg.modules.homePage.vo.DiseaseVO; import org.jeecg.modules.homePage.vo.DiseaseVO;
import org.jeecg.modules.homePage.vo.ToDoVO; import org.jeecg.modules.homePage.vo.ToDoVO;
import org.jeecg.modules.homePage.vo.HomeSearchInfoVO;
import org.jeecg.modules.subwayNetwork.vo.SectionStationNode; import org.jeecg.modules.subwayNetwork.vo.SectionStationNode;
import java.util.List; import java.util.List;
...@@ -24,4 +25,11 @@ public interface HomePageFace { ...@@ -24,4 +25,11 @@ public interface HomePageFace {
ToDoVO todoList(); ToDoVO todoList();
List<DiseaseVO> diseaseList(DiseaseDTO dto); List<DiseaseVO> diseaseList(DiseaseDTO dto);
/**
* 获取车站信息
*
* @return
*/
List<HomeSearchInfoVO> searchInfo(String query);
} }
...@@ -2,7 +2,6 @@ package org.jeecg.modules.homePage.face.impl; ...@@ -2,7 +2,6 @@ package org.jeecg.modules.homePage.face.impl;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import io.swagger.models.auth.In;
import org.jeecg.modules.checkData.service.IMovementRecordsMasterService; import org.jeecg.modules.checkData.service.IMovementRecordsMasterService;
import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatch; import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatch;
import org.jeecg.modules.dynamicStaticAnalysis.service.IAnalysisBatchService; import org.jeecg.modules.dynamicStaticAnalysis.service.IAnalysisBatchService;
...@@ -13,12 +12,12 @@ import org.jeecg.modules.homePage.vo.ToDoDetailVO; ...@@ -13,12 +12,12 @@ import org.jeecg.modules.homePage.vo.ToDoDetailVO;
import org.jeecg.modules.homePage.vo.ToDoVO; import org.jeecg.modules.homePage.vo.ToDoVO;
import org.jeecg.modules.maintenanceWork.service.IWorkBatchService; import org.jeecg.modules.maintenanceWork.service.IWorkBatchService;
import org.jeecg.modules.subwayNetwork.service.ILightRailService; import org.jeecg.modules.subwayNetwork.service.ILightRailService;
import org.jeecg.modules.homePage.vo.HomeSearchInfoVO;
import org.jeecg.modules.subwayNetwork.vo.SectionStationNode; import org.jeecg.modules.subwayNetwork.vo.SectionStationNode;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -110,6 +109,13 @@ public class HomePageFaceImpl implements HomePageFace { ...@@ -110,6 +109,13 @@ public class HomePageFaceImpl implements HomePageFace {
return records; return records;
} }
@Override
public List<HomeSearchInfoVO> searchInfo(String query) {
List<HomeSearchInfoVO> voList = lightRailService.searchInfo(query);
return voList;
}
/** /**
* 条件过滤 * 条件过滤
* *
......
package org.jeecg.modules.homePage.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel(value = "首页检索信息")
public class HomeSearchInfoVO {
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "标签")
private String label;
@ApiModelProperty(value = "类型:1-车站 2-区间")
private Integer type;
@ApiModelProperty(value = "线别id")
private String lineAliasId;
@ApiModelProperty(value = "线别code【冠号】")
private String lineAliasCode;
@ApiModelProperty(value = "起始里程")
private BigDecimal startMileage;
@ApiModelProperty(value = "中心里程")
private BigDecimal centerMileage;
@ApiModelProperty(value = "结束里程")
private BigDecimal endMileage;
}
package org.jeecg.modules.subwayNetwork.mapper; package org.jeecg.modules.subwayNetwork.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.modules.homePage.vo.HomeSearchInfoVO;
import org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO; import org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.LightRail; import org.jeecg.modules.subwayNetwork.entity.LightRail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -22,4 +23,5 @@ public interface LightRailMapper extends BaseMapper<LightRail> { ...@@ -22,4 +23,5 @@ public interface LightRailMapper extends BaseMapper<LightRail> {
List<SectionStationNode> getTreeLightRailList(); List<SectionStationNode> getTreeLightRailList();
List<HomeSearchInfoVO> searchInfo(String query);
} }
...@@ -75,5 +75,42 @@ ...@@ -75,5 +75,42 @@
t_sn_light_rail t_sn_light_rail
--> -->
</select> </select>
<select id="searchInfo" resultType="org.jeecg.modules.homePage.vo.HomeSearchInfoVO">
SELECT * FROM
(
SELECT
CONCAT(tr.id,"-",ta.id,"-",ts.id) id,
CONCAT(tr.rail_line_name,"-",ta.line_alias_name,"-",ts.station_name) label,
1 type,
ts.id lineAliasId,
ta.line_alias_code lineAliasCode,
ts.starting_mileage startMileage,
ts.center_mileage centerMileage,
ts.end_mileage endMileage
FROM
t_sn_train_station ts
LEFT JOIN t_sn_line_alias ta ON ts.line_alias_id = ta.id
LEFT JOIN t_sn_light_rail tr ON ts.light_rail_id = tr.id
UNION ALL
SELECT
CONCAT(tr.id,"-",ta.id,"-",ts.id) id,
CONCAT(tr.rail_line_name,"-",ta.line_alias_name,"-",ts.section_name) label,
2 type,
ts.id lineAliasId,
ta.line_alias_name lineAliasCode,
ts.section_starting_mileage startMileage,
TRUNCATE((ts.section_end_mileage + ts.section_starting_mileage) / 2, 3) centerMileage,
ts.section_end_mileage endMileage
FROM
t_sn_subway_section ts
LEFT JOIN t_sn_line_alias ta ON ts.line_alias_id = ta.id
LEFT JOIN t_sn_light_rail tr ON ts.light_rail_id = tr.id
) t
WHERE 1=1
<if test="query != null and query != ''">
AND t.label LIKE concat('%',#{query},'%')
</if>
ORDER BY label
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,6 +2,7 @@ package org.jeecg.modules.subwayNetwork.service; ...@@ -2,6 +2,7 @@ package org.jeecg.modules.subwayNetwork.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.common.api.dto.PageSearch; import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.modules.homePage.vo.HomeSearchInfoVO;
import org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO; import org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.LightRail; import org.jeecg.modules.subwayNetwork.entity.LightRail;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
...@@ -31,4 +32,6 @@ public interface ILightRailService extends IService<LightRail> { ...@@ -31,4 +32,6 @@ public interface ILightRailService extends IService<LightRail> {
List<SectionStationMapVO> getSectionStation(); List<SectionStationMapVO> getSectionStation();
List<SectionStationNode> getTree(); List<SectionStationNode> getTree();
List<HomeSearchInfoVO> searchInfo(String query);
} }
...@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.api.dto.PageSearch; import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.modules.homePage.vo.HomeSearchInfoVO;
import org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO; import org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.LightRail; import org.jeecg.modules.subwayNetwork.entity.LightRail;
import org.jeecg.modules.subwayNetwork.entity.LineAlias; import org.jeecg.modules.subwayNetwork.entity.LineAlias;
...@@ -351,4 +352,9 @@ public class LightRailServiceImpl extends ServiceImpl<LightRailMapper, LightRail ...@@ -351,4 +352,9 @@ public class LightRailServiceImpl extends ServiceImpl<LightRailMapper, LightRail
*/ */
return lightRailList; return lightRailList;
} }
@Override
public List<HomeSearchInfoVO> searchInfo(String query) {
return this.baseMapper.searchInfo(query);
}
} }
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