Commit 23716be8c1810d558a39fcdb8db19e1cf2722ab5

Authored by 廖磊
2 parents a457f9b5 2e25f1c9

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

# Conflicts:
#	src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java

Too many changes to show.

To preserve performance only 14 of 41 files are displayed.

src/main/java/com/bsth/controller/realcontrol/RealMapController.java
1 package com.bsth.controller.realcontrol; 1 package com.bsth.controller.realcontrol;
2 2
  3 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  4 +import com.bsth.data.gpsdata.arrival.entity.TimedEnableStationRoute;
3 import com.bsth.service.realcontrol.RealMapService; 5 import com.bsth.service.realcontrol.RealMapService;
4 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.web.bind.annotation.RequestMapping; 7 import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RequestMethod;
6 import org.springframework.web.bind.annotation.RequestParam; 9 import org.springframework.web.bind.annotation.RequestParam;
7 import org.springframework.web.bind.annotation.RestController; 10 import org.springframework.web.bind.annotation.RestController;
8 11
@@ -74,4 +77,9 @@ public class RealMapController { @@ -74,4 +77,9 @@ public class RealMapController {
74 public Map<String, Object> multiSectionRoute(@RequestParam String codeIdx){ 77 public Map<String, Object> multiSectionRoute(@RequestParam String codeIdx){
75 return realMapService.multiSectionRoute(codeIdx); 78 return realMapService.multiSectionRoute(codeIdx);
76 } 79 }
  80 +
  81 + @RequestMapping(value = "/lockAndFlxedTimeEnabled", method = RequestMethod.POST)
  82 + public void lockAndFlxedTimeEnabled(TimedEnableStationRoute tes){
  83 + GeoCacheData.tesMap.put(tes.getLineCode(), tes);
  84 + }
77 } 85 }
src/main/java/com/bsth/controller/realcontrol/anomalyCheckController.java
@@ -102,7 +102,7 @@ public class anomalyCheckController { @@ -102,7 +102,7 @@ public class anomalyCheckController {
102 } 102 }
103 103
104 @RequestMapping(value = "/findSchByLpName") 104 @RequestMapping(value = "/findSchByLpName")
105 - public List<ScheduleRealInfo> findSchByLpName(String lpName){ 105 + public List<ScheduleRealInfo> findSchByLpName(@RequestParam String lpName){
106 return dayOfSchedule.getLpScheduleMap().get(lpName); 106 return dayOfSchedule.getLpScheduleMap().get(lpName);
107 } 107 }
108 } 108 }
src/main/java/com/bsth/data/LineConfigData.java
@@ -77,7 +77,7 @@ public class LineConfigData implements CommandLineRunner { @@ -77,7 +77,7 @@ public class LineConfigData implements CommandLineRunner {
77 public long applyIn(ScheduleRealInfo sch, Long timestamp){ 77 public long applyIn(ScheduleRealInfo sch, Long timestamp){
78 LineConfig config = lineConfMap.get(sch.getXlBm()); 78 LineConfig config = lineConfMap.get(sch.getXlBm());
79 int diff = sch.getXlDir().equals("0")?config.getUpInDiff():config.getDownInDiff(); 79 int diff = sch.getXlDir().equals("0")?config.getUpInDiff():config.getDownInDiff();
80 - return timestamp - (diff * 1000); 80 + return timestamp + (diff * 1000);
81 } 81 }
82 82
83 @Component 83 @Component
src/main/java/com/bsth/data/gpsdata/arrival/GeoCacheData.java
@@ -2,6 +2,7 @@ package com.bsth.data.gpsdata.arrival; @@ -2,6 +2,7 @@ package com.bsth.data.gpsdata.arrival;
2 2
3 import com.bsth.data.gpsdata.GpsEntity; 3 import com.bsth.data.gpsdata.GpsEntity;
4 import com.bsth.data.gpsdata.arrival.entity.StationRoute; 4 import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  5 +import com.bsth.data.gpsdata.arrival.entity.TimedEnableStationRoute;
5 import com.bsth.data.gpsdata.arrival.utils.CircleQueue; 6 import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
6 import com.bsth.data.gpsdata.arrival.utils.StationRouteComp; 7 import com.bsth.data.gpsdata.arrival.utils.StationRouteComp;
7 import com.google.common.collect.ArrayListMultimap; 8 import com.google.common.collect.ArrayListMultimap;
@@ -53,6 +54,10 @@ public class GeoCacheData { @@ -53,6 +54,10 @@ public class GeoCacheData {
53 //线路限速信息 54 //线路限速信息
54 private static Map<String, Double> speedLimitMap; 55 private static Map<String, Double> speedLimitMap;
55 56
  57 + //需要定时刷新的站点路由
  58 + public static Map<String, TimedEnableStationRoute> tesMap = new HashMap<>();
  59 + //TimedEnableStationRoute
  60 +
56 @Autowired 61 @Autowired
57 JdbcTemplate jdbcTemplate; 62 JdbcTemplate jdbcTemplate;
58 63
@@ -282,6 +287,28 @@ public class GeoCacheData { @@ -282,6 +287,28 @@ public class GeoCacheData {
282 connectStationRoute(tempMap.get(key)); 287 connectStationRoute(tempMap.get(key));
283 } 288 }
284 289
  290 + //定时启用的站点走向
  291 + if(tesMap.size() > 0){
  292 + List<String> rems = new ArrayList<>();
  293 + long t = System.currentTimeMillis();
  294 + for(TimedEnableStationRoute tes : tesMap.values()){
  295 + if(tes.getEnableTime() > t){
  296 + logger.info("锁住站点路由," + tes.getLineCode());
  297 + tempMap.replaceValues(tes.getLineCode() + "_0", stationCacheMap.get(tes.getLineCode() + "_0"));
  298 + tempMap.replaceValues(tes.getLineCode() + "_1", stationCacheMap.get(tes.getLineCode() + "_1"));
  299 + }
  300 + else
  301 + rems.add(tes.getLineCode());
  302 + }
  303 +
  304 + //remove
  305 + if(rems.size() > 0){
  306 + for(String lineCode : rems){
  307 + logger.info("启用路由," + lineCode);
  308 + tesMap.remove(lineCode);
  309 + }
  310 + }
  311 + }
285 stationCacheMap = tempMap; 312 stationCacheMap = tempMap;
286 routeCodeMap = codeMap; 313 routeCodeMap = codeMap;
287 } 314 }
src/main/java/com/bsth/data/gpsdata/arrival/entity/TimedEnableStationRoute.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.entity;
  2 +
  3 +/**
  4 + * 定时启用站点路由
  5 + * Created by panzhao on 2017/8/28.
  6 + */
  7 +public class TimedEnableStationRoute {
  8 +
  9 + private String lineCode;
  10 +
  11 + private Long enableTime;
  12 +
  13 + public String getLineCode() {
  14 + return lineCode;
  15 + }
  16 +
  17 + public void setLineCode(String lineCode) {
  18 + this.lineCode = lineCode;
  19 + }
  20 +
  21 + public Long getEnableTime() {
  22 + return enableTime;
  23 + }
  24 +
  25 + public void setEnableTime(Long enableTime) {
  26 + this.enableTime = enableTime;
  27 + }
  28 +}
src/main/java/com/bsth/data/gpsdata/arrival/handlers/AbnormalStateHandle.java
@@ -65,8 +65,8 @@ public class AbnormalStateHandle extends SignalHandle{ @@ -65,8 +65,8 @@ public class AbnormalStateHandle extends SignalHandle{
65 * @return 65 * @return
66 */ 66 */
67 public boolean outOfBounds(GpsEntity gps){ 67 public boolean outOfBounds(GpsEntity gps){
68 - //场内的车不处理  
69 - if(gps.getInstation() == 2){ 68 + //只处理电子围栏外的车
  69 + if(gps.getInstation() != 0){
70 return false; 70 return false;
71 } 71 }
72 72
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
@@ -239,9 +239,14 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -239,9 +239,14 @@ public class InOutStationSignalHandle extends SignalHandle{
239 long t2 = gps.getTimestamp(); 239 long t2 = gps.getTimestamp();
240 long c = sch.getDfsjT(); 240 long c = sch.getDfsjT();
241 241
242 - if(c - t1 > 1000 * 60 * 15 && Math.abs(t2 - c) < 1000 * 60 * 5){ 242 + /*if(c - t1 > 1000 * 60 * 15 && Math.abs(t2 - c) < 1000 * 60 * 5){
  243 + return true;
  244 + }*/
  245 + int threshold = 1000 * 60 * 5;
  246 + if(Math.abs(t2 - c) < threshold && c - t1 > threshold){
243 return true; 247 return true;
244 } 248 }
  249 + //if(Math.abs(t2 - c) < 1000 * 60 * 5 && c - t1 > 1000 * 60 * 5)
245 return false; 250 return false;
246 } 251 }
247 252
@@ -255,7 +260,7 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -255,7 +260,7 @@ public class InOutStationSignalHandle extends SignalHandle{
255 if (config != null && config.getOutConfig() == 2) { 260 if (config != null && config.getOutConfig() == 2) {
256 //出站既出场 261 //出站既出场
257 ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); 262 ScheduleRealInfo schPrev = dayOfSchedule.prev(sch);
258 - if (schPrev != null && schPrev.getBcType().equals("out") 263 + if (schPrev != null && schPrev.getBcType().equals("out") && (schPrev.getBcsj()==0 || schPrev.getJhlcOrig().equals(0))
259 && (!limitPark || park.equals(schPrev.getQdzCode()))) { 264 && (!limitPark || park.equals(schPrev.getQdzCode()))) {
260 265
261 schPrev.setFcsjActualAll(sch.getFcsjActualTime()); 266 schPrev.setFcsjActualAll(sch.getFcsjActualTime());
@@ -447,7 +452,7 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -447,7 +452,7 @@ public class InOutStationSignalHandle extends SignalHandle{
447 boolean limitPark = StringUtils.isNotEmpty(park); 452 boolean limitPark = StringUtils.isNotEmpty(park);
448 453
449 454
450 - if (next.getBcType().equals("in") && config.getOutConfig() == 2 455 + if (next.getBcType().equals("in") && config.getOutConfig() == 2 && (next.getBcsj()==0 || next.getJhlcOrig().equals(0))
451 && (!limitPark || park.equals(next.getZdzCode()))) { 456 && (!limitPark || park.equals(next.getZdzCode()))) {
452 457
453 next.setFcsjActualAll(sch.getZdsjActualTime()); 458 next.setFcsjActualAll(sch.getZdsjActualTime());
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
@@ -60,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware { @@ -60,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware {
60 for (String nbbm : keys) { 60 for (String nbbm : keys) {
61 Collections.sort(listMap.get(nbbm), comp); 61 Collections.sort(listMap.get(nbbm), comp);
62 threadPool.execute(new RecoveryThread(listMap.get(nbbm), count)); 62 threadPool.execute(new RecoveryThread(listMap.get(nbbm), count));
63 - /*if(nbbm.equals("W9H-088")) 63 + /*if(nbbm.equals("W09-164"))
64 new RecoveryThread(listMap.get(nbbm), count).run();*/ 64 new RecoveryThread(listMap.get(nbbm), count).run();*/
65 /*if(lineId.equals("60028")) 65 /*if(lineId.equals("60028"))
66 new RecoveryThread(listMap.get(lineId), count).run();*/ 66 new RecoveryThread(listMap.get(lineId), count).run();*/
@@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware {
84 Calendar calendar = Calendar.getInstance(); 84 Calendar calendar = Calendar.getInstance();
85 int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); 85 int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR);
86 86
87 - String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=207";// + dayOfYear; 87 + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=241";// + dayOfYear;
88 JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); 88 JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource());
89 89
90 List<GpsEntity> list = 90 List<GpsEntity> list =
@@ -153,7 +153,7 @@ public class GpsDataRecovery implements ApplicationContextAware { @@ -153,7 +153,7 @@ public class GpsDataRecovery implements ApplicationContextAware {
153 boolean task; 153 boolean task;
154 for (GpsEntity gps : list) { 154 for (GpsEntity gps : list) {
155 try { 155 try {
156 - /*if(gps.getTimestamp() >= 1500942270000L){ 156 + /*if(gps.getTimestamp() >= 1503960000000L){
157 System.out.println("debugger..."); 157 System.out.println("debugger...");
158 }*/ 158 }*/
159 //是否有任务 159 //是否有任务
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -278,12 +278,14 @@ public class DayOfSchedule { @@ -278,12 +278,14 @@ public class DayOfSchedule {
278 List<String> lprms = new ArrayList<>(); 278 List<String> lprms = new ArrayList<>();
279 Set<String> lps = lpScheduleMap.keySet(); 279 Set<String> lps = lpScheduleMap.keySet();
280 for (String lp : lps) { 280 for (String lp : lps) {
281 - if (lp.indexOf(lineCode + "_") != -1) 281 + if (lp.startsWith(lineCode + "_"))
282 lprms.add(lp); 282 lprms.add(lp);
283 } 283 }
284 284
285 - for (String lp : lprms) 285 + for (String lp : lprms){
  286 + logger.info("清理路牌映射 " + lp);
286 lpScheduleMap.removeAll(lp); 287 lpScheduleMap.removeAll(lp);
  288 + }
287 289
288 logger.info(lineCode + "排班清理 " + count); 290 logger.info(lineCode + "排班清理 " + count);
289 } 291 }
@@ -571,7 +573,7 @@ public class DayOfSchedule { @@ -571,7 +573,7 @@ public class DayOfSchedule {
571 continue; 573 continue;
572 574
573 //出站既出场,忽略出场班次 575 //出站既出场,忽略出场班次
574 - if (outConfig == 2 && temp.getBcType().equals("out") 576 + if (outConfig == 2 && temp.getBcType().equals("out") && (temp.getBcsj()==0 || temp.getJhlcOrig().equals(0))
575 && (!limitPark || park.equals(temp.getQdzCode()))) 577 && (!limitPark || park.equals(temp.getQdzCode())))
576 continue; 578 continue;
577 579
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
@@ -117,8 +117,7 @@ public class SchAttrCalculator { @@ -117,8 +117,7 @@ public class SchAttrCalculator {
117 for(int i = 1; i < len; i ++){ 117 for(int i = 1; i < len; i ++){
118 curr = list.get(i); 118 curr = list.get(i);
119 119
120 - if(prve.getZdzName().equals(curr.getQdzName())  
121 - || prve.getZdzCode().equals(curr.getQdzCode())){ 120 + if(isJoin(prve, curr)){
122 curr.setQdzArrDatejh(prve.getZdsj()); 121 curr.setQdzArrDatejh(prve.getZdsj());
123 if(StringUtils.isNotEmpty(prve.getZdsjActual())) 122 if(StringUtils.isNotEmpty(prve.getZdsjActual()))
124 curr.setQdzArrDatesj(prve.getZdsjActual()); 123 curr.setQdzArrDatesj(prve.getZdsjActual());
@@ -126,6 +125,13 @@ public class SchAttrCalculator { @@ -126,6 +125,13 @@ public class SchAttrCalculator {
126 prve = curr; 125 prve = curr;
127 } 126 }
128 } 127 }
  128 +
  129 + private boolean isJoin(ScheduleRealInfo prve, ScheduleRealInfo curr) {
  130 + return prve.getZdzName().equals(curr.getQdzName())//名称相等
  131 + || prve.getZdzCode().equals(curr.getQdzCode())//编码相等
  132 + || prve.getZdzName().startsWith(curr.getQdzName())//起始包括
  133 + || curr.getQdzName().startsWith(prve.getZdzName());//起始包括
  134 + }
129 135
130 /** 136 /**
131 * 137 *
src/main/java/com/bsth/data/schedule/ScheduleComparator.java
@@ -3,6 +3,8 @@ package com.bsth.data.schedule; @@ -3,6 +3,8 @@ package com.bsth.data.schedule;
3 import com.bsth.entity.realcontrol.ScheduleRealInfo; 3 import com.bsth.entity.realcontrol.ScheduleRealInfo;
4 4
5 import java.util.Comparator; 5 import java.util.Comparator;
  6 +import java.util.HashMap;
  7 +import java.util.Map;
6 8
7 /** 9 /**
8 * 10 *
@@ -20,20 +22,38 @@ public class ScheduleComparator { @@ -20,20 +22,38 @@ public class ScheduleComparator {
20 return s1.getFcno() - s2.getFcno(); 22 return s1.getFcno() - s2.getFcno();
21 } 23 }
22 }*/ 24 }*/
  25 +
  26 + static Map<String, Integer> bcTypeOrderMap = new HashMap<>();
  27 +
  28 + static{
  29 + bcTypeOrderMap.put("out", 0);
  30 + bcTypeOrderMap.put("normal", 1);
  31 + bcTypeOrderMap.put("region", 2);
  32 + bcTypeOrderMap.put("major", 3);
  33 + bcTypeOrderMap.put("venting", 4);
  34 + bcTypeOrderMap.put("ldks", 5);
  35 + bcTypeOrderMap.put("in", 6);
  36 + }
23 37
24 public static class FCSJ implements Comparator<ScheduleRealInfo>{ 38 public static class FCSJ implements Comparator<ScheduleRealInfo>{
25 39
26 @Override 40 @Override
27 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) { 41 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
28 - return (int) (s1.getFcsjT() - s2.getFcsjT()); 42 + int diff = (int) (s1.getFcsjT() - s2.getFcsjT());
  43 + return diff!=0?diff:typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
29 } 44 }
30 } 45 }
31 46
  47 + private static int typeOrder(String bcType){
  48 + return bcTypeOrderMap.get(bcType)!=null?bcTypeOrderMap.get(bcType):0;
  49 + }
  50 +
32 public static class DFSJ implements Comparator<ScheduleRealInfo>{ 51 public static class DFSJ implements Comparator<ScheduleRealInfo>{
33 52
34 @Override 53 @Override
35 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) { 54 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
36 - return (int) (s1.getDfsjT() - s2.getDfsjT()); 55 + int diff = (int) (s1.getDfsjT() - s2.getDfsjT());
  56 + return diff!=0?diff:typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
37 } 57 }
38 } 58 }
39 } 59 }
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
@@ -217,6 +217,14 @@ public class ScheduleRealInfo { @@ -217,6 +217,14 @@ public class ScheduleRealInfo {
217 /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/ 217 /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/
218 private int siginCompate; 218 private int siginCompate;
219 219
  220 + /**
  221 + * 漂移状态
  222 + * 1: 发车漂移
  223 + * 2:到站漂移
  224 + * 3:中途漂移
  225 + */
  226 + private int driftStatus = 0;
  227 +
220 public boolean isDfAuto() { 228 public boolean isDfAuto() {
221 return dfAuto; 229 return dfAuto;
222 } 230 }
@@ -933,4 +941,12 @@ public class ScheduleRealInfo { @@ -933,4 +941,12 @@ public class ScheduleRealInfo {
933 public void setSiginCompate(int siginCompate) { 941 public void setSiginCompate(int siginCompate) {
934 this.siginCompate = siginCompate; 942 this.siginCompate = siginCompate;
935 } 943 }
  944 +
  945 + public int getDriftStatus() {
  946 + return driftStatus;
  947 + }
  948 +
  949 + public void setDriftStatus(int driftStatus) {
  950 + this.driftStatus = driftStatus;
  951 + }
936 } 952 }
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
@@ -50,25 +50,25 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements @@ -50,25 +50,25 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
50 JdbcTemplate jdbcTemplate; 50 JdbcTemplate jdbcTemplate;
51 @Override 51 @Override
52 public PageObject<Ylxxb> Pagequery(Map<String, Object> map) { 52 public PageObject<Ylxxb> Pagequery(Map<String, Object> map) {
53 - 53 +
54 String rq=map.get("yyrq").toString(); 54 String rq=map.get("yyrq").toString();
55 String gsdm=map.get("gsdm_like").toString(); 55 String gsdm=map.get("gsdm_like").toString();
56 String fgsdm=map.get("fgsdm_like").toString(); 56 String fgsdm=map.get("fgsdm_like").toString();
57 -  
58 - String sql=" select * from ("  
59 - + "select *,CONCAT(nbbm,jsy) as nj "  
60 - + " from bsth_c_ylxxb where yyrq='"+rq+"' "  
61 - + " and gsdm ='"+gsdm+"' and jylx ='0') x where x.nj not in ("  
62 - + " select CONCAT(nbbm,jsy) from bsth_c_ylb "  
63 - + " where rq='"+rq+"'"  
64 - + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"')"  
65 - + " and x.nbbm in (select nbbm from bsth_c_ylb "  
66 - + " where rq='"+rq+"'"  
67 - + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"') "  
68 - + " and x.nbbm not in (select nbbm from bsth_c_ylxxb"  
69 - + " where yyrq='"+rq+"' and gsdm ='"+gsdm+"' AND jylx ='1')";  
70 -  
71 - 57 +
  58 + String sql=" select * from ("
  59 + + "select *,CONCAT(nbbm,jsy) as nj "
  60 + + " from bsth_c_ylxxb where yyrq='"+rq+"' "
  61 + + " and gsdm ='"+gsdm+"' and jylx ='0') x where x.nj not in ("
  62 + + " select CONCAT(nbbm,jsy) from bsth_c_ylb "
  63 + + " where rq='"+rq+"'"
  64 + + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"')"
  65 + + " and x.nbbm in (select nbbm from bsth_c_ylb "
  66 + + " where rq='"+rq+"'"
  67 + + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"') "
  68 + + " and x.nbbm not in (select nbbm from bsth_c_ylxxb"
  69 + + " where yyrq='"+rq+"' and gsdm ='"+gsdm+"' AND jylx ='1')";
  70 +
  71 +
72 /*String sql= "select v.*,u.jsy as ldgh from " 72 /*String sql= "select v.*,u.jsy as ldgh from "
73 + " ( select * from bsth_c_ylxxb x where " 73 + " ( select * from bsth_c_ylxxb x where "
74 + " DATE_FORMAT(x.yyrq,'%Y-%m-%d')='"+rq+"' and x.gsdm='"+gsdm+"'" 74 + " DATE_FORMAT(x.yyrq,'%Y-%m-%d')='"+rq+"' and x.gsdm='"+gsdm+"'"
@@ -83,43 +83,43 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements @@ -83,43 +83,43 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
83 + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"'" 83 + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"'"
84 + " and ssgsdm='"+gsdm+"' and fgsdm='"+fgsdm+"' ) u " 84 + " and ssgsdm='"+gsdm+"' and fgsdm='"+fgsdm+"' ) u "
85 + " on v.nbbm=u.nbbm ";*/ 85 + " on v.nbbm=u.nbbm ";*/
86 - 86 +
87 //根具条件查询指定日期Ylxxb的数据 87 //根具条件查询指定日期Ylxxb的数据
88 // List<Ylxxb> iterator=repository.checkYlxx(rq,gsdm); 88 // List<Ylxxb> iterator=repository.checkYlxx(rq,gsdm);
89 /*if(map.get("gsdm_in")!=null){ 89 /*if(map.get("gsdm_in")!=null){
90 map.put("ssgsdm_in", map.get("gsdm_in")); 90 map.put("ssgsdm_in", map.get("gsdm_in"));
91 map.remove("gsdm_in"); 91 map.remove("gsdm_in");
92 - 92 +
93 }else{ 93 }else{
94 map.put("ssgsdm_like", map.get("gsdm_like")); 94 map.put("ssgsdm_like", map.get("gsdm_like"));
95 map.remove("gsdm_like"); 95 map.remove("gsdm_like");
96 }*/ 96 }*/
97 - 97 +
98 //根具条件查询指定日期Ylb的数据 98 //根具条件查询指定日期Ylb的数据
99 // List<Ylb> ylbIterator=ylbRepository.checkYl(rq,gsdm,fgsdm); 99 // List<Ylb> ylbIterator=ylbRepository.checkYl(rq,gsdm,fgsdm);
100 - List<Ylxxb> list=jdbcTemplate.query(sql,  
101 - new RowMapper<Ylxxb>(){  
102 - @Override  
103 - public Ylxxb mapRow(ResultSet rs, int rowNum) throws SQLException {  
104 - Ylxxb s = new Ylxxb();  
105 - s.setId(rs.getInt("id"));  
106 - s.setYyrq(rs.getDate("yyrq"));  
107 - s.setNbbm(rs.getString("nbbm"));  
108 - s.setGsdm(rs.getString("gsdm"));  
109 - s.setFgsdm(rs.getString("fgsdm"));  
110 - s.setJsy(rs.getString("jsy"));  
111 - s.setJzl(rs.getDouble("jzl"));  
112 - s.setStationid(rs.getString("stationid"));  
113 - s.setNylx(rs.getInt("nylx"));  
114 - s.setJyggh(rs.getString("jyggh"));  
115 - s.setYj(rs.getDouble("yj")); 100 + List<Ylxxb> list=jdbcTemplate.query(sql,
  101 + new RowMapper<Ylxxb>(){
  102 + @Override
  103 + public Ylxxb mapRow(ResultSet rs, int rowNum) throws SQLException {
  104 + Ylxxb s = new Ylxxb();
  105 + s.setId(rs.getInt("id"));
  106 + s.setYyrq(rs.getDate("yyrq"));
  107 + s.setNbbm(rs.getString("nbbm"));
  108 + s.setGsdm(rs.getString("gsdm"));
  109 + s.setFgsdm(rs.getString("fgsdm"));
  110 + s.setJsy(rs.getString("jsy"));
  111 + s.setJzl(rs.getDouble("jzl"));
  112 + s.setStationid(rs.getString("stationid"));
  113 + s.setNylx(rs.getInt("nylx"));
  114 + s.setJyggh(rs.getString("jyggh"));
  115 + s.setYj(rs.getDouble("yj"));
116 // s.setLdgh(rs.getString("ldgh")); 116 // s.setLdgh(rs.getString("ldgh"));
117 - s.setBz(rs.getString("bz"));  
118 - return s;  
119 - }  
120 - });  
121 -  
122 - 117 + s.setBz(rs.getString("bz"));
  118 + return s;
  119 + }
  120 + });
  121 +
  122 +
123 List<Ylb> listylb=ylbRepository.obtainYl(rq, gsdm, fgsdm, "", "", "nbbm"); 123 List<Ylb> listylb=ylbRepository.obtainYl(rq, gsdm, fgsdm, "", "", "nbbm");
124 for (int i = 0; i < list.size(); i++) { 124 for (int i = 0; i < list.size(); i++) {
125 String ldgh=""; 125 String ldgh="";
@@ -129,11 +129,11 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements @@ -129,11 +129,11 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
129 if(ldgh.equals("")) 129 if(ldgh.equals(""))
130 ldgh +=ylb.getJsy(); 130 ldgh +=ylb.getJsy();
131 else 131 else
132 - ldgh += ","+ylb.getJsy(); 132 + ldgh += ","+ylb.getJsy();
133 } 133 }
134 } 134 }
135 list.get(i).setLdgh(ldgh); 135 list.get(i).setLdgh(ldgh);
136 - 136 +
137 } 137 }
138 //正式使用用下面代码 138 //正式使用用下面代码
139 // for (int i = 0; i < iterator.size(); i++) { 139 // for (int i = 0; i < iterator.size(); i++) {
@@ -154,16 +154,16 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements @@ -154,16 +154,16 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
154 // list.add(y1); 154 // list.add(y1);
155 // } 155 // }
156 // } 156 // }
157 -  
158 -  
159 - 157 +
  158 +
  159 +
160 PageHelper pageHelper = new PageHelper(list.size(), map); 160 PageHelper pageHelper = new PageHelper(list.size(), map);
161 pageHelper.getMap(); 161 pageHelper.getMap();
162 PageObject<Ylxxb> pageObject = pageHelper.getPageObject(); 162 PageObject<Ylxxb> pageObject = pageHelper.getPageObject();
163 pageObject.setDataList(list); 163 pageObject.setDataList(list);
164 return pageObject; 164 return pageObject;
165 } 165 }
166 - @Transactional 166 + @Transactional
167 @Override 167 @Override
168 public Map<String, Object> checkJsy(Map<String, Object> map) throws Exception{ 168 public Map<String, Object> checkJsy(Map<String, Object> map) throws Exception{
169 Map<String, Object> newMap=new HashMap<String,Object>(); 169 Map<String, Object> newMap=new HashMap<String,Object>();
@@ -188,7 +188,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements @@ -188,7 +188,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
188 repository.save(ylxxb); 188 repository.save(ylxxb);
189 } 189 }
190 } 190 }
191 - newMap.put("status", ResponseCode.SUCCESS); 191 + newMap.put("status", ResponseCode.SUCCESS);
192 }catch(Exception e){ 192 }catch(Exception e){
193 newMap.put("status", ResponseCode.ERROR); 193 newMap.put("status", ResponseCode.ERROR);
194 logger.error("save erro.", e); 194 logger.error("save erro.", e);
@@ -235,6 +235,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements @@ -235,6 +235,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
235 return list; 235 return list;
236 } 236 }
237 237
  238 +
238 @Transactional 239 @Transactional
239 @Override 240 @Override
240 public Map<String, Object> checkNbbm(Map<String, Object> map) throws Exception{ 241 public Map<String, Object> checkNbbm(Map<String, Object> map) throws Exception{
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -4077,8 +4077,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4077,8 +4077,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4077 Long zdsjActual_=Long.parseLong(zdsjActual_s[0])*60+Long.parseLong(zdsjActual_s[1]); 4077 Long zdsjActual_=Long.parseLong(zdsjActual_s[0])*60+Long.parseLong(zdsjActual_s[1]);
4078 if((zdsj_-zdsjActual_)>0){ 4078 if((zdsj_-zdsjActual_)>0){
4079 zdsjk =String.valueOf(zdsj_-zdsjActual_); 4079 zdsjk =String.valueOf(zdsj_-zdsjActual_);
4080 - }  
4081 - if(((zdsj_-zdsjActual_)<0)){ 4080 + }else{
4082 zdsjm =String.valueOf(zdsjActual_-zdsj_); 4081 zdsjm =String.valueOf(zdsjActual_-zdsj_);
4083 } 4082 }
4084 } 4083 }
@@ -4105,8 +4104,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4105,8 +4104,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4105 Long fcsjActural_=Long.parseLong(fcsjActural_s[0])*60+Long.parseLong(fcsjActural_s[1]); 4104 Long fcsjActural_=Long.parseLong(fcsjActural_s[0])*60+Long.parseLong(fcsjActural_s[1]);
4106 if((zdsj_-fcsjActural_)>0){ 4105 if((zdsj_-fcsjActural_)>0){
4107 fcsjk =String.valueOf(zdsj_-fcsjActural_); 4106 fcsjk =String.valueOf(zdsj_-fcsjActural_);
4108 - }  
4109 - if((zdsj_-fcsjActural_)<0){ 4107 + }else{
4110 fcsjm =String.valueOf(fcsjActural_-zdsj_); 4108 fcsjm =String.valueOf(fcsjActural_-zdsj_);
4111 } 4109 }
4112 } 4110 }
@@ -4671,8 +4669,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4671,8 +4669,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4671 mr.setSjyygl(rs.getDouble("sjyygl")); 4669 mr.setSjyygl(rs.getDouble("sjyygl"));
4672 mr.setSjksgl(rs.getDouble("sjksgl")); 4670 mr.setSjksgl(rs.getDouble("sjksgl"));
4673 mr.setZgl(rs.getDouble("zyygl")); 4671 mr.setZgl(rs.getDouble("zyygl"));
4674 - mr.setZddfgl(rs.getDouble("sddfgl"));  
4675 - mr.setSddfgl(rs.getDouble("zddfgl")); 4672 + mr.setZddfgl(rs.getDouble("zddfgl"));
  4673 + mr.setSddfgl(rs.getDouble("sddfgl"));
4676 mr.setWqwxhgl(rs.getDouble("wqwxhgl")); 4674 mr.setWqwxhgl(rs.getDouble("wqwxhgl"));
4677 mr.setBfwxhgl(rs.getDouble("bfwxhgl")); 4675 mr.setBfwxhgl(rs.getDouble("bfwxhgl"));
4678 mr.setPygl(rs.getDouble("pygl")); 4676 mr.setPygl(rs.getDouble("pygl"));
@@ -4765,8 +4763,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4765,8 +4763,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4765 sReport.setSjyybc(rs.getInt("sjyybc")); 4763 sReport.setSjyybc(rs.getInt("sjyybc"));
4766 sReport.setSjksbc(rs.getInt("sjksbc")); 4764 sReport.setSjksbc(rs.getInt("sjksbc"));
4767 sReport.setZbc(rs.getInt("zyybc")); 4765 sReport.setZbc(rs.getInt("zyybc"));
4768 - sReport.setZddfbc(rs.getInt("sddfbc"));  
4769 - sReport.setSddfbc(rs.getInt("zddfbc")); 4766 + sReport.setZddfbc(rs.getInt("zddfbc"));
  4767 + sReport.setSddfbc(rs.getInt("sddfbc"));
4770 sReport.setWqwxhbc(rs.getInt("wqwxhbc")); 4768 sReport.setWqwxhbc(rs.getInt("wqwxhbc"));
4771 sReport.setBfwxhbc(rs.getInt("bfwxhbc")); 4769 sReport.setBfwxhbc(rs.getInt("bfwxhbc"));
4772 sReport.setPybc(rs.getInt("pybc")); 4770 sReport.setPybc(rs.getInt("pybc"));