Commit bb7ff122a946c440ce9e2ab92c69fc93a603cd2c
1 parent
c33aec36
1.3月31日更新
Showing
7 changed files
with
70 additions
and
6 deletions
src/main/java/com/bsth/controller/StationController.java
| ... | ... | @@ -42,6 +42,8 @@ public class StationController extends BaseController<Station, Integer> { |
| 42 | 42 | @Autowired |
| 43 | 43 | private ObjectMapper mapper; |
| 44 | 44 | |
| 45 | + private boolean executing = false; | |
| 46 | + | |
| 45 | 47 | /** 日志记录器 */ |
| 46 | 48 | private static final Logger log = LoggerFactory.getLogger(StationController.class); |
| 47 | 49 | |
| ... | ... | @@ -121,4 +123,31 @@ public class StationController extends BaseController<Station, Integer> { |
| 121 | 123 | public List<Station> findStationByName(String stationName) { |
| 122 | 124 | return stationService.findStationByName(stationName); |
| 123 | 125 | } |
| 126 | + | |
| 127 | + /** | |
| 128 | + * 更新所有站点途径线路信息 | |
| 129 | + * @return | |
| 130 | + */ | |
| 131 | + @RequestMapping(value="generate-pass-line" , method = RequestMethod.POST) | |
| 132 | + public Map<String, Object> generatePassLine() { | |
| 133 | + Map<String, Object> result = new HashMap<>(); | |
| 134 | + if (executing) { | |
| 135 | + result.put("status", ResponseCode.ERROR); | |
| 136 | + result.put("msg", "计算正在执行中,请勿重复操作"); | |
| 137 | + | |
| 138 | + return result; | |
| 139 | + } | |
| 140 | + executing = true; | |
| 141 | + try { | |
| 142 | + stationService.generatePassLine(); | |
| 143 | + result.put("status", ResponseCode.SUCCESS); | |
| 144 | + } catch (Exception e) { | |
| 145 | + result.put("status", ResponseCode.ERROR); | |
| 146 | + throw new RuntimeException(e); | |
| 147 | + } finally { | |
| 148 | + executing = false; | |
| 149 | + } | |
| 150 | + | |
| 151 | + return result; | |
| 152 | + } | |
| 124 | 153 | } | ... | ... |
src/main/java/com/bsth/repository/StationRepository.java
| ... | ... | @@ -45,4 +45,11 @@ public interface StationRepository extends BaseRepository<Station, Integer> { |
| 45 | 45 | |
| 46 | 46 | @Query(value = "SELECT ST_AsText(b.buffer_polygon_wgs) g_polygon_grid, b.shaped_type,CONCAT(ST_X(a.center_point), ' ', ST_Y(a.center_point)) g_center_point , b.radius, a.station_code, b.station_name FROM bsth_c_station a JOIN bsth_c_stationroute b ON a.id = b.station WHERE b.line_code = ?1 AND a.station_code = ?2", nativeQuery = true) |
| 47 | 47 | Object[][] findBufferArea(String lineCode, String stationCode); |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 根据站点被引用情况生成站点的途径线路 | |
| 51 | + */ | |
| 52 | + @Modifying | |
| 53 | + @Query(value="UPDATE bsth_c_station t4 JOIN (SELECT t1.id, GROUP_CONCAT(t3.name,'-',t2.directions,'[',t2.station_name,']') pass_lines FROM bsth_c_station t1 LEFT JOIN bsth_c_stationroute t2 ON t1.id = t2.station LEFT JOIN bsth_c_line t3 ON t2.line = t3.id WHERE t2.destroy = 0 GROUP BY t1.id) t5 ON t4.id = t5.id SET t4.pass_lines = t5.pass_lines", nativeQuery = true) | |
| 54 | + void generatePassLine(); | |
| 48 | 55 | } | ... | ... |
src/main/java/com/bsth/service/StationService.java
src/main/java/com/bsth/service/impl/StationServiceImpl.java
| ... | ... | @@ -152,6 +152,15 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | + * 更新所有站点途径线路信息 | |
| 156 | + */ | |
| 157 | + @Transactional | |
| 158 | + @Override | |
| 159 | + public void generatePassLine() { | |
| 160 | + stationRepository.generatePassLine(); | |
| 161 | + } | |
| 162 | + | |
| 163 | + /** | |
| 155 | 164 | * 存在wkt 则转换wkt为geo信息 |
| 156 | 165 | * @param station |
| 157 | 166 | */ | ... | ... |
src/main/resources/static/pages/base/station/js/station-list-table.js
| ... | ... | @@ -64,7 +64,17 @@ |
| 64 | 64 | $('tr.filter .filter-submit').on('click',function(){ |
| 65 | 65 | initSearch(); |
| 66 | 66 | }); |
| 67 | - | |
| 67 | + | |
| 68 | + $('#generatePassLine').on('click', function () { | |
| 69 | + $.post('/station/generate-pass-line', {}, function(res) { | |
| 70 | + if(res.status == 'SUCCESS') { | |
| 71 | + layer.msg('操作成功...'); | |
| 72 | + } else { | |
| 73 | + layer.msg('操作失败...'); | |
| 74 | + } | |
| 75 | + }); | |
| 76 | + }); | |
| 77 | + | |
| 68 | 78 | function initSearch() { |
| 69 | 79 | var params = getParams(); |
| 70 | 80 | page = 0; | ... | ... |
src/main/resources/static/pages/base/station/list.html
| ... | ... | @@ -23,6 +23,7 @@ |
| 23 | 23 | <div class="actions"> |
| 24 | 24 | <div class="btn-group btn-group-devided" data-toggle="buttons"> |
| 25 | 25 | <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加站点</a> |
| 26 | + <a class="btn btn-circle blue" href="javascript:void(0)" id="generatePassLine"><i class="fa fa-wrench"></i> 生成途径线路</a> | |
| 26 | 27 | </div> |
| 27 | 28 | </div> |
| 28 | 29 | </div> |
| ... | ... | @@ -50,7 +51,9 @@ |
| 50 | 51 | <td> |
| 51 | 52 | <input type="text" class="form-control form-filter input-sm" id="stationCode" name="stationCode_like"> |
| 52 | 53 | </td> |
| 53 | - <td></td> | |
| 54 | + <td> | |
| 55 | + <input type="text" class="form-control form-filter input-sm" id="passLines" name="passLines_like"> | |
| 56 | + </td> | |
| 54 | 57 | <td> |
| 55 | 58 | <input type="text" class="form-control form-filter input-sm" id="standardStationCode" name="standardStationCode_like"> |
| 56 | 59 | </td> | ... | ... |
src/main/resources/static/pages/home.html
| ... | ... | @@ -59,14 +59,15 @@ |
| 59 | 59 | } |
| 60 | 60 | </style> |
| 61 | 61 | <div class="system_change_log"> |
| 62 | - <h2 style="text-indent: 35px;margin: 10px 0 5px;">2024-09-12 更新说明 Changelog</h2> | |
| 62 | + <h2 style="text-indent: 35px;margin: 10px 0 5px;">2025-03-31 更新说明 Changelog</h2> | |
| 63 | 63 | <br><br> |
| 64 | 64 | <ul> |
| 65 | 65 | <li class="sub_title"><h6>报表</h6></li> |
| 66 | - <li><span class="label s_c_change">修改</span>1.某些报表在选择过多线路时无法得到查询结果问题修复</li> | |
| 67 | - <li><span class="label s_c_change">修改</span>2.审计公里汇总表显示异常问题修复</li> | |
| 66 | + <li><span class="label s_c_change">修改</span>1.线路调查表加入公司、起讫站列</li> | |
| 67 | + <li><span class="label s_c_change">修改</span>2.油电量计算保留三位小数</li> | |
| 68 | 68 | <li class="sub_title"><h6>线调</h6></li> |
| 69 | - <li><span class="label s_c_change">新增</span>1.线调中查看车辆信息的tip弹窗加入驾驶员联系方式(手机号存在的情况)</li> | |
| 69 | + <li><span class="label s_c_change">修改</span>1.服务热线-报备登记重复提交问题修复</li> | |
| 70 | + <li><span class="label s_c_change">修改</span>2.带前置电子围栏的终点站进站计算逻辑优化</li> | |
| 70 | 71 | </ul> |
| 71 | 72 | |
| 72 | 73 | </div> | ... | ... |