Commit 7b9315bee4686a6223283167b04c44140f0fe5cc
Merge branch 'minhang' into pudong
Showing
36 changed files
with
1149 additions
and
686 deletions
Too many changes to show.
To preserve performance only 36 of 59 files are displayed.
pom.xml
| 1 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 1 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 2 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | 2 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 3 | 3 | ||
| 4 | <modelVersion>4.0.0</modelVersion> | 4 | <modelVersion>4.0.0</modelVersion> |
| 5 | <groupId>com.bsth</groupId> | 5 | <groupId>com.bsth</groupId> |
| @@ -237,27 +237,33 @@ | @@ -237,27 +237,33 @@ | ||
| 237 | <version>1.13</version> | 237 | <version>1.13</version> |
| 238 | </dependency> | 238 | </dependency> |
| 239 | 239 | ||
| 240 | - <dependency> | ||
| 241 | - <groupId>org.dbunit</groupId> | ||
| 242 | - <artifactId>dbunit</artifactId> | ||
| 243 | - <version>2.4.9</version> | ||
| 244 | - <scope>test</scope> | 240 | + <dependency> |
| 241 | + <groupId>org.dbunit</groupId> | ||
| 242 | + <artifactId>dbunit</artifactId> | ||
| 243 | + <version>2.4.9</version> | ||
| 244 | + <scope>test</scope> | ||
| 245 | 245 | ||
| 246 | - <exclusions> | ||
| 247 | - <exclusion> | ||
| 248 | - <groupId>org.slf4j</groupId> | ||
| 249 | - <artifactId>slf4j-api</artifactId> | ||
| 250 | - </exclusion> | ||
| 251 | - </exclusions> | ||
| 252 | - </dependency> | 246 | + <exclusions> |
| 247 | + <exclusion> | ||
| 248 | + <groupId>org.slf4j</groupId> | ||
| 249 | + <artifactId>slf4j-api</artifactId> | ||
| 250 | + </exclusion> | ||
| 251 | + </exclusions> | ||
| 252 | + </dependency> | ||
| 253 | + | ||
| 254 | + <dependency> | ||
| 255 | + <groupId>com.h2database</groupId> | ||
| 256 | + <artifactId>h2</artifactId> | ||
| 257 | + <version>1.2.132</version> | ||
| 258 | + <scope>test</scope> | ||
| 259 | + </dependency> | ||
| 253 | 260 | ||
| 254 | - <dependency> | ||
| 255 | - <groupId>com.h2database</groupId> | ||
| 256 | - <artifactId>h2</artifactId> | ||
| 257 | - <version>1.2.132</version> | ||
| 258 | - <scope>test</scope> | ||
| 259 | - </dependency> | ||
| 260 | 261 | ||
| 262 | + <dependency> | ||
| 263 | + <groupId>ojdbc</groupId> | ||
| 264 | + <artifactId>ojdbc</artifactId> | ||
| 265 | + <version>14</version> | ||
| 266 | + </dependency> | ||
| 261 | </dependencies> | 267 | </dependencies> |
| 262 | 268 | ||
| 263 | <dependencyManagement> | 269 | <dependencyManagement> |
src/main/java/com/bsth/controller/forms/ExportController.java
| @@ -28,6 +28,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading; | @@ -28,6 +28,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading; | ||
| 28 | import com.bsth.entity.mcy_forms.Waybillday; | 28 | import com.bsth.entity.mcy_forms.Waybillday; |
| 29 | import com.bsth.service.forms.ExportService; | 29 | import com.bsth.service.forms.ExportService; |
| 30 | import com.bsth.service.forms.FormsService; | 30 | import com.bsth.service.forms.FormsService; |
| 31 | +import com.bsth.util.Arith; | ||
| 31 | import com.bsth.util.ReportUtils; | 32 | import com.bsth.util.ReportUtils; |
| 32 | 33 | ||
| 33 | @RestController | 34 | @RestController |
| @@ -167,7 +168,7 @@ public class ExportController { | @@ -167,7 +168,7 @@ public class ExportController { | ||
| 167 | } | 168 | } |
| 168 | 169 | ||
| 169 | // 路单数据报表 | 170 | // 路单数据报表 |
| 170 | - @RequestMapping(value = "/singledataExport", method = RequestMethod.POST) | 171 | + @RequestMapping(value = "/singledataExport", method = RequestMethod.GET) |
| 171 | public List<Map<String, Object>> singledataExport(@RequestParam Map<String, Object> map) { | 172 | public List<Map<String, Object>> singledataExport(@RequestParam Map<String, Object> map) { |
| 172 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 173 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 173 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 174 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -213,12 +214,12 @@ public class ExportController { | @@ -213,12 +214,12 @@ public class ExportController { | ||
| 213 | } | 214 | } |
| 214 | 215 | ||
| 215 | // 车辆加注 | 216 | // 车辆加注 |
| 216 | - @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.POST) | 217 | + @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET) |
| 217 | public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) { | 218 | public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) { |
| 218 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 219 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 219 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 220 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 220 | ReportUtils ee = new ReportUtils(); | 221 | ReportUtils ee = new ReportUtils(); |
| 221 | - List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("gsdmVehic").toString(),map.get("fgsdmVehic").toString(),map.get("line").toString(), | 222 | + List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(), |
| 222 | map.get("data").toString()); | 223 | map.get("data").toString()); |
| 223 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 224 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 224 | int i = 1; | 225 | int i = 1; |
| @@ -558,17 +559,13 @@ public class ExportController { | @@ -558,17 +559,13 @@ public class ExportController { | ||
| 558 | List<Daily> allline = formsService.daily(map); | 559 | List<Daily> allline = formsService.daily(map); |
| 559 | 560 | ||
| 560 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 561 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 561 | - Float zgl=0f; | ||
| 562 | - Float ks=0f; | ||
| 563 | - Float yh=0f; | ||
| 564 | - Float bc=0f; | 562 | + double zgl=0.0; |
| 563 | + double ks=0.0; | ||
| 564 | + double yh=0.0; | ||
| 565 | + int bc=0; | ||
| 565 | Map<String, Object> m ; | 566 | Map<String, Object> m ; |
| 566 | for (Daily d : allline) { | 567 | for (Daily d : allline) { |
| 567 | m = new HashMap<String, Object>(); | 568 | m = new HashMap<String, Object>(); |
| 568 | - zgl +=d.getZlc()==""?0f:Float.valueOf(d.getZlc()); | ||
| 569 | - ks +=d.getJzl1()==""?0f:Float.valueOf(d.getJzl1()); | ||
| 570 | - yh +=d.getYh()==""?0f:Float.valueOf(d.getYh()); | ||
| 571 | - bc +=d.getBc()==""?0f:Float.valueOf(d.getBc()); | ||
| 572 | m.put("zbh", d.getZbh()); | 569 | m.put("zbh", d.getZbh()); |
| 573 | m.put("jgh",d.getJgh()); | 570 | m.put("jgh",d.getJgh()); |
| 574 | m.put("jName", d.getjName()); | 571 | m.put("jName", d.getjName()); |
| @@ -576,9 +573,13 @@ public class ExportController { | @@ -576,9 +573,13 @@ public class ExportController { | ||
| 576 | m.put("jzl1", d.getJzl1()); | 573 | m.put("jzl1", d.getJzl1()); |
| 577 | m.put("yh", d.getYh()); | 574 | m.put("yh", d.getYh()); |
| 578 | m.put("bc", d.getBc()); | 575 | m.put("bc", d.getBc()); |
| 576 | + zgl =Arith.add(zgl, d.getZlc()); | ||
| 577 | + ks =Arith.add(ks, d.getJzl1()); | ||
| 578 | + yh =Arith.add(yh, d.getYh()); | ||
| 579 | + bc +=Integer.parseInt(d.getBc()); | ||
| 579 | 580 | ||
| 580 | resList.add(m); | 581 | resList.add(m); |
| 581 | - } | 582 | + } |
| 582 | 583 | ||
| 583 | m=new HashMap<String,Object>(); | 584 | m=new HashMap<String,Object>(); |
| 584 | m.put("total_zgl", zgl); | 585 | m.put("total_zgl", zgl); |
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
| @@ -73,17 +73,16 @@ public class MCY_FormsController { | @@ -73,17 +73,16 @@ public class MCY_FormsController { | ||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | // 路单数据 | 75 | // 路单数据 |
| 76 | - @RequestMapping(value = "/singledata", method = RequestMethod.POST) | 76 | + @RequestMapping(value = "/singledata", method = RequestMethod.GET) |
| 77 | public List<Singledata> singledata(@RequestParam Map<String, Object> map) { | 77 | public List<Singledata> singledata(@RequestParam Map<String, Object> map) { |
| 78 | 78 | ||
| 79 | return formsService.singledata(map); | 79 | return formsService.singledata(map); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | // 车辆加注 | 82 | // 车辆加注 |
| 83 | - @RequestMapping(value = "/vehicleloading", method = RequestMethod.POST) | ||
| 84 | - public List<Vehicleloading> vehicleloading(@RequestParam String gsdmVehic, @RequestParam String fgsdmVehic, | ||
| 85 | - @RequestParam String line, @RequestParam String data) { | ||
| 86 | - return formsService.vehicleloading(gsdmVehic, fgsdmVehic, line, data); | 83 | + @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET) |
| 84 | + public List<Vehicleloading> vehicleloading(@RequestParam String line, @RequestParam String data) { | ||
| 85 | + return formsService.vehicleloading(line, data); | ||
| 87 | } | 86 | } |
| 88 | 87 | ||
| 89 | // 运营服务阶段报表 | 88 | // 运营服务阶段报表 |
src/main/java/com/bsth/controller/oil/YlbController.java
| @@ -238,9 +238,11 @@ public class YlbController extends BaseController<Ylb, Integer>{ | @@ -238,9 +238,11 @@ public class YlbController extends BaseController<Ylb, Integer>{ | ||
| 238 | Map<String, Object> m = new HashMap<String, Object>(); | 238 | Map<String, Object> m = new HashMap<String, Object>(); |
| 239 | m.put("rq", y.getRq()); | 239 | m.put("rq", y.getRq()); |
| 240 | m.put("gsname",y.getGsname() ); | 240 | m.put("gsname",y.getGsname() ); |
| 241 | + m.put("fgsname", y.getFgsname()); | ||
| 241 | m.put("xlname", y.getXlname()); | 242 | m.put("xlname", y.getXlname()); |
| 242 | m.put("nbbm", y.getNbbm()); | 243 | m.put("nbbm", y.getNbbm()); |
| 243 | m.put("jsy", y.getJsy()); | 244 | m.put("jsy", y.getJsy()); |
| 245 | + m.put("name", y.getName()); | ||
| 244 | m.put("jzl", y.getJzl()); | 246 | m.put("jzl", y.getJzl()); |
| 245 | m.put("czlc", y.getCzlc()); | 247 | m.put("czlc", y.getCzlc()); |
| 246 | m.put("jzlc", y.getJzlc()); | 248 | m.put("jzlc", y.getJzlc()); |
src/main/java/com/bsth/controller/realcontrol/DataManagerController.java
| 1 | -package com.bsth.controller.realcontrol; | ||
| 2 | - | ||
| 3 | -import com.bsth.service.realcontrol.DataManagerService; | ||
| 4 | -import org.apache.commons.lang3.StringEscapeUtils; | ||
| 5 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 6 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 7 | -import org.springframework.web.bind.annotation.RequestParam; | ||
| 8 | -import org.springframework.web.bind.annotation.RestController; | ||
| 9 | - | ||
| 10 | -import java.util.Map; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 数据管理,包括从老系统的数据迁移。新系统的数据校验等 | ||
| 14 | - * Created by panzhao on 2017/4/17. | ||
| 15 | - */ | ||
| 16 | -@RestController | ||
| 17 | -@RequestMapping("dataManager") | ||
| 18 | -public class DataManagerController { | ||
| 19 | - | ||
| 20 | - @Autowired | ||
| 21 | - DataManagerService dataManagerService; | ||
| 22 | - | ||
| 23 | - @RequestMapping("cars/old_now") | ||
| 24 | - public Map<String, Object> carInfos(@RequestParam Integer lineId){ | ||
| 25 | - return dataManagerService.carInfos(lineId); | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - @RequestMapping("car/updateDevices") | ||
| 29 | - public Map<String, Object> updateDevices(@RequestParam String jsonStr){ | ||
| 30 | - jsonStr = StringEscapeUtils.unescapeHtml4(jsonStr); | ||
| 31 | - return dataManagerService.updateDevices(jsonStr); | ||
| 32 | - } | ||
| 33 | -} | 1 | +package com.bsth.controller.realcontrol; |
| 2 | + | ||
| 3 | +import com.bsth.service.realcontrol.DataManagerService; | ||
| 4 | +import org.apache.commons.lang3.StringEscapeUtils; | ||
| 5 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 6 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 7 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 8 | +import org.springframework.web.bind.annotation.RestController; | ||
| 9 | + | ||
| 10 | +import java.util.Map; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 数据管理,包括从老系统的数据迁移。新系统的数据校验等 | ||
| 14 | + * Created by panzhao on 2017/4/17. | ||
| 15 | + */ | ||
| 16 | +@RestController | ||
| 17 | +@RequestMapping("dataManager") | ||
| 18 | +public class DataManagerController { | ||
| 19 | + | ||
| 20 | + @Autowired | ||
| 21 | + DataManagerService dataManagerService; | ||
| 22 | + | ||
| 23 | + @RequestMapping("cars/old_now") | ||
| 24 | + public Map<String, Object> carInfos(@RequestParam Integer lineId){ | ||
| 25 | + return dataManagerService.carInfos(lineId); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + @RequestMapping("car/updateDevices") | ||
| 29 | + public Map<String, Object> updateDevices(@RequestParam String jsonStr){ | ||
| 30 | + jsonStr = StringEscapeUtils.unescapeHtml4(jsonStr); | ||
| 31 | + return dataManagerService.updateDevices(jsonStr); | ||
| 32 | + } | ||
| 33 | +} |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -543,4 +543,25 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -543,4 +543,25 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 543 | rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR); | 543 | rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR); |
| 544 | return rs; | 544 | return rs; |
| 545 | } | 545 | } |
| 546 | + | ||
| 547 | + /** | ||
| 548 | + * 误点调整 | ||
| 549 | + * @param idx | ||
| 550 | + * @param minute | ||
| 551 | + * @return | ||
| 552 | + */ | ||
| 553 | + @RequestMapping(value = "lateAdjust", method = RequestMethod.POST) | ||
| 554 | + public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){ | ||
| 555 | + return scheduleRealInfoService.lateAdjust(idx, minute); | ||
| 556 | + } | ||
| 557 | + | ||
| 558 | + /** | ||
| 559 | + * 获取所有应发未到的班次 | ||
| 560 | + * @param idx | ||
| 561 | + * @return | ||
| 562 | + */ | ||
| 563 | + @RequestMapping(value = "allLate2") | ||
| 564 | + public List<ScheduleRealInfo> allLate2(@RequestParam String idx){ | ||
| 565 | + return scheduleRealInfoService.allLate2(idx); | ||
| 566 | + } | ||
| 546 | } | 567 | } |
src/main/java/com/bsth/data/BasicData.java
| @@ -332,7 +332,8 @@ public class BasicData implements CommandLineRunner { | @@ -332,7 +332,8 @@ public class BasicData implements CommandLineRunner { | ||
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | perTempMap.put(jobCode, p); | 334 | perTempMap.put(jobCode, p); |
| 335 | - allPersonMap.put(jobCode, p.getPersonnelName()); | 335 | + |
| 336 | + allPersonMap.put(jobCode.substring(jobCode.indexOf("-")+1), p.getPersonnelName()); | ||
| 336 | } | 337 | } |
| 337 | 338 | ||
| 338 | jsyMap = jsyTempMap; | 339 | jsyMap = jsyTempMap; |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| @@ -8,6 +8,7 @@ import com.bsth.data.gpsdata.arrival.utils.ScheduleSignalState; | @@ -8,6 +8,7 @@ import com.bsth.data.gpsdata.arrival.utils.ScheduleSignalState; | ||
| 8 | import com.bsth.data.gpsdata.arrival.utils.SignalSchPlanMatcher; | 8 | import com.bsth.data.gpsdata.arrival.utils.SignalSchPlanMatcher; |
| 9 | import com.bsth.data.schedule.DayOfSchedule; | 9 | import com.bsth.data.schedule.DayOfSchedule; |
| 10 | import com.bsth.data.schedule.ScheduleComparator; | 10 | import com.bsth.data.schedule.ScheduleComparator; |
| 11 | +import com.bsth.data.schedule.late_adjust.LateAdjustHandle; | ||
| 11 | import com.bsth.entity.realcontrol.LineConfig; | 12 | import com.bsth.entity.realcontrol.LineConfig; |
| 12 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 13 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 13 | import com.bsth.service.directive.DirectiveService; | 14 | import com.bsth.service.directive.DirectiveService; |
| @@ -145,6 +146,9 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -145,6 +146,9 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 145 | //持久化 | 146 | //持久化 |
| 146 | dayOfSchedule.save(sch); | 147 | dayOfSchedule.save(sch); |
| 147 | 148 | ||
| 149 | + //清理应发未发标记 | ||
| 150 | + LateAdjustHandle.remove(sch); | ||
| 151 | + | ||
| 148 | if(sch.getBcType().equals("out")){ | 152 | if(sch.getBcType().equals("out")){ |
| 149 | //出场时,切换成营运状态 | 153 | //出场时,切换成营运状态 |
| 150 | directiveService.send60Operation(sch.getClZbh(), 0, Integer.parseInt(sch.getXlDir()), null, "出场@系统"); | 154 | directiveService.send60Operation(sch.getClZbh(), 0, Integer.parseInt(sch.getXlDir()), null, "出场@系统"); |
| @@ -242,6 +246,10 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -242,6 +246,10 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 242 | long rsT = lineConfigData.applyIn(sch, gps.getTimestamp()); | 246 | long rsT = lineConfigData.applyIn(sch, gps.getTimestamp()); |
| 243 | 247 | ||
| 244 | sch.setZdsjActualAll(rsT); | 248 | sch.setZdsjActualAll(rsT); |
| 249 | + | ||
| 250 | + //通知误点停靠程序,有车辆到站 | ||
| 251 | + LateAdjustHandle.carArrive(gps); | ||
| 252 | + | ||
| 245 | //已完成班次数 | 253 | //已完成班次数 |
| 246 | int doneSum = dayOfSchedule.doneSum(sch.getClZbh()); | 254 | int doneSum = dayOfSchedule.doneSum(sch.getClZbh()); |
| 247 | ScheduleRealInfo next = dayOfSchedule.next(sch); | 255 | ScheduleRealInfo next = dayOfSchedule.next(sch); |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -154,10 +154,10 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -154,10 +154,10 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 154 | diff += (1000 * 60 * 60 * 24); | 154 | diff += (1000 * 60 * 60 * 24); |
| 155 | 155 | ||
| 156 | logger.info(diff / 1000 / 60 + "分钟之后提交到运管处"); | 156 | logger.info(diff / 1000 / 60 + "分钟之后提交到运管处"); |
| 157 | - //Application.mainServices.scheduleWithFixedDelay(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); | 157 | + //Application.mainServices.scheduleAtFixedRate(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); |
| 158 | 158 | ||
| 159 | //计算油、公里加注 | 159 | //计算油、公里加注 |
| 160 | - Application.mainServices.scheduleWithFixedDelay(calcOilThread, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); | 160 | + Application.mainServices.scheduleAtFixedRate(calcOilThread, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); |
| 161 | 161 | ||
| 162 | //指令持久化线程 | 162 | //指令持久化线程 |
| 163 | Application.mainServices.scheduleWithFixedDelay(directivesPstThread, 180, 180, TimeUnit.SECONDS); | 163 | Application.mainServices.scheduleWithFixedDelay(directivesPstThread, 180, 180, TimeUnit.SECONDS); |
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
| 1 | 1 | ||
| 2 | package com.bsth.data.schedule.late_adjust; | 2 | package com.bsth.data.schedule.late_adjust; |
| 3 | 3 | ||
| 4 | +import com.bsth.data.LineConfigData; | ||
| 5 | +import com.bsth.data.gpsdata.GpsEntity; | ||
| 6 | +import com.bsth.entity.realcontrol.LineConfig; | ||
| 4 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 7 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 8 | +import com.bsth.websocket.handler.SendUtils; | ||
| 9 | +import org.slf4j.Logger; | ||
| 10 | +import org.slf4j.LoggerFactory; | ||
| 11 | +import org.springframework.beans.BeansException; | ||
| 12 | +import org.springframework.context.ApplicationContext; | ||
| 13 | +import org.springframework.context.ApplicationContextAware; | ||
| 14 | +import org.springframework.stereotype.Component; | ||
| 5 | 15 | ||
| 16 | +import java.util.Collection; | ||
| 17 | +import java.util.HashMap; | ||
| 6 | import java.util.Map; | 18 | import java.util.Map; |
| 7 | 19 | ||
| 8 | /** | 20 | /** |
| 9 | - * 误点调整处理程序 | 21 | + * 误点自动调整待发 处理程序 |
| 22 | + * | ||
| 23 | + * 注意 :这里的误点是指应发未到 | ||
| 10 | * Created by panzhao on 2017/4/16. | 24 | * Created by panzhao on 2017/4/16. |
| 11 | */ | 25 | */ |
| 12 | -public class LateAdjustHandle { | 26 | +@Component |
| 27 | +public class LateAdjustHandle implements ApplicationContextAware{ | ||
| 28 | + | ||
| 29 | + static LineConfigData lineConfigData; | ||
| 30 | + static SendUtils sendUtils; | ||
| 31 | + | ||
| 32 | + static Logger logger = LoggerFactory.getLogger(LateAdjustHandle.class); | ||
| 13 | 33 | ||
| 14 | /** | 34 | /** |
| 15 | - * 误点的车辆 和 班次 | 35 | + * 应发未到车辆 和 班次 |
| 16 | */ | 36 | */ |
| 17 | private static Map<String, ScheduleRealInfo> lateSchMap; | 37 | private static Map<String, ScheduleRealInfo> lateSchMap; |
| 18 | 38 | ||
| 19 | 39 | ||
| 40 | + static { | ||
| 41 | + lateSchMap = new HashMap<>(); | ||
| 42 | + } | ||
| 43 | + | ||
| 20 | /** | 44 | /** |
| 21 | - * 误点的班次ID 和 停靠时间(秒) | 45 | + * 新增一个误点班次 |
| 46 | + * @param sch | ||
| 22 | */ | 47 | */ |
| 23 | - private static Map<Long, Integer> stopTimeMap; | 48 | + public static void putLate(ScheduleRealInfo sch){ |
| 49 | + try { | ||
| 50 | + //线路配置 | ||
| 51 | + LineConfig config = lineConfigData.get(sch.getXlBm()); | ||
| 52 | + if(sch.getLateMinute() == 0){ | ||
| 53 | + if(config.isEnableYjtk()){ | ||
| 54 | + sch.setLateMinute(sch.getXlDir().equals("0")?config.getUpStopMinute():config.getDownStopMinute()); | ||
| 55 | + } | ||
| 56 | + else | ||
| 57 | + return; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + if(sch.getDfsj().compareTo(config.getYjtkStart()) > 0 | ||
| 61 | + && sch.getDfsj().compareTo(config.getYjtkEnd()) <= 0){ | ||
| 62 | + | ||
| 63 | + ScheduleRealInfo cancel = null; | ||
| 64 | + //之前存在误点班次没有发出 | ||
| 65 | + ScheduleRealInfo old = lateSchMap.get(sch.getClZbh()); | ||
| 66 | + if(old != null && old.getDfsjT() < sch.getDfsjT()){ | ||
| 67 | + remove(old); | ||
| 68 | + cancel = old; | ||
| 69 | + logger.info("【应发未到】old 班次 " + old.getId() + " -被覆盖!"); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + lateSchMap.put(sch.getClZbh(), sch); | ||
| 73 | + //通知客户端 | ||
| 74 | + sch.setLate2(true); | ||
| 75 | + sendUtils.sendAutoWdtz(sch, cancel); | ||
| 76 | + | ||
| 77 | + logger.info("【应发未到】班次 " + sch.getClZbh() + " -" + sch.getDfsj() + " -id: " + sch.getId() + " -加入误点调整!"); | ||
| 78 | + } | ||
| 79 | + }catch (Exception e){ | ||
| 80 | + logger.error("", e); | ||
| 81 | + } | ||
| 82 | + } | ||
| 24 | 83 | ||
| 25 | 84 | ||
| 26 | /** | 85 | /** |
| 27 | - * 班次误点(考虑停靠时间) | ||
| 28 | - * @param sch | 86 | + * 获取所有应发未到的班次 |
| 87 | + * @return | ||
| 29 | */ | 88 | */ |
| 30 | - public static void schLate(ScheduleRealInfo sch){ | 89 | + public static Collection<ScheduleRealInfo> allLateSch(){ |
| 90 | + return lateSchMap.values(); | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + public static void remove(ScheduleRealInfo sch){ | ||
| 94 | + try { | ||
| 95 | + if(lateSchMap.get(sch.getClZbh()) == sch){ | ||
| 96 | + lateSchMap.remove(sch.getClZbh()); | ||
| 97 | + sch.setLate2(false); | ||
| 98 | + sch.setLateMinute(0); | ||
| 99 | + } | ||
| 100 | + }catch (Exception e){ | ||
| 101 | + logger.error("", e); | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + /** | ||
| 106 | + * 车辆到站 | ||
| 107 | + * @param gps | ||
| 108 | + */ | ||
| 109 | + public static void carArrive(GpsEntity gps){ | ||
| 110 | + try{ | ||
| 111 | + if(gps.getInstation() != 1) | ||
| 112 | + return; | ||
| 113 | + | ||
| 114 | + ScheduleRealInfo sch = lateSchMap.get(gps.getNbbm()); | ||
| 115 | + if(sch == null) | ||
| 116 | + return; | ||
| 117 | + | ||
| 118 | + //进的是班次起点 | ||
| 119 | + if(gps.getStopNo().equals(sch.getQdzCode()) | ||
| 120 | + && sch.getLateMinute() > 0){ | ||
| 121 | + //自动调整待发 到达时间 + 停靠时间 | ||
| 122 | + long dt = gps.getTimestamp() + (Long.parseLong(String.valueOf(sch.getLateMinute() * 60 * 1000))); | ||
| 123 | + sch.setDfsjAll(dt); | ||
| 124 | + sch.setDfAuto(true); | ||
| 125 | + | ||
| 126 | + lateSchMap.remove(sch.getClZbh()); | ||
| 127 | + logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt); | ||
| 128 | + } | ||
| 129 | + }catch (Exception e){ | ||
| 130 | + logger.error("", e); | ||
| 131 | + } | ||
| 132 | + } | ||
| 31 | 133 | ||
| 134 | + @Override | ||
| 135 | + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | ||
| 136 | + lineConfigData = applicationContext.getBean(LineConfigData.class); | ||
| 137 | + sendUtils = applicationContext.getBean(SendUtils.class); | ||
| 32 | } | 138 | } |
| 33 | -} | 139 | -} |
| 140 | +} | ||
| 34 | \ No newline at end of file | 141 | \ No newline at end of file |
src/main/java/com/bsth/data/schedule/late_adjust/ScheduleLateThread.java
| @@ -5,6 +5,7 @@ import com.bsth.data.schedule.DayOfSchedule; | @@ -5,6 +5,7 @@ import com.bsth.data.schedule.DayOfSchedule; | ||
| 5 | import com.bsth.data.schedule.ScheduleComparator; | 5 | import com.bsth.data.schedule.ScheduleComparator; |
| 6 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 6 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 7 | import com.bsth.websocket.handler.SendUtils; | 7 | import com.bsth.websocket.handler.SendUtils; |
| 8 | +import org.apache.commons.lang3.StringUtils; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| 10 | 11 | ||
| @@ -14,10 +15,10 @@ import java.util.Comparator; | @@ -14,10 +15,10 @@ import java.util.Comparator; | ||
| 14 | import java.util.List; | 15 | import java.util.List; |
| 15 | 16 | ||
| 16 | /** | 17 | /** |
| 17 | - * | ||
| 18 | - * @ClassName: ScheduleLateThread | ||
| 19 | - * @Description: TODO(班次误点扫描线程) | ||
| 20 | - * @author PanZhao | 18 | + * |
| 19 | + * @ClassName: ScheduleLateThread | ||
| 20 | + * @Description: TODO(班次误点扫描线程) | ||
| 21 | + * @author PanZhao | ||
| 21 | * @date 2016年8月31日 下午3:09:02 | 22 | * @date 2016年8月31日 下午3:09:02 |
| 22 | * | 23 | * |
| 23 | */ | 24 | */ |
| @@ -26,29 +27,39 @@ public class ScheduleLateThread extends Thread{ | @@ -26,29 +27,39 @@ public class ScheduleLateThread extends Thread{ | ||
| 26 | 27 | ||
| 27 | @Autowired | 28 | @Autowired |
| 28 | DayOfSchedule dayOfSchedule; | 29 | DayOfSchedule dayOfSchedule; |
| 29 | - | 30 | + |
| 30 | @Autowired | 31 | @Autowired |
| 31 | SendUtils sendUtils; | 32 | SendUtils sendUtils; |
| 32 | - | 33 | + |
| 33 | private static Comparator<ScheduleRealInfo> cpm = new ScheduleComparator.FCSJ(); | 34 | private static Comparator<ScheduleRealInfo> cpm = new ScheduleComparator.FCSJ(); |
| 34 | - | 35 | + |
| 35 | @Override | 36 | @Override |
| 36 | public void run() { | 37 | public void run() { |
| 37 | List<ScheduleRealInfo> all = new ArrayList<>(dayOfSchedule.findAll()); | 38 | List<ScheduleRealInfo> all = new ArrayList<>(dayOfSchedule.findAll()); |
| 38 | Collections.sort(all, cpm); | 39 | Collections.sort(all, cpm); |
| 39 | - | 40 | + |
| 40 | long t = System.currentTimeMillis(); | 41 | long t = System.currentTimeMillis(); |
| 41 | int size = all.size(); | 42 | int size = all.size(); |
| 42 | - | 43 | + |
| 43 | ScheduleRealInfo sch; | 44 | ScheduleRealInfo sch; |
| 44 | for(int i = 0; i < size; i ++){ | 45 | for(int i = 0; i < size; i ++){ |
| 45 | sch = all.get(i); | 46 | sch = all.get(i); |
| 46 | - if(sch.getDfsjT() > t) | 47 | + if(sch.getDfsjT() > t || sch.isLate()) |
| 47 | break; | 48 | break; |
| 48 | - | ||
| 49 | - if(sch.isLate() == false | ||
| 50 | - && sch.getStatus() == 0 | 49 | + |
| 50 | + if(sch.getStatus() == 0 | ||
| 51 | && sch.getFcsjActual() == null){ | 51 | && sch.getFcsjActual() == null){ |
| 52 | + | ||
| 53 | + //检查应发未到 当前班次无起点到达时间 | ||
| 54 | + if(StringUtils.isEmpty(sch.getQdzArrDateSJ())){ | ||
| 55 | + ScheduleRealInfo prev = dayOfSchedule.prev(sch); | ||
| 56 | + //上一个班次也没有实际终点到达时间 | ||
| 57 | + if(prev != null && StringUtils.isEmpty(prev.getZdsjActual())){ | ||
| 58 | + //进入误点调整程序 | ||
| 59 | + LateAdjustHandle.putLate(sch); | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + | ||
| 52 | //应发未发 | 63 | //应发未发 |
| 53 | sch.setLate(true); | 64 | sch.setLate(true); |
| 54 | //通知客户端 | 65 | //通知客户端 |
| @@ -56,4 +67,4 @@ public class ScheduleLateThread extends Thread{ | @@ -56,4 +67,4 @@ public class ScheduleLateThread extends Thread{ | ||
| 56 | } | 67 | } |
| 57 | } | 68 | } |
| 58 | } | 69 | } |
| 59 | -} | 70 | -} |
| 71 | +} | ||
| 60 | \ No newline at end of file | 72 | \ No newline at end of file |
src/main/java/com/bsth/entity/oil/Ylb.java
| @@ -63,6 +63,11 @@ public class Ylb { | @@ -63,6 +63,11 @@ public class Ylb { | ||
| 63 | @Transient | 63 | @Transient |
| 64 | private String gsname; | 64 | private String gsname; |
| 65 | 65 | ||
| 66 | + @Transient | ||
| 67 | + private String fgsname; | ||
| 68 | + | ||
| 69 | + @Transient | ||
| 70 | + private String name; | ||
| 66 | 71 | ||
| 67 | public Integer getId() { | 72 | public Integer getId() { |
| 68 | return id; | 73 | return id; |
| @@ -299,6 +304,22 @@ public class Ylb { | @@ -299,6 +304,22 @@ public class Ylb { | ||
| 299 | } | 304 | } |
| 300 | 305 | ||
| 301 | 306 | ||
| 307 | + public String getFgsname() { | ||
| 308 | + return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.ssgsdm); | ||
| 309 | + } | ||
| 310 | + | ||
| 311 | + public void setFgsname(String fgsname) { | ||
| 312 | + this.fgsname = fgsname; | ||
| 313 | + } | ||
| 314 | + | ||
| 315 | + public String getName() { | ||
| 316 | + return BasicData.allPerson.get(this.jsy); | ||
| 317 | + } | ||
| 318 | + | ||
| 319 | + public void setName(String name) { | ||
| 320 | + this.name = name; | ||
| 321 | + } | ||
| 322 | + | ||
| 302 | 323 | ||
| 303 | 324 | ||
| 304 | 325 |
src/main/java/com/bsth/entity/realcontrol/LineConfig.java
| @@ -82,7 +82,9 @@ public class LineConfig { | @@ -82,7 +82,9 @@ public class LineConfig { | ||
| 82 | * 应急停靠 | 82 | * 应急停靠 |
| 83 | */ | 83 | */ |
| 84 | private boolean enableYjtk; | 84 | private boolean enableYjtk; |
| 85 | + /** HH:mm */ | ||
| 85 | private String yjtkStart; | 86 | private String yjtkStart; |
| 87 | + /** HH:mm */ | ||
| 86 | private String yjtkEnd; | 88 | private String yjtkEnd; |
| 87 | private int upStopMinute; | 89 | private int upStopMinute; |
| 88 | private int downStopMinute; | 90 | private int downStopMinute; |
src/main/java/com/bsth/entity/realcontrol/OilStationSociety.java
| @@ -21,6 +21,11 @@ public class OilStationSociety { | @@ -21,6 +21,11 @@ public class OilStationSociety { | ||
| 21 | private String stationName; | 21 | private String stationName; |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | + * 加油站编码(为空则默认社会加油站) | ||
| 25 | + */ | ||
| 26 | + private String stationCode; | ||
| 27 | + | ||
| 28 | + /** | ||
| 24 | * 上行进场距离 | 29 | * 上行进场距离 |
| 25 | */ | 30 | */ |
| 26 | private Double upInMile; | 31 | private Double upInMile; |
| @@ -137,4 +142,12 @@ public class OilStationSociety { | @@ -137,4 +142,12 @@ public class OilStationSociety { | ||
| 137 | public void setDownOutTime(int downOutTime) { | 142 | public void setDownOutTime(int downOutTime) { |
| 138 | this.downOutTime = downOutTime; | 143 | this.downOutTime = downOutTime; |
| 139 | } | 144 | } |
| 145 | + | ||
| 146 | + public String getStationCode() { | ||
| 147 | + return stationCode; | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + public void setStationCode(String stationCode) { | ||
| 151 | + this.stationCode = stationCode; | ||
| 152 | + } | ||
| 140 | } | 153 | } |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| @@ -139,10 +139,17 @@ public class ScheduleRealInfo { | @@ -139,10 +139,17 @@ public class ScheduleRealInfo { | ||
| 139 | /** 是否是临加班次 */ | 139 | /** 是否是临加班次 */ |
| 140 | private boolean sflj; | 140 | private boolean sflj; |
| 141 | 141 | ||
| 142 | - /** 是否误点*/ | 142 | + /** 是否误点 (应发未发)*/ |
| 143 | @Transient | 143 | @Transient |
| 144 | private boolean late; | 144 | private boolean late; |
| 145 | 145 | ||
| 146 | + /** 是否误点 (应发未到) */ | ||
| 147 | + @Transient | ||
| 148 | + private boolean late2; | ||
| 149 | + /** 误点停靠时间 */ | ||
| 150 | + @Transient | ||
| 151 | + private float lateMinute; | ||
| 152 | + | ||
| 146 | /** 备注*/ | 153 | /** 备注*/ |
| 147 | private String remarks; | 154 | private String remarks; |
| 148 | 155 | ||
| @@ -887,4 +894,20 @@ public class ScheduleRealInfo { | @@ -887,4 +894,20 @@ public class ScheduleRealInfo { | ||
| 887 | public void setRemark(String remark) { | 894 | public void setRemark(String remark) { |
| 888 | this.remark = remark; | 895 | this.remark = remark; |
| 889 | } | 896 | } |
| 897 | + | ||
| 898 | + public float getLateMinute() { | ||
| 899 | + return lateMinute; | ||
| 900 | + } | ||
| 901 | + | ||
| 902 | + public void setLateMinute(float lateMinute) { | ||
| 903 | + this.lateMinute = lateMinute; | ||
| 904 | + } | ||
| 905 | + | ||
| 906 | + public boolean isLate2() { | ||
| 907 | + return late2; | ||
| 908 | + } | ||
| 909 | + | ||
| 910 | + public void setLate2(boolean late2) { | ||
| 911 | + this.late2 = late2; | ||
| 912 | + } | ||
| 890 | } | 913 | } |
src/main/java/com/bsth/service/excep/impl/OfflineServiceImpl.java
| @@ -56,7 +56,7 @@ public class OfflineServiceImpl implements OfflineService { | @@ -56,7 +56,7 @@ public class OfflineServiceImpl implements OfflineService { | ||
| 56 | Object date=map.get("date"); | 56 | Object date=map.get("date"); |
| 57 | 57 | ||
| 58 | if(line!=null){ | 58 | if(line!=null){ |
| 59 | - sql +=" and line like'%"+line.toString()+"%'"; | 59 | + sql +=" and line like'%"+line.toString().trim()+"%'"; |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | if(nbbm!=null){ | 62 | if(nbbm!=null){ |
| @@ -131,6 +131,7 @@ public class OfflineServiceImpl implements OfflineService { | @@ -131,6 +131,7 @@ public class OfflineServiceImpl implements OfflineService { | ||
| 131 | @SuppressWarnings("unchecked") | 131 | @SuppressWarnings("unchecked") |
| 132 | public PageObject <Offline> Pagequery(Map<String, Object> map) { | 132 | public PageObject <Offline> Pagequery(Map<String, Object> map) { |
| 133 | // TODO Auto-generated method stub | 133 | // TODO Auto-generated method stub |
| 134 | + | ||
| 134 | String sql="select count(*) record from bsth_c_offline where 1=1 "; | 135 | String sql="select count(*) record from bsth_c_offline where 1=1 "; |
| 135 | 136 | ||
| 136 | Object line=map.get("line"); | 137 | Object line=map.get("line"); |
| @@ -140,7 +141,7 @@ public class OfflineServiceImpl implements OfflineService { | @@ -140,7 +141,7 @@ public class OfflineServiceImpl implements OfflineService { | ||
| 140 | Object date=map.get("date"); | 141 | Object date=map.get("date"); |
| 141 | 142 | ||
| 142 | if(line!=null){ | 143 | if(line!=null){ |
| 143 | - sql +=" and line like'%"+line.toString()+"%'"; | 144 | + sql +=" and line like'%"+line.toString().trim()+"%'"; |
| 144 | } | 145 | } |
| 145 | 146 | ||
| 146 | if(nbbm!=null){ | 147 | if(nbbm!=null){ |
| @@ -194,10 +195,9 @@ public class OfflineServiceImpl implements OfflineService { | @@ -194,10 +195,9 @@ public class OfflineServiceImpl implements OfflineService { | ||
| 194 | Date datess = new Date(d1); | 195 | Date datess = new Date(d1); |
| 195 | String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess); | 196 | String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess); |
| 196 | String sk=new SimpleDateFormat("HH:mm").format(datess); | 197 | String sk=new SimpleDateFormat("HH:mm").format(datess); |
| 197 | - String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and" | ||
| 198 | - + " real_exec_date='"+dates+"' "; | ||
| 199 | -// + "and fcsj_actual > '"+sk+"' "; | ||
| 200 | -// + "and '"+sk+"' <dfsj"; | 198 | + String sqlPbb="SELECT * FROM ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj" |
| 199 | + + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and" | ||
| 200 | + + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ; | ||
| 201 | List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb, | 201 | List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb, |
| 202 | new RowMapper<ScheduleRealInfo>(){ | 202 | new RowMapper<ScheduleRealInfo>(){ |
| 203 | @Override | 203 | @Override |
| @@ -208,20 +208,15 @@ public class OfflineServiceImpl implements OfflineService { | @@ -208,20 +208,15 @@ public class OfflineServiceImpl implements OfflineService { | ||
| 208 | s.setLpName(rs.getString("lp_name")); | 208 | s.setLpName(rs.getString("lp_name")); |
| 209 | return s; | 209 | return s; |
| 210 | } | 210 | } |
| 211 | - }); | ||
| 212 | - if(pbb.size()>0){ | ||
| 213 | - list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName()); | ||
| 214 | - list.get(i).setLpname(pbb.get(0).getLpName()); | ||
| 215 | - | ||
| 216 | - } | ||
| 217 | - | 211 | + }); |
| 212 | + if(pbb.size()>0){ | ||
| 213 | + list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName()); | ||
| 214 | + list.get(i).setLpname(pbb.get(0).getLpName()); | ||
| 215 | + } | ||
| 218 | } | 216 | } |
| 217 | + | ||
| 219 | PageObject<Offline> pageObject = pageHelper.getPageObject(); | 218 | PageObject<Offline> pageObject = pageHelper.getPageObject(); |
| 220 | -// for (int i = 0; i < list.size(); i++) { | ||
| 221 | -// if(list.get(i).getLpname()!=null){ | ||
| 222 | pageObject.setDataList(list); | 219 | pageObject.setDataList(list); |
| 223 | -// } | ||
| 224 | -// } | ||
| 225 | 220 | ||
| 226 | return pageObject; | 221 | return pageObject; |
| 227 | } | 222 | } |
src/main/java/com/bsth/service/excep/impl/OutboundServiceImpl.java
| @@ -43,7 +43,7 @@ public class OutboundServiceImpl implements OutboundService{ | @@ -43,7 +43,7 @@ public class OutboundServiceImpl implements OutboundService{ | ||
| 43 | Object updown=map.get("updown"); | 43 | Object updown=map.get("updown"); |
| 44 | Object date=map.get("date"); | 44 | Object date=map.get("date"); |
| 45 | if(line!=null){ | 45 | if(line!=null){ |
| 46 | - sql +=" and line like'%"+line.toString()+"%'"; | 46 | + sql +=" and line like'%"+line.toString().trim()+"%'"; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | if(nbbm!=null){ | 49 | if(nbbm!=null){ |
| @@ -105,7 +105,7 @@ public class OutboundServiceImpl implements OutboundService{ | @@ -105,7 +105,7 @@ public class OutboundServiceImpl implements OutboundService{ | ||
| 105 | outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); | 105 | outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); |
| 106 | outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); | 106 | outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); |
| 107 | outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); | 107 | outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); |
| 108 | - outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString()); | 108 | +// outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString()); |
| 109 | list.add(outbound); | 109 | list.add(outbound); |
| 110 | } | 110 | } |
| 111 | return list; | 111 | return list; |
| @@ -120,7 +120,7 @@ public class OutboundServiceImpl implements OutboundService{ | @@ -120,7 +120,7 @@ public class OutboundServiceImpl implements OutboundService{ | ||
| 120 | Object updown=map.get("updown"); | 120 | Object updown=map.get("updown"); |
| 121 | Object date=map.get("date"); | 121 | Object date=map.get("date"); |
| 122 | if(line!=null){ | 122 | if(line!=null){ |
| 123 | - sql +=" and line like '%"+line.toString()+"%'"; | 123 | + sql +=" and line like '%"+line.toString().trim()+"%'"; |
| 124 | 124 | ||
| 125 | } | 125 | } |
| 126 | 126 | ||
| @@ -174,10 +174,9 @@ public class OutboundServiceImpl implements OutboundService{ | @@ -174,10 +174,9 @@ public class OutboundServiceImpl implements OutboundService{ | ||
| 174 | Date datess = new Date(d1); | 174 | Date datess = new Date(d1); |
| 175 | String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess); | 175 | String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess); |
| 176 | String sk=new SimpleDateFormat("HH:mm").format(datess); | 176 | String sk=new SimpleDateFormat("HH:mm").format(datess); |
| 177 | - String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and" | ||
| 178 | - + " real_exec_date='"+dates+"' "; | ||
| 179 | -// + "and fcsj_actual > '"+sk+"' "; | ||
| 180 | -// + "and '"+sk+"' <dfsj"; | 177 | + String sqlPbb="SELECT * FROM ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj" |
| 178 | + + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and" | ||
| 179 | + + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ; | ||
| 181 | List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb, | 180 | List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb, |
| 182 | new RowMapper<ScheduleRealInfo>(){ | 181 | new RowMapper<ScheduleRealInfo>(){ |
| 183 | @Override | 182 | @Override |
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
| @@ -46,7 +46,7 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -46,7 +46,7 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 46 | Object date=map.get("date"); | 46 | Object date=map.get("date"); |
| 47 | 47 | ||
| 48 | if(line!=null){ | 48 | if(line!=null){ |
| 49 | - sql +=" and line like'%"+line.toString()+"%'"; | 49 | + sql +=" and line like'%"+line.toString().trim()+"%'"; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | if(nbbm!=null){ | 52 | if(nbbm!=null){ |
| @@ -125,7 +125,7 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -125,7 +125,7 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 125 | Object date=map.get("date"); | 125 | Object date=map.get("date"); |
| 126 | 126 | ||
| 127 | if(line!=null){ | 127 | if(line!=null){ |
| 128 | - sql +=" and line like'%"+line.toString()+"%'"; | 128 | + sql +=" and line like'%"+line.toString().trim()+"%'"; |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | if(nbbm!=null){ | 131 | if(nbbm!=null){ |
| @@ -177,10 +177,9 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -177,10 +177,9 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 177 | Date datess = new Date(d1); | 177 | Date datess = new Date(d1); |
| 178 | String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess); | 178 | String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess); |
| 179 | String sk=new SimpleDateFormat("HH:mm").format(datess); | 179 | String sk=new SimpleDateFormat("HH:mm").format(datess); |
| 180 | - String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and" | ||
| 181 | - + " real_exec_date='"+dates+"' "; | ||
| 182 | -// + "and fcsj_actual > '"+sk+"' "; | ||
| 183 | -// + "and '"+sk+"' <dfsj"; | 180 | + String sqlPbb="SELECT * FROM ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj" |
| 181 | + + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and" | ||
| 182 | + + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ; | ||
| 184 | List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb, | 183 | List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb, |
| 185 | new RowMapper<ScheduleRealInfo>(){ | 184 | new RowMapper<ScheduleRealInfo>(){ |
| 186 | @Override | 185 | @Override |
src/main/java/com/bsth/service/forms/FormsService.java
| @@ -31,7 +31,7 @@ public interface FormsService { | @@ -31,7 +31,7 @@ public interface FormsService { | ||
| 31 | 31 | ||
| 32 | public List<Singledata> singledata(Map<String, Object> map); | 32 | public List<Singledata> singledata(Map<String, Object> map); |
| 33 | 33 | ||
| 34 | - public List<Vehicleloading> vehicleloading(String gsdmVehic,String fgsdmVehic,String line,String data); | 34 | + public List<Vehicleloading> vehicleloading(String line,String data); |
| 35 | 35 | ||
| 36 | public List<Operationservice> operationservice(Map<String, Object> map); | 36 | public List<Operationservice> operationservice(Map<String, Object> map); |
| 37 | 37 |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -25,7 +25,9 @@ import com.bsth.entity.mcy_forms.Singledata; | @@ -25,7 +25,9 @@ import com.bsth.entity.mcy_forms.Singledata; | ||
| 25 | import com.bsth.entity.mcy_forms.Turnoutrate; | 25 | import com.bsth.entity.mcy_forms.Turnoutrate; |
| 26 | import com.bsth.entity.mcy_forms.Vehicleloading; | 26 | import com.bsth.entity.mcy_forms.Vehicleloading; |
| 27 | import com.bsth.entity.mcy_forms.Waybillday; | 27 | import com.bsth.entity.mcy_forms.Waybillday; |
| 28 | +import com.bsth.entity.oil.Ylb; | ||
| 28 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 29 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 30 | +import com.bsth.repository.oil.YlbRepository; | ||
| 29 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 31 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 30 | import com.bsth.data.BasicData; | 32 | import com.bsth.data.BasicData; |
| 31 | import com.bsth.entity.mcy_forms.Allline; | 33 | import com.bsth.entity.mcy_forms.Allline; |
| @@ -55,6 +57,9 @@ public class FormsServiceImpl implements FormsService { | @@ -55,6 +57,9 @@ public class FormsServiceImpl implements FormsService { | ||
| 55 | 57 | ||
| 56 | @Autowired | 58 | @Autowired |
| 57 | CulateMileageService culateMileageService; | 59 | CulateMileageService culateMileageService; |
| 60 | + | ||
| 61 | + @Autowired | ||
| 62 | + YlbRepository ylbRepository; | ||
| 58 | 63 | ||
| 59 | // 行车路单日报表 | 64 | // 行车路单日报表 |
| 60 | @Override | 65 | @Override |
| @@ -417,7 +422,19 @@ public class FormsServiceImpl implements FormsService { | @@ -417,7 +422,19 @@ public class FormsServiceImpl implements FormsService { | ||
| 417 | // 路单数据 | 422 | // 路单数据 |
| 418 | @Override | 423 | @Override |
| 419 | public List<Singledata> singledata(Map<String, Object> map) { | 424 | public List<Singledata> singledata(Map<String, Object> map) { |
| 420 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 425 | + |
| 426 | + String gsdm=""; | ||
| 427 | + if(map.get("gsdmSing")!=null){ | ||
| 428 | + gsdm=map.get("gsdmSing").toString(); | ||
| 429 | + } | ||
| 430 | + String fgsdm=""; | ||
| 431 | + if(map.get("fgsdmSing")!=null){ | ||
| 432 | + fgsdm=map.get("fgsdmSing").toString(); | ||
| 433 | + } | ||
| 434 | + | ||
| 435 | + String xlbm=map.get("line").toString().trim(); | ||
| 436 | + | ||
| 437 | + /*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 421 | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); | 438 | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); |
| 422 | Date d = null; | 439 | Date d = null; |
| 423 | Date d1 = null; | 440 | Date d1 = null; |
| @@ -429,60 +446,92 @@ public class FormsServiceImpl implements FormsService { | @@ -429,60 +446,92 @@ public class FormsServiceImpl implements FormsService { | ||
| 429 | e.printStackTrace(); | 446 | e.printStackTrace(); |
| 430 | } | 447 | } |
| 431 | String rq2 = sdf1.format(d); | 448 | String rq2 = sdf1.format(d); |
| 432 | - String rq3 = sdf1.format(d1); | 449 | + String rq3 = sdf1.format(d1);*/ |
| 433 | 450 | ||
| 434 | - rq = rq2 + "-" + rq3; | 451 | +// rq = rq2 + "-" + rq3; |
| 435 | startDate = map.get("startDate").toString(); | 452 | startDate = map.get("startDate").toString(); |
| 436 | - endDate = map.get("endDate").toString(); | ||
| 437 | - String sql = "select t.*,y.yh,y.jzl from (" | ||
| 438 | - + " select r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" | ||
| 439 | - + " from bsth_c_s_sp_info_real r where r.schedule_date_str " | ||
| 440 | - + " BETWEEN '"+startDate+"' and '"+endDate+"' and r.xl_bm='"+map.get("line").toString()+"' " | ||
| 441 | - + " AND r.gs_bm is not null and r.gs_bm='"+map.get("gsdmSing").toString()+"' " | ||
| 442 | - + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"' " | ||
| 443 | - + " group by r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm) t " | ||
| 444 | - + " LEFT JOIN (select a.nbbm,a.jsy,SUM(a.yh) as yh,SUM(a.jzl) as jzl " | ||
| 445 | - + " from bsth_c_ylb a where a.rq BETWEEN '"+startDate+"' and '"+endDate+"'and " | ||
| 446 | - + " a.ssgsdm='"+map.get("gsdmSing").toString()+"' and a.fgsdm='"+map.get("fgsdmSing").toString()+"' " | ||
| 447 | - + "group by a.nbbm,a.jsy) y" | ||
| 448 | - + " on y.nbbm=t.cl_zbh and y.jsy= t.j_gh"; | 453 | +// endDate = map.get("endDate").toString(); |
| 454 | +// String sql = "select t.*,y.yh,y.jzl from (" | ||
| 455 | +// + " select r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" | ||
| 456 | +// + " from bsth_c_s_sp_info_real r where r.schedule_date_str " | ||
| 457 | +// + " BETWEEN '"+startDate+"' and '"+endDate+"' and r.xl_bm='"+map.get("line").toString()+"' " | ||
| 458 | +// + " AND r.gs_bm is not null and r.gs_bm='"+map.get("gsdmSing").toString()+"' " | ||
| 459 | +// + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"' " | ||
| 460 | +// + " group by r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm) t " | ||
| 461 | +// + " LEFT JOIN (select a.nbbm,a.jsy,SUM(a.yh) as yh,SUM(a.jzl) as jzl " | ||
| 462 | +// + " from bsth_c_ylb a where a.rq BETWEEN '"+startDate+"' and '"+endDate+"'and " | ||
| 463 | +// + " a.ssgsdm='"+map.get("gsdmSing").toString()+"' and a.fgsdm='"+map.get("fgsdmSing").toString()+"' " | ||
| 464 | +// + "group by a.nbbm,a.jsy) y" | ||
| 465 | +// + " on y.nbbm=t.cl_zbh and y.jsy= t.j_gh"; | ||
| 449 | 466 | ||
| 467 | + String sql="select r.s_gh,r.s_name, " | ||
| 468 | + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" | ||
| 469 | + + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'"; | ||
| 470 | + if(xlbm.equals("")){ | ||
| 471 | + sql +="and r.gs_bm='"+gsdm+"' " | ||
| 472 | + + " and r.fgs_bm='"+fgsdm+"'"; | ||
| 473 | + }else{ | ||
| 474 | + sql += " and r.xl_bm = '"+xlbm+"'"; | ||
| 475 | + } | ||
| 476 | + sql += " group by r.s_gh,r.s_name," | ||
| 477 | + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"; | ||
| 478 | + | ||
| 450 | List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | 479 | List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 451 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 480 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 452 | @Override | 481 | @Override |
| 453 | public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | 482 | public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 454 | Singledata sin = new Singledata(); | 483 | Singledata sin = new Singledata(); |
| 455 | - sin.setrQ(rq); | ||
| 456 | - sin.setgS(arg0.getString("gs_bm")); | 484 | + sin.setrQ(startDate); |
| 457 | sin.setxL(arg0.getString("xl_name")); | 485 | sin.setxL(arg0.getString("xl_name")); |
| 458 | sin.setClzbh(arg0.getString("cl_zbh")); | 486 | sin.setClzbh(arg0.getString("cl_zbh")); |
| 459 | sin.setJsy(arg0.getString("j_gh")); | 487 | sin.setJsy(arg0.getString("j_gh")); |
| 460 | sin.setjName(arg0.getString("j_name")); | 488 | sin.setjName(arg0.getString("j_name")); |
| 461 | - sin.setHyl(arg0.getString("YH")); | ||
| 462 | - sin.setJzl(arg0.getString("JZL")); | ||
| 463 | - // sin.setJzl(arg0.getString(""));//非营业性用油 | ||
| 464 | - sin.setJhjl(arg0.getString("JZL")); | 489 | + sin.setSgh(arg0.getString("s_gh")); |
| 490 | + sin.setsName(arg0.getString("s_name")); | ||
| 491 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm"))); | ||
| 465 | 492 | ||
| 466 | return sin; | 493 | return sin; |
| 467 | } | 494 | } |
| 468 | }); | 495 | }); |
| 469 | - DecimalFormat df = new DecimalFormat("0.00"); | ||
| 470 | - for(int i=0;i<list.size();i++){ | ||
| 471 | - | ||
| 472 | - Singledata si=list.get(i); | ||
| 473 | - si.setgS(BasicData.businessCodeNameMap.get(si.getgS())); | ||
| 474 | - si.setJzl(df.format(Double.parseDouble(si.getJzl()))); | ||
| 475 | - si.setHyl(df.format(Double.parseDouble(si.getHyl()))); | ||
| 476 | - Map<String, Object> maps = new HashMap<>(); | ||
| 477 | - maps = commonService.findKMBC1(si.getjName(),si.getClzbh(), startDate, | ||
| 478 | - endDate); | ||
| 479 | - //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString()); | ||
| 480 | - si.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString()); | ||
| 481 | - si.setsName(maps.get("s_name") == null ? "" : maps.get("s_name").toString()); | ||
| 482 | - si.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString()); | ||
| 483 | - si.setEmptMileage(maps.get("ksgl") == null ? "" : maps.get("ksgl").toString()); | ||
| 484 | - si.setJhjl(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString()); | ||
| 485 | 496 | ||
| 497 | + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | ||
| 498 | + List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(xlbm, startDate); | ||
| 499 | + for (int i = 0; i < list.size(); i++) { | ||
| 500 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 501 | + Singledata sin=list.get(i); | ||
| 502 | + String jsy=sin.getJsy(); | ||
| 503 | + String clzbh=sin.getClzbh(); | ||
| 504 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 505 | + ScheduleRealInfo s=listReal.get(j); | ||
| 506 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)){ | ||
| 507 | + newList.add(s); | ||
| 508 | + } | ||
| 509 | + } | ||
| 510 | + | ||
| 511 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 512 | + double yygl=culateMileageService.culateSjgl(newList); | ||
| 513 | + double ljgl=culateMileageService.culateLjgl(newList); | ||
| 514 | + double ksgl=culateMileageService.culateKsgl(newList); | ||
| 515 | + double jcgl=culateMileageService.culateJccgl(newList); | ||
| 516 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 517 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 518 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 519 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 520 | + sin.setJhjl(String.valueOf(jhgl)); | ||
| 521 | + double yhl=0.0; | ||
| 522 | + double jzl=0.0; | ||
| 523 | + double fyy=0.0; | ||
| 524 | + for (int j = 0; j < listYlb.size(); j++) { | ||
| 525 | + Ylb y=listYlb.get(j); | ||
| 526 | + if(y.getJsy().equals(jsy) && y.getNbbm().equals(clzbh)){ | ||
| 527 | + yhl=Arith.add(yhl, y.getYh()==null?0:y.getYh()); | ||
| 528 | + jzl=Arith.add(jzl, y.getJzl()==null?0:y.getJzl()); | ||
| 529 | + fyy=Arith.add(fyy, y.getSh()==null?0:y.getSh()); | ||
| 530 | + } | ||
| 531 | + } | ||
| 532 | + sin.setHyl(String.valueOf(yhl)); | ||
| 533 | + sin.setJzl(String.valueOf(jzl)); | ||
| 534 | + sin.setUnyyyl(String.valueOf(fyy)); | ||
| 486 | } | 535 | } |
| 487 | return list; | 536 | return list; |
| 488 | } | 537 | } |
| @@ -545,50 +594,72 @@ public class FormsServiceImpl implements FormsService { | @@ -545,50 +594,72 @@ public class FormsServiceImpl implements FormsService { | ||
| 545 | 594 | ||
| 546 | // 车辆加注 | 595 | // 车辆加注 |
| 547 | @Override | 596 | @Override |
| 548 | - public List<Vehicleloading> vehicleloading(String gsdmVehic,String fgsdmVehic,String line, String date) { | 597 | + public List<Vehicleloading> vehicleloading(String line, String date) { |
| 549 | 598 | ||
| 550 | - String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " | ||
| 551 | - + " FROM bsth_c_s_sp_info_real r " | ||
| 552 | - + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y " | ||
| 553 | - + " where to_days(y.RQ)=to_days('" + date + "') and y.XLBM= '" + line + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y " | ||
| 554 | - + " on r.cl_zbh=y.nbbm " | ||
| 555 | - + " where to_days(r.schedule_date_str)=to_days('" + date + "')" | ||
| 556 | - + " and r.xl_bm='" + line + "' " | ||
| 557 | - + " AND r.gs_bm is not null" | ||
| 558 | - + " and r.bc_type not in('in','out')"; | ||
| 559 | - if(gsdmVehic.toString()!=""){ | ||
| 560 | - sql+=" and r.gs_bm='"+gsdmVehic+"'"; | ||
| 561 | - } | ||
| 562 | - if(fgsdmVehic.toString()!=""){ | ||
| 563 | - sql+=" and r.fgs_bm='"+fgsdmVehic +"'"; | ||
| 564 | - } | ||
| 565 | - sql += " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "; | 599 | + String sql="select r.s_gh,r.s_name, " |
| 600 | + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" | ||
| 601 | + + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+date+"' " | ||
| 602 | + + " and r.xl_bm = '"+line+"' group by r.s_gh,r.s_name," | ||
| 603 | + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"; | ||
| 604 | + | ||
| 566 | List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() { | 605 | List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() { |
| 567 | @Override | 606 | @Override |
| 568 | public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException { | 607 | public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 569 | Vehicleloading ve = new Vehicleloading(); | 608 | Vehicleloading ve = new Vehicleloading(); |
| 570 | - ve.setrQ(arg0.getString("schedule_date_str")); | ||
| 571 | - ve.setgS(arg0.getString("gs_name")); | 609 | + ve.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm"))); |
| 572 | ve.setxL(arg0.getString("xl_name")); | 610 | ve.setxL(arg0.getString("xl_name")); |
| 573 | ve.setClzbh(arg0.getString("cl_zbh")); | 611 | ve.setClzbh(arg0.getString("cl_zbh")); |
| 574 | - ve.setJzl(arg0.getString("JZL")); | ||
| 575 | - ve.setHyl(arg0.getString("YH")); | ||
| 576 | - // ve.setLs(arg0.getString("").toString());//尿素 | ||
| 577 | ve.setJgh(arg0.getString("j_gh").toString()); | 612 | ve.setJgh(arg0.getString("j_gh").toString()); |
| 578 | return ve; | 613 | return ve; |
| 579 | } | 614 | } |
| 580 | }); | 615 | }); |
| 581 | 616 | ||
| 582 | - for(int i=0;i<list.size();i++){ | ||
| 583 | - Vehicleloading v=list.get(i); | ||
| 584 | - Map<String, Object> maps = new HashMap<>(); | ||
| 585 | - maps = commonService.findKMBC2(v.getJgh(), v.getClzbh(), | ||
| 586 | - v.getrQ()); | ||
| 587 | - v.setJhlc(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString()); | ||
| 588 | - v.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次 | ||
| 589 | - v.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次 | ||
| 590 | - } | ||
| 591 | 617 | ||
| 618 | + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, "", "", line, "", "xlbm"); | ||
| 619 | + List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); | ||
| 620 | + for (int i = 0; i < list.size(); i++) { | ||
| 621 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 622 | + Vehicleloading sin=list.get(i); | ||
| 623 | + sin.setrQ(date); | ||
| 624 | + String jsy=sin.getJgh(); | ||
| 625 | + String clzbh=sin.getClzbh(); | ||
| 626 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 627 | + ScheduleRealInfo s=listReal.get(j); | ||
| 628 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)){ | ||
| 629 | + newList.add(s); | ||
| 630 | + } | ||
| 631 | + } | ||
| 632 | + | ||
| 633 | + int jhbc=culateMileageService.culateJhbc(newList, ""); | ||
| 634 | + int sjbc=culateMileageService.culateSjbc(newList, ""); | ||
| 635 | + int ljbc=culateMileageService.culateLjbc(newList, ""); | ||
| 636 | + double yygl=culateMileageService.culateSjgl(newList); | ||
| 637 | + double ljgl=culateMileageService.culateLjgl(newList); | ||
| 638 | + double ksgl=culateMileageService.culateKsgl(newList); | ||
| 639 | + double jcgl=culateMileageService.culateJccgl(newList); | ||
| 640 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 641 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 642 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 643 | + sin.setJhbc(String.valueOf(jhbc)); | ||
| 644 | + sin.setSjbc(String.valueOf(sjbc+ljbc)); | ||
| 645 | + double yhl=0.0; | ||
| 646 | + double jzl=0.0; | ||
| 647 | + double fyy=0.0; | ||
| 648 | + double ns=0.0; | ||
| 649 | + for (int j = 0; j < listYlb.size(); j++) { | ||
| 650 | + Ylb y=listYlb.get(j); | ||
| 651 | + if(y.getJsy().equals(jsy) && y.getNbbm().equals(clzbh)){ | ||
| 652 | + yhl=Arith.add(yhl, y.getYh()==null?0:y.getYh()); | ||
| 653 | + jzl=Arith.add(jzl, y.getJzl()==null?0:y.getJzl()); | ||
| 654 | + fyy=Arith.add(fyy, y.getSh()==null?0:y.getSh()); | ||
| 655 | + ns =Arith.add(ns, y.getNs()==null?0:y.getNs()); | ||
| 656 | + } | ||
| 657 | + } | ||
| 658 | + sin.setHyl(String.valueOf(yhl)); | ||
| 659 | + sin.setJzl(String.valueOf(jzl)); | ||
| 660 | + sin.setUnyyyl(String.valueOf(fyy)); | ||
| 661 | + sin.setLs(String.valueOf(ns)); | ||
| 662 | + } | ||
| 592 | return list; | 663 | return list; |
| 593 | } | 664 | } |
| 594 | 665 | ||
| @@ -816,7 +887,7 @@ public class FormsServiceImpl implements FormsService { | @@ -816,7 +887,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 816 | } | 887 | } |
| 817 | 888 | ||
| 818 | String fgsbm=""; | 889 | String fgsbm=""; |
| 819 | - if(map.get("fgsdmDaily").toString()!=null){ | 890 | + if(map.get("fgsdmDaily")!=null){ |
| 820 | fgsbm=map.get("fgsdmDaily").toString(); | 891 | fgsbm=map.get("fgsdmDaily").toString(); |
| 821 | } | 892 | } |
| 822 | 893 | ||
| @@ -853,6 +924,12 @@ public class FormsServiceImpl implements FormsService { | @@ -853,6 +924,12 @@ public class FormsServiceImpl implements FormsService { | ||
| 853 | for(int i=0;i<list.size();i++){ | 924 | for(int i=0;i<list.size();i++){ |
| 854 | sList =new ArrayList<ScheduleRealInfo>(); | 925 | sList =new ArrayList<ScheduleRealInfo>(); |
| 855 | Daily d=list.get(i); | 926 | Daily d=list.get(i); |
| 927 | + if(d.getYh()==null){ | ||
| 928 | + d.setYh("0"); | ||
| 929 | + }else{ | ||
| 930 | + if(d.getYh().equals("")) | ||
| 931 | + d.setYh("0"); | ||
| 932 | + } | ||
| 856 | for (int j = 0; j < lists.size(); j++) { | 933 | for (int j = 0; j < lists.size(); j++) { |
| 857 | ScheduleRealInfo s=lists.get(j); | 934 | ScheduleRealInfo s=lists.get(j); |
| 858 | if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ | 935 | if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ |
src/main/java/com/bsth/service/realcontrol/DataManagerService.java
| 1 | -package com.bsth.service.realcontrol; | ||
| 2 | - | ||
| 3 | -import java.util.Map; | ||
| 4 | - | ||
| 5 | -/** | ||
| 6 | - * Created by panzhao on 2017/4/18. | ||
| 7 | - */ | ||
| 8 | -public interface DataManagerService { | ||
| 9 | - | ||
| 10 | - Map<String, Object> carInfos(Integer lineId); | ||
| 11 | - | ||
| 12 | - Map<String,Object> updateDevices(String jsonStr); | ||
| 13 | -} | 1 | +package com.bsth.service.realcontrol; |
| 2 | + | ||
| 3 | +import java.util.Map; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * Created by panzhao on 2017/4/18. | ||
| 7 | + */ | ||
| 8 | +public interface DataManagerService { | ||
| 9 | + | ||
| 10 | + Map<String, Object> carInfos(Integer lineId); | ||
| 11 | + | ||
| 12 | + Map<String,Object> updateDevices(String jsonStr); | ||
| 13 | +} |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| @@ -161,4 +161,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | @@ -161,4 +161,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | ||
| 161 | void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type); | 161 | void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type); |
| 162 | 162 | ||
| 163 | Map<String,Object> revokeRealArrive(Long id); | 163 | Map<String,Object> revokeRealArrive(Long id); |
| 164 | + | ||
| 165 | + Map<String,Object> lateAdjust(String idx, float minute); | ||
| 166 | + | ||
| 167 | + List<ScheduleRealInfo> allLate2(String idx); | ||
| 164 | } | 168 | } |
src/main/java/com/bsth/service/realcontrol/impl/DataManagerServiceImpl.java
| 1 | -package com.bsth.service.realcontrol.impl; | ||
| 2 | - | ||
| 3 | -import com.alibaba.fastjson.JSONArray; | ||
| 4 | -import com.alibaba.fastjson.JSONObject; | ||
| 5 | -import com.bsth.common.ResponseCode; | ||
| 6 | -import com.bsth.data.BasicData; | ||
| 7 | -import com.bsth.entity.Cars; | ||
| 8 | -import com.bsth.repository.CarsRepository; | ||
| 9 | -import com.bsth.service.realcontrol.DataManagerService; | ||
| 10 | -import com.bsth.util.db.DBUtils_oldSystem; | ||
| 11 | -import org.slf4j.Logger; | ||
| 12 | -import org.slf4j.LoggerFactory; | ||
| 13 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | -import org.springframework.jdbc.core.JdbcTemplate; | ||
| 15 | -import org.springframework.stereotype.Service; | ||
| 16 | - | ||
| 17 | -import java.util.ArrayList; | ||
| 18 | -import java.util.HashMap; | ||
| 19 | -import java.util.List; | ||
| 20 | -import java.util.Map; | ||
| 21 | - | ||
| 22 | -/** | ||
| 23 | - * Created by panzhao on 2017/4/18. | ||
| 24 | - */ | ||
| 25 | -@Service | ||
| 26 | -public class DataManagerServiceImpl implements DataManagerService{ | ||
| 27 | - | ||
| 28 | - @Autowired | ||
| 29 | - CarsRepository carsRepository; | ||
| 30 | - | ||
| 31 | - @Autowired | ||
| 32 | - JdbcTemplate controlJdbcTemp; | ||
| 33 | - | ||
| 34 | - @Autowired | ||
| 35 | - BasicData.BasicDataLoader dataLoader; | ||
| 36 | - | ||
| 37 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 38 | - | ||
| 39 | - @Override | ||
| 40 | - public Map<String, Object> carInfos(Integer lineId) { | ||
| 41 | - | ||
| 42 | - Map<String, Object> rs = new HashMap<>(); | ||
| 43 | - try { | ||
| 44 | - List<Map<String, String>> nowData = new ArrayList<>(); | ||
| 45 | - List<Map<String, String>> oldData = new ArrayList<>(); | ||
| 46 | - Map<String, String> map; | ||
| 47 | - | ||
| 48 | - //查询新系统车辆信息 | ||
| 49 | - List<Cars> list = carsRepository.findCarsByLineId(lineId); | ||
| 50 | - for(Cars c : list){ | ||
| 51 | - map = new HashMap<>(); | ||
| 52 | - map.put("nbbm", c.getInsideCode()); | ||
| 53 | - map.put("device", c.getEquipmentCode()); | ||
| 54 | - nowData.add(map); | ||
| 55 | - } | ||
| 56 | - | ||
| 57 | - //获取老系统数据 | ||
| 58 | - JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_oldSystem.getDataSource()); | ||
| 59 | - List<Map<String, Object>> oyList = jdbcTemplate.queryForList("select NBBM,SBBH from JJWGPS_T_CLXXB t where xlbm=?", BasicData.lineId2CodeMap.get(lineId)); | ||
| 60 | - for(Map<String, Object> tempMap : oyList){ | ||
| 61 | - map = new HashMap<>(); | ||
| 62 | - map.put("nbbm", tempMap.get("NBBM").toString()); | ||
| 63 | - map.put("device", tempMap.get("SBBH").toString()); | ||
| 64 | - oldData.add(map); | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - rs.put("status", ResponseCode.SUCCESS); | ||
| 68 | - rs.put("nows", nowData); | ||
| 69 | - rs.put("olds", oldData); | ||
| 70 | - }catch (Exception e){ | ||
| 71 | - logger.error("", e); | ||
| 72 | - rs.put("status", ResponseCode.ERROR); | ||
| 73 | - rs.put("msg", e.getMessage()); | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - return rs; | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - /** | ||
| 80 | - * 更新设备号 | ||
| 81 | - * @param jsonStr | ||
| 82 | - * @return | ||
| 83 | - */ | ||
| 84 | - @Override | ||
| 85 | - public Map<String, Object> updateDevices(String jsonStr) { | ||
| 86 | - Map<String, Object> rs = new HashMap<>(); | ||
| 87 | - try { | ||
| 88 | - int count=0; | ||
| 89 | - JSONArray array = JSONArray.parseArray(jsonStr); | ||
| 90 | - JSONObject jObj; | ||
| 91 | - for(int i = 0; i < array.size(); i ++){ | ||
| 92 | - jObj = array.getJSONObject(i); | ||
| 93 | - count += controlJdbcTemp.update("update bsth_c_cars set equipment_code=? where inside_code=?" | ||
| 94 | - , jObj.getString("device"), jObj.getString("nbbm")); | ||
| 95 | - } | ||
| 96 | - | ||
| 97 | - //刷新缓存 | ||
| 98 | - dataLoader.loadDeviceInfo(); | ||
| 99 | - rs.put("status", ResponseCode.SUCCESS); | ||
| 100 | - rs.put("count", count); | ||
| 101 | - }catch (Exception e){ | ||
| 102 | - logger.error("", e); | ||
| 103 | - rs.put("status", ResponseCode.ERROR); | ||
| 104 | - rs.put("msg", e.getMessage()); | ||
| 105 | - } | ||
| 106 | - return rs; | ||
| 107 | - } | ||
| 108 | -} | 1 | +package com.bsth.service.realcontrol.impl; |
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSONArray; | ||
| 4 | +import com.alibaba.fastjson.JSONObject; | ||
| 5 | +import com.bsth.common.ResponseCode; | ||
| 6 | +import com.bsth.data.BasicData; | ||
| 7 | +import com.bsth.entity.Cars; | ||
| 8 | +import com.bsth.repository.CarsRepository; | ||
| 9 | +import com.bsth.service.realcontrol.DataManagerService; | ||
| 10 | +import com.bsth.util.db.DBUtils_oldSystem; | ||
| 11 | +import org.slf4j.Logger; | ||
| 12 | +import org.slf4j.LoggerFactory; | ||
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 15 | +import org.springframework.stereotype.Service; | ||
| 16 | + | ||
| 17 | +import java.util.ArrayList; | ||
| 18 | +import java.util.HashMap; | ||
| 19 | +import java.util.List; | ||
| 20 | +import java.util.Map; | ||
| 21 | + | ||
| 22 | +/** | ||
| 23 | + * Created by panzhao on 2017/4/18. | ||
| 24 | + */ | ||
| 25 | +@Service | ||
| 26 | +public class DataManagerServiceImpl implements DataManagerService{ | ||
| 27 | + | ||
| 28 | + @Autowired | ||
| 29 | + CarsRepository carsRepository; | ||
| 30 | + | ||
| 31 | + @Autowired | ||
| 32 | + JdbcTemplate controlJdbcTemp; | ||
| 33 | + | ||
| 34 | + @Autowired | ||
| 35 | + BasicData.BasicDataLoader dataLoader; | ||
| 36 | + | ||
| 37 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 38 | + | ||
| 39 | + @Override | ||
| 40 | + public Map<String, Object> carInfos(Integer lineId) { | ||
| 41 | + | ||
| 42 | + Map<String, Object> rs = new HashMap<>(); | ||
| 43 | + try { | ||
| 44 | + List<Map<String, String>> nowData = new ArrayList<>(); | ||
| 45 | + List<Map<String, String>> oldData = new ArrayList<>(); | ||
| 46 | + Map<String, String> map; | ||
| 47 | + | ||
| 48 | + //查询新系统车辆信息 | ||
| 49 | + List<Cars> list = carsRepository.findCarsByLineId(lineId); | ||
| 50 | + for(Cars c : list){ | ||
| 51 | + map = new HashMap<>(); | ||
| 52 | + map.put("nbbm", c.getInsideCode()); | ||
| 53 | + map.put("device", c.getEquipmentCode()); | ||
| 54 | + nowData.add(map); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + //获取老系统数据 | ||
| 58 | + JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_oldSystem.getDataSource()); | ||
| 59 | + List<Map<String, Object>> oyList = jdbcTemplate.queryForList("select NBBM,SBBH from JJWGPS_T_CLXXB t where xlbm=?", BasicData.lineId2CodeMap.get(lineId)); | ||
| 60 | + for(Map<String, Object> tempMap : oyList){ | ||
| 61 | + map = new HashMap<>(); | ||
| 62 | + map.put("nbbm", tempMap.get("NBBM").toString()); | ||
| 63 | + map.put("device", tempMap.get("SBBH").toString()); | ||
| 64 | + oldData.add(map); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 68 | + rs.put("nows", nowData); | ||
| 69 | + rs.put("olds", oldData); | ||
| 70 | + }catch (Exception e){ | ||
| 71 | + logger.error("", e); | ||
| 72 | + rs.put("status", ResponseCode.ERROR); | ||
| 73 | + rs.put("msg", e.getMessage()); | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + return rs; | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 更新设备号 | ||
| 81 | + * @param jsonStr | ||
| 82 | + * @return | ||
| 83 | + */ | ||
| 84 | + @Override | ||
| 85 | + public Map<String, Object> updateDevices(String jsonStr) { | ||
| 86 | + Map<String, Object> rs = new HashMap<>(); | ||
| 87 | + try { | ||
| 88 | + int count=0; | ||
| 89 | + JSONArray array = JSONArray.parseArray(jsonStr); | ||
| 90 | + JSONObject jObj; | ||
| 91 | + for(int i = 0; i < array.size(); i ++){ | ||
| 92 | + jObj = array.getJSONObject(i); | ||
| 93 | + count += controlJdbcTemp.update("update bsth_c_cars set equipment_code=? where inside_code=?" | ||
| 94 | + , jObj.getString("device"), jObj.getString("nbbm")); | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + //刷新缓存 | ||
| 98 | + dataLoader.loadDeviceInfo(); | ||
| 99 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 100 | + rs.put("count", count); | ||
| 101 | + }catch (Exception e){ | ||
| 102 | + logger.error("", e); | ||
| 103 | + rs.put("status", ResponseCode.ERROR); | ||
| 104 | + rs.put("msg", e.getMessage()); | ||
| 105 | + } | ||
| 106 | + return rs; | ||
| 107 | + } | ||
| 108 | +} |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -13,6 +13,7 @@ import com.bsth.data.LineConfigData; | @@ -13,6 +13,7 @@ import com.bsth.data.LineConfigData; | ||
| 13 | import com.bsth.data.schedule.DayOfSchedule; | 13 | import com.bsth.data.schedule.DayOfSchedule; |
| 14 | import com.bsth.data.schedule.SchAttrCalculator; | 14 | import com.bsth.data.schedule.SchAttrCalculator; |
| 15 | import com.bsth.data.schedule.ScheduleComparator; | 15 | import com.bsth.data.schedule.ScheduleComparator; |
| 16 | +import com.bsth.data.schedule.late_adjust.LateAdjustHandle; | ||
| 16 | import com.bsth.entity.Cars; | 17 | import com.bsth.entity.Cars; |
| 17 | import com.bsth.entity.Line; | 18 | import com.bsth.entity.Line; |
| 18 | import com.bsth.entity.Personnel; | 19 | import com.bsth.entity.Personnel; |
| @@ -176,6 +177,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -176,6 +177,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 176 | schedule.setDfsjAll(dfsj); | 177 | schedule.setDfsjAll(dfsj); |
| 177 | schedule.addRemarks(remarks); | 178 | schedule.addRemarks(remarks); |
| 178 | 179 | ||
| 180 | + //取消应发未到标记 | ||
| 181 | + if(schedule.isLate2()){ | ||
| 182 | + schedule.setLate2(false); | ||
| 183 | + LateAdjustHandle.remove(schedule); | ||
| 184 | + } | ||
| 185 | + | ||
| 179 | List<ScheduleRealInfo> ts = new ArrayList<>(); | 186 | List<ScheduleRealInfo> ts = new ArrayList<>(); |
| 180 | ts.add(schedule); | 187 | ts.add(schedule); |
| 181 | //调整终点时间和下一个班次的应到时间 | 188 | //调整终点时间和下一个班次的应到时间 |
| @@ -826,9 +833,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -826,9 +833,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 826 | sch.setFcsjActualAll(fcsjActual); | 833 | sch.setFcsjActualAll(fcsjActual); |
| 827 | sch.addRemarks(remarks); | 834 | sch.addRemarks(remarks); |
| 828 | sch.calcStatus(); | 835 | sch.calcStatus(); |
| 836 | + if(sch.isLate2()){ | ||
| 837 | + //取消应发未到标记 | ||
| 838 | + sch.setLate2(false); | ||
| 839 | + LateAdjustHandle.remove(sch); | ||
| 840 | + } | ||
| 829 | 841 | ||
| 830 | dayOfSchedule.save(sch); | 842 | dayOfSchedule.save(sch); |
| 831 | - //scheduleRealInfoRepository.save(sch); | ||
| 832 | 843 | ||
| 833 | ts.add(sch); | 844 | ts.add(sch); |
| 834 | 845 | ||
| @@ -1015,8 +1026,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1015,8 +1026,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1015 | t = fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + fcsjActual); | 1026 | t = fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + fcsjActual); |
| 1016 | 1027 | ||
| 1017 | //调整实发 | 1028 | //调整实发 |
| 1018 | - if (!fcsjActual.equals(sch.getFcsjActual())) | 1029 | + if (!fcsjActual.equals(sch.getFcsjActual())){ |
| 1019 | sch.setFcsjActualAll(t); | 1030 | sch.setFcsjActualAll(t); |
| 1031 | + | ||
| 1032 | + //取消应发未到标记 | ||
| 1033 | + if(sch.isLate2()){ | ||
| 1034 | + sch.setLate2(false); | ||
| 1035 | + LateAdjustHandle.remove(sch); | ||
| 1036 | + } | ||
| 1037 | + } | ||
| 1020 | } else { | 1038 | } else { |
| 1021 | //撤销实发 | 1039 | //撤销实发 |
| 1022 | if (sch.getFcsjActual() != null) | 1040 | if (sch.getFcsjActual() != null) |
| @@ -1107,6 +1125,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1107,6 +1125,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1107 | //重新计算是否误点 | 1125 | //重新计算是否误点 |
| 1108 | schedule.reCalcLate(); | 1126 | schedule.reCalcLate(); |
| 1109 | 1127 | ||
| 1128 | + //取消应发未到标记 | ||
| 1129 | + if(schedule.isLate2()){ | ||
| 1130 | + schedule.setLate2(false); | ||
| 1131 | + LateAdjustHandle.remove(schedule); | ||
| 1132 | + } | ||
| 1110 | dayOfSchedule.save(schedule); | 1133 | dayOfSchedule.save(schedule); |
| 1111 | } | 1134 | } |
| 1112 | 1135 | ||
| @@ -4093,4 +4116,53 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4093,4 +4116,53 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4093 | } | 4116 | } |
| 4094 | return rs; | 4117 | return rs; |
| 4095 | } | 4118 | } |
| 4119 | + | ||
| 4120 | + @Override | ||
| 4121 | + public Map<String, Object> lateAdjust(String idx, float minute) { | ||
| 4122 | + Map<String, Object> rs = new HashMap<>(); | ||
| 4123 | + try { | ||
| 4124 | + int count = 0; | ||
| 4125 | + List<ScheduleRealInfo> list = new ArrayList<>(); | ||
| 4126 | + List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx); | ||
| 4127 | + | ||
| 4128 | + ScheduleRealInfo sch; | ||
| 4129 | + for(String id : ids){ | ||
| 4130 | + sch = dayOfSchedule.get(Long.parseLong(id)); | ||
| 4131 | + if(sch != null && sch.getStatus() == 0){ | ||
| 4132 | + if(minute > 0){ | ||
| 4133 | + sch.setLateMinute(minute); | ||
| 4134 | + } | ||
| 4135 | + else if(minute == 0){ | ||
| 4136 | + LateAdjustHandle.remove(sch); | ||
| 4137 | + } | ||
| 4138 | + count ++; | ||
| 4139 | + list.add(sch); | ||
| 4140 | + } | ||
| 4141 | + } | ||
| 4142 | + | ||
| 4143 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 4144 | + rs.put("count", count); | ||
| 4145 | + rs.put("ts", list); | ||
| 4146 | + }catch (Exception e){ | ||
| 4147 | + logger.error("", e); | ||
| 4148 | + rs.put("status", ResponseCode.ERROR); | ||
| 4149 | + rs.put("msg", e.getMessage()); | ||
| 4150 | + } | ||
| 4151 | + | ||
| 4152 | + return rs; | ||
| 4153 | + } | ||
| 4154 | + | ||
| 4155 | + @Override | ||
| 4156 | + public List<ScheduleRealInfo> allLate2(String idx) { | ||
| 4157 | + List<ScheduleRealInfo> rs = new ArrayList<>(); | ||
| 4158 | + List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx); | ||
| 4159 | + | ||
| 4160 | + Collection<ScheduleRealInfo> all = LateAdjustHandle.allLateSch(); | ||
| 4161 | + for(ScheduleRealInfo sch : all){ | ||
| 4162 | + if(ids.indexOf(sch.getXlBm()) != -1){ | ||
| 4163 | + rs.add(sch); | ||
| 4164 | + } | ||
| 4165 | + } | ||
| 4166 | + return rs; | ||
| 4167 | + } | ||
| 4096 | } | 4168 | } |
| 4097 | \ No newline at end of file | 4169 | \ No newline at end of file |
src/main/java/com/bsth/util/db/DBUtils_oldSystem.java
| 1 | -package com.bsth.util.db; | ||
| 2 | - | ||
| 3 | -import com.mchange.v2.c3p0.DataSources; | ||
| 4 | -import org.apache.log4j.Logger; | ||
| 5 | - | ||
| 6 | -import javax.sql.DataSource; | ||
| 7 | -import java.sql.Connection; | ||
| 8 | -import java.sql.ResultSet; | ||
| 9 | -import java.sql.SQLException; | ||
| 10 | -import java.sql.Statement; | ||
| 11 | -import java.util.HashMap; | ||
| 12 | -import java.util.Map; | ||
| 13 | - | ||
| 14 | -/** | ||
| 15 | - * 老系统数据库连接池(保持少量的连接,不会对老系统有什么影响) | ||
| 16 | - * @author PanZhao | ||
| 17 | - * | ||
| 18 | - */ | ||
| 19 | -//@Component | ||
| 20 | -public class DBUtils_oldSystem { | ||
| 21 | - | ||
| 22 | - private static String url = null; | ||
| 23 | - | ||
| 24 | - private static String username = null; | ||
| 25 | - | ||
| 26 | - private static String pwd = null; | ||
| 27 | - | ||
| 28 | - private static DataSource ds_pooled; | ||
| 29 | - | ||
| 30 | - static Logger logger = Logger.getLogger(DBUtils_oldSystem.class); | ||
| 31 | - | ||
| 32 | - static { | ||
| 33 | - | ||
| 34 | - try { | ||
| 35 | - // 1. 加载驱动类 | ||
| 36 | - Class.forName("oracle.jdbc.driver.OracleDriver"); | ||
| 37 | - | ||
| 38 | - url = "jdbc:oracle:thin:@10.10.200.225:1521:orcl"; | ||
| 39 | - username = "jjwgps"; | ||
| 40 | - pwd = "jjwgps"; | ||
| 41 | - | ||
| 42 | - // 设置连接数据库的配置信息 | ||
| 43 | - DataSource ds_unpooled = DataSources.unpooledDataSource(url, | ||
| 44 | - username, pwd); | ||
| 45 | - | ||
| 46 | - Map<String, Object> pool_conf = new HashMap<String, Object>(); | ||
| 47 | - // 设置最大连接数 | ||
| 48 | - pool_conf.put("maxPoolSize", 5); | ||
| 49 | - | ||
| 50 | - pool_conf.put("testConnectionOnCheckout", false); | ||
| 51 | - //异步检测连接的有效性 | ||
| 52 | - pool_conf.put("testConnectionOnCheckin", true); | ||
| 53 | - //10分钟检测一次 | ||
| 54 | - pool_conf.put("idleConnectionTestPeriod", 60 * 10); | ||
| 55 | - ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf); | ||
| 56 | - } catch (ClassNotFoundException e) { | ||
| 57 | - logger.error(e.toString()); | ||
| 58 | - e.printStackTrace(); | ||
| 59 | - } catch (SQLException e) { | ||
| 60 | - logger.error("初始化老系统连接池失败,非正式环境请忽略这个问题!"); | ||
| 61 | - logger.error(e.toString()); | ||
| 62 | - e.printStackTrace(); | ||
| 63 | - } | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | - /** | ||
| 67 | - * 获取连接对象 | ||
| 68 | - */ | ||
| 69 | - public static Connection getConnection() throws SQLException { | ||
| 70 | - return ds_pooled.getConnection(); | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - /** | ||
| 74 | - * 释放连接池资源 | ||
| 75 | - */ | ||
| 76 | - public static void clearup() { | ||
| 77 | - if (ds_pooled != null) { | ||
| 78 | - try { | ||
| 79 | - DataSources.destroy(ds_pooled); | ||
| 80 | - } catch (SQLException e) { | ||
| 81 | - logger.error(e.toString()); | ||
| 82 | - e.printStackTrace(); | ||
| 83 | - } | ||
| 84 | - } | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - /** | ||
| 88 | - * 资源关闭 | ||
| 89 | - * | ||
| 90 | - * @param rs | ||
| 91 | - * @param stmt | ||
| 92 | - * @param conn | ||
| 93 | - */ | ||
| 94 | - public static void close(ResultSet rs, Statement stmt, Connection conn) { | ||
| 95 | - if (rs != null) { | ||
| 96 | - try { | ||
| 97 | - rs.close(); | ||
| 98 | - } catch (SQLException e) { | ||
| 99 | - logger.error(e.toString()); | ||
| 100 | - e.printStackTrace(); | ||
| 101 | - } | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - if (stmt != null) { | ||
| 105 | - try { | ||
| 106 | - stmt.close(); | ||
| 107 | - } catch (SQLException e) { | ||
| 108 | - logger.error(e.toString()); | ||
| 109 | - e.printStackTrace(); | ||
| 110 | - } | ||
| 111 | - } | ||
| 112 | - | ||
| 113 | - if (conn != null) { | ||
| 114 | - try { | ||
| 115 | - conn.close(); | ||
| 116 | - } catch (SQLException e) { | ||
| 117 | - logger.error(e.toString()); | ||
| 118 | - e.printStackTrace(); | ||
| 119 | - } | ||
| 120 | - } | ||
| 121 | - } | ||
| 122 | - | ||
| 123 | - public static DataSource getDataSource(){ | ||
| 124 | - return ds_pooled; | ||
| 125 | - } | ||
| 126 | -} | 1 | +package com.bsth.util.db; |
| 2 | + | ||
| 3 | +import com.mchange.v2.c3p0.DataSources; | ||
| 4 | +import org.apache.log4j.Logger; | ||
| 5 | + | ||
| 6 | +import javax.sql.DataSource; | ||
| 7 | +import java.sql.Connection; | ||
| 8 | +import java.sql.ResultSet; | ||
| 9 | +import java.sql.SQLException; | ||
| 10 | +import java.sql.Statement; | ||
| 11 | +import java.util.HashMap; | ||
| 12 | +import java.util.Map; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 老系统数据库连接池(保持少量的连接,不会对老系统有什么影响) | ||
| 16 | + * @author PanZhao | ||
| 17 | + * | ||
| 18 | + */ | ||
| 19 | +//@Component | ||
| 20 | +public class DBUtils_oldSystem { | ||
| 21 | + | ||
| 22 | + private static String url = null; | ||
| 23 | + | ||
| 24 | + private static String username = null; | ||
| 25 | + | ||
| 26 | + private static String pwd = null; | ||
| 27 | + | ||
| 28 | + private static DataSource ds_pooled; | ||
| 29 | + | ||
| 30 | + static Logger logger = Logger.getLogger(DBUtils_oldSystem.class); | ||
| 31 | + | ||
| 32 | + static { | ||
| 33 | + | ||
| 34 | + try { | ||
| 35 | + // 1. 加载驱动类 | ||
| 36 | + Class.forName("oracle.jdbc.driver.OracleDriver"); | ||
| 37 | + | ||
| 38 | + url = "jdbc:oracle:thin:@10.10.200.225:1521:orcl"; | ||
| 39 | + username = "jjwgps"; | ||
| 40 | + pwd = "jjwgps"; | ||
| 41 | + | ||
| 42 | + // 设置连接数据库的配置信息 | ||
| 43 | + DataSource ds_unpooled = DataSources.unpooledDataSource(url, | ||
| 44 | + username, pwd); | ||
| 45 | + | ||
| 46 | + Map<String, Object> pool_conf = new HashMap<String, Object>(); | ||
| 47 | + // 设置最大连接数 | ||
| 48 | + pool_conf.put("maxPoolSize", 5); | ||
| 49 | + | ||
| 50 | + pool_conf.put("testConnectionOnCheckout", false); | ||
| 51 | + //异步检测连接的有效性 | ||
| 52 | + pool_conf.put("testConnectionOnCheckin", true); | ||
| 53 | + //10分钟检测一次 | ||
| 54 | + pool_conf.put("idleConnectionTestPeriod", 60 * 10); | ||
| 55 | + ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf); | ||
| 56 | + } catch (ClassNotFoundException e) { | ||
| 57 | + logger.error(e.toString()); | ||
| 58 | + e.printStackTrace(); | ||
| 59 | + } catch (SQLException e) { | ||
| 60 | + logger.error("初始化老系统连接池失败,非正式环境请忽略这个问题!"); | ||
| 61 | + logger.error(e.toString()); | ||
| 62 | + e.printStackTrace(); | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 获取连接对象 | ||
| 68 | + */ | ||
| 69 | + public static Connection getConnection() throws SQLException { | ||
| 70 | + return ds_pooled.getConnection(); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + /** | ||
| 74 | + * 释放连接池资源 | ||
| 75 | + */ | ||
| 76 | + public static void clearup() { | ||
| 77 | + if (ds_pooled != null) { | ||
| 78 | + try { | ||
| 79 | + DataSources.destroy(ds_pooled); | ||
| 80 | + } catch (SQLException e) { | ||
| 81 | + logger.error(e.toString()); | ||
| 82 | + e.printStackTrace(); | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + /** | ||
| 88 | + * 资源关闭 | ||
| 89 | + * | ||
| 90 | + * @param rs | ||
| 91 | + * @param stmt | ||
| 92 | + * @param conn | ||
| 93 | + */ | ||
| 94 | + public static void close(ResultSet rs, Statement stmt, Connection conn) { | ||
| 95 | + if (rs != null) { | ||
| 96 | + try { | ||
| 97 | + rs.close(); | ||
| 98 | + } catch (SQLException e) { | ||
| 99 | + logger.error(e.toString()); | ||
| 100 | + e.printStackTrace(); | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + if (stmt != null) { | ||
| 105 | + try { | ||
| 106 | + stmt.close(); | ||
| 107 | + } catch (SQLException e) { | ||
| 108 | + logger.error(e.toString()); | ||
| 109 | + e.printStackTrace(); | ||
| 110 | + } | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + if (conn != null) { | ||
| 114 | + try { | ||
| 115 | + conn.close(); | ||
| 116 | + } catch (SQLException e) { | ||
| 117 | + logger.error(e.toString()); | ||
| 118 | + e.printStackTrace(); | ||
| 119 | + } | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + public static DataSource getDataSource(){ | ||
| 124 | + return ds_pooled; | ||
| 125 | + } | ||
| 126 | +} |
src/main/java/com/bsth/websocket/handler/SendUtils.java
| @@ -176,7 +176,7 @@ public class SendUtils{ | @@ -176,7 +176,7 @@ public class SendUtils{ | ||
| 176 | public void deviceOffline(GpsEntity gps){ | 176 | public void deviceOffline(GpsEntity gps){ |
| 177 | Map<String, Object> map = new HashMap<>(); | 177 | Map<String, Object> map = new HashMap<>(); |
| 178 | map.put("fn", "deviceOffline"); | 178 | map.put("fn", "deviceOffline"); |
| 179 | - map.put("gps", gps);; | 179 | + map.put("gps", gps); |
| 180 | ObjectMapper mapper = new ObjectMapper(); | 180 | ObjectMapper mapper = new ObjectMapper(); |
| 181 | 181 | ||
| 182 | try { | 182 | try { |
| @@ -199,4 +199,26 @@ public class SendUtils{ | @@ -199,4 +199,26 @@ public class SendUtils{ | ||
| 199 | logger.error("", e); | 199 | logger.error("", e); |
| 200 | } | 200 | } |
| 201 | } | 201 | } |
| 202 | + | ||
| 203 | + /** | ||
| 204 | + * 通知客户端,开始进行误点调整 | ||
| 205 | + * @param sch | ||
| 206 | + */ | ||
| 207 | + public void sendAutoWdtz(ScheduleRealInfo sch, ScheduleRealInfo cancel){ | ||
| 208 | + Map<String, Object> map = new HashMap<>(); | ||
| 209 | + map.put("fn", "auto_wdtz"); | ||
| 210 | + map.put("id", sch.getId()); | ||
| 211 | + if(cancel != null) | ||
| 212 | + map.put("cancelId", cancel.getId()); | ||
| 213 | + map.put("lineCode", sch.getXlBm()); | ||
| 214 | + map.put("minute", sch.getLateMinute()); | ||
| 215 | + ObjectMapper mapper = new ObjectMapper(); | ||
| 216 | + | ||
| 217 | + try { | ||
| 218 | + socketHandler.sendMessageToLine(sch.getXlBm() ,mapper.writeValueAsString(map)); | ||
| 219 | + | ||
| 220 | + } catch (JsonProcessingException e) { | ||
| 221 | + logger.error("", e); | ||
| 222 | + } | ||
| 223 | + } | ||
| 202 | } | 224 | } |
src/main/resources/static/assets/js/common.js
| @@ -204,6 +204,6 @@ function createVehSearch($e){ | @@ -204,6 +204,6 @@ function createVehSearch($e){ | ||
| 204 | return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | 204 | return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; |
| 205 | } | 205 | } |
| 206 | } | 206 | } |
| 207 | - }) | 207 | + }); |
| 208 | return $e; | 208 | return $e; |
| 209 | } | 209 | } |
src/main/resources/static/pages/forms/mould/list.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/vehicleloading.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/daily.html
| @@ -92,8 +92,7 @@ | @@ -92,8 +92,7 @@ | ||
| 92 | 92 | ||
| 93 | <script> | 93 | <script> |
| 94 | $(function(){ | 94 | $(function(){ |
| 95 | - var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'}; | ||
| 96 | - var fage=false; | 95 | + |
| 97 | // 关闭左侧栏 | 96 | // 关闭左侧栏 |
| 98 | if (!$('body').hasClass('page-sidebar-closed')) | 97 | if (!$('body').hasClass('page-sidebar-closed')) |
| 99 | $('.menu-toggler.sidebar-toggler').click(); | 98 | $('.menu-toggler.sidebar-toggler').click(); |
| @@ -102,6 +101,7 @@ | @@ -102,6 +101,7 @@ | ||
| 102 | format : 'YYYY-MM-DD', | 101 | format : 'YYYY-MM-DD', |
| 103 | locale : 'zh-cn' | 102 | locale : 'zh-cn' |
| 104 | }); | 103 | }); |
| 104 | + var fage=false; | ||
| 105 | var xlList; | 105 | var xlList; |
| 106 | var obj = []; | 106 | var obj = []; |
| 107 | 107 |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| @@ -551,7 +551,7 @@ letter-spacing: 20px; | @@ -551,7 +551,7 @@ letter-spacing: 20px; | ||
| 551 | <td>{{obj.fast}}</td> | 551 | <td>{{obj.fast}}</td> |
| 552 | <td>{{obj.slow}}</td> | 552 | <td>{{obj.slow}}</td> |
| 553 | <td>{{obj.fcsj}}</td> | 553 | <td>{{obj.fcsj}}</td> |
| 554 | - <td style="word-break: keep-all;white-space:nowrap;">{{obj.fcsjActual}} | 554 | + <td>{{obj.fcsjActual}} |
| 555 | {{if obj.bcType== "in"}} | 555 | {{if obj.bcType== "in"}} |
| 556 | (进) | 556 | (进) |
| 557 | {{/if}} | 557 | {{/if}} |
src/main/resources/static/pages/mforms/operationservices/operationservice.html
| @@ -42,19 +42,20 @@ | @@ -42,19 +42,20 @@ | ||
| 42 | class="form-control" name="subCompany" id="fgsdmOperat" | 42 | class="form-control" name="subCompany" id="fgsdmOperat" |
| 43 | style="width: 140px;"></select> | 43 | style="width: 140px;"></select> |
| 44 | </div> | 44 | </div> |
| 45 | - <div style="display: inline-block;"> | 45 | + <div style="margin-top: 2px"></div> |
| 46 | + <div style="display: inline-block;margin-left: 33px;"> | ||
| 46 | <span class="item-label" style="width: 80px;">线路: </span> <select | 47 | <span class="item-label" style="width: 80px;">线路: </span> <select |
| 47 | - class="form-control" name="line" id="line" style="width: 180px;"></select> | 48 | + class="form-control" name="line" id="line" style="width: 140px;"></select> |
| 48 | </div> | 49 | </div> |
| 49 | <div style="display: inline-block; margin-left: 15px;"> | 50 | <div style="display: inline-block; margin-left: 15px;"> |
| 50 | <span class="item-label" style="width: 80px;">开始时间: </span> <input | 51 | <span class="item-label" style="width: 80px;">开始时间: </span> <input |
| 51 | class="form-control" type="text" id="startDate" | 52 | class="form-control" type="text" id="startDate" |
| 52 | - style="width: 120px;" /> | 53 | + style="width: 140px;" /> |
| 53 | </div> | 54 | </div> |
| 54 | <div style="display: inline-block; margin-left: 15px;"> | 55 | <div style="display: inline-block; margin-left: 15px;"> |
| 55 | <span class="item-label" style="width: 80px;">结束时间: </span> <input | 56 | <span class="item-label" style="width: 80px;">结束时间: </span> <input |
| 56 | class="form-control" type="text" id="endDate" | 57 | class="form-control" type="text" id="endDate" |
| 57 | - style="width: 120px;" /> | 58 | + style="width: 140px;" /> |
| 58 | </div> | 59 | </div> |
| 59 | <div style="display: inline-block; margin-left: 15px"> | 60 | <div style="display: inline-block; margin-left: 15px"> |
| 60 | <span class="item-label" style="width: 150px;">统计: </span> | 61 | <span class="item-label" style="width: 150px;">统计: </span> |
| @@ -102,69 +103,94 @@ | @@ -102,69 +103,94 @@ | ||
| 102 | format : 'YYYY-MM-DD', | 103 | format : 'YYYY-MM-DD', |
| 103 | locale : 'zh-cn' | 104 | locale : 'zh-cn' |
| 104 | }); | 105 | }); |
| 106 | + | ||
| 107 | + var d = new Date(); | ||
| 108 | + var year = d.getFullYear(); | ||
| 109 | + var month = d.getMonth() + 1; | ||
| 110 | + var day = d.getDate(); | ||
| 111 | + if(month < 10) | ||
| 112 | + month = "0" + month; | ||
| 113 | + if(day < 10) | ||
| 114 | + day = "0" + day; | ||
| 115 | + $("#startDate").val(year + "-" + month + "-" + day); | ||
| 116 | + $("#endDate").val(year + "-" + month + "-" + day); | ||
| 105 | 117 | ||
| 106 | - $.get('/basic/lineCode2Name', function(result) { | ||
| 107 | - var data = []; | ||
| 108 | - | ||
| 109 | - for ( var code in result) { | ||
| 110 | - data.push({ | ||
| 111 | - id : code, | ||
| 112 | - text : result[code] | ||
| 113 | - }); | ||
| 114 | - } | ||
| 115 | - initPinYinSelect2('#line', data, ''); | ||
| 116 | - | ||
| 117 | - }) | ||
| 118 | - | 118 | + var fage=false; |
| 119 | + var xlList; | ||
| 119 | var obj = []; | 120 | var obj = []; |
| 120 | - $.get('/user/companyData', function(result) { | ||
| 121 | - obj = result; | ||
| 122 | - var options = ''; | ||
| 123 | - for (var i = 0; i < obj.length; i++) { | ||
| 124 | - options += '<option value="'+obj[i].companyCode+'">' | ||
| 125 | - + obj[i].companyName + '</option>'; | ||
| 126 | - } | ||
| 127 | - | ||
| 128 | - if (obj.length == 0) { | ||
| 129 | - $("#gsdmDiv_operat").css('display', 'none'); | ||
| 130 | - $('#fgsdmDiv_operat').css('display', 'none'); | ||
| 131 | - } else if (obj.length == 1) { | ||
| 132 | - $("#gsdmDiv_operat").css('display', 'none'); | ||
| 133 | - if (obj[0].children.length == 1 || obj[0].children.length == 0) | ||
| 134 | - $('#fgsdmDiv_operat').css('display', 'none'); | ||
| 135 | - } | ||
| 136 | - $('#gsdmOperat').html(options); | ||
| 137 | - updateCompany(); | ||
| 138 | - }); | ||
| 139 | - | ||
| 140 | - $("#gsdmOperat").on("change", updateCompany); | ||
| 141 | - function updateCompany() { | 121 | + |
| 122 | + | ||
| 123 | + $.get('/report/lineList',function(result){ | ||
| 124 | + xlList=result; | ||
| 125 | + $.get('/user/companyData', function(result){ | ||
| 126 | + obj = result; | ||
| 127 | + var options = ''; | ||
| 128 | + for(var i = 0; i < obj.length; i++){ | ||
| 129 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + if(obj.length ==0){ | ||
| 133 | + $("#gsdmDiv_operat").css('display','none'); | ||
| 134 | + }else if(obj.length ==1){ | ||
| 135 | + $("#gsdmDiv_operat").css('display','none'); | ||
| 136 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 137 | + $('#fgsdmDiv_operat').css('display','none'); | ||
| 138 | + } | ||
| 139 | + $('#gsdmOperat').html(options); | ||
| 140 | + updateCompany(); | ||
| 141 | + }); | ||
| 142 | + }) | ||
| 143 | + $("#gsdmOperat").on("change",updateCompany); | ||
| 144 | + function updateCompany(){ | ||
| 142 | var company = $('#gsdmOperat').val(); | 145 | var company = $('#gsdmOperat').val(); |
| 143 | var options = ''; | 146 | var options = ''; |
| 144 | - for (var i = 0; i < obj.length; i++) { | ||
| 145 | - if (obj[i].companyCode == company) { | 147 | + for(var i = 0; i < obj.length; i++){ |
| 148 | + if(obj[i].companyCode == company){ | ||
| 146 | var children = obj[i].children; | 149 | var children = obj[i].children; |
| 147 | - for (var j = 0; j < children.length; j++) { | ||
| 148 | - options += '<option value="'+children[j].code+'">' | ||
| 149 | - + children[j].name + '</option>'; | 150 | + for(var j = 0; j < children.length; j++){ |
| 151 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 150 | } | 152 | } |
| 151 | } | 153 | } |
| 152 | } | 154 | } |
| 153 | $('#fgsdmOperat').html(options); | 155 | $('#fgsdmOperat').html(options); |
| 156 | + initXl(); | ||
| 154 | } | 157 | } |
| 155 | 158 | ||
| 156 | - $.get('/basic/lineCode2Name', function(result) { | ||
| 157 | - var data = []; | ||
| 158 | - | ||
| 159 | - for ( var code in result) { | ||
| 160 | - data.push({ | ||
| 161 | - id : code, | ||
| 162 | - text : result[code] | ||
| 163 | - }); | 159 | + /* $.get('/basic/lineCode2Name',function(result){ |
| 160 | + var data=[]; | ||
| 161 | + | ||
| 162 | + for(var code in result){ | ||
| 163 | + data.push({id: code, text: result[code]}); | ||
| 164 | } | 164 | } |
| 165 | - initPinYinSelect2('#line', data, ''); | ||
| 166 | - | ||
| 167 | - }) | 165 | + initPinYinSelect2('#line',data,''); |
| 166 | + | ||
| 167 | + }) */ | ||
| 168 | + | ||
| 169 | + $("#fgsdmOperat").on("change",initXl); | ||
| 170 | + function initXl(){ | ||
| 171 | + var data=[]; | ||
| 172 | + if(fage){ | ||
| 173 | + $("#line").select2("destroy").html(''); | ||
| 174 | + } | ||
| 175 | + var fgs=$('#fgsdmOperat').val(); | ||
| 176 | + var gs=$('#gsdmOperat').val(); | ||
| 177 | + for(var i=0;i<xlList.length;i++){ | ||
| 178 | + if(gs!=""){ | ||
| 179 | + if(fgs!=""){ | ||
| 180 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | ||
| 181 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 182 | + } | ||
| 183 | + }else{ | ||
| 184 | + if(xlList[i]["gsbm"]==gs){ | ||
| 185 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 186 | + } | ||
| 187 | + } | ||
| 188 | + } | ||
| 189 | + } | ||
| 190 | + initPinYinSelect2('#line',data,''); | ||
| 191 | + fage=true; | ||
| 192 | + } | ||
| 193 | + | ||
| 168 | 194 | ||
| 169 | $("#query").on( | 195 | $("#query").on( |
| 170 | "click", | 196 | "click", |
src/main/resources/static/pages/mforms/singledatas/singledata.html
| @@ -37,18 +37,14 @@ | @@ -37,18 +37,14 @@ | ||
| 37 | <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select> | 37 | <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select> |
| 38 | </div> | 38 | </div> |
| 39 | <div style="display: inline-block;"> | 39 | <div style="display: inline-block;"> |
| 40 | - <span class="item-label" style="width: 80px;">线路: </span> | ||
| 41 | - <select class="form-control" name="line" id="line" style="width: 136px;"></select> | 40 | + <span class="item-label" style="width: 80px;"> 线路: </span> |
| 41 | + <select class="form-control" name="line" id="line" style="width: 140px;"></select> | ||
| 42 | </div> | 42 | </div> |
| 43 | - <div style="margin-top: 10px"></div> | ||
| 44 | <div style="display: inline-block;margin-left: 15px;"> | 43 | <div style="display: inline-block;margin-left: 15px;"> |
| 45 | - <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 46 | - <input class="form-control" type="text" id="startDate" style="width: 120px;"/> | ||
| 47 | - </div> | ||
| 48 | - <div style="display: inline-block;margin-left: 15px;"> | ||
| 49 | - <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 50 | - <input class="form-control" type="text" id="endDate" style="width: 120px;"/> | 44 | + <span class="item-label" style="width: 140px;">时间: </span> |
| 45 | + <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | ||
| 51 | </div> | 46 | </div> |
| 47 | + | ||
| 52 | <div style="display: inline-block;margin-left: 15px"> | 48 | <div style="display: inline-block;margin-left: 15px"> |
| 53 | <span class="item-label" style="width: 150px;">统计: </span> | 49 | <span class="item-label" style="width: 150px;">统计: </span> |
| 54 | </div> | 50 | </div> |
| @@ -101,26 +97,31 @@ | @@ -101,26 +97,31 @@ | ||
| 101 | locale : 'zh-cn' | 97 | locale : 'zh-cn' |
| 102 | }); | 98 | }); |
| 103 | 99 | ||
| 100 | + var fage=false; | ||
| 101 | + var xlList; | ||
| 104 | var obj = []; | 102 | var obj = []; |
| 105 | - $.get('/user/companyData', function(result){ | ||
| 106 | - obj = result; | ||
| 107 | - var options = ''; | ||
| 108 | - for(var i = 0; i < obj.length; i++){ | ||
| 109 | - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 110 | - } | ||
| 111 | - | ||
| 112 | - if(obj.length ==0){ | ||
| 113 | - $("#gsdmDiv_sing").css('display','none'); | ||
| 114 | - $('#fgsdmDiv_sing').css('display','none'); | ||
| 115 | - }else if(obj.length ==1){ | ||
| 116 | - $("#gsdmDiv_sing").css('display','none'); | ||
| 117 | - if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 118 | - $('#fgsdmDiv_sing').css('display','none'); | ||
| 119 | - } | ||
| 120 | - $('#gsdmSing').html(options); | ||
| 121 | - updateCompany(); | ||
| 122 | - }); | ||
| 123 | - | 103 | + |
| 104 | + | ||
| 105 | + $.get('/report/lineList',function(result){ | ||
| 106 | + xlList=result; | ||
| 107 | + $.get('/user/companyData', function(result){ | ||
| 108 | + obj = result; | ||
| 109 | + var options = ''; | ||
| 110 | + for(var i = 0; i < obj.length; i++){ | ||
| 111 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + if(obj.length ==0){ | ||
| 115 | + $("#gsdmDiv_sing").css('display','none'); | ||
| 116 | + }else if(obj.length ==1){ | ||
| 117 | + $("#gsdmDiv_sing").css('display','none'); | ||
| 118 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 119 | + $('#fgsdmDiv_sing').css('display','none'); | ||
| 120 | + } | ||
| 121 | + $('#gsdmSing').html(options); | ||
| 122 | + updateCompany(); | ||
| 123 | + }); | ||
| 124 | + }) | ||
| 124 | $("#gsdmSing").on("change",updateCompany); | 125 | $("#gsdmSing").on("change",updateCompany); |
| 125 | function updateCompany(){ | 126 | function updateCompany(){ |
| 126 | var company = $('#gsdmSing').val(); | 127 | var company = $('#gsdmSing').val(); |
| @@ -134,10 +135,10 @@ | @@ -134,10 +135,10 @@ | ||
| 134 | } | 135 | } |
| 135 | } | 136 | } |
| 136 | $('#fgsdmSing').html(options); | 137 | $('#fgsdmSing').html(options); |
| 138 | + initXl(); | ||
| 137 | } | 139 | } |
| 138 | 140 | ||
| 139 | - | ||
| 140 | - $.get('/basic/lineCode2Name',function(result){ | 141 | + /* $.get('/basic/lineCode2Name',function(result){ |
| 141 | var data=[]; | 142 | var data=[]; |
| 142 | 143 | ||
| 143 | for(var code in result){ | 144 | for(var code in result){ |
| @@ -145,19 +146,41 @@ | @@ -145,19 +146,41 @@ | ||
| 145 | } | 146 | } |
| 146 | initPinYinSelect2('#line',data,''); | 147 | initPinYinSelect2('#line',data,''); |
| 147 | 148 | ||
| 148 | - }) | 149 | + }) */ |
| 150 | + | ||
| 151 | + $("#fgsdmSing").on("change",initXl); | ||
| 152 | + function initXl(){ | ||
| 153 | + var data=[]; | ||
| 154 | + if(fage){ | ||
| 155 | + $("#line").select2("destroy").html(''); | ||
| 156 | + } | ||
| 157 | + var fgs=$('#fgsdmSing').val(); | ||
| 158 | + var gs=$('#gsdmSing').val(); | ||
| 159 | + for(var i=0;i<xlList.length;i++){ | ||
| 160 | + if(gs!=""){ | ||
| 161 | + if(fgs!=""){ | ||
| 162 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | ||
| 163 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 164 | + } | ||
| 165 | + }else{ | ||
| 166 | + if(xlList[i]["gsbm"]==gs){ | ||
| 167 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | + } | ||
| 172 | + initPinYinSelect2('#line',data,''); | ||
| 173 | + fage=true; | ||
| 174 | + } | ||
| 149 | 175 | ||
| 150 | 176 | ||
| 151 | $("#query").on("click",function(){ | 177 | $("#query").on("click",function(){ |
| 152 | var line = $("#line").val(); | 178 | var line = $("#line").val(); |
| 153 | var startDate = $("#startDate").val(); | 179 | var startDate = $("#startDate").val(); |
| 154 | - var endDate = $("#endDate").val(); | ||
| 155 | var lpName = $("#lpName").val(); | 180 | var lpName = $("#lpName").val(); |
| 156 | var gsdmSing = $("#gsdmSing").val(); | 181 | var gsdmSing = $("#gsdmSing").val(); |
| 157 | - var fgsdmSing = $("#fgsdmSing").val(); | ||
| 158 | - $post("/mcy_forms/singledata",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){ | ||
| 159 | - $("#sDate").text(startDate); | ||
| 160 | - $("#eDate").text(endDate); | 182 | + var fgsdmSing = $("#fgsdmSing").val(); var params = {}; |
| 183 | + $get("/mcy_forms/singledata",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,lpName:lpName},function(result){ | ||
| 161 | var temp = {}; | 184 | var temp = {}; |
| 162 | var today_account = 0; | 185 | var today_account = 0; |
| 163 | temp["line"] = $("#line").text(); | 186 | temp["line"] = $("#line").text(); |
| @@ -181,7 +204,7 @@ | @@ -181,7 +204,7 @@ | ||
| 181 | var lpName = $("#lpName").val(); | 204 | var lpName = $("#lpName").val(); |
| 182 | var gsdmSing = $("#gsdmSing").val(); | 205 | var gsdmSing = $("#gsdmSing").val(); |
| 183 | var fgsdmSing = $("#fgsdmSing").val(); | 206 | var fgsdmSing = $("#fgsdmSing").val(); |
| 184 | - $post('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){ | 207 | + $get('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){ |
| 185 | window.open("/downloadFile/download?fileName=路单数据"+moment(startDate).format("YYYYMMDD")); | 208 | window.open("/downloadFile/download?fileName=路单数据"+moment(startDate).format("YYYYMMDD")); |
| 186 | }); | 209 | }); |
| 187 | }); | 210 | }); |
| @@ -203,7 +226,7 @@ | @@ -203,7 +226,7 @@ | ||
| 203 | <td>{{obj.emptMileage}}</td> | 226 | <td>{{obj.emptMileage}}</td> |
| 204 | <td>{{obj.hyl}}</td> | 227 | <td>{{obj.hyl}}</td> |
| 205 | <td>{{obj.jzl}}</td> | 228 | <td>{{obj.jzl}}</td> |
| 206 | - <td> </td> | 229 | + <td>{{obj.unyyyl}}</td> |
| 207 | <td>{{obj.jhjl}}</td> | 230 | <td>{{obj.jhjl}}</td> |
| 208 | </tr> | 231 | </tr> |
| 209 | {{/each}} | 232 | {{/each}} |
src/main/resources/static/pages/mforms/vehicleloadings/vehicleloading.html
| @@ -64,7 +64,7 @@ | @@ -64,7 +64,7 @@ | ||
| 64 | <th>耗油量(不含非营业性用油)</th> | 64 | <th>耗油量(不含非营业性用油)</th> |
| 65 | <th>尿素</th> | 65 | <th>尿素</th> |
| 66 | <th>实际公里(含空放公里)</th> | 66 | <th>实际公里(含空放公里)</th> |
| 67 | - <th>非商业性用油</th> | 67 | + <th>非营业性用油</th> |
| 68 | <th>计划班次</th> | 68 | <th>计划班次</th> |
| 69 | <th>实际班次</th> | 69 | <th>实际班次</th> |
| 70 | </tr> | 70 | </tr> |
| @@ -89,26 +89,31 @@ | @@ -89,26 +89,31 @@ | ||
| 89 | format : 'YYYY-MM-DD', | 89 | format : 'YYYY-MM-DD', |
| 90 | locale : 'zh-cn' | 90 | locale : 'zh-cn' |
| 91 | }); | 91 | }); |
| 92 | + var fage=false; | ||
| 93 | + var xlList; | ||
| 94 | + var obj = []; | ||
| 92 | 95 | ||
| 93 | - $.get('/user/companyData', function(result){ | ||
| 94 | - obj = result; | ||
| 95 | - var options = ''; | ||
| 96 | - for(var i = 0; i < obj.length; i++){ | ||
| 97 | - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - if(obj.length ==0){ | ||
| 101 | - $("#gsdmDiv_vehic").css('display','none'); | ||
| 102 | - $('#fgsdmDiv_vehic').css('display','none'); | ||
| 103 | - }else if(obj.length ==1){ | ||
| 104 | - $("#gsdmDiv_vehic").css('display','none'); | ||
| 105 | - if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 106 | - $('#fgsdmDiv_vehic').css('display','none'); | ||
| 107 | - } | ||
| 108 | - $('#gsdmVehic').html(options); | ||
| 109 | - updateCompany(); | ||
| 110 | - }); | ||
| 111 | - | 96 | + |
| 97 | + $.get('/report/lineList',function(result){ | ||
| 98 | + xlList=result; | ||
| 99 | + $.get('/user/companyData', function(result){ | ||
| 100 | + obj = result; | ||
| 101 | + var options = ''; | ||
| 102 | + for(var i = 0; i < obj.length; i++){ | ||
| 103 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + if(obj.length ==0){ | ||
| 107 | + $("#gsdmDiv_vehic").css('display','none'); | ||
| 108 | + }else if(obj.length ==1){ | ||
| 109 | + $("#gsdmDiv_vehic").css('display','none'); | ||
| 110 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 111 | + $('#fgsdmDiv_vehic').css('display','none'); | ||
| 112 | + } | ||
| 113 | + $('#gsdmVehic').html(options); | ||
| 114 | + updateCompany(); | ||
| 115 | + }); | ||
| 116 | + }) | ||
| 112 | $("#gsdmVehic").on("change",updateCompany); | 117 | $("#gsdmVehic").on("change",updateCompany); |
| 113 | function updateCompany(){ | 118 | function updateCompany(){ |
| 114 | var company = $('#gsdmVehic').val(); | 119 | var company = $('#gsdmVehic').val(); |
| @@ -122,9 +127,10 @@ | @@ -122,9 +127,10 @@ | ||
| 122 | } | 127 | } |
| 123 | } | 128 | } |
| 124 | $('#fgsdmVehic').html(options); | 129 | $('#fgsdmVehic').html(options); |
| 130 | + initXl(); | ||
| 125 | } | 131 | } |
| 126 | - | ||
| 127 | - $.get('/basic/lineCode2Name',function(result){ | 132 | + |
| 133 | + /* $.get('/basic/lineCode2Name',function(result){ | ||
| 128 | var data=[]; | 134 | var data=[]; |
| 129 | 135 | ||
| 130 | for(var code in result){ | 136 | for(var code in result){ |
| @@ -132,9 +138,33 @@ | @@ -132,9 +138,33 @@ | ||
| 132 | } | 138 | } |
| 133 | initPinYinSelect2('#line',data,''); | 139 | initPinYinSelect2('#line',data,''); |
| 134 | 140 | ||
| 135 | - }) | 141 | + }) */ |
| 142 | + | ||
| 143 | + $("#fgsdmVehic").on("change",initXl); | ||
| 144 | + function initXl(){ | ||
| 145 | + var data=[]; | ||
| 146 | + if(fage){ | ||
| 147 | + $("#line").select2("destroy").html(''); | ||
| 148 | + } | ||
| 149 | + var fgs=$('#fgsdmVehic').val(); | ||
| 150 | + var gs=$('#gsdmVehic').val(); | ||
| 151 | + for(var i=0;i<xlList.length;i++){ | ||
| 152 | + if(gs!=""){ | ||
| 153 | + if(fgs!=""){ | ||
| 154 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | ||
| 155 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 156 | + } | ||
| 157 | + }else{ | ||
| 158 | + if(xlList[i]["gsbm"]==gs){ | ||
| 159 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 160 | + } | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + } | ||
| 164 | + initPinYinSelect2('#line',data,''); | ||
| 165 | + fage=true; | ||
| 166 | + } | ||
| 136 | 167 | ||
| 137 | - | ||
| 138 | var line ; | 168 | var line ; |
| 139 | var date ; | 169 | var date ; |
| 140 | var gsdmVehic ; | 170 | var gsdmVehic ; |
| @@ -142,9 +172,9 @@ | @@ -142,9 +172,9 @@ | ||
| 142 | $("#query").on("click",function(){ | 172 | $("#query").on("click",function(){ |
| 143 | line = $("#line").val(); | 173 | line = $("#line").val(); |
| 144 | date = $("#date").val(); | 174 | date = $("#date").val(); |
| 145 | - gsdmVehic = $("#gsdmVehic").val(); | ||
| 146 | - fgsdmVehic = $("#fgsdmVehic").val(); | ||
| 147 | - $post('/mcy_forms/vehicleloading',{line:line,data:date, gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic},function(result){ | 175 | +// gsdmVehic = $("#gsdmVehic").val(); |
| 176 | +// fgsdmVehic = $("#fgsdmVehic").val(); | ||
| 177 | + $get('/mcy_forms/vehicleloading',{line:line,data:date},function(result){ | ||
| 148 | // 把数据填充到模版中 | 178 | // 把数据填充到模版中 |
| 149 | var tbodyHtml = template('vehicleloading',{list:result}); | 179 | var tbodyHtml = template('vehicleloading',{list:result}); |
| 150 | // 把渲染好的模版html文本追加到表格中 | 180 | // 把渲染好的模版html文本追加到表格中 |
| @@ -157,7 +187,7 @@ | @@ -157,7 +187,7 @@ | ||
| 157 | date = $("#date").val(); | 187 | date = $("#date").val(); |
| 158 | gsdmVehic = $("#gsdmVehic").val(); | 188 | gsdmVehic = $("#gsdmVehic").val(); |
| 159 | fgsdmVehic = $("#fgsdmVehic").val(); | 189 | fgsdmVehic = $("#fgsdmVehic").val(); |
| 160 | - $post('/mcy_export/vehicleloadingExport',{line:line,data:date,gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic,type:'export'},function(result){ | 190 | + $get('/mcy_export/vehicleloadingExport',{line:line,data:date,gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic,type:'export'},function(result){ |
| 161 | window.open("/downloadFile/download?fileName=车辆加注"+moment(date).format("YYYYMMDD")); | 191 | window.open("/downloadFile/download?fileName=车辆加注"+moment(date).format("YYYYMMDD")); |
| 162 | }); | 192 | }); |
| 163 | }); | 193 | }); |
| @@ -173,9 +203,9 @@ | @@ -173,9 +203,9 @@ | ||
| 173 | <td>{{obj.clzbh}}</td> | 203 | <td>{{obj.clzbh}}</td> |
| 174 | <td>{{obj.jzl}}</td> | 204 | <td>{{obj.jzl}}</td> |
| 175 | <td>{{obj.hyl}}</td> | 205 | <td>{{obj.hyl}}</td> |
| 176 | - <td> </td> | 206 | + <td>{{obj.ls}}</td> |
| 177 | <td>{{obj.jhlc}}</td> | 207 | <td>{{obj.jhlc}}</td> |
| 178 | - <td> </td> | 208 | + <td>{{obj.unyyyl}}</td> |
| 179 | <td>{{obj.jhbc}}</td> | 209 | <td>{{obj.jhbc}}</td> |
| 180 | <td>{{obj.sjbc}}</td> | 210 | <td>{{obj.sjbc}}</td> |
| 181 | </tr> | 211 | </tr> |
src/main/resources/static/pages/oil/list_ph.html
src/main/resources/static/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css
| 1 | -/* perfect-scrollbar v0.6.16 */ | ||
| 2 | -.ps-container { | ||
| 3 | - -ms-touch-action: auto; | ||
| 4 | - touch-action: auto; | ||
| 5 | - overflow: hidden !important; | ||
| 6 | - -ms-overflow-style: none; } | ||
| 7 | - @supports (-ms-overflow-style: none) { | ||
| 8 | - .ps-container { | ||
| 9 | - overflow: auto !important; } } | ||
| 10 | - @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { | ||
| 11 | - .ps-container { | ||
| 12 | - overflow: auto !important; } } | ||
| 13 | - .ps-container.ps-active-x > .ps-scrollbar-x-rail, | ||
| 14 | - .ps-container.ps-active-y > .ps-scrollbar-y-rail { | ||
| 15 | - display: block; | ||
| 16 | - background-color: transparent; } | ||
| 17 | - .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail { | ||
| 18 | - background-color: #eee; | ||
| 19 | - opacity: 0.9; } | ||
| 20 | - .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x { | ||
| 21 | - background-color: #999; | ||
| 22 | - height: 11px; } | ||
| 23 | - .ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail { | ||
| 24 | - background-color: #eee; | ||
| 25 | - opacity: 0.9; } | ||
| 26 | - .ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y { | ||
| 27 | - background-color: #999; | ||
| 28 | - width: 11px; } | ||
| 29 | - .ps-container > .ps-scrollbar-x-rail { | ||
| 30 | - display: none; | ||
| 31 | - position: absolute; | ||
| 32 | - /* please don't change 'position' */ | ||
| 33 | - opacity: 0; | ||
| 34 | - -webkit-transition: background-color .2s linear, opacity .2s linear; | ||
| 35 | - -o-transition: background-color .2s linear, opacity .2s linear; | ||
| 36 | - -moz-transition: background-color .2s linear, opacity .2s linear; | ||
| 37 | - transition: background-color .2s linear, opacity .2s linear; | ||
| 38 | - bottom: 0px; | ||
| 39 | - /* there must be 'bottom' for ps-scrollbar-x-rail */ | ||
| 40 | - height: 15px; } | ||
| 41 | - .ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x { | ||
| 42 | - position: absolute; | ||
| 43 | - /* please don't change 'position' */ | ||
| 44 | - background-color: #aaa; | ||
| 45 | - -webkit-border-radius: 6px; | ||
| 46 | - -moz-border-radius: 6px; | ||
| 47 | - border-radius: 6px; | ||
| 48 | - -webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out; | ||
| 49 | - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out; | ||
| 50 | - -o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out; | ||
| 51 | - -moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out; | ||
| 52 | - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out; | ||
| 53 | - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out; | ||
| 54 | - bottom: 2px; | ||
| 55 | - /* there must be 'bottom' for ps-scrollbar-x */ | ||
| 56 | - height: 6px; } | ||
| 57 | - .ps-container > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x, .ps-container > .ps-scrollbar-x-rail:active > .ps-scrollbar-x { | ||
| 58 | - height: 11px; } | ||
| 59 | - .ps-container > .ps-scrollbar-y-rail { | ||
| 60 | - display: none; | ||
| 61 | - position: absolute; | ||
| 62 | - /* please don't change 'position' */ | ||
| 63 | - opacity: 0; | ||
| 64 | - -webkit-transition: background-color .2s linear, opacity .2s linear; | ||
| 65 | - -o-transition: background-color .2s linear, opacity .2s linear; | ||
| 66 | - -moz-transition: background-color .2s linear, opacity .2s linear; | ||
| 67 | - transition: background-color .2s linear, opacity .2s linear; | ||
| 68 | - right: 0; | ||
| 69 | - /* there must be 'right' for ps-scrollbar-y-rail */ | ||
| 70 | - width: 15px; } | ||
| 71 | - .ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y { | ||
| 72 | - position: absolute; | ||
| 73 | - /* please don't change 'position' */ | ||
| 74 | - background-color: #aaa; | ||
| 75 | - -webkit-border-radius: 6px; | ||
| 76 | - -moz-border-radius: 6px; | ||
| 77 | - border-radius: 6px; | ||
| 78 | - -webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out; | ||
| 79 | - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out; | ||
| 80 | - -o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out; | ||
| 81 | - -moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out; | ||
| 82 | - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out; | ||
| 83 | - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out; | ||
| 84 | - right: 2px; | ||
| 85 | - /* there must be 'right' for ps-scrollbar-y */ | ||
| 86 | - width: 6px; } | ||
| 87 | - .ps-container > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y, .ps-container > .ps-scrollbar-y-rail:active > .ps-scrollbar-y { | ||
| 88 | - width: 11px; } | ||
| 89 | - .ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail { | ||
| 90 | - background-color: #eee; | ||
| 91 | - opacity: 0.9; } | ||
| 92 | - .ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x { | ||
| 93 | - background-color: #999; | ||
| 94 | - height: 11px; } | ||
| 95 | - .ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail { | ||
| 96 | - background-color: #eee; | ||
| 97 | - opacity: 0.9; } | ||
| 98 | - .ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y { | ||
| 99 | - background-color: #999; | ||
| 100 | - width: 11px; } | ||
| 101 | - .ps-container:hover > .ps-scrollbar-x-rail, | ||
| 102 | - .ps-container:hover > .ps-scrollbar-y-rail { | ||
| 103 | - opacity: 0.6; } | ||
| 104 | - .ps-container:hover > .ps-scrollbar-x-rail:hover { | ||
| 105 | - background-color: #eee; | ||
| 106 | - opacity: 0.9; } | ||
| 107 | - .ps-container:hover > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x { | ||
| 108 | - background-color: #999; } | ||
| 109 | - .ps-container:hover > .ps-scrollbar-y-rail:hover { | ||
| 110 | - background-color: #eee; | ||
| 111 | - opacity: 0.9; } | ||
| 112 | - .ps-container:hover > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y { | ||
| 113 | - background-color: #999; } | 1 | +/* perfect-scrollbar v0.6.16 */ |
| 2 | +.ps-container { | ||
| 3 | + -ms-touch-action: auto; | ||
| 4 | + touch-action: auto; | ||
| 5 | + overflow: hidden !important; | ||
| 6 | + -ms-overflow-style: none; } | ||
| 7 | + @supports (-ms-overflow-style: none) { | ||
| 8 | + .ps-container { | ||
| 9 | + overflow: auto !important; } } | ||
| 10 | + @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { | ||
| 11 | + .ps-container { | ||
| 12 | + overflow: auto !important; } } | ||
| 13 | + .ps-container.ps-active-x > .ps-scrollbar-x-rail, | ||
| 14 | + .ps-container.ps-active-y > .ps-scrollbar-y-rail { | ||
| 15 | + display: block; | ||
| 16 | + background-color: transparent; } | ||
| 17 | + .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail { | ||
| 18 | + background-color: #eee; | ||
| 19 | + opacity: 0.9; } | ||
| 20 | + .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x { | ||
| 21 | + background-color: #999; | ||
| 22 | + height: 11px; } | ||
| 23 | + .ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail { | ||
| 24 | + background-color: #eee; | ||
| 25 | + opacity: 0.9; } | ||
| 26 | + .ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y { | ||
| 27 | + background-color: #999; | ||
| 28 | + width: 11px; } | ||
| 29 | + .ps-container > .ps-scrollbar-x-rail { | ||
| 30 | + display: none; | ||
| 31 | + position: absolute; | ||
| 32 | + /* please don't change 'position' */ | ||
| 33 | + opacity: 0; | ||
| 34 | + -webkit-transition: background-color .2s linear, opacity .2s linear; | ||
| 35 | + -o-transition: background-color .2s linear, opacity .2s linear; | ||
| 36 | + -moz-transition: background-color .2s linear, opacity .2s linear; | ||
| 37 | + transition: background-color .2s linear, opacity .2s linear; | ||
| 38 | + bottom: 0px; | ||
| 39 | + /* there must be 'bottom' for ps-scrollbar-x-rail */ | ||
| 40 | + height: 15px; } | ||
| 41 | + .ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x { | ||
| 42 | + position: absolute; | ||
| 43 | + /* please don't change 'position' */ | ||
| 44 | + background-color: #aaa; | ||
| 45 | + -webkit-border-radius: 6px; | ||
| 46 | + -moz-border-radius: 6px; | ||
| 47 | + border-radius: 6px; | ||
| 48 | + -webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out; | ||
| 49 | + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out; | ||
| 50 | + -o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out; | ||
| 51 | + -moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out; | ||
| 52 | + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out; | ||
| 53 | + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out; | ||
| 54 | + bottom: 2px; | ||
| 55 | + /* there must be 'bottom' for ps-scrollbar-x */ | ||
| 56 | + height: 6px; } | ||
| 57 | + .ps-container > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x, .ps-container > .ps-scrollbar-x-rail:active > .ps-scrollbar-x { | ||
| 58 | + height: 11px; } | ||
| 59 | + .ps-container > .ps-scrollbar-y-rail { | ||
| 60 | + display: none; | ||
| 61 | + position: absolute; | ||
| 62 | + /* please don't change 'position' */ | ||
| 63 | + opacity: 0; | ||
| 64 | + -webkit-transition: background-color .2s linear, opacity .2s linear; | ||
| 65 | + -o-transition: background-color .2s linear, opacity .2s linear; | ||
| 66 | + -moz-transition: background-color .2s linear, opacity .2s linear; | ||
| 67 | + transition: background-color .2s linear, opacity .2s linear; | ||
| 68 | + right: 0; | ||
| 69 | + /* there must be 'right' for ps-scrollbar-y-rail */ | ||
| 70 | + width: 15px; } | ||
| 71 | + .ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y { | ||
| 72 | + position: absolute; | ||
| 73 | + /* please don't change 'position' */ | ||
| 74 | + background-color: #aaa; | ||
| 75 | + -webkit-border-radius: 6px; | ||
| 76 | + -moz-border-radius: 6px; | ||
| 77 | + border-radius: 6px; | ||
| 78 | + -webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out; | ||
| 79 | + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out; | ||
| 80 | + -o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out; | ||
| 81 | + -moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out; | ||
| 82 | + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out; | ||
| 83 | + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out; | ||
| 84 | + right: 2px; | ||
| 85 | + /* there must be 'right' for ps-scrollbar-y */ | ||
| 86 | + width: 6px; } | ||
| 87 | + .ps-container > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y, .ps-container > .ps-scrollbar-y-rail:active > .ps-scrollbar-y { | ||
| 88 | + width: 11px; } | ||
| 89 | + .ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail { | ||
| 90 | + background-color: #eee; | ||
| 91 | + opacity: 0.9; } | ||
| 92 | + .ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x { | ||
| 93 | + background-color: #999; | ||
| 94 | + height: 11px; } | ||
| 95 | + .ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail { | ||
| 96 | + background-color: #eee; | ||
| 97 | + opacity: 0.9; } | ||
| 98 | + .ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y { | ||
| 99 | + background-color: #999; | ||
| 100 | + width: 11px; } | ||
| 101 | + .ps-container:hover > .ps-scrollbar-x-rail, | ||
| 102 | + .ps-container:hover > .ps-scrollbar-y-rail { | ||
| 103 | + opacity: 0.6; } | ||
| 104 | + .ps-container:hover > .ps-scrollbar-x-rail:hover { | ||
| 105 | + background-color: #eee; | ||
| 106 | + opacity: 0.9; } | ||
| 107 | + .ps-container:hover > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x { | ||
| 108 | + background-color: #999; } | ||
| 109 | + .ps-container:hover > .ps-scrollbar-y-rail:hover { | ||
| 110 | + background-color: #eee; | ||
| 111 | + opacity: 0.9; } | ||
| 112 | + .ps-container:hover > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y { | ||
| 113 | + background-color: #999; } |