Commit 7d2f98d69b0fab75cb20f4cb282a3f90dfcae4f9
1 parent
57d776b7
线路添加删除功能..
Showing
11 changed files
with
159 additions
and
33 deletions
src/main/java/com/bsth/controller/LineController.java
| 1 | 1 | package com.bsth.controller; |
| 2 | 2 | |
| 3 | -import java.text.ParseException; | |
| 4 | -import java.text.SimpleDateFormat; | |
| 5 | -import java.util.Date; | |
| 6 | -import java.util.HashMap; | |
| 7 | -import java.util.Map; | |
| 8 | - | |
| 9 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | -import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | -import org.springframework.web.bind.annotation.RequestParam; | |
| 13 | -import org.springframework.web.bind.annotation.RestController; | |
| 14 | - | |
| 15 | 3 | import com.bsth.common.ResponseCode; |
| 16 | 4 | import com.bsth.entity.Line; |
| 17 | 5 | import com.bsth.entity.LineVersions; |
| 18 | 6 | import com.bsth.service.LineService; |
| 19 | 7 | import com.bsth.service.LineVersionsService; |
| 20 | 8 | import com.bsth.util.GetUIDAndCode; |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 13 | +import org.springframework.web.bind.annotation.RestController; | |
| 14 | + | |
| 15 | +import java.text.ParseException; | |
| 16 | +import java.text.SimpleDateFormat; | |
| 17 | +import java.util.Date; | |
| 18 | +import java.util.HashMap; | |
| 19 | +import java.util.Map; | |
| 21 | 20 | |
| 22 | 21 | /** |
| 23 | 22 | * |
| ... | ... | @@ -123,4 +122,14 @@ public class LineController extends BaseController<Line, Integer> { |
| 123 | 122 | Line findByID(@RequestParam(defaultValue = "id") Integer id){ |
| 124 | 123 | return service.findById(id); |
| 125 | 124 | } |
| 125 | + | |
| 126 | + /** | |
| 127 | + * 删除线路 | |
| 128 | + * @param id | |
| 129 | + * @return | |
| 130 | + */ | |
| 131 | + @RequestMapping(value ="/remove" , method = RequestMethod.POST) | |
| 132 | + public Map<String, Object> remove(Integer id){ | |
| 133 | + return service.remove(id); | |
| 134 | + } | |
| 126 | 135 | } | ... | ... |
src/main/java/com/bsth/entity/Line.java
| ... | ... | @@ -160,6 +160,11 @@ public class Line implements Serializable { |
| 160 | 160 | |
| 161 | 161 | /** 是否在使用 <1:是;0:否> bit length(50) */ |
| 162 | 162 | private Integer inUse; |
| 163 | + | |
| 164 | + /** | |
| 165 | + * 逻辑删除标记 为 1:标识已删除 | |
| 166 | + */ | |
| 167 | + private Integer remove; | |
| 163 | 168 | |
| 164 | 169 | public Integer getSpacGrade() { |
| 165 | 170 | return spacGrade; |
| ... | ... | @@ -492,6 +497,13 @@ public class Line implements Serializable { |
| 492 | 497 | public void setSfyy(Integer sfyy) { |
| 493 | 498 | this.sfyy = sfyy; |
| 494 | 499 | } |
| 495 | - | |
| 496 | - | |
| 500 | + | |
| 501 | + | |
| 502 | + public Integer getRemove() { | |
| 503 | + return remove; | |
| 504 | + } | |
| 505 | + | |
| 506 | + public void setRemove(Integer remove) { | |
| 507 | + this.remove = remove; | |
| 508 | + } | |
| 497 | 509 | } | ... | ... |
src/main/java/com/bsth/service/LineService.java
| 1 | 1 | package com.bsth.service; |
| 2 | 2 | |
| 3 | -import java.util.Map; | |
| 4 | - | |
| 5 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 6 | -import org.springframework.web.bind.annotation.RequestMethod; | |
| 7 | - | |
| 8 | 3 | import com.bsth.entity.Line; |
| 9 | 4 | |
| 5 | +import java.util.Map; | |
| 6 | + | |
| 10 | 7 | /** |
| 11 | 8 | * |
| 12 | 9 | * @Interface: LineService(线路service业务层实现接口) |
| ... | ... | @@ -38,4 +35,6 @@ public interface LineService extends BaseService<Line, Integer> { |
| 38 | 35 | String lineCodeVerification(String lineCode); |
| 39 | 36 | |
| 40 | 37 | Map<String, Object> update(Line l); |
| 38 | + | |
| 39 | + Map<String,Object> remove(Integer id); | |
| 41 | 40 | } | ... | ... |
src/main/java/com/bsth/service/impl/LineServiceImpl.java
| 1 | 1 | package com.bsth.service.impl; |
| 2 | 2 | |
| 3 | -import java.util.HashMap; | |
| 4 | -import java.util.Map; | |
| 5 | - | |
| 6 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | -import org.springframework.stereotype.Service; | |
| 8 | -import org.springframework.transaction.annotation.Transactional; | |
| 9 | - | |
| 10 | 3 | import com.bsth.common.ResponseCode; |
| 11 | 4 | import com.bsth.entity.Line; |
| 12 | 5 | import com.bsth.repository.LineRepository; |
| 13 | 6 | import com.bsth.service.LineService; |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 9 | +import org.springframework.stereotype.Service; | |
| 10 | +import org.springframework.transaction.annotation.Transactional; | |
| 11 | + | |
| 12 | +import java.util.HashMap; | |
| 13 | +import java.util.Map; | |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * |
| ... | ... | @@ -34,6 +34,9 @@ public class LineServiceImpl extends BaseServiceImpl<Line, Integer> implements L |
| 34 | 34 | @Autowired |
| 35 | 35 | private LineRepository repository; |
| 36 | 36 | |
| 37 | + @Autowired | |
| 38 | + JdbcTemplate jdbcTemplate; | |
| 39 | + | |
| 37 | 40 | /** |
| 38 | 41 | * 获取线路编码 |
| 39 | 42 | * |
| ... | ... | @@ -86,4 +89,32 @@ public class LineServiceImpl extends BaseServiceImpl<Line, Integer> implements L |
| 86 | 89 | return map; |
| 87 | 90 | } |
| 88 | 91 | |
| 92 | + @Override | |
| 93 | + public Map<String, Object> remove(Integer id) { | |
| 94 | + Map<String, Object> map = new HashMap<>(); | |
| 95 | + | |
| 96 | + try{ | |
| 97 | + if(null == id){ | |
| 98 | + map.put("status", ResponseCode.ERROR); | |
| 99 | + map.put("msg", "参数异常"); | |
| 100 | + return map; | |
| 101 | + } | |
| 102 | + | |
| 103 | + int destroy = jdbcTemplate.queryForObject("select destroy from bsth_c_line where id=" + id, Integer.class); | |
| 104 | + | |
| 105 | + if(destroy==0){ | |
| 106 | + map.put("status", ResponseCode.ERROR); | |
| 107 | + map.put("msg", "你只能删除已撤销的线路!"); | |
| 108 | + return map; | |
| 109 | + } | |
| 110 | + | |
| 111 | + jdbcTemplate.update("update bsth_c_line set `remove`=1 where id=?", id); | |
| 112 | + map.put("status", ResponseCode.SUCCESS); | |
| 113 | + }catch (Exception e){ | |
| 114 | + logger.error("", e); | |
| 115 | + map.put("status", ResponseCode.ERROR); | |
| 116 | + map.put("msg", e.getMessage()); | |
| 117 | + } | |
| 118 | + return map; | |
| 119 | + } | |
| 89 | 120 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -1234,7 +1234,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1234 | 1234 | ScheduleModifyLogger.sftz(sch, fcsjActual, remarks); |
| 1235 | 1235 | |
| 1236 | 1236 | sch.setFcsjActualAll(fcsjActual); |
| 1237 | - sch.addRemarks(remarks); | |
| 1237 | + sch.setRemark(remarks); | |
| 1238 | 1238 | sch.calcStatus(); |
| 1239 | 1239 | //if(sch.isLate2()){ |
| 1240 | 1240 | //取消应发未到标记 | ... | ... |
src/main/resources/static/pages/base/line/js/line-list-table.js
src/main/resources/static/pages/base/line/list.html
| 1 | 1 | <!-- <link href="/pages/base/line/css/animate.css" rel="stylesheet" type="text/css" /> |
| 2 | 2 | <link href="/pages/base/line/css/tipso.css" rel="stylesheet" type="text/css" /> --> |
| 3 | 3 | <!-- 片段标题 START --> |
| 4 | +<style> | |
| 5 | + a.ct_base_line_delete_link{ | |
| 6 | + font-size: 12px; | |
| 7 | + color: red; | |
| 8 | + vertical-align: bottom; | |
| 9 | + display: inline-block; | |
| 10 | + margin-left: 5px; | |
| 11 | + text-decoration: underline; | |
| 12 | + } | |
| 13 | + | |
| 14 | + a.ct_base_line_delete_link:hover{ | |
| 15 | + color: #d11608; | |
| 16 | + } | |
| 17 | +</style> | |
| 4 | 18 | <div class="page-head"> |
| 5 | 19 | <div class="page-title"> |
| 6 | 20 | <h1>线路信息</h1> |
| ... | ... | @@ -355,6 +369,10 @@ |
| 355 | 369 | <td> |
| 356 | 370 | <a href="details.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a> |
| 357 | 371 | <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> |
| 372 | + | |
| 373 | + {{if obj.destroy==1}} | |
| 374 | + <a class="ct_base_line_delete_link" data-id="{{obj.id}}" data-name="{{obj.name}}"> 删除 </a> | |
| 375 | + {{/if}} | |
| 358 | 376 | </td> |
| 359 | 377 | </tr> |
| 360 | 378 | {{/each}} |
| ... | ... | @@ -365,4 +383,23 @@ |
| 365 | 383 | {{/if}} |
| 366 | 384 | </script> |
| 367 | 385 | <!-- 线路信息片段JS模块 --> |
| 368 | -<script src="/pages/base/line/js/line-list-table.js"></script> | |
| 369 | 386 | \ No newline at end of file |
| 387 | +<script src="/pages/base/line/js/line-list-table.js"></script> | |
| 388 | +<script> | |
| 389 | + (function () { | |
| 390 | + $(document).on('click', 'a.ct_base_line_delete_link', function () { | |
| 391 | + var id = $(this).data('id'), | |
| 392 | + name = $(this).data('name'); | |
| 393 | + | |
| 394 | + layer.confirm('你确定要删除线路【'+name+'】?', { | |
| 395 | + btn: ['确定删除','取消'] //按钮 | |
| 396 | + }, function(){ | |
| 397 | + layer.msg('操作中...', {icon: 16,shade: 0.01}); | |
| 398 | + $post('/line/remove', {id: id}, function (rs) { | |
| 399 | + layer.msg('删除成功!'); | |
| 400 | + $('.filter-submit.margin-bottom').trigger('click'); | |
| 401 | + }); | |
| 402 | + | |
| 403 | + }); | |
| 404 | + }); | |
| 405 | + })(); | |
| 406 | +</script> | |
| 370 | 407 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/css/main.css
| ... | ... | @@ -338,6 +338,9 @@ svg.line-chart g.merge-item text { |
| 338 | 338 | .tooltip span.field { |
| 339 | 339 | color: #7d7d7b; |
| 340 | 340 | margin-right: 5px; |
| 341 | + width: 52px; | |
| 342 | + display: inline-block; | |
| 343 | + text-align: right; | |
| 341 | 344 | } |
| 342 | 345 | |
| 343 | 346 | .tooltip .tip_map_wrap { |
| ... | ... | @@ -2026,4 +2029,10 @@ dl.active > dd.disabled { |
| 2026 | 2029 | 100% { |
| 2027 | 2030 | background: rgba(254, 235, 69, 0.38); |
| 2028 | 2031 | } |
| 2032 | +} | |
| 2033 | + | |
| 2034 | +.home_svg_tips>div{ | |
| 2035 | + overflow: hidden; | |
| 2036 | + text-overflow: ellipsis; | |
| 2037 | + white-space: nowrap; | |
| 2029 | 2038 | } |
| 2030 | 2039 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/home/tooltip.html
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | <div class="tooltip" data-id="{{deviceId}}"> |
| 4 | 4 | <div class="tooltip-container"> |
| 5 | 5 | |
| 6 | - <div class="cont-text-panel"> | |
| 6 | + <div class="cont-text-panel home_svg_tips"> | |
| 7 | 7 | <div class="title"> |
| 8 | 8 | <a href="javascript:;" data-for="station" class="tip_modal"> |
| 9 | 9 | {{nbbm}} |
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | <div> |
| 22 | 22 | <span class="field">车牌号:</span>{{plateNo}} |
| 23 | 23 | </div> |
| 24 | - <div> | |
| 24 | + <div title="{{stationName}}"> | |
| 25 | 25 | <span class="field">站点:</span>{{stationName}} |
| 26 | 26 | </div> |
| 27 | 27 | <!-- <div> |
| ... | ... | @@ -30,9 +30,19 @@ |
| 30 | 30 | <div> |
| 31 | 31 | <span class="field">设备:</span>{{deviceId}} |
| 32 | 32 | </div> |
| 33 | - <div> | |
| 33 | + <!--<div> | |
| 34 | 34 | <span class="field">坐标:</span>{{lon}} {{lat}} |
| 35 | - </div> | |
| 35 | + </div>--> | |
| 36 | + {{if sch!=null}} | |
| 37 | + <div> | |
| 38 | + <span class="field">驾驶员:</span>{{sch.jGh}}/{{sch.jName}} | |
| 39 | + </div> | |
| 40 | + {{if sch.sGh!=null && sch.sGh!=""}} | |
| 41 | + <div> | |
| 42 | + <span class="field">售票员:</span>{{sch.sGh}}/{{sch.sName}} | |
| 43 | + </div> | |
| 44 | + {{/if}} | |
| 45 | + {{/if}} | |
| 36 | 46 | <div> |
| 37 | 47 | <span class="field">速度:</span>{{speed>99?'..':speed}}</div> |
| 38 | 48 | <div> | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
src/main/resources/static/real_control_v2/mapmonitor/js/playback.js
| ... | ... | @@ -10,6 +10,18 @@ var gb_map_play_back = (function () { |
| 10 | 10 | dom = rs; |
| 11 | 11 | }); |
| 12 | 12 | |
| 13 | + var setParam = function (sch) { | |
| 14 | + console.log('sch', sch); | |
| 15 | + var f = $('.play-back-form form'), | |
| 16 | + st = (sch['fcsjActualTime']?sch['fcsjActualTime']:sch['dfsjT']) - 1000 * 60 * 5, | |
| 17 | + et = (sch['zdsjActualTime']?sch['zdsjActualTime']:sch['zdsjT']) + 1000 * 60 * 5, | |
| 18 | + fs = 'YYYY-MM-DD HH:mm'; | |
| 19 | + | |
| 20 | + $('[name=nbbm]', f).val(sch.clZbh); | |
| 21 | + $('[name=startTime]', f).val(moment(st).format(fs)); | |
| 22 | + $('[name=endTime]', f).val(moment(et).format(fs)); | |
| 23 | + }; | |
| 24 | + | |
| 13 | 25 | var initParams = function (deviceId, nbbm) { |
| 14 | 26 | //关闭infowindow |
| 15 | 27 | if (deviceId) |
| ... | ... | @@ -96,6 +108,7 @@ var gb_map_play_back = (function () { |
| 96 | 108 | |
| 97 | 109 | return { |
| 98 | 110 | initParams: initParams, |
| 99 | - listToExcel: listToExcel | |
| 111 | + listToExcel: listToExcel, | |
| 112 | + setParam: setParam | |
| 100 | 113 | } |
| 101 | 114 | })(); |
| 102 | 115 | \ No newline at end of file | ... | ... |