Commit a2d14a12a3c0507661b375ac989b4d46f80147f2
Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang
Showing
16 changed files
with
487 additions
and
489 deletions
src/main/java/com/bsth/controller/forms/ExportController.java
| ... | ... | @@ -303,12 +303,10 @@ public class ExportController { |
| 303 | 303 | m.put("fssj", l.getFssj()); |
| 304 | 304 | m.put("xgsj", l.getXgsj()); |
| 305 | 305 | m.put("pcch", l.getPcch()); |
| 306 | - m.put("pcry", l.getPcry()); | |
| 307 | - m.put("jhch", l.getJhch()); | |
| 308 | - m.put("jhgh", l.getJhgh()); | |
| 309 | 306 | m.put("sjch", l.getSjch()); |
| 307 | + m.put("fcgh", l.getPcry()); | |
| 310 | 308 | m.put("sjgh", l.getSjgh()); |
| 311 | - m.put("yy", l.getYy()); | |
| 309 | + m.put("yy", l.getYy()==null?"":l.getYy()); | |
| 312 | 310 | m.put("xgr", l.getXgr()); |
| 313 | 311 | resList.add(m); |
| 314 | 312 | } | ... | ... |
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
| ... | ... | @@ -66,7 +66,7 @@ public class MCY_FormsController { |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // 换人换车情况统计表 |
| 69 | - @RequestMapping(value = "/changetochange", method = RequestMethod.POST) | |
| 69 | + @RequestMapping(value = "/changetochange", method = RequestMethod.GET) | |
| 70 | 70 | public List<Changetochange> changetochange(@RequestParam Map<String, Object> map) { |
| 71 | 71 | |
| 72 | 72 | return formsService.changetochange(map); | ... | ... |
src/main/java/com/bsth/data/car_out_info/CarOutInfoHandler.java
| 1 | 1 | package com.bsth.data.car_out_info; |
| 2 | 2 | |
| 3 | -import com.bsth.Application; | |
| 4 | 3 | import com.bsth.data.BasicData; |
| 5 | 4 | import com.bsth.data.schedule.DayOfSchedule; |
| 6 | 5 | import com.bsth.data.schedule.ScheduleComparator; |
| ... | ... | @@ -24,7 +23,6 @@ import org.springframework.transaction.support.DefaultTransactionDefinition; |
| 24 | 23 | import java.sql.PreparedStatement; |
| 25 | 24 | import java.sql.SQLException; |
| 26 | 25 | import java.util.*; |
| 27 | -import java.util.concurrent.TimeUnit; | |
| 28 | 26 | |
| 29 | 27 | /** |
| 30 | 28 | * 发车信息表处理程序 |
| ... | ... | @@ -208,7 +206,7 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo { |
| 208 | 206 | bcTypeMap.put("venting", "直放"); |
| 209 | 207 | bcTypeMap.put("major", "放站"); |
| 210 | 208 | bcTypeMap.put("ldks", "两点间空驶"); |
| 211 | - Application.mainServices.scheduleWithFixedDelay(updateInfoThread, 60, 40, TimeUnit.SECONDS); | |
| 209 | + //Application.mainServices.scheduleWithFixedDelay(updateInfoThread, 60, 40, TimeUnit.SECONDS); | |
| 212 | 210 | } |
| 213 | 211 | |
| 214 | 212 | @Component | ... | ... |
src/main/java/com/bsth/data/directive/DirectivesPstThread.java
| 1 | 1 | package com.bsth.data.directive; |
| 2 | 2 | |
| 3 | +import com.bsth.data.schedule.DayOfSchedule; | |
| 3 | 4 | import com.bsth.entity.directive.D60; |
| 4 | 5 | import com.bsth.entity.directive.D64; |
| 5 | 6 | import com.bsth.entity.directive.Directive; |
| 7 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 6 | 8 | import com.bsth.repository.directive.D60Repository; |
| 7 | 9 | import com.bsth.repository.directive.D64Repository; |
| 8 | 10 | import org.slf4j.Logger; |
| ... | ... | @@ -27,6 +29,9 @@ public class DirectivesPstThread extends Thread { |
| 27 | 29 | @Autowired |
| 28 | 30 | D64Repository d64Repository; |
| 29 | 31 | |
| 32 | + @Autowired | |
| 33 | + DayOfSchedule dayOfSchedule; | |
| 34 | + | |
| 30 | 35 | @Override |
| 31 | 36 | public void run() { |
| 32 | 37 | LinkedList<Directive> list = DayOfDirectives.pstDirectives; |
| ... | ... | @@ -37,7 +42,14 @@ public class DirectivesPstThread extends Thread { |
| 37 | 42 | directive = list.poll(); |
| 38 | 43 | |
| 39 | 44 | if (directive instanceof D60) { |
| 40 | - d60Repository.save((D60) directive); | |
| 45 | + D60 d60 = (D60) directive; | |
| 46 | + if(d60.isDispatch()){ | |
| 47 | + ScheduleRealInfo sch = d60.getSch(); | |
| 48 | + //如果关联的班次已经不存在了,放弃入库 | |
| 49 | + if(dayOfSchedule.get(sch.getId()) == null) | |
| 50 | + continue; | |
| 51 | + } | |
| 52 | + d60Repository.save(d60); | |
| 41 | 53 | } |
| 42 | 54 | |
| 43 | 55 | if (directive instanceof D64) { | ... | ... |
src/main/java/com/bsth/data/gpsdata/thread/ThreadPollMonitor.java
| 1 | -package com.bsth.data.gpsdata.thread; | |
| 2 | - | |
| 3 | -import com.bsth.data.gpsdata.arrival.GpsRealAnalyse; | |
| 4 | -import org.springframework.stereotype.Component; | |
| 5 | - | |
| 6 | -/** | |
| 7 | - * 线程池监听 | |
| 8 | - * Created by panzhao on 2017/5/10. | |
| 9 | - */ | |
| 10 | -@Component | |
| 11 | -public class ThreadPollMonitor extends Thread{ | |
| 12 | - | |
| 13 | - @Override | |
| 14 | - public void run() { | |
| 15 | - long t = System.currentTimeMillis(); | |
| 16 | - | |
| 17 | - if(t - GpsRealAnalyse.st > 3000 * 10){ | |
| 18 | - GpsRealAnalyse.shutdown(); | |
| 19 | - } | |
| 20 | - } | |
| 21 | -} | |
| 1 | +package com.bsth.data.gpsdata.thread; | |
| 2 | + | |
| 3 | +import com.bsth.data.gpsdata.arrival.GpsRealAnalyse; | |
| 4 | +import org.springframework.stereotype.Component; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * 线程池监听 | |
| 8 | + * Created by panzhao on 2017/5/10. | |
| 9 | + */ | |
| 10 | +@Component | |
| 11 | +public class ThreadPollMonitor extends Thread{ | |
| 12 | + | |
| 13 | + @Override | |
| 14 | + public void run() { | |
| 15 | + long t = System.currentTimeMillis(); | |
| 16 | + | |
| 17 | + if(t - GpsRealAnalyse.st > 3000 * 10){ | |
| 18 | + GpsRealAnalyse.shutdown(); | |
| 19 | + } | |
| 20 | + } | |
| 21 | +} | ... | ... |
src/main/java/com/bsth/entity/directive/D60.java
| 1 | 1 | package com.bsth.entity.directive; |
| 2 | 2 | |
| 3 | -import javax.persistence.Embeddable; | |
| 4 | -import javax.persistence.Entity; | |
| 5 | -import javax.persistence.FetchType; | |
| 6 | -import javax.persistence.GeneratedValue; | |
| 7 | -import javax.persistence.Id; | |
| 8 | -import javax.persistence.ManyToOne; | |
| 9 | -import javax.persistence.NamedAttributeNode; | |
| 10 | -import javax.persistence.NamedEntityGraph; | |
| 11 | -import javax.persistence.NamedEntityGraphs; | |
| 12 | -import javax.persistence.Table; | |
| 13 | -import javax.persistence.Transient; | |
| 14 | - | |
| 15 | 3 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 16 | 4 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 17 | 5 | |
| 6 | +import javax.persistence.*; | |
| 7 | + | |
| 18 | 8 | |
| 19 | 9 | /** |
| 20 | 10 | * @author PanZhao |
| ... | ... | @@ -75,7 +65,7 @@ public class D60 extends Directive { |
| 75 | 65 | * 相关联的班次 |
| 76 | 66 | */ |
| 77 | 67 | @JsonIgnore |
| 78 | - @ManyToOne(fetch = FetchType.LAZY) | |
| 68 | + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH) | |
| 79 | 69 | private ScheduleRealInfo sch; |
| 80 | 70 | |
| 81 | 71 | public Long getReply46Time() { | ... | ... |
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
| ... | ... | @@ -132,14 +132,14 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen |
| 132 | 132 | // 发送指令 |
| 133 | 133 | int code = GatewayHttpUtils.postJson(jObj.toJSONString()); |
| 134 | 134 | |
| 135 | - // 添加到缓存,等待入库 | |
| 136 | 135 | d60.setDispatch(true); |
| 137 | 136 | d60.setSch(sch); |
| 138 | 137 | d60.setHttpCode(code); |
| 139 | - dayOfDirectives.put60(d60); | |
| 140 | 138 | |
| 141 | 139 | if (code == 0) { |
| 142 | 140 | sch.setDirectiveState(60); |
| 141 | + // 添加到缓存,延迟入库 | |
| 142 | + dayOfDirectives.put60(d60); | |
| 143 | 143 | // 通知页面 |
| 144 | 144 | sendD60ToPage(sch); |
| 145 | 145 | } | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| ... | ... | @@ -407,7 +407,19 @@ public class FormsServiceImpl implements FormsService { |
| 407 | 407 | |
| 408 | 408 | rq = rq2 + "-" + rq3; |
| 409 | 409 | |
| 410 | - String sql = " select c.*,l.line_code from bsth_c_chtoch c LEFT JOIN bsth_c_line l on c.xl=l.name WHERE 1=1 "; | |
| 410 | + String line=""; | |
| 411 | + if(map.get("line")!=null){ | |
| 412 | + line=map.get("line").toString().trim(); | |
| 413 | + } | |
| 414 | + String gs=""; | |
| 415 | + if(map.get("gsdm")!=null){ | |
| 416 | + gs=map.get("gsdm").toString(); | |
| 417 | + } | |
| 418 | + String fgs=""; | |
| 419 | + if(map.get("fgsdm")!=null){ | |
| 420 | + fgs =map.get("fgsdm").toString(); | |
| 421 | + } | |
| 422 | + /*String sql = " select c.*,l.line_code from bsth_c_chtoch c LEFT JOIN bsth_c_line l on c.xl=l.name WHERE 1=1 "; | |
| 411 | 423 | if (!map.get("startDate").toString().equals(" ") && !map.get("endDate").toString().equals(" ")) { |
| 412 | 424 | sql += "and DATE_FORMAT( c.rq,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" |
| 413 | 425 | + map.get("endDate").toString() + "'"; |
| ... | ... | @@ -419,18 +431,28 @@ public class FormsServiceImpl implements FormsService { |
| 419 | 431 | sql += " and c.pcch!=c.pcry"; |
| 420 | 432 | } else if (map.get("sel").equals("1")) { |
| 421 | 433 | sql += " and c.jhgh!=c.sjgh"; |
| 422 | - } | |
| 434 | + }*/ | |
| 423 | 435 | |
| 436 | + String sql="select * from bsth_c_chtoch where rq BETWEEN '"+ map.get("startDate").toString()+"' " | |
| 437 | + + " and '"+map.get("endDate").toString() +"'"; | |
| 438 | + | |
| 439 | + if(!line.equals("")){ | |
| 440 | + sql +=" and xl= '"+line+"'"; | |
| 441 | + }else{ | |
| 442 | + sql += " and gs= '"+gs+"' and fgs= '"+fgs+"'"; | |
| 443 | + } | |
| 444 | + | |
| 445 | + sql +=" order by rq"; | |
| 424 | 446 | List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() { |
| 425 | 447 | |
| 426 | 448 | |
| 427 | 449 | @Override |
| 428 | 450 | public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 429 | 451 | Changetochange chan = new Changetochange(); |
| 430 | - chan.setRq(rq); | |
| 431 | - chan.setGs(arg0.getString("gs")); | |
| 432 | - chan.setFgs(arg0.getString("fgs")); | |
| 433 | - chan.setXl(arg0.getString("xl")); | |
| 452 | + chan.setRq(arg0.getString("rq")); | |
| 453 | + chan.setGs(BasicData.businessCodeNameMap.get(arg0.getString("gs"))); | |
| 454 | + chan.setFgs(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs")+"_"+arg0.getString("gs"))); | |
| 455 | + chan.setXl(BasicData.lineCode2NameMap.get(arg0.getString("xl"))); | |
| 434 | 456 | chan.setLp(arg0.getString("lp")); |
| 435 | 457 | chan.setFssj(arg0.getString("fssj")); |
| 436 | 458 | chan.setXgsj(arg0.getString("xgsj")); | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
| ... | ... | @@ -51,11 +51,11 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon |
| 51 | 51 | |
| 52 | 52 | if(StringUtils.isEmpty(t.getEndStationName())) |
| 53 | 53 | t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix)); |
| 54 | + if(t.getDestroyReason() == null) | |
| 55 | + t.setDestroyReason(""); | |
| 54 | 56 | //先持久化子任务 |
| 55 | 57 | rs = super.save(t); |
| 56 | 58 | //关联主任务 |
| 57 | - System.out.println("schschsch: " + sch); | |
| 58 | - System.out.println("sch.getcTasks()sch.getcTasks(): " + sch.getcTasks()); | |
| 59 | 59 | sch.getcTasks().add(t); |
| 60 | 60 | dayOfSchedule.save(sch); |
| 61 | 61 | //直接持久化 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -41,6 +41,7 @@ import com.bsth.repository.schedule.EmployeeConfigInfoRepository; |
| 41 | 41 | import com.bsth.repository.schedule.GuideboardInfoRepository; |
| 42 | 42 | import com.bsth.security.util.SecurityUtils; |
| 43 | 43 | import com.bsth.service.SectionRouteService; |
| 44 | +import com.bsth.service.directive.DirectiveService; | |
| 44 | 45 | import com.bsth.service.impl.BaseServiceImpl; |
| 45 | 46 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 46 | 47 | import com.bsth.service.report.CulateMileageService; |
| ... | ... | @@ -89,7 +90,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 89 | 90 | |
| 90 | 91 | @Autowired |
| 91 | 92 | SectionRouteService sectionRouteService; |
| 92 | - | |
| 93 | + | |
| 93 | 94 | @Autowired |
| 94 | 95 | CulateMileageService culateMieageService; |
| 95 | 96 | |
| ... | ... | @@ -125,16 +126,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 125 | 126 | |
| 126 | 127 | @Autowired |
| 127 | 128 | YlbRepository ylbRepository; |
| 128 | - | |
| 129 | + | |
| 129 | 130 | @Autowired |
| 130 | 131 | ReportService reposrService; |
| 131 | - | |
| 132 | + | |
| 132 | 133 | @Autowired |
| 133 | 134 | CulateMileageService culateService; |
| 134 | 135 | |
| 135 | 136 | @Autowired |
| 136 | 137 | SchModifyLog schModifyLog; |
| 137 | 138 | |
| 139 | + @Autowired | |
| 140 | + DirectiveService directiveService; | |
| 141 | + | |
| 138 | 142 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 139 | 143 | |
| 140 | 144 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| ... | ... | @@ -620,6 +624,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 620 | 624 | //数据库删除 |
| 621 | 625 | rs = super.delete(id); |
| 622 | 626 | if(rs.get("status").equals(ResponseCode.SUCCESS)){ |
| 627 | + /*ScheduleRealInfo temp = super.findById(id); | |
| 628 | + if(temp != null){ | |
| 629 | + rs.put("status", ResponseCode.ERROR); | |
| 630 | + rs.put("msg", "删除失败,请重试!"); | |
| 631 | + return rs; | |
| 632 | + }*/ | |
| 633 | + | |
| 623 | 634 | dayOfSchedule.delete(sch); |
| 624 | 635 | //更新起点应到时间 |
| 625 | 636 | List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch); |
| ... | ... | @@ -729,39 +740,39 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 729 | 740 | List<ScheduleRealInfo> listNew = new ArrayList<ScheduleRealInfo>(); |
| 730 | 741 | Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); |
| 731 | 742 | // if (px.equals("desc")) { |
| 732 | - int zt = 0; | |
| 733 | - for (int l = 0; l < 2; l++) { | |
| 734 | - for (int i = 0; i < list.size(); i++) { | |
| 735 | - ScheduleRealInfo t = list.get(i); | |
| 736 | - if (t.getLpName().indexOf("+") != -1) { | |
| 737 | - if (zt == 0) { | |
| 738 | - listNew.add(t); | |
| 739 | - } | |
| 740 | - } else if (pattern.matcher(t.getLpName()).matches()) { | |
| 741 | - if (zt == 1) { | |
| 742 | - listNew.add(t); | |
| 743 | - } | |
| 744 | - } else { | |
| 743 | + int zt = 0; | |
| 744 | + for (int l = 0; l < 2; l++) { | |
| 745 | + for (int i = 0; i < list.size(); i++) { | |
| 746 | + ScheduleRealInfo t = list.get(i); | |
| 747 | + if (t.getLpName().indexOf("+") != -1) { | |
| 748 | + if (zt == 0) { | |
| 749 | + listNew.add(t); | |
| 750 | + } | |
| 751 | + } else if (pattern.matcher(t.getLpName()).matches()) { | |
| 752 | + if (zt == 1) { | |
| 753 | + listNew.add(t); | |
| 754 | + } | |
| 755 | + } else { | |
| 745 | 756 | // if (zt == 2) { |
| 746 | 757 | // listNew.add(t); |
| 747 | 758 | // } |
| 748 | - continue; | |
| 749 | - } | |
| 759 | + continue; | |
| 750 | 760 | } |
| 751 | - zt++; | |
| 752 | 761 | } |
| 753 | - | |
| 754 | - Collections.sort(list, new ComparableLp()); | |
| 755 | - for (int i = 0; i < list.size(); i++) { | |
| 756 | - ScheduleRealInfo t = list.get(i); | |
| 757 | - if (t.getLpName().indexOf("+") != -1) { | |
| 758 | - continue; | |
| 759 | - } else if (pattern.matcher(t.getLpName()).matches()) { | |
| 760 | - continue; | |
| 761 | - } else { | |
| 762 | - listNew.add(t); | |
| 763 | - } | |
| 764 | - } | |
| 762 | + zt++; | |
| 763 | + } | |
| 764 | + | |
| 765 | + Collections.sort(list, new ComparableLp()); | |
| 766 | + for (int i = 0; i < list.size(); i++) { | |
| 767 | + ScheduleRealInfo t = list.get(i); | |
| 768 | + if (t.getLpName().indexOf("+") != -1) { | |
| 769 | + continue; | |
| 770 | + } else if (pattern.matcher(t.getLpName()).matches()) { | |
| 771 | + continue; | |
| 772 | + } else { | |
| 773 | + listNew.add(t); | |
| 774 | + } | |
| 775 | + } | |
| 765 | 776 | /*} else { |
| 766 | 777 | int zt = 0; |
| 767 | 778 | for (int l = 0; l < 3; l++) { |
| ... | ... | @@ -804,17 +815,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 804 | 815 | List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); |
| 805 | 816 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); |
| 806 | 817 | // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); |
| 807 | - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 808 | - for (int i = 0; i < scheduleRealInfos.size(); i++) { | |
| 809 | - ScheduleRealInfo s=scheduleRealInfos.get(i); | |
| 810 | - if(s.getZdsjActual()!=null){ | |
| 811 | - lists.add(s); | |
| 812 | - } | |
| 813 | - } | |
| 818 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 819 | + for (int i = 0; i < scheduleRealInfos.size(); i++) { | |
| 820 | + ScheduleRealInfo s=scheduleRealInfos.get(i); | |
| 821 | + if(s.getZdsjActual()!=null){ | |
| 822 | + lists.add(s); | |
| 823 | + } | |
| 824 | + } | |
| 814 | 825 | DecimalFormat format = new DecimalFormat("0.00"); |
| 815 | 826 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 816 | 827 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); |
| 817 | - //计算里程和班次数,并放入Map里 | |
| 828 | + //计算里程和班次数,并放入Map里 | |
| 818 | 829 | Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId()); |
| 819 | 830 | |
| 820 | 831 | map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos))); |
| ... | ... | @@ -833,33 +844,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 833 | 844 | // map=new HashMap<String,Object>(); |
| 834 | 845 | Map<String, Object> maps; |
| 835 | 846 | for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { |
| 836 | - maps = new HashMap<String, Object>(); | |
| 837 | - try { | |
| 838 | - scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); | |
| 839 | - scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); | |
| 840 | - maps = rru.getMapValue(scheduleRealInfo); | |
| 841 | - String zdsj = scheduleRealInfo.getZdsj(); | |
| 842 | - String zdsjActual = scheduleRealInfo.getZdsjActual(); | |
| 843 | - if (zdsj != null && zdsjActual != null && | |
| 844 | - !zdsj.equals(zdsjActual)) { | |
| 845 | - if (zdsj.compareTo(zdsjActual) > 0) { | |
| 846 | - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 847 | - maps.put("slow", ""); | |
| 848 | - } else { | |
| 849 | - maps.put("fast", ""); | |
| 850 | - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 851 | - } | |
| 847 | + maps = new HashMap<String, Object>(); | |
| 848 | + try { | |
| 849 | + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); | |
| 850 | + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); | |
| 851 | + maps = rru.getMapValue(scheduleRealInfo); | |
| 852 | + String zdsj = scheduleRealInfo.getZdsj(); | |
| 853 | + String zdsjActual = scheduleRealInfo.getZdsjActual(); | |
| 854 | + if (zdsj != null && zdsjActual != null && | |
| 855 | + !zdsj.equals(zdsjActual)) { | |
| 856 | + if (zdsj.compareTo(zdsjActual) > 0) { | |
| 857 | + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 858 | + maps.put("slow", ""); | |
| 852 | 859 | } else { |
| 853 | - maps.put("fast", ""); | |
| 854 | - maps.put("slow", ""); | |
| 860 | + maps.put("fast", ""); | |
| 861 | + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 855 | 862 | } |
| 856 | - listMap.add(maps); | |
| 857 | - } catch (Exception e) { | |
| 858 | - e.printStackTrace(); | |
| 863 | + } else { | |
| 864 | + maps.put("fast", ""); | |
| 865 | + maps.put("slow", ""); | |
| 859 | 866 | } |
| 867 | + listMap.add(maps); | |
| 868 | + } catch (Exception e) { | |
| 869 | + e.printStackTrace(); | |
| 870 | + } | |
| 860 | 871 | } |
| 861 | 872 | |
| 862 | - | |
| 873 | + | |
| 863 | 874 | |
| 864 | 875 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 865 | 876 | |
| ... | ... | @@ -1269,6 +1280,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1269 | 1280 | ts.add(next); |
| 1270 | 1281 | } |
| 1271 | 1282 | |
| 1283 | + if(!next.getXlBm().equals(sch.getXlBm())){ | |
| 1284 | + directiveService.lineChange(next.getClZbh(), next.getXlBm(), "套跑@系统"); | |
| 1285 | + } | |
| 1286 | + | |
| 1272 | 1287 | //重新计算车辆执行班次 |
| 1273 | 1288 | dayOfSchedule.reCalcExecPlan(sch.getClZbh()); |
| 1274 | 1289 | } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){ |
| ... | ... | @@ -1638,38 +1653,38 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1638 | 1653 | // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc)); |
| 1639 | 1654 | return map; |
| 1640 | 1655 | }*/ |
| 1641 | - | |
| 1656 | + | |
| 1642 | 1657 | public Map<String, Object> findKMBC(String jGh, String clZbh, |
| 1643 | - String lpName, String date, String line) { | |
| 1644 | - Map<String, Object> map = new HashMap<String, Object>(); | |
| 1645 | - List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line); | |
| 1646 | - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 1647 | - for (int i = 0; i < list.size(); i++) { | |
| 1648 | - ScheduleRealInfo s=list.get(i); | |
| 1649 | - if(s.getZdsjActual()!=null){ | |
| 1650 | - lists.add(s); | |
| 1651 | - } | |
| 1652 | - } | |
| 1653 | - double ksgl=culateService.culateKsgl(list); | |
| 1654 | - double sjgl=culateService.culateSjgl(lists); | |
| 1655 | - double jccgl=culateService.culateJccgl(lists); | |
| 1656 | - double ljgl=culateService.culateLjgl(lists); | |
| 1657 | - | |
| 1658 | - map.put("jhlc", Arith.add(culateService.culateJhgl(list),culateService.culateJhJccgl(list))); //计划里程 | |
| 1659 | - map.put("remMileage", culateService.culateLbgl(list)); //烂班公里 | |
| 1660 | - map.put("addMileage", ljgl); //临加公里 | |
| 1661 | - map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里 | |
| 1662 | - map.put("ksgl", ksgl);//空驶公里 | |
| 1663 | - map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl))); | |
| 1658 | + String lpName, String date, String line) { | |
| 1659 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 1660 | + List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line); | |
| 1661 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 1662 | + for (int i = 0; i < list.size(); i++) { | |
| 1663 | + ScheduleRealInfo s=list.get(i); | |
| 1664 | + if(s.getZdsjActual()!=null){ | |
| 1665 | + lists.add(s); | |
| 1666 | + } | |
| 1667 | + } | |
| 1668 | + double ksgl=culateService.culateKsgl(list); | |
| 1669 | + double sjgl=culateService.culateSjgl(lists); | |
| 1670 | + double jccgl=culateService.culateJccgl(lists); | |
| 1671 | + double ljgl=culateService.culateLjgl(lists); | |
| 1672 | + | |
| 1673 | + map.put("jhlc", Arith.add(culateService.culateJhgl(list),culateService.culateJhJccgl(list))); //计划里程 | |
| 1674 | + map.put("remMileage", culateService.culateLbgl(list)); //烂班公里 | |
| 1675 | + map.put("addMileage", ljgl); //临加公里 | |
| 1676 | + map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里 | |
| 1677 | + map.put("ksgl", ksgl);//空驶公里 | |
| 1678 | + map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl))); | |
| 1664 | 1679 | // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage)); |
| 1665 | - map.put("jhbc", culateService.culateJhbc(list,"")); | |
| 1666 | - map.put("cjbc", culateService.culateLbbc(list)); | |
| 1667 | - map.put("ljbc", culateService.culateLjbc(lists,"")); | |
| 1668 | - map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,"")); | |
| 1669 | - map.put("jcclc", jccgl); | |
| 1670 | - map.put("zkslc", Arith.add(ksgl,jccgl)); | |
| 1680 | + map.put("jhbc", culateService.culateJhbc(list,"")); | |
| 1681 | + map.put("cjbc", culateService.culateLbbc(list)); | |
| 1682 | + map.put("ljbc", culateService.culateLjbc(lists,"")); | |
| 1683 | + map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,"")); | |
| 1684 | + map.put("jcclc", jccgl); | |
| 1685 | + map.put("zkslc", Arith.add(ksgl,jccgl)); | |
| 1671 | 1686 | // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc)); |
| 1672 | - return map; | |
| 1687 | + return map; | |
| 1673 | 1688 | } |
| 1674 | 1689 | |
| 1675 | 1690 | |
| ... | ... | @@ -1792,38 +1807,38 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1792 | 1807 | list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); |
| 1793 | 1808 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| 1794 | 1809 | String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'"; |
| 1795 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 1796 | - String[] minSjs = minfcsj.split(":"); | |
| 1797 | - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); | |
| 1798 | - | |
| 1810 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 1811 | + String[] minSjs = minfcsj.split(":"); | |
| 1812 | + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); | |
| 1813 | + | |
| 1799 | 1814 | for (int i = 0; i < list.size(); i++) { |
| 1800 | - ScheduleRealInfo s=list.get(i); | |
| 1801 | - String[] fcsj= s.getFcsj().split(":"); | |
| 1802 | - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]); | |
| 1803 | - | |
| 1804 | - Long fscjT=0L; | |
| 1805 | - if(fcsjL<minSj){ | |
| 1806 | - Calendar calendar = new GregorianCalendar(); | |
| 1807 | - calendar.setTime(s.getScheduleDate()); | |
| 1808 | - calendar.add(calendar.DATE,1); | |
| 1809 | - s.setScheduleDate(calendar.getTime()); | |
| 1810 | - try { | |
| 1811 | - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime(); | |
| 1812 | - } catch (ParseException e) { | |
| 1813 | - // TODO Auto-generated catch block | |
| 1814 | - e.printStackTrace(); | |
| 1815 | - } | |
| 1816 | - | |
| 1817 | - }else{ | |
| 1818 | - try { | |
| 1819 | - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime(); | |
| 1820 | - } catch (ParseException e) { | |
| 1821 | - // TODO Auto-generated catch block | |
| 1822 | - e.printStackTrace(); | |
| 1823 | - }; | |
| 1824 | - } | |
| 1825 | - s.setFcsjT(fscjT); | |
| 1826 | - } | |
| 1815 | + ScheduleRealInfo s=list.get(i); | |
| 1816 | + String[] fcsj= s.getFcsj().split(":"); | |
| 1817 | + Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]); | |
| 1818 | + | |
| 1819 | + Long fscjT=0L; | |
| 1820 | + if(fcsjL<minSj){ | |
| 1821 | + Calendar calendar = new GregorianCalendar(); | |
| 1822 | + calendar.setTime(s.getScheduleDate()); | |
| 1823 | + calendar.add(calendar.DATE,1); | |
| 1824 | + s.setScheduleDate(calendar.getTime()); | |
| 1825 | + try { | |
| 1826 | + fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime(); | |
| 1827 | + } catch (ParseException e) { | |
| 1828 | + // TODO Auto-generated catch block | |
| 1829 | + e.printStackTrace(); | |
| 1830 | + } | |
| 1831 | + | |
| 1832 | + }else{ | |
| 1833 | + try { | |
| 1834 | + fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime(); | |
| 1835 | + } catch (ParseException e) { | |
| 1836 | + // TODO Auto-generated catch block | |
| 1837 | + e.printStackTrace(); | |
| 1838 | + }; | |
| 1839 | + } | |
| 1840 | + s.setFcsjT(fscjT); | |
| 1841 | + } | |
| 1827 | 1842 | Collections.sort(list, new ComparableReal()); |
| 1828 | 1843 | for (int i = 0; i < list.size(); i++) { |
| 1829 | 1844 | ScheduleRealInfo s = list.get(i); |
| ... | ... | @@ -1847,31 +1862,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1847 | 1862 | remarks += "(烂班)"; |
| 1848 | 1863 | s.setRemarks(remarks); |
| 1849 | 1864 | } |
| 1850 | - | |
| 1865 | + | |
| 1851 | 1866 | listSchedule.add(s); |
| 1852 | 1867 | //计算营运里程,空驶里程 |
| 1853 | 1868 | if (!childTaskPlans.isEmpty()) { |
| 1854 | 1869 | // Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| 1855 | - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans); | |
| 1856 | - Collections.sort(listit, new ComparableChild()); | |
| 1857 | - for (int j = 0; j < listit.size(); j++) { | |
| 1858 | - ScheduleRealInfo t = new ScheduleRealInfo(); | |
| 1859 | - ChildTaskPlan childTaskPlan = listit.get(j); | |
| 1860 | - if (childTaskPlan.isDestroy()) { | |
| 1861 | - t.setFcsjActual(""); | |
| 1862 | - t.setZdsjActual(""); | |
| 1863 | - t.setJhlc(0.0); | |
| 1864 | - } else { | |
| 1865 | - t.setFcsjActual(childTaskPlan.getStartDate()); | |
| 1866 | - t.setZdsjActual(childTaskPlan.getEndDate()); | |
| 1867 | - t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage()))); | |
| 1868 | - } | |
| 1869 | - t.setQdzName(childTaskPlan.getStartStationName()); | |
| 1870 | - t.setZdzName(childTaskPlan.getEndStationName()); | |
| 1871 | - t.setRemarks(childTaskPlan.getRemarks()); | |
| 1872 | - t.setAdjustExps("子"); | |
| 1873 | - listSchedule.add(t); | |
| 1874 | - } | |
| 1870 | + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans); | |
| 1871 | + Collections.sort(listit, new ComparableChild()); | |
| 1872 | + for (int j = 0; j < listit.size(); j++) { | |
| 1873 | + ScheduleRealInfo t = new ScheduleRealInfo(); | |
| 1874 | + ChildTaskPlan childTaskPlan = listit.get(j); | |
| 1875 | + if (childTaskPlan.isDestroy()) { | |
| 1876 | + t.setFcsjActual(""); | |
| 1877 | + t.setZdsjActual(""); | |
| 1878 | + t.setJhlc(0.0); | |
| 1879 | + } else { | |
| 1880 | + t.setFcsjActual(childTaskPlan.getStartDate()); | |
| 1881 | + t.setZdsjActual(childTaskPlan.getEndDate()); | |
| 1882 | + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage()))); | |
| 1883 | + } | |
| 1884 | + t.setQdzName(childTaskPlan.getStartStationName()); | |
| 1885 | + t.setZdzName(childTaskPlan.getEndStationName()); | |
| 1886 | + t.setRemarks(childTaskPlan.getRemarks()); | |
| 1887 | + t.setAdjustExps("子"); | |
| 1888 | + listSchedule.add(t); | |
| 1889 | + } | |
| 1875 | 1890 | /* String sqlPc = "select * from bsth_c_s_child_task where schedule=" + s.getId() + " order by start_date "; |
| 1876 | 1891 | List<ScheduleRealInfo> lists = jdbcTemplate.query(sqlPc, |
| 1877 | 1892 | new RowMapper<ScheduleRealInfo>() { |
| ... | ... | @@ -1924,62 +1939,62 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1924 | 1939 | @Override |
| 1925 | 1940 | public List<Map<String, Object>> statisticsDaily(String line, String date, |
| 1926 | 1941 | String xlName, String type) { |
| 1927 | - List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>(); | |
| 1928 | - List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date); | |
| 1929 | - List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>(); | |
| 1930 | - for (int i = 0; i < list_s.size(); i++) { | |
| 1931 | - ScheduleRealInfo s=list_s.get(i); | |
| 1932 | - if(s.getZdsjActual()!=null){ | |
| 1933 | - lists.add(s); | |
| 1934 | - } | |
| 1935 | - } | |
| 1936 | - Map<String, Object> map = new HashMap<String, Object>(); | |
| 1937 | - map.put("xlName", xlName); | |
| 1938 | - double jhlc=culateService.culateJhgl(list_s); | |
| 1939 | - map.put("jhlc",jhlc); | |
| 1940 | - map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists))); | |
| 1941 | - double lbgl=culateService.culateLbgl(list_s); | |
| 1942 | - map.put("ssgl", lbgl); | |
| 1943 | - map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻")); | |
| 1944 | - map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢")); | |
| 1945 | - map.put("ssgl_gz", culateService.culateCJLC(list_s, "故障")); | |
| 1946 | - map.put("ssgl_jf", culateService.culateCJLC(list_s, "纠纷")); | |
| 1947 | - map.put("ssgl_zs", culateService.culateCJLC(list_s, "肇事")); | |
| 1948 | - map.put("ssgl_qr", culateService.culateCJLC(list_s, "缺人")); | |
| 1949 | - map.put("ssgl_qc", culateService.culateCJLC(list_s, "缺车")); | |
| 1950 | - map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀")); | |
| 1951 | - map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候")); | |
| 1952 | - map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外")); | |
| 1953 | - double ssgl_pc=culateService.culateCJLC(list_s, "配车"); | |
| 1954 | - double ssgl_by=culateService.culateCJLC(list_s, "保养"); | |
| 1955 | - double ssgl_cj=culateService.culateCJLC(list_s, "抽减"); | |
| 1956 | - double ssgl_qt=culateService.culateCJLC(list_s, "其他"); | |
| 1957 | - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt))); | |
| 1958 | - map.put("ssbc", culateService.culateLbbc(list_s)); | |
| 1959 | - double ljgl=culateService.culateLjgl(lists); | |
| 1960 | - map.put("ljgl", ljgl); | |
| 1961 | - map.put("jhbc", culateService.culateJhbc(list_s,"")); | |
| 1962 | - map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf")); | |
| 1963 | - map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf")); | |
| 1964 | - map.put("sjbc", culateService.culateSjbc(lists,"")); | |
| 1965 | - map.put("sjbc_m", culateService.culateSjbc(lists,"zgf")); | |
| 1966 | - map.put("sjbc_a", culateService.culateSjbc(lists,"wgf")); | |
| 1967 | - map.put("ljbc", culateService.culateLjbc(lists,"")); | |
| 1968 | - map.put("ljbc_m", culateService.culateLjbc(lists,"zgf")); | |
| 1969 | - map.put("ljbc_a", culateService.culateLjbc(lists,"wgf")); | |
| 1970 | - map.put("fzbc", culateService.culateFzbc(lists, "")); | |
| 1971 | - map.put("fzbc_m", culateService.culateFzbc(lists, "zgf")); | |
| 1972 | - map.put("fzbc_a", culateService.culateFzbc(lists, "wgf")); | |
| 1973 | - map.put("dtbc", 0); | |
| 1974 | - map.put("dtbc_m", 0); | |
| 1975 | - map.put("dtbc_a", 0); | |
| 1976 | - map.put("djg", 0); | |
| 1977 | - map.put("djg_m", 0); | |
| 1978 | - map.put("djg_a", 0); | |
| 1979 | - map.put("djg_time", 0); | |
| 1980 | - map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl)); | |
| 1981 | - lMap.add(map); | |
| 1982 | - return lMap; | |
| 1942 | + List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>(); | |
| 1943 | + List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date); | |
| 1944 | + List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>(); | |
| 1945 | + for (int i = 0; i < list_s.size(); i++) { | |
| 1946 | + ScheduleRealInfo s=list_s.get(i); | |
| 1947 | + if(s.getZdsjActual()!=null){ | |
| 1948 | + lists.add(s); | |
| 1949 | + } | |
| 1950 | + } | |
| 1951 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 1952 | + map.put("xlName", xlName); | |
| 1953 | + double jhlc=culateService.culateJhgl(list_s); | |
| 1954 | + map.put("jhlc",jhlc); | |
| 1955 | + map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists))); | |
| 1956 | + double lbgl=culateService.culateLbgl(list_s); | |
| 1957 | + map.put("ssgl", lbgl); | |
| 1958 | + map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻")); | |
| 1959 | + map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢")); | |
| 1960 | + map.put("ssgl_gz", culateService.culateCJLC(list_s, "故障")); | |
| 1961 | + map.put("ssgl_jf", culateService.culateCJLC(list_s, "纠纷")); | |
| 1962 | + map.put("ssgl_zs", culateService.culateCJLC(list_s, "肇事")); | |
| 1963 | + map.put("ssgl_qr", culateService.culateCJLC(list_s, "缺人")); | |
| 1964 | + map.put("ssgl_qc", culateService.culateCJLC(list_s, "缺车")); | |
| 1965 | + map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀")); | |
| 1966 | + map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候")); | |
| 1967 | + map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外")); | |
| 1968 | + double ssgl_pc=culateService.culateCJLC(list_s, "配车"); | |
| 1969 | + double ssgl_by=culateService.culateCJLC(list_s, "保养"); | |
| 1970 | + double ssgl_cj=culateService.culateCJLC(list_s, "抽减"); | |
| 1971 | + double ssgl_qt=culateService.culateCJLC(list_s, "其他"); | |
| 1972 | + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt))); | |
| 1973 | + map.put("ssbc", culateService.culateLbbc(list_s)); | |
| 1974 | + double ljgl=culateService.culateLjgl(lists); | |
| 1975 | + map.put("ljgl", ljgl); | |
| 1976 | + map.put("jhbc", culateService.culateJhbc(list_s,"")); | |
| 1977 | + map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf")); | |
| 1978 | + map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf")); | |
| 1979 | + map.put("sjbc", culateService.culateSjbc(lists,"")); | |
| 1980 | + map.put("sjbc_m", culateService.culateSjbc(lists,"zgf")); | |
| 1981 | + map.put("sjbc_a", culateService.culateSjbc(lists,"wgf")); | |
| 1982 | + map.put("ljbc", culateService.culateLjbc(lists,"")); | |
| 1983 | + map.put("ljbc_m", culateService.culateLjbc(lists,"zgf")); | |
| 1984 | + map.put("ljbc_a", culateService.culateLjbc(lists,"wgf")); | |
| 1985 | + map.put("fzbc", culateService.culateFzbc(lists, "")); | |
| 1986 | + map.put("fzbc_m", culateService.culateFzbc(lists, "zgf")); | |
| 1987 | + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf")); | |
| 1988 | + map.put("dtbc", 0); | |
| 1989 | + map.put("dtbc_m", 0); | |
| 1990 | + map.put("dtbc_a", 0); | |
| 1991 | + map.put("djg", 0); | |
| 1992 | + map.put("djg_m", 0); | |
| 1993 | + map.put("djg_a", 0); | |
| 1994 | + map.put("djg_time", 0); | |
| 1995 | + map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl)); | |
| 1996 | + lMap.add(map); | |
| 1997 | + return lMap; | |
| 1983 | 1998 | } |
| 1984 | 1999 | |
| 1985 | 2000 | /* @Override |
| ... | ... | @@ -2527,34 +2542,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2527 | 2542 | |
| 2528 | 2543 | return lMap; |
| 2529 | 2544 | }*/ |
| 2530 | - | |
| 2545 | + | |
| 2531 | 2546 | public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){ |
| 2532 | - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 2533 | - for(int i=0;i<list.size();i++){ | |
| 2534 | - ScheduleRealInfo s=list.get(i); | |
| 2535 | - if(s.getZdsjActual()!=null){ | |
| 2536 | - lists.add(s); | |
| 2537 | - } | |
| 2538 | - } | |
| 2539 | - Map<String, Object> map = new HashMap<String, Object>(); | |
| 2540 | - map.put("xlName", lists.get(0).getXlName()); | |
| 2541 | - double jhyygl=culateService.culateJhgl(list);//计划营运公里 | |
| 2542 | - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) | |
| 2543 | - map.put("jhlc", jhyygl); | |
| 2544 | - map.put("jcclc", jhjcclc); | |
| 2545 | - map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); | |
| 2546 | - | |
| 2547 | - double ljgl= culateService.culateLjgl(lists); | |
| 2548 | - double sjyygl= culateService.culateSjgl(lists); | |
| 2549 | - double zyygl= Arith.add(sjyygl,ljgl); | |
| 2550 | - | |
| 2551 | - double sjjccgl=culateService.culateJccgl(lists); | |
| 2552 | - double sjksgl=culateService.culateKsgl(lists); | |
| 2553 | - double zksgl=Arith.add(sjjccgl, sjksgl); | |
| 2554 | - map.put("sjzgl", Arith.add(zyygl, zksgl)); | |
| 2555 | - map.put("sjgl",zyygl); | |
| 2556 | - map.put("sjksgl", zksgl); | |
| 2557 | - | |
| 2547 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 2548 | + for(int i=0;i<list.size();i++){ | |
| 2549 | + ScheduleRealInfo s=list.get(i); | |
| 2550 | + if(s.getZdsjActual()!=null){ | |
| 2551 | + lists.add(s); | |
| 2552 | + } | |
| 2553 | + } | |
| 2554 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 2555 | + map.put("xlName", lists.get(0).getXlName()); | |
| 2556 | + double jhyygl=culateService.culateJhgl(list);//计划营运公里 | |
| 2557 | + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) | |
| 2558 | + map.put("jhlc", jhyygl); | |
| 2559 | + map.put("jcclc", jhjcclc); | |
| 2560 | + map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); | |
| 2561 | + | |
| 2562 | + double ljgl= culateService.culateLjgl(lists); | |
| 2563 | + double sjyygl= culateService.culateSjgl(lists); | |
| 2564 | + double zyygl= Arith.add(sjyygl,ljgl); | |
| 2565 | + | |
| 2566 | + double sjjccgl=culateService.culateJccgl(lists); | |
| 2567 | + double sjksgl=culateService.culateKsgl(lists); | |
| 2568 | + double zksgl=Arith.add(sjjccgl, sjksgl); | |
| 2569 | + map.put("sjzgl", Arith.add(zyygl, zksgl)); | |
| 2570 | + map.put("sjgl",zyygl); | |
| 2571 | + map.put("sjksgl", zksgl); | |
| 2572 | + | |
| 2558 | 2573 | map.put("ssgl", culateService.culateLbgl(list)); |
| 2559 | 2574 | map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); |
| 2560 | 2575 | map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); |
| ... | ... | @@ -2588,66 +2603,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2588 | 2603 | map.put("djg_m", 0); |
| 2589 | 2604 | map.put("djg_a", 0); |
| 2590 | 2605 | map.put("djg_time", 0); |
| 2591 | - return map; | |
| 2606 | + return map; | |
| 2592 | 2607 | } |
| 2593 | - | |
| 2608 | + | |
| 2594 | 2609 | @Override |
| 2595 | 2610 | public List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, |
| 2596 | - String xlName, String type) { | |
| 2611 | + String xlName, String type) { | |
| 2597 | 2612 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); |
| 2598 | 2613 | List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); |
| 2599 | 2614 | List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); |
| 2600 | 2615 | line =line.trim(); |
| 2601 | 2616 | if(line.equals("")){ |
| 2602 | - //查询所有线路 | |
| 2603 | - list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm); | |
| 2617 | + //查询所有线路 | |
| 2618 | + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm); | |
| 2604 | 2619 | }else{ |
| 2605 | - //查询单条线路 | |
| 2606 | - list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); | |
| 2620 | + //查询单条线路 | |
| 2621 | + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); | |
| 2607 | 2622 | } |
| 2608 | 2623 | for (int i = 0; i < list.size(); i++) { |
| 2609 | - ScheduleRealInfo s=list.get(i); | |
| 2610 | - if(s.getZdsjActual()!=null){ | |
| 2611 | - list_s.add(s); | |
| 2612 | - } | |
| 2613 | - } | |
| 2624 | + ScheduleRealInfo s=list.get(i); | |
| 2625 | + if(s.getZdsjActual()!=null){ | |
| 2626 | + list_s.add(s); | |
| 2627 | + } | |
| 2628 | + } | |
| 2614 | 2629 | List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); |
| 2615 | 2630 | for (int i = 0; i < list.size(); i++) { |
| 2616 | - if(i<list.size()-1){ | |
| 2617 | - if(list.get(i+1).getXlBm().equals(list.get(i).getXlBm())){ | |
| 2618 | - lists.add(list.get(i)); | |
| 2619 | - }else{ | |
| 2620 | - lists.add(list.get(i)); | |
| 2621 | - Map<String, Object> map=staticTj(lists); | |
| 2622 | - lMap.add(map); | |
| 2623 | - lists=new ArrayList<ScheduleRealInfo>(); | |
| 2624 | - } | |
| 2625 | - }else{ | |
| 2626 | - if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){ | |
| 2627 | - lists.add(list.get(i)); | |
| 2628 | - Map<String, Object> map=staticTj(lists); | |
| 2629 | - lMap.add(map); | |
| 2630 | - }else{ | |
| 2631 | - lists=new ArrayList<ScheduleRealInfo>(); | |
| 2632 | - lists.add(list.get(i)); | |
| 2633 | - Map<String, Object> map=staticTj(lists); | |
| 2634 | - lMap.add(map); | |
| 2635 | - } | |
| 2636 | - } | |
| 2631 | + if(i<list.size()-1){ | |
| 2632 | + if(list.get(i+1).getXlBm().equals(list.get(i).getXlBm())){ | |
| 2633 | + lists.add(list.get(i)); | |
| 2634 | + }else{ | |
| 2635 | + lists.add(list.get(i)); | |
| 2636 | + Map<String, Object> map=staticTj(lists); | |
| 2637 | + lMap.add(map); | |
| 2638 | + lists=new ArrayList<ScheduleRealInfo>(); | |
| 2639 | + } | |
| 2640 | + }else{ | |
| 2641 | + if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){ | |
| 2642 | + lists.add(list.get(i)); | |
| 2643 | + Map<String, Object> map=staticTj(lists); | |
| 2644 | + lMap.add(map); | |
| 2645 | + }else{ | |
| 2646 | + lists=new ArrayList<ScheduleRealInfo>(); | |
| 2647 | + lists.add(list.get(i)); | |
| 2648 | + Map<String, Object> map=staticTj(lists); | |
| 2649 | + lMap.add(map); | |
| 2650 | + } | |
| 2651 | + } | |
| 2637 | 2652 | } |
| 2638 | - | |
| 2653 | + | |
| 2639 | 2654 | Map<String, Object> map = new HashMap<String, Object>(); |
| 2640 | - map.put("xlName", "合计"); | |
| 2641 | - double jhyygl=culateService.culateJhgl(list);//计划营运公里 | |
| 2642 | - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) | |
| 2655 | + map.put("xlName", "合计"); | |
| 2656 | + double jhyygl=culateService.culateJhgl(list);//计划营运公里 | |
| 2657 | + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) | |
| 2643 | 2658 | map.put("jhlc", jhyygl); |
| 2644 | 2659 | map.put("jcclc", jhjcclc); |
| 2645 | 2660 | map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); |
| 2646 | - | |
| 2661 | + | |
| 2647 | 2662 | double ljgl= culateService.culateLjgl(list_s); |
| 2648 | 2663 | double sjyygl= culateService.culateSjgl(list_s); |
| 2649 | 2664 | double zyygl= Arith.add(sjyygl,ljgl); |
| 2650 | - | |
| 2665 | + | |
| 2651 | 2666 | double sjjccgl=culateService.culateJccgl(list_s); |
| 2652 | 2667 | double sjksgl=culateService.culateKsgl(list_s); |
| 2653 | 2668 | double zksgl=Arith.add(sjjccgl, sjksgl); |
| ... | ... | @@ -2965,10 +2980,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2965 | 2980 | List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm); |
| 2966 | 2981 | // System.out.println("shijian3:"+new Date()); |
| 2967 | 2982 | for (int x = 0; x < yesterdayDataList.size(); x++) { |
| 2968 | - | |
| 2983 | + | |
| 2969 | 2984 | String jName = yesterdayDataList.get(x).get("jGh").toString(); |
| 2970 | 2985 | String clZbh = yesterdayDataList.get(x).get("clZbh").toString(); |
| 2971 | - | |
| 2986 | + | |
| 2972 | 2987 | // double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0; |
| 2973 | 2988 | double addMileage = 0, remMileage = 0; |
| 2974 | 2989 | Map<String, Object> map = new HashMap<String, Object>(); |
| ... | ... | @@ -2977,14 +2992,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2977 | 2992 | String bCompany=""; |
| 2978 | 2993 | List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>(); |
| 2979 | 2994 | for (ScheduleRealInfo scheduleRealInfo : lists) { |
| 2980 | - if(scheduleRealInfo.getjGh().equals(jName) && scheduleRealInfo.getClZbh().equals(clZbh)){ | |
| 2981 | - if (fage) { | |
| 2982 | - //根据线路代码获取公司 | |
| 2983 | - company=scheduleRealInfo.getGsBm(); | |
| 2984 | - bCompany=scheduleRealInfo.getFgsBm(); | |
| 2985 | - fage = false; | |
| 2986 | - } | |
| 2987 | - listS.add(scheduleRealInfo); | |
| 2995 | + if(scheduleRealInfo.getjGh().equals(jName) && scheduleRealInfo.getClZbh().equals(clZbh)){ | |
| 2996 | + if (fage) { | |
| 2997 | + //根据线路代码获取公司 | |
| 2998 | + company=scheduleRealInfo.getGsBm(); | |
| 2999 | + bCompany=scheduleRealInfo.getFgsBm(); | |
| 3000 | + fage = false; | |
| 3001 | + } | |
| 3002 | + listS.add(scheduleRealInfo); | |
| 2988 | 3003 | |
| 2989 | 3004 | /* if (scheduleRealInfo != null) { |
| 2990 | 3005 | //计划里程(主任务过滤掉临加班次), |
| ... | ... | @@ -3046,9 +3061,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3046 | 3061 | } |
| 3047 | 3062 | } |
| 3048 | 3063 | }*/ |
| 3049 | - } | |
| 3064 | + } | |
| 3050 | 3065 | } |
| 3051 | - | |
| 3066 | + | |
| 3052 | 3067 | yesterdayDataList.get(x).put("company", company); |
| 3053 | 3068 | yesterdayDataList.get(x).put("bCompany", bCompany); |
| 3054 | 3069 | // Double zgl=Arith.add(yygl,ksgl); |
| ... | ... | @@ -3800,9 +3815,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3800 | 3815 | } |
| 3801 | 3816 | |
| 3802 | 3817 | if (!c.isDestroy()) { |
| 3803 | - if(c.getMileageType().equals("service")){ | |
| 3804 | - sjlc += c.getMileage() == null ? 0 : c.getMileage(); | |
| 3805 | - } | |
| 3818 | + if(c.getMileageType().equals("service")){ | |
| 3819 | + sjlc += c.getMileage() == null ? 0 : c.getMileage(); | |
| 3820 | + } | |
| 3806 | 3821 | } |
| 3807 | 3822 | |
| 3808 | 3823 | } |
| ... | ... | @@ -3866,14 +3881,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3866 | 3881 | Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime(); |
| 3867 | 3882 | Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime(); |
| 3868 | 3883 | for (int i = 0; i < list.size(); i++) { |
| 3869 | - DutyEmployee t = list.get(i); | |
| 3870 | - if(!(dbdp.indexOf(",")>0)){ | |
| 3871 | - if(!(dbdp.length()>0)){ | |
| 3872 | - dbdp =t.getuName(); | |
| 3873 | - }else{ | |
| 3874 | - dbdp +=","+t.getuName(); | |
| 3875 | - } | |
| 3876 | - } | |
| 3884 | + DutyEmployee t = list.get(i); | |
| 3885 | + if(!(dbdp.indexOf(",")>0)){ | |
| 3886 | + if(!(dbdp.length()>0)){ | |
| 3887 | + dbdp =t.getuName(); | |
| 3888 | + }else{ | |
| 3889 | + dbdp +=","+t.getuName(); | |
| 3890 | + } | |
| 3891 | + } | |
| 3877 | 3892 | Long ts = t.getTs(); |
| 3878 | 3893 | if (ts > fcsj1 && ts < fcsj2) { |
| 3879 | 3894 | if (zdp.indexOf(t.getuName()) == -1) { |
| ... | ... | @@ -3958,18 +3973,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3958 | 3973 | if (!scheduleRealInfo.getsGh().equals(sgh)) { |
| 3959 | 3974 | sgh = scheduleRealInfo.getsGh()==null?"":scheduleRealInfo.getsGh(); |
| 3960 | 3975 | if(!sgh.equals("")){ |
| 3961 | - if (map.get("sjb1") != null) { | |
| 3962 | - if (map.get("sjb2") != null) { | |
| 3963 | - map.put("sjb3", scheduleRealInfo.getsGh() + "/" + | |
| 3964 | - scheduleRealInfo.getFcsjActual()); | |
| 3965 | - } else { | |
| 3966 | - map.put("sjb2", scheduleRealInfo.getsGh() + "/" + | |
| 3967 | - scheduleRealInfo.getFcsjActual()); | |
| 3968 | - } | |
| 3969 | - } else { | |
| 3970 | - map.put("sjb1", scheduleRealInfo.getsGh() + "/" + | |
| 3971 | - scheduleRealInfo.getFcsjActual()); | |
| 3972 | - } | |
| 3976 | + if (map.get("sjb1") != null) { | |
| 3977 | + if (map.get("sjb2") != null) { | |
| 3978 | + map.put("sjb3", scheduleRealInfo.getsGh() + "/" + | |
| 3979 | + scheduleRealInfo.getFcsjActual()); | |
| 3980 | + } else { | |
| 3981 | + map.put("sjb2", scheduleRealInfo.getsGh() + "/" + | |
| 3982 | + scheduleRealInfo.getFcsjActual()); | |
| 3983 | + } | |
| 3984 | + } else { | |
| 3985 | + map.put("sjb1", scheduleRealInfo.getsGh() + "/" + | |
| 3986 | + scheduleRealInfo.getFcsjActual()); | |
| 3987 | + } | |
| 3973 | 3988 | } |
| 3974 | 3989 | } |
| 3975 | 3990 | } |
| ... | ... | @@ -4059,7 +4074,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4059 | 4074 | String xlName = map.get("xlName").toString(); |
| 4060 | 4075 | String state = map.get("state").toString(); |
| 4061 | 4076 | String type = map.get("type").toString(); |
| 4062 | - | |
| 4077 | + | |
| 4063 | 4078 | List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>(); |
| 4064 | 4079 | List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>(); |
| 4065 | 4080 | List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null); |
| ... | ... | @@ -4136,10 +4151,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4136 | 4151 | String fcsjActural=schedule.getFcsjActual() != null ? schedule.getFcsjActual() : ""; |
| 4137 | 4152 | String bcType=schedule.getBcType()!=null?schedule.getBcType():""; |
| 4138 | 4153 | if(bcType.equals("in")){ |
| 4139 | - fcsjActural=fcsjActural+"(进)"; | |
| 4154 | + fcsjActural=fcsjActural+"(进)"; | |
| 4140 | 4155 | } |
| 4141 | 4156 | if(bcType.equals("out")){ |
| 4142 | - fcsjActural=fcsjActural+"(出)"; | |
| 4157 | + fcsjActural=fcsjActural+"(出)"; | |
| 4143 | 4158 | } |
| 4144 | 4159 | tempMap.put("fcsjActual" + size, fcsjActural); |
| 4145 | 4160 | tempMap.put("fcsjk" + size, ""); |
| ... | ... | @@ -4201,13 +4216,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4201 | 4216 | List<ScheduleRealInfo> scheduleRealInfos = listpl; |
| 4202 | 4217 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); |
| 4203 | 4218 | // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); |
| 4204 | - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 4205 | - for (int i = 0; i < scheduleRealInfos.size(); i++) { | |
| 4206 | - ScheduleRealInfo s=scheduleRealInfos.get(i); | |
| 4207 | - if(s.getZdsjActual()!=null){ | |
| 4208 | - lists.add(s); | |
| 4209 | - } | |
| 4210 | - } | |
| 4219 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 4220 | + for (int i = 0; i < scheduleRealInfos.size(); i++) { | |
| 4221 | + ScheduleRealInfo s=scheduleRealInfos.get(i); | |
| 4222 | + if(s.getZdsjActual()!=null){ | |
| 4223 | + lists.add(s); | |
| 4224 | + } | |
| 4225 | + } | |
| 4211 | 4226 | DecimalFormat format = new DecimalFormat("0.00"); |
| 4212 | 4227 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 4213 | 4228 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); |
| ... | ... | @@ -4229,33 +4244,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4229 | 4244 | |
| 4230 | 4245 | Map<String, Object> maps; |
| 4231 | 4246 | for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { |
| 4232 | - maps = new HashMap<String, Object>(); | |
| 4233 | - try { | |
| 4234 | - scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); | |
| 4235 | - scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); | |
| 4236 | - maps = rru.getMapValue(scheduleRealInfo); | |
| 4237 | - String zdsj = scheduleRealInfo.getZdsj(); | |
| 4238 | - String zdsjActual = scheduleRealInfo.getZdsjActual(); | |
| 4239 | - if (zdsj != null && zdsjActual != null && | |
| 4240 | - !zdsj.equals(zdsjActual)) { | |
| 4241 | - if (zdsj.compareTo(zdsjActual) > 0) { | |
| 4242 | - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4243 | - maps.put("slow", ""); | |
| 4244 | - } else { | |
| 4245 | - maps.put("fast", ""); | |
| 4246 | - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4247 | - } | |
| 4247 | + maps = new HashMap<String, Object>(); | |
| 4248 | + try { | |
| 4249 | + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); | |
| 4250 | + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); | |
| 4251 | + maps = rru.getMapValue(scheduleRealInfo); | |
| 4252 | + String zdsj = scheduleRealInfo.getZdsj(); | |
| 4253 | + String zdsjActual = scheduleRealInfo.getZdsjActual(); | |
| 4254 | + if (zdsj != null && zdsjActual != null && | |
| 4255 | + !zdsj.equals(zdsjActual)) { | |
| 4256 | + if (zdsj.compareTo(zdsjActual) > 0) { | |
| 4257 | + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4258 | + maps.put("slow", ""); | |
| 4248 | 4259 | } else { |
| 4249 | 4260 | maps.put("fast", ""); |
| 4250 | - maps.put("slow", ""); | |
| 4261 | + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4251 | 4262 | } |
| 4252 | - listMap.add(maps); | |
| 4253 | - } catch (Exception e) { | |
| 4254 | - e.printStackTrace(); | |
| 4263 | + } else { | |
| 4264 | + maps.put("fast", ""); | |
| 4265 | + maps.put("slow", ""); | |
| 4255 | 4266 | } |
| 4267 | + listMap.add(maps); | |
| 4268 | + } catch (Exception e) { | |
| 4269 | + e.printStackTrace(); | |
| 4270 | + } | |
| 4256 | 4271 | } |
| 4257 | 4272 | |
| 4258 | - | |
| 4273 | + | |
| 4259 | 4274 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 4260 | 4275 | |
| 4261 | 4276 | list.add(listMap.iterator()); |
| ... | ... | @@ -4263,7 +4278,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4263 | 4278 | path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); |
| 4264 | 4279 | // return scheduleRealInfos; |
| 4265 | 4280 | } |
| 4266 | - | |
| 4281 | + | |
| 4267 | 4282 | @Override |
| 4268 | 4283 | public Map<String, Object> exportWaybillMore(Map<String, Object> map) { |
| 4269 | 4284 | String date = map.get("date").toString(); |
| ... | ... | @@ -4287,17 +4302,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4287 | 4302 | file.mkdirs(); |
| 4288 | 4303 | List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); |
| 4289 | 4304 | for (List<String> list : lists) { |
| 4290 | - List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 4305 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 4291 | 4306 | String jName = list.get(0); |
| 4292 | 4307 | String clZbh = list.get(1); |
| 4293 | 4308 | String lpName = list.get(2); |
| 4294 | 4309 | String jGh =list.get(3); |
| 4295 | 4310 | for (int i = 0; i < lists_line.size(); i++) { |
| 4296 | - ScheduleRealInfo s=lists_line.get(i); | |
| 4297 | - if(s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){ | |
| 4298 | - newList.add(s); | |
| 4299 | - } | |
| 4300 | - } | |
| 4311 | + ScheduleRealInfo s=lists_line.get(i); | |
| 4312 | + if(s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){ | |
| 4313 | + newList.add(s); | |
| 4314 | + } | |
| 4315 | + } | |
| 4301 | 4316 | this.exportWaybill_pl(newList, date, jName, clZbh, lpName); |
| 4302 | 4317 | File temp = new File(path + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); |
| 4303 | 4318 | String fileName = file.getName(); | ... | ... |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| ... | ... | @@ -558,7 +558,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 558 | 558 | //有子任务 |
| 559 | 559 | if (cts != null && cts.size() > 0) { |
| 560 | 560 | for(ChildTaskPlan c : cts){ |
| 561 | - if(c.isDestroy() && c.getDestroyReason().equals(item)) | |
| 561 | + if(c.isDestroy() && (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)) | |
| 562 | 562 | sum = Arith.add(sum, c.getMileage()); |
| 563 | 563 | } |
| 564 | 564 | } | ... | ... |
src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
| ... | ... | @@ -6,29 +6,29 @@ import com.bsth.data.BasicData; |
| 6 | 6 | import com.google.common.base.Splitter; |
| 7 | 7 | import org.slf4j.Logger; |
| 8 | 8 | import org.slf4j.LoggerFactory; |
| 9 | -import org.springframework.context.annotation.Scope; | |
| 10 | 9 | import org.springframework.stereotype.Component; |
| 11 | 10 | import org.springframework.web.socket.*; |
| 12 | 11 | |
| 13 | -import java.util.*; | |
| 12 | +import java.util.ArrayList; | |
| 13 | +import java.util.Collection; | |
| 14 | +import java.util.Iterator; | |
| 15 | +import java.util.List; | |
| 14 | 16 | import java.util.concurrent.ConcurrentHashMap; |
| 17 | +import java.util.concurrent.CopyOnWriteArrayList; | |
| 15 | 18 | |
| 16 | 19 | /** |
| 17 | 20 | * @author PanZhao |
| 18 | 21 | */ |
| 19 | 22 | @Component |
| 20 | -@Scope("prototype") | |
| 21 | 23 | public class RealControlSocketHandler implements WebSocketHandler { |
| 22 | 24 | |
| 23 | 25 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 24 | 26 | |
| 25 | 27 | private static ArrayList<WebSocketSession> users; |
| 26 | - //private static final ArrayListMultimap<String, WebSocketSession> listenMap; | |
| 27 | - private static ConcurrentHashMap<String, List<WebSocketSession>> listenMap; | |
| 28 | + private static ConcurrentHashMap<String, CopyOnWriteArrayList<WebSocketSession>> listenMap; | |
| 28 | 29 | |
| 29 | 30 | static { |
| 30 | 31 | users = new ArrayList<WebSocketSession>(); |
| 31 | - //listenMap = ArrayListMultimap.create(); | |
| 32 | 32 | listenMap = new ConcurrentHashMap(); |
| 33 | 33 | } |
| 34 | 34 | |
| ... | ... | @@ -37,30 +37,13 @@ public class RealControlSocketHandler implements WebSocketHandler { |
| 37 | 37 | throws Exception { |
| 38 | 38 | users.remove(session); |
| 39 | 39 | //清理监听 |
| 40 | - //Set<String> keys = listenMap.keySet(); | |
| 41 | - //Map<String, WebSocketSession> remMap = new HashMap<>(); | |
| 42 | - | |
| 43 | 40 | int vsCount=0; |
| 44 | - Collection<List<WebSocketSession>> vs = listenMap.values(); | |
| 45 | - for(List<WebSocketSession> list : vs){ | |
| 41 | + Collection<CopyOnWriteArrayList<WebSocketSession>> vs = listenMap.values(); | |
| 42 | + for(CopyOnWriteArrayList<WebSocketSession> list : vs){ | |
| 46 | 43 | list.remove(session); |
| 47 | 44 | |
| 48 | 45 | vsCount += list.size(); |
| 49 | 46 | } |
| 50 | - /*List<WebSocketSession> vs; | |
| 51 | - for(String k : keys){ | |
| 52 | - //vs = listenMap.get(k); | |
| 53 | - //vs.remove(session); | |
| 54 | - listenMap.get(k).remove() | |
| 55 | - *//*if(listenMap.get(k).contains(session)) | |
| 56 | - remMap.put(k, session);*//* | |
| 57 | - }*/ | |
| 58 | - | |
| 59 | - /*Set<String> remSet = remMap.keySet(); | |
| 60 | - for(String k : remSet){ | |
| 61 | - listenMap.remove(k, remMap.get(k)); | |
| 62 | - logger.info("web socket close, remove listen K: "+ k); | |
| 63 | - }*/ | |
| 64 | 47 | logger.info("listen values size: " + vsCount + " -CloseStatus:" + arg1); |
| 65 | 48 | } |
| 66 | 49 | |
| ... | ... | @@ -81,7 +64,7 @@ public class RealControlSocketHandler implements WebSocketHandler { |
| 81 | 64 | for(String lineCode : idx){ |
| 82 | 65 | if(BasicData.lineCode2NameMap.containsKey(lineCode)){ |
| 83 | 66 | if(!listenMap.containsKey(lineCode)){ |
| 84 | - listenMap.put(lineCode, new ArrayList<WebSocketSession>()); | |
| 67 | + listenMap.put(lineCode, new CopyOnWriteArrayList<WebSocketSession>()); | |
| 85 | 68 | } |
| 86 | 69 | listenMap.get(lineCode).add(session); |
| 87 | 70 | } | ... | ... |
src/main/resources/application-dev.properties
| ... | ... | @@ -10,10 +10,8 @@ spring.jpa.show-sql= true |
| 10 | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | 11 | spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 12 | 12 | spring.datasource.username= root |
| 13 | -spring.datasource.password= | |
| 14 | -#spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 15 | -#spring.datasource.username= root | |
| 16 | -#spring.datasource.password= root | |
| 13 | +spring.datasource.password= root | |
| 14 | + | |
| 17 | 15 | #DATASOURCE |
| 18 | 16 | spring.datasource.max-active=100 |
| 19 | 17 | spring.datasource.max-idle=8 |
| ... | ... | @@ -29,7 +27,6 @@ spring.datasource.validation-query=select 1 |
| 29 | 27 | ## |
| 30 | 28 | #222.66.0.204:5555 |
| 31 | 29 | ##\u5B9E\u65F6gps |
| 32 | -http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ | |
| 33 | 30 | #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/ |
| 34 | 31 | ##\u6D88\u606F\u4E0B\u53D1 |
| 35 | -http.send.directive = http://192.168.168.201:9090/transport_server/message/ | |
| 36 | 32 | \ No newline at end of file |
| 33 | +http.send.directive = http://192.168.168.201:9090/transport_server/message/ | ... | ... |
src/main/resources/static/pages/forms/mould/changetochange.xls
No preview for this file type
src/main/resources/static/pages/mforms/changetochanges/changetochange.html
| ... | ... | @@ -70,14 +70,14 @@ |
| 70 | 70 | class="form-control" type="text" id="endDate" |
| 71 | 71 | style="width: 140px;" /> |
| 72 | 72 | </div> |
| 73 | - <div style="display: inline-block; margin-left: 10px;"> | |
| 74 | - <span class="item-label" style="width: 120px;">类型: </span> <select | |
| 75 | - class="form-control" id="sel"> | |
| 76 | - <option value="">请选择</option> | |
| 77 | - <option value="1">换人</option> | |
| 78 | - <option value="2">换车</option> | |
| 79 | - </select> | |
| 80 | - </div> | |
| 73 | +<!-- <div style="display: inline-block; margin-left: 10px;"> --> | |
| 74 | +<!-- <span class="item-label" style="width: 120px;">类型: </span> <select --> | |
| 75 | +<!-- class="form-control" id="sel"> --> | |
| 76 | +<!-- <option value="">请选择</option> --> | |
| 77 | +<!-- <option value="1">换人</option> --> | |
| 78 | +<!-- <option value="2">换车</option> --> | |
| 79 | +<!-- </select> --> | |
| 80 | +<!-- </div> --> | |
| 81 | 81 | <div class="form-group"> |
| 82 | 82 | <input class="btn btn-default" type="button" id="query" value="筛选" /> |
| 83 | 83 | <input class="btn btn-default" type="button" id="export" |
| ... | ... | @@ -117,10 +117,8 @@ |
| 117 | 117 | <tr> |
| 118 | 118 | <td>车号</td> |
| 119 | 119 | <td>车号</td> |
| 120 | - <td>工号</td> | |
| 121 | - <td>人员</td> | |
| 122 | - <td>工号</td> | |
| 123 | - <td>人员</td> | |
| 120 | + <td colspan="2">工号/人员</td> | |
| 121 | + <td colspan="2">工号/人员</td> | |
| 124 | 122 | </tr> |
| 125 | 123 | </thead> |
| 126 | 124 | <tbody> |
| ... | ... | @@ -188,6 +186,7 @@ |
| 188 | 186 | $("#fgsdmChange").on("change",initXl); |
| 189 | 187 | function initXl(){ |
| 190 | 188 | var data=[]; |
| 189 | + data.push({id: " ", text: "请选择"}); | |
| 191 | 190 | if(fage){ |
| 192 | 191 | $("#line").select2("destroy").html(''); |
| 193 | 192 | } |
| ... | ... | @@ -223,29 +222,15 @@ |
| 223 | 222 | var gsdmChange= $("#gsdmChange").val(); |
| 224 | 223 | var fgsdmChange= $("#fgsdmChange").val(); |
| 225 | 224 | if (startDate1 != '' && endDate1 != '') { |
| 226 | - $post('/mcy_forms/changetochange', { | |
| 225 | + $get('/mcy_forms/changetochange', { | |
| 227 | 226 | sel : sel, |
| 228 | 227 | line : line, |
| 229 | 228 | startDate : $("#startDate").val(), |
| 230 | 229 | endDate : $("#endDate").val(), |
| 230 | + gsdm:gsdmChange, | |
| 231 | + fgsdm:fgsdmChange, | |
| 231 | 232 | type : 'query' |
| 232 | 233 | }, function(result) { |
| 233 | - startDate = $("#startDate").val(); | |
| 234 | - endDate = $("#endDate").val(); | |
| 235 | - $("#sDate").text(startDate); | |
| 236 | - $("#eDate").text(endDate); | |
| 237 | - var temp = {}; | |
| 238 | - var today_account = 0; | |
| 239 | - temp["line"] = $("#line").text(); | |
| 240 | - $.each(result, function(i, obj) { | |
| 241 | - if (moment(obj.schedule_date_str).format( | |
| 242 | - "YYYY-MM-DD") == moment(obj.startDate) | |
| 243 | - .format("YYYY-MM-DD")) { | |
| 244 | - today_account++; | |
| 245 | - } | |
| 246 | - obj.updateDate = moment(obj.startDate).format( | |
| 247 | - "YYYY-MM-DD HH:mm:ss"); | |
| 248 | - }); | |
| 249 | 234 | // 把数据填充到模版中 |
| 250 | 235 | var tbodyHtml = template('changetochange', { |
| 251 | 236 | list : result |
| ... | ... | @@ -294,11 +279,9 @@ |
| 294 | 279 | <td>{{obj.fssj}}</td> |
| 295 | 280 | <td>{{obj.xgsj}}</td> |
| 296 | 281 | <td>{{obj.pcch}}</td> |
| 297 | - <td>{{obj.pcry}}</td> | |
| 298 | - <td>{{obj.jhgh}}</td> | |
| 299 | - <td>{{obj.jhch}}</td> | |
| 300 | - <td>{{obj.sjgh}}</td> | |
| 301 | 282 | <td>{{obj.sjch}}</td> |
| 283 | + <td colspan="2">{{obj.pcry}}</td> | |
| 284 | + <td colspan="2">{{obj.sjgh}}</td> | |
| 302 | 285 | <td>{{obj.yy}}</td> |
| 303 | 286 | <td>{{obj.xgr}}</td> |
| 304 | 287 | </tr> | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/directive_history.html
| 1 | -<div class="uk-modal" id="directive-history-modal"> | |
| 1 | +<div class="uk-modal ct_move_modal" id="directive-history-modal"> | |
| 2 | 2 | <div class="uk-modal-dialog" style="width: 1040px;"> |
| 3 | 3 | <a href="" class="uk-modal-close uk-close"></a> |
| 4 | 4 | <div class="uk-modal-header"> |
| ... | ... | @@ -15,12 +15,12 @@ |
| 15 | 15 | </legend> |
| 16 | 16 | <span class="horizontal-field">指令类型</span> |
| 17 | 17 | <select name="dType"> |
| 18 | - <option value="-1">全部</option> | |
| 19 | - <option value="3">消息短语</option> | |
| 20 | - <option value="0">调度指令</option> | |
| 21 | - <option value="1">运营指令</option> | |
| 22 | - <option value="2">线路切换指令</option> | |
| 23 | - </select> | |
| 18 | + <option value="-1">全部</option> | |
| 19 | + <option value="3">消息短语</option> | |
| 20 | + <option value="0">调度指令</option> | |
| 21 | + <option value="1">运营指令</option> | |
| 22 | + <option value="2">线路切换指令</option> | |
| 23 | + </select> | |
| 24 | 24 | <span class="horizontal-field">车辆</span> |
| 25 | 25 | <div class="uk-autocomplete uk-form" id="uk-autocomplete-cars"> |
| 26 | 26 | <input type="text" name="nbbm" placeholder="车辆自编号"> |
| ... | ... | @@ -33,13 +33,13 @@ |
| 33 | 33 | <div style="height: 495px;margin:5px 0 -18px;"> |
| 34 | 34 | <table class="ct-fixed-table uk-table uk-table-hover"> |
| 35 | 35 | <thead> |
| 36 | - <tr> | |
| 37 | - <th style="width: 6%;">时间</th> | |
| 38 | - <th style="width: 8%;">车辆</th> | |
| 39 | - <th style="width: 44%;">指令内容</th> | |
| 40 | - <th style="width: 7%;">发送人</th> | |
| 41 | - <th style="width: 15%;">状态</th> | |
| 42 | - </tr> | |
| 36 | + <tr> | |
| 37 | + <th style="width: 6%;">时间</th> | |
| 38 | + <th style="width: 8%;">车辆</th> | |
| 39 | + <th style="width: 44%;">指令内容</th> | |
| 40 | + <th style="width: 7%;">发送人</th> | |
| 41 | + <th style="width: 15%;">状态</th> | |
| 42 | + </tr> | |
| 43 | 43 | </thead> |
| 44 | 44 | <tbody> |
| 45 | 45 | </tbody> |
| ... | ... | @@ -61,14 +61,14 @@ |
| 61 | 61 | <td> |
| 62 | 62 | {{if obj.errorText != null}} |
| 63 | 63 | <div class="uk-badge uk-badge-danger"> {{obj.errorText}}</div> |
| 64 | - {{else}} | |
| 65 | - {{if obj.reply46 != 0}} | |
| 66 | - <div class="uk-badge uk-badge-danger"> 设备未响应</div> | |
| 67 | - {{else if obj.reply47 != 0}} | |
| 68 | - <div class="uk-badge uk-badge-warning"> 设备已响应</div> | |
| 69 | - {{else if obj.reply46 == 0 && obj.reply47 == 0}} | |
| 70 | - <div class="uk-badge"> 驾驶员已确认</div> | |
| 71 | - {{/if}} | |
| 64 | + {{else if obj.operCode==96}} | |
| 65 | + {{if obj.reply46 != 0}} | |
| 66 | + <div class="uk-badge uk-badge-danger"> 设备未响应</div> | |
| 67 | + {{else if obj.reply47 != 0}} | |
| 68 | + <div class="uk-badge uk-badge-warning"> 设备已响应</div> | |
| 69 | + {{else if obj.reply46 == 0 && obj.reply47 == 0}} | |
| 70 | + <div class="uk-badge"> 驾驶员已确认</div> | |
| 71 | + {{/if}} | |
| 72 | 72 | {{/if}} |
| 73 | 73 | </td> |
| 74 | 74 | </tr> |
| ... | ... | @@ -87,17 +87,17 @@ |
| 87 | 87 | var carInput = $('#uk-autocomplete-cars input'); |
| 88 | 88 | var search_nbbm = function(release) { |
| 89 | 89 | var q = carInput.val().toUpperCase(), |
| 90 | - rs = [], | |
| 91 | - max = 12, | |
| 92 | - count = 0; | |
| 90 | + rs = [], | |
| 91 | + max = 12, | |
| 92 | + count = 0; | |
| 93 | 93 | |
| 94 | 94 | $.each(cars, function(i, item) { |
| 95 | 95 | if (item.indexOf(q) != -1){ |
| 96 | - rs.push({ | |
| 97 | - value: item, | |
| 98 | - title: item | |
| 99 | - }); | |
| 100 | - count ++; | |
| 96 | + rs.push({ | |
| 97 | + value: item, | |
| 98 | + title: item | |
| 99 | + }); | |
| 100 | + count ++; | |
| 101 | 101 | } |
| 102 | 102 | if (count >= max) |
| 103 | 103 | return false; |
| ... | ... | @@ -156,7 +156,7 @@ |
| 156 | 156 | var resetPagination = true; |
| 157 | 157 | var pagination = function(pages, currentPage) { |
| 158 | 158 | var wrap = $('.pagination-wrap', modal).empty() |
| 159 | - ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap); | |
| 159 | + ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap); | |
| 160 | 160 | |
| 161 | 161 | var pagination = UIkit.pagination(e, { |
| 162 | 162 | pages: pages, |
| ... | ... | @@ -164,8 +164,8 @@ |
| 164 | 164 | }); |
| 165 | 165 | |
| 166 | 166 | e.on('select.uk.pagination', function(e, pageIndex){ |
| 167 | - page = pageIndex; | |
| 168 | - query(); | |
| 167 | + page = pageIndex; | |
| 168 | + query(); | |
| 169 | 169 | }); |
| 170 | 170 | |
| 171 | 171 | resetPagination = false; | ... | ... |