Commit 3973d99e5616d488abff8482d91c0fef0d985119
1 parent
b65d207c
1.修正道闸逻辑
Showing
1 changed file
with
12 additions
and
20 deletions
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
| @@ -659,18 +659,18 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -659,18 +659,18 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 659 | zcwcTime = Long.parseLong(timeL.get(0).get("zcwc_time").toString()); | 659 | zcwcTime = Long.parseLong(timeL.get(0).get("zcwc_time").toString()); |
| 660 | } | 660 | } |
| 661 | // 大于当前时间5分钟为补传数据 | 661 | // 大于当前时间5分钟为补传数据 |
| 662 | - if(Math.abs(date-timeT) > bcwcTime){ | 662 | + if(Math.abs(date-timeT) >= bcwcTime){ |
| 663 | for (int i = 0; i < size; i++) { | 663 | for (int i = 0; i < size; i++) { |
| 664 | ScheduleRealInfo isr = list.get(i); | 664 | ScheduleRealInfo isr = list.get(i); |
| 665 | if (list.get(i).isDestroy()) | 665 | if (list.get(i).isDestroy()) |
| 666 | continue; | 666 | continue; |
| 667 | if(fIsOut == 2 && (isr.getQdzName().trim().indexOf(fOutParkName) != -1) && (Math.abs(isr.getDfsjT()-fOutTime)<bcwcTime || (isr.getFcsjActualTime() != null && Math.abs(isr.getFcsjActualTime()-fOutTime)<bcwcTime))){ | 667 | if(fIsOut == 2 && (isr.getQdzName().trim().indexOf(fOutParkName) != -1) && (Math.abs(isr.getDfsjT()-fOutTime)<bcwcTime || (isr.getFcsjActualTime() != null && Math.abs(isr.getFcsjActualTime()-fOutTime)<bcwcTime))){ |
| 668 | - bcwcTime = Math.abs(isr.getDfsjT()-fOutTime); | ||
| 669 | sr = isr; | 668 | sr = isr; |
| 669 | + break; | ||
| 670 | } | 670 | } |
| 671 | if(fIsOut == 1 && fInStatus != 0 && (isr.getZdzName().trim().indexOf(fInParkName) != -1) && (Math.abs(isr.getZdsjT()-fInTime)<bcwcTime || (isr.getZdsjActualTime() != null && Math.abs(isr.getZdsjActualTime()-fOutTime)<bcwcTime))){ | 671 | if(fIsOut == 1 && fInStatus != 0 && (isr.getZdzName().trim().indexOf(fInParkName) != -1) && (Math.abs(isr.getZdsjT()-fInTime)<bcwcTime || (isr.getZdsjActualTime() != null && Math.abs(isr.getZdsjActualTime()-fOutTime)<bcwcTime))){ |
| 672 | - bcwcTime = Math.abs(isr.getZdsjT()-fInTime); | ||
| 673 | sr = isr; | 672 | sr = isr; |
| 673 | + break; | ||
| 674 | } | 674 | } |
| 675 | } | 675 | } |
| 676 | if(sr==null){ | 676 | if(sr==null){ |
| @@ -680,7 +680,6 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -680,7 +680,6 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 680 | return rs; | 680 | return rs; |
| 681 | } | 681 | } |
| 682 | } else { | 682 | } else { |
| 683 | - sr = dayOfSchedule.executeCurr(carPlate); | ||
| 684 | if(sr==null){ | 683 | if(sr==null){ |
| 685 | // 班次完成3分钟内上传道闸消息,可以标记 | 684 | // 班次完成3分钟内上传道闸消息,可以标记 |
| 686 | for (int i = 0; i < size; i++) { | 685 | for (int i = 0; i < size; i++) { |
| @@ -688,12 +687,12 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -688,12 +687,12 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 688 | if (list.get(i).isDestroy()) | 687 | if (list.get(i).isDestroy()) |
| 689 | continue; | 688 | continue; |
| 690 | if(fIsOut == 2 && (isr.getQdzName().trim().indexOf(fOutParkName) != -1) && (Math.abs(isr.getDfsjT()-fOutTime)<zcwcTime || (isr.getFcsjActualTime() != null && Math.abs(isr.getFcsjActualTime()-fOutTime)<zcwcTime))){ | 689 | if(fIsOut == 2 && (isr.getQdzName().trim().indexOf(fOutParkName) != -1) && (Math.abs(isr.getDfsjT()-fOutTime)<zcwcTime || (isr.getFcsjActualTime() != null && Math.abs(isr.getFcsjActualTime()-fOutTime)<zcwcTime))){ |
| 691 | - zcwcTime = Math.abs(isr.getDfsjT()-fOutTime); | ||
| 692 | sr = isr; | 690 | sr = isr; |
| 691 | + break; | ||
| 693 | } | 692 | } |
| 694 | if(fIsOut == 1 && fInStatus != 0 && (isr.getZdzName().trim().indexOf(fInParkName) != -1) && (Math.abs(isr.getZdsjT()-fInTime)<zcwcTime || (isr.getZdsjActualTime() != null && Math.abs(isr.getZdsjActualTime()-fOutTime)<zcwcTime))){ | 693 | if(fIsOut == 1 && fInStatus != 0 && (isr.getZdzName().trim().indexOf(fInParkName) != -1) && (Math.abs(isr.getZdsjT()-fInTime)<zcwcTime || (isr.getZdsjActualTime() != null && Math.abs(isr.getZdsjActualTime()-fOutTime)<zcwcTime))){ |
| 695 | - zcwcTime = Math.abs(isr.getZdsjT()-fInTime); | ||
| 696 | sr = isr; | 694 | sr = isr; |
| 695 | + break; | ||
| 697 | } | 696 | } |
| 698 | } | 697 | } |
| 699 | if(sr==null){ | 698 | if(sr==null){ |
| @@ -704,12 +703,12 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -704,12 +703,12 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 704 | } | 703 | } |
| 705 | } | 704 | } |
| 706 | } | 705 | } |
| 707 | - ScheduleRealInfo prevSr = dayOfSchedule.prev(sr); | ||
| 708 | - ScheduleRealInfo nextSr = dayOfSchedule.next(sr); | 706 | + //ScheduleRealInfo prevSr = dayOfSchedule.prev(sr); |
| 707 | + //ScheduleRealInfo nextSr = dayOfSchedule.next(sr); | ||
| 709 | 708 | ||
| 710 | - boolean isMatch = false; | ||
| 711 | - ScheduleRealInfo matchSr = null; | ||
| 712 | - String inTimeStr ="",outTimeStr=""; | 709 | + boolean isMatch = sr == null ? false : true; |
| 710 | + ScheduleRealInfo matchSr = sr; | ||
| 711 | + String inTimeStr = fmtHHmm.print(fInTime),outTimeStr = fmtHHmm.print(fOutTime); | ||
| 713 | /** | 712 | /** |
| 714 | fIsOut 1:进场 2:出场 | 713 | fIsOut 1:进场 2:出场 |
| 715 | * 进场 如果道闸信息先发,则为当前班次, 道闸信息后发,则为上一个班次信息 | 714 | * 进场 如果道闸信息先发,则为当前班次, 道闸信息后发,则为上一个班次信息 |
| @@ -718,14 +717,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -718,14 +717,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 718 | * | 717 | * |
| 719 | * 到达时间接近那个班次的进场/出场判定为这个班次 | 718 | * 到达时间接近那个班次的进场/出场判定为这个班次 |
| 720 | */ | 719 | */ |
| 721 | - if (fIsOut == 1 && fInStatus != 0 && fInTime != 0) { | ||
| 722 | - /*if(prevSr == null || (Math.abs((sr.getZdsjT()- fInTime)) < Math.abs((prevSr.getZdsjT()- fInTime)))){ | ||
| 723 | - isMatch = true; | ||
| 724 | - matchSr = sr; | ||
| 725 | - } else {//if(Math.abs((prevSr.getDfsjT())- fInTime) < 120) | ||
| 726 | - isMatch = true; | ||
| 727 | - matchSr = prevSr; | ||
| 728 | - }*/ | 720 | + /*if (fIsOut == 1 && fInStatus != 0 && fInTime != 0) { |
| 729 | if(prevSr == null && (sr.getZdzName().trim().indexOf(fInParkName) != -1) && (Math.abs((sr.getZdsjT()- fInTime)) < Math.abs((prevSr.getZdsjT()- fInTime)))){ | 721 | if(prevSr == null && (sr.getZdzName().trim().indexOf(fInParkName) != -1) && (Math.abs((sr.getZdsjT()- fInTime)) < Math.abs((prevSr.getZdsjT()- fInTime)))){ |
| 730 | isMatch = true; | 722 | isMatch = true; |
| 731 | matchSr = sr; | 723 | matchSr = sr; |
| @@ -743,7 +735,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -743,7 +735,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 743 | matchSr = nextSr; | 735 | matchSr = nextSr; |
| 744 | } | 736 | } |
| 745 | outTimeStr = fmtHHmm.print(fOutTime); | 737 | outTimeStr = fmtHHmm.print(fOutTime); |
| 746 | - } | 738 | + }*/ |
| 747 | if(isMatch){ | 739 | if(isMatch){ |
| 748 | ScheduleRealInfoTag tag = new ScheduleRealInfoTag(); | 740 | ScheduleRealInfoTag tag = new ScheduleRealInfoTag(); |
| 749 | Long real_id = matchSr.getId(); | 741 | Long real_id = matchSr.getId(); |