Commit 6d68dffa8e8ef30e86c755fa0f636ee8df40322f
Merge branch 'pudong' into jiading
# Conflicts: # src/main/java/com/bsth/controller/BusIntervalController.java # src/main/java/com/bsth/service/BusIntervalService.java # src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java # src/main/resources/ms-jdbc.properties
Showing
75 changed files
with
2558 additions
and
944 deletions
Too many changes to show.
To preserve performance only 75 of 107 files are displayed.
src/main/java/com/bsth/controller/PersonnelController.java
| @@ -36,7 +36,6 @@ public class PersonnelController extends BaseController<Personnel, Integer> { | @@ -36,7 +36,6 @@ public class PersonnelController extends BaseController<Personnel, Integer> { | ||
| 36 | 36 | ||
| 37 | @RequestMapping(value = "/all_py", method = RequestMethod.GET) | 37 | @RequestMapping(value = "/all_py", method = RequestMethod.GET) |
| 38 | public List<PersionPinYin> findAll_PY(){ | 38 | public List<PersionPinYin> findAll_PY(){ |
| 39 | - persionPinYinBuffer.refresh(); | ||
| 40 | return persionPinYinBuffer.getAll(); | 39 | return persionPinYinBuffer.getAll(); |
| 41 | } | 40 | } |
| 42 | 41 |
src/main/java/com/bsth/controller/forms/ExportController.java
| @@ -98,14 +98,14 @@ public class ExportController { | @@ -98,14 +98,14 @@ public class ExportController { | ||
| 98 | m.put("lpName", l.getLpName()); | 98 | m.put("lpName", l.getLpName()); |
| 99 | m.put("carPlate", l.getCarPlate()); | 99 | m.put("carPlate", l.getCarPlate()); |
| 100 | m.put("jhlc", l.getJhlc()); | 100 | m.put("jhlc", l.getJhlc()); |
| 101 | - // m.put("sjjhlc", l.getSjjhlc()); | 101 | + m.put("sjjhlc", l.getSjjhlc()); |
| 102 | m.put("yygl", l.getYygl()); | 102 | m.put("yygl", l.getYygl()); |
| 103 | m.put("emptMileage", l.getEmptMileage()); | 103 | m.put("emptMileage", l.getEmptMileage()); |
| 104 | m.put("remMileage", l.getRemMileage()); | 104 | m.put("remMileage", l.getRemMileage()); |
| 105 | m.put("addMileage", l.getAddMileage()); | 105 | m.put("addMileage", l.getAddMileage()); |
| 106 | m.put("totalm", l.getTotalm()); | 106 | m.put("totalm", l.getTotalm()); |
| 107 | m.put("jhbc", l.getJhbc()); | 107 | m.put("jhbc", l.getJhbc()); |
| 108 | - // m.put("sjjhbc", l.getSjjhbc()); | 108 | + m.put("sjjhbc", l.getSjjhbc()); |
| 109 | m.put("cjbc", l.getCjbc()); | 109 | m.put("cjbc", l.getCjbc()); |
| 110 | m.put("ljbc", l.getLjbc()); | 110 | m.put("ljbc", l.getLjbc()); |
| 111 | m.put("sjbc", l.getSjbc()); | 111 | m.put("sjbc", l.getSjbc()); |
| @@ -171,6 +171,51 @@ public class ExportController { | @@ -171,6 +171,51 @@ public class ExportController { | ||
| 171 | 171 | ||
| 172 | return resList; | 172 | return resList; |
| 173 | } | 173 | } |
| 174 | + | ||
| 175 | + // 班次车辆人员月统计 | ||
| 176 | + @RequestMapping(value = "/shiftuehiclemanthExport2", method = RequestMethod.GET) | ||
| 177 | + public List<Map<String, Object>> shiftuehiclemanthExport2(@RequestParam Map<String, Object> map) { | ||
| 178 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 179 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 180 | + ReportUtils ee = new ReportUtils(); | ||
| 181 | + List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth2(map); | ||
| 182 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 183 | + int i = 1; | ||
| 184 | + for (Shiftuehiclemanth l : shiftuehiclemanth) { | ||
| 185 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 186 | + m.put("i", i); | ||
| 187 | + m.put("jName", l.getjName()); | ||
| 188 | + m.put("jhlc", l.getJhlc()); | ||
| 189 | + m.put("emptMileage", l.getEmptMileage()); | ||
| 190 | + m.put("remMileage", l.getRemMileage()); | ||
| 191 | + m.put("addMileage", l.getAddMileage()); | ||
| 192 | + m.put("totalm", l.getTotalm()); | ||
| 193 | + m.put("cjbc", l.getCjbc()); | ||
| 194 | + m.put("ljbc", l.getLjbc()); | ||
| 195 | + m.put("sjbc", l.getSjbc()); | ||
| 196 | + resList.add(m); | ||
| 197 | + i++; | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + try { | ||
| 201 | + String mouldurl = null; | ||
| 202 | + if(map.get("empnames").equals("驾驶员")){ | ||
| 203 | + mouldurl="mould/shiftuehiclemanth.xls"; | ||
| 204 | + }else if(map.get("empnames").equals("售票员")){ | ||
| 205 | + mouldurl="mould/shiftuehiclemanthspy.xls"; | ||
| 206 | + }else if(map.get("empnames").equals("车辆自编号")){ | ||
| 207 | + mouldurl="mould/shiftuehiclemanthclzbh.xls"; | ||
| 208 | + } | ||
| 209 | + listI.add(resList.iterator()); | ||
| 210 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 211 | + ee.excelReplace(listI, new Object[] { map }, path +mouldurl, | ||
| 212 | + path + "export/班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | ||
| 213 | + } catch (Exception e) { | ||
| 214 | + e.printStackTrace(); | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + return resList; | ||
| 218 | + } | ||
| 174 | 219 | ||
| 175 | // 路单数据报表 | 220 | // 路单数据报表 |
| 176 | @RequestMapping(value = "/singledataExport", method = RequestMethod.GET) | 221 | @RequestMapping(value = "/singledataExport", method = RequestMethod.GET) |
| @@ -214,6 +259,49 @@ public class ExportController { | @@ -214,6 +259,49 @@ public class ExportController { | ||
| 214 | 259 | ||
| 215 | return resList; | 260 | return resList; |
| 216 | } | 261 | } |
| 262 | + | ||
| 263 | + // 路单数据报表 | ||
| 264 | + @RequestMapping(value = "/singledataExport2", method = RequestMethod.GET) | ||
| 265 | + public List<Map<String, Object>> singledataExport2(@RequestParam Map<String, Object> map) { | ||
| 266 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 267 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 268 | + ReportUtils ee = new ReportUtils(); | ||
| 269 | + List<Singledata> singledata = formsService.singledata2(map); | ||
| 270 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 271 | + int i = 1; | ||
| 272 | + for (Singledata l : singledata) { | ||
| 273 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 274 | + m.put("i", i); | ||
| 275 | + m.put("rQ", l.getrQ()); | ||
| 276 | + m.put("gS", l.getgS()); | ||
| 277 | + m.put("xL", l.getXlmc()); | ||
| 278 | + m.put("clzbh", l.getClzbh()); | ||
| 279 | + m.put("jsy", l.getJsy()); | ||
| 280 | + m.put("jName", l.getjName()); | ||
| 281 | + m.put("sgh", l.getSgh()); | ||
| 282 | + m.put("sName", l.getsName()); | ||
| 283 | + m.put("jhlc", l.getJhlc()); | ||
| 284 | + m.put("emptMileage", l.getEmptMileage()); | ||
| 285 | + m.put("hyl", l.getHyl()); | ||
| 286 | + m.put("jzl", l.getJzl()); | ||
| 287 | + m.put("unyyyl", l.getUnyyyl()); | ||
| 288 | + m.put("jhjl", l.getJhjl()); | ||
| 289 | + resList.add(m); | ||
| 290 | + | ||
| 291 | + i++; | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + try { | ||
| 295 | + listI.add(resList.iterator()); | ||
| 296 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 297 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | ||
| 298 | + path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | ||
| 299 | + } catch (Exception e) { | ||
| 300 | + e.printStackTrace(); | ||
| 301 | + } | ||
| 302 | + | ||
| 303 | + return resList; | ||
| 304 | + } | ||
| 217 | @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET) | 305 | @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET) |
| 218 | public List<Map<String, Object>> singledataExportTj(@RequestParam Map<String, Object> map) { | 306 | public List<Map<String, Object>> singledataExportTj(@RequestParam Map<String, Object> map) { |
| 219 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 307 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| @@ -255,6 +343,48 @@ public class ExportController { | @@ -255,6 +343,48 @@ public class ExportController { | ||
| 255 | 343 | ||
| 256 | return resList; | 344 | return resList; |
| 257 | } | 345 | } |
| 346 | + | ||
| 347 | + @RequestMapping(value = "/singledataExportTj2", method = RequestMethod.GET) | ||
| 348 | + public List<Map<String, Object>> singledataExportTj2(@RequestParam Map<String, Object> map) { | ||
| 349 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 350 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 351 | + ReportUtils ee = new ReportUtils(); | ||
| 352 | + List<Singledata> singledata = formsService.singledatatj2(map); | ||
| 353 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 354 | + int i = 1; | ||
| 355 | + for (Singledata l : singledata) { | ||
| 356 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 357 | + m.put("i", i); | ||
| 358 | + m.put("rQ", l.getrQ()); | ||
| 359 | + m.put("gS", l.getgS()); | ||
| 360 | + m.put("xL", l.getXlmc()); | ||
| 361 | + m.put("clzbh", l.getClzbh()); | ||
| 362 | + m.put("jsy", l.getJsy()); | ||
| 363 | + m.put("jName", l.getjName()); | ||
| 364 | + m.put("sgh", l.getSgh()); | ||
| 365 | + m.put("sName", l.getsName()); | ||
| 366 | + m.put("jhlc", l.getJhlc()); | ||
| 367 | + m.put("emptMileage", l.getEmptMileage()); | ||
| 368 | + m.put("hyl", l.getHyl()); | ||
| 369 | + m.put("jzl", l.getJzl()); | ||
| 370 | + m.put("unyyyl", l.getUnyyyl()); | ||
| 371 | + m.put("jhjl", l.getJhjl()); | ||
| 372 | + resList.add(m); | ||
| 373 | + | ||
| 374 | + i++; | ||
| 375 | + } | ||
| 376 | + | ||
| 377 | + try { | ||
| 378 | + listI.add(resList.iterator()); | ||
| 379 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 380 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | ||
| 381 | + path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | ||
| 382 | + } catch (Exception e) { | ||
| 383 | + e.printStackTrace(); | ||
| 384 | + } | ||
| 385 | + | ||
| 386 | + return resList; | ||
| 387 | + } | ||
| 258 | // 车辆加注 | 388 | // 车辆加注 |
| 259 | @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET) | 389 | @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET) |
| 260 | public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) { | 390 | public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) { |
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
| @@ -57,6 +57,13 @@ public class MCY_FormsController { | @@ -57,6 +57,13 @@ public class MCY_FormsController { | ||
| 57 | 57 | ||
| 58 | return formsService.shiftuehiclemanth(map); | 58 | return formsService.shiftuehiclemanth(map); |
| 59 | } | 59 | } |
| 60 | + | ||
| 61 | + // 班次车辆人员月报表 | ||
| 62 | + @RequestMapping(value = "/shiftuehiclemanth2", method = RequestMethod.GET) | ||
| 63 | + public List<Shiftuehiclemanth> shiftuehiclemanth2(@RequestParam Map<String, Object> map) { | ||
| 64 | + | ||
| 65 | + return formsService.shiftuehiclemanth2(map); | ||
| 66 | + } | ||
| 60 | 67 | ||
| 61 | // 班次车辆人员日统计 | 68 | // 班次车辆人员日统计 |
| 62 | @RequestMapping(value = "/shifday", method = RequestMethod.GET) | 69 | @RequestMapping(value = "/shifday", method = RequestMethod.GET) |
| @@ -80,6 +87,13 @@ public class MCY_FormsController { | @@ -80,6 +87,13 @@ public class MCY_FormsController { | ||
| 80 | } | 87 | } |
| 81 | 88 | ||
| 82 | // 路单数据 | 89 | // 路单数据 |
| 90 | + @RequestMapping(value = "/singledata2", method = RequestMethod.GET) | ||
| 91 | + public List<Singledata> singledata2(@RequestParam Map<String, Object> map) { | ||
| 92 | + | ||
| 93 | + return formsService.singledata2(map); | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + // 路单数据 | ||
| 83 | @RequestMapping(value = "/singledatanew", method = RequestMethod.GET) | 97 | @RequestMapping(value = "/singledatanew", method = RequestMethod.GET) |
| 84 | public List<Singledata> singledatanew(@RequestParam Map<String, Object> map) { | 98 | public List<Singledata> singledatanew(@RequestParam Map<String, Object> map) { |
| 85 | 99 | ||
| @@ -92,6 +106,12 @@ public class MCY_FormsController { | @@ -92,6 +106,12 @@ public class MCY_FormsController { | ||
| 92 | return formsService.singledatatj(map); | 106 | return formsService.singledatatj(map); |
| 93 | } | 107 | } |
| 94 | 108 | ||
| 109 | + | ||
| 110 | + @RequestMapping(value = "/singledatatj2", method = RequestMethod.GET) | ||
| 111 | + public List<Singledata> singledatatj2(@RequestParam Map<String, Object> map) { | ||
| 112 | + | ||
| 113 | + return formsService.singledatatj2(map); | ||
| 114 | + } | ||
| 95 | // 车辆加注 | 115 | // 车辆加注 |
| 96 | @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET) | 116 | @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET) |
| 97 | public List<Vehicleloading> vehicleloading(@RequestParam String line, @RequestParam String data) { | 117 | public List<Vehicleloading> vehicleloading(@RequestParam String line, @RequestParam String data) { |
src/main/java/com/bsth/controller/gps/GpsController.java
| @@ -84,7 +84,7 @@ public class GpsController { | @@ -84,7 +84,7 @@ public class GpsController { | ||
| 84 | @RequestMapping(value = "/gpsHistory/multiple") | 84 | @RequestMapping(value = "/gpsHistory/multiple") |
| 85 | public List<Map<String, Object>> gpsHistory(@RequestParam String[] nbbmArray, @RequestParam Long st, | 85 | public List<Map<String, Object>> gpsHistory(@RequestParam String[] nbbmArray, @RequestParam Long st, |
| 86 | @RequestParam Long et) { | 86 | @RequestParam Long et) { |
| 87 | - return gpsService.history(nbbmArray, st, et); | 87 | + return (List<Map<String, Object>>) gpsService.history(nbbmArray, st, et).get("list"); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | /*@RequestMapping(value = "/analyse/ram") | 90 | /*@RequestMapping(value = "/analyse/ram") |
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
| @@ -4,6 +4,8 @@ import com.alibaba.fastjson.serializer.PropertyFilter; | @@ -4,6 +4,8 @@ import com.alibaba.fastjson.serializer.PropertyFilter; | ||
| 4 | import com.bsth.common.ResponseCode; | 4 | import com.bsth.common.ResponseCode; |
| 5 | import com.bsth.data.BasicData; | 5 | import com.bsth.data.BasicData; |
| 6 | import com.bsth.data.Station2ParkBuffer; | 6 | import com.bsth.data.Station2ParkBuffer; |
| 7 | +import com.bsth.data.pinyin.PersionPinYin; | ||
| 8 | +import com.bsth.data.pinyin.PersionPinYinBuffer; | ||
| 7 | import com.bsth.entity.Line; | 9 | import com.bsth.entity.Line; |
| 8 | import com.bsth.entity.realcontrol.StationToPark; | 10 | import com.bsth.entity.realcontrol.StationToPark; |
| 9 | import com.google.common.base.Splitter; | 11 | import com.google.common.base.Splitter; |
| @@ -33,6 +35,9 @@ public class BasicDataController { | @@ -33,6 +35,9 @@ public class BasicDataController { | ||
| 33 | 35 | ||
| 34 | @Autowired | 36 | @Autowired |
| 35 | Station2ParkBuffer station2ParkBuffer; | 37 | Station2ParkBuffer station2ParkBuffer; |
| 38 | + | ||
| 39 | + @Autowired | ||
| 40 | + PersionPinYinBuffer persionPinYinBuffer; | ||
| 36 | 41 | ||
| 37 | @RequestMapping("/cars") | 42 | @RequestMapping("/cars") |
| 38 | public Iterable<String> findAllNbbm(Map<String, Object> map){ | 43 | public Iterable<String> findAllNbbm(Map<String, Object> map){ |
| @@ -69,6 +74,11 @@ public class BasicDataController { | @@ -69,6 +74,11 @@ public class BasicDataController { | ||
| 69 | rs.put("spy", JSON.parse(JSON.toJSONString(BasicData.spyMap.values(), filter)));*//* | 74 | rs.put("spy", JSON.parse(JSON.toJSONString(BasicData.spyMap.values(), filter)));*//* |
| 70 | return rs; | 75 | return rs; |
| 71 | }*/ | 76 | }*/ |
| 77 | + | ||
| 78 | + @RequestMapping(value = "/all_personnel_py", method = RequestMethod.GET) | ||
| 79 | + public List<PersionPinYin> findAll_PY(){ | ||
| 80 | + return persionPinYinBuffer.getAll(); | ||
| 81 | + } | ||
| 72 | 82 | ||
| 73 | @RequestMapping("/all_personnel") | 83 | @RequestMapping("/all_personnel") |
| 74 | public Map<String, String> all_personnel(){ | 84 | public Map<String, String> all_personnel(){ |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -553,7 +553,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -553,7 +553,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 553 | 553 | ||
| 554 | long t = System.currentTimeMillis(); | 554 | long t = System.currentTimeMillis(); |
| 555 | if(c != 1) | 555 | if(c != 1) |
| 556 | - t -= (ONE_DAY + (1000 * 60 * 60 * 2)); | 556 | + t -= (ONE_DAY + (1000 * 60 * 60 * 6)); |
| 557 | for(int i = 0; i < 3; i ++){ | 557 | for(int i = 0; i < 3; i ++){ |
| 558 | rs.add(fmtyyyyMMdd.print(t)); | 558 | rs.add(fmtyyyyMMdd.print(t)); |
| 559 | t -= ONE_DAY; | 559 | t -= ONE_DAY; |
src/main/java/com/bsth/controller/realcontrol/calc/ReCalcDataController.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol.calc; | ||
| 2 | + | ||
| 3 | +import com.bsth.common.ResponseCode; | ||
| 4 | +import com.bsth.util.HttpClientUtils; | ||
| 5 | +import org.slf4j.Logger; | ||
| 6 | +import org.slf4j.LoggerFactory; | ||
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 8 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 10 | +import org.springframework.web.bind.annotation.RestController; | ||
| 11 | + | ||
| 12 | +import java.util.HashMap; | ||
| 13 | +import java.util.Map; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 重新统计(数据汇总) | ||
| 17 | + * Created by panzhao on 2018/1/25. | ||
| 18 | + */ | ||
| 19 | +@RestController | ||
| 20 | +@RequestMapping("/sch/reCalc") | ||
| 21 | +public class ReCalcDataController { | ||
| 22 | + | ||
| 23 | + private static String reCalcUrl = "http://10.10.150.24:30571/reCalc/scheduleDetail"; | ||
| 24 | + | ||
| 25 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 重新统计班次明细 | ||
| 29 | + * @param date | ||
| 30 | + * @param line | ||
| 31 | + * @return | ||
| 32 | + */ | ||
| 33 | + @RequestMapping(value = "/scheduleDetail", method = RequestMethod.POST) | ||
| 34 | + public Map<String, Object> reCalcScheduleDetail(@RequestParam String date, @RequestParam String line){ | ||
| 35 | + Map<String, Object> rs = new HashMap(); | ||
| 36 | + try{ | ||
| 37 | + HttpClientUtils.post(reCalcUrl + "?rq=" + date + "&lineCode=" + line, ""); | ||
| 38 | + }catch (Exception e){ | ||
| 39 | + logger.error("", e); | ||
| 40 | + rs.put("status", ResponseCode.ERROR); | ||
| 41 | + rs.put("msg", e.getMessage()); | ||
| 42 | + } | ||
| 43 | + return rs; | ||
| 44 | + } | ||
| 45 | +} |
src/main/java/com/bsth/controller/schedule/TrafficManageController.java
| @@ -111,6 +111,15 @@ public class TrafficManageController { | @@ -111,6 +111,15 @@ public class TrafficManageController { | ||
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | + @RequestMapping(value = "/setJHBCByDate", method = RequestMethod.GET) | ||
| 115 | + public String setJHBCByDate(@RequestParam("theDate") String theDate) throws Exception { | ||
| 116 | + try { | ||
| 117 | + return trManageService.setJHBC(theDate); | ||
| 118 | + } catch (Exception exp) { | ||
| 119 | + throw new Exception(exp.getCause()); | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + | ||
| 114 | @RequestMapping(value = "/setSKB", method = RequestMethod.GET) | 123 | @RequestMapping(value = "/setSKB", method = RequestMethod.GET) |
| 115 | public String setSKB(@RequestParam("ids") String ids) throws Exception { | 124 | public String setSKB(@RequestParam("ids") String ids) throws Exception { |
| 116 | try { | 125 | try { |
src/main/java/com/bsth/controller/traffic/VehicleInoutStopController.java
| @@ -2,7 +2,10 @@ package com.bsth.controller.traffic; | @@ -2,7 +2,10 @@ package com.bsth.controller.traffic; | ||
| 2 | 2 | ||
| 3 | import com.bsth.controller.BaseController; | 3 | import com.bsth.controller.BaseController; |
| 4 | import com.bsth.entity.traffic.VehicleInoutStop; | 4 | import com.bsth.entity.traffic.VehicleInoutStop; |
| 5 | +import com.bsth.service.impl.TrafficManageServiceImpl; | ||
| 5 | import com.bsth.service.traffic.VehicleInoutStopService; | 6 | import com.bsth.service.traffic.VehicleInoutStopService; |
| 7 | +import org.slf4j.Logger; | ||
| 8 | +import org.slf4j.LoggerFactory; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.data.domain.Page; | 10 | import org.springframework.data.domain.Page; |
| 8 | import org.springframework.data.domain.PageImpl; | 11 | import org.springframework.data.domain.PageImpl; |
| @@ -21,6 +24,7 @@ import java.util.Map; | @@ -21,6 +24,7 @@ import java.util.Map; | ||
| 21 | @RestController | 24 | @RestController |
| 22 | @RequestMapping("vehicle_stop") | 25 | @RequestMapping("vehicle_stop") |
| 23 | public class VehicleInoutStopController extends BaseController<VehicleInoutStop,Integer> { | 26 | public class VehicleInoutStopController extends BaseController<VehicleInoutStop,Integer> { |
| 27 | + Logger logger = LoggerFactory.getLogger(TrafficManageServiceImpl.class); | ||
| 24 | 28 | ||
| 25 | @Autowired | 29 | @Autowired |
| 26 | VehicleInoutStopService vehicleInoutStopService; | 30 | VehicleInoutStopService vehicleInoutStopService; |
| @@ -36,11 +40,18 @@ public class VehicleInoutStopController extends BaseController<VehicleInoutStop, | @@ -36,11 +40,18 @@ public class VehicleInoutStopController extends BaseController<VehicleInoutStop, | ||
| 36 | public Page<Map<String, Object>> getVehicleInoutStopByParam(@RequestParam Map<String, Object> map, | 40 | public Page<Map<String, Object>> getVehicleInoutStopByParam(@RequestParam Map<String, Object> map, |
| 37 | @RequestParam(defaultValue = "0") int page, | 41 | @RequestParam(defaultValue = "0") int page, |
| 38 | @RequestParam(defaultValue = "10") int size) { | 42 | @RequestParam(defaultValue = "10") int size) { |
| 39 | - map.put("page",page); | ||
| 40 | - map.put("size",size); | ||
| 41 | - long total = vehicleInoutStopService.getVehicleInoutStopCountByParam(map); | ||
| 42 | - Page<Map<String, Object>> result = new PageImpl<>(vehicleInoutStopService.getVehicleInoutStopByParam(map), | ||
| 43 | - new PageRequest(page, size, null),total); | 43 | + Page<Map<String, Object>> result = null; |
| 44 | + try { | ||
| 45 | + map.put("page",page); | ||
| 46 | + map.put("size",size); | ||
| 47 | + long total = vehicleInoutStopService.getVehicleInoutStopCountByParam(map); | ||
| 48 | + result = new PageImpl<>(vehicleInoutStopService.getVehicleInoutStopByParam(map), | ||
| 49 | + new PageRequest(page, size, null),total); | ||
| 50 | + }catch (Exception e){ | ||
| 51 | + logger.error("车载上报停靠站查询出错:",e); | ||
| 52 | + e.printStackTrace(); | ||
| 53 | + } | ||
| 54 | + | ||
| 44 | return result; | 55 | return result; |
| 45 | } | 56 | } |
| 46 | } | 57 | } |
src/main/java/com/bsth/data/LineVersionsData.java
| 1 | package com.bsth.data; | 1 | package com.bsth.data; |
| 2 | 2 | ||
| 3 | -import java.util.HashMap; | ||
| 4 | -import java.util.List; | ||
| 5 | -import java.util.Map; | ||
| 6 | - | 3 | +import com.bsth.entity.LineVersions; |
| 4 | +import com.bsth.service.LineVersionsService; | ||
| 5 | +import com.bsth.service.StationRouteService; | ||
| 7 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| 8 | import org.slf4j.LoggerFactory; | 7 | import org.slf4j.LoggerFactory; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | -import org.springframework.boot.CommandLineRunner; | ||
| 11 | import org.springframework.core.annotation.Order; | 9 | import org.springframework.core.annotation.Order; |
| 12 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| 13 | 11 | ||
| 14 | -import com.bsth.entity.LineVersions; | ||
| 15 | -import com.bsth.service.LineVersionsService; | ||
| 16 | -import com.bsth.service.StationRouteService; | 12 | +import java.util.HashMap; |
| 13 | +import java.util.List; | ||
| 14 | +import java.util.Map; | ||
| 17 | 15 | ||
| 18 | /** | 16 | /** |
| 19 | * @ClassName: LineVersionsData | 17 | * @ClassName: LineVersionsData |
| @@ -25,10 +23,9 @@ public class LineVersionsData extends Thread { | @@ -25,10 +23,9 @@ public class LineVersionsData extends Thread { | ||
| 25 | 23 | ||
| 26 | static Logger logger = LoggerFactory.getLogger(LineVersionsData.class); | 24 | static Logger logger = LoggerFactory.getLogger(LineVersionsData.class); |
| 27 | 25 | ||
| 28 | - | ||
| 29 | @Autowired | 26 | @Autowired |
| 30 | LineVersionsService lineVersionsService; | 27 | LineVersionsService lineVersionsService; |
| 31 | - | 28 | + |
| 32 | @Autowired | 29 | @Autowired |
| 33 | StationRouteService stationRouteService; | 30 | StationRouteService stationRouteService; |
| 34 | 31 |
src/main/java/com/bsth/data/directive/DirectivesPstThread.java
| @@ -45,7 +45,10 @@ public class DirectivesPstThread extends Thread { | @@ -45,7 +45,10 @@ public class DirectivesPstThread extends Thread { | ||
| 45 | for (int i = 0; i < 1000; i++) { | 45 | for (int i = 0; i < 1000; i++) { |
| 46 | try { | 46 | try { |
| 47 | directive = list.poll(); | 47 | directive = list.poll(); |
| 48 | - | 48 | + if(null == directive) |
| 49 | + break; | ||
| 50 | + //日期 | ||
| 51 | + directive.setRq(fmtyyyyMMdd.print(directive.getTimestamp())); | ||
| 49 | if (directive instanceof D60) { | 52 | if (directive instanceof D60) { |
| 50 | D60 d60 = (D60) directive; | 53 | D60 d60 = (D60) directive; |
| 51 | if(d60.isDispatch()){ | 54 | if(d60.isDispatch()){ |
| @@ -56,8 +59,6 @@ public class DirectivesPstThread extends Thread { | @@ -56,8 +59,6 @@ public class DirectivesPstThread extends Thread { | ||
| 56 | continue; | 59 | continue; |
| 57 | } | 60 | } |
| 58 | } | 61 | } |
| 59 | - //日期 | ||
| 60 | - d60.setRq(fmtyyyyMMdd.print(d60.getTimestamp())); | ||
| 61 | d60Repository.save(d60); | 62 | d60Repository.save(d60); |
| 62 | } | 63 | } |
| 63 | 64 |
src/main/java/com/bsth/data/directive/GatewayHttpUtils.java
| @@ -12,61 +12,58 @@ import org.apache.http.util.EntityUtils; | @@ -12,61 +12,58 @@ import org.apache.http.util.EntityUtils; | ||
| 12 | import org.slf4j.Logger; | 12 | import org.slf4j.Logger; |
| 13 | import org.slf4j.LoggerFactory; | 13 | import org.slf4j.LoggerFactory; |
| 14 | 14 | ||
| 15 | -import java.io.IOException; | ||
| 16 | - | ||
| 17 | /** | 15 | /** |
| 18 | - * | ||
| 19 | - * @ClassName: GatewayHttpUtils | ||
| 20 | - * @Description: TODO(和网关HTTP通讯工具类) | ||
| 21 | * @author PanZhao | 16 | * @author PanZhao |
| 22 | - * @date 2016年8月14日 下午9:50:46 | ||
| 23 | - * | 17 | + * @ClassName: GatewayHttpUtils |
| 18 | + * @Description: TODO(和网关HTTP通讯工具类) | ||
| 19 | + * @date 2016年8月14日 下午9:50:46 | ||
| 24 | */ | 20 | */ |
| 25 | public class GatewayHttpUtils { | 21 | public class GatewayHttpUtils { |
| 26 | - static Logger logger = LoggerFactory.getLogger(GatewayHttpUtils.class); | ||
| 27 | - | ||
| 28 | - static String url; | ||
| 29 | - | ||
| 30 | - static{ | ||
| 31 | - url = ConfigUtil.get("http.send.directive"); | ||
| 32 | - } | ||
| 33 | - | ||
| 34 | - public static int postJson(String jsonStr){ | ||
| 35 | - logger.info("send : " + jsonStr); | ||
| 36 | - | ||
| 37 | - CloseableHttpClient httpClient = null; | ||
| 38 | - int code = -1; | ||
| 39 | - try{ | ||
| 40 | - httpClient = HttpClients.createDefault(); | ||
| 41 | - | ||
| 42 | - //超时时间 | ||
| 43 | - RequestConfig requestConfig = RequestConfig.custom() | ||
| 44 | - .setConnectTimeout(1500).setConnectionRequestTimeout(1000) | ||
| 45 | - .setSocketTimeout(1500).build(); | ||
| 46 | - | ||
| 47 | - HttpPost post = new HttpPost(url); | ||
| 48 | - | ||
| 49 | - post.setConfig(requestConfig); | ||
| 50 | - | ||
| 51 | - post.setEntity(new StringEntity(jsonStr, "utf-8")); | ||
| 52 | - | ||
| 53 | - CloseableHttpResponse response = httpClient.execute(post); | 22 | + static Logger logger = LoggerFactory.getLogger(GatewayHttpUtils.class); |
| 23 | + | ||
| 24 | + static String url; | ||
| 25 | + static CloseableHttpClient httpClient = null; | ||
| 26 | + static HttpPost post; | ||
| 27 | + static RequestConfig requestConfig; | ||
| 28 | + static CloseableHttpResponse response; | ||
| 29 | + | ||
| 30 | + static { | ||
| 31 | + url = ConfigUtil.get("http.send.directive"); | ||
| 32 | + httpClient = HttpClients.createDefault(); | ||
| 33 | + post = new HttpPost(url); | ||
| 34 | + requestConfig = RequestConfig.custom() | ||
| 35 | + .setConnectTimeout(2000).setConnectionRequestTimeout(1000) | ||
| 36 | + .setSocketTimeout(2000).build(); | ||
| 37 | + post.setConfig(requestConfig); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + public static int postJson(String jsonStr) { | ||
| 41 | + logger.info("send : " + jsonStr); | ||
| 42 | + | ||
| 43 | + int code = -1; | ||
| 44 | + try { | ||
| 45 | + post.setEntity(new StringEntity(jsonStr, "utf-8")); | ||
| 46 | + | ||
| 47 | + response = httpClient.execute(post); | ||
| 48 | + | ||
| 49 | + int statusCode = response.getStatusLine().getStatusCode(); | ||
| 50 | + if(statusCode != 200){ | ||
| 51 | + //post.abort(); | ||
| 52 | + logger.error("http client status code: " + statusCode); | ||
| 53 | + //return code; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); | ||
| 57 | + if (null != json && json.getInteger("errCode") == 0) | ||
| 58 | + code = 0; | ||
| 59 | + else | ||
| 60 | + logger.error("和网关http通讯失败,rs: " + json); | ||
| 54 | 61 | ||
| 55 | - JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); | ||
| 56 | - if(null != json && json.getInteger("errCode") == 0) | ||
| 57 | - code = 0; | ||
| 58 | - else | ||
| 59 | - logger.error("和网关http通讯失败,rs: " + json); | ||
| 60 | - }catch(Exception e){ | ||
| 61 | - logger.error("", e); | ||
| 62 | - }finally { | ||
| 63 | - try { | ||
| 64 | - if(httpClient != null) | ||
| 65 | - httpClient.close(); | ||
| 66 | - } catch (IOException e) { | ||
| 67 | - logger.error("", e); | ||
| 68 | - } | ||
| 69 | - } | ||
| 70 | - return code; | ||
| 71 | - } | 62 | + if (null != response) |
| 63 | + response.close(); | ||
| 64 | + } catch (Exception e) { | ||
| 65 | + logger.error("", e); | ||
| 66 | + } | ||
| 67 | + return code; | ||
| 68 | + } | ||
| 72 | } | 69 | } |
src/main/java/com/bsth/data/gpsdata_v2/DataHandleProcess.java
| @@ -67,6 +67,8 @@ public class DataHandleProcess { | @@ -67,6 +67,8 @@ public class DataHandleProcess { | ||
| 67 | //数据均分给线程 | 67 | //数据均分给线程 |
| 68 | ArrayListMultimap dataListMap = ArrayListMultimap.create(); | 68 | ArrayListMultimap dataListMap = ArrayListMultimap.create(); |
| 69 | int size = deviceList.size(), threadIndex = 0, threadSize = size / POOL_SIZE; | 69 | int size = deviceList.size(), threadIndex = 0, threadSize = size / POOL_SIZE; |
| 70 | + if(threadSize==0) | ||
| 71 | + threadSize = size; | ||
| 70 | for (int i = 0; i < size; i++) { | 72 | for (int i = 0; i < size; i++) { |
| 71 | if (i % threadSize == 0) | 73 | if (i % threadSize == 0) |
| 72 | threadIndex++; | 74 | threadIndex++; |
| @@ -78,7 +80,6 @@ public class DataHandleProcess { | @@ -78,7 +80,6 @@ public class DataHandleProcess { | ||
| 78 | 80 | ||
| 79 | logger.info(JSON.toJSONString(ks)); | 81 | logger.info(JSON.toJSONString(ks)); |
| 80 | for (Integer index : ks) { | 82 | for (Integer index : ks) { |
| 81 | - //logger.info("execute index: " + index); | ||
| 82 | threadPool.execute(new SignalHandleThread(dataListMap.get(index), count)); | 83 | threadPool.execute(new SignalHandleThread(dataListMap.get(index), count)); |
| 83 | } | 84 | } |
| 84 | 85 | ||
| @@ -112,13 +113,10 @@ public class DataHandleProcess { | @@ -112,13 +113,10 @@ public class DataHandleProcess { | ||
| 112 | public void run() { | 113 | public void run() { |
| 113 | try { | 114 | try { |
| 114 | Collections.sort(list, comp); | 115 | Collections.sort(list, comp); |
| 115 | - //logger.info("sort end --" + Thread.currentThread().getName() + " -list size: " + list.size()); | ||
| 116 | - | ||
| 117 | GpsEntity gps; | 116 | GpsEntity gps; |
| 118 | for(int i = 0,len = list.size(); i< len ;i ++){ | 117 | for(int i = 0,len = list.size(); i< len ;i ++){ |
| 119 | gps = list.get(i); | 118 | gps = list.get(i); |
| 120 | 119 | ||
| 121 | - //logger.info("run |--" + Thread.currentThread().getName() + " -i: " + i); | ||
| 122 | try { | 120 | try { |
| 123 | if (StringUtils.isEmpty(gps.getNbbm())) | 121 | if (StringUtils.isEmpty(gps.getNbbm())) |
| 124 | continue; | 122 | continue; |
| @@ -134,20 +132,14 @@ public class DataHandleProcess { | @@ -134,20 +132,14 @@ public class DataHandleProcess { | ||
| 134 | outStationProcess.process(gps);//出站 | 132 | outStationProcess.process(gps);//出站 |
| 135 | 133 | ||
| 136 | 134 | ||
| 137 | - //logger.info("put start --" + Thread.currentThread().getName() + " -i: " + i); | ||
| 138 | GpsCacheData.putGps(gps);//历史gps缓存 | 135 | GpsCacheData.putGps(gps);//历史gps缓存 |
| 139 | - //logger.info("put end --" + Thread.currentThread().getName() + " -i: " + i); | ||
| 140 | } catch (Throwable e) { | 136 | } catch (Throwable e) { |
| 141 | logger.error("", e); | 137 | logger.error("", e); |
| 142 | } | 138 | } |
| 143 | } | 139 | } |
| 144 | - | ||
| 145 | - //logger.info("for end --" + Thread.currentThread().getName() + " -list size: " + list.size()); | ||
| 146 | - | ||
| 147 | } finally { | 140 | } finally { |
| 148 | if (count != null) | 141 | if (count != null) |
| 149 | count.countDown(); | 142 | count.countDown(); |
| 150 | - //logger.info(Thread.currentThread().getName() + " -countDown : " + count.getCount()); | ||
| 151 | } | 143 | } |
| 152 | } | 144 | } |
| 153 | } | 145 | } |
src/main/java/com/bsth/data/gpsdata_v2/GpsRealData.java
| @@ -148,8 +148,6 @@ public class GpsRealData { | @@ -148,8 +148,6 @@ public class GpsRealData { | ||
| 148 | gps.setRemark("执行 " + sch.getXlName() + " " + sch.getDfsj() + " 班次"); | 148 | gps.setRemark("执行 " + sch.getXlName() + " " + sch.getDfsj() + " 班次"); |
| 149 | gps.setPlanCode(sch.getXlBm()); | 149 | gps.setPlanCode(sch.getXlBm()); |
| 150 | } | 150 | } |
| 151 | - else | ||
| 152 | - gps.setRemark(null); | ||
| 153 | }else | 151 | }else |
| 154 | gps.setRemark(null); | 152 | gps.setRemark(null); |
| 155 | 153 |
src/main/java/com/bsth/data/gpsdata_v2/handlers/GpsStateProcess.java
| @@ -28,15 +28,15 @@ public class GpsStateProcess { | @@ -28,15 +28,15 @@ public class GpsStateProcess { | ||
| 28 | return; | 28 | return; |
| 29 | 29 | ||
| 30 | byte upDown = Byte.parseByte(sch.getXlDir()); | 30 | byte upDown = Byte.parseByte(sch.getXlDir()); |
| 31 | + int schState = dayOfSchedule.emptyService(sch)?1:0; | ||
| 31 | 32 | ||
| 32 | - if (gps.getUpDown() != upDown) { | ||
| 33 | - gps.setUpDown(upDown);//修正走向 | 33 | + if(gps.getState() != schState || gps.getUpDown() != upDown){ |
| 34 | + //下发指令纠正车载的 营运状态 和 走向 | ||
| 35 | + gpsStatusManager.changeServiceState(gps.getNbbm(), upDown, schState, "同步@系统"); | ||
| 34 | } | 36 | } |
| 35 | 37 | ||
| 36 | - if ((!gps.isService() || gps.getUpDown() != upDown) && | ||
| 37 | - !dayOfSchedule.emptyService(sch)) { | ||
| 38 | - //下发指令纠正车载的 营运状态 和 走向 | ||
| 39 | - gpsStatusManager.changeServiceState(gps.getNbbm(), upDown, 0, "同步@系统"); | 38 | + if (gps.getUpDown() != upDown) { |
| 39 | + gps.setUpDown(upDown);//修正走向 | ||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | if (!sch.getXlBm().equals(gps.getLineId())) { | 42 | if (!sch.getXlBm().equals(gps.getLineId())) { |
src/main/java/com/bsth/data/gpsdata_v2/handlers/InStationProcess.java
| @@ -164,19 +164,23 @@ public class InStationProcess { | @@ -164,19 +164,23 @@ public class InStationProcess { | ||
| 164 | //将gps转换成下一个班次走向的站内信号(应对只有一个站内信号 即 发出时) | 164 | //将gps转换成下一个班次走向的站内信号(应对只有一个站内信号 即 发出时) |
| 165 | transformUpDown(gps, next); | 165 | transformUpDown(gps, next); |
| 166 | 166 | ||
| 167 | - //下发调度指令 | ||
| 168 | - DirectivePushQueue.put6002(next, doneSum, "到站@系统"); | ||
| 169 | - | ||
| 170 | //套跑 -下发线路切换指令 | 167 | //套跑 -下发线路切换指令 |
| 171 | if (null != next && !next.getXlBm().equals(sch.getXlBm())) { | 168 | if (null != next && !next.getXlBm().equals(sch.getXlBm())) { |
| 172 | gpsStatusManager.changeLine(next.getClZbh(), next.getXlBm(), "套跑@系统"); | 169 | gpsStatusManager.changeLine(next.getClZbh(), next.getXlBm(), "套跑@系统"); |
| 173 | } | 170 | } |
| 174 | 171 | ||
| 172 | + /** | ||
| 173 | + * 注意: | ||
| 174 | + * 要先发运营指令,再发调度指令 | ||
| 175 | + */ | ||
| 176 | + if(null == next && gps.isService()){ | ||
| 177 | + nonService(sch, "结束@系统");//营运结束 | ||
| 178 | + } | ||
| 179 | + //下发运营指令 | ||
| 180 | + DirectivePushQueue.put6003(next, "到站@系统"); | ||
| 175 | 181 | ||
| 176 | - if (null == next && gps.isService()) | ||
| 177 | - nonService(sch, "结束@系统");//班次结束 | ||
| 178 | - else if (null != next && dayOfSchedule.emptyService(next)) | ||
| 179 | - nonService(sch, "空驶@系统");//下一班非营运 | 182 | + //下发调度指令 |
| 183 | + DirectivePushQueue.put6002(next, doneSum, "到站@系统", ""); | ||
| 180 | } | 184 | } |
| 181 | 185 | ||
| 182 | /** | 186 | /** |
src/main/java/com/bsth/data/gpsdata_v2/handlers/OutStationProcess.java
| @@ -116,9 +116,9 @@ public class OutStationProcess { | @@ -116,9 +116,9 @@ public class OutStationProcess { | ||
| 116 | LateAdjustHandle.remove(sch); | 116 | LateAdjustHandle.remove(sch); |
| 117 | 117 | ||
| 118 | //发车的时候,同步一下状态 | 118 | //发车的时候,同步一下状态 |
| 119 | - if (!gps.isService() && !dayOfSchedule.emptyService(sch)) | 119 | + /*if (!gps.isService() && !dayOfSchedule.emptyService(sch)) |
| 120 | gpsStatusManager.changeServiceState(sch.getClZbh(), sch.getXlDir(), 0, "发车@系统"); | 120 | gpsStatusManager.changeServiceState(sch.getClZbh(), sch.getXlDir(), 0, "发车@系统"); |
| 121 | - | 121 | +*/ |
| 122 | logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); | 122 | logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); |
| 123 | } | 123 | } |
| 124 | 124 |
src/main/java/com/bsth/data/gpsdata_v2/rfid/handle/RfidSignalHandle.java
| @@ -123,7 +123,7 @@ public class RfidSignalHandle { | @@ -123,7 +123,7 @@ public class RfidSignalHandle { | ||
| 123 | logger.info("RFID; 车辆:" + nbbm + " 班次:" + sch.getDfsj() + "到终点, 时间:" + sch.getZdsjActual()); | 123 | logger.info("RFID; 车辆:" + nbbm + " 班次:" + sch.getDfsj() + "到终点, 时间:" + sch.getZdsjActual()); |
| 124 | 124 | ||
| 125 | //下发调度指令 | 125 | //下发调度指令 |
| 126 | - DirectivePushQueue.put6002(next, doneSum, "rfid@系统"); | 126 | + DirectivePushQueue.put6002(next, doneSum, "rfid@系统", ""); |
| 127 | 127 | ||
| 128 | //套跑 -下发线路切换指令 | 128 | //套跑 -下发线路切换指令 |
| 129 | if(null != next && !next.getXlBm().equals(sch.getXlBm())){ | 129 | if(null != next && !next.getXlBm().equals(sch.getXlBm())){ |
src/main/java/com/bsth/data/gpsdata_v2/status_manager/gps_service_state/ServiceStateHandle.java
| @@ -11,6 +11,7 @@ import org.springframework.stereotype.Component; | @@ -11,6 +11,7 @@ import org.springframework.stereotype.Component; | ||
| 11 | 11 | ||
| 12 | import java.util.Collection; | 12 | import java.util.Collection; |
| 13 | import java.util.concurrent.ConcurrentHashMap; | 13 | import java.util.concurrent.ConcurrentHashMap; |
| 14 | +import java.util.concurrent.ConcurrentMap; | ||
| 14 | 15 | ||
| 15 | /** | 16 | /** |
| 16 | * 设备营运状态/上下行 处理 | 17 | * 设备营运状态/上下行 处理 |
| @@ -19,7 +20,7 @@ import java.util.concurrent.ConcurrentHashMap; | @@ -19,7 +20,7 @@ import java.util.concurrent.ConcurrentHashMap; | ||
| 19 | @Component | 20 | @Component |
| 20 | public class ServiceStateHandle { | 21 | public class ServiceStateHandle { |
| 21 | 22 | ||
| 22 | - private static ConcurrentHashMap<String, StateBean> map; | 23 | + private static ConcurrentMap<String, StateBean> map; |
| 23 | 24 | ||
| 24 | @Autowired | 25 | @Autowired |
| 25 | DirectiveService directiveService; | 26 | DirectiveService directiveService; |
| @@ -41,7 +42,11 @@ public class ServiceStateHandle { | @@ -41,7 +42,11 @@ public class ServiceStateHandle { | ||
| 41 | 42 | ||
| 42 | public void changeState(String nbbm, int upDown ,int state, String sender){ | 43 | public void changeState(String nbbm, int upDown ,int state, String sender){ |
| 43 | if(map.containsKey(nbbm)){ | 44 | if(map.containsKey(nbbm)){ |
| 44 | - return; | 45 | + StateBean sb = map.get(nbbm); |
| 46 | + if(sb.getUpDown()==upDown && sb.getState()==state) | ||
| 47 | + return; | ||
| 48 | + else | ||
| 49 | + map.remove(nbbm); | ||
| 45 | } | 50 | } |
| 46 | StateBean sb = StateBean.getInstance(nbbm, upDown, state, sender); | 51 | StateBean sb = StateBean.getInstance(nbbm, upDown, state, sender); |
| 47 | map.put(nbbm, sb); | 52 | map.put(nbbm, sb); |
src/main/java/com/bsth/data/msg_queue/DirectivePushQueue.java
| 1 | package com.bsth.data.msg_queue; | 1 | package com.bsth.data.msg_queue; |
| 2 | 2 | ||
| 3 | +import com.bsth.data.schedule.DayOfSchedule; | ||
| 3 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 4 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 4 | import com.bsth.service.directive.DirectiveService; | 5 | import com.bsth.service.directive.DirectiveService; |
| 5 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| @@ -9,7 +10,9 @@ import org.springframework.context.ApplicationContext; | @@ -9,7 +10,9 @@ import org.springframework.context.ApplicationContext; | ||
| 9 | import org.springframework.context.ApplicationContextAware; | 10 | import org.springframework.context.ApplicationContextAware; |
| 10 | import org.springframework.stereotype.Component; | 11 | import org.springframework.stereotype.Component; |
| 11 | 12 | ||
| 13 | +import java.util.concurrent.ConcurrentHashMap; | ||
| 12 | import java.util.concurrent.ConcurrentLinkedQueue; | 14 | import java.util.concurrent.ConcurrentLinkedQueue; |
| 15 | +import java.util.concurrent.ConcurrentMap; | ||
| 13 | 16 | ||
| 14 | /** | 17 | /** |
| 15 | * 到网关的指令推送队列 (系统发送的队列, 用户手动发送的不走这里) | 18 | * 到网关的指令推送队列 (系统发送的队列, 用户手动发送的不走这里) |
| @@ -22,13 +25,23 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -22,13 +25,23 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 22 | static DataPushThread thread; | 25 | static DataPushThread thread; |
| 23 | static DirectiveService directiveService; | 26 | static DirectiveService directiveService; |
| 24 | static long t; | 27 | static long t; |
| 25 | - static final int IDLE_TIME = 1000 * 30; | 28 | + |
| 29 | + /** | ||
| 30 | + * 下发运营指令6003的最小间隔时间 | ||
| 31 | + */ | ||
| 32 | + static final int MIN_SEND6003_SPACE = 1000 * 30; | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * 车辆 ——> 上次下发6003的时间 | ||
| 36 | + */ | ||
| 37 | + static ConcurrentMap<String, Long> lastSend6003Map; | ||
| 26 | 38 | ||
| 27 | static { | 39 | static { |
| 28 | linkedList = new ConcurrentLinkedQueue<>(); | 40 | linkedList = new ConcurrentLinkedQueue<>(); |
| 41 | + lastSend6003Map = new ConcurrentHashMap<>(); | ||
| 29 | } | 42 | } |
| 30 | 43 | ||
| 31 | - public static void put6002(ScheduleRealInfo sch, int finish, String sender){ | 44 | + public static void put6002(ScheduleRealInfo sch, int finish, String sender, String txtPrefix){ |
| 32 | if(null == sch) | 45 | if(null == sch) |
| 33 | return; | 46 | return; |
| 34 | QueueData_Directive qd6002 = new QueueData_Directive(); | 47 | QueueData_Directive qd6002 = new QueueData_Directive(); |
| @@ -36,21 +49,36 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -36,21 +49,36 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 36 | qd6002.setFinish(finish); | 49 | qd6002.setFinish(finish); |
| 37 | qd6002.setSender(sender); | 50 | qd6002.setSender(sender); |
| 38 | qd6002.setCode("60_02"); | 51 | qd6002.setCode("60_02"); |
| 52 | + qd6002.setTxtPrefix(txtPrefix); | ||
| 39 | 53 | ||
| 40 | linkedList.add(qd6002); | 54 | linkedList.add(qd6002); |
| 41 | } | 55 | } |
| 42 | 56 | ||
| 43 | public static void put6003(String nbbm, int state, int upDown, String sender){ | 57 | public static void put6003(String nbbm, int state, int upDown, String sender){ |
| 58 | + long t = System.currentTimeMillis(); | ||
| 59 | + if(lastSend6003Map.containsKey(nbbm) | ||
| 60 | + && t - lastSend6003Map.get(nbbm) < MIN_SEND6003_SPACE) | ||
| 61 | + return; //最短下发间隔 | ||
| 62 | + | ||
| 44 | QueueData_Directive qd6003 = new QueueData_Directive(); | 63 | QueueData_Directive qd6003 = new QueueData_Directive(); |
| 45 | qd6003.setNbbm(nbbm); | 64 | qd6003.setNbbm(nbbm); |
| 46 | qd6003.setState(state); | 65 | qd6003.setState(state); |
| 47 | qd6003.setUpDown(upDown); | 66 | qd6003.setUpDown(upDown); |
| 48 | - //qd6003.setSch(sch); | ||
| 49 | qd6003.setSender(sender); | 67 | qd6003.setSender(sender); |
| 50 | - | ||
| 51 | qd6003.setCode("60_03"); | 68 | qd6003.setCode("60_03"); |
| 52 | 69 | ||
| 53 | linkedList.add(qd6003); | 70 | linkedList.add(qd6003); |
| 71 | + lastSend6003Map.put(nbbm, t); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + public static void put6003(ScheduleRealInfo sch, String sender){ | ||
| 75 | + if(null == sch) | ||
| 76 | + return; | ||
| 77 | + int state = 0;//营运状态 | ||
| 78 | + if(DayOfSchedule.emptyService(sch)) | ||
| 79 | + state = 1; | ||
| 80 | + | ||
| 81 | + put6003(sch.getClZbh(), state, Integer.parseInt(sch.getXlDir()), sender); | ||
| 54 | } | 82 | } |
| 55 | 83 | ||
| 56 | public static void put64(String nbbm, String lineCode, String sender){ | 84 | public static void put64(String nbbm, String lineCode, String sender){ |
| @@ -64,10 +92,6 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -64,10 +92,6 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 64 | linkedList.add(qd64); | 92 | linkedList.add(qd64); |
| 65 | } | 93 | } |
| 66 | 94 | ||
| 67 | - public static boolean isIdle(){ | ||
| 68 | - return System.currentTimeMillis() - t > IDLE_TIME; | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | public static void start(){ | 95 | public static void start(){ |
| 72 | if(thread != null){ | 96 | if(thread != null){ |
| 73 | thread.interrupt(); | 97 | thread.interrupt(); |
| @@ -81,11 +105,6 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -81,11 +105,6 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 81 | return linkedList.size(); | 105 | return linkedList.size(); |
| 82 | } | 106 | } |
| 83 | 107 | ||
| 84 | -/* @Override | ||
| 85 | - public void run(String... strings) throws Exception { | ||
| 86 | - start(); | ||
| 87 | - }*/ | ||
| 88 | - | ||
| 89 | @Override | 108 | @Override |
| 90 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | 109 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| 91 | directiveService = applicationContext.getBean(DirectiveService.class); | 110 | directiveService = applicationContext.getBean(DirectiveService.class); |
| @@ -108,7 +127,7 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -108,7 +127,7 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 108 | code = qd.getCode(); | 127 | code = qd.getCode(); |
| 109 | 128 | ||
| 110 | if(code.equals("60_02")){ | 129 | if(code.equals("60_02")){ |
| 111 | - directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender()); | 130 | + directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender(), qd.getTxtPrefix()); |
| 112 | log.info("directive 60_02 sch id: " + qd.getSch().getId()); | 131 | log.info("directive 60_02 sch id: " + qd.getSch().getId()); |
| 113 | } | 132 | } |
| 114 | else if(code.equals("60_03")){ | 133 | else if(code.equals("60_03")){ |
src/main/java/com/bsth/data/msg_queue/QueueData_Directive.java
| @@ -29,6 +29,8 @@ public class QueueData_Directive { | @@ -29,6 +29,8 @@ public class QueueData_Directive { | ||
| 29 | 29 | ||
| 30 | private String sender; | 30 | private String sender; |
| 31 | 31 | ||
| 32 | + private String txtPrefix; | ||
| 33 | + | ||
| 32 | 34 | ||
| 33 | public ScheduleRealInfo getSch() { | 35 | public ScheduleRealInfo getSch() { |
| 34 | return sch; | 36 | return sch; |
| @@ -93,4 +95,12 @@ public class QueueData_Directive { | @@ -93,4 +95,12 @@ public class QueueData_Directive { | ||
| 93 | public void setLineCode(String lineCode) { | 95 | public void setLineCode(String lineCode) { |
| 94 | this.lineCode = lineCode; | 96 | this.lineCode = lineCode; |
| 95 | } | 97 | } |
| 98 | + | ||
| 99 | + public String getTxtPrefix() { | ||
| 100 | + return txtPrefix; | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + public void setTxtPrefix(String txtPrefix) { | ||
| 104 | + this.txtPrefix = txtPrefix; | ||
| 105 | + } | ||
| 96 | } | 106 | } |
src/main/java/com/bsth/data/pilot80/PilotReport.java
| @@ -93,7 +93,7 @@ public class PilotReport { | @@ -93,7 +93,7 @@ public class PilotReport { | ||
| 93 | if (outSch.getJhlc() == null) | 93 | if (outSch.getJhlc() == null) |
| 94 | outSch = dayOfSchedule.next(outSch); | 94 | outSch = dayOfSchedule.next(outSch); |
| 95 | //下发调度指令 | 95 | //下发调度指令 |
| 96 | - DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统"); | 96 | + DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统", "同意出场;"); |
| 97 | } | 97 | } |
| 98 | break; | 98 | break; |
| 99 | } | 99 | } |
src/main/java/com/bsth/data/safe_driv/SafeDrivCenter.java
| @@ -5,7 +5,6 @@ import org.joda.time.format.DateTimeFormat; | @@ -5,7 +5,6 @@ import org.joda.time.format.DateTimeFormat; | ||
| 5 | import org.joda.time.format.DateTimeFormatter; | 5 | import org.joda.time.format.DateTimeFormatter; |
| 6 | import org.springframework.beans.BeansException; | 6 | import org.springframework.beans.BeansException; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | -import org.springframework.boot.CommandLineRunner; | ||
| 9 | import org.springframework.context.ApplicationContext; | 8 | import org.springframework.context.ApplicationContext; |
| 10 | import org.springframework.context.ApplicationContextAware; | 9 | import org.springframework.context.ApplicationContextAware; |
| 11 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| @@ -20,7 +19,7 @@ import java.util.Set; | @@ -20,7 +19,7 @@ import java.util.Set; | ||
| 20 | * Created by panzhao on 2017/4/6. | 19 | * Created by panzhao on 2017/4/6. |
| 21 | */ | 20 | */ |
| 22 | @Component | 21 | @Component |
| 23 | -public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware { | 22 | +public class SafeDrivCenter implements ApplicationContextAware { |
| 24 | 23 | ||
| 25 | private static Set<SafeDriv> data; | 24 | private static Set<SafeDriv> data; |
| 26 | 25 | ||
| @@ -65,12 +64,6 @@ public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware | @@ -65,12 +64,6 @@ public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware | ||
| 65 | } | 64 | } |
| 66 | 65 | ||
| 67 | @Override | 66 | @Override |
| 68 | - public void run(String... strings) throws Exception { | ||
| 69 | - //定时加载安全驾驶数据 | ||
| 70 | - //Application.mainServices.scheduleWithFixedDelay(safeDrivDataLoadThread, 80, 7, TimeUnit.SECONDS); | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - @Override | ||
| 74 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | 67 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| 75 | sendUtils = applicationContext.getBean(SendUtils.class); | 68 | sendUtils = applicationContext.getBean(SendUtils.class); |
| 76 | } | 69 | } |
src/main/java/com/bsth/data/safe_driv/SafeDrivDataLoadThread.java
| @@ -2,6 +2,7 @@ package com.bsth.data.safe_driv; | @@ -2,6 +2,7 @@ package com.bsth.data.safe_driv; | ||
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | import org.apache.http.HttpEntity; | 4 | import org.apache.http.HttpEntity; |
| 5 | +import org.apache.http.client.config.RequestConfig; | ||
| 5 | import org.apache.http.client.methods.CloseableHttpResponse; | 6 | import org.apache.http.client.methods.CloseableHttpResponse; |
| 6 | import org.apache.http.client.methods.HttpGet; | 7 | import org.apache.http.client.methods.HttpGet; |
| 7 | import org.apache.http.impl.client.CloseableHttpClient; | 8 | import org.apache.http.impl.client.CloseableHttpClient; |
| @@ -21,24 +22,43 @@ import java.util.List; | @@ -21,24 +22,43 @@ import java.util.List; | ||
| 21 | @Component | 22 | @Component |
| 22 | public class SafeDrivDataLoadThread extends Thread{ | 23 | public class SafeDrivDataLoadThread extends Thread{ |
| 23 | 24 | ||
| 24 | - private final static String url = "http://180.166.5.82:9005/bsth-safedriving/Crlcxb/realtimeInterface.do"; | ||
| 25 | - | ||
| 26 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 25 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 27 | 26 | ||
| 27 | + static String url; | ||
| 28 | + static CloseableHttpClient httpClient = null; | ||
| 29 | + static HttpGet get; | ||
| 30 | + static RequestConfig requestConfig; | ||
| 31 | + static CloseableHttpResponse response; | ||
| 32 | + static HttpEntity entity; | ||
| 33 | + static BufferedReader br; | ||
| 34 | + | ||
| 35 | + static { | ||
| 36 | + url = "http://180.166.5.82:9007/bsth-safedriving/Crlcxb/realtimeInterface.do"; | ||
| 37 | + httpClient = HttpClients.createDefault(); | ||
| 38 | + get = new HttpGet(url); | ||
| 39 | + requestConfig = RequestConfig.custom() | ||
| 40 | + .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 41 | + .setSocketTimeout(2500).build(); | ||
| 42 | + get.setConfig(requestConfig); | ||
| 43 | + } | ||
| 44 | + | ||
| 28 | @Override | 45 | @Override |
| 29 | public void run() { | 46 | public void run() { |
| 30 | - List<SafeDriv> list = null; | ||
| 31 | - CloseableHttpClient httpClient = null; | ||
| 32 | - CloseableHttpResponse response = null; | 47 | + List<SafeDriv> list; |
| 33 | try { | 48 | try { |
| 34 | - httpClient = HttpClients.createDefault(); | ||
| 35 | - HttpGet get = new HttpGet(url); | ||
| 36 | 49 | ||
| 37 | response = httpClient.execute(get); | 50 | response = httpClient.execute(get); |
| 38 | 51 | ||
| 39 | - HttpEntity entity = response.getEntity(); | 52 | + int statusCode = response.getStatusLine().getStatusCode(); |
| 53 | + if(statusCode != 200){ | ||
| 54 | + get.abort(); | ||
| 55 | + logger.error("http client status code: " + statusCode); | ||
| 56 | + return; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + entity = response.getEntity(); | ||
| 40 | if (null != entity) { | 60 | if (null != entity) { |
| 41 | - BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent())); | 61 | + br = new BufferedReader(new InputStreamReader(entity.getContent())); |
| 42 | StringBuffer stringBuffer = new StringBuffer(); | 62 | StringBuffer stringBuffer = new StringBuffer(); |
| 43 | String str = ""; | 63 | String str = ""; |
| 44 | while ((str = br.readLine()) != null) | 64 | while ((str = br.readLine()) != null) |
| @@ -46,47 +66,14 @@ public class SafeDrivDataLoadThread extends Thread{ | @@ -46,47 +66,14 @@ public class SafeDrivDataLoadThread extends Thread{ | ||
| 46 | 66 | ||
| 47 | 67 | ||
| 48 | list = JSON.parseArray(stringBuffer.toString(), SafeDriv.class); | 68 | list = JSON.parseArray(stringBuffer.toString(), SafeDriv.class); |
| 49 | - /** | ||
| 50 | - * 模拟数据 | ||
| 51 | - | ||
| 52 | - SafeDriv sd1 = new SafeDriv(); | ||
| 53 | - sd1.setYczltype("1"); | ||
| 54 | - sd1.setClzbh("W2B-001"); | ||
| 55 | - sd1.setStartime("2017-04-07 08:00:00.0"); | ||
| 56 | - | ||
| 57 | - SafeDriv sd2 = new SafeDriv(); | ||
| 58 | - sd2.setYczltype("2"); | ||
| 59 | - sd2.setClzbh("W2B-002"); | ||
| 60 | - sd2.setStartime("2017-04-07 08:02:00.0"); | ||
| 61 | - | ||
| 62 | - SafeDriv sd3 = new SafeDriv(); | ||
| 63 | - sd3.setYczltype("3"); | ||
| 64 | - sd3.setClzbh("W2B-003"); | ||
| 65 | - sd3.setStartime("2017-04-07 08:03:00.0"); | ||
| 66 | - | ||
| 67 | - SafeDriv sd4 = new SafeDriv(); | ||
| 68 | - sd4.setYczltype("4"); | ||
| 69 | - sd4.setClzbh("W2B-004"); | ||
| 70 | - sd4.setStartime("2017-04-07 08:04:00.0"); | ||
| 71 | - | ||
| 72 | - SafeDriv sd5 = new SafeDriv(); | ||
| 73 | - sd5.setYczltype("5"); | ||
| 74 | - sd5.setClzbh("W2B-005"); | ||
| 75 | - sd5.setStartime("2017-04-07 08:05:00.0"); | ||
| 76 | 69 | ||
| 77 | - list.add(sd1); | ||
| 78 | - list.add(sd2); | ||
| 79 | - list.add(sd3); | ||
| 80 | - list.add(sd4); | ||
| 81 | - list.add(sd5); | ||
| 82 | - */ | ||
| 83 | for(SafeDriv sd : list){ | 70 | for(SafeDriv sd : list){ |
| 84 | SafeDrivCenter.put(sd); | 71 | SafeDrivCenter.put(sd); |
| 85 | } | 72 | } |
| 86 | } | 73 | } |
| 87 | 74 | ||
| 88 | - httpClient.close(); | ||
| 89 | - response.close(); | 75 | + if (null != response) |
| 76 | + response.close(); | ||
| 90 | } catch (Exception e) { | 77 | } catch (Exception e) { |
| 91 | logger.error("安全驾驶接口报错了" , e.getMessage()); | 78 | logger.error("安全驾驶接口报错了" , e.getMessage()); |
| 92 | } | 79 | } |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -904,6 +904,7 @@ public class DayOfSchedule { | @@ -904,6 +904,7 @@ public class DayOfSchedule { | ||
| 904 | public List<ScheduleRealInfo> changeCar(ScheduleRealInfo sch, String newClZbh) { | 904 | public List<ScheduleRealInfo> changeCar(ScheduleRealInfo sch, String newClZbh) { |
| 905 | List<ScheduleRealInfo> ups = new ArrayList<>(); | 905 | List<ScheduleRealInfo> ups = new ArrayList<>(); |
| 906 | 906 | ||
| 907 | + String oldClZbh = sch.getClZbh(); | ||
| 907 | //变更相关映射信息 | 908 | //变更相关映射信息 |
| 908 | nbbmScheduleMap.remove(sch.getClZbh(), sch); | 909 | nbbmScheduleMap.remove(sch.getClZbh(), sch); |
| 909 | 910 | ||
| @@ -914,7 +915,7 @@ public class DayOfSchedule { | @@ -914,7 +915,7 @@ public class DayOfSchedule { | ||
| 914 | 915 | ||
| 915 | //重新计算车辆当前执行班次 | 916 | //重新计算车辆当前执行班次 |
| 916 | reCalcExecPlan(newClZbh); | 917 | reCalcExecPlan(newClZbh); |
| 917 | - reCalcExecPlan(sch.getClZbh()); | 918 | + reCalcExecPlan(oldClZbh); |
| 918 | //重新分组计划用车 | 919 | //重新分组计划用车 |
| 919 | reCalcLineNbbms(); | 920 | reCalcLineNbbms(); |
| 920 | return ups; | 921 | return ups; |
| @@ -935,6 +936,8 @@ public class DayOfSchedule { | @@ -935,6 +936,8 @@ public class DayOfSchedule { | ||
| 935 | ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list); | 936 | ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list); |
| 936 | if(null != sch) | 937 | if(null != sch) |
| 937 | carExecutePlanMap.put(nbbm, sch); | 938 | carExecutePlanMap.put(nbbm, sch); |
| 939 | + else | ||
| 940 | + carExecutePlanMap.remove(nbbm); | ||
| 938 | } | 941 | } |
| 939 | 942 | ||
| 940 | /** | 943 | /** |
src/main/java/com/bsth/data/schedule/thread/SchedulePstThread.java
| @@ -66,22 +66,11 @@ public class SchedulePstThread extends Thread { | @@ -66,22 +66,11 @@ public class SchedulePstThread extends Thread { | ||
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | -/* PropertyFilter filter = new PropertyFilter() { | ||
| 70 | - //过滤不需要的字段 | ||
| 71 | - public boolean apply(Object source, String name, Object value) { | ||
| 72 | - if("cTasks".equals(name)||"createBy".equals(name)||"updateBy".equals(name)){ | ||
| 73 | - return false; | ||
| 74 | - } | ||
| 75 | - return true; | ||
| 76 | - } | ||
| 77 | - };*/ | ||
| 78 | - | ||
| 79 | private void save(){ | 69 | private void save(){ |
| 80 | if(saveList.size() == 0) | 70 | if(saveList.size() == 0) |
| 81 | return; | 71 | return; |
| 82 | //记录同步数据 | 72 | //记录同步数据 |
| 83 | logger.info("real schedule update size: " + saveList.size()); | 73 | logger.info("real schedule update size: " + saveList.size()); |
| 84 | - //logger.info(JSON.toJSONString(saveList, filter)); | ||
| 85 | 74 | ||
| 86 | //批量入库 | 75 | //批量入库 |
| 87 | update2Db(); | 76 | update2Db(); |
src/main/java/com/bsth/entity/Line.java
| @@ -164,7 +164,7 @@ public class Line implements Serializable { | @@ -164,7 +164,7 @@ public class Line implements Serializable { | ||
| 164 | /** | 164 | /** |
| 165 | * 逻辑删除标记 为 1:标识已删除 | 165 | * 逻辑删除标记 为 1:标识已删除 |
| 166 | */ | 166 | */ |
| 167 | - private Integer remove; | 167 | + private Integer remove = 0; |
| 168 | 168 | ||
| 169 | public Integer getSpacGrade() { | 169 | public Integer getSpacGrade() { |
| 170 | return spacGrade; | 170 | return spacGrade; |
src/main/java/com/bsth/entity/LineVersions.java
| @@ -73,7 +73,7 @@ public class LineVersions{ | @@ -73,7 +73,7 @@ public class LineVersions{ | ||
| 73 | * 是否发布 int length(1) | 73 | * 是否发布 int length(1) |
| 74 | * 0(没有),1(发布) | 74 | * 0(没有),1(发布) |
| 75 | */ | 75 | */ |
| 76 | - private int isupdate; | 76 | + private int isupdate = 0; |
| 77 | 77 | ||
| 78 | public Integer getId() { | 78 | public Integer getId() { |
| 79 | return id; | 79 | return id; |
src/main/java/com/bsth/repository/LineRepository.java
| @@ -48,7 +48,7 @@ public interface LineRepository extends BaseRepository<Line, Integer> { | @@ -48,7 +48,7 @@ public interface LineRepository extends BaseRepository<Line, Integer> { | ||
| 48 | @Query(value = " SELECT l FROM Line l where l.company like ?1 and l.brancheCompany like ?2 and l.lineCode like ?3") | 48 | @Query(value = " SELECT l FROM Line l where l.company like ?1 and l.brancheCompany like ?2 and l.lineCode like ?3") |
| 49 | public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); | 49 | public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); |
| 50 | 50 | ||
| 51 | - @Query("SELECT L FROM Line L where L.destroy=0") | 51 | + @Query("SELECT L FROM Line L where L.destroy=0 and L.remove !=1") |
| 52 | List<Line> findAllService(); | 52 | List<Line> findAllService(); |
| 53 | 53 | ||
| 54 | 54 |
src/main/java/com/bsth/repository/SectionRouteRepository.java
| @@ -172,11 +172,11 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int | @@ -172,11 +172,11 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int | ||
| 172 | void isRoadSpeedUpd(Integer isR,Integer line,Integer directions); | 172 | void isRoadSpeedUpd(Integer isR,Integer line,Integer directions); |
| 173 | 173 | ||
| 174 | @Modifying | 174 | @Modifying |
| 175 | - @Query(value="UPDATE bsth_c_sectionroute set sectionroute_code = (sectionroute_code+100) where line = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true) | 175 | + @Query(value="UPDATE bsth_c_sectionroute set sectionroute_code = (sectionroute_code+1) where line = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true) |
| 176 | public void sectionUpdSectionRouteCode(Integer line,Integer dir,Integer routeCod); | 176 | public void sectionUpdSectionRouteCode(Integer line,Integer dir,Integer routeCod); |
| 177 | 177 | ||
| 178 | @Modifying | 178 | @Modifying |
| 179 | - @Query(value="UPDATE bsth_c_sectionroute set sectionroute_code = (sectionroute_code+100) where line_code = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true) | 179 | + @Query(value="UPDATE bsth_c_sectionroute set sectionroute_code = (sectionroute_code+1) where line_code = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true) |
| 180 | public void sectionUpdSectionRouteCode(String lineCode,Integer dir,int routeCod); | 180 | public void sectionUpdSectionRouteCode(String lineCode,Integer dir,int routeCod); |
| 181 | 181 | ||
| 182 | @Modifying | 182 | @Modifying |
src/main/java/com/bsth/repository/oil/CwjyRepository.java
| @@ -27,7 +27,7 @@ public interface CwjyRepository extends BaseRepository<Cwjy, Integer>{ | @@ -27,7 +27,7 @@ public interface CwjyRepository extends BaseRepository<Cwjy, Integer>{ | ||
| 27 | " ) c on a.nbbm=c.nbbm where a.nbbm like %?2% ",nativeQuery=true) | 27 | " ) c on a.nbbm=c.nbbm where a.nbbm like %?2% ",nativeQuery=true) |
| 28 | List<Object[]> obtainCwjycl(String rq,String nbbm); | 28 | List<Object[]> obtainCwjycl(String rq,String nbbm); |
| 29 | 29 | ||
| 30 | - @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3%",nativeQuery=true) | 30 | + @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3% order by nbbm",nativeQuery=true) |
| 31 | List<Cwjy> selectAll(String nbbm,String gsdm,String fgsdm); | 31 | List<Cwjy> selectAll(String nbbm,String gsdm,String fgsdm); |
| 32 | 32 | ||
| 33 | @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3% and line =?4",nativeQuery=true) | 33 | @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3% and line =?4",nativeQuery=true) |
src/main/java/com/bsth/service/TrafficManageService.java
| @@ -70,6 +70,8 @@ public interface TrafficManageService { | @@ -70,6 +70,8 @@ public interface TrafficManageService { | ||
| 70 | */ | 70 | */ |
| 71 | String setJHBC(); | 71 | String setJHBC(); |
| 72 | 72 | ||
| 73 | + String setJHBC(String theDate); | ||
| 74 | + | ||
| 73 | String setLD(String theDate); | 75 | String setLD(String theDate); |
| 74 | 76 | ||
| 75 | String setLD(); | 77 | String setLD(); |
src/main/java/com/bsth/service/directive/DirectiveService.java
| @@ -32,7 +32,7 @@ public interface DirectiveService extends BaseService<D60, Integer>{ | @@ -32,7 +32,7 @@ public interface DirectiveService extends BaseService<D60, Integer>{ | ||
| 32 | * @param @param finish 已完成的班次数 | 32 | * @param @param finish 已完成的班次数 |
| 33 | * @throws | 33 | * @throws |
| 34 | */ | 34 | */ |
| 35 | - int send60Dispatch(ScheduleRealInfo sch, int finish, String sender); | 35 | + int send60Dispatch(ScheduleRealInfo sch, int finish, String sender,String txtPrefix); |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * | 38 | * |
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
| @@ -26,6 +26,7 @@ import com.bsth.websocket.handler.RealControlSocketHandler; | @@ -26,6 +26,7 @@ import com.bsth.websocket.handler.RealControlSocketHandler; | ||
| 26 | import com.fasterxml.jackson.core.JsonProcessingException; | 26 | import com.fasterxml.jackson.core.JsonProcessingException; |
| 27 | import com.fasterxml.jackson.databind.ObjectMapper; | 27 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 28 | import com.google.common.base.Splitter; | 28 | import com.google.common.base.Splitter; |
| 29 | +import org.apache.commons.lang3.StringEscapeUtils; | ||
| 29 | import org.apache.commons.lang3.StringUtils; | 30 | import org.apache.commons.lang3.StringUtils; |
| 30 | import org.joda.time.format.DateTimeFormat; | 31 | import org.joda.time.format.DateTimeFormat; |
| 31 | import org.joda.time.format.DateTimeFormatter; | 32 | import org.joda.time.format.DateTimeFormatter; |
| @@ -78,6 +79,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -78,6 +79,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 78 | public int send60Phrase(String nbbm, String text, String sender) { | 79 | public int send60Phrase(String nbbm, String text, String sender) { |
| 79 | D60 d60 = null; | 80 | D60 d60 = null; |
| 80 | try { | 81 | try { |
| 82 | + text = StringEscapeUtils.unescapeHtml4(text); | ||
| 83 | + text = text.replaceAll("#", ""); | ||
| 81 | d60 = create60Data(nbbm, text, (short) 0x00, null); | 84 | d60 = create60Data(nbbm, text, (short) 0x00, null); |
| 82 | } catch (Exception e) { | 85 | } catch (Exception e) { |
| 83 | logger.error("发送消息短语出现异常", e); | 86 | logger.error("发送消息短语出现异常", e); |
| @@ -105,7 +108,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -105,7 +108,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 105 | } | 108 | } |
| 106 | 109 | ||
| 107 | @Override | 110 | @Override |
| 108 | - public int send60Dispatch(ScheduleRealInfo sch, int finish, String sender) { | 111 | + public int send60Dispatch(ScheduleRealInfo sch, int finish, String sender, String txtPrefix) { |
| 109 | D60 d60 = null; | 112 | D60 d60 = null; |
| 110 | try { | 113 | try { |
| 111 | if (sch.isDestroy()) { | 114 | if (sch.isDestroy()) { |
| @@ -129,8 +132,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -129,8 +132,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 129 | long t = System.currentTimeMillis() + 1000 * 30, | 132 | long t = System.currentTimeMillis() + 1000 * 30, |
| 130 | alarmTime = sch.getDfsjT() < t?t:sch.getDfsjT(); | 133 | alarmTime = sch.getDfsjT() < t?t:sch.getDfsjT(); |
| 131 | 134 | ||
| 135 | + if(StringUtils.isNotEmpty(txtPrefix)){ | ||
| 136 | + text = txtPrefix + text; | ||
| 137 | + } | ||
| 138 | + text = StringEscapeUtils.unescapeHtml4(text); | ||
| 139 | + int state = 0;//营运状态 | ||
| 140 | + if(dayOfSchedule.emptyService(sch)) | ||
| 141 | + state = 1; | ||
| 132 | d60 = new DirectiveCreator().createD60_01(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir()) | 142 | d60 = new DirectiveCreator().createD60_01(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir()) |
| 133 | - , 0, new Date(alarmTime)); | 143 | + , state, new Date(alarmTime)); |
| 134 | 144 | ||
| 135 | d60.setLineCode(sch.getXlBm()); | 145 | d60.setLineCode(sch.getXlBm()); |
| 136 | } catch (Exception e) { | 146 | } catch (Exception e) { |
| @@ -170,6 +180,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -170,6 +180,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 170 | dayOfDirectives.put60(d60, false); | 180 | dayOfDirectives.put60(d60, false); |
| 171 | d60Repository.save(d60); | 181 | d60Repository.save(d60); |
| 172 | } | 182 | } |
| 183 | + | ||
| 173 | return code; | 184 | return code; |
| 174 | } | 185 | } |
| 175 | 186 | ||
| @@ -196,7 +207,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -196,7 +207,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 196 | ScheduleRealInfo sch = dayOfSchedule.get(id); | 207 | ScheduleRealInfo sch = dayOfSchedule.get(id); |
| 197 | // 车辆已完成班次 | 208 | // 车辆已完成班次 |
| 198 | int finish = dayOfSchedule.doneSum(sch.getClZbh()); | 209 | int finish = dayOfSchedule.doneSum(sch.getClZbh()); |
| 199 | - return send60Dispatch(sch, finish, sender); | 210 | + return send60Dispatch(sch, finish, sender, ""); |
| 200 | } | 211 | } |
| 201 | 212 | ||
| 202 | @Override | 213 | @Override |
src/main/java/com/bsth/service/forms/FormsService.java
| @@ -24,14 +24,19 @@ public interface FormsService { | @@ -24,14 +24,19 @@ public interface FormsService { | ||
| 24 | public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map); | 24 | public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map); |
| 25 | 25 | ||
| 26 | public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map); | 26 | public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map); |
| 27 | + public List<Shiftuehiclemanth> shiftuehiclemanth2(Map<String, Object> map); | ||
| 27 | 28 | ||
| 28 | public List<Changetochange> changetochange(Map<String, Object> map); | 29 | public List<Changetochange> changetochange(Map<String, Object> map); |
| 29 | 30 | ||
| 30 | public List<Shifday> shifday(Map<String, Object> map); | 31 | public List<Shifday> shifday(Map<String, Object> map); |
| 31 | 32 | ||
| 32 | public List<Singledata> singledata(Map<String, Object> map); | 33 | public List<Singledata> singledata(Map<String, Object> map); |
| 34 | + public List<Singledata> singledata2(Map<String, Object> map); | ||
| 35 | + | ||
| 33 | public List<Singledata> singledatanew(Map<String, Object> map); | 36 | public List<Singledata> singledatanew(Map<String, Object> map); |
| 34 | public List<Singledata> singledatatj(Map<String, Object> map); | 37 | public List<Singledata> singledatatj(Map<String, Object> map); |
| 38 | + public List<Singledata> singledatatj2(Map<String, Object> map); | ||
| 39 | + | ||
| 35 | 40 | ||
| 36 | public List<Vehicleloading> vehicleloading(String line,String data); | 41 | public List<Vehicleloading> vehicleloading(String line,String data); |
| 37 | 42 |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -360,7 +360,7 @@ public class FormsServiceImpl implements FormsService { | @@ -360,7 +360,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 360 | int ljbc=culateMileageService.culateLjbc(list_s,""); | 360 | int ljbc=culateMileageService.culateLjbc(list_s,""); |
| 361 | int sjbc=culateMileageService.culateSjbc(list_s, ""); | 361 | int sjbc=culateMileageService.culateSjbc(list_s, ""); |
| 362 | double cjgl=culateMileageService.culateLbgl(sList); | 362 | double cjgl=culateMileageService.culateLbgl(sList); |
| 363 | - double zjgl=culateMileageService.culateLjgl(list_s); | 363 | +// double zjgl=culateMileageService.culateLjgl(list_s); |
| 364 | d.setEmptMileage(String.valueOf(zksgl));//空驶公里 | 364 | d.setEmptMileage(String.valueOf(zksgl));//空驶公里 |
| 365 | d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 | 365 | d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 |
| 366 | d.setSjbc(String.valueOf(sjbc+ljbc)); | 366 | d.setSjbc(String.valueOf(sjbc+ljbc)); |
| @@ -368,7 +368,7 @@ public class FormsServiceImpl implements FormsService { | @@ -368,7 +368,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 368 | d.setCjbc(String.valueOf(cjbc));//抽检班次 | 368 | d.setCjbc(String.valueOf(cjbc));//抽检班次 |
| 369 | d.setLjbc(String.valueOf(ljbc));//增加班次 | 369 | d.setLjbc(String.valueOf(ljbc));//增加班次 |
| 370 | d.setRemMileage(String.valueOf(cjgl));//抽检里程 | 370 | d.setRemMileage(String.valueOf(cjgl));//抽检里程 |
| 371 | - d.setAddMileage(String.valueOf(zjgl));//增加里程 | 371 | + d.setAddMileage(String.valueOf(ljgl));//增加里程 |
| 372 | 372 | ||
| 373 | } | 373 | } |
| 374 | 374 | ||
| @@ -403,6 +403,191 @@ public class FormsServiceImpl implements FormsService { | @@ -403,6 +403,191 @@ public class FormsServiceImpl implements FormsService { | ||
| 403 | 403 | ||
| 404 | return list; | 404 | return list; |
| 405 | } | 405 | } |
| 406 | + | ||
| 407 | + | ||
| 408 | + @Override | ||
| 409 | + public List<Shiftuehiclemanth> shiftuehiclemanth2(Map<String, Object> map) { | ||
| 410 | + final String empnames=map.get("empnames").toString(); | ||
| 411 | + String gsdmManth=""; | ||
| 412 | + String fgsdmManth=""; | ||
| 413 | + if(map.containsKey("gsdmManth")){ | ||
| 414 | + gsdmManth=map.get("gsdmManth").toString(); | ||
| 415 | + } | ||
| 416 | + if(map.containsKey("fgsdmManth")){ | ||
| 417 | + fgsdmManth=map.get("fgsdmManth").toString(); | ||
| 418 | + } | ||
| 419 | + String sql ="select "; | ||
| 420 | + if(empnames.equals("驾驶员")){ | ||
| 421 | + sql += " r.j_name,r.j_gh "; | ||
| 422 | + }else if(empnames.equals("售票员")){ | ||
| 423 | + sql += " r.s_gh,r.s_name"; | ||
| 424 | + }else{ | ||
| 425 | + sql += " r.cl_zbh"; | ||
| 426 | + } | ||
| 427 | + sql += " from bsth_c_s_sp_info_real r where " | ||
| 428 | + + " r.schedule_date_str >= '" + map.get("startDate").toString() + "' " | ||
| 429 | + + " and r.schedule_date_str <='" + map.get("endDate").toString() + "' "; | ||
| 430 | + if(map.get("line")!=null&&!map.get("line").equals("")){ | ||
| 431 | + sql+=" and r.xl_bm='"+ map.get("line").toString() + "' "; | ||
| 432 | + } | ||
| 433 | + sql+=" and r.gs_bm like'%"+gsdmManth+"%' and r.fgs_bm like'%"+fgsdmManth+"%'"; | ||
| 434 | + | ||
| 435 | + if(empnames.equals("驾驶员")){ | ||
| 436 | + sql += " GROUP BY " | ||
| 437 | + + "r.j_name,r.j_gh"; | ||
| 438 | + }else if(empnames.equals("售票员")){ | ||
| 439 | + sql+="and r.s_name is not null AND r.s_name !='' GROUP BY r.s_gh,r.s_name"; | ||
| 440 | + }else{ | ||
| 441 | + sql += " GROUP BY r.cl_zbh"; | ||
| 442 | + } | ||
| 443 | + | ||
| 444 | + List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { | ||
| 445 | + | ||
| 446 | + @Override | ||
| 447 | + public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 448 | + Shiftuehiclemanth shif = new Shiftuehiclemanth(); | ||
| 449 | + if(empnames.equals("驾驶员")){ | ||
| 450 | + shif.setjName(arg0.getString("j_name")+"/"+arg0.getString("j_gh")); | ||
| 451 | + shif.setJgh(arg0.getString("j_gh")); | ||
| 452 | + }else if(empnames.equals("售票员")){ | ||
| 453 | + shif.setjName(arg0.getString("s_name")+"/"+arg0.getString("s_gh")); | ||
| 454 | + shif.setSgh(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); | ||
| 455 | + }else if(empnames.equals("车辆自编号")){ | ||
| 456 | + shif.setjName(arg0.getString("cl_zbh")); | ||
| 457 | + } | ||
| 458 | +// shif.setJgh(arg0.getString("j_gh")); | ||
| 459 | +// shif.setZbh(arg0.getString("cl_zbh")); | ||
| 460 | +// shif.setjName(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); | ||
| 461 | + return shif; | ||
| 462 | + } | ||
| 463 | + }); | ||
| 464 | + | ||
| 465 | + List<ScheduleRealInfo> sList; | ||
| 466 | + List<ScheduleRealInfo> list_s; | ||
| 467 | + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineYbb(map.get("line").toString(), map.get("startDate").toString(), map.get("endDate").toString()); | ||
| 468 | + for(int i=0;i<list.size();i++){ | ||
| 469 | + sList =new ArrayList<ScheduleRealInfo>(); | ||
| 470 | + list_s =new ArrayList<ScheduleRealInfo>(); | ||
| 471 | + Shiftuehiclemanth d=list.get(i); | ||
| 472 | + for (int j = 0; j < lists.size(); j++) { | ||
| 473 | + ScheduleRealInfo s=lists.get(j); | ||
| 474 | +// if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ | ||
| 475 | +// sList.add(s); | ||
| 476 | +// } | ||
| 477 | + if(empnames.equals("驾驶员")){ | ||
| 478 | + if(d.getJgh().equals(s.getjGh())){ | ||
| 479 | + sList.add(s); | ||
| 480 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 481 | + if(cts != null && cts.size() > 0){ | ||
| 482 | + list_s.add(s); | ||
| 483 | + }else{ | ||
| 484 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 485 | + list_s.add(s); | ||
| 486 | + } | ||
| 487 | + } | ||
| 488 | + | ||
| 489 | + } | ||
| 490 | + }else if(empnames.equals("售票员")){ | ||
| 491 | + String sgh=s.getsGh()==null?"":s.getsGh(); | ||
| 492 | + if(d.getSgh().equals(sgh)){ | ||
| 493 | + sList.add(s); | ||
| 494 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 495 | + if(cts != null && cts.size() > 0){ | ||
| 496 | + list_s.add(s); | ||
| 497 | + }else{ | ||
| 498 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 499 | + list_s.add(s); | ||
| 500 | + } | ||
| 501 | + } | ||
| 502 | + } | ||
| 503 | + }else if(empnames.equals("车辆自编号")){ | ||
| 504 | + if(d.getjName().equals(s.getClZbh())){ | ||
| 505 | + sList.add(s); | ||
| 506 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 507 | + if(cts != null && cts.size() > 0){ | ||
| 508 | + list_s.add(s); | ||
| 509 | + }else{ | ||
| 510 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 511 | + list_s.add(s); | ||
| 512 | + } | ||
| 513 | + } | ||
| 514 | + } | ||
| 515 | + } | ||
| 516 | + | ||
| 517 | + } | ||
| 518 | + | ||
| 519 | + if(empnames.equals("售票员")){ | ||
| 520 | + double zksgl=culateMileageService.culateSjfyylc_spy(list_s); | ||
| 521 | + double ljgl=culateMileageService.culateLjgl_spy(list_s); | ||
| 522 | + double sjgl=culateMileageService.culateSjgl_spy(list_s); | ||
| 523 | + double zyygl=Arith.add(ljgl, sjgl); | ||
| 524 | + int cjbc=culateMileageService.culateLbbc(sList); | ||
| 525 | + int ljbc=culateMileageService.culateLjbc(list_s,""); | ||
| 526 | + int sjbc=culateMileageService.culateSjbc(list_s, ""); | ||
| 527 | + double cjgl=culateMileageService.culateLbgl(sList); | ||
| 528 | +// double zjgl=culateMileageService.culateLjgl(list_s); | ||
| 529 | + d.setEmptMileage(String.valueOf(zksgl));//空驶公里 | ||
| 530 | + d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 | ||
| 531 | + d.setSjbc(String.valueOf(sjbc+ljbc)); | ||
| 532 | + d.setJhlc(String.valueOf(zyygl));//运营里程 | ||
| 533 | + d.setCjbc(String.valueOf(cjbc));//抽检班次 | ||
| 534 | + d.setLjbc(String.valueOf(ljbc));//增加班次 | ||
| 535 | + d.setRemMileage(String.valueOf(cjgl));//抽检里程 | ||
| 536 | + d.setAddMileage(String.valueOf(ljgl));//增加里程 | ||
| 537 | + }else{ | ||
| 538 | + double ksgl=culateMileageService.culateKsgl(list_s); | ||
| 539 | + double jccgl=culateMileageService.culateJccgl(list_s); | ||
| 540 | + double zksgl=Arith.add(ksgl, jccgl); | ||
| 541 | + double ljgl=culateMileageService.culateLjgl(list_s); | ||
| 542 | + double sjgl=culateMileageService.culateSjgl(list_s); | ||
| 543 | + double zyygl=Arith.add(ljgl, sjgl); | ||
| 544 | + int cjbc=culateMileageService.culateLbbc(sList); | ||
| 545 | + int ljbc=culateMileageService.culateLjbc(list_s,""); | ||
| 546 | + int sjbc=culateMileageService.culateSjbc(list_s, ""); | ||
| 547 | + double cjgl=culateMileageService.culateLbgl(sList); | ||
| 548 | +// double zjgl=culateMileageService.culateLjgl(list_s); | ||
| 549 | + d.setEmptMileage(String.valueOf(zksgl));//空驶公里 | ||
| 550 | + d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 | ||
| 551 | + d.setSjbc(String.valueOf(sjbc+ljbc)); | ||
| 552 | + d.setJhlc(String.valueOf(zyygl));//运营里程 | ||
| 553 | + d.setCjbc(String.valueOf(cjbc));//抽检班次 | ||
| 554 | + d.setLjbc(String.valueOf(ljbc));//增加班次 | ||
| 555 | + d.setRemMileage(String.valueOf(cjgl));//抽检里程 | ||
| 556 | + d.setAddMileage(String.valueOf(ljgl));//增加里程 | ||
| 557 | + } | ||
| 558 | + } | ||
| 559 | + | ||
| 560 | + Shiftuehiclemanth shif = new Shiftuehiclemanth(); | ||
| 561 | + shif.setjName("汇总合计"); | ||
| 562 | + BigDecimal yylc = new BigDecimal("0.0"); | ||
| 563 | + BigDecimal kslc = new BigDecimal("0.0"); | ||
| 564 | + BigDecimal cjlc = new BigDecimal("0.0"); | ||
| 565 | + BigDecimal zjlc = new BigDecimal("0.0"); | ||
| 566 | + BigDecimal zlc = new BigDecimal("0.0"); | ||
| 567 | + int cjbc = 0, zjbc = 0, sjbc = 0; | ||
| 568 | + for(Shiftuehiclemanth s : list){ | ||
| 569 | + yylc = yylc.add(new BigDecimal(s.getJhlc())); | ||
| 570 | + kslc = kslc.add(new BigDecimal(s.getEmptMileage())); | ||
| 571 | + cjlc = cjlc.add(new BigDecimal(s.getRemMileage())); | ||
| 572 | + zjlc = zjlc.add(new BigDecimal(s.getAddMileage())); | ||
| 573 | + zlc = zlc.add(new BigDecimal(s.getTotalm())); | ||
| 574 | + cjbc += Integer.valueOf(s.getCjbc()); | ||
| 575 | + zjbc += Integer.valueOf(s.getLjbc()); | ||
| 576 | + sjbc += Integer.valueOf(s.getSjbc()); | ||
| 577 | + } | ||
| 578 | + shif.setJhlc(yylc.toString()); | ||
| 579 | + shif.setEmptMileage(kslc.toString()); | ||
| 580 | + shif.setRemMileage(cjlc.toString()); | ||
| 581 | + shif.setAddMileage(zjlc.toString()); | ||
| 582 | + shif.setTotalm(zlc.toString()); | ||
| 583 | + shif.setCjbc("" + cjbc); | ||
| 584 | + shif.setLjbc("" + zjbc); | ||
| 585 | + shif.setSjbc("" + sjbc); | ||
| 586 | + if(list.size() > 0) | ||
| 587 | + list.add(shif); | ||
| 588 | + | ||
| 589 | + return list; | ||
| 590 | + } | ||
| 406 | 591 | ||
| 407 | // 班次车辆人员日统计 | 592 | // 班次车辆人员日统计 |
| 408 | @Override | 593 | @Override |
| @@ -603,38 +788,290 @@ public class FormsServiceImpl implements FormsService { | @@ -603,38 +788,290 @@ public class FormsServiceImpl implements FormsService { | ||
| 603 | sql += " and gs= '"+gs+"' and fgs= '"+fgs+"'"; | 788 | sql += " and gs= '"+gs+"' and fgs= '"+fgs+"'"; |
| 604 | } | 789 | } |
| 605 | 790 | ||
| 606 | - sql +=" order by rq"; | ||
| 607 | - List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() { | ||
| 608 | - | ||
| 609 | - | ||
| 610 | - @Override | ||
| 611 | - public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 612 | - Changetochange chan = new Changetochange(); | ||
| 613 | - chan.setRq(arg0.getString("rq")); | ||
| 614 | - chan.setGs(BasicData.businessCodeNameMap.get(arg0.getString("gs"))); | ||
| 615 | - chan.setFgs(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs")+"_"+arg0.getString("gs"))); | ||
| 616 | - chan.setXl(BasicData.lineCode2NameMap.get(arg0.getString("xl"))); | ||
| 617 | - chan.setLp(arg0.getString("lp")); | ||
| 618 | - chan.setFssj(arg0.getString("fssj")); | ||
| 619 | - chan.setXgsj(arg0.getString("xgsj")); | ||
| 620 | - chan.setPcch(arg0.getString("pcch")); | ||
| 621 | - chan.setPcry(arg0.getString("pcry")); | ||
| 622 | - chan.setJhch(arg0.getString("jhch")); | ||
| 623 | - chan.setJhgh(arg0.getString("jhgh")); | ||
| 624 | - chan.setSjch(arg0.getString("sjch")); | ||
| 625 | - chan.setSjgh(arg0.getString("sjgh")); | ||
| 626 | - chan.setYy(arg0.getString("yy")); | ||
| 627 | - chan.setXgr(arg0.getString("xgr")); | ||
| 628 | - return chan; | ||
| 629 | - } | ||
| 630 | - }); | ||
| 631 | - return list; | ||
| 632 | - } | ||
| 633 | - | ||
| 634 | - | ||
| 635 | - // 路单数据 | 791 | + sql +=" order by rq"; |
| 792 | + List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() { | ||
| 793 | + | ||
| 794 | + | ||
| 795 | + @Override | ||
| 796 | + public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 797 | + Changetochange chan = new Changetochange(); | ||
| 798 | + chan.setRq(arg0.getString("rq")); | ||
| 799 | + chan.setGs(BasicData.businessCodeNameMap.get(arg0.getString("gs"))); | ||
| 800 | + chan.setFgs(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs")+"_"+arg0.getString("gs"))); | ||
| 801 | + chan.setXl(BasicData.lineCode2NameMap.get(arg0.getString("xl"))); | ||
| 802 | + chan.setLp(arg0.getString("lp")); | ||
| 803 | + chan.setFssj(arg0.getString("fssj")); | ||
| 804 | + chan.setXgsj(arg0.getString("xgsj")); | ||
| 805 | + chan.setPcch(arg0.getString("pcch")); | ||
| 806 | + chan.setPcry(arg0.getString("pcry")); | ||
| 807 | + chan.setJhch(arg0.getString("jhch")); | ||
| 808 | + chan.setJhgh(arg0.getString("jhgh")); | ||
| 809 | + chan.setSjch(arg0.getString("sjch")); | ||
| 810 | + chan.setSjgh(arg0.getString("sjgh")); | ||
| 811 | + chan.setYy(arg0.getString("yy")); | ||
| 812 | + chan.setXgr(arg0.getString("xgr")); | ||
| 813 | + return chan; | ||
| 814 | + } | ||
| 815 | + }); | ||
| 816 | + return list; | ||
| 817 | + } | ||
| 818 | + | ||
| 819 | + | ||
| 820 | + // 路单数据 | ||
| 821 | + @Override | ||
| 822 | + public List<Singledata> singledatatj(Map<String, Object> map) { | ||
| 823 | + String gsdm=""; | ||
| 824 | + if(map.get("gsdmSing")!=null){ | ||
| 825 | + gsdm=map.get("gsdmSing").toString(); | ||
| 826 | + } | ||
| 827 | + String fgsdm=""; | ||
| 828 | + if(map.get("fgsdmSing")!=null){ | ||
| 829 | + fgsdm=map.get("fgsdmSing").toString(); | ||
| 830 | + } | ||
| 831 | + | ||
| 832 | + String tjtype=map.get("tjtype").toString(); | ||
| 833 | + String xlbm=map.get("line").toString().trim(); | ||
| 834 | + startDate = map.get("startDate").toString(); | ||
| 835 | + | ||
| 836 | + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>(); | ||
| 837 | + if(xlbm.equals("")){ | ||
| 838 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineByGs_(gsdm, fgsdm, startDate); | ||
| 839 | + }else{ | ||
| 840 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineQp(xlbm, startDate); | ||
| 841 | + } | ||
| 842 | + List<Singledata> list=new ArrayList<Singledata>(); | ||
| 843 | + List<Singledata> list_=new ArrayList<Singledata>(); | ||
| 844 | + if(tjtype.equals("jsy")){ | ||
| 845 | + //油统计 | ||
| 846 | + String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.j_name" | ||
| 847 | + + " from bsth_c_s_sp_info_real r where " | ||
| 848 | + + " r.schedule_date_str = '"+startDate+"'"; | ||
| 849 | + if(xlbm.equals("")){ | ||
| 850 | + sql +="and r.gs_bm='"+gsdm+"' " | ||
| 851 | + + " and r.fgs_bm='"+fgsdm+"'"; | ||
| 852 | + }else{ | ||
| 853 | + sql += " and r.xl_bm = '"+xlbm+"'"; | ||
| 854 | + } | ||
| 855 | + sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh"; | ||
| 856 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | ||
| 857 | + @Override | ||
| 858 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 859 | + Singledata sin = new Singledata(); | ||
| 860 | + sin.setxL(arg0.getString("xl_bm")); | ||
| 861 | + sin.setJsy(arg0.getString("j_gh")); | ||
| 862 | + sin.setjName(arg0.getString("j_name")); | ||
| 863 | + sin.setClzbh(arg0.getString("cl_zbh")); | ||
| 864 | + return sin; | ||
| 865 | + } | ||
| 866 | + }); | ||
| 867 | + String linesql=""; | ||
| 868 | + if(!xlbm.equals("")){ | ||
| 869 | + linesql +=" and xlbm ='"+xlbm+"' "; | ||
| 870 | + } | ||
| 871 | + String nysql="SELECT id,xlbm,nbbm, jsy,jzl as jzl,yh as yh,sh as sh FROM bsth_c_ylb " | ||
| 872 | + + " WHERE rq = '"+startDate+"'" | ||
| 873 | + + " AND ssgsdm = '"+gsdm+"' AND fgsdm = '"+fgsdm+"'" +linesql | ||
| 874 | + + " union" | ||
| 875 | + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh FROM bsth_c_dlb" | ||
| 876 | + + " WHERE rq = '"+startDate+"'" | ||
| 877 | + + " AND ssgsdm = '"+gsdm+"' AND fgsdm = '"+fgsdm+"'"+linesql; | ||
| 878 | + List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { | ||
| 879 | + @Override | ||
| 880 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 881 | + Singledata sin = new Singledata(); | ||
| 882 | + sin.setxL(arg0.getString("xlbm")); | ||
| 883 | + sin.setJsy(arg0.getString("jsy")); | ||
| 884 | + sin.setClzbh(arg0.getString("nbbm")); | ||
| 885 | + sin.setJzl(arg0.getString("jzl")); | ||
| 886 | + sin.setHyl(arg0.getString("yh")); | ||
| 887 | + sin.setUnyyyl(arg0.getString("sh")); | ||
| 888 | + return sin; | ||
| 889 | + } | ||
| 890 | + }); | ||
| 891 | + //统计油,电表中手动添加的或者有加注没里程的数据 | ||
| 892 | + for (int i = 0; i < listNy.size(); i++) { | ||
| 893 | + Singledata sin_=listNy.get(i); | ||
| 894 | + String jsy=sin_.getJsy(); | ||
| 895 | + String line=sin_.getxL(); | ||
| 896 | + String clzbh=sin_.getClzbh(); | ||
| 897 | + boolean fages=true; | ||
| 898 | + for (int j = 0; j < list.size(); j++) { | ||
| 899 | + Singledata sin=list.get(j); | ||
| 900 | + String jsy_=sin.getJsy(); | ||
| 901 | + String line_=sin.getxL(); | ||
| 902 | + String clzbh_=sin.getClzbh(); | ||
| 903 | + if(jsy.equals(jsy_) | ||
| 904 | + &&line.equals(line_) | ||
| 905 | + &&clzbh.equals(clzbh_)){ | ||
| 906 | + fages=false; | ||
| 907 | + } | ||
| 908 | + } | ||
| 909 | + if(fages){ | ||
| 910 | + Singledata s=new Singledata(); | ||
| 911 | + s.setJsy(jsy); | ||
| 912 | + s.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | ||
| 913 | + s.setClzbh(clzbh); | ||
| 914 | + s.setSgh(""); | ||
| 915 | + s.setsName(""); | ||
| 916 | + s.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 917 | + s.setxL(line); | ||
| 918 | + s.setXlmc(BasicData.lineCode2NameMap.get(line)); | ||
| 919 | + s.setJzl(sin_.getJzl()); | ||
| 920 | + s.setHyl(sin_.getHyl()); | ||
| 921 | + s.setUnyyyl(sin_.getUnyyyl()); | ||
| 922 | + s.setJhlc("0.0"); | ||
| 923 | + s.setEmptMileage("0.0"); | ||
| 924 | + s.setJhjl("0.0"); | ||
| 925 | + s.setrQ(startDate); | ||
| 926 | + list_.add(s); | ||
| 927 | + } | ||
| 928 | + } | ||
| 929 | + for (int i= 0; i < list.size(); i++) { | ||
| 930 | + Singledata sin=list.get(i); | ||
| 931 | + String jsy=sin.getJsy(); | ||
| 932 | + String line=sin.getxL(); | ||
| 933 | + String clzbh=sin.getClzbh(); | ||
| 934 | + double jzl=0.0; | ||
| 935 | + double yh=0.0; | ||
| 936 | + double sh=0.0; | ||
| 937 | + for (int j = 0; j < listNy.size(); j++) { | ||
| 938 | + Singledata y=listNy.get(j); | ||
| 939 | + if(y.getJsy().equals(jsy) | ||
| 940 | + &&y.getClzbh().equals(clzbh) | ||
| 941 | + &&y.getxL().equals(line)){ | ||
| 942 | + jzl=Arith.add(jzl, y.getJzl()); | ||
| 943 | + yh=Arith.add(yh, y.getHyl()); | ||
| 944 | + sh=Arith.add(sh, y.getUnyyyl()); | ||
| 945 | + } | ||
| 946 | + } | ||
| 947 | + sin.setHyl(String.valueOf(yh)); | ||
| 948 | + sin.setJzl(String.valueOf(jzl)); | ||
| 949 | + sin.setUnyyyl(String.valueOf(sh)); | ||
| 950 | + | ||
| 951 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 952 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | ||
| 953 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 954 | + ScheduleRealInfo s=listReal.get(j); | ||
| 955 | + if(s.getjGh().equals(jsy) | ||
| 956 | + && s.getClZbh().equals(clzbh) | ||
| 957 | + &&s.getXlBm().equals(line)){ | ||
| 958 | + newList.add(s); | ||
| 959 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 960 | + if(cts != null && cts.size() > 0){ | ||
| 961 | + newList_.add(s); | ||
| 962 | + }else{ | ||
| 963 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 964 | + newList_.add(s); | ||
| 965 | + } | ||
| 966 | + } | ||
| 967 | + } | ||
| 968 | + } | ||
| 969 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 970 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 971 | + double yygl=culateMileageService.culateSjgl(newList_); | ||
| 972 | + double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 973 | + double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 974 | + double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 975 | + | ||
| 976 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 977 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 978 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 979 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 980 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 981 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | ||
| 982 | + sin.setrQ(startDate); | ||
| 983 | +// sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | ||
| 984 | + sin.setSgh(""); | ||
| 985 | + sin.setsName(""); | ||
| 986 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 987 | + list_.add(sin); | ||
| 988 | + | ||
| 989 | + } | ||
| 990 | + Collections.sort(list_,new SingledataByXlbm()); | ||
| 991 | + }else{ | ||
| 992 | + String sql="select r.s_gh,r.s_name, " | ||
| 993 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" | ||
| 994 | + + " from bsth_c_s_sp_info_real r where " | ||
| 995 | + + " r.schedule_date_str = '"+startDate+"'" | ||
| 996 | + + " and r.s_gh !='' and r.s_gh is not null "; | ||
| 997 | + if(xlbm.equals("")){ | ||
| 998 | + sql +="and r.gs_bm='"+gsdm+"' " | ||
| 999 | + + " and r.fgs_bm='"+fgsdm+"'"; | ||
| 1000 | + }else{ | ||
| 1001 | + sql += " and r.xl_bm = '"+xlbm+"'"; | ||
| 1002 | + } | ||
| 1003 | + sql += " group by r.s_gh,r.s_name," | ||
| 1004 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | ||
| 1005 | + | ||
| 1006 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | ||
| 1007 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1008 | + @Override | ||
| 1009 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 1010 | + Singledata sin = new Singledata(); | ||
| 1011 | + sin.setrQ(startDate); | ||
| 1012 | + sin.setxL(arg0.getString("xl_bm")); | ||
| 1013 | + sin.setClzbh(arg0.getString("cl_zbh")); | ||
| 1014 | + sin.setSgh(arg0.getString("s_gh")); | ||
| 1015 | + sin.setsName(arg0.getString("s_name")); | ||
| 1016 | + return sin; | ||
| 1017 | + } | ||
| 1018 | + }); | ||
| 1019 | + | ||
| 1020 | + for (int i = 0; i < list.size(); i++) { | ||
| 1021 | + Singledata sin=list.get(i); | ||
| 1022 | + String jsy=sin.getSgh(); | ||
| 1023 | + String line=sin.getxL(); | ||
| 1024 | + String clzbh=sin.getClzbh(); | ||
| 1025 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 1026 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | ||
| 1027 | + | ||
| 1028 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 1029 | + ScheduleRealInfo s=listReal.get(j); | ||
| 1030 | + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 1031 | + &&s.getXlBm().equals(line)){ | ||
| 1032 | + newList.add(s); | ||
| 1033 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 1034 | + if(cts != null && cts.size() > 0){ | ||
| 1035 | + newList_.add(s); | ||
| 1036 | + }else{ | ||
| 1037 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 1038 | + newList_.add(s); | ||
| 1039 | + } | ||
| 1040 | + } | ||
| 1041 | + } | ||
| 1042 | + } | ||
| 1043 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 1044 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 1045 | + double yygl=culateMileageService.culateSjgl(newList_); | ||
| 1046 | + double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 1047 | + double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 1048 | + double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 1049 | + | ||
| 1050 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 1051 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 1052 | + | ||
| 1053 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 1054 | + | ||
| 1055 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 1056 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 1057 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | ||
| 1058 | + sin.setClzbh(clzbh); | ||
| 1059 | + sin.setJsy(""); | ||
| 1060 | + sin.setjName(""); | ||
| 1061 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 1062 | + sin.setHyl(""); | ||
| 1063 | + sin.setJzl(""); | ||
| 1064 | + sin.setUnyyyl(""); | ||
| 1065 | + list_.add(sin); | ||
| 1066 | + } | ||
| 1067 | + Collections.sort(list_,new SingledataByXlbm()); | ||
| 1068 | + } | ||
| 1069 | + return list_; | ||
| 1070 | + } | ||
| 1071 | + | ||
| 1072 | + | ||
| 636 | @Override | 1073 | @Override |
| 637 | - public List<Singledata> singledatatj(Map<String, Object> map) { | 1074 | + public List<Singledata> singledatatj2(Map<String, Object> map) { |
| 638 | String gsdm=""; | 1075 | String gsdm=""; |
| 639 | if(map.get("gsdmSing")!=null){ | 1076 | if(map.get("gsdmSing")!=null){ |
| 640 | gsdm=map.get("gsdmSing").toString(); | 1077 | gsdm=map.get("gsdmSing").toString(); |
| @@ -857,14 +1294,17 @@ public class FormsServiceImpl implements FormsService { | @@ -857,14 +1294,17 @@ public class FormsServiceImpl implements FormsService { | ||
| 857 | } | 1294 | } |
| 858 | double jhgl=culateMileageService.culateJhgl(newList); | 1295 | double jhgl=culateMileageService.culateJhgl(newList); |
| 859 | double jhjcc=culateMileageService.culateJhJccgl(newList); | 1296 | double jhjcc=culateMileageService.culateJhJccgl(newList); |
| 860 | - double yygl=culateMileageService.culateSjgl(newList_); | ||
| 861 | - double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 862 | - double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 863 | - double jcgl=culateMileageService.culateJccgl(newList_); | 1297 | +// double yygl=culateMileageService.culateSjgl(newList_); |
| 1298 | +// double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 1299 | +// double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 1300 | +// double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 864 | 1301 | ||
| 865 | - double zyygl=Arith.add(yygl, ljgl); | ||
| 866 | - double zksgl=Arith.add(ksgl, jcgl); | 1302 | + double yygl=culateMileageService.culateSjgl_spy(newList_); |
| 1303 | + double ljgl=culateMileageService.culateLjgl_spy(newList_); | ||
| 867 | 1304 | ||
| 1305 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 1306 | +// double zksgl=Arith.add(ksgl, jcgl); | ||
| 1307 | + double zksgl=culateMileageService.culateSjfyylc_spy(newList_); | ||
| 868 | sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | 1308 | sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); |
| 869 | 1309 | ||
| 870 | sin.setEmptMileage(String.valueOf(zksgl)); | 1310 | sin.setEmptMileage(String.valueOf(zksgl)); |
| @@ -1562,6 +2002,284 @@ public class FormsServiceImpl implements FormsService { | @@ -1562,6 +2002,284 @@ public class FormsServiceImpl implements FormsService { | ||
| 1562 | } | 2002 | } |
| 1563 | return list; | 2003 | return list; |
| 1564 | } | 2004 | } |
| 2005 | + | ||
| 2006 | + | ||
| 2007 | + // 路单数据 | ||
| 2008 | + @Override | ||
| 2009 | + public List<Singledata> singledata2(Map<String, Object> map) { | ||
| 2010 | + | ||
| 2011 | + String gsdm=""; | ||
| 2012 | + if(map.get("gsdmSing")!=null){ | ||
| 2013 | + gsdm=map.get("gsdmSing").toString(); | ||
| 2014 | + } | ||
| 2015 | + String fgsdm=""; | ||
| 2016 | + if(map.get("fgsdmSing")!=null){ | ||
| 2017 | + fgsdm=map.get("fgsdmSing").toString(); | ||
| 2018 | + } | ||
| 2019 | + | ||
| 2020 | + String tjtype=map.get("tjtype").toString(); | ||
| 2021 | + String xlbm=map.get("line").toString().trim(); | ||
| 2022 | + startDate = map.get("startDate").toString(); | ||
| 2023 | + | ||
| 2024 | + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>(); | ||
| 2025 | + if(xlbm.equals("")){ | ||
| 2026 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineByGs_(gsdm, fgsdm, startDate); | ||
| 2027 | + }else{ | ||
| 2028 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineQp(xlbm, startDate); | ||
| 2029 | + } | ||
| 2030 | + List<Singledata> list=new ArrayList<Singledata>(); | ||
| 2031 | + List<Singledata> listY=new ArrayList<Singledata>(); | ||
| 2032 | + List<Singledata> listD=new ArrayList<Singledata>(); | ||
| 2033 | + | ||
| 2034 | + if(tjtype.equals("jsy")){ | ||
| 2035 | + DecimalFormat df = new DecimalFormat("0.00"); | ||
| 2036 | + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | ||
| 2037 | + for (int i = 0; i < listYlb.size(); i++) { | ||
| 2038 | + Ylb y=listYlb.get(i); | ||
| 2039 | + boolean fage=false; | ||
| 2040 | + if(xlbm.equals("")){ | ||
| 2041 | + fage=true; | ||
| 2042 | + }else{ | ||
| 2043 | + if(xlbm.equals(y.getXlbm())){ | ||
| 2044 | + fage=true; | ||
| 2045 | + } | ||
| 2046 | + } | ||
| 2047 | + if(fage){ | ||
| 2048 | + String jsy=y.getJsy(); | ||
| 2049 | + String line=y.getXlbm(); | ||
| 2050 | + String clzbh=y.getNbbm(); | ||
| 2051 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 2052 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | ||
| 2053 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 2054 | + ScheduleRealInfo s=listReal.get(j); | ||
| 2055 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 2056 | + &&s.getXlBm().equals(line)){ | ||
| 2057 | + if(y.getLp()==null){ | ||
| 2058 | + newList.add(s); | ||
| 2059 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 2060 | + if(cts != null && cts.size() > 0){ | ||
| 2061 | + newList_.add(s); | ||
| 2062 | + }else{ | ||
| 2063 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 2064 | + newList_.add(s); | ||
| 2065 | + } | ||
| 2066 | + } | ||
| 2067 | + }else{ | ||
| 2068 | + if(y.getLp().equals(s.getLpName())){ | ||
| 2069 | + newList.add(s); | ||
| 2070 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 2071 | + if(cts != null && cts.size() > 0){ | ||
| 2072 | + newList_.add(s); | ||
| 2073 | + }else{ | ||
| 2074 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 2075 | + newList_.add(s); | ||
| 2076 | + } | ||
| 2077 | + } | ||
| 2078 | + } | ||
| 2079 | + } | ||
| 2080 | + } | ||
| 2081 | + } | ||
| 2082 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 2083 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 2084 | + double yygl=culateMileageService.culateSjgl(newList_); | ||
| 2085 | + double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 2086 | + double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 2087 | + double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 2088 | + | ||
| 2089 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 2090 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 2091 | + | ||
| 2092 | + Singledata sin=new Singledata(); | ||
| 2093 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 2094 | + | ||
| 2095 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 2096 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 2097 | + sin.setxL(y.getXlbm()); | ||
| 2098 | + sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | ||
| 2099 | + sin.setClzbh(clzbh); | ||
| 2100 | + sin.setJsy(jsy); | ||
| 2101 | + sin.setrQ(startDate); | ||
| 2102 | + if(newList.size()>0){ | ||
| 2103 | + sin.setjName(newList.get(0).getjName()); | ||
| 2104 | + }else{ | ||
| 2105 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | ||
| 2106 | + } | ||
| 2107 | + sin.setSgh(""); | ||
| 2108 | + sin.setsName(""); | ||
| 2109 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 2110 | + sin.setHyl(df.format(y.getYh())); | ||
| 2111 | + sin.setJzl(df.format(y.getJzl())); | ||
| 2112 | + sin.setUnyyyl(df.format(y.getSh())); | ||
| 2113 | + listY.add(sin); | ||
| 2114 | + } | ||
| 2115 | + | ||
| 2116 | + } | ||
| 2117 | + | ||
| 2118 | + List<Dlb> listDlb= dlbRepository.obtainDl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | ||
| 2119 | + for (int i = 0; i < listDlb.size(); i++) { | ||
| 2120 | + Dlb y=listDlb.get(i); | ||
| 2121 | + boolean fage=false; | ||
| 2122 | + if(xlbm.equals("")){ | ||
| 2123 | + fage=true; | ||
| 2124 | + }else{ | ||
| 2125 | + if(xlbm.equals(y.getXlbm())){ | ||
| 2126 | + fage=true; | ||
| 2127 | + } | ||
| 2128 | + } | ||
| 2129 | + if(fage){ | ||
| 2130 | + String jsy=y.getJsy(); | ||
| 2131 | + String line=y.getXlbm(); | ||
| 2132 | + String clzbh=y.getNbbm(); | ||
| 2133 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 2134 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | ||
| 2135 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 2136 | + ScheduleRealInfo s=listReal.get(j); | ||
| 2137 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 2138 | + &&s.getXlBm().equals(line)){ | ||
| 2139 | + if(y.getLp()==null){ | ||
| 2140 | + newList.add(s); | ||
| 2141 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 2142 | + if(cts != null && cts.size() > 0){ | ||
| 2143 | + newList_.add(s); | ||
| 2144 | + }else{ | ||
| 2145 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 2146 | + newList_.add(s); | ||
| 2147 | + } | ||
| 2148 | + } | ||
| 2149 | + }else{ | ||
| 2150 | + if(y.getLp().equals(s.getLpName())){ | ||
| 2151 | + newList.add(s); | ||
| 2152 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 2153 | + if(cts != null && cts.size() > 0){ | ||
| 2154 | + newList_.add(s); | ||
| 2155 | + }else{ | ||
| 2156 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 2157 | + newList_.add(s); | ||
| 2158 | + } | ||
| 2159 | + } | ||
| 2160 | + } | ||
| 2161 | + } | ||
| 2162 | + } | ||
| 2163 | + } | ||
| 2164 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 2165 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 2166 | + double yygl=culateMileageService.culateSjgl(newList_); | ||
| 2167 | + double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 2168 | + double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 2169 | + double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 2170 | + | ||
| 2171 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 2172 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 2173 | + | ||
| 2174 | + Singledata sin=new Singledata(); | ||
| 2175 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 2176 | + | ||
| 2177 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 2178 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 2179 | + sin.setxL(y.getXlbm()); | ||
| 2180 | + sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | ||
| 2181 | + sin.setClzbh(clzbh); | ||
| 2182 | + sin.setJsy(jsy); | ||
| 2183 | + sin.setrQ(startDate); | ||
| 2184 | + if(newList.size()>0){ | ||
| 2185 | + sin.setjName(newList.get(0).getjName()); | ||
| 2186 | + }else{ | ||
| 2187 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | ||
| 2188 | + } | ||
| 2189 | + sin.setSgh(""); | ||
| 2190 | + sin.setsName(""); | ||
| 2191 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 2192 | + sin.setHyl(df.format(y.getHd())); | ||
| 2193 | + sin.setJzl(df.format(y.getCdl())); | ||
| 2194 | + sin.setUnyyyl(df.format(y.getSh())); | ||
| 2195 | + listD.add(sin); | ||
| 2196 | + } | ||
| 2197 | + } | ||
| 2198 | + | ||
| 2199 | + Collections.sort(listY,new SingledataByXlbm()); | ||
| 2200 | + Collections.sort(listD,new SingledataByXlbm()); | ||
| 2201 | + list.addAll(listY); | ||
| 2202 | + list.addAll(listD); | ||
| 2203 | + }else{ | ||
| 2204 | + String sql="select r.s_gh,r.s_name, " | ||
| 2205 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" | ||
| 2206 | + + " from bsth_c_s_sp_info_real r where " | ||
| 2207 | + + " r.schedule_date_str = '"+startDate+"'" | ||
| 2208 | + + " and r.s_gh !='' and r.s_gh is not null "; | ||
| 2209 | + if(xlbm.equals("")){ | ||
| 2210 | + sql +="and r.gs_bm='"+gsdm+"' " | ||
| 2211 | + + " and r.fgs_bm='"+fgsdm+"'"; | ||
| 2212 | + }else{ | ||
| 2213 | + sql += " and r.xl_bm = '"+xlbm+"'"; | ||
| 2214 | + } | ||
| 2215 | + sql += " group by r.s_gh,r.s_name," | ||
| 2216 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | ||
| 2217 | + | ||
| 2218 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | ||
| 2219 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 2220 | + @Override | ||
| 2221 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 2222 | + Singledata sin = new Singledata(); | ||
| 2223 | + sin.setrQ(startDate); | ||
| 2224 | + sin.setxL(arg0.getString("xl_bm")); | ||
| 2225 | + sin.setClzbh(arg0.getString("cl_zbh")); | ||
| 2226 | + sin.setSgh(arg0.getString("s_gh")); | ||
| 2227 | + sin.setsName(arg0.getString("s_name")); | ||
| 2228 | + return sin; | ||
| 2229 | + } | ||
| 2230 | + }); | ||
| 2231 | + | ||
| 2232 | + for (int i = 0; i < list.size(); i++) { | ||
| 2233 | + Singledata sin=list.get(i); | ||
| 2234 | + String jsy=sin.getSgh(); | ||
| 2235 | + String line=sin.getxL(); | ||
| 2236 | + String clzbh=sin.getClzbh(); | ||
| 2237 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 2238 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | ||
| 2239 | + | ||
| 2240 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 2241 | + ScheduleRealInfo s=listReal.get(j); | ||
| 2242 | + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 2243 | + &&s.getXlBm().equals(line)){ | ||
| 2244 | + newList.add(s); | ||
| 2245 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 2246 | + if(cts != null && cts.size() > 0){ | ||
| 2247 | + newList_.add(s); | ||
| 2248 | + }else{ | ||
| 2249 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 2250 | + newList_.add(s); | ||
| 2251 | + } | ||
| 2252 | + } | ||
| 2253 | + } | ||
| 2254 | + } | ||
| 2255 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 2256 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 2257 | +// double yygl=culateMileageService.culateSjgl(newList_); | ||
| 2258 | +// double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 2259 | +// double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 2260 | +// double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 2261 | + double yygl=culateMileageService.culateSjgl_spy(newList_); | ||
| 2262 | + double ljgl=culateMileageService.culateLjgl_spy(newList_); | ||
| 2263 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 2264 | +// double zksgl=Arith.add(ksgl, jcgl); | ||
| 2265 | + double zksgl=culateMileageService.culateSjfyylc_spy(newList_); | ||
| 2266 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 2267 | + | ||
| 2268 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 2269 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 2270 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | ||
| 2271 | + sin.setClzbh(clzbh); | ||
| 2272 | + sin.setJsy(""); | ||
| 2273 | + sin.setjName(""); | ||
| 2274 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 2275 | + sin.setHyl(""); | ||
| 2276 | + sin.setJzl(""); | ||
| 2277 | + sin.setUnyyyl(""); | ||
| 2278 | + } | ||
| 2279 | + Collections.sort(list,new SingledataByXlbm()); | ||
| 2280 | + } | ||
| 2281 | + return list; | ||
| 2282 | + } | ||
| 1565 | 2283 | ||
| 1566 | // 运营服务阶段报表 | 2284 | // 运营服务阶段报表 |
| 1567 | @Override | 2285 | @Override |
| @@ -1961,6 +2679,7 @@ public class FormsServiceImpl implements FormsService { | @@ -1961,6 +2679,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 1961 | tempMap.put("jhbc", jhbc); | 2679 | tempMap.put("jhbc", jhbc); |
| 1962 | tempMap.put("sjbc", sjbc); | 2680 | tempMap.put("sjbc", sjbc); |
| 1963 | tempMap.put("qz", qz); | 2681 | tempMap.put("qz", qz); |
| 2682 | + tempMap.put("sm", ""); | ||
| 1964 | if(jhcc != 0 && sjcc != 0){ | 2683 | if(jhcc != 0 && sjcc != 0){ |
| 1965 | tempMap.put("ccl", numberFormat.format(((float)sjcc / jhcc)*100)+"%"); | 2684 | tempMap.put("ccl", numberFormat.format(((float)sjcc / jhcc)*100)+"%"); |
| 1966 | }else{ | 2685 | }else{ |
src/main/java/com/bsth/service/gps/GpsService.java
| @@ -13,7 +13,7 @@ public interface GpsService { | @@ -13,7 +13,7 @@ public interface GpsService { | ||
| 13 | 13 | ||
| 14 | List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions); | 14 | List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions); |
| 15 | 15 | ||
| 16 | - List<Map<String, Object>> history(String[] nbbmArray, Long st, Long et); | 16 | + Map<String, Object> history(String[] nbbmArray, Long st, Long et); |
| 17 | 17 | ||
| 18 | Map<String, Object> findBuffAeraByCode(String code, String type); | 18 | Map<String, Object> findBuffAeraByCode(String code, String type); |
| 19 | 19 |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -168,10 +168,12 @@ public class GpsServiceImpl implements GpsService { | @@ -168,10 +168,12 @@ public class GpsServiceImpl implements GpsService { | ||
| 168 | 168 | ||
| 169 | private static DateTimeFormatter fmtyyyy = DateTimeFormat.forPattern("yyyy"); | 169 | private static DateTimeFormatter fmtyyyy = DateTimeFormat.forPattern("yyyy"); |
| 170 | @Override | 170 | @Override |
| 171 | - public List<Map<String, Object>> history(String[] nbbmArray, Long st, Long et) { | 171 | + public Map<String, Object> history(String[] nbbmArray, Long st, Long et) { |
| 172 | + Map<String, Object> rsMap = new HashMap<>(); | ||
| 172 | List<Map<String, Object>> list = new ArrayList<>(); | 173 | List<Map<String, Object>> list = new ArrayList<>(); |
| 174 | + rsMap.put("list", list); | ||
| 173 | if (et - st > GPS_RANGE) | 175 | if (et - st > GPS_RANGE) |
| 174 | - return list; | 176 | + return rsMap; |
| 175 | 177 | ||
| 176 | st = st * 1000; | 178 | st = st * 1000; |
| 177 | et = et * 1000; | 179 | et = et * 1000; |
| @@ -186,24 +188,9 @@ public class GpsServiceImpl implements GpsService { | @@ -186,24 +188,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 186 | String nbbm = nbbmArray[0]; | 188 | String nbbm = nbbmArray[0]; |
| 187 | 189 | ||
| 188 | List<DeviceChange> dcs = findDeviceChangeLogs(nbbm, et, st); | 190 | List<DeviceChange> dcs = findDeviceChangeLogs(nbbm, et, st); |
| 189 | - //没有设备变更记录,则参考车辆信息上的设备号 | ||
| 190 | - if(null == dcs || dcs.size() == 0){ | ||
| 191 | - DeviceChange dc = new DeviceChange(); | ||
| 192 | - dc.setNbbm(nbbm); | ||
| 193 | - dc.setDevice(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); | ||
| 194 | - dc.setSt(st); | ||
| 195 | - dc.setEt(et); | ||
| 196 | - | ||
| 197 | - dcs.add(dc); | ||
| 198 | - } | ||
| 199 | - | ||
| 200 | - //bsth_c_gps_info | ||
| 201 | - String tableName = "bsth_c_gps_info"; | ||
| 202 | - String sYear = fmtyyyy.print(st), | ||
| 203 | - currYear = fmtyyyy.print(System.currentTimeMillis()); | ||
| 204 | 191 | ||
| 205 | - if(!sYear.equals(currYear)) | ||
| 206 | - tableName += "_" + sYear; | 192 | + //按年分表 |
| 193 | + String tableName = "bsth_c_gps_info_" + fmtyyyy.print(st); | ||
| 207 | 194 | ||
| 208 | StringBuilder sql = new StringBuilder(""); | 195 | StringBuilder sql = new StringBuilder(""); |
| 209 | long t1,t2; | 196 | long t1,t2; |
| @@ -214,16 +201,16 @@ public class GpsServiceImpl implements GpsService { | @@ -214,16 +201,16 @@ public class GpsServiceImpl implements GpsService { | ||
| 214 | dc = dcs.get(i); | 201 | dc = dcs.get(i); |
| 215 | if(dc.getSt() > st) | 202 | if(dc.getSt() > st) |
| 216 | t1 = dc.getSt(); | 203 | t1 = dc.getSt(); |
| 217 | - if(dc.getEt() < et) | 204 | + if(dc.getEt() < et && dc.getEt()!=0) |
| 218 | t2 = dc.getEt(); | 205 | t2 = dc.getEt(); |
| 219 | 206 | ||
| 220 | sql.append("select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO,DIRECTION,LINE_ID,SPEED_GPS,SECTION_CODE from "+tableName+" where days_year in ("+sDayOfYear+","+eDayOfYear+") " + | 207 | sql.append("select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO,DIRECTION,LINE_ID,SPEED_GPS,SECTION_CODE from "+tableName+" where days_year in ("+sDayOfYear+","+eDayOfYear+") " + |
| 221 | - " and device_id='"+dc.getDevice()+"' and ts > "+t1+" and ts < "+t2+" "); | 208 | + " and device_id='"+dc.getDevice()+"' and ts >= "+t1+" and ts <= "+t2+" "); |
| 222 | 209 | ||
| 223 | if(i == len - 1) | 210 | if(i == len - 1) |
| 224 | sql.append(" ORDER BY device_id,ts,stop_no"); | 211 | sql.append(" ORDER BY device_id,ts,stop_no"); |
| 225 | else | 212 | else |
| 226 | - sql.append(" UNION"); | 213 | + sql.append(" UNION "); |
| 227 | } | 214 | } |
| 228 | 215 | ||
| 229 | logger.info("轨迹回放 nbbm: " + nbbm + " -st: " + st + " -et: " + et + " -sql: " + sql.toString()); | 216 | logger.info("轨迹回放 nbbm: " + nbbm + " -st: " + st + " -et: " + et + " -sql: " + sql.toString()); |
| @@ -302,7 +289,10 @@ public class GpsServiceImpl implements GpsService { | @@ -302,7 +289,10 @@ public class GpsServiceImpl implements GpsService { | ||
| 302 | return (int) (Long.parseLong(o1.get("ts").toString()) - Long.parseLong(o2.get("ts").toString())); | 289 | return (int) (Long.parseLong(o1.get("ts").toString()) - Long.parseLong(o2.get("ts").toString())); |
| 303 | } | 290 | } |
| 304 | }); | 291 | }); |
| 305 | - return list; | 292 | + |
| 293 | + rsMap.put("list", list); | ||
| 294 | + rsMap.put("dcs", dcs); | ||
| 295 | + return rsMap; | ||
| 306 | } | 296 | } |
| 307 | 297 | ||
| 308 | private String map_get_str(Map<String, Object> map, String key){ | 298 | private String map_get_str(Map<String, Object> map, String key){ |
| @@ -317,30 +307,52 @@ public class GpsServiceImpl implements GpsService { | @@ -317,30 +307,52 @@ public class GpsServiceImpl implements GpsService { | ||
| 317 | return map.containsKey(key)?Float.parseFloat(map.get(key).toString()):-1; | 307 | return map.containsKey(key)?Float.parseFloat(map.get(key).toString()):-1; |
| 318 | } | 308 | } |
| 319 | 309 | ||
| 320 | - private List<DeviceChange> findDeviceChangeLogs(String nbbm, long t, long st){ | 310 | + private List<DeviceChange> findDeviceChangeLogs(String nbbm, long et, long st){ |
| 321 | List<DeviceChange> dcs = null; | 311 | List<DeviceChange> dcs = null; |
| 322 | List<DeviceChange> rs = new ArrayList<>(); | 312 | List<DeviceChange> rs = new ArrayList<>(); |
| 323 | try{ | 313 | try{ |
| 324 | 314 | ||
| 325 | //JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); | 315 | //JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 326 | - dcs = jdbcTemplate.query("select cl_zbh as nbbm,new_device_no as device,UNIX_TIMESTAMP(qyrq) * 1000 as st from bsth_c_car_device where cl_zbh='"+nbbm+"' and UNIX_TIMESTAMP(qyrq)<" + (t / 1000) | 316 | + dcs = jdbcTemplate.query("select cl_zbh as nbbm,new_device_no as device,old_device_no as old_device,UNIX_TIMESTAMP(qyrq) * 1000 as st from bsth_c_car_device where is_cancel=0 and cl_zbh='"+nbbm+"' order by qyrq" |
| 327 | , BeanPropertyRowMapper.newInstance(DeviceChange.class)); | 317 | , BeanPropertyRowMapper.newInstance(DeviceChange.class)); |
| 328 | 318 | ||
| 329 | 319 | ||
| 330 | - Collections.sort(dcs, new Comparator<DeviceChange>() { | ||
| 331 | - @Override | ||
| 332 | - public int compare(DeviceChange d1, DeviceChange d2) { | ||
| 333 | - return (int) (d1.getSt() - d2.getSt()); | ||
| 334 | - } | ||
| 335 | - }); | 320 | + //生成一条初始记录 |
| 321 | + if(dcs.size() > 0){ | ||
| 322 | + DeviceChange first = dcs.get(0); | ||
| 336 | 323 | ||
| 324 | + DeviceChange initDv = new DeviceChange(); | ||
| 325 | + initDv.setDevice(first.getOldDevice()); | ||
| 326 | + if(StringUtils.isNotEmpty(initDv.getDevice())){ | ||
| 327 | + initDv.setNbbm(first.getNbbm()); | ||
| 328 | + initDv.setSt(0); | ||
| 329 | + initDv.setEt(first.getSt()); | ||
| 330 | + dcs.add(0, initDv); | ||
| 331 | + } | ||
| 332 | + } | ||
| 337 | for(int i = 0,len=dcs.size(); i < len - 1; i++){ | 333 | for(int i = 0,len=dcs.size(); i < len - 1; i++){ |
| 338 | dcs.get(i).setEt(dcs.get(i + 1).getSt()); | 334 | dcs.get(i).setEt(dcs.get(i + 1).getSt()); |
| 339 | } | 335 | } |
| 340 | 336 | ||
| 341 | for(DeviceChange dc : dcs){ | 337 | for(DeviceChange dc : dcs){ |
| 342 | - if(dc.getEt() > st) | ||
| 343 | - rs.add(dc); | 338 | + if(dc.getEt() < st && dc.getEt() != 0) |
| 339 | + continue; | ||
| 340 | + if(dc.getSt() > et) | ||
| 341 | + continue; | ||
| 342 | + | ||
| 343 | + rs.add(dc); | ||
| 344 | + } | ||
| 345 | + | ||
| 346 | + //没有设备变更记录,则参考车辆信息上的设备号 | ||
| 347 | + if(null == rs || rs.size() == 0){ | ||
| 348 | + DeviceChange dc = new DeviceChange(); | ||
| 349 | + dc.setNbbm(nbbm); | ||
| 350 | + dc.setDevice(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); | ||
| 351 | + dc.setSt(st); | ||
| 352 | + dc.setEt(et); | ||
| 353 | + dc.setType(1); | ||
| 354 | + | ||
| 355 | + rs.add(dc); | ||
| 344 | } | 356 | } |
| 345 | }catch (Exception e){ | 357 | }catch (Exception e){ |
| 346 | logger.error("", e); | 358 | logger.error("", e); |
| @@ -357,11 +369,14 @@ public class GpsServiceImpl implements GpsService { | @@ -357,11 +369,14 @@ public class GpsServiceImpl implements GpsService { | ||
| 357 | 369 | ||
| 358 | // weeks_year 分区字段 | 370 | // weeks_year 分区字段 |
| 359 | Calendar sCal = Calendar.getInstance(); | 371 | Calendar sCal = Calendar.getInstance(); |
| 360 | - sCal.setTime(new Date(st * 1000)); | 372 | + sCal.setTime(new Date(st)); |
| 361 | int sWeekOfYear = sCal.get(Calendar.WEEK_OF_YEAR); | 373 | int sWeekOfYear = sCal.get(Calendar.WEEK_OF_YEAR); |
| 362 | Calendar eCal = Calendar.getInstance(); | 374 | Calendar eCal = Calendar.getInstance(); |
| 363 | - eCal.setTime(new Date(et * 1000)); | ||
| 364 | - int eWeekOfYear = eCal.get(Calendar.DAY_OF_YEAR); | 375 | + eCal.setTime(new Date(et)); |
| 376 | + int eWeekOfYear = eCal.get(Calendar.WEEK_OF_YEAR); | ||
| 377 | + | ||
| 378 | + //按年分表 | ||
| 379 | + String tableName = "bsth_c_arrival_info_" + fmtyyyy.print(st); | ||
| 365 | 380 | ||
| 366 | StringBuilder sql = new StringBuilder(""); | 381 | StringBuilder sql = new StringBuilder(""); |
| 367 | long t1,t2; | 382 | long t1,t2; |
| @@ -372,18 +387,19 @@ public class GpsServiceImpl implements GpsService { | @@ -372,18 +387,19 @@ public class GpsServiceImpl implements GpsService { | ||
| 372 | dc = dcs.get(i); | 387 | dc = dcs.get(i); |
| 373 | if(dc.getSt() > st) | 388 | if(dc.getSt() > st) |
| 374 | t1 = dc.getSt(); | 389 | t1 = dc.getSt(); |
| 375 | - if(dc.getEt() < et) | 390 | + if(dc.getEt() < et && dc.getEt() != 0) |
| 376 | t2 = dc.getEt(); | 391 | t2 = dc.getEt(); |
| 377 | 392 | ||
| 378 | - sql.append("SELECT DEVICE_ID,LINE_ID as LINE_CODE,STOP_NO,TS,UP_DOWN,IN_OUT,WEEKS_YEAR,CREATE_DATE FROM bsth_c_arrival_info " + | ||
| 379 | - " where weeks_year in ("+sWeekOfYear+", "+eWeekOfYear+") and device_id='"+dc.getDevice()+"' and ts > "+t1+" and ts < " + t2); | 393 | + sql.append("SELECT DEVICE_ID,LINE_ID as LINE_CODE,STOP_NO,TS,UP_DOWN,IN_OUT,WEEKS_YEAR,CREATE_DATE FROM " + tableName + |
| 394 | + " where weeks_year in ("+sWeekOfYear+", "+eWeekOfYear+") and device_id='"+dc.getDevice()+"' and ts > "+t1+" and ts < " + t2); | ||
| 380 | 395 | ||
| 381 | if(i == len - 1) | 396 | if(i == len - 1) |
| 382 | - sql.append(" ORDER BY device_id,ts,stop_no"); | 397 | + sql.append(" ORDER BY device_id,ts,stop_no "); |
| 383 | else | 398 | else |
| 384 | - sql.append(" UNION"); | 399 | + sql.append(" UNION "); |
| 385 | } | 400 | } |
| 386 | 401 | ||
| 402 | + logger.info("arrivl sql : " + sql.toString()); | ||
| 387 | JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); | 403 | JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 388 | List<ArrivalEntity> list = jdbcTemplate_ms.query(sql.toString(), BeanPropertyRowMapper.newInstance(ArrivalEntity.class)); | 404 | List<ArrivalEntity> list = jdbcTemplate_ms.query(sql.toString(), BeanPropertyRowMapper.newInstance(ArrivalEntity.class)); |
| 389 | 405 | ||
| @@ -606,7 +622,7 @@ public class GpsServiceImpl implements GpsService { | @@ -606,7 +622,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 606 | 622 | ||
| 607 | try { | 623 | try { |
| 608 | //获取历史gps 数据 | 624 | //获取历史gps 数据 |
| 609 | - List<HistoryGps_DTO> list = HistoryGps_DTO.craete(history(new String[]{nbbm}, st, et)); | 625 | + List<HistoryGps_DTO> list = HistoryGps_DTO.craete((List<Map<String, Object>>) history(new String[]{nbbm}, st, et).get("list")); |
| 610 | if (list != null && list.size() > 0) { | 626 | if (list != null && list.size() > 0) { |
| 611 | //获取路段信息 | 627 | //获取路段信息 |
| 612 | String sql = "select ID, ST_AsText(GROAD_VECTOR) as GROAD_VECTOR,ROAD_CODE,ROAD_NAME,SPEED from bsth_c_road where road_code in(select section_code from bsth_c_sectionroute where line_code=? and destroy=0)"; | 628 | String sql = "select ID, ST_AsText(GROAD_VECTOR) as GROAD_VECTOR,ROAD_CODE,ROAD_NAME,SPEED from bsth_c_road where road_code in(select section_code from bsth_c_sectionroute where line_code=? and destroy=0)"; |
| @@ -655,7 +671,8 @@ public class GpsServiceImpl implements GpsService { | @@ -655,7 +671,8 @@ public class GpsServiceImpl implements GpsService { | ||
| 655 | 671 | ||
| 656 | try { | 672 | try { |
| 657 | //获取历史gps 数据 | 673 | //获取历史gps 数据 |
| 658 | - List<HistoryGps_DTOV3> list = HistoryGps_DTOV3.craete(history(new String[]{nbbm}, st, et)); | 674 | + Map<String, Object> gpsMap = history(new String[]{nbbm}, st, et); |
| 675 | + List<HistoryGps_DTOV3> list = HistoryGps_DTOV3.craete((List<Map<String, Object>>) gpsMap.get("list")); | ||
| 659 | if (list != null && list.size() > 0) { | 676 | if (list != null && list.size() > 0) { |
| 660 | //关联路段名称 | 677 | //关联路段名称 |
| 661 | Map<String, String> sectionCode2Name = GeoCacheData.sectionCode2NameMap(); | 678 | Map<String, String> sectionCode2Name = GeoCacheData.sectionCode2NameMap(); |
| @@ -696,6 +713,7 @@ public class GpsServiceImpl implements GpsService { | @@ -696,6 +713,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 696 | rs.put("speedList", speedList); | 713 | rs.put("speedList", speedList); |
| 697 | rs.put("outboundList", outboundList); | 714 | rs.put("outboundList", outboundList); |
| 698 | rs.put("sumMileage", new DecimalFormat(".##").format(sum / 1000)); | 715 | rs.put("sumMileage", new DecimalFormat(".##").format(sum / 1000)); |
| 716 | + rs.put("dcs", gpsMap.get("dcs")); | ||
| 699 | } catch (Exception e) { | 717 | } catch (Exception e) { |
| 700 | logger.error("", e); | 718 | logger.error("", e); |
| 701 | rs.put("status", ResponseCode.ERROR); | 719 | rs.put("status", ResponseCode.ERROR); |
| @@ -707,7 +725,7 @@ public class GpsServiceImpl implements GpsService { | @@ -707,7 +725,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 707 | @Override | 725 | @Override |
| 708 | public void trailExcel(String nbbm, long st, long et, HttpServletResponse resp) { | 726 | public void trailExcel(String nbbm, long st, long et, HttpServletResponse resp) { |
| 709 | //获取历史gps 数据 | 727 | //获取历史gps 数据 |
| 710 | - List<HistoryGps_DTOV3> list = HistoryGps_DTOV3.craete(history(new String[]{nbbm}, st, et)); | 728 | + List<HistoryGps_DTOV3> list = HistoryGps_DTOV3.craete((List<Map<String, Object>>) history(new String[]{nbbm}, st, et).get("list")); |
| 711 | if (list != null && list.size() > 0) { | 729 | if (list != null && list.size() > 0) { |
| 712 | //关联路段名称 | 730 | //关联路段名称 |
| 713 | Map<String, String> sectionCode2Name = GeoCacheData.sectionCode2NameMap(); | 731 | Map<String, String> sectionCode2Name = GeoCacheData.sectionCode2NameMap(); |
| @@ -862,27 +880,84 @@ public class GpsServiceImpl implements GpsService { | @@ -862,27 +880,84 @@ public class GpsServiceImpl implements GpsService { | ||
| 862 | 880 | ||
| 863 | @Override | 881 | @Override |
| 864 | public List<GpsSpeed_DTO> speeds(String nbbm, long st, long et) { | 882 | public List<GpsSpeed_DTO> speeds(String nbbm, long st, long et) { |
| 865 | - String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); | ||
| 866 | - String sql = "select vehicle, line, up_down, lon, lat, speed,timestamp from bsth_c_speeding where vehicle=? and timestamp>? and timestamp<?"; | 883 | + st = st * 1000; |
| 884 | + et = et * 1000; | ||
| 885 | + //按周分区 | ||
| 886 | + Calendar sCal = Calendar.getInstance(); | ||
| 887 | + sCal.setTime(new Date(st)); | ||
| 888 | + int sWeekYear = sCal.get(Calendar.WEEK_OF_YEAR); | ||
| 889 | + Calendar eCal = Calendar.getInstance(); | ||
| 890 | + eCal.setTime(new Date(et)); | ||
| 891 | + int eWeekYear = eCal.get(Calendar.WEEK_OF_YEAR); | ||
| 892 | + | ||
| 893 | + //按年分表 | ||
| 894 | + String tableName = "bsth_c_speeding_" + fmtyyyy.print(st); | ||
| 867 | 895 | ||
| 868 | - return GpsSpeed_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st * 1000, et * 1000)); | 896 | + List<DeviceChange> dcs = findDeviceChangeLogs(nbbm, et, st); |
| 897 | + StringBuilder sql = new StringBuilder(""); | ||
| 898 | + long t1,t2; | ||
| 899 | + DeviceChange dc; | ||
| 900 | + for(int i = 0,len=dcs.size(); i < len; i++){ | ||
| 901 | + t1 = st; | ||
| 902 | + t2 = et; | ||
| 903 | + dc = dcs.get(i); | ||
| 904 | + if(dc.getSt() > st) | ||
| 905 | + t1 = dc.getSt(); | ||
| 906 | + if(dc.getEt() < et && dc.getEt()!=0) | ||
| 907 | + t2 = dc.getEt(); | ||
| 908 | + | ||
| 909 | + sql.append(" select vehicle, line, up_down, lon, lat, speed,timestamp from "+tableName+" where " + | ||
| 910 | + " weeks_year in ("+sWeekYear+", "+eWeekYear+") and vehicle='"+dc.getDevice()+"' and timestamp>="+t1+" and timestamp<= " + t2); | ||
| 911 | + | ||
| 912 | + if(i == len - 1) | ||
| 913 | + sql.append(" ORDER BY vehicle,timestamp"); | ||
| 914 | + else | ||
| 915 | + sql.append(" UNION "); | ||
| 916 | + } | ||
| 917 | + | ||
| 918 | + logger.info("speed sql : " + sql.toString()); | ||
| 919 | + return GpsSpeed_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql.toString())); | ||
| 869 | } | 920 | } |
| 870 | 921 | ||
| 871 | @Override | 922 | @Override |
| 872 | public List<GpsOutbound_DTO> outbounds(String nbbm, long st, long et) { | 923 | public List<GpsOutbound_DTO> outbounds(String nbbm, long st, long et) { |
| 873 | - /** | ||
| 874 | - * 如果 st 和 et 跨了周分区,也只查询st 分区的数据。 | ||
| 875 | - */ | ||
| 876 | st = st * 1000; | 924 | st = st * 1000; |
| 877 | et = et * 1000; | 925 | et = et * 1000; |
| 878 | //按周分区 | 926 | //按周分区 |
| 879 | - Calendar weekCal = Calendar.getInstance(); | ||
| 880 | - weekCal.setTimeInMillis(st); | ||
| 881 | - int weekYear = weekCal.get(Calendar.WEEK_OF_YEAR); | ||
| 882 | - //设备号 | ||
| 883 | - String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); | ||
| 884 | - String sql = "select vehicle,line,up_down,lon,lat,timestamp from bsth_c_outbound where weeks_year=" + weekYear + " and vehicle=? and timestamp>? and timestamp<?"; | ||
| 885 | - return GpsOutbound_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st, et)); | 927 | + Calendar sCal = Calendar.getInstance(); |
| 928 | + sCal.setTime(new Date(st)); | ||
| 929 | + int sWeekYear = sCal.get(Calendar.WEEK_OF_YEAR); | ||
| 930 | + Calendar eCal = Calendar.getInstance(); | ||
| 931 | + eCal.setTime(new Date(et)); | ||
| 932 | + int eWeekYear = eCal.get(Calendar.WEEK_OF_YEAR); | ||
| 933 | + | ||
| 934 | + //按年分表 | ||
| 935 | + String tableName = "bsth_c_outbound_" + fmtyyyy.print(st); | ||
| 936 | + | ||
| 937 | + List<DeviceChange> dcs = findDeviceChangeLogs(nbbm, et, st); | ||
| 938 | + StringBuilder sql = new StringBuilder(""); | ||
| 939 | + long t1,t2; | ||
| 940 | + DeviceChange dc; | ||
| 941 | + for(int i = 0,len=dcs.size(); i < len; i++){ | ||
| 942 | + t1 = st; | ||
| 943 | + t2 = et; | ||
| 944 | + dc = dcs.get(i); | ||
| 945 | + if(dc.getSt() > st) | ||
| 946 | + t1 = dc.getSt(); | ||
| 947 | + if(dc.getEt() < et && dc.getEt()!=0) | ||
| 948 | + t2 = dc.getEt(); | ||
| 949 | + | ||
| 950 | + sql.append("select vehicle,line,up_down,lon,lat,timestamp from "+tableName+" where " + | ||
| 951 | + " weeks_year in ("+sWeekYear+", "+eWeekYear+") and vehicle='"+dc.getDevice()+"' and timestamp>="+t1+" and timestamp<=" + t2); | ||
| 952 | + | ||
| 953 | + if(i == len - 1) | ||
| 954 | + sql.append(" ORDER BY vehicle,timestamp"); | ||
| 955 | + else | ||
| 956 | + sql.append(" UNION "); | ||
| 957 | + } | ||
| 958 | + | ||
| 959 | + logger.info("outbounds sql : " + sql.toString()); | ||
| 960 | + return GpsOutbound_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql.toString())); | ||
| 886 | } | 961 | } |
| 887 | 962 | ||
| 888 | @Override | 963 | @Override |
src/main/java/com/bsth/service/gps/entity/DeviceChange.java
| @@ -7,10 +7,14 @@ package com.bsth.service.gps.entity; | @@ -7,10 +7,14 @@ package com.bsth.service.gps.entity; | ||
| 7 | public class DeviceChange { | 7 | public class DeviceChange { |
| 8 | 8 | ||
| 9 | private String nbbm; | 9 | private String nbbm; |
| 10 | + private String oldDevice; | ||
| 10 | private String device; | 11 | private String device; |
| 11 | private long st; | 12 | private long st; |
| 12 | private long et; | 13 | private long et; |
| 13 | 14 | ||
| 15 | + //为1 表示没有设备变更记录,直接从车辆信息上关联的设备号 | ||
| 16 | + private int type=0; | ||
| 17 | + | ||
| 14 | public String getNbbm() { | 18 | public String getNbbm() { |
| 15 | return nbbm; | 19 | return nbbm; |
| 16 | } | 20 | } |
| @@ -42,4 +46,20 @@ public class DeviceChange { | @@ -42,4 +46,20 @@ public class DeviceChange { | ||
| 42 | public void setEt(long et) { | 46 | public void setEt(long et) { |
| 43 | this.et = et; | 47 | this.et = et; |
| 44 | } | 48 | } |
| 49 | + | ||
| 50 | + public int getType() { | ||
| 51 | + return type; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + public void setType(int type) { | ||
| 55 | + this.type = type; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public String getOldDevice() { | ||
| 59 | + return oldDevice; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + public void setOldDevice(String oldDevice) { | ||
| 63 | + this.oldDevice = oldDevice; | ||
| 64 | + } | ||
| 45 | } | 65 | } |
src/main/java/com/bsth/service/impl/LineVersionsServiceImpl.java
| @@ -202,6 +202,8 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | @@ -202,6 +202,8 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | ||
| 202 | // 更新线路版本 | 202 | // 更新线路版本 |
| 203 | repository.updateOdlVersions(lineId, lineCode); | 203 | repository.updateOdlVersions(lineId, lineCode); |
| 204 | repository.updateNewVersions(lineId,lineCode,versions); | 204 | repository.updateNewVersions(lineId,lineCode,versions); |
| 205 | + // 记录版本更新日志 | ||
| 206 | + jdbcTemplate.update("INSERT into bsth_c_line_versions_enablog(line_code,`line_versions`,`t`) VALUES (?,?,?)",lineCode,versions, lineVersions.getStartDate().getTime()); | ||
| 205 | } | 207 | } |
| 206 | } | 208 | } |
| 207 | return list; | 209 | return list; |
| @@ -235,7 +237,8 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | @@ -235,7 +237,8 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | ||
| 235 | lineVersions.setStartDate(new java.sql.Date(startDate.getTime())); | 237 | lineVersions.setStartDate(new java.sql.Date(startDate.getTime())); |
| 236 | lineVersions.setEndDate(new java.sql.Date(endDate.getTime())); | 238 | lineVersions.setEndDate(new java.sql.Date(endDate.getTime())); |
| 237 | lineVersions.setVersions(versions); | 239 | lineVersions.setVersions(versions); |
| 238 | - lineVersions.setStatus(Integer.valueOf(map.get("status").toString())); | 240 | + // 添加的线路版本默认为待更新的 |
| 241 | + lineVersions.setStatus(2); | ||
| 239 | lineVersions.setRemark(map.get("remark").toString()); | 242 | lineVersions.setRemark(map.get("remark").toString()); |
| 240 | repository.save(lineVersions); | 243 | repository.save(lineVersions); |
| 241 | // 更新上一版本时间 | 244 | // 更新上一版本时间 |
src/main/java/com/bsth/service/impl/SectionServiceImpl.java
| @@ -172,7 +172,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -172,7 +172,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 172 | SectionRoute route = new SectionRoute(); | 172 | SectionRoute route = new SectionRoute(); |
| 173 | Line line = lineRepository.findOne(sectionRouteLine); | 173 | Line line = lineRepository.findOne(sectionRouteLine); |
| 174 | Section section = repository.findOne(sectionId); | 174 | Section section = repository.findOne(sectionId); |
| 175 | - route.setSectionrouteCode(sectionrouteCode+i*100); | 175 | + route.setSectionrouteCode(sectionrouteCode+i); |
| 176 | route.setLineCode(lineCode); | 176 | route.setLineCode(lineCode); |
| 177 | route.setSectionCode(sectionCode); | 177 | route.setSectionCode(sectionCode); |
| 178 | route.setDirections(directions); | 178 | route.setDirections(directions); |
| @@ -306,7 +306,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -306,7 +306,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 306 | LsSectionRoute route = new LsSectionRoute(); | 306 | LsSectionRoute route = new LsSectionRoute(); |
| 307 | Line line = lineRepository.findOne(sectionRouteLine); | 307 | Line line = lineRepository.findOne(sectionRouteLine); |
| 308 | Section section = repository.findOne(sectionId); | 308 | Section section = repository.findOne(sectionId); |
| 309 | - route.setSectionrouteCode(sectionrouteCode+i*100); | 309 | + route.setSectionrouteCode(sectionrouteCode+i); |
| 310 | route.setLineCode(lineCode); | 310 | route.setLineCode(lineCode); |
| 311 | route.setSectionCode(sectionCode); | 311 | route.setSectionCode(sectionCode); |
| 312 | route.setDirections(directions); | 312 | route.setDirections(directions); |
| @@ -405,9 +405,9 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -405,9 +405,9 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 405 | Integer routeCode = 0; | 405 | Integer routeCode = 0; |
| 406 | if(!sectionrouteCode.equals("")){ | 406 | if(!sectionrouteCode.equals("")){ |
| 407 | String sectionrouteCodeArray[] = sectionrouteCode.split("_"); | 407 | String sectionrouteCodeArray[] = sectionrouteCode.split("_"); |
| 408 | - routeCode = Integer.valueOf(sectionrouteCodeArray[0])+100; | 408 | + routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1; |
| 409 | }else { | 409 | }else { |
| 410 | - routeCode = 100; | 410 | + routeCode = 1; |
| 411 | } | 411 | } |
| 412 | // 增加路段序号 | 412 | // 增加路段序号 |
| 413 | 413 | ||
| @@ -455,11 +455,11 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -455,11 +455,11 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 455 | } | 455 | } |
| 456 | repository.systemSave(sectionCode, sectionName, "", "", "", "", gsectionVector, bsectionVectorS, "", "", "", 0, 0, "", 0, "", 1, sectionId); | 456 | repository.systemSave(sectionCode, sectionName, "", "", "", "", gsectionVector, bsectionVectorS, "", "", "", 0, 0, "", 0, "", 1, sectionId); |
| 457 | 457 | ||
| 458 | - routeRepository.sectionUpdSectionRouteCode(lineId, directions,routeCode+i*100); | 458 | + routeRepository.sectionUpdSectionRouteCode(lineId, directions,routeCode+i); |
| 459 | SectionRoute route = new SectionRoute(); | 459 | SectionRoute route = new SectionRoute(); |
| 460 | Line line = lineRepository.findOne(lineId); | 460 | Line line = lineRepository.findOne(lineId); |
| 461 | Section section = repository.findOne(sectionId); | 461 | Section section = repository.findOne(sectionId); |
| 462 | - route.setSectionrouteCode(routeCode+i*100); | 462 | + route.setSectionrouteCode(routeCode+i); |
| 463 | route.setLineCode(lineCode); | 463 | route.setLineCode(lineCode); |
| 464 | route.setSectionCode(sectionCode); | 464 | route.setSectionCode(sectionCode); |
| 465 | route.setDirections(directions); | 465 | route.setDirections(directions); |
| @@ -662,11 +662,12 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -662,11 +662,12 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 662 | // 路段路由 | 662 | // 路段路由 |
| 663 | Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString()); | 663 | Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString()); |
| 664 | SectionRoute resultS = routeRepository.findOne(sectionRouteId); | 664 | SectionRoute resultS = routeRepository.findOne(sectionRouteId); |
| 665 | - int old_code = resultS.getSectionrouteCode(); | 665 | +// int old_code = resultS.getSectionrouteCode(); |
| 666 | + // 如果为空,默认在第一个路段 | ||
| 666 | if(sectionrouteCode!=null) { | 667 | if(sectionrouteCode!=null) { |
| 667 | - sectionrouteCode += 100; | 668 | + sectionrouteCode += 1; |
| 668 | }else { | 669 | }else { |
| 669 | - sectionrouteCode = old_code; | 670 | + sectionrouteCode = 1; |
| 670 | } | 671 | } |
| 671 | routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode); | 672 | routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode); |
| 672 | // 限速 | 673 | // 限速 |
| @@ -784,18 +785,14 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -784,18 +785,14 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 784 | Double sectionTime = map.get("sectionTime").equals("") ? null : Double.valueOf(map.get("sectionTime").toString()); | 785 | Double sectionTime = map.get("sectionTime").equals("") ? null : Double.valueOf(map.get("sectionTime").toString()); |
| 785 | // 路段路由 | 786 | // 路段路由 |
| 786 | // Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString()); | 787 | // Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString()); |
| 787 | - Integer sectionrouteCode = 100; | 788 | + Integer sectionrouteCode = 1; |
| 788 | SectionRouteCache resultS = routeCacheRepository.findOne(sectionRouteId); | 789 | SectionRouteCache resultS = routeCacheRepository.findOne(sectionRouteId); |
| 789 | int old_code = resultS.getSectionrouteCode(); | 790 | int old_code = resultS.getSectionrouteCode(); |
| 790 | if(sectionrouteCode!=null) { | 791 | if(sectionrouteCode!=null) { |
| 791 | - int new_code = sectionrouteCode+100; | ||
| 792 | - if(new_code==old_code){ | ||
| 793 | - sectionrouteCode = new_code; | ||
| 794 | - }else { | ||
| 795 | - sectionrouteCode = new_code-100+1; | ||
| 796 | - } | 792 | + sectionrouteCode += 1; |
| 793 | + // 默认是最前面路段 | ||
| 797 | }else { | 794 | }else { |
| 798 | - sectionrouteCode = old_code; | 795 | + sectionrouteCode = 1; |
| 799 | } | 796 | } |
| 800 | routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode); | 797 | routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode); |
| 801 | // 限速 | 798 | // 限速 |
| @@ -959,9 +956,9 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -959,9 +956,9 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 959 | Integer routeCode = null; | 956 | Integer routeCode = null; |
| 960 | if(!sectionrouteCode.equals("")){ | 957 | if(!sectionrouteCode.equals("")){ |
| 961 | String sectionrouteCodeArray[] = sectionrouteCode.split("_"); | 958 | String sectionrouteCodeArray[] = sectionrouteCode.split("_"); |
| 962 | - routeCode = Integer.valueOf(sectionrouteCodeArray[0])+100; | 959 | + routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1; |
| 963 | }else { | 960 | }else { |
| 964 | - routeCode = 100; | 961 | + routeCode = 1; |
| 965 | } | 962 | } |
| 966 | routeRepository.sectionUpdSectionRouteCode(lineId, directions, routeCode); | 963 | routeRepository.sectionUpdSectionRouteCode(lineId, directions, routeCode); |
| 967 | sectionRoute.setSectionrouteCode(routeCode); | 964 | sectionRoute.setSectionrouteCode(routeCode); |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| @@ -812,10 +812,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -812,10 +812,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 812 | } | 812 | } |
| 813 | 813 | ||
| 814 | /** | 814 | /** |
| 815 | + * 上传计划班次 指定日期 yyyy-MM-dd | ||
| 816 | + * @param theDate | ||
| 817 | + * @return | ||
| 818 | + */ | ||
| 819 | + public String setJHBC(String theDate){ | ||
| 820 | + return uploadJHBC(theDate); | ||
| 821 | + } | ||
| 822 | + | ||
| 823 | + /** | ||
| 824 | + * 上传计划班次 | ||
| 825 | + * @return | ||
| 826 | + */ | ||
| 827 | + public String setJHBC(){ | ||
| 828 | + return uploadJHBC(null); | ||
| 829 | + } | ||
| 830 | + /** | ||
| 815 | * 上传线路计划班次表 | 831 | * 上传线路计划班次表 |
| 816 | */ | 832 | */ |
| 817 | - @Override | ||
| 818 | - public String setJHBC() { | 833 | + |
| 834 | + private String uploadJHBC(String theDate) { | ||
| 819 | String result = "failure"; | 835 | String result = "failure"; |
| 820 | Line line; | 836 | Line line; |
| 821 | StringBuffer sBuffer =new StringBuffer(); | 837 | StringBuffer sBuffer =new StringBuffer(); |
| @@ -825,8 +841,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -825,8 +841,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 825 | SchedulePlanInfo schedulePlanInfo; | 841 | SchedulePlanInfo schedulePlanInfo; |
| 826 | String xlbm,zbh = ""; | 842 | String xlbm,zbh = ""; |
| 827 | Long lp = 0L; | 843 | Long lp = 0L; |
| 828 | - // 取明天的日期 | ||
| 829 | - String tomorrow = sdfnyr.format(DateUtils.addDays(new Date(), +1)); | 844 | + // 取得计划班次时间 |
| 845 | + String tomorrow = theDate == null ? sdfnyr.format(DateUtils.addDays(new Date(), +1)) : theDate; | ||
| 830 | // 查询所有班次 | 846 | // 查询所有班次 |
| 831 | List<SchedulePlanInfo> schedulePlanList = schedulePlanInfoRepository.findLineScheduleBc(tomorrow); | 847 | List<SchedulePlanInfo> schedulePlanList = schedulePlanInfoRepository.findLineScheduleBc(tomorrow); |
| 832 | int j = 0; // 初始化标识 | 848 | int j = 0; // 初始化标识 |
src/main/java/com/bsth/service/report/CulateMileageService.java
| @@ -14,6 +14,7 @@ public interface CulateMileageService { | @@ -14,6 +14,7 @@ public interface CulateMileageService { | ||
| 14 | List<Map<String,Object>> jobLjqk(List<ScheduleRealInfo> lists); | 14 | List<Map<String,Object>> jobLjqk(List<ScheduleRealInfo> lists); |
| 15 | double culateLjgl(List<ScheduleRealInfo> lists); | 15 | double culateLjgl(List<ScheduleRealInfo> lists); |
| 16 | double culateLjgl_(List<ScheduleRealInfo> lists,String item); | 16 | double culateLjgl_(List<ScheduleRealInfo> lists,String item); |
| 17 | + double culateLjgl_spy(List<ScheduleRealInfo> lists); | ||
| 17 | int culateLjbc(List<ScheduleRealInfo> lists,String item); | 18 | int culateLjbc(List<ScheduleRealInfo> lists,String item); |
| 18 | 19 | ||
| 19 | double culateJhgl(List<ScheduleRealInfo> lists); | 20 | double culateJhgl(List<ScheduleRealInfo> lists); |
| @@ -23,11 +24,13 @@ public interface CulateMileageService { | @@ -23,11 +24,13 @@ public interface CulateMileageService { | ||
| 23 | 24 | ||
| 24 | double culateSjgl(List<ScheduleRealInfo> lists); | 25 | double culateSjgl(List<ScheduleRealInfo> lists); |
| 25 | double culateSjgl_(List<ScheduleRealInfo> lists,String item); | 26 | double culateSjgl_(List<ScheduleRealInfo> lists,String item); |
| 27 | + | ||
| 28 | + double culateSjgl_spy(List<ScheduleRealInfo> lists); | ||
| 26 | int culateSjbc(List<ScheduleRealInfo> lists,String item); | 29 | int culateSjbc(List<ScheduleRealInfo> lists,String item); |
| 27 | 30 | ||
| 28 | double culateKsgl(List<ScheduleRealInfo> lists); | 31 | double culateKsgl(List<ScheduleRealInfo> lists); |
| 29 | double culateJccgl(List<ScheduleRealInfo> lists); | 32 | double culateJccgl(List<ScheduleRealInfo> lists); |
| 30 | - | 33 | + double culateSjfyylc_spy(List<ScheduleRealInfo> lists); |
| 31 | double culateJhJccgl(List<ScheduleRealInfo> lists); | 34 | double culateJhJccgl(List<ScheduleRealInfo> lists); |
| 32 | 35 | ||
| 33 | double culateCJLC(List<ScheduleRealInfo> lists,String item); | 36 | double culateCJLC(List<ScheduleRealInfo> lists,String item); |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| @@ -1476,5 +1476,130 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -1476,5 +1476,130 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 1476 | map.put("djgsj", djcsj); | 1476 | map.put("djgsj", djcsj); |
| 1477 | return map; | 1477 | return map; |
| 1478 | } | 1478 | } |
| 1479 | + | ||
| 1480 | + @Override | ||
| 1481 | + public double culateSjgl_spy(List<ScheduleRealInfo> lists) { | ||
| 1482 | + // 实际营运里程 | ||
| 1483 | + double sjgl = 0; | ||
| 1484 | + for (int i = 0; i < lists.size(); i++) { | ||
| 1485 | + ScheduleRealInfo scheduleRealInfo = lists.get(i); | ||
| 1486 | + if (!isInOut(scheduleRealInfo)) { | ||
| 1487 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 1488 | + if (!scheduleRealInfo.isSflj()) { | ||
| 1489 | + if (childTaskPlans.isEmpty()) { | ||
| 1490 | + if (!scheduleRealInfo.isDestroy()) { | ||
| 1491 | + double jhlcOrig = scheduleRealInfo.getJhlcOrig() == null ? 0 | ||
| 1492 | + : scheduleRealInfo.getJhlcOrig(); | ||
| 1493 | + double jhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); | ||
| 1494 | + if (jhlc - jhlcOrig > 0) { | ||
| 1495 | + sjgl = Arith.add(sjgl, jhlcOrig); | ||
| 1496 | + } else { | ||
| 1497 | + sjgl = Arith.add(sjgl, jhlc); | ||
| 1498 | + } | ||
| 1499 | + } | ||
| 1500 | + } else { | ||
| 1501 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 1502 | + while (it.hasNext()) { | ||
| 1503 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 1504 | + if (childTaskPlan.getMileageType().equals("service") | ||
| 1505 | + && "正常".equals(childTaskPlan.getType1()) && childTaskPlan.getCcId() == null | ||
| 1506 | + && (!childTaskPlan.isNoClerk())) { | ||
| 1507 | + if (!childTaskPlan.isDestroy()) { | ||
| 1508 | + Float jhgl = childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | ||
| 1509 | + sjgl = Arith.add(sjgl, jhgl); | ||
| 1510 | + } | ||
| 1511 | + } | ||
| 1512 | + } | ||
| 1513 | + } | ||
| 1514 | + } | ||
| 1515 | + } | ||
| 1516 | + } | ||
| 1517 | + return sjgl; | ||
| 1518 | + } | ||
| 1519 | + | ||
| 1520 | + @Override | ||
| 1521 | + public double culateSjfyylc_spy(List<ScheduleRealInfo> lists) { | ||
| 1522 | + // 实际非营运里程(售) | ||
| 1523 | + double sjgl = 0; | ||
| 1524 | + for (int i = 0; i < lists.size(); i++) { | ||
| 1525 | + ScheduleRealInfo scheduleRealInfo = lists.get(i); | ||
| 1526 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 1527 | + if (childTaskPlans.isEmpty()) { | ||
| 1528 | + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 1529 | + || scheduleRealInfo.getBcType().equals("ldks")) { | ||
| 1530 | + if (!scheduleRealInfo.isDestroy()) { | ||
| 1531 | + double jhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); | ||
| 1532 | + sjgl = Arith.add(sjgl, jhlc); | ||
| 1533 | + } | ||
| 1534 | + } | ||
| 1535 | + } else { | ||
| 1536 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 1537 | + while (it.hasNext()) { | ||
| 1538 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 1539 | + if (childTaskPlan.getMileageType().equals("empty") | ||
| 1540 | + && (!childTaskPlan.isNoClerk()) && childTaskPlan.getCcId() == null) { | ||
| 1541 | + if (!childTaskPlan.isDestroy()) { | ||
| 1542 | + Float jhgl = childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | ||
| 1543 | + sjgl = Arith.add(sjgl, jhgl); | ||
| 1544 | + } | ||
| 1545 | + } | ||
| 1546 | + } | ||
| 1547 | + } | ||
| 1548 | + } | ||
| 1549 | + return sjgl; | ||
| 1550 | + } | ||
| 1551 | + | ||
| 1552 | + @Override | ||
| 1553 | + public double culateLjgl_spy(List<ScheduleRealInfo> lists) { | ||
| 1554 | + // 临加营运里程(售) | ||
| 1555 | + double ljgl = 0; | ||
| 1556 | + for (int i = 0; i < lists.size(); i++) { | ||
| 1557 | + ScheduleRealInfo scheduleRealInfo = lists.get(i); | ||
| 1558 | + if (!isInOut(scheduleRealInfo)) { | ||
| 1559 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 1560 | + if (scheduleRealInfo.isSflj()) { | ||
| 1561 | + if (childTaskPlans.isEmpty()) { | ||
| 1562 | + if (!scheduleRealInfo.isDestroy()) | ||
| 1563 | + ljgl = Arith.add(ljgl, scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc()); | ||
| 1564 | + } else { | ||
| 1565 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 1566 | + while (it.hasNext()) { | ||
| 1567 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 1568 | + if (childTaskPlan.getMileageType().equals("service") && childTaskPlan.getCcId() == null | ||
| 1569 | + && (!childTaskPlan.isNoClerk())) { | ||
| 1570 | + if (!childTaskPlan.isDestroy()) { | ||
| 1571 | + Float jhgl = childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | ||
| 1572 | + ljgl = Arith.add(ljgl, jhgl); | ||
| 1573 | + } | ||
| 1574 | + } | ||
| 1575 | + } | ||
| 1576 | + } | ||
| 1577 | + } else { | ||
| 1578 | + if (childTaskPlans.isEmpty()) { | ||
| 1579 | + double jhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); | ||
| 1580 | + double jhlcOrig = scheduleRealInfo.getJhlcOrig() == null ? 0 : scheduleRealInfo.getJhlcOrig(); | ||
| 1581 | + double zjlc = Arith.sub(jhlc, jhlcOrig); | ||
| 1582 | + if (zjlc > 0) { | ||
| 1583 | + ljgl = Arith.add(zjlc, ljgl); | ||
| 1584 | + } | ||
| 1585 | + } else { | ||
| 1586 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 1587 | + while (it.hasNext()) { | ||
| 1588 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 1589 | + if ("service".equals(childTaskPlan.getMileageType()) | ||
| 1590 | + && "临加".equals(childTaskPlan.getType1()) && childTaskPlan.getCcId() == null | ||
| 1591 | + && (!childTaskPlan.isNoClerk())) { | ||
| 1592 | + if (!childTaskPlan.isDestroy()) { | ||
| 1593 | + Float jhgl = childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | ||
| 1594 | + ljgl = Arith.add(ljgl, jhgl); | ||
| 1595 | + } | ||
| 1596 | + } | ||
| 1597 | + } | ||
| 1598 | + } | ||
| 1599 | + } | ||
| 1600 | + } | ||
| 1601 | + } | ||
| 1602 | + return ljgl; | ||
| 1603 | + } | ||
| 1479 | 1604 | ||
| 1480 | } | 1605 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -96,7 +96,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -96,7 +96,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 96 | Long date1=simpleDateFormat.parse(date+" "+sjfc+":00").getTime(); | 96 | Long date1=simpleDateFormat.parse(date+" "+sjfc+":00").getTime(); |
| 97 | Long date2=simpleDateFormat.parse(date+" "+sjdd+":00").getTime(); | 97 | Long date2=simpleDateFormat.parse(date+" "+sjdd+":00").getTime(); |
| 98 | Date dates=simpleDateFormat.parse(date+" 00:00:00"); | 98 | Date dates=simpleDateFormat.parse(date+" 00:00:00"); |
| 99 | - List<ArrivalInfo> lists=load(line,sbbb,date1,date2,dates); | 99 | + List<ArrivalInfo> lists=load(line,sbbb,date1,date2,dates,date); |
| 100 | 100 | ||
| 101 | for(int i=0;i<lists.size();i++){ | 101 | for(int i=0;i<lists.size();i++){ |
| 102 | ArrivalInfo t1=lists.get(i); | 102 | ArrivalInfo t1=lists.get(i); |
| @@ -123,7 +123,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -123,7 +123,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | 125 | ||
| 126 | - public List<ArrivalInfo> load(String line,String sbbb,Long date1,Long date2,Date dates){ | 126 | + public List<ArrivalInfo> load(String line,String sbbb,Long date1,Long date2,Date dates,String date){ |
| 127 | List<ArrivalInfo> list = null; | 127 | List<ArrivalInfo> list = null; |
| 128 | Calendar cal = Calendar.getInstance(); | 128 | Calendar cal = Calendar.getInstance(); |
| 129 | cal.setTime(dates); | 129 | cal.setTime(dates); |
| @@ -133,8 +133,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -133,8 +133,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 133 | Connection conn = null; | 133 | Connection conn = null; |
| 134 | PreparedStatement ps = null; | 134 | PreparedStatement ps = null; |
| 135 | ResultSet rs = null; | 135 | ResultSet rs = null; |
| 136 | - | ||
| 137 | - String sql = "select * from bsth_c_arrival_info where device_id=? AND line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts"; | 136 | + String year=date.substring(0,4); |
| 137 | + String sql = "select * from bsth_c_arrival_info_"+year+" where device_id=? AND line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts"; | ||
| 138 | try{ | 138 | try{ |
| 139 | conn = DBUtils_MS.getConnection(); | 139 | conn = DBUtils_MS.getConnection(); |
| 140 | ps = conn.prepareStatement(sql); | 140 | ps = conn.prepareStatement(sql); |
| @@ -194,7 +194,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -194,7 +194,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 194 | Long date2=simpleDateFormat.parse(ddsj+":00").getTime(); | 194 | Long date2=simpleDateFormat.parse(ddsj+":00").getTime(); |
| 195 | Date dates1=simpleDateFormat.parse(fcsj+":00"); | 195 | Date dates1=simpleDateFormat.parse(fcsj+":00"); |
| 196 | Date dates2=simpleDateFormat.parse(ddsj+":00"); | 196 | Date dates2=simpleDateFormat.parse(ddsj+":00"); |
| 197 | - List<ArrivalInfo> lists=load2(line,date1,date2,dates1,dates2,zd,zdlx); | 197 | + List<ArrivalInfo> lists=load2(line,date1,date2,dates1,dates2,zd,zdlx,fcsj); |
| 198 | 198 | ||
| 199 | for(int i=0;i<lists.size();i++){ | 199 | for(int i=0;i<lists.size();i++){ |
| 200 | ArrivalInfo t1=lists.get(i); | 200 | ArrivalInfo t1=lists.get(i); |
| @@ -224,7 +224,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -224,7 +224,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | 226 | ||
| 227 | - public List<ArrivalInfo> load2(String line,Long date1,Long date2,Date dates1,Date dates2,String zd,String zdlx){ | 227 | + public List<ArrivalInfo> load2(String line,Long date1,Long date2,Date dates1,Date dates2,String zd,String zdlx,String fcsj){ |
| 228 | List<ArrivalInfo> list = null; | 228 | List<ArrivalInfo> list = null; |
| 229 | Calendar cal = Calendar.getInstance(); | 229 | Calendar cal = Calendar.getInstance(); |
| 230 | cal.setTime(dates1); | 230 | cal.setTime(dates1); |
| @@ -235,8 +235,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -235,8 +235,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 235 | Connection conn = null; | 235 | Connection conn = null; |
| 236 | PreparedStatement ps = null; | 236 | PreparedStatement ps = null; |
| 237 | ResultSet rs = null; | 237 | ResultSet rs = null; |
| 238 | - | ||
| 239 | - String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year>=? " | 238 | + String year=fcsj.substring(0,4); |
| 239 | + String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year>=? " | ||
| 240 | + " AND weeks_year<=? AND ts > ? AND ts <=? AND up_down=? AND stop_no like ? order by ts"; | 240 | + " AND weeks_year<=? AND ts > ? AND ts <=? AND up_down=? AND stop_no like ? order by ts"; |
| 241 | try{ | 241 | try{ |
| 242 | conn = DBUtils_MS.getConnection(); | 242 | conn = DBUtils_MS.getConnection(); |
| @@ -2025,7 +2025,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -2025,7 +2025,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2025 | public List<Map<String, Object>> lineList() { | 2025 | public List<Map<String, Object>> lineList() { |
| 2026 | // TODO Auto-generated method stub | 2026 | // TODO Auto-generated method stub |
| 2027 | List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | 2027 | List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); |
| 2028 | - Iterator<Line> iterator = lineRepository.findAll().iterator(); | 2028 | + Iterator<Line> iterator = lineRepository.findAllService().iterator(); |
| 2029 | Line line; | 2029 | Line line; |
| 2030 | while (iterator.hasNext()) { | 2030 | while (iterator.hasNext()) { |
| 2031 | line = iterator.next(); | 2031 | line = iterator.next(); |
| @@ -2179,8 +2179,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -2179,8 +2179,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2179 | Connection conn = null; | 2179 | Connection conn = null; |
| 2180 | PreparedStatement ps = null; | 2180 | PreparedStatement ps = null; |
| 2181 | ResultSet rs = null; | 2181 | ResultSet rs = null; |
| 2182 | - | ||
| 2183 | - String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? " | 2182 | + String year=date.substring(0,4); |
| 2183 | + String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year=? " | ||
| 2184 | + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts"; | 2184 | + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts"; |
| 2185 | try{ | 2185 | try{ |
| 2186 | conn = DBUtils_MS.getConnection(); | 2186 | conn = DBUtils_MS.getConnection(); |
| @@ -2229,8 +2229,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -2229,8 +2229,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2229 | Connection conn = null; | 2229 | Connection conn = null; |
| 2230 | PreparedStatement ps = null; | 2230 | PreparedStatement ps = null; |
| 2231 | ResultSet rs = null; | 2231 | ResultSet rs = null; |
| 2232 | - | ||
| 2233 | - String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? " | 2232 | + String year=date.substring(0,4); |
| 2233 | + String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year=? " | ||
| 2234 | + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts"; | 2234 | + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts"; |
| 2235 | try{ | 2235 | try{ |
| 2236 | conn = DBUtils_MS.getConnection(); | 2236 | conn = DBUtils_MS.getConnection(); |
| @@ -3529,7 +3529,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -3529,7 +3529,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3529 | Long date1 = simpleDateFormat.parse(date+" 00:00:01").getTime(); | 3529 | Long date1 = simpleDateFormat.parse(date+" 00:00:01").getTime(); |
| 3530 | Long date2=simpleDateFormat.parse(date+" 23:59:59").getTime(); | 3530 | Long date2=simpleDateFormat.parse(date+" 23:59:59").getTime(); |
| 3531 | Date dates=simpleDateFormat.parse(date+" 00:00:00"); | 3531 | Date dates=simpleDateFormat.parse(date+" 00:00:00"); |
| 3532 | - List<ArrivalInfo> lists=load_online(line,date1,date2,dates); | 3532 | + List<ArrivalInfo> lists=load_online(line,date1,date2,dates,date); |
| 3533 | for (int i = 0; i < list.size(); i++) { | 3533 | for (int i = 0; i < list.size(); i++) { |
| 3534 | String nbbm=list.get(i); | 3534 | String nbbm=list.get(i); |
| 3535 | String sbbb=BasicData.deviceId2NbbmMap.inverse().get(nbbm); | 3535 | String sbbb=BasicData.deviceId2NbbmMap.inverse().get(nbbm); |
| @@ -3582,7 +3582,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -3582,7 +3582,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3582 | return map; | 3582 | return map; |
| 3583 | } | 3583 | } |
| 3584 | 3584 | ||
| 3585 | - public List<ArrivalInfo> load_online(String line,Long date1,Long date2,Date dates){ | 3585 | + public List<ArrivalInfo> load_online(String line,Long date1,Long date2,Date dates,String date){ |
| 3586 | List<ArrivalInfo> list = null; | 3586 | List<ArrivalInfo> list = null; |
| 3587 | Calendar cal = Calendar.getInstance(); | 3587 | Calendar cal = Calendar.getInstance(); |
| 3588 | cal.setTime(dates); | 3588 | cal.setTime(dates); |
| @@ -3592,8 +3592,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -3592,8 +3592,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3592 | Connection conn = null; | 3592 | Connection conn = null; |
| 3593 | PreparedStatement ps = null; | 3593 | PreparedStatement ps = null; |
| 3594 | ResultSet rs = null; | 3594 | ResultSet rs = null; |
| 3595 | - | ||
| 3596 | - String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts"; | 3595 | + String year=date.substring(0,4); |
| 3596 | + String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts"; | ||
| 3597 | try{ | 3597 | try{ |
| 3598 | conn = DBUtils_MS.getConnection(); | 3598 | conn = DBUtils_MS.getConnection(); |
| 3599 | ps = conn.prepareStatement(sql); | 3599 | ps = conn.prepareStatement(sql); |
src/main/java/com/bsth/service/traffic/impl/VehicleInoutStopServiceImpl.java
| @@ -2,9 +2,12 @@ package com.bsth.service.traffic.impl; | @@ -2,9 +2,12 @@ package com.bsth.service.traffic.impl; | ||
| 2 | 2 | ||
| 3 | import com.bsth.entity.traffic.VehicleInoutStop; | 3 | import com.bsth.entity.traffic.VehicleInoutStop; |
| 4 | import com.bsth.service.impl.BaseServiceImpl; | 4 | import com.bsth.service.impl.BaseServiceImpl; |
| 5 | +import com.bsth.service.impl.TrafficManageServiceImpl; | ||
| 5 | import com.bsth.service.traffic.VehicleInoutStopService; | 6 | import com.bsth.service.traffic.VehicleInoutStopService; |
| 6 | import com.bsth.util.DateUtils; | 7 | import com.bsth.util.DateUtils; |
| 7 | import com.bsth.util.db.DBUtils_MS; | 8 | import com.bsth.util.db.DBUtils_MS; |
| 9 | +import org.slf4j.Logger; | ||
| 10 | +import org.slf4j.LoggerFactory; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.jdbc.core.JdbcTemplate; | 12 | import org.springframework.jdbc.core.JdbcTemplate; |
| 10 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
| @@ -30,9 +33,7 @@ import java.util.Map; | @@ -30,9 +33,7 @@ import java.util.Map; | ||
| 30 | 33 | ||
| 31 | @Service | 34 | @Service |
| 32 | public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutStop,Integer> implements VehicleInoutStopService { | 35 | public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutStop,Integer> implements VehicleInoutStopService { |
| 33 | - | ||
| 34 | - @Autowired | ||
| 35 | - JdbcTemplate jdbcTemplate; | 36 | + Logger logger = LoggerFactory.getLogger(TrafficManageServiceImpl.class); |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * 拼装sql | 39 | * 拼装sql |
| @@ -81,6 +82,7 @@ public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutSto | @@ -81,6 +82,7 @@ public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutSto | ||
| 81 | "if( up_down= 0,'上行','下行') as up_down ," + | 82 | "if( up_down= 0,'上行','下行') as up_down ," + |
| 82 | "if( in_out_stop= 0,'站内','站外') as in_out_stop , " + | 83 | "if( in_out_stop= 0,'站内','站外') as in_out_stop , " + |
| 83 | "stop,report_date FROM bsth_c_shreal " + packageParam(map,"") ; | 84 | "stop,report_date FROM bsth_c_shreal " + packageParam(map,"") ; |
| 85 | + logger.info("车载上报停靠站查询sql:"+sql); | ||
| 84 | List<Map<String, Object>> result = jdbcTemp.queryForList(sql); | 86 | List<Map<String, Object>> result = jdbcTemp.queryForList(sql); |
| 85 | return result; | 87 | return result; |
| 86 | } | 88 | } |
| @@ -94,6 +96,7 @@ public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutSto | @@ -94,6 +96,7 @@ public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutSto | ||
| 94 | JdbcTemplate jdbcTemp = new JdbcTemplate(DBUtils_MS.getDataSource()); | 96 | JdbcTemplate jdbcTemp = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 95 | String sql = "SELECT count(1) COUNT FROM bsth_c_shreal" + packageParam(map,"count"); | 97 | String sql = "SELECT count(1) COUNT FROM bsth_c_shreal" + packageParam(map,"count"); |
| 96 | long result = Long.valueOf(jdbcTemp.queryForMap(sql).get("COUNT")+""); | 98 | long result = Long.valueOf(jdbcTemp.queryForMap(sql).get("COUNT")+""); |
| 99 | + logger.info("车载上报停靠站查询count-sql:"+sql); | ||
| 97 | return result; | 100 | return result; |
| 98 | } | 101 | } |
| 99 | } | 102 | } |
src/main/java/com/bsth/websocket/dto/WsScheduleRealInfo.java
0 → 100644
| 1 | +package com.bsth.websocket.dto; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | ||
| 4 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 5 | + | ||
| 6 | +import javax.persistence.FetchType; | ||
| 7 | +import javax.persistence.OneToMany; | ||
| 8 | +import javax.persistence.Transient; | ||
| 9 | +import java.util.ArrayList; | ||
| 10 | +import java.util.HashSet; | ||
| 11 | +import java.util.List; | ||
| 12 | +import java.util.Set; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 精简字段的实际排班 entity | ||
| 16 | + * webSocket 传输用,去掉了页面不需要的一些字段 | ||
| 17 | + * Created by panzhao on 2017/11/14. | ||
| 18 | + */ | ||
| 19 | +public class WsScheduleRealInfo { | ||
| 20 | + | ||
| 21 | + public static WsScheduleRealInfo getInstance(ScheduleRealInfo sch){ | ||
| 22 | + if(null == sch) | ||
| 23 | + return null; | ||
| 24 | + WsScheduleRealInfo wss = new WsScheduleRealInfo(); | ||
| 25 | + wss.id = sch.getId(); | ||
| 26 | + wss.scheduleDateStr = sch.getScheduleDateStr(); | ||
| 27 | + wss.realExecDate = sch.getRealExecDate(); | ||
| 28 | + wss.xlName = sch.getXlName(); | ||
| 29 | + wss.xlBm = sch.getXlBm(); | ||
| 30 | + wss.lpName = sch.getLpName(); | ||
| 31 | + wss.clZbh = sch.getClZbh(); | ||
| 32 | + wss.jGh = sch.getjGh(); | ||
| 33 | + wss.jName = sch.getjName(); | ||
| 34 | + wss.sGh = sch.getsGh(); | ||
| 35 | + wss.sName = sch.getsName(); | ||
| 36 | + wss.xlDir = sch.getXlDir(); | ||
| 37 | + wss.qdzCode = sch.getQdzCode(); | ||
| 38 | + wss.qdzName = sch.getQdzName(); | ||
| 39 | + wss.zdzCode = sch.getZdzCode(); | ||
| 40 | + wss.zdzName = sch.getZdzName(); | ||
| 41 | + wss.fcsj = sch.getFcsj(); | ||
| 42 | + wss.fcsjT = sch.getFcsjT(); | ||
| 43 | + wss.zdsj = sch.getZdsj(); | ||
| 44 | + wss.zdsjT = sch.getZdsjT(); | ||
| 45 | + wss.jhlc = sch.getJhlc(); | ||
| 46 | + wss.jhlcOrig = sch.getJhlcOrig(); | ||
| 47 | + wss.bcsj = sch.getBcsj(); | ||
| 48 | + wss.bcType = sch.getBcType(); | ||
| 49 | + wss.majorStationName = sch.getMajorStationName(); | ||
| 50 | + wss.fcsjActual = sch.getFcsjActual(); | ||
| 51 | + wss.fcsjActualTime = sch.getFcsjActualTime(); | ||
| 52 | + wss.zdsjActual = sch.getZdsjActual(); | ||
| 53 | + wss.zdsjActualTime = sch.getZdsjActualTime(); | ||
| 54 | + wss.status = sch.getStatus(); | ||
| 55 | + wss.adjustExps = sch.getAdjustExps(); | ||
| 56 | + wss.sflj = sch.isSflj(); | ||
| 57 | + wss.late = sch.isLate(); | ||
| 58 | + wss.late2 = sch.isLate2(); | ||
| 59 | + wss.lateMinute = sch.getLateMinute(); | ||
| 60 | + wss.remarks = sch.getRemarks(); | ||
| 61 | + wss.dfsj = sch.getDfsj(); | ||
| 62 | + wss.dfsjT = sch.getDfsjT(); | ||
| 63 | + wss.directiveState = sch.getDirectiveState(); | ||
| 64 | + wss.qdzArrDatejh = sch.getQdzArrDatejh(); | ||
| 65 | + wss.qdzArrDatesj = sch.getQdzArrDatesj(); | ||
| 66 | + wss.cTasks = sch.getcTasks(); | ||
| 67 | + wss.gsName = sch.getGsName(); | ||
| 68 | + wss.gsBm = sch.getGsBm(); | ||
| 69 | + wss.fgsName = sch.getFgsName(); | ||
| 70 | + wss.fgsBm = sch.getFgsBm(); | ||
| 71 | + wss.ccService = sch.isCcService(); | ||
| 72 | + return wss; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + | ||
| 76 | + public static List<WsScheduleRealInfo> getMultiInstance(List<ScheduleRealInfo> list){ | ||
| 77 | + List<WsScheduleRealInfo> rs = new ArrayList<>(); | ||
| 78 | + for(ScheduleRealInfo sch : list){ | ||
| 79 | + rs.add(getInstance(sch)); | ||
| 80 | + } | ||
| 81 | + return rs; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + /** 主键Id */ | ||
| 85 | + private Long id; | ||
| 86 | + | ||
| 87 | + /** 排班日期字符串 YYYY-MM-DD */ | ||
| 88 | + private String scheduleDateStr; | ||
| 89 | + | ||
| 90 | + /** 真实执行时间 yyyy-MM-dd */ | ||
| 91 | + private String realExecDate; | ||
| 92 | + | ||
| 93 | + /** 线路名称 */ | ||
| 94 | + private String xlName; | ||
| 95 | + /** 线路编码 */ | ||
| 96 | + private String xlBm; | ||
| 97 | + | ||
| 98 | + /** 路牌名称 */ | ||
| 99 | + private String lpName; | ||
| 100 | + | ||
| 101 | + /** 车辆自编号 */ | ||
| 102 | + private String clZbh; | ||
| 103 | + | ||
| 104 | + /** 驾驶员工号 */ | ||
| 105 | + private String jGh; | ||
| 106 | + /** 驾驶员名字 */ | ||
| 107 | + private String jName; | ||
| 108 | + /** 售票员工号 */ | ||
| 109 | + private String sGh; | ||
| 110 | + /** 售票员名字 */ | ||
| 111 | + private String sName; | ||
| 112 | + | ||
| 113 | + /** 线路方向 */ | ||
| 114 | + private String xlDir; | ||
| 115 | + /** 起点站code*/ | ||
| 116 | + private String qdzCode; | ||
| 117 | + /** 起点站名字 */ | ||
| 118 | + private String qdzName; | ||
| 119 | + | ||
| 120 | + /** 终点站code*/ | ||
| 121 | + private String zdzCode; | ||
| 122 | + /** 终点站名字 */ | ||
| 123 | + private String zdzName; | ||
| 124 | + | ||
| 125 | + /** 计划发车时间(格式 HH:mm) */ | ||
| 126 | + private String fcsj; | ||
| 127 | + /** 计划发车时间戳*/ | ||
| 128 | + @Transient | ||
| 129 | + private Long fcsjT; | ||
| 130 | + | ||
| 131 | + /** 计划终点时间(格式 HH:mm) */ | ||
| 132 | + private String zdsj; | ||
| 133 | + /** 计划终点时间戳*/ | ||
| 134 | + @Transient | ||
| 135 | + private Long zdsjT; | ||
| 136 | + | ||
| 137 | + /** 计划里程 */ | ||
| 138 | + private Double jhlc; | ||
| 139 | + | ||
| 140 | + /** 原始计划里程 (原计调的数据) */ | ||
| 141 | + private Double jhlcOrig; | ||
| 142 | + /** 班次历时 */ | ||
| 143 | + private Integer bcsj; | ||
| 144 | + | ||
| 145 | + /** | ||
| 146 | + * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶 | ||
| 147 | + */ | ||
| 148 | + private String bcType; | ||
| 149 | + | ||
| 150 | + //放站班次 站点名称 | ||
| 151 | + private String majorStationName; | ||
| 152 | + | ||
| 153 | + /** 实际发车时间*/ | ||
| 154 | + private String fcsjActual; | ||
| 155 | + /** 实际发车时间戳*/ | ||
| 156 | + @Transient | ||
| 157 | + private Long fcsjActualTime; | ||
| 158 | + /**实际终点时间 */ | ||
| 159 | + private String zdsjActual; | ||
| 160 | + /** 实际终点时间戳*/ | ||
| 161 | + @Transient | ||
| 162 | + private Long zdsjActualTime; | ||
| 163 | + | ||
| 164 | + /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */ | ||
| 165 | + private int status; | ||
| 166 | + | ||
| 167 | + private String adjustExps; | ||
| 168 | + | ||
| 169 | + /** 是否是临加班次 */ | ||
| 170 | + private boolean sflj; | ||
| 171 | + | ||
| 172 | + /** 是否误点 (应发未发)*/ | ||
| 173 | + @Transient | ||
| 174 | + private boolean late; | ||
| 175 | + | ||
| 176 | + /** 是否误点 (应发未到) */ | ||
| 177 | + @Transient | ||
| 178 | + private boolean late2; | ||
| 179 | + /** 误点停靠时间 */ | ||
| 180 | + @Transient | ||
| 181 | + private float lateMinute; | ||
| 182 | + | ||
| 183 | + /** 备注*/ | ||
| 184 | + private String remarks; | ||
| 185 | + | ||
| 186 | + /**待发时间(格式 HH:mm) */ | ||
| 187 | + private String dfsj; | ||
| 188 | + | ||
| 189 | + /**待发时间戳 */ | ||
| 190 | + @Transient | ||
| 191 | + private Long dfsjT; | ||
| 192 | + | ||
| 193 | + /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */ | ||
| 194 | + private Integer directiveState = -1; | ||
| 195 | + | ||
| 196 | + /** 起点站计划到达时间 */ | ||
| 197 | + @Transient | ||
| 198 | + private String qdzArrDatejh; | ||
| 199 | + | ||
| 200 | + /** 起点站实际到达时间 */ | ||
| 201 | + @Transient | ||
| 202 | + private String qdzArrDatesj; | ||
| 203 | + | ||
| 204 | + /** 子任务 */ | ||
| 205 | + @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule") | ||
| 206 | + private Set<ChildTaskPlan> cTasks = new HashSet<>(); | ||
| 207 | + | ||
| 208 | + /** 关联的公司名称 */ | ||
| 209 | + private String gsName; | ||
| 210 | + /** 关联的公司编码 */ | ||
| 211 | + private String gsBm; | ||
| 212 | + /** 关联的分公司名称 */ | ||
| 213 | + private String fgsName; | ||
| 214 | + /** 关联的分公司编码 */ | ||
| 215 | + private String fgsBm; | ||
| 216 | + | ||
| 217 | + /** | ||
| 218 | + * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成 | ||
| 219 | + */ | ||
| 220 | + private boolean ccService; | ||
| 221 | + | ||
| 222 | + public Long getId() { | ||
| 223 | + return id; | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + public void setId(Long id) { | ||
| 227 | + this.id = id; | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + public String getScheduleDateStr() { | ||
| 231 | + return scheduleDateStr; | ||
| 232 | + } | ||
| 233 | + | ||
| 234 | + public void setScheduleDateStr(String scheduleDateStr) { | ||
| 235 | + this.scheduleDateStr = scheduleDateStr; | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + public String getRealExecDate() { | ||
| 239 | + return realExecDate; | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + public void setRealExecDate(String realExecDate) { | ||
| 243 | + this.realExecDate = realExecDate; | ||
| 244 | + } | ||
| 245 | + | ||
| 246 | + public String getXlName() { | ||
| 247 | + return xlName; | ||
| 248 | + } | ||
| 249 | + | ||
| 250 | + public void setXlName(String xlName) { | ||
| 251 | + this.xlName = xlName; | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + public String getXlBm() { | ||
| 255 | + return xlBm; | ||
| 256 | + } | ||
| 257 | + | ||
| 258 | + public void setXlBm(String xlBm) { | ||
| 259 | + this.xlBm = xlBm; | ||
| 260 | + } | ||
| 261 | + | ||
| 262 | + public String getLpName() { | ||
| 263 | + return lpName; | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + public void setLpName(String lpName) { | ||
| 267 | + this.lpName = lpName; | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + public String getClZbh() { | ||
| 271 | + return clZbh; | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + public void setClZbh(String clZbh) { | ||
| 275 | + this.clZbh = clZbh; | ||
| 276 | + } | ||
| 277 | + | ||
| 278 | + public String getjGh() { | ||
| 279 | + return jGh; | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + public void setjGh(String jGh) { | ||
| 283 | + this.jGh = jGh; | ||
| 284 | + } | ||
| 285 | + | ||
| 286 | + public String getjName() { | ||
| 287 | + return jName; | ||
| 288 | + } | ||
| 289 | + | ||
| 290 | + public void setjName(String jName) { | ||
| 291 | + this.jName = jName; | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + public String getsGh() { | ||
| 295 | + return sGh; | ||
| 296 | + } | ||
| 297 | + | ||
| 298 | + public void setsGh(String sGh) { | ||
| 299 | + this.sGh = sGh; | ||
| 300 | + } | ||
| 301 | + | ||
| 302 | + public String getsName() { | ||
| 303 | + return sName; | ||
| 304 | + } | ||
| 305 | + | ||
| 306 | + public void setsName(String sName) { | ||
| 307 | + this.sName = sName; | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + public String getXlDir() { | ||
| 311 | + return xlDir; | ||
| 312 | + } | ||
| 313 | + | ||
| 314 | + public void setXlDir(String xlDir) { | ||
| 315 | + this.xlDir = xlDir; | ||
| 316 | + } | ||
| 317 | + | ||
| 318 | + public String getQdzCode() { | ||
| 319 | + return qdzCode; | ||
| 320 | + } | ||
| 321 | + | ||
| 322 | + public void setQdzCode(String qdzCode) { | ||
| 323 | + this.qdzCode = qdzCode; | ||
| 324 | + } | ||
| 325 | + | ||
| 326 | + public String getQdzName() { | ||
| 327 | + return qdzName; | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | + public void setQdzName(String qdzName) { | ||
| 331 | + this.qdzName = qdzName; | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + public String getZdzCode() { | ||
| 335 | + return zdzCode; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + public void setZdzCode(String zdzCode) { | ||
| 339 | + this.zdzCode = zdzCode; | ||
| 340 | + } | ||
| 341 | + | ||
| 342 | + public String getZdzName() { | ||
| 343 | + return zdzName; | ||
| 344 | + } | ||
| 345 | + | ||
| 346 | + public void setZdzName(String zdzName) { | ||
| 347 | + this.zdzName = zdzName; | ||
| 348 | + } | ||
| 349 | + | ||
| 350 | + public String getFcsj() { | ||
| 351 | + return fcsj; | ||
| 352 | + } | ||
| 353 | + | ||
| 354 | + public void setFcsj(String fcsj) { | ||
| 355 | + this.fcsj = fcsj; | ||
| 356 | + } | ||
| 357 | + | ||
| 358 | + public Long getFcsjT() { | ||
| 359 | + return fcsjT; | ||
| 360 | + } | ||
| 361 | + | ||
| 362 | + public void setFcsjT(Long fcsjT) { | ||
| 363 | + this.fcsjT = fcsjT; | ||
| 364 | + } | ||
| 365 | + | ||
| 366 | + public String getZdsj() { | ||
| 367 | + return zdsj; | ||
| 368 | + } | ||
| 369 | + | ||
| 370 | + public void setZdsj(String zdsj) { | ||
| 371 | + this.zdsj = zdsj; | ||
| 372 | + } | ||
| 373 | + | ||
| 374 | + public Long getZdsjT() { | ||
| 375 | + return zdsjT; | ||
| 376 | + } | ||
| 377 | + | ||
| 378 | + public void setZdsjT(Long zdsjT) { | ||
| 379 | + this.zdsjT = zdsjT; | ||
| 380 | + } | ||
| 381 | + | ||
| 382 | + public Double getJhlc() { | ||
| 383 | + return jhlc; | ||
| 384 | + } | ||
| 385 | + | ||
| 386 | + public void setJhlc(Double jhlc) { | ||
| 387 | + this.jhlc = jhlc; | ||
| 388 | + } | ||
| 389 | + | ||
| 390 | + public Double getJhlcOrig() { | ||
| 391 | + return jhlcOrig; | ||
| 392 | + } | ||
| 393 | + | ||
| 394 | + public void setJhlcOrig(Double jhlcOrig) { | ||
| 395 | + this.jhlcOrig = jhlcOrig; | ||
| 396 | + } | ||
| 397 | + | ||
| 398 | + public Integer getBcsj() { | ||
| 399 | + return bcsj; | ||
| 400 | + } | ||
| 401 | + | ||
| 402 | + public void setBcsj(Integer bcsj) { | ||
| 403 | + this.bcsj = bcsj; | ||
| 404 | + } | ||
| 405 | + | ||
| 406 | + public String getBcType() { | ||
| 407 | + return bcType; | ||
| 408 | + } | ||
| 409 | + | ||
| 410 | + public void setBcType(String bcType) { | ||
| 411 | + this.bcType = bcType; | ||
| 412 | + } | ||
| 413 | + | ||
| 414 | + public String getMajorStationName() { | ||
| 415 | + return majorStationName; | ||
| 416 | + } | ||
| 417 | + | ||
| 418 | + public void setMajorStationName(String majorStationName) { | ||
| 419 | + this.majorStationName = majorStationName; | ||
| 420 | + } | ||
| 421 | + | ||
| 422 | + public String getFcsjActual() { | ||
| 423 | + return fcsjActual; | ||
| 424 | + } | ||
| 425 | + | ||
| 426 | + public void setFcsjActual(String fcsjActual) { | ||
| 427 | + this.fcsjActual = fcsjActual; | ||
| 428 | + } | ||
| 429 | + | ||
| 430 | + public Long getFcsjActualTime() { | ||
| 431 | + return fcsjActualTime; | ||
| 432 | + } | ||
| 433 | + | ||
| 434 | + public void setFcsjActualTime(Long fcsjActualTime) { | ||
| 435 | + this.fcsjActualTime = fcsjActualTime; | ||
| 436 | + } | ||
| 437 | + | ||
| 438 | + public String getZdsjActual() { | ||
| 439 | + return zdsjActual; | ||
| 440 | + } | ||
| 441 | + | ||
| 442 | + public void setZdsjActual(String zdsjActual) { | ||
| 443 | + this.zdsjActual = zdsjActual; | ||
| 444 | + } | ||
| 445 | + | ||
| 446 | + public Long getZdsjActualTime() { | ||
| 447 | + return zdsjActualTime; | ||
| 448 | + } | ||
| 449 | + | ||
| 450 | + public void setZdsjActualTime(Long zdsjActualTime) { | ||
| 451 | + this.zdsjActualTime = zdsjActualTime; | ||
| 452 | + } | ||
| 453 | + | ||
| 454 | + public int getStatus() { | ||
| 455 | + return status; | ||
| 456 | + } | ||
| 457 | + | ||
| 458 | + public void setStatus(int status) { | ||
| 459 | + this.status = status; | ||
| 460 | + } | ||
| 461 | + | ||
| 462 | + public String getAdjustExps() { | ||
| 463 | + return adjustExps; | ||
| 464 | + } | ||
| 465 | + | ||
| 466 | + public void setAdjustExps(String adjustExps) { | ||
| 467 | + this.adjustExps = adjustExps; | ||
| 468 | + } | ||
| 469 | + | ||
| 470 | + public boolean isSflj() { | ||
| 471 | + return sflj; | ||
| 472 | + } | ||
| 473 | + | ||
| 474 | + public void setSflj(boolean sflj) { | ||
| 475 | + this.sflj = sflj; | ||
| 476 | + } | ||
| 477 | + | ||
| 478 | + public boolean isLate() { | ||
| 479 | + return late; | ||
| 480 | + } | ||
| 481 | + | ||
| 482 | + public void setLate(boolean late) { | ||
| 483 | + this.late = late; | ||
| 484 | + } | ||
| 485 | + | ||
| 486 | + public boolean isLate2() { | ||
| 487 | + return late2; | ||
| 488 | + } | ||
| 489 | + | ||
| 490 | + public void setLate2(boolean late2) { | ||
| 491 | + this.late2 = late2; | ||
| 492 | + } | ||
| 493 | + | ||
| 494 | + public float getLateMinute() { | ||
| 495 | + return lateMinute; | ||
| 496 | + } | ||
| 497 | + | ||
| 498 | + public void setLateMinute(float lateMinute) { | ||
| 499 | + this.lateMinute = lateMinute; | ||
| 500 | + } | ||
| 501 | + | ||
| 502 | + public String getRemarks() { | ||
| 503 | + return remarks; | ||
| 504 | + } | ||
| 505 | + | ||
| 506 | + public void setRemarks(String remarks) { | ||
| 507 | + this.remarks = remarks; | ||
| 508 | + } | ||
| 509 | + | ||
| 510 | + public String getDfsj() { | ||
| 511 | + return dfsj; | ||
| 512 | + } | ||
| 513 | + | ||
| 514 | + public void setDfsj(String dfsj) { | ||
| 515 | + this.dfsj = dfsj; | ||
| 516 | + } | ||
| 517 | + | ||
| 518 | + public Long getDfsjT() { | ||
| 519 | + return dfsjT; | ||
| 520 | + } | ||
| 521 | + | ||
| 522 | + public void setDfsjT(Long dfsjT) { | ||
| 523 | + this.dfsjT = dfsjT; | ||
| 524 | + } | ||
| 525 | + | ||
| 526 | + public Integer getDirectiveState() { | ||
| 527 | + return directiveState; | ||
| 528 | + } | ||
| 529 | + | ||
| 530 | + public void setDirectiveState(Integer directiveState) { | ||
| 531 | + this.directiveState = directiveState; | ||
| 532 | + } | ||
| 533 | + | ||
| 534 | + public String getQdzArrDatejh() { | ||
| 535 | + return qdzArrDatejh; | ||
| 536 | + } | ||
| 537 | + | ||
| 538 | + public void setQdzArrDatejh(String qdzArrDatejh) { | ||
| 539 | + this.qdzArrDatejh = qdzArrDatejh; | ||
| 540 | + } | ||
| 541 | + | ||
| 542 | + public String getQdzArrDatesj() { | ||
| 543 | + return qdzArrDatesj; | ||
| 544 | + } | ||
| 545 | + | ||
| 546 | + public void setQdzArrDatesj(String qdzArrDatesj) { | ||
| 547 | + this.qdzArrDatesj = qdzArrDatesj; | ||
| 548 | + } | ||
| 549 | + | ||
| 550 | + public Set<ChildTaskPlan> getcTasks() { | ||
| 551 | + return cTasks; | ||
| 552 | + } | ||
| 553 | + | ||
| 554 | + public void setcTasks(Set<ChildTaskPlan> cTasks) { | ||
| 555 | + this.cTasks = cTasks; | ||
| 556 | + } | ||
| 557 | + | ||
| 558 | + public String getGsName() { | ||
| 559 | + return gsName; | ||
| 560 | + } | ||
| 561 | + | ||
| 562 | + public void setGsName(String gsName) { | ||
| 563 | + this.gsName = gsName; | ||
| 564 | + } | ||
| 565 | + | ||
| 566 | + public String getGsBm() { | ||
| 567 | + return gsBm; | ||
| 568 | + } | ||
| 569 | + | ||
| 570 | + public void setGsBm(String gsBm) { | ||
| 571 | + this.gsBm = gsBm; | ||
| 572 | + } | ||
| 573 | + | ||
| 574 | + public String getFgsName() { | ||
| 575 | + return fgsName; | ||
| 576 | + } | ||
| 577 | + | ||
| 578 | + public void setFgsName(String fgsName) { | ||
| 579 | + this.fgsName = fgsName; | ||
| 580 | + } | ||
| 581 | + | ||
| 582 | + public String getFgsBm() { | ||
| 583 | + return fgsBm; | ||
| 584 | + } | ||
| 585 | + | ||
| 586 | + public void setFgsBm(String fgsBm) { | ||
| 587 | + this.fgsBm = fgsBm; | ||
| 588 | + } | ||
| 589 | + | ||
| 590 | + public boolean isCcService() { | ||
| 591 | + return ccService; | ||
| 592 | + } | ||
| 593 | + | ||
| 594 | + public void setCcService(boolean ccService) { | ||
| 595 | + this.ccService = ccService; | ||
| 596 | + } | ||
| 597 | +} |
src/main/java/com/bsth/websocket/handler/SendUtils.java
| @@ -7,6 +7,7 @@ import com.bsth.data.gpsdata_v2.entity.GpsEntity; | @@ -7,6 +7,7 @@ import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 7 | import com.bsth.data.safe_driv.SafeDriv; | 7 | import com.bsth.data.safe_driv.SafeDriv; |
| 8 | import com.bsth.entity.directive.D80; | 8 | import com.bsth.entity.directive.D80; |
| 9 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 9 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 10 | +import com.bsth.websocket.dto.WsScheduleRealInfo; | ||
| 10 | import com.fasterxml.jackson.core.JsonProcessingException; | 11 | import com.fasterxml.jackson.core.JsonProcessingException; |
| 11 | import com.fasterxml.jackson.databind.ObjectMapper; | 12 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 12 | import org.slf4j.Logger; | 13 | import org.slf4j.Logger; |
| @@ -38,7 +39,7 @@ public class SendUtils{ | @@ -38,7 +39,7 @@ public class SendUtils{ | ||
| 38 | 39 | ||
| 39 | Map<String, Object> map = new HashMap<>(); | 40 | Map<String, Object> map = new HashMap<>(); |
| 40 | map.put("fn", "faChe"); | 41 | map.put("fn", "faChe"); |
| 41 | - map.put("t", sch); | 42 | + map.put("t", WsScheduleRealInfo.getInstance(sch)); |
| 42 | map.put("dataStr", sdf.format(new Date())); | 43 | map.put("dataStr", sdf.format(new Date())); |
| 43 | 44 | ||
| 44 | ObjectMapper mapper = new ObjectMapper(); | 45 | ObjectMapper mapper = new ObjectMapper(); |
| @@ -62,7 +63,7 @@ public class SendUtils{ | @@ -62,7 +63,7 @@ public class SendUtils{ | ||
| 62 | 63 | ||
| 63 | Map<String, Object> map = new HashMap<>(); | 64 | Map<String, Object> map = new HashMap<>(); |
| 64 | map.put("fn", "refreshSch"); | 65 | map.put("fn", "refreshSch"); |
| 65 | - map.put("ts", list); | 66 | + map.put("ts", WsScheduleRealInfo.getMultiInstance(list)); |
| 66 | 67 | ||
| 67 | ObjectMapper mapper = new ObjectMapper(); | 68 | ObjectMapper mapper = new ObjectMapper(); |
| 68 | 69 | ||
| @@ -82,8 +83,8 @@ public class SendUtils{ | @@ -82,8 +83,8 @@ public class SendUtils{ | ||
| 82 | 83 | ||
| 83 | Map<String, Object> map = new HashMap<>(); | 84 | Map<String, Object> map = new HashMap<>(); |
| 84 | map.put("fn", "zhongDian"); | 85 | map.put("fn", "zhongDian"); |
| 85 | - map.put("t", sch); | ||
| 86 | - map.put("nt", nextSch); | 86 | + map.put("t", WsScheduleRealInfo.getInstance(sch)); |
| 87 | + map.put("nt", WsScheduleRealInfo.getInstance(nextSch)); | ||
| 87 | map.put("finish", finish); | 88 | map.put("finish", finish); |
| 88 | map.put("dataStr", sdf.format(new Date())); | 89 | map.put("dataStr", sdf.format(new Date())); |
| 89 | 90 | ||
| @@ -123,7 +124,7 @@ public class SendUtils{ | @@ -123,7 +124,7 @@ public class SendUtils{ | ||
| 123 | 124 | ||
| 124 | Map<String, Object> map = new HashMap<>(); | 125 | Map<String, Object> map = new HashMap<>(); |
| 125 | map.put("fn", "directive"); | 126 | map.put("fn", "directive"); |
| 126 | - map.put("t", sch);; | 127 | + map.put("t", WsScheduleRealInfo.getInstance(sch));; |
| 127 | 128 | ||
| 128 | ObjectMapper mapper = new ObjectMapper(); | 129 | ObjectMapper mapper = new ObjectMapper(); |
| 129 | 130 | ||
| @@ -167,8 +168,7 @@ public class SendUtils{ | @@ -167,8 +168,7 @@ public class SendUtils{ | ||
| 167 | ObjectMapper mapper = new ObjectMapper(); | 168 | ObjectMapper mapper = new ObjectMapper(); |
| 168 | 169 | ||
| 169 | try { | 170 | try { |
| 170 | - socketHandler.sendMessage(mapper.writeValueAsString(map)); | ||
| 171 | - | 171 | + socketHandler.sendMessageToLine(sd.getXlbm(), mapper.writeValueAsString(map)); |
| 172 | } catch (JsonProcessingException e) { | 172 | } catch (JsonProcessingException e) { |
| 173 | logger.error("", e); | 173 | logger.error("", e); |
| 174 | } | 174 | } |
src/main/resources/fatso/start.js
| @@ -16,7 +16,7 @@ var platform = process.platform; | @@ -16,7 +16,7 @@ var platform = process.platform; | ||
| 16 | var iswin = platform=='win32'; | 16 | var iswin = platform=='win32'; |
| 17 | var sp = platform=='win32'?'\\':'/'; | 17 | var sp = platform=='win32'?'\\':'/'; |
| 18 | //不参与的目录 | 18 | //不参与的目录 |
| 19 | -var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission'+sp+'authorize_all', 'summary', 'history_sch' ,'report'+sp+'oil','base'+sp+'geo_data_edit'] | 19 | +var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission'+sp+'authorize_all', 'summary', 'history_sch' ,'report'+sp+'oil','base'+sp+'geo_data_edit', 'forms','mforms', 'report', 'punctual'] |
| 20 | ,ep = new EventProxy() | 20 | ,ep = new EventProxy() |
| 21 | ,pName = 'bsth_control' | 21 | ,pName = 'bsth_control' |
| 22 | ,path = process.cwd() | 22 | ,path = process.cwd() |
src/main/resources/static/pages/base/carpark/add.html
| @@ -208,7 +208,7 @@ | @@ -208,7 +208,7 @@ | ||
| 208 | <!-- 所属公司 --> | 208 | <!-- 所属公司 --> |
| 209 | <div class="form-body"> | 209 | <div class="form-body"> |
| 210 | <div class="form-group"> | 210 | <div class="form-group"> |
| 211 | - <label class="col-md-3 control-label">所属公司 :</label> | 211 | + <label class="col-md-3 control-label"><span class="required"> * </span>所属公司 :</label> |
| 212 | <div class="col-md-6"> | 212 | <div class="col-md-6"> |
| 213 | <select name="company" class="form-control" style="width:100%" id="companySelect"></select> | 213 | <select name="company" class="form-control" style="width:100%" id="companySelect"></select> |
| 214 | </div> | 214 | </div> |
| @@ -217,7 +217,7 @@ | @@ -217,7 +217,7 @@ | ||
| 217 | <!-- 所属分公司 --> | 217 | <!-- 所属分公司 --> |
| 218 | <div class="form-body"> | 218 | <div class="form-body"> |
| 219 | <div class="form-group"> | 219 | <div class="form-group"> |
| 220 | - <label class="col-md-3 control-label">所属分公司 :</label> | 220 | + <label class="col-md-3 control-label"><span class="required"> * </span>所属分公司 :</label> |
| 221 | <div class="col-md-6"> | 221 | <div class="col-md-6"> |
| 222 | <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> | 222 | <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> |
| 223 | </select> | 223 | </select> |
src/main/resources/static/pages/base/carpark/js/add-form-wizard.js
| @@ -33,6 +33,8 @@ var FormWizard = function() { | @@ -33,6 +33,8 @@ var FormWizard = function() { | ||
| 33 | data : {'parkCode' : function() { return $("#parkCodeInput").val(); }}, | 33 | data : {'parkCode' : function() { return $("#parkCodeInput").val(); }}, |
| 34 | }},// 停车场编码 必填项 | 34 | }},// 停车场编码 必填项 |
| 35 | 'bCenterPoint' : {required : true,},// 经纬度坐标点 必填项 | 35 | 'bCenterPoint' : {required : true,},// 经纬度坐标点 必填项 |
| 36 | + 'company' : {required : true,},// 必填项 | ||
| 37 | + 'brancheCompany' : {required : true,},// 必填项 | ||
| 36 | 'shapesType' : {required : true,},// 几何图形类型 必填项 | 38 | 'shapesType' : {required : true,},// 几何图形类型 必填项 |
| 37 | 'radius' : {required : true,digits:true},// 圆形半径 必填项 | 39 | 'radius' : {required : true,digits:true},// 圆形半径 必填项 |
| 38 | 'destroy' : {required : true,},// 是否撤销 必填项 | 40 | 'destroy' : {required : true,},// 是否撤销 必填项 |
src/main/resources/static/pages/base/carpark/list.html
| @@ -115,73 +115,9 @@ | @@ -115,73 +115,9 @@ | ||
| 115 | </td> | 115 | </td> |
| 116 | <td> | 116 | <td> |
| 117 | {{obj.gsmc}} | 117 | {{obj.gsmc}} |
| 118 | - <!--{{if obj.company == '55'}} | ||
| 119 | - 上南公司 | ||
| 120 | - {{else if obj.company == '22'}} | ||
| 121 | - 金高公司 | ||
| 122 | - {{else if obj.company == '05'}} | ||
| 123 | - 杨高公司 | ||
| 124 | - {{else if obj.company == '26'}} | ||
| 125 | - 南汇公司 | ||
| 126 | - {{else if obj.company == '77'}} | ||
| 127 | - 闵行公司 | ||
| 128 | - {{/if}}--> | ||
| 129 | </td> | 118 | </td> |
| 130 | <td> | 119 | <td> |
| 131 | {{obj.fgsmc}} | 120 | {{obj.fgsmc}} |
| 132 | - <!--{{if obj.company == '55'}} | ||
| 133 | - | ||
| 134 | - {{if obj.brancheCompany == '1'}} | ||
| 135 | - 上南二分公司 | ||
| 136 | - {{else if obj.brancheCompany == '2'}} | ||
| 137 | - 上南三分公司 | ||
| 138 | - {{else if obj.brancheCompany == '3'}} | ||
| 139 | - 上南六分公司 | ||
| 140 | - {{else if obj.brancheCompany == '4'}} | ||
| 141 | - 上南一分公司 | ||
| 142 | - {{/if}} | ||
| 143 | - | ||
| 144 | - {{else if obj.company == '22'}} | ||
| 145 | - | ||
| 146 | - {{if obj.brancheCompany == '1'}} | ||
| 147 | - 四分公司 | ||
| 148 | - {{else if obj.brancheCompany == '2'}} | ||
| 149 | - 二分公司 | ||
| 150 | - {{else if obj.brancheCompany == '3'}} | ||
| 151 | - 三分公司 | ||
| 152 | - {{else if obj.brancheCompany == '5'}} | ||
| 153 | - 一分公司 | ||
| 154 | - {{/if}} | ||
| 155 | - | ||
| 156 | - {{else if obj.company == '05'}} | ||
| 157 | - | ||
| 158 | - {{if obj.brancheCompany == '1'}} | ||
| 159 | - 川沙分公司 | ||
| 160 | - {{else if obj.brancheCompany == '2'}} | ||
| 161 | - 金桥分公司 | ||
| 162 | - {{else if obj.brancheCompany == '3'}} | ||
| 163 | - 芦潮港分公司 | ||
| 164 | - {{else if obj.brancheCompany == '5'}} | ||
| 165 | - 杨高分公司 | ||
| 166 | - {{else if obj.brancheCompany == '6'}} | ||
| 167 | - 周浦分公司 | ||
| 168 | - {{/if}} | ||
| 169 | - | ||
| 170 | - {{else if obj.company == '26'}} | ||
| 171 | - | ||
| 172 | - {{if obj.brancheCompany == '1'}} | ||
| 173 | - 南汇一分 | ||
| 174 | - {{else if obj.brancheCompany == '2'}} | ||
| 175 | - 南汇二分 | ||
| 176 | - {{else if obj.brancheCompany == '3'}} | ||
| 177 | - 南汇三分 | ||
| 178 | - {{else if obj.brancheCompany == '4'}} | ||
| 179 | - 南汇维修公司 | ||
| 180 | - {{else if obj.brancheCompany == '5'}} | ||
| 181 | - 南汇公司 | ||
| 182 | - {{/if}} | ||
| 183 | - | ||
| 184 | - {{/if}}--> | ||
| 185 | </td> | 121 | </td> |
| 186 | <td> | 122 | <td> |
| 187 | {{obj.versions}} | 123 | {{obj.versions}} |
src/main/resources/static/pages/base/line/js/line-list-table.js
| @@ -101,7 +101,7 @@ | @@ -101,7 +101,7 @@ | ||
| 101 | var len_ = array.length,paramsD = new Array(); | 101 | var len_ = array.length,paramsD = new Array(); |
| 102 | if(len_>0) { | 102 | if(len_>0) { |
| 103 | $.each(array, function(i, g){ | 103 | $.each(array, function(i, g){ |
| 104 | - if(g.name!='' || g.name != null) { | 104 | + if(g.remove != 1 && (g.name!='' || g.name != null)) { |
| 105 | paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); | 105 | paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); |
| 106 | } | 106 | } |
| 107 | }); | 107 | }); |
src/main/resources/static/pages/base/line/list.html
| @@ -247,75 +247,9 @@ | @@ -247,75 +247,9 @@ | ||
| 247 | </td> | 247 | </td> |
| 248 | <td> | 248 | <td> |
| 249 | {{obj.gsmc}} | 249 | {{obj.gsmc}} |
| 250 | - <!--{{if obj.company == '55'}} | ||
| 251 | - 上南公司 | ||
| 252 | - {{else if obj.company == '22'}} | ||
| 253 | - 金高公司 | ||
| 254 | - {{else if obj.company == '05'}} | ||
| 255 | - 杨高公司 | ||
| 256 | - {{else if obj.company == '26'}} | ||
| 257 | - 南汇公司 | ||
| 258 | - {{else if obj.company == '77'}} | ||
| 259 | - 闵行公司 | ||
| 260 | - {{/if}}--> | ||
| 261 | </td> | 250 | </td> |
| 262 | <td> | 251 | <td> |
| 263 | {{obj.fgsmc}} | 252 | {{obj.fgsmc}} |
| 264 | - <!--{{if obj.company == '55'}} | ||
| 265 | - | ||
| 266 | - {{if obj.brancheCompany == '1'}} | ||
| 267 | - 上南二分公司 | ||
| 268 | - {{else if obj.brancheCompany == '2'}} | ||
| 269 | - 上南三分公司 | ||
| 270 | - {{else if obj.brancheCompany == '3'}} | ||
| 271 | - 上南六分公司 | ||
| 272 | - {{else if obj.brancheCompany == '4'}} | ||
| 273 | - 上南一分公司 | ||
| 274 | - {{/if}} | ||
| 275 | - | ||
| 276 | - {{else if obj.company == '22'}} | ||
| 277 | - | ||
| 278 | - {{if obj.brancheCompany == '1'}} | ||
| 279 | - 四分公司 | ||
| 280 | - {{else if obj.brancheCompany == '2'}} | ||
| 281 | - 二分公司 | ||
| 282 | - {{else if obj.brancheCompany == '3'}} | ||
| 283 | - 三分公司 | ||
| 284 | - {{else if obj.brancheCompany == '5'}} | ||
| 285 | - 一分公司 | ||
| 286 | - {{/if}} | ||
| 287 | - | ||
| 288 | - {{else if obj.company == '05'}} | ||
| 289 | - | ||
| 290 | - {{if obj.brancheCompany == '1'}} | ||
| 291 | - 川沙分公司 | ||
| 292 | - {{else if obj.brancheCompany == '2'}} | ||
| 293 | - 金桥分公司 | ||
| 294 | - {{else if obj.brancheCompany == '3'}} | ||
| 295 | - 芦潮港分公司 | ||
| 296 | - {{else if obj.brancheCompany == '5'}} | ||
| 297 | - 杨高分公司 | ||
| 298 | - {{else if obj.brancheCompany == '6'}} | ||
| 299 | - 周浦分公司 | ||
| 300 | - {{/if}} | ||
| 301 | - | ||
| 302 | - {{else if obj.company == '26'}} | ||
| 303 | - | ||
| 304 | - {{if obj.brancheCompany == '1'}} | ||
| 305 | - 南汇一分 | ||
| 306 | - {{else if obj.brancheCompany == '2'}} | ||
| 307 | - 南汇二分 | ||
| 308 | - {{else if obj.brancheCompany == '3'}} | ||
| 309 | - 南汇三分 | ||
| 310 | - {{else if obj.brancheCompany == '4'}} | ||
| 311 | - 南汇维修公司 | ||
| 312 | - {{else if obj.brancheCompany == '5'}} | ||
| 313 | - 南汇公司 | ||
| 314 | - {{else if obj.brancheCompany == '6'}} | ||
| 315 | - 航头枢纽站 | ||
| 316 | - {{/if}} | ||
| 317 | - | ||
| 318 | - {{/if}}--> | ||
| 319 | </td> | 253 | </td> |
| 320 | <td> | 254 | <td> |
| 321 | {{if obj.nature == 'lj'}} | 255 | {{if obj.nature == 'lj'}} |
| @@ -371,7 +305,7 @@ | @@ -371,7 +305,7 @@ | ||
| 371 | <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> | 305 | <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> |
| 372 | 306 | ||
| 373 | {{if obj.destroy==1}} | 307 | {{if obj.destroy==1}} |
| 374 | - <a class="ct_base_line_delete_link" data-id="{{obj.id}}" data-name="{{obj.name}}"> 删除 </a> | 308 | + <!--<a class="ct_base_line_delete_link" data-id="{{obj.id}}" data-name="{{obj.name}}"> 删除 </a>--> |
| 375 | {{/if}} | 309 | {{/if}} |
| 376 | </td> | 310 | </td> |
| 377 | </tr> | 311 | </tr> |
src/main/resources/static/pages/base/lineinformation/js/lineinformation-add-form.js
| @@ -204,7 +204,7 @@ $(function(){ | @@ -204,7 +204,7 @@ $(function(){ | ||
| 204 | if (params.line) { | 204 | if (params.line) { |
| 205 | 205 | ||
| 206 | // 添加数据 | 206 | // 添加数据 |
| 207 | - $post('/lineInformation1', params, function(result) { | 207 | + $post('/lineInformation', params, function(result) { |
| 208 | 208 | ||
| 209 | // 如果返回结果不为空 | 209 | // 如果返回结果不为空 |
| 210 | if(result){ | 210 | if(result){ |
src/main/resources/static/pages/base/lineversions/add.html
| @@ -44,8 +44,7 @@ | @@ -44,8 +44,7 @@ | ||
| 44 | <div class="form-body"> | 44 | <div class="form-body"> |
| 45 | <input type="hidden" name="lineId" id="lineIdInput" /> | 45 | <input type="hidden" name="lineId" id="lineIdInput" /> |
| 46 | <input type="hidden" name="lineCode" id="lineCodeInput" /> | 46 | <input type="hidden" name="lineCode" id="lineCodeInput" /> |
| 47 | - <input type="hidden" name="lineCode" id="statusInput" /> | ||
| 48 | - | 47 | + |
| 49 | <!-- 表单分组组件 form-group START --> | 48 | <!-- 表单分组组件 form-group START --> |
| 50 | <div class="form-group"> | 49 | <div class="form-group"> |
| 51 | <label class="control-label col-md-5"> | 50 | <label class="control-label col-md-5"> |
src/main/resources/static/pages/base/lineversions/edit.html
| @@ -44,17 +44,8 @@ | @@ -44,17 +44,8 @@ | ||
| 44 | <div class="form-body"> | 44 | <div class="form-body"> |
| 45 | <input type="hidden" name="lineId" id="lineIdInput" /> | 45 | <input type="hidden" name="lineId" id="lineIdInput" /> |
| 46 | <input type="hidden" name="lineCode" id="lineCodeInput" /> | 46 | <input type="hidden" name="lineCode" id="lineCodeInput" /> |
| 47 | - <input type="hidden" name="lineCode" id="statusInput" /> | ||
| 48 | - | ||
| 49 | - <!-- 表单分组组件 form-group START --> | ||
| 50 | - <div class="form-group"> | ||
| 51 | - <label class="control-label col-md-5"> | ||
| 52 | - <span class="required"> * </span>线路版本Id : | ||
| 53 | - </label> | ||
| 54 | - <div class="col-md-4"> | ||
| 55 | - <input type="text" class="form-control" name="Id" id="IdInput" readonly="readonly" /> | ||
| 56 | - </div> | ||
| 57 | - </div> | 47 | + <input type="hidden" name="status" id="statusInput" /> |
| 48 | + <input type="hidden" name="Id" id="IdInput" /> | ||
| 58 | <!-- 表单分组组件 form-group END --> | 49 | <!-- 表单分组组件 form-group END --> |
| 59 | 50 | ||
| 60 | <!-- 表单分组组件 form-group START --> | 51 | <!-- 表单分组组件 form-group START --> |
src/main/resources/static/pages/base/lineversions/js/lineversions-add-from.js
| @@ -198,7 +198,7 @@ | @@ -198,7 +198,7 @@ | ||
| 198 | // 防止用户多次提交 | 198 | // 防止用户多次提交 |
| 199 | $("#submintBtn").addClass("disabled"); | 199 | $("#submintBtn").addClass("disabled"); |
| 200 | // 添加数据 | 200 | // 添加数据 |
| 201 | - $post('/lineVersions/add', params, function(result) { | 201 | + $post('/lineVersions/add', params, function(result) { |
| 202 | // 如果返回结果不为空 | 202 | // 如果返回结果不为空 |
| 203 | if(result){ | 203 | if(result){ |
| 204 | // 返回状态码为"SUCCESS" ,则添加成功;返回状态码为"ERROR" ,则添加失败 | 204 | // 返回状态码为"SUCCESS" ,则添加成功;返回状态码为"ERROR" ,则添加失败 |
src/main/resources/static/pages/base/lineversions/js/lineversions-edit-from.js
| @@ -85,7 +85,6 @@ | @@ -85,7 +85,6 @@ | ||
| 85 | $("#IdInput").val(result.id); | 85 | $("#IdInput").val(result.id); |
| 86 | $("#lineIdInput").val(result.line); | 86 | $("#lineIdInput").val(result.line); |
| 87 | $("#lineCodeInput").val(result.lineCode); | 87 | $("#lineCodeInput").val(result.lineCode); |
| 88 | - $("#lineSelect").val(); | ||
| 89 | $("#lineSelect").val(result.line.id+"_"+result.lineCode).trigger("change"); | 88 | $("#lineSelect").val(result.line.id+"_"+result.lineCode).trigger("change"); |
| 90 | $("#startDateInput").val(moment(result.startDate).format('YYYY-MM-DD HH:mm:ss')); | 89 | $("#startDateInput").val(moment(result.startDate).format('YYYY-MM-DD HH:mm:ss')); |
| 91 | $("#endDateInput").val(moment(result.endDate).format('YYYY-MM-DD HH:mm:ss')); | 90 | $("#endDateInput").val(moment(result.endDate).format('YYYY-MM-DD HH:mm:ss')); |
| @@ -208,6 +207,7 @@ | @@ -208,6 +207,7 @@ | ||
| 208 | submit(); | 207 | submit(); |
| 209 | // 提交 | 208 | // 提交 |
| 210 | function submit() { | 209 | function submit() { |
| 210 | + debugger | ||
| 211 | // 添加数据 | 211 | // 添加数据 |
| 212 | $post('/lineVersions/update', params, function(result) { | 212 | $post('/lineVersions/update', params, function(result) { |
| 213 | // 如果返回结果不为空 | 213 | // 如果返回结果不为空 |
src/main/resources/static/pages/base/lineversions/js/lineversions-list-table.js
| 1 | /** | 1 | /** |
| 2 | - * | ||
| 3 | * @JSName : lineversions-list-table.js(线路版本信息list.html页面js) | 2 | * @JSName : lineversions-list-table.js(线路版本信息list.html页面js) |
| 4 | * @Description : TOOD(线路信息list.html页面js) | 3 | * @Description : TOOD(线路信息list.html页面js) |
| 5 | */ | 4 | */ |
| 5 | +(function () { | ||
| 6 | + // 关闭左侧栏 | ||
| 7 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | ||
| 8 | + // 定义 page : 当前页;initPag ; icheckOptions:选择框 | ||
| 9 | + var page = 0, | ||
| 10 | + initPag, | ||
| 11 | + icheckOptions = {checkboxClass: 'icheckbox_flat-blue',increaseArea: '20%'}, | ||
| 12 | + storage = window.localStorage; | ||
| 13 | + if(storage.xlName_AgursData!=null && storage.xlName_AgursData !='') { | ||
| 14 | + $('.tipso-animation').children().remove(); | ||
| 15 | + // 延迟加载 | ||
| 16 | + setTimeout(function(){ | ||
| 17 | + $('.tipso-animation').tipso({ | ||
| 18 | + speed : 400, | ||
| 19 | + background : '#0ed0e8', | ||
| 20 | + color : '#ffffff', | ||
| 21 | + position :'bottom', | ||
| 22 | + width : 400, | ||
| 23 | + delay : 100, | ||
| 24 | + animationIn : 'fadeInDownBig', | ||
| 25 | + animationOut : 'fadeOut', | ||
| 26 | + offsetX : -50, | ||
| 27 | + offsetY : -195, | ||
| 28 | + content :'您可以通过点击重置按钮来清除对线路名称的记忆哦!', | ||
| 6 | 29 | ||
| 30 | + }); | ||
| 31 | + $('.tipso-animation').tipso('show'); | ||
| 32 | + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | ||
| 33 | + },200); | ||
| 34 | + } | ||
| 35 | + // 营运公司Map[key(businessCode)] = 名字 | ||
| 36 | + var companyMap = new Map(); | ||
| 37 | + // 分公司Map[key(upCode+_+businessCode)] = 名字 | ||
| 38 | + var branchMap = new Map(); | ||
| 39 | + initCompanySelect2(function(array) { | ||
| 40 | + $.each(array, function() { | ||
| 41 | + companyMap[this.businessCode] = this.businessName; | ||
| 42 | + // companyMap.put(this.businessCode.toString(), this.businessName); | ||
| 43 | + if(this.businessCode != null || this.businessCode !=''){ | ||
| 44 | + /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */ | ||
| 45 | + $get('/business/all', {upCode_eq: this.businessCode}, function(array){ | ||
| 46 | + // 遍历array | ||
| 47 | + $.each(array, function(i,d){ | ||
| 48 | + branchMap[this.upCode+"_"+this.businessCode] = this.businessName; | ||
| 49 | + // branchMap.put(this.upCode+"_"+this.businessCode, this.businessName); | ||
| 50 | + }); | ||
| 51 | + }); | ||
| 52 | + } | ||
| 53 | + }); | ||
| 54 | + // 公司下拉options属性值 | ||
| 55 | + var options = '<option value="">请选择...</option>'; | ||
| 56 | + // 遍历array | ||
| 57 | + $.each(array, function(i,d){ | ||
| 58 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 59 | + }); | ||
| 60 | + // 初始化公司下拉框并监听值改变事件. | ||
| 61 | + $('#companySelect').html(options).on('change', setBrancheCompanySelectOptions); | ||
| 62 | + // 初始化分公司下拉框. | ||
| 63 | + setBrancheCompanySelectOptions(); | ||
| 64 | + initLineSelect2(array); | ||
| 65 | + /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */ | ||
| 66 | + loadTableDate({'line.name_like':splitxlName(storage.xlName_AgursData)},true); | ||
| 67 | + }); | ||
| 68 | + | ||
| 69 | + function initLineSelect2(compD) { | ||
| 70 | + getComp(function(rs) { | ||
| 71 | + var params = {}; | ||
| 72 | + if(rs.length>0) { | ||
| 73 | + var compA = new Array(); | ||
| 74 | + for(var c = 0 ; c<rs.length;c++) { | ||
| 75 | + var comC = rs[c].companyCode; | ||
| 76 | + var child = rs[c].children; | ||
| 77 | + if(child.length>0) { | ||
| 78 | + for(var d = 0 ;d< child.length;d++) { | ||
| 79 | + compA.push(comC + '_' + child[d].code); | ||
| 80 | + } | ||
| 81 | + }else { | ||
| 82 | + compA.push(comC); | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + params.cgsbm_in = compA.toString(); | ||
| 86 | + } | ||
| 87 | + // 填充线路拉框选择值 | ||
| 88 | + $get('/line/all', params, function(array){ | ||
| 89 | + var len_ = array.length,paramsD = new Array(); | ||
| 90 | + if(len_>0) { | ||
| 91 | + $.each(array, function(i, g){ | ||
| 92 | + if(g.name!='' || g.name != null) { | ||
| 93 | + paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); | ||
| 94 | + } | ||
| 95 | + }); | ||
| 96 | + if($('span').hasClass('select2-selection')) | ||
| 97 | + $('span .select2-selection').remove(); | ||
| 98 | + initPinYinSelect2($('#lineSelect'),paramsD,function(selector) { | ||
| 99 | + selector.select2("val", storage.xlName_AgursData); | ||
| 100 | + }); | ||
| 101 | + } | ||
| 102 | + }); | ||
| 103 | + }); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + $('#lineSelect').on('change',function() { | ||
| 107 | + var text = $('#lineSelect').val(); | ||
| 108 | + if(text){ | ||
| 109 | + var linecode = text.split("_"); | ||
| 110 | + $("#lineCodeInput").val(linecode[2]); | ||
| 111 | + } | ||
| 112 | + }); | ||
| 113 | + | ||
| 114 | + function gsdmTogsName(gsD,code) { | ||
| 115 | + var rsStr = ''; | ||
| 116 | + for(var s = 0 ; s < gsD.length; s++) { | ||
| 117 | + if(gsD[s].businessCode == code) { | ||
| 118 | + rsStr = rsStr + '(' + gsD[s].businessName.replace('公司','') + ')'; | ||
| 119 | + break; | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + return rsStr; | ||
| 123 | + } | ||
| 7 | 124 | ||
| 8 | - // 关闭左侧栏 | ||
| 9 | - if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | ||
| 10 | - // 定义 page : 当前页;initPag ; icheckOptions:选择框 | ||
| 11 | - var page = 0, | ||
| 12 | - initPag, | ||
| 13 | - icheckOptions = {checkboxClass: 'icheckbox_flat-blue',increaseArea: '20%'}, | ||
| 14 | - storage = window.localStorage; | ||
| 15 | - if(storage.xlName_AgursData!=null && storage.xlName_AgursData !='') { | ||
| 16 | - $('.tipso-animation').children().remove(); | ||
| 17 | - // 延迟加载 | ||
| 18 | - setTimeout(function(){ | ||
| 19 | - $('.tipso-animation').tipso({ | ||
| 20 | - speed : 400, | ||
| 21 | - background : '#0ed0e8', | ||
| 22 | - color : '#ffffff', | ||
| 23 | - position :'bottom', | ||
| 24 | - width : 400, | ||
| 25 | - delay : 100, | ||
| 26 | - animationIn : 'fadeInDownBig', | ||
| 27 | - animationOut : 'fadeOut', | ||
| 28 | - offsetX : -50, | ||
| 29 | - offsetY : -195, | ||
| 30 | - content :'您可以通过点击重置按钮来清除对线路名称的记忆哦!', | ||
| 31 | - | ||
| 32 | - }); | ||
| 33 | - $('.tipso-animation').tipso('show'); | ||
| 34 | - setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | ||
| 35 | - },200); | ||
| 36 | - } | ||
| 37 | - // 营运公司Map[key(businessCode)] = 名字 | ||
| 38 | - var companyMap = new Map(); | ||
| 39 | - // 分公司Map[key(upCode+_+businessCode)] = 名字 | ||
| 40 | - var branchMap = new Map(); | ||
| 41 | - initCompanySelect2(function(array) { | ||
| 42 | - $.each(array, function() { | ||
| 43 | - companyMap[this.businessCode] = this.businessName; | ||
| 44 | - // companyMap.put(this.businessCode.toString(), this.businessName); | ||
| 45 | - if(this.businessCode != null || this.businessCode !=''){ | ||
| 46 | - /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */ | ||
| 47 | - $get('/business/all', {upCode_eq: this.businessCode}, function(array){ | ||
| 48 | - // 遍历array | ||
| 49 | - $.each(array, function(i,d){ | ||
| 50 | - branchMap[this.upCode+"_"+this.businessCode] = this.businessName; | ||
| 51 | - // branchMap.put(this.upCode+"_"+this.businessCode, this.businessName); | ||
| 52 | - }); | ||
| 53 | - }); | ||
| 54 | - } | ||
| 55 | - }); | ||
| 56 | - // 公司下拉options属性值 | ||
| 57 | - var options = '<option value="">请选择...</option>'; | ||
| 58 | - // 遍历array | ||
| 59 | - $.each(array, function(i,d){ | ||
| 60 | - options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 61 | - }); | ||
| 62 | - // 初始化公司下拉框并监听值改变事件. | ||
| 63 | - $('#companySelect').html(options).on('change', setBrancheCompanySelectOptions); | ||
| 64 | - // 初始化分公司下拉框. | ||
| 65 | - setBrancheCompanySelectOptions(); | ||
| 66 | - initLineSelect2(array); | ||
| 67 | - /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */ | ||
| 68 | - loadTableDate({'line.name_like':splitxlName(storage.xlName_AgursData)},true); | ||
| 69 | - }); | ||
| 70 | - | ||
| 71 | - function initLineSelect2(compD) { | ||
| 72 | - getComp(function(rs) { | ||
| 73 | - var params = {}; | ||
| 74 | - if(rs.length>0) { | ||
| 75 | - var compA = new Array(); | ||
| 76 | - for(var c = 0 ; c<rs.length;c++) { | ||
| 77 | - var comC = rs[c].companyCode; | ||
| 78 | - var child = rs[c].children; | ||
| 79 | - if(child.length>0) { | ||
| 80 | - for(var d = 0 ;d< child.length;d++) { | ||
| 81 | - compA.push(comC + '_' + child[d].code); | ||
| 82 | - } | ||
| 83 | - }else { | ||
| 84 | - compA.push(comC); | ||
| 85 | - } | ||
| 86 | - } | ||
| 87 | - params.cgsbm_in = compA.toString(); | ||
| 88 | - } | ||
| 89 | - // 填充线路拉框选择值 | ||
| 90 | - $get('/line/all', params, function(array){ | ||
| 91 | - var len_ = array.length,paramsD = new Array(); | ||
| 92 | - if(len_>0) { | ||
| 93 | - $.each(array, function(i, g){ | ||
| 94 | - if(g.name!='' || g.name != null) { | ||
| 95 | - paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); | ||
| 96 | - } | ||
| 97 | - }); | ||
| 98 | - if($('span').hasClass('select2-selection')) | ||
| 99 | - $('span .select2-selection').remove(); | ||
| 100 | - initPinYinSelect2($('#lineSelect'),paramsD,function(selector) { | ||
| 101 | - selector.select2("val", storage.xlName_AgursData); | ||
| 102 | - }); | ||
| 103 | - } | ||
| 104 | - }); | ||
| 105 | - }); | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - $('#lineSelect').on('change',function() { | ||
| 109 | - var text = $('#lineSelect').val(); | ||
| 110 | - if(text){ | ||
| 111 | - var linecode = text.split("_"); | ||
| 112 | - $("#lineCodeInput").val(linecode[2]); | ||
| 113 | - } | ||
| 114 | - }); | ||
| 115 | - | ||
| 116 | - function gsdmTogsName(gsD,code) { | ||
| 117 | - var rsStr = ''; | ||
| 118 | - for(var s = 0 ; s < gsD.length; s++) { | ||
| 119 | - if(gsD[s].businessCode == code) { | ||
| 120 | - rsStr = rsStr + '(' + gsD[s].businessName.replace('公司','') + ')'; | ||
| 121 | - break; | ||
| 122 | - } | ||
| 123 | - } | ||
| 124 | - return rsStr; | ||
| 125 | - } | ||
| 126 | - | ||
| 127 | function initCompanySelect2(cb) { | 125 | function initCompanySelect2(cb) { |
| 128 | - // get请求获取公司 | ||
| 129 | - $get('/business/all', {upCode_eq: '88'}, function(gs_d){ | ||
| 130 | - return cb && cb(gs_d); | ||
| 131 | - }); | ||
| 132 | - } | ||
| 133 | - function getComp(cb) { | ||
| 134 | - $.get('/user/companyData',null,function(rs) { | ||
| 135 | - return cb && cb(rs); | ||
| 136 | - }); | ||
| 137 | - } | ||
| 138 | - function getParams() { | ||
| 139 | - // cells 集合返回表格中所有(列)单元格的一个数组 | ||
| 140 | - var cells = $('tr.filter')[0].cells; | ||
| 141 | - // 搜索参数集合 | ||
| 142 | - var params = {}; | ||
| 143 | - // 搜索字段名称 | ||
| 144 | - var name; | ||
| 145 | - // 遍历cells数组 | ||
| 146 | - $.each(cells, function(i, cell){ | ||
| 147 | - // 获取第i列的input或者select集合 | ||
| 148 | - var items = $('input,select', cell); | ||
| 149 | - // 遍历items集合 | ||
| 150 | - for(var j = 0, item; item = items[j++];){ | ||
| 151 | - // 获取字段名称 | ||
| 152 | - name = $(item).attr('name'); | ||
| 153 | - if(name){ | ||
| 154 | - // 赋取相对应的值 | ||
| 155 | - params[name] = $(item).val(); | ||
| 156 | - } | ||
| 157 | - } | ||
| 158 | - }); | ||
| 159 | - return params; | ||
| 160 | - } | ||
| 161 | - | ||
| 162 | - /** 表格数据分页加载事件 @param:<param : 查询参数;isPon : 是否重新分页> */ | ||
| 163 | - function loadTableDate(param,isPon){ | ||
| 164 | - // 搜索参数 | ||
| 165 | - var params = {}; | ||
| 166 | - if(param) { | ||
| 167 | - params = param; | ||
| 168 | - } | ||
| 169 | - // 排序(按方向与序号) | ||
| 170 | - params['order'] = 'lineCode,versions'; | ||
| 171 | - // 排序方向. | ||
| 172 | - params['direction'] = 'ASC,ASC'; | ||
| 173 | - // 记录当前页数 | ||
| 174 | - params['page'] = page; | ||
| 175 | - // 弹出正在加载层 | ||
| 176 | - var i = layer.load(2); | ||
| 177 | - // 异步请求获取表格数据 | ||
| 178 | - $.get('/lineVersions',params,function(result){ | ||
| 179 | - // 添加序号 | ||
| 180 | - result.content.page = page; | ||
| 181 | - // 把数据填充到模版中 | 126 | + // get请求获取公司 |
| 127 | + $get('/business/all', {upCode_eq: '88'}, function(gs_d){ | ||
| 128 | + return cb && cb(gs_d); | ||
| 129 | + }); | ||
| 130 | + } | ||
| 131 | + function getComp(cb) { | ||
| 132 | + $.get('/user/companyData',null,function(rs) { | ||
| 133 | + return cb && cb(rs); | ||
| 134 | + }); | ||
| 135 | + } | ||
| 136 | + function getParams() { | ||
| 137 | + // cells 集合返回表格中所有(列)单元格的一个数组 | ||
| 138 | + var cells = $('tr.filter')[0].cells; | ||
| 139 | + // 搜索参数集合 | ||
| 140 | + var params = {}; | ||
| 141 | + // 搜索字段名称 | ||
| 142 | + var name; | ||
| 143 | + // 遍历cells数组 | ||
| 144 | + $.each(cells, function(i, cell){ | ||
| 145 | + // 获取第i列的input或者select集合 | ||
| 146 | + var items = $('input,select', cell); | ||
| 147 | + // 遍历items集合 | ||
| 148 | + for(var j = 0, item; item = items[j++];){ | ||
| 149 | + // 获取字段名称 | ||
| 150 | + name = $(item).attr('name'); | ||
| 151 | + if(name){ | ||
| 152 | + // 赋取相对应的值 | ||
| 153 | + params[name] = $(item).val(); | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + }); | ||
| 157 | + return params; | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + /** 表格数据分页加载事件 @param:<param : 查询参数;isPon : 是否重新分页> */ | ||
| 161 | + function loadTableDate(param,isPon){ | ||
| 162 | + // 搜索参数 | ||
| 163 | + var params = {}; | ||
| 164 | + if(param) { | ||
| 165 | + params = param; | ||
| 166 | + } | ||
| 167 | + // 排序(按方向与序号) | ||
| 168 | + params['order'] = 'lineCode,versions'; | ||
| 169 | + // 排序方向. | ||
| 170 | + params['direction'] = 'ASC,ASC'; | ||
| 171 | + // 记录当前页数 | ||
| 172 | + params['page'] = page; | ||
| 173 | + // 弹出正在加载层 | ||
| 174 | + var i = layer.load(2); | ||
| 175 | + // 异步请求获取表格数据 | ||
| 176 | + $.get('/lineVersions',params,function(result){ | ||
| 177 | + // 添加序号 | ||
| 178 | + result.content.page = page; | ||
| 179 | + // 把数据填充到模版中 | ||
| 182 | $.each(result.content, function(i, data) { | 180 | $.each(result.content, function(i, data) { |
| 183 | result.content[i].gsmc = companyMap[data.line.company]; | 181 | result.content[i].gsmc = companyMap[data.line.company]; |
| 184 | result.content[i].fgsmc = branchMap[data.line.cgsbm]; | 182 | result.content[i].fgsmc = branchMap[data.line.cgsbm]; |
| @@ -186,169 +184,172 @@ | @@ -186,169 +184,172 @@ | ||
| 186 | data.endDateStr=moment(data.endDate).format('YYYY-MM-DD HH:mm:ss'); | 184 | data.endDateStr=moment(data.endDate).format('YYYY-MM-DD HH:mm:ss'); |
| 187 | }); | 185 | }); |
| 188 | 186 | ||
| 189 | - var tbodyHtml = template('lineversions_list_temp',{list:result.content}); | ||
| 190 | - $('#datatable_lineversions tbody').html(tbodyHtml); | ||
| 191 | - // 是重新分页且返回数据长度大于0 | ||
| 192 | - if(isPon && result.content.length > 0){ | ||
| 193 | - // 重新分页 | ||
| 194 | - initPag = true; | ||
| 195 | - // 分页栏 | ||
| 196 | - showPagination(result); | ||
| 197 | - } | ||
| 198 | - // 关闭弹出加载层 | ||
| 199 | - layer.close(i); | ||
| 200 | - }); | ||
| 201 | - } | 187 | + var tbodyHtml = template('lineversions_list_temp',{list:result.content}); |
| 188 | + $('#datatable_lineversions tbody').html(tbodyHtml); | ||
| 189 | + // 是重新分页且返回数据长度大于0 | ||
| 190 | + if(isPon && result.content.length > 0){ | ||
| 191 | + // 重新分页 | ||
| 192 | + initPag = true; | ||
| 193 | + // 分页栏 | ||
| 194 | + showPagination(result); | ||
| 195 | + } | ||
| 196 | + // 关闭弹出加载层 | ||
| 197 | + layer.close(i); | ||
| 198 | + }); | ||
| 199 | + } | ||
| 200 | + | ||
| 202 | 201 | ||
| 202 | + function toDate(timestamp){ | ||
| 203 | + var date = new Date(parseInt(timestamp).toLocaleString()); | ||
| 204 | + return date; | ||
| 205 | + } | ||
| 203 | 206 | ||
| 204 | - function toDate(timestamp){ | ||
| 205 | - var date = new Date(parseInt(timestamp).toLocaleString()); | ||
| 206 | - return date; | ||
| 207 | - } | ||
| 208 | - | ||
| 209 | - /** 复选框组件 */ | ||
| 210 | - function iCheckChange(){ | ||
| 211 | - // 获取当前的父节点tr | ||
| 212 | - var tr = $(this).parents('tr'); | ||
| 213 | - // 判断当前是否选中 | ||
| 214 | - if(this.checked) { | ||
| 215 | - // 选中,则增添父节点tr的样式 | ||
| 216 | - tr.addClass('row-active'); | ||
| 217 | - }else { | ||
| 218 | - // 未选中,则删除父节点tr的样式 | ||
| 219 | - tr.removeClass('row-active'); | ||
| 220 | - } | ||
| 221 | - } | ||
| 222 | - | ||
| 223 | - /** 分页栏组件 */ | ||
| 224 | - function showPagination(data){ | ||
| 225 | - // 分页组件 | ||
| 226 | - $('#pagination').jqPaginator({ | ||
| 227 | - // 总页数 | ||
| 228 | - totalPages: data.totalPages, | ||
| 229 | - // 中间显示页数 | ||
| 230 | - visiblePages: 6, | ||
| 231 | - // 当前页 | ||
| 232 | - currentPage: page + 1, | ||
| 233 | - first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | 207 | + /** 复选框组件 */ |
| 208 | + function iCheckChange(){ | ||
| 209 | + // 获取当前的父节点tr | ||
| 210 | + var tr = $(this).parents('tr'); | ||
| 211 | + // 判断当前是否选中 | ||
| 212 | + if(this.checked) { | ||
| 213 | + // 选中,则增添父节点tr的样式 | ||
| 214 | + tr.addClass('row-active'); | ||
| 215 | + }else { | ||
| 216 | + // 未选中,则删除父节点tr的样式 | ||
| 217 | + tr.removeClass('row-active'); | ||
| 218 | + } | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + /** 分页栏组件 */ | ||
| 222 | + function showPagination(data){ | ||
| 223 | + // 分页组件 | ||
| 224 | + $('#pagination').jqPaginator({ | ||
| 225 | + // 总页数 | ||
| 226 | + totalPages: data.totalPages, | ||
| 227 | + // 中间显示页数 | ||
| 228 | + visiblePages: 6, | ||
| 229 | + // 当前页 | ||
| 230 | + currentPage: page + 1, | ||
| 231 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | ||
| 234 | prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | 232 | prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', |
| 235 | next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | 233 | next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', |
| 236 | last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | 234 | last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', |
| 237 | page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | 235 | page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', |
| 238 | - onPageChange: function (num, type) { | ||
| 239 | - if(initPag){ | ||
| 240 | - initPag = false; | ||
| 241 | - return; | ||
| 242 | - } | ||
| 243 | - var pData = getParams(); | ||
| 244 | - pData['line.name_like'] = splitxlName(pData['line.name_like']); | ||
| 245 | - page = num - 1; | ||
| 246 | - loadTableDate(pData, false); | ||
| 247 | - } | ||
| 248 | - }); | ||
| 249 | - } | ||
| 250 | - /** 填充分公司下拉框选择值 */ | ||
| 251 | - function setBrancheCompanySelectOptions(){ | ||
| 252 | - // 获取公司下拉框选择值 | ||
| 253 | - var businessCode = $('#companySelect').val(); | ||
| 254 | - // 分公司下拉框options属性值 | ||
| 255 | - var options = '<option value="">请选择...</option>'; | ||
| 256 | - // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 | ||
| 257 | - if(businessCode == null || businessCode ==''){ | ||
| 258 | - // 填充分公司下拉框options | ||
| 259 | - $('#brancheCompanySelect').html(options); | ||
| 260 | - } else { | ||
| 261 | - /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */ | ||
| 262 | - $get('/business/all', {upCode_eq: businessCode}, function(array){ | ||
| 263 | - // 遍历array | ||
| 264 | - $.each(array, function(i,d){ | ||
| 265 | - options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 266 | - // 填充分公司下拉框options | ||
| 267 | - $('#brancheCompanySelect').html(options); | ||
| 268 | - }); | ||
| 269 | - }); | ||
| 270 | - } | ||
| 271 | - } | ||
| 272 | - | ||
| 273 | - /** 重置按钮事件 */ | ||
| 274 | - $('tr.filter .filter-cancel').on('click',function() { | ||
| 275 | - // 清空搜索框值 | ||
| 276 | - $('tr.filter input,select').val('').change(); | ||
| 277 | - $('.tipso-animation').tipso('hide'); | ||
| 278 | - storage.setItem('xlName_AgursData',''); | ||
| 279 | - /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */ | ||
| 280 | - loadTableDate(null,true); | ||
| 281 | - }); | ||
| 282 | - | ||
| 283 | - function splitxlName(str) { | ||
| 284 | - var rsStr = ''; | ||
| 285 | - if(str) { | ||
| 286 | - var strArray = str.split('_'); | ||
| 287 | - rsStr = strArray[0]; | ||
| 288 | - } | ||
| 289 | - return rsStr; | ||
| 290 | - } | ||
| 291 | - | ||
| 292 | - | ||
| 293 | - /** 搜索按钮事件 */ | ||
| 294 | - $('tr.filter .filter-submit').on('click',function(){ | ||
| 295 | - var params = getParams(); | ||
| 296 | - if(params['line.name_like']!='' && params['line.name_like'] != null) { | ||
| 297 | - storage.setItem('xlName_AgursData',params['line.name_like']); | ||
| 298 | - } | ||
| 299 | - params['line.name_like'] = splitxlName(params['line.name_like']); | ||
| 300 | - page = 0; | ||
| 301 | - /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */ | ||
| 302 | - loadTableDate(params,true); | ||
| 303 | - }); | ||
| 304 | - | 236 | + onPageChange: function (num, type) { |
| 237 | + if(initPag){ | ||
| 238 | + initPag = false; | ||
| 239 | + return; | ||
| 240 | + } | ||
| 241 | + var pData = getParams(); | ||
| 242 | + pData['line.name_like'] = splitxlName(pData['line.name_like']); | ||
| 243 | + page = num - 1; | ||
| 244 | + loadTableDate(pData, false); | ||
| 245 | + } | ||
| 246 | + }); | ||
| 247 | + } | ||
| 248 | + /** 填充分公司下拉框选择值 */ | ||
| 249 | + function setBrancheCompanySelectOptions(){ | ||
| 250 | + // 获取公司下拉框选择值 | ||
| 251 | + var businessCode = $('#companySelect').val(); | ||
| 252 | + // 分公司下拉框options属性值 | ||
| 253 | + var options = '<option value="">请选择...</option>'; | ||
| 254 | + // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 | ||
| 255 | + if(businessCode == null || businessCode ==''){ | ||
| 256 | + // 填充分公司下拉框options | ||
| 257 | + $('#brancheCompanySelect').html(options); | ||
| 258 | + } else { | ||
| 259 | + /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */ | ||
| 260 | + $get('/business/all', {upCode_eq: businessCode}, function(array){ | ||
| 261 | + // 遍历array | ||
| 262 | + $.each(array, function(i,d){ | ||
| 263 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 264 | + // 填充分公司下拉框options | ||
| 265 | + $('#brancheCompanySelect').html(options); | ||
| 266 | + }); | ||
| 267 | + }); | ||
| 268 | + } | ||
| 269 | + } | ||
| 270 | + | ||
| 271 | + /** 重置按钮事件 */ | ||
| 272 | + $('tr.filter .filter-cancel').on('click',function() { | ||
| 273 | + // 清空搜索框值 | ||
| 274 | + $('tr.filter input,select').val('').change(); | ||
| 275 | + $('.tipso-animation').tipso('hide'); | ||
| 276 | + storage.setItem('xlName_AgursData',''); | ||
| 277 | + /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */ | ||
| 278 | + loadTableDate(null,true); | ||
| 279 | + }); | ||
| 305 | 280 | ||
| 306 | -function updateVersionsRoute(obj){ | ||
| 307 | - var lineId = obj.dataset.lineid; | ||
| 308 | - swal({ | ||
| 309 | - title: "操作须知", | ||
| 310 | - text: "每周会更新数据,请在本周内做完线路走向并发布,不然您做的走向有可能会被覆盖!", | ||
| 311 | - type: "warning", | ||
| 312 | - showCancelButton: true, | ||
| 313 | - confirmButtonColor: "#DD6B55", | ||
| 314 | - confirmButtonText: "知道了!", | ||
| 315 | - cancelButtonText: "不懂!", | ||
| 316 | - closeOnConfirm: false }, | ||
| 317 | - function(isConfirm){ | ||
| 318 | - if(isConfirm){ | ||
| 319 | - var win1 = window.open("http://114.80.178.12:29088/login2.html","线路信息编辑","false"); | ||
| 320 | - setTimeout(function(){ | ||
| 321 | - window.open("http://114.80.178.12:29088/pages/base/stationroute/list.html?no="+lineId,"线路信息编辑","false"); | ||
| 322 | - },1500); | ||
| 323 | - swal.close(); | ||
| 324 | - } | ||
| 325 | - }); | ||
| 326 | -} | 281 | + function splitxlName(str) { |
| 282 | + var rsStr = ''; | ||
| 283 | + if(str) { | ||
| 284 | + var strArray = str.split('_'); | ||
| 285 | + rsStr = strArray[0]; | ||
| 286 | + } | ||
| 287 | + return rsStr; | ||
| 288 | + } | ||
| 327 | 289 | ||
| 328 | -function issueBnt(id){ | ||
| 329 | - swal({ | ||
| 330 | - title: "发布说明", | ||
| 331 | - text: "重复发布会覆盖已有的数据,请确认线路信息正确后发布,发布后需要几分钟后才能再次发布!", | ||
| 332 | - type: "warning", | ||
| 333 | - showCancelButton: true, | ||
| 334 | - confirmButtonColor: "#DD6B55", | ||
| 335 | - confirmButtonText: "确定发布!", | ||
| 336 | - cancelButtonText: "取消发布!", | ||
| 337 | - closeOnConfirm: false }, | ||
| 338 | - function(){ | ||
| 339 | - $.post('/lineVersions/issueVersion',{'id':id},function(result){ | ||
| 340 | - if(result.status=='SUCCESS') { | ||
| 341 | - // 弹出添加成功提示消息 | ||
| 342 | - swal("发布!", "线路站点及走向已发布至历史库,待到版本启用时间自动更新。", "success"); | ||
| 343 | - } else if(result.status=='ERROR') { | ||
| 344 | - // 弹出添加失败提示消息 | ||
| 345 | - swal("发布失败!", "您发布的信息可能有误,请检查!", "ERROR"); | ||
| 346 | - } | ||
| 347 | -// loadPage('list.html'); | ||
| 348 | - // 发布后刷新页面 | ||
| 349 | - var pData = getParams(); | ||
| 350 | - pData['line.name_like'] = splitxlName(pData['line.name_like']); | ||
| 351 | - loadTableDate(pData, false); | ||
| 352 | - }); | ||
| 353 | - }); | ||
| 354 | -} | ||
| 355 | \ No newline at end of file | 290 | \ No newline at end of file |
| 291 | + | ||
| 292 | + /** 搜索按钮事件 */ | ||
| 293 | + $('tr.filter .filter-submit').on('click',function(){ | ||
| 294 | + var params = getParams(); | ||
| 295 | + if(params['line.name_like']!='' && params['line.name_like'] != null) { | ||
| 296 | + storage.setItem('xlName_AgursData',params['line.name_like']); | ||
| 297 | + } | ||
| 298 | + params['line.name_like'] = splitxlName(params['line.name_like']); | ||
| 299 | + page = 0; | ||
| 300 | + /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */ | ||
| 301 | + loadTableDate(params,true); | ||
| 302 | + }); | ||
| 303 | + // 线路版本编辑 | ||
| 304 | + $(document).on('click', 'a.update_versions_route_btn', function () { | ||
| 305 | + debugger | ||
| 306 | + var lineId = $(this).data('lineid'); | ||
| 307 | + swal({ | ||
| 308 | + title: "操作须知", | ||
| 309 | + text: "每周会更新数据,请在本周内做完线路走向并发布,不然您做的走向有可能会被覆盖!", | ||
| 310 | + type: "warning", | ||
| 311 | + showCancelButton: true, | ||
| 312 | + confirmButtonColor: "#DD6B55", | ||
| 313 | + confirmButtonText: "知道了!", | ||
| 314 | + cancelButtonText: "不懂!", | ||
| 315 | + closeOnConfirm: false }, | ||
| 316 | + function(isConfirm){ | ||
| 317 | + if(isConfirm){ | ||
| 318 | + var win1 = window.open("http://114.80.178.12:29088/login2.html","线路信息编辑","false"); | ||
| 319 | + setTimeout(function(){ | ||
| 320 | + window.open("http://114.80.178.12:29088/pages/base/stationroute/list.html?no="+lineId,"线路信息编辑","false"); | ||
| 321 | + },1500); | ||
| 322 | + swal.close(); | ||
| 323 | + } | ||
| 324 | + }); | ||
| 325 | + }); | ||
| 326 | + // 版本发布 | ||
| 327 | + $(document).on('click', 'a.issue_btn', function () { | ||
| 328 | + var id = $(this).data('id'); | ||
| 329 | + swal({ | ||
| 330 | + title: "发布说明", | ||
| 331 | + text: "重复发布会覆盖已有的数据,请确认线路信息正确后发布,发布后需要几分钟后才能再次发布!", | ||
| 332 | + type: "warning", | ||
| 333 | + showCancelButton: true, | ||
| 334 | + confirmButtonColor: "#DD6B55", | ||
| 335 | + confirmButtonText: "确定发布!", | ||
| 336 | + cancelButtonText: "取消发布!", | ||
| 337 | + closeOnConfirm: false }, | ||
| 338 | + function(){ | ||
| 339 | + $.post('/lineVersions/issueVersion',{'id':id},function(result){ | ||
| 340 | + if(result.status=='SUCCESS') { | ||
| 341 | + // 弹出添加成功提示消息 | ||
| 342 | + swal("发布!", "线路站点及走向已发布至历史库,5分钟内自动同步到历史表后,即可排班。", "success"); | ||
| 343 | + } else if(result.status=='ERROR') { | ||
| 344 | + // 弹出添加失败提示消息 | ||
| 345 | + swal("发布失败!", "您发布的信息可能有误,请检查!", "ERROR"); | ||
| 346 | + } | ||
| 347 | + // loadPage('list.html'); | ||
| 348 | + // 发布后刷新页面 | ||
| 349 | + var pData = getParams(); | ||
| 350 | + pData['line.name_like'] = splitxlName(pData['line.name_like']); | ||
| 351 | + page = page; | ||
| 352 | + loadTableDate(pData, false); | ||
| 353 | + }); | ||
| 354 | + }); | ||
| 355 | + }); | ||
| 356 | +})(); | ||
| 356 | \ No newline at end of file | 357 | \ No newline at end of file |
src/main/resources/static/pages/base/lineversions/list.html
| @@ -119,75 +119,9 @@ | @@ -119,75 +119,9 @@ | ||
| 119 | </td> | 119 | </td> |
| 120 | <td> | 120 | <td> |
| 121 | {{obj.gsmc}} | 121 | {{obj.gsmc}} |
| 122 | - <!--{{if obj.line.company == '55'}} | ||
| 123 | - 上南公司 | ||
| 124 | - {{else if obj.line.company == '22'}} | ||
| 125 | - 金高公司 | ||
| 126 | - {{else if obj.line.company == '05'}} | ||
| 127 | - 杨高公司 | ||
| 128 | - {{else if obj.line.company == '26'}} | ||
| 129 | - 南汇公司 | ||
| 130 | - {{else if obj.line.company == '77'}} | ||
| 131 | - 闵行公司 | ||
| 132 | - {{/if}}--> | ||
| 133 | </td> | 122 | </td> |
| 134 | <td> | 123 | <td> |
| 135 | {{obj.fgsmc}} | 124 | {{obj.fgsmc}} |
| 136 | - <!--{{if obj.line.company == '55'}} | ||
| 137 | - | ||
| 138 | - {{if obj.line.brancheCompany == '1'}} | ||
| 139 | - 上南二分公司 | ||
| 140 | - {{else if obj.line.brancheCompany == '2'}} | ||
| 141 | - 上南三分公司 | ||
| 142 | - {{else if obj.line.brancheCompany == '3'}} | ||
| 143 | - 上南六分公司 | ||
| 144 | - {{else if obj.line.brancheCompany == '4'}} | ||
| 145 | - 上南一分公司 | ||
| 146 | - {{/if}} | ||
| 147 | - | ||
| 148 | - {{else if obj.company == '22'}} | ||
| 149 | - | ||
| 150 | - {{if obj.line.brancheCompany == '1'}} | ||
| 151 | - 四分公司 | ||
| 152 | - {{else if obj.line.brancheCompany == '2'}} | ||
| 153 | - 二分公司 | ||
| 154 | - {{else if obj.line.brancheCompany == '3'}} | ||
| 155 | - 三分公司 | ||
| 156 | - {{else if obj.line.brancheCompany == '5'}} | ||
| 157 | - 一分公司 | ||
| 158 | - {{/if}} | ||
| 159 | - | ||
| 160 | - {{else if obj.line.company == '05'}} | ||
| 161 | - | ||
| 162 | - {{if obj.line.brancheCompany == '1'}} | ||
| 163 | - 川沙分公司 | ||
| 164 | - {{else if obj.line.brancheCompany == '2'}} | ||
| 165 | - 金桥分公司 | ||
| 166 | - {{else if obj.line.brancheCompany == '3'}} | ||
| 167 | - 芦潮港分公司 | ||
| 168 | - {{else if obj.line.brancheCompany == '5'}} | ||
| 169 | - 杨高分公司 | ||
| 170 | - {{else if obj.line.brancheCompany == '6'}} | ||
| 171 | - 周浦分公司 | ||
| 172 | - {{/if}} | ||
| 173 | - | ||
| 174 | - {{else if obj.line.company == '26'}} | ||
| 175 | - | ||
| 176 | - {{if obj.line.brancheCompany == '1'}} | ||
| 177 | - 南汇一分 | ||
| 178 | - {{else if obj.line.brancheCompany == '2'}} | ||
| 179 | - 南汇二分 | ||
| 180 | - {{else if obj.line.brancheCompany == '3'}} | ||
| 181 | - 南汇三分 | ||
| 182 | - {{else if obj.line.brancheCompany == '4'}} | ||
| 183 | - 南汇维修公司 | ||
| 184 | - {{else if obj.line.brancheCompany == '5'}} | ||
| 185 | - 南汇公司 | ||
| 186 | - {{else if obj.brancheCompany == '6'}} | ||
| 187 | - 航头枢纽站 | ||
| 188 | - {{/if}} | ||
| 189 | - | ||
| 190 | - {{/if}}--> | ||
| 191 | </td> | 125 | </td> |
| 192 | <td> | 126 | <td> |
| 193 | {{obj.startDateStr}} | 127 | {{obj.startDateStr}} |
| @@ -213,10 +147,10 @@ | @@ -213,10 +147,10 @@ | ||
| 213 | <td> | 147 | <td> |
| 214 | <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> | 148 | <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> |
| 215 | {{if obj.status == '2'}} | 149 | {{if obj.status == '2'}} |
| 216 | - <a class="btn default blue-stripe btn-sm" data-lineid="{{obj.line.id}}" onclick="updateVersionsRoute(this)" data-pjax> 编辑版本路线 </a> | 150 | + <a class="update_versions_route_btn btn default blue-stripe btn-sm" data-lineid="{{obj.line.id}}" data-pjax> 编辑版本路线 </a> |
| 217 | {{/if}} | 151 | {{/if}} |
| 218 | {{if obj.status == '2' && obj.isupdate!=1}} | 152 | {{if obj.status == '2' && obj.isupdate!=1}} |
| 219 | - <a class="btn btn-danger btn-sm" onclick = "issueBnt({{obj.id}})" data-pjax>发布</a> | 153 | + <a class="issue_btn btn btn-danger btn-sm" data-id="{{obj.id}}" data-pjax>发布</a> |
| 220 | {{else if obj.status == '2' && obj.isupdate==1}} | 154 | {{else if obj.status == '2' && obj.isupdate==1}} |
| 221 | <a class="btn btn-danger btn-sm disabled">数据同步中</a> | 155 | <a class="btn btn-danger btn-sm disabled">数据同步中</a> |
| 222 | {{/if}} | 156 | {{/if}} |
src/main/resources/static/pages/base/section/editsection.html
| @@ -184,7 +184,7 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | @@ -184,7 +184,7 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | ||
| 184 | }); */ | 184 | }); */ |
| 185 | var array = treeData[0].children[1].children,paramsD =new Array(); | 185 | var array = treeData[0].children[1].children,paramsD =new Array(); |
| 186 | var eq_scetionRouteCode = Section.sectionRouteCode; | 186 | var eq_scetionRouteCode = Section.sectionRouteCode; |
| 187 | - paramsD.push({'id':'请选择...','text':'请选择...'}); | 187 | + paramsD.push({'id':'请选择...','text':'将此路段设置位第一个路段'}); |
| 188 | // 遍历. | 188 | // 遍历. |
| 189 | $.each(array, function(i, g){ | 189 | $.each(array, function(i, g){ |
| 190 | // 判断. | 190 | // 判断. |
| @@ -300,5 +300,5 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | @@ -300,5 +300,5 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | ||
| 300 | }); | 300 | }); |
| 301 | } | 301 | } |
| 302 | }); | 302 | }); |
| 303 | -}); | 303 | +}); |
| 304 | </script> | 304 | </script> |
| 305 | \ No newline at end of file | 305 | \ No newline at end of file |
src/main/resources/static/pages/base/section/js/section-list-table.js
| @@ -147,7 +147,7 @@ | @@ -147,7 +147,7 @@ | ||
| 147 | var len_ = array.length,paramsD = new Array(); | 147 | var len_ = array.length,paramsD = new Array(); |
| 148 | if(len_>0) { | 148 | if(len_>0) { |
| 149 | $.each(array, function(i, g){ | 149 | $.each(array, function(i, g){ |
| 150 | - if(g.name!='' || g.name != null) { | 150 | + if(g.remove != 1 && (g.name!='' || g.name != null)) { |
| 151 | paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); | 151 | paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); |
| 152 | } | 152 | } |
| 153 | }); | 153 | }); |
src/main/resources/static/pages/base/station/js/station-list-table.js
| @@ -173,7 +173,7 @@ | @@ -173,7 +173,7 @@ | ||
| 173 | var len_ = array.length,paramsD = new Array(); | 173 | var len_ = array.length,paramsD = new Array(); |
| 174 | if(len_>0) { | 174 | if(len_>0) { |
| 175 | $.each(array, function(i, g){ | 175 | $.each(array, function(i, g){ |
| 176 | - if(g.name!='' || g.name != null) { | 176 | + if(g.remove != 1 && (g.name!='' || g.name != null)) { |
| 177 | paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); | 177 | paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); |
| 178 | } | 178 | } |
| 179 | }); | 179 | }); |
src/main/resources/static/pages/base/stationroute/editsection.html
| @@ -168,7 +168,7 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | @@ -168,7 +168,7 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | ||
| 168 | + ' --' + fun.dirdmToName(dArray[i].sectionrouteDirections) + '</option>' ; | 168 | + ' --' + fun.dirdmToName(dArray[i].sectionrouteDirections) + '</option>' ; |
| 169 | } | 169 | } |
| 170 | $('#sectionrouteCodeSelect').html(options); */ | 170 | $('#sectionrouteCodeSelect').html(options); */ |
| 171 | - paramsD.push({'id':'请选择...','text':'请选择...'}); | 171 | + paramsD.push({'id':'请选择...','text':'将此路段设置位第一个路段'}); |
| 172 | // 遍历. | 172 | // 遍历. |
| 173 | $.each(array, function(i, g){ | 173 | $.each(array, function(i, g){ |
| 174 | // 判断. | 174 | // 判断. |
| @@ -270,5 +270,5 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | @@ -270,5 +270,5 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | ||
| 270 | }); | 270 | }); |
| 271 | } | 271 | } |
| 272 | }); | 272 | }); |
| 273 | -}); | 273 | +}); |
| 274 | </script> | 274 | </script> |
| 275 | \ No newline at end of file | 275 | \ No newline at end of file |
src/main/resources/static/pages/control/lineallot_v2/main.html
| @@ -123,6 +123,14 @@ | @@ -123,6 +123,14 @@ | ||
| 123 | .uk-button-default{ | 123 | .uk-button-default{ |
| 124 | background: #e0e0e0 !important; | 124 | background: #e0e0e0 !important; |
| 125 | } | 125 | } |
| 126 | + | ||
| 127 | + .line_list_all_wrap > .item.destroy{ | ||
| 128 | + color: #f64242; | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + .checked_list > .item.destroy{ | ||
| 132 | + background: #ff5c5c; | ||
| 133 | + } | ||
| 126 | </style> | 134 | </style> |
| 127 | </head> | 135 | </head> |
| 128 | 136 | ||
| @@ -169,7 +177,7 @@ | @@ -169,7 +177,7 @@ | ||
| 169 | 177 | ||
| 170 | <script id="line_list_items_temp" type="text/html"> | 178 | <script id="line_list_items_temp" type="text/html"> |
| 171 | {{each list as obj i}} | 179 | {{each list as obj i}} |
| 172 | - <span class="item" data-id="{{obj.lineCode}}" data-gsbm="{{obj.company}}_{{obj.brancheCompany}}">{{obj.name}}</span> | 180 | + <span class="item {{obj.destroy==1?'destroy':''}}" data-id="{{obj.lineCode}}" data-gsbm="{{obj.company}}_{{obj.brancheCompany}}">{{obj.name}}</span> |
| 173 | {{/each}} | 181 | {{/each}} |
| 174 | </script> | 182 | </script> |
| 175 | 183 | ||
| @@ -258,7 +266,7 @@ | @@ -258,7 +266,7 @@ | ||
| 258 | /** | 266 | /** |
| 259 | * 查询所有线路 | 267 | * 查询所有线路 |
| 260 | */ | 268 | */ |
| 261 | - $.get('/line/all', {destroy_eq: 0}, function (list) { | 269 | + $.get('/line/all', {remove_ne: 1}, function (list) { |
| 262 | ep.emit('all_lines', list); | 270 | ep.emit('all_lines', list); |
| 263 | }); | 271 | }); |
| 264 | 272 | ||
| @@ -283,7 +291,7 @@ | @@ -283,7 +291,7 @@ | ||
| 283 | } | 291 | } |
| 284 | else { | 292 | else { |
| 285 | $(this).addClass('active'); | 293 | $(this).addClass('active'); |
| 286 | - var span = $('<span data-id="'+lineCode+'" class="item uk-card uk-card-default uk-animation-slide-bottom">'+name+'</span>') | 294 | + var span = $('<span data-id="'+lineCode+'" class="item uk-card uk-card-default uk-animation-slide-bottom '+($(this).hasClass('destroy')?"destroy":"")+'">'+name+'</span>') |
| 287 | .one('webkitAnimationEnd', function () { | 295 | .one('webkitAnimationEnd', function () { |
| 288 | $(this).removeClass('uk-animation-slide-bottom'); | 296 | $(this).removeClass('uk-animation-slide-bottom'); |
| 289 | }); | 297 | }); |
src/main/resources/static/pages/forms/mould/shifday.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/shiftuehiclemanth.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/shiftuehiclemanthclzbh.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/shiftuehiclemanthspy.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/timeAndSpeed.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/firstAndLastBus_delay.html
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
| @@ -170,14 +170,6 @@ | @@ -170,14 +170,6 @@ | ||
| 170 | if (!$('body').hasClass('page-sidebar-closed')) | 170 | if (!$('body').hasClass('page-sidebar-closed')) |
| 171 | $('.menu-toggler.sidebar-toggler').click(); | 171 | $('.menu-toggler.sidebar-toggler').click(); |
| 172 | 172 | ||
| 173 | - $("#startDate").datetimepicker({ | ||
| 174 | - format : 'YYYY-MM-DD', | ||
| 175 | - locale : 'zh-cn' | ||
| 176 | - }); | ||
| 177 | - $("#endDate").datetimepicker({ | ||
| 178 | - format : 'YYYY-MM-DD', | ||
| 179 | - locale : 'zh-cn' | ||
| 180 | - }); | ||
| 181 | 173 | ||
| 182 | $("#times1").datetimepicker({ | 174 | $("#times1").datetimepicker({ |
| 183 | format : 'HH:mm', | 175 | format : 'HH:mm', |
| @@ -189,6 +181,7 @@ | @@ -189,6 +181,7 @@ | ||
| 189 | }); | 181 | }); |
| 190 | 182 | ||
| 191 | var d = new Date(); | 183 | var d = new Date(); |
| 184 | + d.setTime(d.getTime() - 1*1000*60*60*24); | ||
| 192 | var year = d.getFullYear(); | 185 | var year = d.getFullYear(); |
| 193 | var month = d.getMonth() + 1; | 186 | var month = d.getMonth() + 1; |
| 194 | var day = d.getDate(); | 187 | var day = d.getDate(); |
| @@ -196,8 +189,19 @@ | @@ -196,8 +189,19 @@ | ||
| 196 | month = "0" + month; | 189 | month = "0" + month; |
| 197 | if(day < 10) | 190 | if(day < 10) |
| 198 | day = "0" + day; | 191 | day = "0" + day; |
| 199 | - $("#startDate").val(year + "-" + month + "-" + day); | ||
| 200 | - $("#endDate").val(year + "-" + month + "-" + day); | 192 | + var dateTime = year + "-" + month + "-" + day; |
| 193 | + $("#startDate").datetimepicker({ | ||
| 194 | + format : 'YYYY-MM-DD', | ||
| 195 | + locale : 'zh-cn', | ||
| 196 | + maxDate : dateTime | ||
| 197 | + }); | ||
| 198 | + $("#endDate").datetimepicker({ | ||
| 199 | + format : 'YYYY-MM-DD', | ||
| 200 | + locale : 'zh-cn', | ||
| 201 | + maxDate : dateTime | ||
| 202 | + }); | ||
| 203 | + $("#startDate").val(dateTime); | ||
| 204 | + $("#endDate").val(dateTime); | ||
| 201 | 205 | ||
| 202 | $("#times1").val("05:00"); | 206 | $("#times1").val("05:00"); |
| 203 | $("#times2").val("23:00"); | 207 | $("#times2").val("23:00"); |
| @@ -391,7 +395,8 @@ | @@ -391,7 +395,8 @@ | ||
| 391 | var tbodyHtml = template('list_lineTimeAnaly',{list:result}); | 395 | var tbodyHtml = template('list_lineTimeAnaly',{list:result}); |
| 392 | // 把渲染好的模版html文本追加到表格中 | 396 | // 把渲染好的模版html文本追加到表格中 |
| 393 | $('#forms tbody').html(tbodyHtml); | 397 | $('#forms tbody').html(tbodyHtml); |
| 394 | - | 398 | + $("#works_hidden").addClass("hidden"); |
| 399 | + $("#printArea").addClass("hidden"); | ||
| 395 | list = result; | 400 | list = result; |
| 396 | }); | 401 | }); |
| 397 | 402 | ||
| @@ -413,6 +418,7 @@ | @@ -413,6 +418,7 @@ | ||
| 413 | $('#works tbody').html(tbodyHtml); | 418 | $('#works tbody').html(tbodyHtml); |
| 414 | $("#works_hidden").removeClass("hidden"); | 419 | $("#works_hidden").removeClass("hidden"); |
| 415 | $("#works .hidden").removeClass("hidden"); | 420 | $("#works .hidden").removeClass("hidden"); |
| 421 | + $("#printArea").removeClass("hidden"); | ||
| 416 | $("#date1").html(g.dates); | 422 | $("#date1").html(g.dates); |
| 417 | $("#line1").html(g.line); | 423 | $("#line1").html(g.line); |
| 418 | $("#lp1").html(g.lp); | 424 | $("#lp1").html(g.lp); |
src/main/resources/static/pages/history_sch/edit/history_sch_maintain.html
| @@ -495,22 +495,27 @@ | @@ -495,22 +495,27 @@ | ||
| 495 | $(that).prepend('<i class="uk-icon-spinner uk-icon-spin"></i>'); | 495 | $(that).prepend('<i class="uk-icon-spinner uk-icon-spin"></i>'); |
| 496 | 496 | ||
| 497 | 497 | ||
| 498 | - var reCountEp = EventProxy.create('ylbUpdate', function () { | 498 | + var reCountEp = EventProxy.create('ylbUpdate', 'calcWaybill', 'scheduleDetail', function () { |
| 499 | $('i.uk-icon-spin', that).remove(); | 499 | $('i.uk-icon-spin', that).remove(); |
| 500 | $(that).removeAttr('disabled'); | 500 | $(that).removeAttr('disabled'); |
| 501 | notify_succ('重新统计成功!'); | 501 | notify_succ('重新统计成功!'); |
| 502 | }); | 502 | }); |
| 503 | 503 | ||
| 504 | //统计路单 -娄高峰 | 504 | //统计路单 -娄高峰 |
| 505 | - /*gb_common.$get('/calcWaybill/generateNew', {date:rq, line: lineCode}, function () { | ||
| 506 | - reCountEp.emitLater('calcWaybill'); | ||
| 507 | - });*/ | 505 | + gb_common.$get('/calcWaybill/generateNew', {date:rq, line: lineCode}, function () { |
| 506 | + reCountEp.emitLater('calcWaybill'); | ||
| 507 | + }); | ||
| 508 | 508 | ||
| 509 | //统计油 -廖磊 | 509 | //统计油 -廖磊 |
| 510 | gb_common.$post('/ylb/updateHistory', {date:rq, line: lineCode}, function () { | 510 | gb_common.$post('/ylb/updateHistory', {date:rq, line: lineCode}, function () { |
| 511 | reCountEp.emitLater('ylbUpdate'); | 511 | reCountEp.emitLater('ylbUpdate'); |
| 512 | }); | 512 | }); |
| 513 | 513 | ||
| 514 | + //重新统计班次明细 | ||
| 515 | + gb_common.$post('/sch/reCalc/scheduleDetail', {date:rq, line: lineCode}, function () { | ||
| 516 | + reCountEp.emitLater('scheduleDetail'); | ||
| 517 | + }); | ||
| 518 | + | ||
| 514 | }, '我确定'); | 519 | }, '我确定'); |
| 515 | }); | 520 | }); |
| 516 | })(); | 521 | })(); |
src/main/resources/static/pages/home.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | height: calc(100% + 10px); | 6 | height: calc(100% + 10px); |
| 7 | margin-top: -10px; | 7 | margin-top: -10px; |
| 8 | font-size: 14px; | 8 | font-size: 14px; |
| 9 | - padding: 20px 0 0 15px; | 9 | + padding: 10px 0 0 15px; |
| 10 | overflow: auto; | 10 | overflow: auto; |
| 11 | } | 11 | } |
| 12 | .system_change_log>ul{ | 12 | .system_change_log>ul{ |
| @@ -22,6 +22,8 @@ | @@ -22,6 +22,8 @@ | ||
| 22 | font-size: 12px; | 22 | font-size: 12px; |
| 23 | font-family: 微软雅黑; | 23 | font-family: 微软雅黑; |
| 24 | color: #000; | 24 | color: #000; |
| 25 | + margin-top: 8px; | ||
| 26 | + margin-bottom: 8px; | ||
| 25 | } | 27 | } |
| 26 | 28 | ||
| 27 | .system_change_log>ul>li{ | 29 | .system_change_log>ul>li{ |
| @@ -62,32 +64,33 @@ | @@ -62,32 +64,33 @@ | ||
| 62 | <li class="sub_title"><h6>基础信息</h6></li> | 64 | <li class="sub_title"><h6>基础信息</h6></li> |
| 63 | <li><span class="label s_c_add">新增</span>1、新增站点间双路段生成功能。</li> | 65 | <li><span class="label s_c_add">新增</span>1、新增站点间双路段生成功能。</li> |
| 64 | <li><span class="label s_c_change">修复</span>2、修复一个bug,在线路编辑页面初始化线路的系统规划功能,百度地图上缺少的线路会显示一直加载。</li> | 66 | <li><span class="label s_c_change">修复</span>2、修复一个bug,在线路编辑页面初始化线路的系统规划功能,百度地图上缺少的线路会显示一直加载。</li> |
| 65 | - <li><span class="label s_c_change">修复</span>3、修复一个bug,在修改站点时选择取消,不点击站点树状图,直接选择上/下行操作里的修改站点,会出现没有可修改站点的bug。</li> | ||
| 66 | - <li><span class="label s_c_change">修复</span>4、线路跨版本更新修复。</li> | ||
| 67 | - <li><span class="label s_c_change">修复</span>5、线路、线路版本、停车场查询列表显示公司。</li> | ||
| 68 | - <li><span class="label s_c_add">新增</span>6、新增线路删除功能,可以删除已撤销的线路,仅用于剔除录入错误的数据,如出现误操作,请联系管理员恢复数据。</li> | 67 | + <li><span class="label s_c_change">修改</span>3、修改站点位置修改。</li> |
| 68 | + <li><span class="label s_c_add">新增</span>4、新增线路删除功能,可以删除已撤销的线路,仅用于剔除录入错误的数据,如出现误操作,请联系管理员恢复数据。</li> | ||
| 69 | <li class="sub_title"><h6>用油和报表</h6></li> | 69 | <li class="sub_title"><h6>用油和报表</h6></li> |
| 70 | - <li><span class="label s_c_add">新增</span>7、油量,电量记录操作日志。</li> | ||
| 71 | - <li><span class="label s_c_change">修复</span>8、修正获取加存油信息特殊情况下获取不到前一天的进场值。</li> | ||
| 72 | - <li><span class="label s_c_change">修复</span>9、行车路单批量导出,由之前导出成多个压缩文件改为导出成一个文件</li> | ||
| 73 | - <li><span class="label s_c_add">新增</span>10、新增班次准点率统计导出。</li> | ||
| 74 | - <li><span class="label s_c_change">修复</span>11、修复一个bug,这个bug导致在更换设备号后,驾驶员请求台账出现车辆字段为空的情况。</li> | 70 | + <li><span class="label s_c_add">新增</span>5、油量,电量记录操作日志。</li> |
| 71 | + <li><span class="label s_c_change">修复</span>6、修正获取加存油信息特殊情况下获取不到前一天的进场值。</li> | ||
| 72 | + <li><span class="label s_c_change">修复</span>7、行车路单批量导出,由之前导出成多个压缩文件改为导出成一个文件</li> | ||
| 73 | + <li><span class="label s_c_add">新增</span>8、新增班次准点率统计导出。</li> | ||
| 74 | + <li><span class="label s_c_change">修复</span>9、修复一个bug,这个bug导致在更换设备号后,驾驶员请求台账出现车辆字段为空的情况。</li> | ||
| 75 | <li class="sub_title"><h6>计划调度</h6></li> | 75 | <li class="sub_title"><h6>计划调度</h6></li> |
| 76 | - <li><span class="label s_c_add">新增</span>12、时刻表自动生成,根据时间间隔自动时刻表生成,导出生成的时刻表数据。</li> | ||
| 77 | - <li><span class="label s_c_add">新增</span>13、时刻表版本导入,导入时刻表可选版本,编辑时间表带版本。</li> | ||
| 78 | - <li><span class="label s_c_add">新增</span>14、添加车辆报废功能,释放报废的车辆所持有的设备编号。</li> | ||
| 79 | - <li><span class="label s_c_change">修复</span>15、车辆设备管理,启用日期精确到时间分钟。</li> | 76 | + <li><span class="label s_c_add">新增</span>10、时刻表自动生成,根据时间间隔自动时刻表生成,导出生成的时刻表数据。</li> |
| 77 | + <li><span class="label s_c_add">新增</span>11、时刻表版本导入,导入时刻表可选版本,编辑时间表带版本。</li> | ||
| 78 | + <li><span class="label s_c_add">新增</span>12、添加车辆报废功能,释放报废的车辆所持有的设备编号。</li> | ||
| 79 | + <li><span class="label s_c_change">修复</span>13、车辆设备管理,启用日期精确到时间分钟。</li> | ||
| 80 | <li class="sub_title"><h6>线调</h6></li> | 80 | <li class="sub_title"><h6>线调</h6></li> |
| 81 | - <li><span class="label s_c_change">修复</span>16、修复一个轨迹回放的bug,这个bug导致在车辆更换设备号之后,无法回放更换设备之前的数据。</li> | ||
| 82 | - <li><span class="label s_c_change">修复</span>17、修复驾驶员请求信使,无法点击不同意的问题。</li> | ||
| 83 | - <li><span class="label s_c_add">新增</span>18、新增异常提示,当子任务公里与计划不等时,子任务 badge 将会显示为红色,相等则为绿色。</li> | ||
| 84 | - <li><span class="label s_c_add">新增</span>19、新增子任务修改功能。</li> | ||
| 85 | - <li><span class="label s_c_add">新增</span>20、新增点击路牌单元格时,信使框下方弹出tip,显示路牌公里。</li> | ||
| 86 | - <li><span class="label s_c_add">新增</span>21、新增车辆状态标记,如果车辆在套跑其他线路班次,在车辆单元格右上角会出现一个 icon 显示车辆当前执行的线路。</li> | ||
| 87 | - <li><span class="label s_c_add">新增</span>22、新增双击车辆单元格展开全部车辆面板,显示所有的计划用车和实际的车载信号。</li> | ||
| 88 | - <li><span class="label s_c_add">新增</span>23、新增超速提醒,地图模块左下角。</li> | ||
| 89 | - <li><span class="label s_c_remove">删除</span>24、移除了表格渐变色。</li> | ||
| 90 | - <li><span class="label s_c_add">新增</span>25、模拟图车辆展开的tip上,显示司售信息。</li> | ||
| 91 | - <li><span class="label s_c_add">新增</span>26、轨迹回放窗口打开时,点击班次,会自动将班次车辆时间写入轨迹搜索表单。</li> | 81 | + <li><span class="label s_c_change">修复</span>14、修复一个轨迹回放的bug,这个bug导致在车辆更换设备号之后,无法回放更换设备之前的数据。</li> |
| 82 | + <li><span class="label s_c_change">修复</span>15、修复驾驶员请求信使,无法点击不同意的问题。</li> | ||
| 83 | + <li><span class="label s_c_add">新增</span>16、新增异常提示,当子任务公里与计划不等时,子任务 badge 将会显示为红色,相等则为绿色。</li> | ||
| 84 | + <li><span class="label s_c_add">新增</span>17、新增子任务修改功能。</li> | ||
| 85 | + <li><span class="label s_c_add">新增</span>18、新增点击路牌单元格时,信使框下方弹出tip,显示路牌公里。</li> | ||
| 86 | + <li><span class="label s_c_add">新增</span>19、新增车辆状态标记,如果车辆在套跑其他线路班次,在车辆单元格右上角会出现一个 icon 显示车辆当前执行的线路。</li> | ||
| 87 | + <li><span class="label s_c_add">新增</span>20、新增双击车辆单元格展开全部车辆面板,显示所有的计划用车和实际的车载信号。</li> | ||
| 88 | + <li><span class="label s_c_add">新增</span>21、新增超速提醒,地图模块左下角。</li> | ||
| 89 | + <li><span class="label s_c_remove">删除</span>22、移除了表格渐变色。</li> | ||
| 90 | + <li><span class="label s_c_add">新增</span>23、模拟图车辆展开的tip上,显示司售信息。</li> | ||
| 91 | + <li><span class="label s_c_add">新增</span>24、轨迹回放窗口打开时,点击班次,会自动将班次车辆时间写入轨迹搜索表单。</li> | ||
| 92 | + <li><span class="label s_c_add">新增</span>25、已撤销的线路也可以进入线调(线路授权、选择线路、线调tab 等页面均以红色区分撤销的线路)。</li> | ||
| 93 | + <li><span class="label s_c_add">新增</span>26、轨迹回放点击搜索后,车辆输入框后面会显示设备号,悬停展示该设备号的更换时间。</li> | ||
| 94 | + <li><span class="label s_c_add">新增</span>27、轨迹回放的停车场下拉列表新增搜索功能。</li> | ||
| 92 | </ul> | 95 | </ul> |
| 93 | </div> | 96 | </div> |