Commit 6069faab authored by hkl's avatar hkl

feat:1.代码提交

parent 767210b9
......@@ -83,6 +83,7 @@ public class TrainStationController extends JeecgController<TrainStation, ITrain
Map<String, Object> map = new HashMap<>();
map.put("label", trainStation.getStationName());
map.put("value", trainStation.getId());
map.put("lineAliasCode", trainStation.getLineAliasCode());
map.put("lightRailId", trainStation.getLightRailId());
list.add(map);
}
......
......@@ -21,4 +21,7 @@ public class SubwaySectionEditDTO {
@ApiModelProperty(value = "区间名")
private String sectionName;
@ApiModelProperty(value = "备注")
private String remark;
}
......@@ -67,4 +67,6 @@ public class SubwaySection implements Serializable {
@ApiModelProperty(value = "结束车站Id")
private String endTrainStationId;
@ApiModelProperty(value = "备注")
private String remark;
}
package org.jeecg.modules.subwayNetwork.mapper;
import org.jeecg.modules.subwayNetwork.entity.SectionStationMap;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 线路车站-区间站点映射
* @Author: jeecg-boot
* @Date: 2023-06-15
* @Version: V1.0
*/
public interface SectionStationMapMapper extends BaseMapper<SectionStationMap> {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.subwayNetwork.mapper.SectionStationMapMapper">
</mapper>
\ No newline at end of file
......@@ -11,7 +11,8 @@
t2.rail_line_name light_rail_name,
t1.light_rail_id,
t1.start_train_station_id,
t1.end_train_station_id
t1.end_train_station_id,
t1.remark
FROM
t_sn_subway_section t1 LEFT JOIN t_sn_light_rail t2 ON t1.light_rail_id = t2.id
<where>
......
package org.jeecg.modules.subwayNetwork.service;
import org.jeecg.modules.subwayNetwork.entity.SectionStationMap;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 线路车站-区间站点映射
* @Author: jeecg-boot
* @Date: 2023-06-15
* @Version: V1.0
*/
public interface ISectionStationMapService extends IService<SectionStationMap> {
}
package org.jeecg.modules.subwayNetwork.service.impl;
import org.jeecg.modules.subwayNetwork.entity.SectionStationMap;
import org.jeecg.modules.subwayNetwork.mapper.SectionStationMapMapper;
import org.jeecg.modules.subwayNetwork.service.ISectionStationMapService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 线路车站-区间站点映射
* @Author: jeecg-boot
* @Date: 2023-06-15
* @Version: V1.0
*/
@Service
public class SectionStationMapServiceImpl extends ServiceImpl<SectionStationMapMapper, SectionStationMap> implements ISectionStationMapService {
}
......@@ -2,29 +2,23 @@ package org.jeecg.modules.subwayNetwork.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.modules.subwayNetwork.dto.SubwaySectionEditDTO;
import org.jeecg.modules.subwayNetwork.dto.SubwaySectionQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.LightRail;
import org.jeecg.modules.subwayNetwork.entity.SubwaySection;
import org.jeecg.modules.subwayNetwork.entity.TrainStation;
import org.jeecg.modules.subwayNetwork.mapper.LightRailMapper;
import org.jeecg.modules.subwayNetwork.mapper.SubwaySectionMapper;
import org.jeecg.modules.subwayNetwork.mapper.TrainStationMapper;
import org.jeecg.modules.subwayNetwork.service.ISubwaySectionService;
import org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO;
import org.jeecg.modules.subwayNetwork.vo.SubwaySectionVO;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
/**
* @Description: 线路车站-地铁区间
......@@ -35,9 +29,6 @@ import java.util.List;
@Service
public class SubwaySectionServiceImpl extends ServiceImpl<SubwaySectionMapper, SubwaySection> implements ISubwaySectionService {
@Resource
private LightRailMapper lightRailMapper;
@Resource
private TrainStationMapper trainStationMapper;
......@@ -60,6 +51,18 @@ public class SubwaySectionServiceImpl extends ServiceImpl<SubwaySectionMapper, S
IPage<SubwaySectionVO> page = new Page<>(dto.getPageNo(), dto.getPageSize());
page = this.baseMapper.queryPageList(page, dto.getQuery());
for (SubwaySectionVO record : page.getRecords()) {
// 计算区间里程
TrainStation startTrainStation = trainStationMapper.selectById(record.getStartTrainStationId());
TrainStation endTrainStation = trainStationMapper.selectById(record.getEndTrainStationId());
BigDecimal sectionMileage = endTrainStation.getEndMileage().subtract(startTrainStation.getEndMileage());
record.setSectionMileage(sectionMileage);
// 车站数量
int trainStationNum = endTrainStation.getSeq() - startTrainStation.getSeq();
record.setTrainStationNum(trainStationNum);
}
return page;
......
......@@ -53,4 +53,7 @@ public class SubwaySectionVO {
@ApiModelProperty(value = "车站数量")
private Integer trainStationNum;
@ApiModelProperty(value = "备注")
private String remark;
}
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