Commit 5906cdb4f232ee3acb9d9f37729e36375e58967d

Authored by 潘钊
2 parents a8c06755 be6befbd

Merge branch 'minhang' into pudong

src/main/java/com/bsth/data/pilot80/PilotReport.java
... ... @@ -117,6 +117,11 @@ public class PilotReport {
117 117  
118 118 //推送到页面
119 119 sendUtils.send80ToPage(d80);
  120 +
  121 + //反射搜索用 瞬时字段
  122 + d80.setLineId(d80.getData().getLineId());
  123 + d80.setNbbm(d80.getData().getNbbm());
  124 + d80.setRequestCode(d80.getData().getRequestCode());
120 125 } catch (Exception e) {
121 126 logger.error("", e);
122 127 }
... ...
src/main/java/com/bsth/data/utils/ListFilterUtils.java 0 → 100644
  1 +package com.bsth.data.utils;
  2 +
  3 +import org.apache.commons.lang3.StringUtils;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +
  7 +import java.lang.reflect.Field;
  8 +import java.util.ArrayList;
  9 +import java.util.Collection;
  10 +import java.util.List;
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * 集合搜索过滤
  15 + * Created by panzhao on 2017/8/2.
  16 + */
  17 +public class ListFilterUtils {
  18 +
  19 + static Logger logger = LoggerFactory.getLogger(ListFilterUtils.class);
  20 +
  21 + public static List filter(Collection all, Map<String, Object> map, Class clazz) {
  22 + List rs = new ArrayList();
  23 + Field[] fields = clazz.getDeclaredFields();
  24 +
  25 + //参与过滤的字段
  26 + List<Field> fs = new ArrayList<>();
  27 + for (Field f : fields) {
  28 + f.setAccessible(true);
  29 + if (map.containsKey(f.getName()))
  30 + fs.add(f);
  31 + }
  32 +
  33 + //过滤数据
  34 + for (Object obj : all) {
  35 + if (fieldEquals(fs, obj, map))
  36 + rs.add(obj);
  37 + }
  38 + return rs;
  39 + }
  40 +
  41 + public static boolean fieldEquals(List<Field> fs, Object obj, Map<String, Object> map) {
  42 + try {
  43 + for (Field f : fs) {
  44 + if (StringUtils.isEmpty(map.get(f.getName()).toString()))
  45 + continue;
  46 +
  47 + if (f.get(obj) == null || f.get(obj).toString().indexOf(map.get(f.getName()).toString()) == -1)
  48 + return false;
  49 + }
  50 + } catch (Exception e) {
  51 + logger.error("", e);
  52 + return false;
  53 + }
  54 + return true;
  55 + }
  56 +}
... ...
src/main/java/com/bsth/data/utils/ListPageQueryUtils.java 0 → 100644
  1 +package com.bsth.data.utils;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +/**
  7 + * 集合分页工具
  8 + * Created by panzhao on 2017/8/2.
  9 + */
  10 +public class ListPageQueryUtils {
  11 +
  12 + public static List paging(List all, int page, int pageSize) {
  13 + List rs = new ArrayList(pageSize);
  14 +
  15 + int s = page * pageSize;
  16 + int e = (page + 1) * pageSize;
  17 +
  18 + int size = all.size();
  19 +
  20 + if (e > size)
  21 + e = size;
  22 +
  23 + if (s > size)
  24 + return rs;
  25 +
  26 + for (; s < e; s++) {
  27 + rs.add(all.get(s));
  28 + }
  29 + return rs;
  30 + }
  31 +}
... ...
src/main/java/com/bsth/entity/directive/D80.java
1 1 package com.bsth.entity.directive;
2 2  
3 3 import com.bsth.entity.directive.DC0.DC0Data;
  4 +import com.fasterxml.jackson.annotation.JsonIgnore;
4 5  
5 6 import javax.persistence.*;
6 7 import java.util.Date;
... ... @@ -65,6 +66,18 @@ public class D80 {
65 66  
66 67 private Long schId;
67 68  
  69 + @Transient
  70 + @JsonIgnore
  71 + private String lineId;
  72 +
  73 + @Transient
  74 + @JsonIgnore
  75 + private String nbbm;
  76 +
  77 + @Transient
  78 + @JsonIgnore
  79 + private Short requestCode;
  80 +
68 81 public Long getSchId() {
69 82 return schId;
70 83 }
... ... @@ -73,6 +86,30 @@ public class D80 {
73 86 this.schId = schId;
74 87 }
75 88  
  89 + public String getLineId() {
  90 + return data.lineId;
  91 + }
  92 +
  93 + public String getNbbm() {
  94 + return data.nbbm;
  95 + }
  96 +
  97 + public void setLineId(String lineId) {
  98 + this.lineId = lineId;
  99 + }
  100 +
  101 + public void setNbbm(String nbbm) {
  102 + this.nbbm = nbbm;
  103 + }
  104 +
  105 + public Short getRequestCode() {
  106 + return requestCode;
  107 + }
  108 +
  109 + public void setRequestCode(Short requestCode) {
  110 + this.requestCode = requestCode;
  111 + }
  112 +
76 113 @Embeddable
77 114 public static class D80Data {
78 115  
... ...
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
... ... @@ -11,6 +11,8 @@ import com.bsth.data.gpsdata.GpsEntity;
11 11 import com.bsth.data.gpsdata.GpsRealData;
12 12 import com.bsth.data.pilot80.PilotReport;
13 13 import com.bsth.data.schedule.DayOfSchedule;
  14 +import com.bsth.data.utils.ListFilterUtils;
  15 +import com.bsth.data.utils.ListPageQueryUtils;
14 16 import com.bsth.entity.directive.*;
15 17 import com.bsth.entity.realcontrol.ScheduleRealInfo;
16 18 import com.bsth.entity.sys.SysUser;
... ... @@ -110,8 +112,11 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
110 112 logger.warn("烂班不允许发送调度指令....");
111 113 return -1;
112 114 }
  115 +
  116 + //待发应到时间
  117 + String dfsj = fmtHHmm.print(sch.getDfsjT() + (sch.getBcsj() * 60 * 1000));
113 118 String text = "您已完成" + finish + "个班次,下一发车时间" + fmtHHmm_CN.print(sch.getDfsjT()) + ",由"
114   - + sch.getQdzName() + "发往" + sch.getZdzName() + ";应到 " + sch.getZdsj();
  119 + + sch.getQdzName() + "发往" + sch.getZdzName() + ";应到 " + dfsj;
115 120  
116 121 if(sch.getBcType().equals("venting")){
117 122 text += " (直放)";
... ... @@ -445,7 +450,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
445 450  
446 451 @Override
447 452 public Map<String, Object> findAll80(Map<String, Object> map, int page, int size) {
448   - List<D80> d80s = new ArrayList<>();
  453 + /*List<D80> d80s = new ArrayList<>();
449 454  
450 455 Object nbbm = map.get("nbbm");
451 456 if (null != nbbm && StringUtils.isNotEmpty(nbbm.toString())) {
... ... @@ -489,8 +494,25 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
489 494 Map<String, Object> rsMap = new HashMap<>();
490 495 rsMap.put("list", rs);
491 496 rsMap.put("totalPages", count % size == 0 ? count / size - 1 : count / size);
492   - rsMap.put("page", page);
  497 + rsMap.put("page", page);*/
493 498  
  499 + List all = ListFilterUtils.filter(pilotReport.findAll(), map, D80.class);
  500 + //排序
  501 + Collections.sort(all, new Comparator<D80>() {
  502 + @Override
  503 + public int compare(D80 o1, D80 o2) {
  504 + return (int) (o2.getTimestamp() - o1.getTimestamp());
  505 + }
  506 + });
  507 + List<D80> d80s = ListPageQueryUtils.paging(all, page, size);
  508 + //时间格式化
  509 + for (D80 d80 : d80s) {
  510 + d80.setTimeStr(fmtHHmm.print(d80.getTimestamp()));
  511 + }
  512 + Map<String, Object> rsMap = new HashMap<>();
  513 + rsMap.put("list", d80s);
  514 + rsMap.put("totalPages", all.size() % size == 0 ? all.size() / size - 1: all.size() / size);
  515 + rsMap.put("page", page);
494 516 return rsMap;
495 517 }
496 518  
... ...
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
... ... @@ -593,7 +593,8 @@ public class CulateMileageServiceImpl implements CulateMileageService{
593 593 while (it.hasNext()) {
594 594 ChildTaskPlan childTaskPlan = it.next();
595 595 if (childTaskPlan.getMileageType().equals("service")
596   - && "正常".equals(childTaskPlan.getType1())) {
  596 + && "正常".equals(childTaskPlan.getType1())
  597 + && childTaskPlan.getCcId()==null) {
597 598 if (!childTaskPlan.isDestroy()) {
598 599 Float jhgl = childTaskPlan.getMileage() == null ? 0
599 600 : childTaskPlan.getMileage();
... ... @@ -769,7 +770,8 @@ public class CulateMileageServiceImpl implements CulateMileageService{
769 770 xxkzgf=0,xxkwgf=0,xxm=0,xxmzgf=0,xxmwgf=0;
770 771 for (int i = 0; i < lists.size(); i++) {
771 772 ScheduleRealInfo s=lists.get(i);
772   - if(s.getFcsjActual()!=null){
  773 + if(s.getFcsjActual()!=null && !s.isCcService()
  774 + && !isInOut(s)){
773 775 String xlDir=s.getXlDir();
774 776 String fcsjs=s.getFcsj();
775 777 String[] fcsjStr = fcsjs.split(":");
... ... @@ -779,7 +781,6 @@ public class CulateMileageServiceImpl implements CulateMileageService{
779 781 long fcsjActual = Long.parseLong(fcsjActualsStr[0]) * 60 + Long.parseLong(fcsjActualsStr[1]);
780 782  
781 783 if("0".equals(xlDir)){
782   -
783 784 if(fcsj-fcsjActual>1){
784 785 sxk++;
785 786 if(fcsj>zgf1&&fcsj<zgf2)
... ...
src/main/java/com/bsth/service/report/impl/SheetServiceImpl.java
... ... @@ -80,6 +80,9 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
80 80 if(s.getBcType().equals("ldks")){
81 81 fage=true;
82 82 }
  83 + if(s.isCcService()){
  84 + fage=true;
  85 + }
83 86  
84 87 return fage;
85 88 }
... ...
src/main/resources/static/real_control_v2/alone_page/home/home_wrap.html
... ... @@ -44,6 +44,7 @@
44 44  
45 45 #main-tab-content{
46 46 padding: 0 !important;
  47 + list-style: none;
47 48 }
48 49  
49 50 .home-panel{
... ... @@ -99,6 +100,8 @@
99 100 <script src="/assets/js/d3.min.js"></script>
100 101 <!-- EventProxy -->
101 102 <script src="/assets/js/eventproxy.js"></script>
  103 +<!-- Geolib -->
  104 +<script src="/real_control_v2/geolib/geolib.js" merge="plugins"></script>
102 105  
103 106 <script>
104 107  
... ...
src/main/resources/static/real_control_v2/css/home.css
... ... @@ -125,6 +125,7 @@
125 125 line-height: 25px;
126 126 font-size: 13px;
127 127 padding: 0 0 3px;
  128 + position: relative;
128 129 }
129 130  
130 131 .data-wrap .data-title span.data-title-text {
... ... @@ -326,4 +327,13 @@ span.signal-state-speed-limit{
326 327 #send-phrase-multi-modal .tools>span{
327 328 cursor: pointer;
328 329 margin-left: 12px;
  330 +}
  331 +
  332 +.device_list_filter_icon{
  333 + position: absolute;
  334 + right: 15px;
  335 +}
  336 +
  337 +.device_list_filter_icon.online{
  338 +
329 339 }
330 340 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/dftz.html
... ... @@ -42,9 +42,9 @@
42 42 <div class="uk-grid">
43 43 <div class="uk-width-1-1">
44 44 <div class="uk-form-row ct-stacked">
45   - <label class="uk-form-label" for="form-s-t">备注<small class="font-danger">(不超过20个字符)</small></label>
  45 + <label class="uk-form-label" for="form-s-t">备注<small class="font-danger">(不超过50个字符)</small></label>
46 46 <div class="uk-form-controls">
47   - <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="20" >{{remarks}}</textarea>
  47 + <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="50" >{{remarks}}</textarea>
48 48 </div>
49 49 </div>
50 50 </div>
... ... @@ -167,8 +167,7 @@
167 167 if(sch.bcType == 'in' || sch.bcType == 'out')
168 168 return;
169 169  
170   - //重置类型,等待调整界面触发刷新事件
171   - $(this).val(sch.bcType);
  170 +
172 171 var url, detailModal;
173 172 if(type=='venting'){
174 173 url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html';
... ... @@ -181,6 +180,8 @@
181 180 else
182 181 return;
183 182  
  183 + //重置类型,等待调整界面触发刷新事件
  184 + $(this).val(sch.bcType);
184 185 $.get(url, function(htmlStr){
185 186 $(document.body).append(htmlStr);
186 187  
... ... @@ -194,9 +195,9 @@
194 195 */
195 196 $('[name=bcType]', modal).mousedown(function () {
196 197 this.sindex = $(this)[0].selectedIndex;
197   - $(this)[0].selectedIndex = 0;
  198 + $(this)[0].selectedIndex = -1;
198 199 }).mouseout(function () {
199   - if ($(this)[0].selectedIndex === 0) {
  200 + if ($(this)[0].selectedIndex === -1) {
200 201 $(this)[0].selectedIndex = this.sindex;
201 202 }
202 203 });
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
... ... @@ -270,17 +270,19 @@
270 270 if(sch.bcType == 'in' || sch.bcType == 'out')
271 271 return;
272 272  
273   - //重置类型,等待调整界面触发刷新事件
274   - $(this).val(sch.bcType);
275 273 var url, detailModal;
276 274 if(type=='venting'){
277 275 url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html';
278 276 detailModal='#bctype-venting-modal';
279 277 }
280   - else{
  278 + else if(type=='major'){
281 279 detailModal='#bctype-major-modal';
282 280 url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_major.html';
283 281 }
  282 + else return;
  283 +
  284 + //重置类型,等待调整界面触发刷新事件
  285 + $(this).val(sch.bcType);
284 286  
285 287 $.get(url, function(htmlStr){
286 288 $(document.body).append(htmlStr);
... ... @@ -295,9 +297,9 @@
295 297 */
296 298 $('select[name=bcType]', modal).mousedown(function () {
297 299 this.sindex = $(this)[0].selectedIndex;
298   - $(this)[0].selectedIndex = 0;
  300 + $(this)[0].selectedIndex = -1;
299 301 }).mouseout(function () {
300   - if ($(this)[0].selectedIndex === 0) {
  302 + if ($(this)[0].selectedIndex === -1) {
301 303 $(this)[0].selectedIndex = this.sindex;
302 304 }
303 305 });
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/report_80.html
... ... @@ -12,8 +12,12 @@
12 12 </legend>
13 13 <span class="horizontal-field">请求代码</span>
14 14 <select name="requestCode">
15   - <option value="-1">全部</option>
  15 + <option value="">全部</option>
16 16 </select>
  17 + <span class="horizontal-field">线路</span>
  18 + <div class="uk-autocomplete uk-form autocomplete-line" >
  19 + <input type="text" name="lineId" placeholder="线路">
  20 + </div>
17 21 <span class="horizontal-field">车辆</span>
18 22 <div class="uk-autocomplete uk-form autocomplete-cars" >
19 23 <input type="text" name="nbbm" placeholder="车辆自编号">
... ... @@ -84,9 +88,9 @@
84 88 }
85 89 $('[name=requestCode]', modal).append(opt);
86 90 //车辆 autocomplete
87   - $.get('/basic/cars', function(rs) {
88   - gb_common.carAutocomplete($('.autocomplete-cars', modal), rs);
89   - });
  91 + gb_common.carAutocomplete($('.autocomplete-cars', modal), gb_data_basic.carsArray());
  92 + //线路 autocomplete
  93 + gb_common.lineAutocomplete($('.autocomplete-line', modal));
90 94 query();
91 95 });
92 96  
... ... @@ -102,6 +106,12 @@
102 106 var data = form.serializeJSON();
103 107 data.page = page;
104 108 data.size = pageSize;
  109 + //线路转换成编码
  110 + if(data.lineId){
  111 + var lineCode = gb_data_basic.findCodeByLinename(data.lineId);
  112 + if(lineCode)
  113 + data.lineId=lineCode;
  114 + }
105 115 $.get('/directive/findAll80', data, function(rs) {
106 116 $.each(rs.list, function(){
107 117 //命令字转中文
... ... @@ -122,7 +132,7 @@
122 132 if (resetPagination)
123 133 pagination(rs.totalPages + 1, rs.page);
124 134 })
125   - }
  135 + };
126 136  
127 137 var resetPagination = true;
128 138 var pagination = function(pages, currentPage) {
... ...