Commit 7d86d708f29814f431a11c9f80726ae7544afbf9

Authored by 潘钊
1 parent 69bd7921

update...

src/main/java/com/bsth/data/schedule/real/InOutScheduleDataBuffer.java
... ... @@ -115,10 +115,15 @@ public class InOutScheduleDataBuffer implements CommandLineRunner {
115 115  
116 116 Collection<ScheduleInOut> vs = allMaps.values();
117 117 for (ScheduleInOut sio : vs) {
118   - if (sio.getBcType().equals("out"))
119   - outListCopy.add(sio);
120   - else if (sio.getBcType().equals("in"))
121   - inListCopy.add(sio);
  118 + try{
  119 + if (sio.getBcType().equals("out"))
  120 + outListCopy.add(sio);
  121 + else if (sio.getBcType().equals("in"))
  122 + inListCopy.add(sio);
  123 +
  124 + }catch (Exception e){
  125 + logger.error("", e);
  126 + }
122 127 }
123 128  
124 129 outList = outListCopy;
... ... @@ -167,6 +172,7 @@ public class InOutScheduleDataBuffer implements CommandLineRunner {
167 172 old.setZdsjT(now.getZdsjT());
168 173 old.setAttJhTime(now.getAttJhTime());
169 174 old.setUt(now.getUt());
  175 + old.setStatus(now.getStatus());
170 176  
171 177 boolean isCPerson = !old.getJsy().equals(now.getJsy());//换人
172 178 boolean isCCar = !old.getNbbm().equals(now.getNbbm());//换车
... ... @@ -182,7 +188,7 @@ public class InOutScheduleDataBuffer implements CommandLineRunner {
182 188  
183 189 @Override
184 190 public void run(String... strings) throws Exception {
185   - Application.mainServices.scheduleWithFixedDelay(fixedRefreshThread, 10, 30, TimeUnit.SECONDS);
  191 + Application.mainServices.scheduleWithFixedDelay(fixedRefreshThread, 40, 30, TimeUnit.SECONDS);
186 192 }
187 193  
188 194 /**
... ... @@ -209,6 +215,8 @@ public class InOutScheduleDataBuffer implements CommandLineRunner {
209 215 List<ScheduleInOut> execs = new ArrayList<>();
210 216  
211 217 for(ScheduleInOut sio : list){
  218 + if(sio.getStatus() == -1)//烂班
  219 + continue;
212 220 if(Math.abs(t - sio.getDfsjT()) < SPACE_THRESHOLD){
213 221 execs.add(sio);
214 222 }
... ... @@ -238,8 +246,6 @@ public class InOutScheduleDataBuffer implements CommandLineRunner {
238 246 Collections.sort(listCopy, schComparator);
239 247 Line line;
240 248 for (ScheduleInOut sio : listCopy) {
241   - if(sio.getStatus()==-1)
242   - continue;
243 249 //进场还是出场
244 250 if (sio.getQdzCode().equals(tccCode)) {
245 251 sio.setBcType("out");
... ...
src/main/java/com/bsth/entity/ac/CarInOutEntity.java
... ... @@ -5,6 +5,7 @@ import com.bsth.data.basic.person.PersonDataBuffer;
5 5 import com.bsth.data.signal.dto.RfidInOutDto;
6 6 import com.bsth.entity.Bus;
7 7 import com.bsth.entity.Person;
  8 +import com.bsth.util.HexCardTransform;
8 9  
9 10 import javax.persistence.Entity;
10 11 import javax.persistence.GeneratedValue;
... ... @@ -120,7 +121,8 @@ public class CarInOutEntity {
120 121 cio.setLineName(b.getLineName());
121 122 }
122 123  
123   - Person p = PersonDataBuffer.findByCard(cio.getpCard());
  124 + String cardId = HexCardTransform.hexConvert(cio.getpCard());
  125 + Person p = PersonDataBuffer.findByCard(cardId);
124 126 if(null != p){
125 127 cio.setJsy(p.getUserId() + "/" + p.getPersonnelName());
126 128 cio.setCompany(p.getCompanyCode());
... ...
src/main/java/com/bsth/service/basic/impl/PersonServiceImpl.java
... ... @@ -7,6 +7,7 @@ import com.bsth.data.utils.ListPageQueryUtils;
7 7 import com.bsth.entity.Person;
8 8 import com.bsth.service.basic.PersonService;
9 9 import com.bsth.util.CtStringUtils;
  10 +import com.bsth.util.HexCardTransform;
10 11 import org.apache.commons.lang3.StringUtils;
11 12 import org.apache.poi.ss.usermodel.Cell;
12 13 import org.apache.poi.ss.usermodel.Row;
... ... @@ -21,7 +22,6 @@ import org.springframework.util.Base64Utils;
21 22  
22 23 import java.io.ByteArrayInputStream;
23 24 import java.io.IOException;
24   -import java.math.BigInteger;
25 25 import java.text.DecimalFormat;
26 26 import java.util.ArrayList;
27 27 import java.util.HashMap;
... ... @@ -216,7 +216,7 @@ public class PersonServiceImpl implements PersonService {
216 216 if(CtStringUtils.isChinese(data.get("jobCode")))
217 217 data.put("error", "1");
218 218 try {
219   - data.put("idCard", hexConvert(getCellData(row.getCell(2))));
  219 + data.put("idCard", HexCardTransform.hexConvert(getCellData(row.getCell(2))));
220 220  
221 221 if(data.get("idCard").equals("0000000000")) {
222 222 data.put("idCard", "");
... ... @@ -254,31 +254,8 @@ public class PersonServiceImpl implements PersonService {
254 254 return v;
255 255 }
256 256  
257   - /**
258   - * 16进制卡ID号转10进制
259   - *
260   - * @param hexCode
261   - * @return
262   - */
263   - private String hexConvert(String hexCode) {
264   - //16进制补满8位
265   - hexCode = padLeft(hexCode, 8, '0');
266   -
267   - char[] cardIdArray = hexCode.toCharArray();
268   - String cardId16Counter = "";
269   - String cardId10 = "";
270   - //倒序
271   - for (int i = cardIdArray.length - 1; i >= 0; i -= 2) {
272   - cardId16Counter += cardIdArray[i - 1] + "" + cardIdArray[i];
273   - }
274   - //转10进制
275   - cardId10 = String.valueOf(new BigInteger(cardId16Counter, 16));
276   - //10进制补满10位
277   - cardId10 = padLeft(cardId10, 10, '0');
278   - return cardId10;
279   - }
280 257  
281   - /**
  258 + /**
282 259 * 截断工号前缀
283 260 *
284 261 * @param jobCode
... ... @@ -290,20 +267,8 @@ public class PersonServiceImpl implements PersonService {
290 267 }
291 268  
292 269 if (jobCode.length() < 6) {
293   - jobCode = padLeft(jobCode, 6, '0');
  270 + jobCode = HexCardTransform.padLeft(jobCode, 6, '0');
294 271 }
295 272 return jobCode;
296 273 }
297   -
298   - public String padLeft(String oriStr, int len, char alexin) {
299   - String str = "";
300   - int strlen = oriStr.length();
301   - if (strlen < len) {
302   - for (int i = 0; i < len - strlen; i++) {
303   - str = str + alexin;
304   - }
305   - }
306   - str = str + oriStr;
307   - return str;
308   - }
309 274 }
... ...
src/main/java/com/bsth/util/HexCardTransform.java 0 → 100644
  1 +package com.bsth.util;
  2 +
  3 +import java.math.BigInteger;
  4 +
  5 +/**
  6 + * Created by panzhao on 2017/9/27.
  7 + */
  8 +public class HexCardTransform {
  9 +
  10 + /**
  11 + * 16进制卡ID号转10进制
  12 + *
  13 + * @param hexCode
  14 + * @return
  15 + */
  16 + public static String hexConvert(String hexCode) {
  17 + //16进制补满8位
  18 + hexCode = padLeft(hexCode, 8, '0');
  19 +
  20 + char[] cardIdArray = hexCode.toCharArray();
  21 + String cardId16Counter = "";
  22 + String cardId10 = "";
  23 + //倒序
  24 + for (int i = cardIdArray.length - 1; i >= 0; i -= 2) {
  25 + cardId16Counter += cardIdArray[i - 1] + "" + cardIdArray[i];
  26 + }
  27 + //转10进制
  28 + cardId10 = String.valueOf(new BigInteger(cardId16Counter, 16));
  29 + //10进制补满10位
  30 + cardId10 = padLeft(cardId10, 10, '0');
  31 + return cardId10;
  32 + }
  33 +
  34 + public static String padLeft(String oriStr, int len, char alexin) {
  35 + String str = "";
  36 + int strlen = oriStr.length();
  37 + if (strlen < len) {
  38 + for (int i = 0; i < len - strlen; i++) {
  39 + str = str + alexin;
  40 + }
  41 + }
  42 + str = str + oriStr;
  43 + return str;
  44 + }
  45 +}
... ...
src/main/resources/static/assets/css/main.css
... ... @@ -620,6 +620,9 @@ table tr th, table tr td{
620 620  
621 621 -webkit-user-select: none;
622 622 user-select: none;
  623 + overflow: auto;
  624 + height: calc(100% - 50px);
  625 + position: relative;
623 626 }
624 627  
625 628 .berth_card_list>.berth_card{
... ... @@ -669,7 +672,7 @@ table tr th, table tr td{
669 672 }
670 673  
671 674 .berth_card_list>.berth_card>.car_blank.charging:before{
672   - content: "正在充电...";
  675 + content: "";
673 676 width: 100%;
674 677 height: 60%;
675 678 display: block;
... ... @@ -683,7 +686,7 @@ table tr th, table tr td{
683 686 }
684 687  
685 688 .berth_card_list>.berth_card>.car_blank.no_elec{
686   - background: #607D8B;
  689 + background: #9f9f9f;
687 690 }
688 691  
689 692 .berth_card_list>.berth_card>.car_blank.no_elec:before{
... ... @@ -816,4 +819,8 @@ table tr th, table tr td{
816 819 vertical-align: middle !important;
817 820 font-size: 18px;
818 821 font-weight: 600;
  822 +}
  823 +
  824 +.signal_gps{
  825 + color: #9e9e9e;
819 826 }
820 827 \ No newline at end of file
... ...
src/main/resources/static/pages/b_p_manager/b_p_main.html
1   -<div id="b_p_manager_main_wrap" style="position: relative;">
  1 +<div id="b_p_manager_main_wrap" style="position: relative;height: 100%;">
2 2 <div class="drag_tip"></div>
3 3 <div class="berth_card_list"></div>
4 4  
... ... @@ -18,6 +18,8 @@
18 18 <script>
19 19 (function () {
20 20 var wrap = '#b_p_manager_main_wrap';
  21 + //滚动条
  22 + $('.berth_card_list', wrap).perfectScrollbar({suppressScrollX: true});
21 23  
22 24 /** 加载全部泊位信息 */
23 25 $.get('/berth/all', function (list) {
... ... @@ -28,6 +30,7 @@
28 30 initDragEvents();
29 31 //定时刷新实时车辆信息
30 32 fixedTimeRefresh();
  33 + $('.berth_card_list', wrap).perfectScrollbar('update');
31 34 });
32 35  
33 36 //定时刷新实时车辆信息
... ...