Commit 9789dd4feb6d7091ed04a4eee5b8cf52ff6e5e35

Authored by 潘钊
1 parent 2c729139

update

src/main/java/com/bsth/entity/realcontrol/LineConfig.java
... ... @@ -75,6 +75,15 @@ public class LineConfig {
75 75 //下行出站
76 76 private int downOutDiff;
77 77  
  78 + /**
  79 + * 应急停靠
  80 + */
  81 + private boolean enableYjtk;
  82 + private String yjtkStart;
  83 + private String yjtkEnd;
  84 + private int upStopMinute;
  85 + private int downStopMinute;
  86 +
78 87  
79 88 @OneToMany(cascade = CascadeType.ALL)
80 89 private Set<D80ReplyTemp> d80Temps = new HashSet<>();
... ... @@ -219,4 +228,44 @@ public class LineConfig {
219 228 public void setTwinsPark(String twinsPark) {
220 229 this.twinsPark = twinsPark;
221 230 }
  231 +
  232 + public String getYjtkStart() {
  233 + return yjtkStart;
  234 + }
  235 +
  236 + public void setYjtkStart(String yjtkStart) {
  237 + this.yjtkStart = yjtkStart;
  238 + }
  239 +
  240 + public String getYjtkEnd() {
  241 + return yjtkEnd;
  242 + }
  243 +
  244 + public void setYjtkEnd(String yjtkEnd) {
  245 + this.yjtkEnd = yjtkEnd;
  246 + }
  247 +
  248 + public int getUpStopMinute() {
  249 + return upStopMinute;
  250 + }
  251 +
  252 + public void setUpStopMinute(int upStopMinute) {
  253 + this.upStopMinute = upStopMinute;
  254 + }
  255 +
  256 + public int getDownStopMinute() {
  257 + return downStopMinute;
  258 + }
  259 +
  260 + public void setDownStopMinute(int downStopMinute) {
  261 + this.downStopMinute = downStopMinute;
  262 + }
  263 +
  264 + public boolean isEnableYjtk() {
  265 + return enableYjtk;
  266 + }
  267 +
  268 + public void setEnableYjtk(boolean enableYjtk) {
  269 + this.enableYjtk = enableYjtk;
  270 + }
222 271 }
... ...
src/main/java/com/bsth/repository/sys/DutyEmployeeRepository.java
... ... @@ -13,7 +13,7 @@ import java.util.List;
13 13 @Repository
14 14 public interface DutyEmployeeRepository extends BaseRepository<DutyEmployee, Long>{
15 15  
16   - //@Query("select t from DutyEmployee t where t.codeIdx like %?1% and t.ts > ?2 and t.ts < ?3")
17   - @Query("select t from DutyEmployee t where t.codeIdx like %?1% and t.ts < ?2")
18   - List<DutyEmployee> findByLineAndTime(String lineCode, long et);
  16 + @Query("select t from DutyEmployee t where t.codeIdx like %?1% and t.ts > ?2 and t.ts < ?3")
  17 + //@Query("select t from DutyEmployee t where t.codeIdx like %?1% and t.ts < ?2")
  18 + List<DutyEmployee> findByLineAndTime(String lineCode, long st, long et);
19 19 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/LineConfigServiceImpl.java
... ... @@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
11 11 import org.springframework.beans.factory.annotation.Autowired;
12 12 import org.springframework.stereotype.Service;
13 13  
  14 +import java.lang.reflect.Field;
14 15 import java.util.ArrayList;
15 16 import java.util.HashMap;
16 17 import java.util.List;
... ... @@ -104,7 +105,7 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt;
104 105 try {
105 106 LineConfig conf = lineConfigData.get(lineCode);
106 107  
107   - conf.setInParkForSource(enable==1);
  108 + conf.setInParkForSource(enable == 1);
108 109 lineConfigData.set(conf);
109 110  
110 111 rs.put("status", ResponseCode.SUCCESS);
... ... @@ -123,8 +124,10 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt;
123 124 Map<String, Object> rs = new HashMap<>();
124 125 try {
125 126 LineConfig conf = lineConfigData.get(lineCode);
  127 + Field f = conf.getClass().getDeclaredField(field);
  128 + f.setAccessible(true);
  129 + f.setInt(conf, Integer.parseInt(value));
126 130  
127   - conf.getClass().getField(field).set(conf, value);
128 131 lineConfigData.set(conf);
129 132  
130 133 rs.put("status", ResponseCode.SUCCESS);
... ...
src/main/java/com/bsth/service/sys/impl/DutyEmployeeServiceImpl.java
... ... @@ -39,6 +39,7 @@ public class DutyEmployeeServiceImpl extends BaseServiceImpl&lt;DutyEmployee, Long&gt;
39 39 */
40 40 public List<DutyEmployee> getDutyEmployee(String lineCode, String startTime, String endTime) {
41 41 DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm");
42   - return dutyEmployeeRepository.findByLineAndTime(lineCode + ",", fmtyyyyMMddHHmm.parseMillis(endTime));
  42 + return dutyEmployeeRepository.findByLineAndTime(lineCode + ",", fmtyyyyMMddHHmm.parseMillis(startTime)
  43 + , fmtyyyyMMddHHmm.parseMillis(endTime));
43 44 }
44 45 }
... ...
src/main/resources/static/real_control_v2/css/line_schedule.css
... ... @@ -923,7 +923,7 @@ input.i-cbox[type=checkbox]{
923 923  
924 924 #add-sub-task-inpark-modal .uk-modal-dialog{
925 925 width: 755px;
926   - transition: all .3s ease;
  926 + /*transition: all .3s ease;*/
927 927 }
928 928  
929 929 #add-sub-task-inpark-modal .uk-modal-dialog.three-children{
... ...
src/main/resources/static/real_control_v2/css/modal_extend.css 0 → 100644
  1 +.uk-modal{
  2 + background: rgba(0,0,0,.4) !important;
  3 +}
  4 +
  5 +.uk-modal-dialog{
  6 + border: 1px solid #dd6952;
  7 +
  8 + position: absolute !important;
  9 + margin: 0 !important;
  10 +}
  11 +
  12 +.uk-modal-dialog.uk-modal-dialog-blank{
  13 + border: none !important;
  14 +}
  15 +
  16 +.uk-modal-header{
  17 + cursor: move;
  18 + user-select: none;
  19 +}
0 20 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/buffer_config.html
... ... @@ -48,7 +48,7 @@
48 48 <tr>
49 49 <td colspan="2" style="padding-left: 30px;">
50 50 是否启用
51   - <select class="z-depth-input">
  51 + <select class="z-depth-input" name="enableYjtk">
52 52 <option>禁用</option>
53 53 <option>启用</option>
54 54 </select>
... ... @@ -57,20 +57,20 @@
57 57 <tr>
58 58 <td colspan="2" style="padding-left: 58px;">
59 59 时间
60   - <input type="time" disabled>至
61   - <input type="time" disabled>
  60 + <input type="time" value="{{yjtkStart}}" name="yjtkStart" {{if !enableYjtk}}disabled{{/if}}>至
  61 + <input type="time" value="{{yjtkEnd}}" name="yjtkEnd" {{if !enableYjtk}}disabled{{/if}}>
62 62 </td>
63 63 </tr>
64 64 <tr>
65 65 <td>
66 66 上行停靠时间
67   - <input type="number" disabled>分钟
  67 + <input type="number" value="{{upStopMinute}}" name="upStopMinute" {{if !enableYjtk}}disabled{{/if}}>分钟
68 68 </td>
69 69 </tr>
70 70 <tr>
71 71 <td>
72 72 下行停靠时间
73   - <input type="number" disabled>分钟
  73 + <input type="number" value="{{downStopMinute}}" name="downStopMinute" {{if !enableYjtk}}disabled{{/if}}>分钟
74 74 </td>
75 75 </tr>
76 76 </table>
... ... @@ -108,11 +108,15 @@
108 108 value: val
109 109 }, function (rs) {
110 110 conf[rs.field] = rs.value;
111   - console.log('rs', rs);
112 111 notify_succ(textMap[field] + val + '秒');
113 112 });
114 113 }
115 114 });
  115 +
  116 + //应急停靠
  117 + $('[name=enableYjtk]', wrap).on('change', function () {
  118 +
  119 + });
116 120 });
117 121  
118 122 })();
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config.html
... ... @@ -63,6 +63,16 @@
63 63 }
64 64 });
65 65  
  66 + /**
  67 + * 手风琴拨动
  68 + */
  69 + $('.uk-accordion').on('toggle.uk.accordion', function (e, active, toggle, content) {
  70 + if(active){
  71 + activeCode = $(toggle).data('id');
  72 + load();
  73 + }
  74 + });
  75 +
66 76 var load = function () {
67 77 //获取线路配置信息
68 78 $.get('/lineConfig/getByLineCode', {lineCode: activeCode}, function (conf) {
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config_entity.html
... ... @@ -9,7 +9,7 @@
9 9 </h2>
10 10 <div>
11 11 <div>
12   - 闵行11路每天
  12 + <span class="line_name"></span>每天
13 13 <div class="uk-form-icon" style="margin: 0 5px;">
14 14 <i class="uk-icon-clock-o"></i>
15 15 <input name="startOptInput" readonly type="text" class="z-depth-input" value="{{startOpt}}"
... ... @@ -23,8 +23,8 @@
23 23 <small><i class="uk-icon-question-circle"></i> 所有发车时间小于该时间的班次都默认跨过24点,手动调整的实发实达均应用此规则。</small>
24 24 </li>
25 25 </ul>
26   - <a class="uk-button uk-button-mini">删除班次</a>
27   - <a class="uk-button uk-button-mini">重新加载计划排班</a>
  26 + <a class="uk-button uk-button-mini">删除实际排班</a>
  27 + <a class="uk-button uk-button-mini">重新加载实际排班</a>
28 28 <a class="uk-button uk-button-mini">加载历史GPS恢复到离站</a>
29 29 </div>
30 30 </div>
... ... @@ -60,7 +60,7 @@
60 60 </h2>
61 61 <div>
62 62 是否启用
63   - <select name="inParkForSourceSelect" class="z-depth-input">
  63 + <select name="inParkForSourceSelect" class="z-depth-input" disabled>
64 64 <option value="0">禁用</option>
65 65 <option value="1">启用</option>
66 66 </select>
... ... @@ -87,7 +87,7 @@
87 87 var htmlStr = template('line_config_entity_form-temp', conf);
88 88 $('form', wrap).html(htmlStr);
89 89  
90   - console.log('confconf', conf);
  90 + $('.line_name', '#line_config_entity_wrap').text(conf.line.name);
91 91 //更新排班时间
92 92 $('input[name=startOptInput]', wrap).on('change', updateStartTime);
93 93 //出场时间类型
... ...
src/main/resources/static/real_control_v2/js/main.js
... ... @@ -61,10 +61,7 @@ var gb_main_ep = new EventProxy(),
61 61 }
62 62 });
63 63  
64   -//modal hide remove dom
65   -$(document).on('hide.uk.modal', '.uk-modal', function () {
66   - $(this).remove();
67   -});
  64 +
68 65  
69 66 $(document).on('click', '.ct-bottom-drawer-close', function () {
70 67 $(this).parents('.ct-bottom-drawer').removeClass('open');
... ... @@ -150,30 +147,6 @@ var disabled_submit_btn = function (form) {
150 147 }
151 148 };
152 149  
153   -var show_modal = function (id, dom) {
154   - $(document.body).append(dom);
155   - return UIkit.modal(id, {
156   - bgclose: false
157   - }).show();
158   -};
159   -
160   -var open_modal = function (pageUrl, data, opt) {
161   - $.get(pageUrl, function (dom) {
162   - if (!$(dom).hasClass('uk-modal')) {
163   - alert('无效的dom片段!');
164   - return;
165   - }
166   - var id = '#' + $(dom).attr('id');
167   -
168   - $(document.body).append(dom);
169   -
170   - UIkit.modal(id, opt).show();
171   -
172   - if (data)
173   - $(id).trigger('init', data);
174   - });
175   -};
176   -
177 150  
178 151 function showUpdateDescription() {
179 152 //更新说明
... ...
src/main/resources/static/real_control_v2/js/modal_extend.js 0 → 100644
  1 +
  2 +//modal hide remove dom
  3 +$(document).on('hide.uk.modal', '.uk-modal', function () {
  4 + $(this).remove();
  5 +});
  6 +
  7 +$(document).on('show.uk.modal', '.uk-modal', function () {
  8 + if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-blank'))
  9 + return;
  10 + //计算居中位置
  11 + var win = $('body');
  12 + var Y = (win.width() - $('.uk-modal-dialog', this).width()) / 2 - 10;
  13 + $('.uk-modal-dialog', this).css('top', '50px').css('left', Y + 'px');
  14 +});
  15 +
  16 +var show_modal = function (id, dom) {
  17 + $(document.body).append(dom);
  18 + return UIkit.modal(id, {
  19 + bgclose: false
  20 + }).show();
  21 +};
  22 +
  23 +var open_modal = function (pageUrl, data, opt) {
  24 + $.get(pageUrl, function (dom) {
  25 + if (!$(dom).hasClass('uk-modal')) {
  26 + alert('无效的dom片段!');
  27 + return;
  28 + }
  29 + var id = '#' + $(dom).attr('id');
  30 +
  31 + $(document.body).append(dom);
  32 + UIkit.modal(id, opt).show();
  33 + //move
  34 + modal_move($('.uk-modal-header',id));
  35 +
  36 + if (data)
  37 + $(id).trigger('init', data);
  38 + });
  39 +};
  40 +
  41 +
  42 +var modal_move = function (m_header) {
  43 + var _moveFlag;
  44 + var _moveObj;
  45 + var _offset;
  46 + var dict= {};
  47 + var win = $('body');
  48 +
  49 + $(m_header).on('mousedown', function (e) {
  50 + console.log('mousedown');
  51 + e.preventDefault();
  52 + _moveFlag = true;
  53 + _moveObj = $(this).parent();
  54 + _offset = [
  55 + e.clientX - parseFloat(_moveObj.css('left')) - 1,
  56 + e.clientY - parseFloat(_moveObj.css('top')) - 1
  57 + ];
  58 + });
  59 +
  60 + $(m_header).parents('.uk-modal').mousemove(function (e) {
  61 + e.preventDefault();
  62 + if(!_moveFlag || !_moveObj)
  63 + return;
  64 +
  65 + var X = e.clientX - _offset[0]
  66 + ,Y = e.clientY - _offset[1];
  67 +
  68 + dict.stX = win.scrollLeft();
  69 + dict.stY = win.scrollTop();
  70 +
  71 + //控制元素不被拖出窗口外
  72 + var setRig = win.width() - _moveObj.outerWidth() + dict.stX
  73 + ,setBot = win.height() - _moveObj.outerHeight() + dict.stY;
  74 + X < dict.stX && (X = dict.stX);
  75 + X > setRig && (X = setRig);
  76 + Y < dict.stY && (Y = dict.stY);
  77 + Y > setBot && (Y = setBot);
  78 +
  79 + _moveObj.css({
  80 + left: X
  81 + ,top: Y
  82 + });
  83 + });
  84 + $(window).on('mouseup', function () {
  85 + _moveFlag = false;
  86 + _moveObj = null;
  87 + });
  88 +
  89 +};
... ...
src/main/resources/static/real_control_v2/main.html
... ... @@ -33,6 +33,7 @@
33 33 <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css"/>
34 34 <link rel="stylesheet" href="/real_control_v2/css/pace.css"/>
35 35  
  36 + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css"/>
36 37 </head>
37 38  
38 39 <body>
... ... @@ -181,6 +182,8 @@
181 182  
182 183 <!-- 处理表单片段嵌入问题 -->
183 184 <script src="/real_control_v2/js/forms/form_embed.js"></script>
  185 +
  186 +<script src="/real_control_v2/js/modal_extend.js"></script>
184 187 </body>
185 188  
186 189 </html>
... ...