Commit 1cea78d47f4c23fc2d85f984764a5603531eb14f

Authored by 潘钊
1 parent 2f8d0f5f

update...

src/main/java/com/bsth/controller/directive/DirectiveController.java
... ... @@ -173,15 +173,10 @@ public class DirectiveController {
173 173 }
174 174  
175 175 @RequestMapping(value = "/c0a4", method = RequestMethod.POST)
176   - public int c0a4(@RequestParam String nbbm){
  176 + public Map<String, Object> c0a4(@RequestParam String nbbm){
177 177 return directiveService.sendC0A4(nbbm);
178 178 }
179 179  
180   -// @RequestMapping(value = "/c0a3", method = RequestMethod.POST)
181   -// public int c0a3(@RequestParam DC0_A4 c0a4){
182   -// return directiveService.sendC0A3(c0a4);
183   -// }
184   -
185 180 @RequestMapping(value = "/c0a3", method = RequestMethod.POST)
186 181 public int c0a3(String json){
187 182 json = StringEscapeUtils.unescapeHtml4(json);
... ... @@ -192,7 +187,6 @@ public class DirectiveController {
192 187 @RequestMapping(value = "/c0a5", method = RequestMethod.POST)
193 188 public int c0a5(String json){
194 189 json = StringEscapeUtils.unescapeHtml4(json);
195   - //DC0_A3 c0a3 = JSON.toJavaObject(JSONObject.parseObject(json), DC0_A3.class);
196 190 return directiveService.sendC0A5(json);
197 191 }
198 192  
... ...
src/main/java/com/bsth/controller/realcontrol/LineConfigController.java
... ... @@ -101,4 +101,14 @@ public class LineConfigController extends BaseController&lt;LineConfig, Integer&gt;{
101 101 //System.out.println(map);
102 102 return lineConfigService.yjtkSet(map);
103 103 }
  104 +
  105 + /**
  106 + * 修改场既是站的 停车场 和 站点
  107 + * @param map
  108 + * @return
  109 + */
  110 + @RequestMapping(value = "/parkAndStationSet", method = RequestMethod.POST)
  111 + public Map<String, Object> parkAndStationSet(@RequestParam Map<String, String> map){
  112 + return lineConfigService.parkAndStationSet(map);
  113 + }
104 114 }
... ...
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
... ... @@ -49,25 +49,25 @@ public class SchAttrCalculator {
49 49 if (null == sch.getFcsjT())
50 50 calcFcsjTime(sch);
51 51  
52   - //計發時間
  52 + //计发時間
53 53 if(sch.getFcsj().compareTo(conf.getStartOpt()) < 0){
54 54 sch.setFcsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsj()) + DAY_TIME);
55 55 }
56 56  
57   - //待時間
  57 + //待時間
58 58 if(sch.getDfsj().compareTo(conf.getStartOpt()) < 0){
59 59 sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj()) + DAY_TIME);
60 60 }
61 61 else
62 62 sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj()));
63 63  
64   - //實發時間
  64 + //实发時間
65 65 if(StringUtils.isNotEmpty(sch.getFcsjActual()) &&
66 66 sch.getFcsjActual().compareTo(conf.getStartOpt()) < 0){
67 67 sch.setFcsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsjActual()) + DAY_TIME);
68 68 }
69 69  
70   - //實際終點時間
  70 + //实际终点時間
71 71 if(StringUtils.isNotEmpty(sch.getZdsjActual()) &&
72 72 sch.getZdsjActual().compareTo(conf.getStartOpt()) < 0){
73 73 sch.setZdsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getZdsjActual()) + DAY_TIME);
... ...
src/main/java/com/bsth/service/directive/DirectiveService.java
... ... @@ -86,7 +86,7 @@ public interface DirectiveService extends BaseService&lt;D60, Integer&gt;{
86 86  
87 87 D64 save64(D64 d64);
88 88  
89   - int sendC0A4(String nbbm);
  89 + Map<String, Object> sendC0A4(String nbbm);
90 90  
91 91 int sendC0A3(DC0_A3 c0a4);
92 92  
... ...
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
... ... @@ -484,9 +484,18 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
484 484 }
485 485  
486 486 @Override
487   - public int sendC0A4(String nbbm) {
  487 + public Map<String, Object> sendC0A4(String nbbm) {
  488 + Map<String, Object> rs = new HashMap<>();
  489 +
488 490 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm);
489 491  
  492 + GpsEntity gps = gpsRealDataBuffer.get(deviceId);
  493 + if(gps == null || gps.isOffline()){
  494 + rs.put("status", ResponseCode.ERROR);
  495 + rs.put("msg", "下发指令失败,设备离线");
  496 + return rs;
  497 + }
  498 +
490 499 Map<String, Object> c0a4 = new HashMap<>();
491 500 c0a4.put("deviceId", deviceId);
492 501 c0a4.put("timestamp", System.currentTimeMillis());
... ... @@ -497,7 +506,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
497 506 data.put("operCode2", (short) 0xA4);
498 507 c0a4.put("data", data);
499 508  
500   - return GatewayHttpUtils.postJson(JSON.toJSONString(c0a4));
  509 + int code = GatewayHttpUtils.postJson(JSON.toJSONString(c0a4));
  510 + if(code != 0){
  511 + rs.put("status", ResponseCode.ERROR);
  512 + rs.put("msg", "和网关通讯失败, code " + code);
  513 + }
  514 + else{
  515 + rs.put("status", ResponseCode.SUCCESS);
  516 + }
  517 + return rs;
501 518 }
502 519  
503 520 @Override
... ... @@ -529,12 +546,23 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
529 546 public Map<String, Object> deviceCofigList(Map<String, String> map, int page, int size) {
530 547 Map<String, Object> rs = new HashMap<>();
531 548 try {
532   - int count = jdbcTemplate.queryForObject("select count(*) from bsth_c_cars", Integer.class);
  549 + String conts="";
  550 + if(StringUtils.isNotBlank(map.get("lineId"))){
  551 + conts+=" AND xl='" + map.get("lineId")+"'";
  552 + }
  553 + if(StringUtils.isNotBlank(map.get("nbbm"))){
  554 + conts+=" AND inside_code like '%" + map.get("nbbm")+"%'";
  555 + }
  556 + if(StringUtils.isNotBlank(map.get("deviceId"))){
  557 + conts+=" AND equipment_code like '%" + map.get("deviceId")+"%'";
  558 + }
  559 +
  560 + String sql = "select * from (SELECT * FROM (SELECT id AS cl_id,inside_code,equipment_code FROM bsth_c_cars ) t1 LEFT JOIN bsth_v_c0_a4 t2 ON t1.equipment_code = t2.id LEFT JOIN (SELECT xl,cl FROM bsth_c_s_ccinfo WHERE id IN (SELECT max(id) FROM bsth_c_s_ccinfo GROUP BY cl)) t3 ON t1.cl_id = t3.cl ORDER BY t2.`timestamp` DESC) t4 where 1=1 "+conts;
  561 +
  562 + int count = jdbcTemplate.queryForObject("select count(*) from ("+sql+") c1", Integer.class);
533 563 int totalPages = count % size == 0 ? count / size : count / size + 1;
534 564 int s = page * size;
535   -
536   - String sql = "select * from (select inside_code, equipment_code from bsth_c_cars) t1 left join bsth_v_c0_a4 t2 on t1.equipment_code=t2.id order by t2.`timestamp` desc LIMIT " + s + "," + size;
537   - List<DeviceConfigDto> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(DeviceConfigDto.class));
  565 + List<DeviceConfigDto> list = jdbcTemplate.query(sql + " LIMIT " + s + "," + size, new BeanPropertyRowMapper<>(DeviceConfigDto.class));
538 566  
539 567 rs.put("status", ResponseCode.SUCCESS);
540 568 rs.put("list", list);
... ...
src/main/java/com/bsth/service/directive/dto/DeviceConfigDto.java
... ... @@ -5,6 +5,7 @@ package com.bsth.service.directive.dto;
5 5 */
6 6 public class DeviceConfigDto {
7 7  
  8 + private String xl;
8 9 private String id;
9 10 private String insideCode;
10 11 private String equipmentCode;
... ... @@ -192,4 +193,12 @@ public class DeviceConfigDto {
192 193 public void setInsideCode(String insideCode) {
193 194 this.insideCode = insideCode;
194 195 }
  196 +
  197 + public String getXl() {
  198 + return xl;
  199 + }
  200 +
  201 + public void setXl(String xl) {
  202 + this.xl = xl;
  203 + }
195 204 }
... ...
src/main/java/com/bsth/service/realcontrol/LineConfigService.java
... ... @@ -22,4 +22,6 @@ public interface LineConfigService extends BaseService&lt;LineConfig, Integer&gt;{
22 22 Map<String,Object> bufferTimeDiff(String lineCode, String field, String value);
23 23  
24 24 Map<String,Object> yjtkSet(Map<String, String> map);
  25 +
  26 + Map<String,Object> parkAndStationSet(Map<String, String> map);
25 27 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/LineConfigServiceImpl.java
... ... @@ -179,4 +179,28 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt;
179 179 }
180 180 return rs;
181 181 }
  182 +
  183 + @Override
  184 + public Map<String, Object> parkAndStationSet(Map<String, String> map) {
  185 + String lineCode = map.get("lineCode").toString();
  186 + String twinsPark = map.get("twinsPark").toString();
  187 + String twinsStation = map.get("twinsStation").toString();
  188 +
  189 + Map<String, Object> rs = new HashMap<>();
  190 + try {
  191 + LineConfig conf = lineConfigData.get(lineCode);
  192 + conf.setTwinsPark(twinsPark);
  193 + conf.setTwinsStation(twinsStation);
  194 +
  195 + lineConfigData.set(conf);
  196 +
  197 + rs.put("status", ResponseCode.SUCCESS);
  198 + rs.put("conf", conf);
  199 + } catch (Exception e) {
  200 + rs.put("status", ResponseCode.ERROR);
  201 + rs.put("msg", e.getMessage());
  202 + logger.error("", e);
  203 + }
  204 + return rs;
  205 + }
182 206 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -554,9 +554,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
554 554 t.setZdsjT(sdfyyyyMMddHHmm.parse(schDate + t.getZdsj()).getTime());
555 555 t.setJhlcOrig(t.getJhlc());
556 556  
557   - //班次历时
558   - t.setBcsj(DateUtils.calcHHmmDiff(t.getFcsj(), t.getZdsj()) / 1000 / 60);
559   -
560 557 //起终点名称
561 558 String prefix = t.getXlBm() + "_" + t.getXlDir() + "_";
562 559 t.setQdzName(BasicData.getStationNameByCode(t.getQdzCode(), prefix));
... ... @@ -564,6 +561,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
564 561  
565 562 //计算班次实际执行时间
566 563 schAttrCalculator.calcRealDate(t).calcAllTimeByFcsj(t);
  564 +
  565 + //处理计达跨24点
  566 + LineConfig conf = lineConfigData.get(t.getXlBm());
  567 + if(t.getZdsj().compareTo(conf.getStartOpt()) < 0){
  568 + t.setZdsjT(sdfyyyyMMddHHmm.parse(t.getScheduleDateStr() + t.getZdsj()).getTime() + (1000 * 60 * 60 * 24));
  569 + }
  570 +
  571 + //班次历时
  572 + t.setBcsj((int) ((t.getZdsjT() - t.getDfsjT()) / 1000 / 60));
567 573 if (t.getZdsjT() < t.getFcsjT()) {
568 574 rs.put("status", ResponseCode.ERROR);
569 575 rs.put("msg", "起终点时间异常!");
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -937,7 +937,7 @@ option.oil_station_opt{
937 937 .park-and-station-wrap{
938 938 margin-top: 9px;
939 939 border: 1px solid #3dce69;
940   - width: 470px;
  940 + width: 580px;
941 941 padding: 12px;
942 942 border-radius: 5px;
943 943 }
... ... @@ -1187,10 +1187,11 @@ ul.left_tabs_lg li{
1187 1187 }
1188 1188  
1189 1189 .device_config_table dl dt:nth-of-type(1), .device_config_table dl dd:nth-of-type(1){
1190   - width: 6%;
  1190 + width: 7%;
  1191 + text-indent: 10px;
1191 1192 }
1192 1193 .device_config_table dl dt:nth-of-type(2), .device_config_table dl dd:nth-of-type(2){
1193   - width: 6%;
  1194 + width: 7%;
1194 1195 }
1195 1196 .device_config_table dl dt:nth-of-type(3), .device_config_table dl dd:nth-of-type(3){
1196 1197 width: 8%;
... ... @@ -1199,13 +1200,13 @@ ul.left_tabs_lg li{
1199 1200 width: 5%;
1200 1201 }
1201 1202 .device_config_table dl dt:nth-of-type(5), .device_config_table dl dd:nth-of-type(5){
1202   - width: 3%;
  1203 + width: 4%;
1203 1204 }
1204 1205 .device_config_table dl dt:nth-of-type(6), .device_config_table dl dd:nth-of-type(6){
1205   - width: 5%;
  1206 + width: 4%;
1206 1207 }
1207 1208 .device_config_table dl dt:nth-of-type(7), .device_config_table dl dd:nth-of-type(7){
1208   - width: 5%;
  1209 + width: 4%;
1209 1210 }
1210 1211 .device_config_table dl dt:nth-of-type(8), .device_config_table dl dd:nth-of-type(8){
1211 1212 width: 5%;
... ... @@ -1214,7 +1215,7 @@ ul.left_tabs_lg li{
1214 1215 width: 5%;
1215 1216 }
1216 1217 .device_config_table dl dt:nth-of-type(10), .device_config_table dl dd:nth-of-type(10){
1217   - width: 9%;
  1218 + width: 8%;
1218 1219 }
1219 1220 .device_config_table dl dt:nth-of-type(11), .device_config_table dl dd:nth-of-type(11){
1220 1221 width: 5%;
... ... @@ -1223,10 +1224,10 @@ ul.left_tabs_lg li{
1223 1224 width: 5%;
1224 1225 }
1225 1226 .device_config_table dl dt:nth-of-type(13), .device_config_table dl dd:nth-of-type(13){
1226   - width: 5%;
  1227 + width: 4%;
1227 1228 }
1228 1229 .device_config_table dl dt:nth-of-type(14), .device_config_table dl dd:nth-of-type(14){
1229   - width: 5%;
  1230 + width: 4%;
1230 1231 }
1231 1232 .device_config_table dl dt:nth-of-type(15), .device_config_table dl dd:nth-of-type(15){
1232 1233 width: 4%;
... ... @@ -1238,7 +1239,7 @@ ul.left_tabs_lg li{
1238 1239 width: 4%;
1239 1240 }
1240 1241 .device_config_table dl dt:nth-of-type(18), .device_config_table dl dd:nth-of-type(18){
1241   - width: 11%;
  1242 + width: 13%;
1242 1243 }
1243 1244  
1244 1245 .uk-tooltip{
... ... @@ -1248,4 +1249,10 @@ ul.left_tabs_lg li{
1248 1249 .device_config_table.ct_table dl dd,
1249 1250 .device_config_table.ct_table dl dt{
1250 1251 border-right: 1px solid #dedede !important;
  1252 +}
  1253 +
  1254 +.device_configs_manager .search_form{
  1255 + text-indent: 12px;
  1256 + margin-bottom: 0;
  1257 + padding: 18px 5px;
1251 1258 }
1252 1259 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/device_config/list.html
1 1 <div class="ct_layer_modal device_configs_manager">
2 2  
3 3 <div style="height: calc(100% - 20px);">
4   - <div class="ct_table_wrap ct_table_no_border" style="height: 100%;overflow: hidden;">
  4 + <div class="search_form">
  5 + <form class="uk-form search-form">
  6 + <fieldset data-uk-margin>
  7 + <span class="horizontal-field">线路</span>
  8 + <div class="uk-autocomplete uk-form autocomplete-line" >
  9 + <input type="text" name="lineId" placeholder="线路">
  10 + </div>
  11 + <span class="horizontal-field">车辆</span>
  12 + <div class="uk-autocomplete uk-form autocomplete-cars" >
  13 + <input type="text" name="nbbm" placeholder="车辆自编号">
  14 + </div>
  15 + <span class="horizontal-field">设备号</span>
  16 + <div class="uk-autocomplete uk-form autocomplete-device" >
  17 + <input type="text" name="deviceId" placeholder="设备号">
  18 + </div>
  19 + <button class="uk-button" type="submit"><i class="uk-icon-search"></i> 检索</button>
  20 + &nbsp;
  21 + <button class="uk-button param_config_btn" >参数配置</button>
  22 + &nbsp;
  23 + <button class="uk-button up_soft_version_btn" >升级程序版本</button>
  24 + </fieldset>
  25 + </form>
  26 + </div>
  27 +
  28 + <div class="ct_table_wrap ct_table_no_border" style="height: calc(100% - 115px);overflow: hidden;margin-top: 0;">
5 29 <div class="ct_table device_config_table">
6 30 <div class="ct_table_head" style="top: 0px;">
7 31 <dl>
... ... @@ -10,39 +34,42 @@
10 34 <dt data-uk-tooltip title="网关IP">网关IP</dt>
11 35 <dt data-uk-tooltip title="网关端口">网关端口</dt>
12 36 <dt data-uk-tooltip title="定时定距上报模式">模式</dt>
13   - <dt data-uk-tooltip title="定时上报时间间隔">时间间隔</dt>
14   - <dt data-uk-tooltip title="定距上报距离间隔">距离间隔</dt>
  37 + <dt data-uk-tooltip title="定时上报时间间隔">时间</dt>
  38 + <dt data-uk-tooltip title="定距上报距离间隔">距离</dt>
15 39 <dt data-uk-tooltip title="非线路状态超速阀门">超速阀门</dt>
16 40 <dt data-uk-tooltip title="预警阀门">预警阀门</dt>
17 41 <dt data-uk-tooltip title="pos机IP地址">POS机IP</dt>
18 42 <dt data-uk-tooltip title="pos机端口">POS端口</dt>
19 43 <dt data-uk-tooltip title="延迟关机时间">延迟关机</dt>
20   - <dt data-uk-tooltip title="中门视频切换到码表界面速度阀门">中码阀门</dt>
21   - <dt data-uk-tooltip title="码表界面切换到中门视频速度阀门">码中阀门</dt>
  44 + <dt data-uk-tooltip title="中门视频切换到码表界面速度阀门">中码</dt>
  45 + <dt data-uk-tooltip title="码表界面切换到中门视频速度阀门">码中</dt>
22 46 <dt data-uk-tooltip title="对比度">对比度</dt>
23 47 <dt data-uk-tooltip title="亮度">亮度</dt>
24 48 <dt data-uk-tooltip title="饱和度">饱和度</dt>
25 49 <dt data-uk-tooltip title="参数上报时间">参数上报时间</dt>
26 50 </dl>
27 51 </div>
28   - <div class="ct_table_body"></div>
  52 + <div class="ct_table_body">
  53 + </div>
29 54 </div>
30 55 </div>
  56 + <div class="uk-modal-footer uk-text-right pagination-wrap" style="margin: 0;">
  57 + </div>
31 58 </div>
32 59  
33 60 <script id="device_configs_table-temp" type="text/html">
34 61 {{each list as c i}}
35 62 <dl>
36 63 <dd>{{c.insideCode}}</dd>
37   - <dd>{{c.id}}</dd>
38   - <dd>{{c.ipAddress}}</dd>
  64 + <dd>{{c.equipmentCode}}</dd>
  65 + <dd title="{{c.ipAddress}}">{{c.ipAddress}}</dd>
39 66 <dd>{{c.port}}</dd>
40 67 <dd>{{c.reportMode}}</dd>
41 68 <dd>{{c.interval}}</dd>
42 69 <dd>{{c.distance}}</dd>
43 70 <dd>{{c.speedingThreshold}}</dd>
44 71 <dd>{{c.alarmThreshold}}</dd>
45   - <dd>{{c.posIpAddress}}</dd>
  72 + <dd title="{{c.posIpAddress}}">{{c.posIpAddress}}</dd>
46 73 <dd>{{c.posPort}}</dd>
47 74 <dd>
48 75 {{if c.delay != null}}
... ... @@ -54,25 +81,112 @@
54 81 <dd>{{c.contrast}}</dd>
55 82 <dd>{{c.brightness}}</dd>
56 83 <dd>{{c.saturation}}</dd>
57   - <dd>{{c.timeStr}}</dd>
  84 + <dd>
  85 + {{if c.timestamp != null}}
  86 + {{c.timeStr}}
  87 + {{else}}
  88 + <a class="query_params_link" data-nbbm="{{c.insideCode}}" style="font-size: 12px;" title="指令通知设备,将当前参数上传至平台">查询设备参数</a>
  89 + {{/if}}
  90 + </dd>
58 91 </dl>
59 92 {{/each}}
60 93 </script>
61 94 <script>
62 95 (function () {
63 96 var modal = $('.ct_layer_modal.device_configs_manager');
  97 + var form = $('.search-form', modal);
  98 +
  99 + //车辆 autocomplete
  100 + gb_common.carAutocomplete($('.autocomplete-cars', modal), gb_data_basic.carsArray());
  101 + //线路 autocomplete
  102 + gb_common.lineAutocomplete($('.autocomplete-line', modal));
  103 + //设备号autocomplete
  104 + var deviceArray = gb_common.get_keys(gb_data_basic.device2nbbmMap()),deviceData=[];
  105 + $.each(deviceArray, function(){
  106 + deviceData.push({value: this});
  107 + });
  108 + gb_common.init_autocomplete($('.autocomplete-device', modal), deviceData);
  109 +
  110 + var page=0,size=13;
  111 +
  112 + //sumit event
  113 + form.on('submit', function(e) {
  114 + e.preventDefault();
  115 + resetPagination = true;
  116 + page=0;
  117 + query();
  118 + });
  119 +
  120 + $(modal).on('init', function(e, data) {
  121 + e.stopPropagation();
  122 + if(data){
  123 + if(data.nbbm)
  124 + $('[name=nbbm]', form).val(data.nbbm);
  125 + if(data.deviceId)
  126 + $('[name=deviceId]', form).val(data.deviceId);
  127 + }
  128 + query();
  129 + });
  130 +
  131 + function query() {
  132 + var data = form.serializeJSON();
  133 + data.page = page;
  134 + data.size = size;
64 135  
65   - var page=0,size=12;
66   - gb_common.$get('/directive/deviceCofigList', {page:page,size:size}, function (rs) {
67   - var f = 'YYYY-MM-DD HH:mm';
68   - $.each(rs.list, function () {
69   - if(this.timestamp){
70   - this.timeStr = moment(this.timestamp).format(f);
71   - }
  136 + //线路转换成编码
  137 + if(data.lineId){
  138 + var lineCode = gb_data_basic.findCodeByLinename(data.lineId);
  139 + if(lineCode)
  140 + data.lineId=lineCode;
  141 + }
  142 + gb_common.$get('/directive/deviceCofigList', data, function (rs) {
  143 + var f = 'YYYY-MM-DD HH:mm';
  144 + $.each(rs.list, function () {
  145 + if(this.timestamp){
  146 + this.timeStr = moment(this.timestamp).format(f);
  147 + }
  148 + });
  149 +
  150 + var htmlStr = template('device_configs_table-temp', {list: rs.list});
  151 + $('.device_config_table .ct_table_body', modal).html(htmlStr);
  152 +
  153 + if (resetPagination)
  154 + pagination(rs.totalPages, rs.page);
  155 + });
  156 + }
  157 +
  158 +
  159 + var resetPagination = true;
  160 + var pagination = function(pages, currentPage) {
  161 + var wrap = $('.pagination-wrap', modal).empty()
  162 + ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap);
  163 +
  164 + var pagination = UIkit.pagination(e, {
  165 + pages: pages,
  166 + currentPage: currentPage
  167 + });
  168 +
  169 + e.on('select.uk.pagination', function(e, pageIndex){
  170 + page = pageIndex;
  171 + query();
  172 + });
  173 +
  174 + resetPagination = false;
  175 + };
  176 +
  177 + $(modal).on('click', '.query_params_link', function () {
  178 + var nbbm = $(this).data('nbbm');
  179 + gb_common.$post('/directive/c0a4', {nbbm: nbbm}, function (rs) {
  180 + notify_succ('下发指令成功!');
72 181 });
  182 + });
  183 +
  184 + $('.param_config_btn', modal).on('click', function () {
  185 + notify_err('当前账号权限不足!');
  186 + });
73 187  
74   - var htmlStr = template('device_configs_table-temp', {list: rs.list});
75   - $('.device_config_table .ct_table_body', modal).html(htmlStr);
  188 + $('.up_soft_version_btn', modal).on('click', function () {
  189 + notify_err('当前账号权限不足!');
76 190 });
77 191 })();
78 192 </script>
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/all_devices.html
... ... @@ -122,9 +122,7 @@
122 122 $(modal).on('init', function(e, data) {
123 123 e.stopPropagation();
124 124 //车辆 autocomplete
125   - $.get('/basic/cars?t='+Math.random(), function(rs) {
126   - gb_common.carAutocomplete($('.autocomplete-cars', modal), rs);
127   - });
  125 + gb_common.carAutocomplete($('.autocomplete-cars', modal), gb_data_basic.carsArray());
128 126 //线路 autocomplete
129 127 gb_common.lineAutocomplete($('.autocomplete-line', modal));
130 128 //设备号autocomplete
... ... @@ -202,6 +200,25 @@
202 200 resetPagination = false;
203 201 };
204 202  
  203 + var C0_A3 = function(device){
  204 + $.get('/real_control_v2/fragments/device_config/list.html', function (dom) {
  205 + var index = layer.open({
  206 + id: 'deviceConfigsLayer',
  207 + type: 1,
  208 + title: '设备参数管理',
  209 + resize: false,
  210 + shadeClose: true,
  211 + shade: false,
  212 + area: ['1288px', '660px'],
  213 + skin:'layui-layer-molv play_back-layer',
  214 + content: dom,
  215 + success: function(layero){
  216 + $('.ct_layer_modal.device_configs_manager').trigger('init', {deviceId: device});
  217 + }
  218 + });
  219 + });
  220 + };
  221 +
205 222 var callbackHandler={
206 223 change_line: function(device){
207 224 var htmlStr=template('device-line-change-modal-temp', {device: device})
... ... @@ -250,10 +267,10 @@
250 267 }, '确定从清册中移除');
251 268 },
252 269 state_up_0: state_up_0,
253   - state_down_0: state_down_0
  270 + state_down_0: state_down_0,
  271 + C0_A3: C0_A3
254 272 };
255 273  
256   -
257 274 //营运状态和上下行切换
258 275 var stateChange = function (nbbm, updown, state) {
259 276 $.post('/directive/stateChange', {
... ... @@ -293,6 +310,9 @@
293 310 'refresh_line_file':{
294 311 name: '刷新线路文件'
295 312 },
  313 + 'C0_A3':{
  314 + name: '设备参数管理'
  315 + },
296 316 'delete': {
297 317 name: '删除'
298 318 }
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config_entity.html
... ... @@ -80,14 +80,14 @@
80 80 </script>
81 81  
82 82 <script id="park-and-station-temp" type="text/html">
83   - 场
84   - <select class="z-depth-input">
  83 + 停车场
  84 + <select class="z-depth-input" name="twinsPark">
85 85 {{each parks as p i}}
86 86 <option value="{{p.code}}" {{if p.code==conf.twinsPark}}selected{{/if}}>{{p.name}}</option>
87 87 {{/each}}
88 88 </select>
89   - 既是站
90   - <select class="z-depth-input">
  89 + 既是站点
  90 + <select class="z-depth-input" name="twinsStation">
91 91 {{each routes as r i}}
92 92 <option value="{{r.stationCode}}" {{if r.stationCode==conf.twinsStation}}selected{{/if}}>{{r.stationName}}
93 93 </option>
... ... @@ -167,6 +167,19 @@
167 167 $('#reLoadRealScheduleBtn', wrap).on('click', reLoadRealSchedule);
168 168 });
169 169  
  170 + function changeTwinsParkAndStation() {
  171 + var park = $('select[name=twinsPark]', wrap).val();
  172 + var station = $('select[name=twinsStation]', wrap).val();
  173 + gb_common.$post('/lineConfig/parkAndStationSet', {
  174 + lineCode: conf.line.lineCode,
  175 + twinsPark: park,
  176 + twinsStation: station
  177 + }, function (rs) {
  178 + notify_succ('设置成功!!');
  179 + conf = rs.conf;
  180 + });
  181 + }
  182 +
170 183 //更新排班时间
171 184 var startOptFlag;
172 185  
... ... @@ -209,6 +222,8 @@
209 222 });
210 223 }
211 224  
  225 +
  226 +
212 227 function enableInParkForSource() {
213 228 var enable = $(this).val();
214 229 gb_common.$post('/lineConfig/enableInParkForSource', {
... ... @@ -236,6 +251,10 @@
236 251 }
237 252 else
238 253 $panel.html('').hide();
  254 +
  255 + //切换场既是站的,停车场和站点
  256 + $('select[name=twinsPark]', wrap).on('change', changeTwinsParkAndStation);
  257 + $('select[name=twinsStation]', wrap).on('change', changeTwinsParkAndStation);
239 258 }
240 259 })();
241 260 </script>
... ...
src/main/resources/static/real_control_v2/js/forms/wrap.html
... ... @@ -96,12 +96,12 @@
96 96 $('.form-page-content').load(pageUrl, function () {
97 97 //限制日期
98 98 var d = moment(top.gb_second_timer.now()),
99   - f='YYYY-MM-DD',
100   - ed=d.format(f),
101   - sd=d.subtract(3, 'days').format(f);
  99 + f='YYYY-MM-DD';
  100 + //ed=d.format(f),
  101 + //sd=d.subtract(3, 'days').format(f);
102 102  
103 103 $('#date', '.form-page-content').data('DateTimePicker')
104   - .defaultDate(d);
  104 + .defaultDate(d.format(f));
105 105 //.maxDate(ed).minDate(sd);
106 106  
107 107 if($("#ddrbBody").length > 0){
... ...
src/main/resources/static/real_control_v2/js/home/context_menu.js
... ... @@ -205,8 +205,22 @@ var gb_home_context_menu = (function() {
205 205 };
206 206  
207 207 var C0_A3 = function(){
208   - //open_modal('/real_control_v2/fragments/home/c0_a3.html', {nbbm: active_car}, {center: false, bgclose: false});
209   - open_layer_modal('/real_control_v2/fragments/device_config/list.html', {}, 1288, 600, '设备参数管理(功能调试中...)');
  208 + $.get('/real_control_v2/fragments/device_config/list.html', function (dom) {
  209 + var index = layer.open({
  210 + id: 'deviceConfigsLayer',
  211 + type: 1,
  212 + title: '设备参数管理',
  213 + resize: false,
  214 + shadeClose: true,
  215 + shade: false,
  216 + area: ['1288px', '660px'],
  217 + skin:'layui-layer-molv play_back-layer',
  218 + content: dom,
  219 + success: function(layero){
  220 + $('.ct_layer_modal.device_configs_manager').trigger('init', {nbbm: active_car});
  221 + }
  222 + });
  223 + });
210 224 };
211 225  
212 226 var callbackHandler = {
... ...
src/main/resources/static/real_control_v2/js/modal_extend.js
... ... @@ -30,7 +30,7 @@ var open_modal = function (pageUrl, data, opt) {
30 30 });
31 31 };
32 32  
33   -var open_layer_modal = function (pageUrl, data, w, h, t) {
  33 +/*var open_layer_modal = function (pageUrl, data, w, h, t) {
34 34 if(!w) w = 1200;
35 35 if(!h) h = 650;
36 36 $.get(pageUrl, function (dom) {
... ... @@ -39,7 +39,7 @@ var open_layer_modal = function (pageUrl, data, w, h, t) {
39 39 title: t,
40 40 shadeClose: true,
41 41 shade: false,
42   - maxmin: true, //开启最大化最小化按钮
  42 + maxmin: false, //开启最大化最小化按钮
43 43 area: [w+'px', h+'px'],
44 44 skin:'layui-layer-molv play_back-layer',
45 45 content: dom,
... ... @@ -50,7 +50,7 @@ var open_layer_modal = function (pageUrl, data, w, h, t) {
50 50 }
51 51 });
52 52 });
53   -};
  53 +};*/
54 54  
55 55 var open_modal_dom = function (dom, data, opt) {
56 56 if (!$(dom).hasClass('uk-modal')) {
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/left.html
... ... @@ -258,9 +258,7 @@
258 258 }
259 259  
260 260 //车辆 autocomplete
261   - $.get('/basic/cars', function (rs) {
262   - gb_common.carAutocomplete($('.autocomplete-nbbm', leftWrap), rs);
263   - });
  261 + gb_common.carAutocomplete($('.autocomplete-nbbm', leftWrap), gb_data_basic.carsArray());
264 262  
265 263 /**
266 264 * 车辆选择抽屉显示
... ...