Commit d7fda2e708ef9c219688f9a490899d14421a56eb
Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang
Showing
28 changed files
with
820 additions
and
272 deletions
src/main/java/com/bsth/controller/oil/DlbController.java
| ... | ... | @@ -148,12 +148,12 @@ public class DlbController extends BaseController<Dlb, Integer>{ |
| 148 | 148 | m.put("nbbm", y.getNbbm()); |
| 149 | 149 | m.put("jsy", y.getJsy()); |
| 150 | 150 | m.put("name", y.getName()); |
| 151 | - m.put("cdl", y.getCdl()); | |
| 152 | - m.put("czcd", y.getCzcd()+"%"); | |
| 153 | - m.put("jzcd", y.getJzcd()+"%"); | |
| 154 | - m.put("czlc", y.getCzlc()); | |
| 155 | - m.put("jzlc", y.getJzlc()); | |
| 156 | - m.put("hd", y.getHd()); | |
| 151 | + m.put("cdl", y.getCdl()<=0?"0":y.getCdl()); | |
| 152 | + m.put("czcd", y.getCzcd()<=0?"0":y.getCzcd()+"%"); | |
| 153 | + m.put("jzcd", y.getJzcd()<=0?"0":y.getJzcd()+"%"); | |
| 154 | + m.put("czlc", y.getCzlc()<=0?"0":y.getCzlc()); | |
| 155 | + m.put("jzlc", y.getJzlc()<=0?"0":y.getJzlc()); | |
| 156 | + m.put("hd", y.getHd()<=0?"0":y.getHd()); | |
| 157 | 157 | String shyy ="无"; |
| 158 | 158 | if(y.getShyy()!=null){ |
| 159 | 159 | if(shyy.equals("1")){shyy="票务用油";} |
| ... | ... | @@ -166,22 +166,23 @@ public class DlbController extends BaseController<Dlb, Integer>{ |
| 166 | 166 | else if(shyy.equals("8")){shyy="车间(小修)";} |
| 167 | 167 | else{shyy ="无";} |
| 168 | 168 | } |
| 169 | - m.put("ns", y.getNs()); | |
| 169 | + m.put("ns", y.getNs()<=0?"0":y.getNs()); | |
| 170 | 170 | m.put("shyy", shyy); |
| 171 | - m.put("sh", y.getSh()); | |
| 172 | - m.put("zlc", y.getZlc()); | |
| 171 | + m.put("sh", y.getSh()<=0?"0":y.getSh()); | |
| 172 | + m.put("zlc", y.getZlc()<=0?"0":y.getZlc()); | |
| 173 | 173 | m.put("rdlx", ""); |
| 174 | 174 | m.put("bglyh", y.getBglyh()); |
| 175 | 175 | resList.add(m); |
| 176 | 176 | } |
| 177 | 177 | try { |
| 178 | + map.put("sheetName", map.get("rq")); | |
| 178 | 179 | listI.add(resList.iterator()); |
| 179 | 180 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 180 | 181 | ee.excelReplace(listI, new Object[] { map }, path+"mould/listDl.xls", |
| 181 | 182 | path+"export/"+map.get("rq").toString()+ "进出场存电量.xls"); |
| 182 | 183 | } catch (Exception e) { |
| 183 | 184 | e.printStackTrace(); |
| 184 | - } | |
| 185 | + } | |
| 185 | 186 | |
| 186 | 187 | return resList; |
| 187 | 188 | ... | ... |
src/main/java/com/bsth/controller/oil/YlbController.java
| ... | ... | @@ -236,19 +236,19 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 236 | 236 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 237 | 237 | for (Ylb y : ylb) { |
| 238 | 238 | Map<String, Object> m = new HashMap<String, Object>(); |
| 239 | - m.put("rq", y.getRq()); | |
| 239 | + m.put("rq", sdfMonth.format(y.getRq())); | |
| 240 | 240 | m.put("gsname",y.getGsname() ); |
| 241 | 241 | m.put("fgsname", y.getFgsname()); |
| 242 | 242 | m.put("xlname", y.getXlname()==null?"":y.getXlname()); |
| 243 | 243 | m.put("nbbm", y.getNbbm()); |
| 244 | 244 | m.put("jsy", y.getJsy()); |
| 245 | 245 | m.put("name", y.getName()); |
| 246 | - m.put("jzl", y.getJzl()); | |
| 247 | - m.put("czlc", y.getCzlc()); | |
| 248 | - m.put("jzlc", y.getJzlc()); | |
| 249 | - m.put("czyl", y.getCzyl()); | |
| 250 | - m.put("jzyl", y.getJzyl()); | |
| 251 | - m.put("yh", y.getYh()); | |
| 246 | + m.put("jzl", y.getJzl()<=0?"0":y.getJzl()); | |
| 247 | + m.put("czlc", y.getCzlc()<=0?"0":y.getCzlc()); | |
| 248 | + m.put("jzlc", y.getJzlc()<=0?"0":y.getJzlc()); | |
| 249 | + m.put("czyl", y.getCzyl()<=0?"0":y.getCzyl()); | |
| 250 | + m.put("jzyl", y.getJzyl()<=0?"0":y.getJzyl()); | |
| 251 | + m.put("yh", y.getYh()<=0?"0":y.getYh()); | |
| 252 | 252 | String rylx=""; |
| 253 | 253 | if(y.getRylx()!=null){ |
| 254 | 254 | if(y.getRylx().equals("0")){rylx="0号柴油";} |
| ... | ... | @@ -270,12 +270,13 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 270 | 270 | else{shyy ="无";} |
| 271 | 271 | } |
| 272 | 272 | m.put("shyy", shyy); |
| 273 | - m.put("sh", y.getSh()); | |
| 274 | - m.put("zlc", y.getZlc()); | |
| 273 | + m.put("sh", y.getSh()<=0?"0":y.getSh()); | |
| 274 | + m.put("zlc", y.getZlc()<=0?"0":y.getZlc()); | |
| 275 | 275 | m.put("bglyh", y.getBglyh()); |
| 276 | 276 | resList.add(m); |
| 277 | 277 | } |
| 278 | 278 | try { |
| 279 | + map.put("sheetName", map.get("rq")); | |
| 279 | 280 | listI.add(resList.iterator()); |
| 280 | 281 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 281 | 282 | ee.excelReplace(listI, new Object[] { map }, path+"mould/list.xls", | ... | ... |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -309,6 +309,12 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 309 | 309 | @RequestParam String code,@RequestParam String xlName, @RequestParam String type) { |
| 310 | 310 | return scheduleRealInfoService.account(line, date, code, xlName, type); |
| 311 | 311 | } |
| 312 | + | |
| 313 | + @RequestMapping(value = "/accountPx") | |
| 314 | + public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date, | |
| 315 | + @RequestParam String code,@RequestParam String xlName, @RequestParam String px) { | |
| 316 | + return scheduleRealInfoService.accountPx(line, date, code, xlName, px); | |
| 317 | + } | |
| 312 | 318 | |
| 313 | 319 | @RequestMapping(value = "/correctForm") |
| 314 | 320 | public List<ScheduleRealInfo> correctForm(@RequestParam String line, @RequestParam String startDate, | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| ... | ... | @@ -289,7 +289,7 @@ public class BasicData implements CommandLineRunner { |
| 289 | 289 | num = 1; |
| 290 | 290 | lineCode = tempArray[0]+""; |
| 291 | 291 | } |
| 292 | - key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2]; | |
| 292 | + key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[3]; | |
| 293 | 293 | tempStationName2YgcNumber.put(key,num++); |
| 294 | 294 | } |
| 295 | 295 | } | ... | ... |
src/main/java/com/bsth/data/car_out_info/CarOutInfoHandler.java
| ... | ... | @@ -43,7 +43,7 @@ public class CarOutInfoHandler { |
| 43 | 43 | bcTypeMap.put("ldks", "两点间空驶"); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - private static ScheduleComparator.FCSJ schFCSJComparator = new ScheduleComparator.FCSJ(); | |
| 46 | + private static ScheduleComparator.DFSJ schDFSJComparator = new ScheduleComparator.DFSJ(); | |
| 47 | 47 | |
| 48 | 48 | @Autowired |
| 49 | 49 | JdbcTemplate jdbcTemplate; |
| ... | ... | @@ -165,9 +165,9 @@ public class CarOutInfoHandler { |
| 165 | 165 | */ |
| 166 | 166 | private ScheduleRealInfo[] nexts(List<ScheduleRealInfo> list) { |
| 167 | 167 | ScheduleRealInfo[] array = new ScheduleRealInfo[3]; |
| 168 | - Collections.sort(list, schFCSJComparator); | |
| 168 | + Collections.sort(list, schDFSJComparator); | |
| 169 | 169 | |
| 170 | - int count = 0, threshold = 1000 * 60 * 30; | |
| 170 | + int count = 0, threshold = 1000 * 60 * 60; | |
| 171 | 171 | long t = System.currentTimeMillis(); |
| 172 | 172 | for (ScheduleRealInfo sch : list) { |
| 173 | 173 | if (count == 3) | ... | ... |
src/main/java/com/bsth/data/schedule/ScheduleComparator.java
| ... | ... | @@ -28,4 +28,12 @@ public class ScheduleComparator { |
| 28 | 28 | return (int) (s1.getFcsjT() - s2.getFcsjT()); |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | + | |
| 32 | + public static class DFSJ implements Comparator<ScheduleRealInfo>{ | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) { | |
| 36 | + return (int) (s1.getDfsjT() - s2.getDfsjT()); | |
| 37 | + } | |
| 38 | + } | |
| 31 | 39 | } | ... | ... |
src/main/java/com/bsth/data/schedule/edit_logs/ScheduleModifyLogger.java
| ... | ... | @@ -187,17 +187,9 @@ public class ScheduleModifyLogger { |
| 187 | 187 | String newNbbm = cpc.getClZbh(); |
| 188 | 188 | String newJsy = cpc.getJsy(); |
| 189 | 189 | String newSpy = cpc.getSpy(); |
| 190 | - //String oldJsy = sch.getjGh() + "/" + sch.getjName(); | |
| 191 | 190 | |
| 192 | 191 | if (newNbbm == null && newJsy == null && newSpy==null) |
| 193 | 192 | return; |
| 194 | - /*if (newNbbm != null && newJsy != null | |
| 195 | - && newNbbm.equals(sch.getClZbh()) && newJsy.equals(oldJsy)) | |
| 196 | - return;*/ | |
| 197 | - | |
| 198 | - | |
| 199 | - SchEditInfo sei = SchEditInfo.getInstance(sch); | |
| 200 | - sei.setType(EditType.TZRC); | |
| 201 | 193 | |
| 202 | 194 | //detail |
| 203 | 195 | JSONObject jobj = new JSONObject(); |
| ... | ... | @@ -213,11 +205,22 @@ public class ScheduleModifyLogger { |
| 213 | 205 | } |
| 214 | 206 | |
| 215 | 207 | String oldSpy = sch.getsGh() + "/" + sch.getsName(); |
| 216 | - if (StringUtils.isNotEmpty(newSpy) && !newSpy.equals(oldSpy)) { | |
| 217 | - jobj.put("old_spy", oldSpy); | |
| 218 | - jobj.put("now_spy", cpc.getSpy()); | |
| 208 | + if(newSpy != null){ | |
| 209 | + if(newSpy.equals("")) | |
| 210 | + newSpy = "/"; | |
| 211 | + | |
| 212 | + if(!newSpy.equals(oldSpy)){ | |
| 213 | + jobj.put("old_spy", oldSpy); | |
| 214 | + jobj.put("now_spy", newSpy); | |
| 215 | + } | |
| 219 | 216 | } |
| 220 | 217 | |
| 218 | + if(jobj.size() == 0) | |
| 219 | + return; | |
| 220 | + | |
| 221 | + SchEditInfo sei = SchEditInfo.getInstance(sch); | |
| 222 | + sei.setType(EditType.TZRC); | |
| 223 | + | |
| 221 | 224 | sei.setJsonArray(jobj.toJSONString()); |
| 222 | 225 | put(sei); |
| 223 | 226 | } catch (Exception e) { | ... | ... |
src/main/java/com/bsth/entity/oil/Dlb.java
src/main/java/com/bsth/entity/oil/Ylb.java
src/main/java/com/bsth/repository/StationRouteRepository.java
| ... | ... | @@ -3,7 +3,6 @@ package com.bsth.repository; |
| 3 | 3 | import java.util.List; |
| 4 | 4 | import java.util.Map; |
| 5 | 5 | |
| 6 | -import com.bsth.entity.schedule.CarConfigInfo; | |
| 7 | 6 | import org.springframework.data.domain.Page; |
| 8 | 7 | import org.springframework.data.domain.Pageable; |
| 9 | 8 | import org.springframework.data.domain.Sort; |
| ... | ... | @@ -15,7 +14,6 @@ import org.springframework.stereotype.Repository; |
| 15 | 14 | import org.springframework.transaction.annotation.Transactional; |
| 16 | 15 | |
| 17 | 16 | import com.bsth.entity.Line; |
| 18 | -import com.bsth.entity.LineInformation; | |
| 19 | 17 | import com.bsth.entity.StationRoute; |
| 20 | 18 | |
| 21 | 19 | /** |
| ... | ... | @@ -262,7 +260,7 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int |
| 262 | 260 | List<StationRoute> findByLineCode(String lineCode); |
| 263 | 261 | |
| 264 | 262 | @Query("SELECT " + |
| 265 | - "lineCode,directions,stationName,stationRouteCode " + | |
| 263 | + "lineCode,directions,stationName,stationCode " + | |
| 266 | 264 | "FROM " + |
| 267 | 265 | "StationRoute s " + |
| 268 | 266 | "WHERE " + | ... | ... |
src/main/java/com/bsth/repository/oil/DlbRepository.java
| ... | ... | @@ -81,7 +81,8 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ |
| 81 | 81 | + " and nbbm like %?5%",nativeQuery=true) |
| 82 | 82 | List<Object[]> sumDlb2(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); |
| 83 | 83 | |
| 84 | - | |
| 84 | + @Transactional | |
| 85 | + @Modifying | |
| 85 | 86 | @Query(value="UPDATE bsth_c_dlb SET " + |
| 86 | 87 | " czcd= ?2,"+ |
| 87 | 88 | " jzcd = ?3, " + | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| ... | ... | @@ -559,8 +559,9 @@ public class FormsServiceImpl implements FormsService { |
| 559 | 559 | return sin; |
| 560 | 560 | } |
| 561 | 561 | }); |
| 562 | - | |
| 562 | + DecimalFormat df = new DecimalFormat("0.00"); | |
| 563 | 563 | List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); |
| 564 | + List<Dlb> listDlb= dlbRepository.obtainDl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 564 | 565 | List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLine(xlbm, startDate); |
| 565 | 566 | for (int i = 0; i < list.size(); i++) { |
| 566 | 567 | List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); |
| ... | ... | @@ -569,10 +570,12 @@ public class FormsServiceImpl implements FormsService { |
| 569 | 570 | String jsy=sin.getJsy(); |
| 570 | 571 | String clzbh=sin.getClzbh(); |
| 571 | 572 | String xl=sin.getxL(); |
| 573 | + String spy=sin.getSgh(); | |
| 572 | 574 | sin.setxL(BasicData.lineCode2NameMap.get(xl)); |
| 573 | 575 | for (int j = 0; j < listReal.size(); j++) { |
| 574 | 576 | ScheduleRealInfo s=listReal.get(j); |
| 575 | - if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)&&s.getXlBm().equals(xl)){ | |
| 577 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 578 | + &&s.getXlBm().equals(xl)&&s.getsGh().equals(spy)){ | |
| 576 | 579 | newList.add(s); |
| 577 | 580 | } |
| 578 | 581 | } |
| ... | ... | @@ -584,23 +587,39 @@ public class FormsServiceImpl implements FormsService { |
| 584 | 587 | double jcgl=culateMileageService.culateJccgl(newList); |
| 585 | 588 | double zyygl=Arith.add(yygl, ljgl); |
| 586 | 589 | double zksgl=Arith.add(ksgl, jcgl); |
| 590 | + double zlc=Arith.add(zyygl,zksgl); | |
| 587 | 591 | sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); |
| 588 | 592 | sin.setEmptMileage(String.valueOf(zksgl)); |
| 589 | 593 | sin.setJhjl(String.valueOf(jhgl)); |
| 590 | 594 | double yhl=0.0; |
| 591 | 595 | double jzl=0.0; |
| 592 | 596 | double fyy=0.0; |
| 597 | + double zlcs=0.0; | |
| 593 | 598 | for (int j = 0; j < listYlb.size(); j++) { |
| 594 | 599 | Ylb y=listYlb.get(j); |
| 595 | 600 | if(y.getJsy().equals(jsy) && y.getNbbm().equals(clzbh)){ |
| 596 | 601 | yhl=Arith.add(yhl, y.getYh()==null?0:y.getYh()); |
| 597 | 602 | jzl=Arith.add(jzl, y.getJzl()==null?0:y.getJzl()); |
| 598 | 603 | fyy=Arith.add(fyy, y.getSh()==null?0:y.getSh()); |
| 604 | + zlcs=Arith.add(zlcs, y.getZlc()==null?0:y.getZlc()); | |
| 599 | 605 | } |
| 600 | 606 | } |
| 601 | - sin.setHyl(String.valueOf(yhl)); | |
| 602 | - sin.setJzl(String.valueOf(jzl)); | |
| 603 | - sin.setUnyyyl(String.valueOf(fyy)); | |
| 607 | + | |
| 608 | + for(int j=0;j<listDlb.size();j++){ | |
| 609 | + Dlb d=listDlb.get(j); | |
| 610 | + if(d.getJsy().equals(jsy)&&d.getNbbm().equals(clzbh)){ | |
| 611 | + yhl=Arith.add(yhl, d.getHd()==null?0:d.getHd()); | |
| 612 | + jzl=Arith.add(jzl, d.getCdl()==null?0:d.getCdl()); | |
| 613 | + fyy=Arith.add(fyy, d.getSh()==null?0:d.getSh()); | |
| 614 | + zlcs=Arith.add(zlcs, d.getZlc()==null?0:d.getZlc()); | |
| 615 | + } | |
| 616 | + } | |
| 617 | + if(zlcs>0){ | |
| 618 | + double lcbfb= zlc/zlcs; | |
| 619 | + sin.setHyl(df.format(yhl*lcbfb)); | |
| 620 | + sin.setJzl(df.format(jzl*lcbfb)); | |
| 621 | + sin.setUnyyyl(df.format(fyy*lcbfb)); | |
| 622 | + } | |
| 604 | 623 | } |
| 605 | 624 | return list; |
| 606 | 625 | } |
| ... | ... | @@ -658,6 +677,24 @@ public class FormsServiceImpl implements FormsService { |
| 658 | 677 | return y; |
| 659 | 678 | } |
| 660 | 679 | }); |
| 680 | + | |
| 681 | + String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+startDate+"' and '"+endDate+"'"; | |
| 682 | + if(xlbm.equals("")){ | |
| 683 | + ylbSql +="and ssgsdm='"+gsdm+"' " | |
| 684 | + + " and fgsdm='"+fgsdm+"'"; | |
| 685 | + }else{ | |
| 686 | + ylbSql += " and xlbm = '"+xlbm+"'"; | |
| 687 | + } | |
| 688 | + List<Dlb> dlbList= jdbcTemplate.query(dlbSql, new RowMapper<Dlb>() { | |
| 689 | + @Override | |
| 690 | + public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 691 | + Dlb d = new Dlb(); | |
| 692 | + d.setCdl(arg0.getDouble("cdl")); | |
| 693 | + d.setXlbm(arg0.getString("xlbm")); | |
| 694 | + d.setHd(arg0.getDouble("hd")); | |
| 695 | + return d; | |
| 696 | + } | |
| 697 | + }); | |
| 661 | 698 | List<ScheduleRealInfo> listReal; |
| 662 | 699 | if(xlbm.equals("")){ |
| 663 | 700 | listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj(xlbm, startDate, endDate, gsdm, fgsdm); |
| ... | ... | @@ -700,6 +737,13 @@ public class FormsServiceImpl implements FormsService { |
| 700 | 737 | xhl=Arith.add(xhl, t.getYh()); |
| 701 | 738 | } |
| 702 | 739 | } |
| 740 | + for (int j = 0; j < dlbList.size(); j++) { | |
| 741 | + Dlb d=dlbList.get(j); | |
| 742 | + if(d.getXlbm().equals(line)){ | |
| 743 | + jzl=Arith.add(jzl, d.getCdl()); | |
| 744 | + xhl=Arith.add(xhl, d.getHd()); | |
| 745 | + } | |
| 746 | + } | |
| 703 | 747 | |
| 704 | 748 | o.setJzl(String.valueOf(jzl)); |
| 705 | 749 | o.setXhl(String.valueOf(xhl)); |
| ... | ... | @@ -731,7 +775,8 @@ public class FormsServiceImpl implements FormsService { |
| 731 | 775 | }); |
| 732 | 776 | |
| 733 | 777 | |
| 734 | - List<Ylb> listYlb= ylbRepository.obtainYl(startDate, "", "", line, "", "xlbm"); | |
| 778 | + List<Ylb> listYlb= ylbRepository.obtainYl(date, "", "", line, "", "xlbm"); | |
| 779 | + List<Dlb> listDlb= dlbRepository.obtainDl(date, "", "", line, "", "xlbm"); | |
| 735 | 780 | List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); |
| 736 | 781 | for (int i = 0; i < list.size(); i++) { |
| 737 | 782 | List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); |
| ... | ... | @@ -771,6 +816,14 @@ public class FormsServiceImpl implements FormsService { |
| 771 | 816 | ns =Arith.add(ns, y.getNs()==null?0:y.getNs()); |
| 772 | 817 | } |
| 773 | 818 | } |
| 819 | + for (int j = 0; j < listDlb.size(); j++) { | |
| 820 | + Dlb d=listDlb.get(j); | |
| 821 | + if(d.getJsy().equals(jsy) && d.getNbbm().equals(clzbh)){ | |
| 822 | + yhl=Arith.add(yhl, d.getHd()==null?0:d.getHd()); | |
| 823 | + jzl=Arith.add(jzl, d.getCdl()==null?0:d.getCdl()); | |
| 824 | + fyy=Arith.add(fyy, d.getSh()==null?0:d.getSh()); | |
| 825 | + } | |
| 826 | + } | |
| 774 | 827 | sin.setHyl(String.valueOf(yhl)); |
| 775 | 828 | sin.setJzl(String.valueOf(jzl)); |
| 776 | 829 | sin.setUnyyyl(String.valueOf(fyy)); | ... | ... |
src/main/java/com/bsth/service/impl/StationServiceImpl.java
| ... | ... | @@ -335,7 +335,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 335 | 335 | arg0.setDestroy(destroy); |
| 336 | 336 | // 版本号 |
| 337 | 337 | arg0.setVersions(versions); |
| 338 | - /*arg0.setbJwpoints(bJwpoints);*/ | |
| 338 | + arg0.setbJwpoints(bJwpoints); | |
| 339 | 339 | // 插入站点信息 |
| 340 | 340 | repository.save(arg0); |
| 341 | 341 | ... | ... |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| ... | ... | @@ -140,51 +140,45 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 140 | 140 | try { |
| 141 | 141 | Iterator<Line> lineIterator = lineRepository.findAll().iterator(); |
| 142 | 142 | Line line = null; |
| 143 | - List<StationRoute> stationsList = null;// 站点路由集 | |
| 143 | + List<StationRoute> upStationsList = null;// 上行站点路由集 | |
| 144 | + List<StationRoute> downStationsList = null;// 下行站点路由集 | |
| 144 | 145 | List<LineInformation> lineInformationsList = null; |
| 145 | 146 | LineInformation lineInformation = null; |
| 146 | - sBuffer.append("<XLs>"); | |
| 147 | + sBuffer.append("<Data>"); | |
| 148 | + sBuffer.append("<RequestOrg>上海巴士拓华科技发展有限公司</RequestOrg>"); | |
| 149 | + sBuffer.append("<DataList>"); | |
| 147 | 150 | while(lineIterator.hasNext()){ |
| 148 | 151 | line = lineIterator.next(); |
| 152 | + if(!line.getName().equals("浦江4路")){ | |
| 153 | + continue; | |
| 154 | + } | |
| 149 | 155 | if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null |
| 150 | 156 | || line.getInUse() == 0){ |
| 151 | 157 | continue; |
| 152 | 158 | } |
| 153 | - sBuffer.append("<XL>"); | |
| 154 | - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</XLBM>"); | |
| 155 | - sBuffer.append("<XLMC>").append(line.getName()).append("</XLMC>"); | |
| 156 | - sBuffer.append("<QDZ>").append(line.getStartStationName()).append("</QDZ>"); | |
| 157 | - sBuffer.append("<ZDZ>").append(line.getEndStationName()).append("</ZDZ>"); | |
| 158 | - // 线路标准信息实体 | |
| 159 | - lineInformationsList = lineInformationRepository.findByLine(line); | |
| 160 | - int size = lineInformationsList.size(); | |
| 161 | - if(lineInformationsList != null && size > 0){ | |
| 162 | - double upMileage = 0.0; // 上行里程 | |
| 163 | - double downMileage = 0.0; // 下行里程 | |
| 164 | - // 如果线路标准有多个,累加上行里程和下行里程 | |
| 165 | - for (int i = 0; i < size; i++) { | |
| 166 | - lineInformation = lineInformationsList.get(i); | |
| 167 | - upMileage +=lineInformation.getUpMileage(); | |
| 168 | - downMileage +=lineInformation.getDownMileage(); | |
| 169 | - } | |
| 170 | - sBuffer.append("<QZLC>").append(upMileage).append("</QZLC>"); | |
| 171 | - sBuffer.append("<ZQLC>").append(downMileage).append("</ZQLC>"); | |
| 172 | - } | |
| 173 | - sBuffer.append("<XLGH>").append(line.getLinePlayType() == null ?"0":line.getLinePlayType()) | |
| 174 | - .append("</XLGH>"); | |
| 159 | + sBuffer.append("<LINE_ID>").append(line.getId()).append("</LINE_ID>"); | |
| 160 | + sBuffer.append("<LINE_CODE>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</LINE_CODE>"); | |
| 161 | + sBuffer.append("<LINE_NAME>").append(line.getName()).append("</LINE_NAME>"); | |
| 175 | 162 | // 循环添加站点信息 |
| 176 | - sBuffer.append("<StationList>"); | |
| 163 | + sBuffer.append("<LineStationList>"); | |
| 177 | 164 | // 先查上行 |
| 178 | - stationsList = stationRouteRepository.findByLine(line.getLineCode(), 0); | |
| 165 | + upStationsList = stationRouteRepository.findByLine(line.getLineCode(), 0); | |
| 179 | 166 | int startId = 1; |
| 180 | - startId = packagStationXml(stationsList, sBuffer, startId); | |
| 167 | + startId = packagStationXml(upStationsList, sBuffer, startId); | |
| 181 | 168 | // 再查下行 |
| 182 | - stationsList = stationRouteRepository.findByLine(line.getLineCode(), 1); | |
| 183 | - packagStationXml(stationsList, sBuffer, startId); | |
| 184 | - sBuffer.append("</StationList>"); | |
| 185 | - sBuffer.append("</XL>"); | |
| 169 | + downStationsList = stationRouteRepository.findByLine(line.getLineCode(), 1); | |
| 170 | + packagStationXml(downStationsList, sBuffer, startId); | |
| 171 | + sBuffer.append("</LineStationList>"); | |
| 172 | + | |
| 173 | + // 循环添加站点点位信息 | |
| 174 | + sBuffer.append("<LinePointList>"); | |
| 175 | + startId = 1; | |
| 176 | + startId = packagStationPointXml(upStationsList, sBuffer, startId); | |
| 177 | + packagStationPointXml(downStationsList, sBuffer, startId); | |
| 178 | + sBuffer.append("</LinePointList>"); | |
| 186 | 179 | } |
| 187 | - sBuffer.append("</XLs>"); | |
| 180 | + sBuffer.append("</DataList>"); | |
| 181 | + sBuffer.append("</Data>"); | |
| 188 | 182 | System.out.println(sBuffer.toString()); |
| 189 | 183 | if(sBuffer.indexOf("<XL>") != -1){ |
| 190 | 184 | portType = new Internal().getInternalHttpSoap11Endpoint(); |
| ... | ... | @@ -329,7 +323,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 329 | 323 | sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); |
| 330 | 324 | sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); |
| 331 | 325 | sf.append("<LDList>"); |
| 332 | - | |
| 333 | 326 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 334 | 327 | if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("lpName")+"") |
| 335 | 328 | .equals(scheduleRealInfo.getLpName()) |
| ... | ... | @@ -355,7 +348,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 355 | 348 | sf.append("<SXX>"+scheduleRealInfo.getXlDir()+"</SXX>"); |
| 356 | 349 | sf.append("<FCZDMC>"+scheduleRealInfo.getQdzName()+"</FCZDMC>"); |
| 357 | 350 | sf.append("<FCZDXH>" + getYgcStationNumByLineCodeAndDirectionAndStationName( |
| 358 | - scheduleRealInfo.getXlBm(), scheduleRealInfo.getXlDir(), scheduleRealInfo.getQdzName()) + "</FCZDXH>"); | |
| 351 | + scheduleRealInfo.getXlBm(), scheduleRealInfo.getXlDir(), scheduleRealInfo.getQdzCode()) + "</FCZDXH>"); | |
| 359 | 352 | sf.append("<FCZDBM>"+scheduleRealInfo.getQdzCode()+"</FCZDBM>"); |
| 360 | 353 | sf.append("<JHFCSJ>"+scheduleRealInfo.getFcsj()+"</JHFCSJ>"); |
| 361 | 354 | sf.append("<DFSJ>"+scheduleRealInfo.getDfsj()+"</DFSJ>"); |
| ... | ... | @@ -363,7 +356,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 363 | 356 | sf.append("<FCZDLX>"+""+"</FCZDLX>"); |
| 364 | 357 | sf.append("<DDZDMC>"+scheduleRealInfo.getZdzName()+"</DDZDMC>"); |
| 365 | 358 | sf.append("<DDZDXH>"+ getYgcStationNumByLineCodeAndDirectionAndStationName( |
| 366 | - scheduleRealInfo.getXlBm(), scheduleRealInfo.getXlDir(), scheduleRealInfo.getZdzName()) +"</DDZDXH>"); | |
| 359 | + scheduleRealInfo.getXlBm(), scheduleRealInfo.getXlDir(), scheduleRealInfo.getZdzCode()) +"</DDZDXH>"); | |
| 367 | 360 | sf.append("<DDZDBM>"+scheduleRealInfo.getZdzCode()+"</DDZDBM>"); |
| 368 | 361 | sf.append("<JHDDSJ>"+scheduleRealInfo.getZdsj()+"</JHDDSJ>"); |
| 369 | 362 | sf.append("<SJDDSJ>"+scheduleRealInfo.getZdsjActual()+"</SJDDSJ>"); |
| ... | ... | @@ -382,6 +375,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 382 | 375 | Results results = ssop.setLD(userNameOther, passwordOther, sf.toString()); |
| 383 | 376 | if(results.isSuccess()){ |
| 384 | 377 | result = "success"; |
| 378 | + }else{ | |
| 379 | + result = "failure"; | |
| 385 | 380 | } |
| 386 | 381 | logger.info("setLD:"+sf.toString()); |
| 387 | 382 | logger.info("setLD:"+result); |
| ... | ... | @@ -393,11 +388,33 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 393 | 388 | Results results = ssop.setLD(userNameOther, passwordOther, sf.toString()); |
| 394 | 389 | if(results.isSuccess()){ |
| 395 | 390 | result = "success"; |
| 391 | + }else{ | |
| 392 | + result = "failure"; | |
| 396 | 393 | } |
| 397 | 394 | logger.info("setLD:"+sf.toString()); |
| 398 | 395 | logger.info("setLD:"+result); |
| 399 | 396 | } |
| 397 | + } catch (Exception e) { | |
| 398 | + logger.error("setLD:",e); | |
| 399 | + e.printStackTrace(); | |
| 400 | + }finally{ | |
| 400 | 401 | |
| 402 | + } | |
| 403 | + return result; | |
| 404 | + } | |
| 405 | + | |
| 406 | + /** | |
| 407 | + * 上传路单 xml来自文件 | |
| 408 | + * @return 上传成功标识 | |
| 409 | + */ | |
| 410 | + public String setLDFile(){ | |
| 411 | + String result = "failure"; | |
| 412 | + try { | |
| 413 | + String tmp = readXmlFromFile("E:/ld.txt"); | |
| 414 | + Results rss = ssop.setLD(userNameOther, passwordOther, tmp); | |
| 415 | + if(rss.isSuccess()){ | |
| 416 | + result = "success"; | |
| 417 | + } | |
| 401 | 418 | } catch (Exception e) { |
| 402 | 419 | logger.error("setLD:",e); |
| 403 | 420 | e.printStackTrace(); |
| ... | ... | @@ -660,11 +677,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 660 | 677 | sBuffer.append("<SXX>").append(schedulePlanInfo.getXlDir()).append("</SXX>"); |
| 661 | 678 | sBuffer.append("<FCZDMC>").append(schedulePlanInfo.getQdzName()).append("</FCZDMC>"); |
| 662 | 679 | sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( |
| 663 | - schedulePlanInfo.getXlBm(), schedulePlanInfo.getXlDir(), schedulePlanInfo.getQdzName())).append("</ZDXH>"); | |
| 680 | + schedulePlanInfo.getXlBm(), schedulePlanInfo.getXlDir(), schedulePlanInfo.getQdzCode())).append("</ZDXH>"); | |
| 664 | 681 | sBuffer.append("<JHFCSJ>").append(schedulePlanInfo.getFcsj()).append("</JHFCSJ>"); |
| 665 | 682 | sBuffer.append("<DDZDMC>").append(schedulePlanInfo.getZdzName()).append("</DDZDMC>"); |
| 666 | 683 | sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( |
| 667 | - schedulePlanInfo.getXlBm(), schedulePlanInfo.getXlDir(), schedulePlanInfo.getZdzName())).append("</DDXH>"); | |
| 684 | + schedulePlanInfo.getXlBm(), schedulePlanInfo.getXlDir(), schedulePlanInfo.getZdzCode())).append("</DDXH>"); | |
| 668 | 685 | sBuffer.append("<JHDDSJ>").append(calcDdsj(schedulePlanInfo.getFcsj(),schedulePlanInfo.getBcsj())) |
| 669 | 686 | .append("</JHDDSJ>"); |
| 670 | 687 | sBuffer.append("</BC>"); |
| ... | ... | @@ -767,11 +784,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 767 | 784 | sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>"); |
| 768 | 785 | sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>"); |
| 769 | 786 | sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( |
| 770 | - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationName())).append("</ZDXH>"); | |
| 787 | + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationCod())).append("</ZDXH>"); | |
| 771 | 788 | sBuffer.append("<JHFCSJ>").append(changeTimeFormat(ttInfoDetail)).append("</JHFCSJ>"); |
| 772 | 789 | sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>"); |
| 773 | 790 | sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( |
| 774 | - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationName())).append("</DDXH>"); | |
| 791 | + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationCod())).append("</DDXH>"); | |
| 775 | 792 | sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>"); |
| 776 | 793 | sBuffer.append("</BC>"); |
| 777 | 794 | } |
| ... | ... | @@ -1131,15 +1148,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 1131 | 1148 | zdlx = "2"; |
| 1132 | 1149 | } |
| 1133 | 1150 | sBuffer.append("<Station>"); |
| 1134 | - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(srRoute.getLineCode(),srRoute.getDirections()+"",srRoute.getStationName())).append("</ZDXH>"); | |
| 1135 | - sBuffer.append("<SXX>").append(srRoute.getDirections()).append("</SXX>"); | |
| 1136 | - sBuffer.append("<ZDMC>").append(srRoute.getStationName()).append("</ZDMC>"); | |
| 1137 | - sBuffer.append("<ZDBM>").append(srRoute.getStationCode()).append("</ZDBM>"); | |
| 1138 | - sBuffer.append("<ZDJD>").append(srRoute.getStation().getgLonx()).append("</ZDJD>"); | |
| 1139 | - sBuffer.append("<ZDWD>").append(srRoute.getStation().getgLaty()).append("</ZDWD>"); | |
| 1140 | - sBuffer.append("<ZZ>").append(srRoute.getStation().getAddr()).append("</ZZ>");//站点的具体地址 | |
| 1141 | - sBuffer.append("<ZDLX>").append(zdlx).append("</ZDLX>"); | |
| 1142 | - sBuffer.append("<ZJLC>").append(srRoute.getDistances()).append("</ZJLC>"); | |
| 1151 | + sBuffer.append("<STATION_ID>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(srRoute.getLineCode(),srRoute.getDirections()+"",srRoute.getStationCode())).append("</STATION_ID>"); | |
| 1152 | + sBuffer.append("<UPDDOWN>").append(srRoute.getDirections()).append("</UPDDOWN>"); | |
| 1153 | + sBuffer.append("<STATION_NO>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(srRoute.getLineCode(),srRoute.getDirections()+"",srRoute.getStationCode())).append("</STATION_NO>"); | |
| 1154 | + sBuffer.append("<STATION_CODE>").append(srRoute.getStationCode()).append("</STATION_CODE>"); | |
| 1155 | + sBuffer.append("<STATION_NAME>").append(srRoute.getStationName()).append("</STATION_NAME>"); | |
| 1156 | + sBuffer.append("<STATION_LON>").append(srRoute.getStation().getgLonx()).append("</STATION_LON>"); | |
| 1157 | + sBuffer.append("<STATION_LAT>").append(srRoute.getStation().getgLaty()).append("</STATION_LAT>"); | |
| 1158 | + sBuffer.append("<STATION_TYPE>").append(zdlx).append("</STATION_TYPE>"); | |
| 1159 | + sBuffer.append("<STATION_DISTANCE>").append(srRoute.getDistances()).append("</STATION_DISTANCE>"); | |
| 1143 | 1160 | sBuffer.append("</Station>"); |
| 1144 | 1161 | startId++; |
| 1145 | 1162 | } |
| ... | ... | @@ -1147,15 +1164,47 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 1147 | 1164 | } |
| 1148 | 1165 | |
| 1149 | 1166 | /** |
| 1167 | + * @param stationsList 站点路由集 | |
| 1168 | + * @param sBuffer sBuffer | |
| 1169 | + * @param startId 站点序号起始ID | |
| 1170 | + * | |
| 1171 | + * @return 站点序号累加后的ID | |
| 1172 | + */ | |
| 1173 | + private int packagStationPointXml(List<StationRoute> stationsList,StringBuffer sBuffer,int startId){ | |
| 1174 | + int size = stationsList.size(); | |
| 1175 | + StationRoute srRoute; | |
| 1176 | + String zdlx ;// 站点类型:0:起点站、1:终点站、2:中途站 | |
| 1177 | + for (int i = 0; i < size; i++) { | |
| 1178 | + srRoute = stationsList.get(i); | |
| 1179 | + zdlx = srRoute.getStationMark(); | |
| 1180 | + if(zdlx.equals("B")){ | |
| 1181 | + zdlx = "0"; | |
| 1182 | + }else if(zdlx.equals("E")){ | |
| 1183 | + zdlx = "1"; | |
| 1184 | + }else{ | |
| 1185 | + zdlx = "2"; | |
| 1186 | + } | |
| 1187 | + sBuffer.append("<Point>"); | |
| 1188 | + sBuffer.append("<POINT_ID>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(srRoute.getLineCode(),srRoute.getDirections()+"",srRoute.getStationCode())).append("</POINT_ID>"); | |
| 1189 | + sBuffer.append("<UPDDOWN>").append(srRoute.getDirections()).append("</UPDDOWN>"); | |
| 1190 | + sBuffer.append("<POINTLON>").append(srRoute.getStation().getgLonx()).append("</POINTLON>"); | |
| 1191 | + sBuffer.append("<POINTLAT>").append(srRoute.getStation().getgLaty()).append("</POINTLAT>"); | |
| 1192 | + sBuffer.append("</Point>"); | |
| 1193 | + startId++; | |
| 1194 | + } | |
| 1195 | + return startId; | |
| 1196 | + } | |
| 1197 | + | |
| 1198 | + /** | |
| 1150 | 1199 | * |
| 1151 | 1200 | * @param lineCode 线路编码 |
| 1152 | 1201 | * @param direction 线路方向 |
| 1153 | - * @param stationName 让点名称 | |
| 1202 | + * @param stationCode 让点名称 | |
| 1154 | 1203 | * @return 运管处站点序号 |
| 1155 | 1204 | */ |
| 1156 | - private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationName){ | |
| 1205 | + private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationCode){ | |
| 1157 | 1206 | Integer number = 0; |
| 1158 | - number = BasicData.stationName2YgcNumber.get(lineCode+"_"+direction+"_"+stationName); | |
| 1159 | - return number; | |
| 1207 | + number = BasicData.stationName2YgcNumber.get(lineCode+"_"+direction+"_"+stationCode); | |
| 1208 | + return number == null ? 0 : number; | |
| 1160 | 1209 | } |
| 1161 | 1210 | } | ... | ... |
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| ... | ... | @@ -704,15 +704,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 704 | 704 | // String nbbm =jsonObject.getString("nbbm"); |
| 705 | 705 | // String rq=jsonObject.getString("rq"); |
| 706 | 706 | repository.dlbUpdate(id, czcd, jzcd, hd, sh, shyy, yhlx); |
| 707 | - /*for (int z = 0; z < cylList.size(); z++) { | |
| 708 | - Cyl cyl = cylList.get(z); | |
| 709 | - if (nbbm.equals(cyl.getNbbm())) { | |
| 710 | - cyl.setCyl(jzyl); | |
| 711 | - cyl.setUpdatetime(sdf.parse(rq)); | |
| 712 | - break; | |
| 713 | - } | |
| 714 | - cylRepository.save(cyl); | |
| 715 | - }*/ | |
| 707 | + | |
| 716 | 708 | } |
| 717 | 709 | newMap.put("status", ResponseCode.SUCCESS); |
| 718 | 710 | }catch(Exception e){ | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -266,7 +266,44 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 266 | 266 | List<Ylb> ylListBe =repository.listMaxRqJcsx(rq, gsbm, fgsbm, line, nbbm); |
| 267 | 267 | List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm); |
| 268 | 268 | // 从排班表中计算出行驶的总里程 |
| 269 | - List<Map<String, Object>> listpb = scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm); | |
| 269 | + List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); | |
| 270 | + List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm); | |
| 271 | + | |
| 272 | + String sxtj=map2.get("sxtj").toString(); | |
| 273 | + if(sxtj.equals("0")){ | |
| 274 | + listpb=listpbs; | |
| 275 | + }else{ | |
| 276 | + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, line,nbbm); | |
| 277 | + List<String> stringList=new ArrayList<String>(); | |
| 278 | + for (int i = 0; i < objectLists.size(); i++) { | |
| 279 | + String clbm=objectLists.get(i)[0].toString(); | |
| 280 | + int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | |
| 281 | + //一车一单 | |
| 282 | + if(sxtj.equals("1")){ | |
| 283 | + if(cs==1){ | |
| 284 | + stringList.add(clbm); | |
| 285 | + } | |
| 286 | + } | |
| 287 | + //一车多单 | |
| 288 | + if(sxtj.equals("2")){ | |
| 289 | + if(cs>1){ | |
| 290 | + stringList.add(clbm); | |
| 291 | + } | |
| 292 | + } | |
| 293 | + } | |
| 294 | + | |
| 295 | + for (int i = 0; i < stringList.size(); i++) { | |
| 296 | + String strNbbm=stringList.get(i); | |
| 297 | + for (int j = 0; j < listpbs.size(); j++) { | |
| 298 | + Map<String, Object> map = listpbs.get(j); | |
| 299 | + String mapNbbm=map.get("clZbh").toString(); | |
| 300 | + if(strNbbm.equals(mapNbbm)){ | |
| 301 | + listpb.add(map); | |
| 302 | + } | |
| 303 | + } | |
| 304 | + } | |
| 305 | + } | |
| 306 | + | |
| 270 | 307 | List<Ylb> addList = new ArrayList<Ylb>(); |
| 271 | 308 | List<Ylb> updateList = new ArrayList<Ylb>(); |
| 272 | 309 | String ins=""; |
| ... | ... | @@ -443,15 +480,53 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 443 | 480 | List<Cyl> cylList = cylRepository.obtainCyl(nbbm,gsbm); |
| 444 | 481 | // 指定日期YLB信息 |
| 445 | 482 | List<Ylb> ylbList =new ArrayList<Ylb>(); |
| 483 | + List<Ylb> ylbLists =new ArrayList<Ylb>(); | |
| 446 | 484 | List<Ylb> iterator2=new ArrayList<Ylb>(); |
| 447 | 485 | if(xlbm.equals("")){ |
| 448 | - ylbList=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | |
| 486 | + ylbLists=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | |
| 449 | 487 | iterator2=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx"); |
| 450 | 488 | }else{ |
| 451 | - ylbList=repository.obtainYl_eq(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | |
| 489 | + ylbLists=repository.obtainYl_eq(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | |
| 452 | 490 | iterator2=repository.obtainYl_eq(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx"); |
| 453 | 491 | } |
| 454 | 492 | |
| 493 | + // 从排班表中计算出行驶的总里程 | |
| 494 | + | |
| 495 | + String sxtj=map.get("sxtj").toString(); | |
| 496 | + if(sxtj.equals("0")){ | |
| 497 | + ylbList=ylbLists; | |
| 498 | + }else{ | |
| 499 | + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | |
| 500 | + List<String> stringList=new ArrayList<String>(); | |
| 501 | + for (int i = 0; i < objectLists.size(); i++) { | |
| 502 | + String clbm=objectLists.get(i)[0].toString(); | |
| 503 | + int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | |
| 504 | + //一车一单 | |
| 505 | + if(sxtj.equals("1")){ | |
| 506 | + if(cs==1){ | |
| 507 | + stringList.add(clbm); | |
| 508 | + } | |
| 509 | + } | |
| 510 | + //一车多单 | |
| 511 | + if(sxtj.equals("2")){ | |
| 512 | + if(cs>1){ | |
| 513 | + stringList.add(clbm); | |
| 514 | + } | |
| 515 | + } | |
| 516 | + } | |
| 517 | + | |
| 518 | + for (int i = 0; i < stringList.size(); i++) { | |
| 519 | + String strNbbm=stringList.get(i); | |
| 520 | + for (int j = 0; j < ylbLists.size(); j++) { | |
| 521 | + Ylb y = ylbLists.get(j); | |
| 522 | + String mapNbbm=y.getNbbm(); | |
| 523 | + if(strNbbm.equals(mapNbbm)){ | |
| 524 | + ylbList.add(y); | |
| 525 | + } | |
| 526 | + } | |
| 527 | + } | |
| 528 | + } | |
| 529 | + | |
| 455 | 530 | for (int i=0;i<ylbList.size();i++) { |
| 456 | 531 | Ylb ylb = ylbList.get(i); |
| 457 | 532 | // 判断是否已经计算过 |
| ... | ... | @@ -506,7 +581,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 506 | 581 | long l=Math.round(nextJzyl); |
| 507 | 582 | double ylxs=l*100/100; |
| 508 | 583 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); |
| 509 | - yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); | |
| 584 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | |
| 510 | 585 | t.setYh(yh); |
| 511 | 586 | t.setJzyl(ylxs); |
| 512 | 587 | nextJzyl=ylxs; |
| ... | ... | @@ -531,7 +606,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 531 | 606 | ylxs=l*100/100; |
| 532 | 607 | |
| 533 | 608 | } |
| 534 | - yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); | |
| 609 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | |
| 535 | 610 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); |
| 536 | 611 | |
| 537 | 612 | t.setYh(yh); |
| ... | ... | @@ -1218,8 +1293,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1218 | 1293 | t.setShyy(shyy); |
| 1219 | 1294 | } |
| 1220 | 1295 | czyl=t.getCzyl(); |
| 1221 | -// Double jcyl = t.getCzyl(); | |
| 1222 | - zyl = jzl; | |
| 1296 | + Double jcyl = t.getCzyl(); | |
| 1297 | + zyl = Arith.sub(Arith.add(jcyl, jzl), yl); | |
| 1223 | 1298 | Double yh = 0.0; |
| 1224 | 1299 | if (zlc > 0 && t.getZlc() > 0) { |
| 1225 | 1300 | yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); |
| ... | ... | @@ -1229,7 +1304,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1229 | 1304 | long l=Math.round(nextJzyl); |
| 1230 | 1305 | double ylxs=l*100/100; |
| 1231 | 1306 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); |
| 1232 | - yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); | |
| 1307 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | |
| 1233 | 1308 | t.setYh(yh); |
| 1234 | 1309 | t.setJzyl(ylxs); |
| 1235 | 1310 | nextJzyl=ylxs; |
| ... | ... | @@ -1252,12 +1327,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1252 | 1327 | long l=0l; |
| 1253 | 1328 | double ylxs=0.0; |
| 1254 | 1329 | if(i==iterator2.size()-1){ |
| 1255 | - ylxs=czyl; | |
| 1330 | + ylxs=yl; | |
| 1256 | 1331 | }else{ |
| 1257 | 1332 | l=Math.round(nextJzyl); |
| 1258 | 1333 | ylxs=l*100/100; |
| 1259 | 1334 | } |
| 1260 | - yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); | |
| 1335 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); | |
| 1261 | 1336 | t.setYh(yh); |
| 1262 | 1337 | t.setJzyl(ylxs); |
| 1263 | 1338 | nextJzyl=ylxs; |
| ... | ... | @@ -1269,7 +1344,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1269 | 1344 | } |
| 1270 | 1345 | } |
| 1271 | 1346 | repository.save(t); |
| 1272 | - /*for (int z = 0; z < cylList.size(); z++) { | |
| 1347 | + for (int z = 0; z < cylList.size(); z++) { | |
| 1273 | 1348 | Cyl cyl = cylList.get(z); |
| 1274 | 1349 | if (t.getNbbm().equals(cyl.getNbbm())) { |
| 1275 | 1350 | cyl.setCyl(t.getJzyl()); |
| ... | ... | @@ -1277,7 +1352,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1277 | 1352 | break; |
| 1278 | 1353 | } |
| 1279 | 1354 | cylRepository.save(cyl); |
| 1280 | - }*/ | |
| 1355 | + } | |
| 1281 | 1356 | } |
| 1282 | 1357 | newMap.put("status", ResponseCode.SUCCESS); |
| 1283 | 1358 | } |
| ... | ... | @@ -1289,6 +1364,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1289 | 1364 | return newMap; |
| 1290 | 1365 | } |
| 1291 | 1366 | |
| 1367 | + | |
| 1292 | 1368 | @Override |
| 1293 | 1369 | public String checkJsy(Map<String, Object> map) { |
| 1294 | 1370 | // TODO Auto-generated method stub | ... | ... |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| ... | ... | @@ -101,6 +101,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L |
| 101 | 101 | List<Map<String,String>> findLpName(String lpName); |
| 102 | 102 | |
| 103 | 103 | List<Map<String,Object>> account(String line,String date,String code,String xlName, String type); |
| 104 | + List<Map<String,Object>> accountPx(String line,String date,String code,String xlName, String px); | |
| 105 | + | |
| 104 | 106 | |
| 105 | 107 | List<ScheduleRealInfo> correctForm(String line,String startDate,String endDate,String lpName,String code, String type); |
| 106 | 108 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -244,6 +244,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 244 | 244 | schedule.setBcType(bcType); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | + //如果正在执行该班次 | |
| 248 | + ScheduleRealInfo exec = dayOfSchedule.executeCurr(schedule.getClZbh()); | |
| 249 | + if(exec != null && exec == schedule){ | |
| 250 | + //重新计算正在执行班次 | |
| 251 | + dayOfSchedule.reCalcExecPlan(schedule.getClZbh()); | |
| 252 | + } | |
| 253 | + | |
| 247 | 254 | //重新计算是否误点 |
| 248 | 255 | schedule.reCalcLate(); |
| 249 | 256 | //取消应发未到标记,不再自动调整待发 |
| ... | ... | @@ -724,12 +731,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 724 | 731 | state = state + "+1"; |
| 725 | 732 | type = "ASC"; |
| 726 | 733 | } |
| 727 | - String sqlPlan = "select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh," | |
| 728 | - + " s.lp_Name as lpName,s.j_Name as jName,min(s.schedule_date_str) as dateStr ,min(s.fcsj) as fcsj" | |
| 734 | + /*String sqlPlan = "select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh," | |
| 735 | + + " s.lp_Name as lpName,s.j_Name as jName,min(s.schedule_date_str) as dateStr ," | |
| 736 | + + " min(s.fcsj) as fcsj, min(s.schedule_date) as date" | |
| 729 | 737 | + " from bsth_c_s_sp_info_real s " |
| 730 | 738 | + " where s.xl_Bm = '" + line + "' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='" + date + "' " |
| 731 | 739 | + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name" |
| 732 | - + " order by (" + state + "),dateStr,fcsj " + type; | |
| 740 | + + " order by (" + state + "),dateStr,fcsj " + type;*/ | |
| 741 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 742 | + + " id = (" | |
| 743 | + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 744 | + + ")"; | |
| 745 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 746 | + String sqlPlan ="select * from (select * from (" | |
| 747 | + + " select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, " | |
| 748 | + + " s.lp_Name as lpName,s.j_Name as jName,max(s.schedule_date_str) as dateStr ," | |
| 749 | + + " min(s.fcsj) as fcsj,1 as px from bsth_c_s_sp_info_real s where " | |
| 750 | + + " s.xl_Bm = '"+line+"' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='"+date+"'" | |
| 751 | + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name ) x where x.fcsj >'"+minfcsj+"'" | |
| 752 | + + " UNION " | |
| 753 | + + " select * from ( select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, " | |
| 754 | + + " s.lp_Name as lpName,s.j_Name as jName, max(s.schedule_date_str) as dateStr," | |
| 755 | + + " min(s.fcsj) as fcsj,2 as px from bsth_c_s_sp_info_real s " | |
| 756 | + + " where s.xl_Bm = '"+line+"' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='"+date+"'" | |
| 757 | + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name " | |
| 758 | + + " ) y where y.fcsj <='"+minfcsj+"') z order by (" + state + "),dateStr,px " + type; | |
| 733 | 759 | List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan, |
| 734 | 760 | new RowMapper<ScheduleRealInfo>() { |
| 735 | 761 | @Override |
| ... | ... | @@ -740,10 +766,48 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 740 | 766 | t.setClZbh(rs.getString("clZbh")); |
| 741 | 767 | t.setLpName(rs.getString("lpName")); |
| 742 | 768 | t.setjName(rs.getString("jName")); |
| 769 | + t.setFcsj(rs.getString("fcsj")); | |
| 743 | 770 | return t; |
| 744 | 771 | } |
| 745 | 772 | }); |
| 746 | 773 | if (lpname.equals("lpName")) { |
| 774 | + /* SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); | |
| 775 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 776 | + + " id = (" | |
| 777 | + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 778 | + + ")"; | |
| 779 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 780 | + String[] minSjs = minfcsj.split(":"); | |
| 781 | + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); | |
| 782 | + for (int i = 0; i < list.size(); i++) { | |
| 783 | + ScheduleRealInfo s=list.get(i); | |
| 784 | + String[] fcsj= s.getFcsj().split(":"); | |
| 785 | + Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]); | |
| 786 | + | |
| 787 | + Long fscjT=0L; | |
| 788 | + if(fcsjL<minSj){ | |
| 789 | + Calendar calendar = new GregorianCalendar(); | |
| 790 | + calendar.setTime(s.getScheduleDate()); | |
| 791 | + calendar.add(calendar.DATE,1); | |
| 792 | + s.setScheduleDate(calendar.getTime()); | |
| 793 | + try { | |
| 794 | + fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime(); | |
| 795 | + } catch (ParseException e) { | |
| 796 | + // TODO Auto-generated catch block | |
| 797 | + e.printStackTrace(); | |
| 798 | + } | |
| 799 | + | |
| 800 | + }else{ | |
| 801 | + try { | |
| 802 | + fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime(); | |
| 803 | + } catch (ParseException e) { | |
| 804 | + // TODO Auto-generated catch block | |
| 805 | + e.printStackTrace(); | |
| 806 | + }; | |
| 807 | + } | |
| 808 | + s.setFcsjT(fscjT); | |
| 809 | + } | |
| 810 | + Collections.sort(list, new ComparableReal());*/ | |
| 747 | 811 | List<ScheduleRealInfo> listNew = new ArrayList<ScheduleRealInfo>(); |
| 748 | 812 | Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); |
| 749 | 813 | // if (px.equals("desc")) { |
| ... | ... | @@ -1747,6 +1811,46 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1747 | 1811 | |
| 1748 | 1812 | |
| 1749 | 1813 | @Override |
| 1814 | + public List<Map<String, Object>> accountPx(String line, String date, | |
| 1815 | + String code, String xlName, String px) { | |
| 1816 | +// List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px); | |
| 1817 | + List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); | |
| 1818 | + String sql= "SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T') as date," | |
| 1819 | + + "c.inside_code FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c " | |
| 1820 | + + "ON c.equipment_code = r.device_id where " | |
| 1821 | + + "FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = '"+date +"'" | |
| 1822 | + + "and r.line_id = "+line+" and c.inside_code like '%"+code+"%'" | |
| 1823 | + + " order by c.inside_code "+px; | |
| 1824 | + Map<String, Object> map; | |
| 1825 | + List<Object[]> lsitObj = jdbcTemplate.query(sql, | |
| 1826 | + new RowMapper<Object[]>() { | |
| 1827 | + @Override | |
| 1828 | + public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 1829 | + Object[] t = new Object[4]; | |
| 1830 | + t[0]=rs.getString("company"); | |
| 1831 | + t[1]=rs.getString("request_code"); | |
| 1832 | + t[2]=rs.getString("date"); | |
| 1833 | + t[3]=rs.getString("inside_code"); | |
| 1834 | + return t; | |
| 1835 | + } | |
| 1836 | + }); | |
| 1837 | + int i = 1; | |
| 1838 | + for (Object[] obj : lsitObj) { | |
| 1839 | + if (obj != null) { | |
| 1840 | + map = new HashMap<String, Object>(); | |
| 1841 | + map.put("num", i++); | |
| 1842 | + map.put("xlName", xlName); | |
| 1843 | + map.put("clZbh", obj[3]); | |
| 1844 | + map.put("company", obj[0]); | |
| 1845 | + map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[1] + "")).toUpperCase()); | |
| 1846 | + map.put("requestTime", obj[2]); | |
| 1847 | + listMap.add(map); | |
| 1848 | + } | |
| 1849 | + } | |
| 1850 | + | |
| 1851 | + return listMap; | |
| 1852 | + } | |
| 1853 | + @Override | |
| 1750 | 1854 | public List<Map<String, Object>> account(String line, String date, |
| 1751 | 1855 | String code, String xlName, String type) { |
| 1752 | 1856 | List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code); |
| ... | ... | @@ -2610,6 +2714,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2610 | 2714 | }*/ |
| 2611 | 2715 | |
| 2612 | 2716 | public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){ |
| 2717 | + | |
| 2613 | 2718 | List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); |
| 2614 | 2719 | for(int i=0;i<list.size();i++){ |
| 2615 | 2720 | ScheduleRealInfo s=list.get(i); |
| ... | ... | @@ -2623,57 +2728,59 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2623 | 2728 | } |
| 2624 | 2729 | } |
| 2625 | 2730 | Map<String, Object> map = new HashMap<String, Object>(); |
| 2626 | - map.put("xlName", lists.get(0).getXlName()); | |
| 2627 | - double jhyygl=culateService.culateJhgl(list);//计划营运公里 | |
| 2628 | - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) | |
| 2629 | - map.put("jhlc", jhyygl); | |
| 2630 | - map.put("jcclc", jhjcclc); | |
| 2631 | - map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); | |
| 2632 | - | |
| 2633 | - double ljgl= culateService.culateLjgl(lists); | |
| 2634 | - double sjyygl= culateService.culateSjgl(lists); | |
| 2635 | - double zyygl= Arith.add(sjyygl,ljgl); | |
| 2636 | - | |
| 2637 | - double sjjccgl=culateService.culateJccgl(lists); | |
| 2638 | - double sjksgl=culateService.culateKsgl(lists); | |
| 2639 | - double zksgl=Arith.add(sjjccgl, sjksgl); | |
| 2640 | - map.put("sjzgl", Arith.add(zyygl, zksgl)); | |
| 2641 | - map.put("sjgl",zyygl); | |
| 2642 | - map.put("sjksgl", zksgl); | |
| 2643 | - | |
| 2644 | - map.put("ssgl", culateService.culateLbgl(list)); | |
| 2645 | - map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); | |
| 2646 | - map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); | |
| 2647 | - map.put("ssgl_gz", culateService.culateCJLC(list, "故障")); | |
| 2648 | - map.put("ssgl_jf", culateService.culateCJLC(list, "纠纷")); | |
| 2649 | - map.put("ssgl_zs", culateService.culateCJLC(list, "肇事")); | |
| 2650 | - map.put("ssgl_qr", culateService.culateCJLC(list, "缺人")); | |
| 2651 | - map.put("ssgl_qc", culateService.culateCJLC(list, "缺车")); | |
| 2652 | - map.put("ssgl_kx", culateService.culateCJLC(list, "客稀")); | |
| 2653 | - map.put("ssgl_qh", culateService.culateCJLC(list, "气候")); | |
| 2654 | - map.put("ssgl_yw", culateService.culateCJLC(list, "援外")); | |
| 2655 | - map.put("ssgl_other", culateService.culateCJLC(list, "其他")); | |
| 2656 | - map.put("ssbc", culateService.culateLbbc(list)); | |
| 2657 | - map.put("ljgl", ljgl); | |
| 2658 | - map.put("jhbc", culateService.culateJhbc(list,"")); | |
| 2659 | - map.put("jhbc_m", culateService.culateJhbc(list, "zgf")); | |
| 2660 | - map.put("jhbc_a", culateService.culateJhbc(list, "wgf")); | |
| 2661 | - map.put("sjbc", culateService.culateSjbc(lists,"")); | |
| 2662 | - map.put("sjbc_m", culateService.culateSjbc(lists,"zgf")); | |
| 2663 | - map.put("sjbc_a", culateService.culateSjbc(lists,"wgf")); | |
| 2664 | - map.put("ljbc", culateService.culateLjbc(lists,"")); | |
| 2665 | - map.put("ljbc_m", culateService.culateLjbc(lists,"zgf")); | |
| 2666 | - map.put("ljbc_a", culateService.culateLjbc(lists,"wgf")); | |
| 2667 | - map.put("fzbc", culateService.culateFzbc(lists, "")); | |
| 2668 | - map.put("fzbc_m", culateService.culateFzbc(lists, "zgf")); | |
| 2669 | - map.put("fzbc_a", culateService.culateFzbc(lists, "wgf")); | |
| 2670 | - map.put("dtbc", 0); | |
| 2671 | - map.put("dtbc_m", 0); | |
| 2672 | - map.put("dtbc_a", 0); | |
| 2673 | - map.put("djg", 0); | |
| 2674 | - map.put("djg_m", 0); | |
| 2675 | - map.put("djg_a", 0); | |
| 2676 | - map.put("djg_time", 0); | |
| 2731 | + if(list.size()>0){ | |
| 2732 | + map.put("xlName", list.get(0).getXlName()); | |
| 2733 | + double jhyygl=culateService.culateJhgl(list);//计划营运公里 | |
| 2734 | + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) | |
| 2735 | + map.put("jhlc", jhyygl); | |
| 2736 | + map.put("jcclc", jhjcclc); | |
| 2737 | + map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); | |
| 2738 | + | |
| 2739 | + double ljgl= culateService.culateLjgl(lists); | |
| 2740 | + double sjyygl= culateService.culateSjgl(lists); | |
| 2741 | + double zyygl= Arith.add(sjyygl,ljgl); | |
| 2742 | + | |
| 2743 | + double sjjccgl=culateService.culateJccgl(lists); | |
| 2744 | + double sjksgl=culateService.culateKsgl(lists); | |
| 2745 | + double zksgl=Arith.add(sjjccgl, sjksgl); | |
| 2746 | + map.put("sjzgl", Arith.add(zyygl, zksgl)); | |
| 2747 | + map.put("sjgl",zyygl); | |
| 2748 | + map.put("sjksgl", zksgl); | |
| 2749 | + | |
| 2750 | + map.put("ssgl", culateService.culateLbgl(list)); | |
| 2751 | + map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); | |
| 2752 | + map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); | |
| 2753 | + map.put("ssgl_gz", culateService.culateCJLC(list, "故障")); | |
| 2754 | + map.put("ssgl_jf", culateService.culateCJLC(list, "纠纷")); | |
| 2755 | + map.put("ssgl_zs", culateService.culateCJLC(list, "肇事")); | |
| 2756 | + map.put("ssgl_qr", culateService.culateCJLC(list, "缺人")); | |
| 2757 | + map.put("ssgl_qc", culateService.culateCJLC(list, "缺车")); | |
| 2758 | + map.put("ssgl_kx", culateService.culateCJLC(list, "客稀")); | |
| 2759 | + map.put("ssgl_qh", culateService.culateCJLC(list, "气候")); | |
| 2760 | + map.put("ssgl_yw", culateService.culateCJLC(list, "援外")); | |
| 2761 | + map.put("ssgl_other", culateService.culateCJLC(list, "其他")); | |
| 2762 | + map.put("ssbc", culateService.culateLbbc(list)); | |
| 2763 | + map.put("ljgl", ljgl); | |
| 2764 | + map.put("jhbc", culateService.culateJhbc(list,"")); | |
| 2765 | + map.put("jhbc_m", culateService.culateJhbc(list, "zgf")); | |
| 2766 | + map.put("jhbc_a", culateService.culateJhbc(list, "wgf")); | |
| 2767 | + map.put("sjbc", culateService.culateSjbc(lists,"")); | |
| 2768 | + map.put("sjbc_m", culateService.culateSjbc(lists,"zgf")); | |
| 2769 | + map.put("sjbc_a", culateService.culateSjbc(lists,"wgf")); | |
| 2770 | + map.put("ljbc", culateService.culateLjbc(lists,"")); | |
| 2771 | + map.put("ljbc_m", culateService.culateLjbc(lists,"zgf")); | |
| 2772 | + map.put("ljbc_a", culateService.culateLjbc(lists,"wgf")); | |
| 2773 | + map.put("fzbc", culateService.culateFzbc(lists, "")); | |
| 2774 | + map.put("fzbc_m", culateService.culateFzbc(lists, "zgf")); | |
| 2775 | + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf")); | |
| 2776 | + map.put("dtbc", 0); | |
| 2777 | + map.put("dtbc_m", 0); | |
| 2778 | + map.put("dtbc_a", 0); | |
| 2779 | + map.put("djg", 0); | |
| 2780 | + map.put("djg_m", 0); | |
| 2781 | + map.put("djg_a", 0); | |
| 2782 | + map.put("djg_time", 0); | |
| 2783 | + } | |
| 2677 | 2784 | return map; |
| 2678 | 2785 | } |
| 2679 | 2786 | |
| ... | ... | @@ -3222,8 +3329,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3222 | 3329 | |
| 3223 | 3330 | if (StringUtils.isNotEmpty(cpc.getJsy())) { |
| 3224 | 3331 | //换驾驶员 |
| 3225 | - persoChange(sch, jGh); | |
| 3226 | - set.add(sch); | |
| 3332 | + if(persoChange(sch, jGh)) | |
| 3333 | + set.add(sch); | |
| 3227 | 3334 | } |
| 3228 | 3335 | |
| 3229 | 3336 | //换售票员 |
| ... | ... | @@ -3235,8 +3342,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3235 | 3342 | rs.put("status", ResponseCode.ERROR); |
| 3236 | 3343 | return rs; |
| 3237 | 3344 | } |
| 3238 | - persoChangeSPY(sch, sGh); | |
| 3239 | - set.add(sch); | |
| 3345 | + if(persoChangeSPY(sch, sGh)) | |
| 3346 | + set.add(sch); | |
| 3240 | 3347 | } |
| 3241 | 3348 | else if(StringUtils.isNotEmpty(sch.getsGh())){ |
| 3242 | 3349 | sch.setsGh(""); |
| ... | ... | @@ -3244,12 +3351,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3244 | 3351 | } |
| 3245 | 3352 | |
| 3246 | 3353 | //换车 |
| 3247 | - if (StringUtils.isNotEmpty(cpc.getClZbh())) { | |
| 3354 | + if (StringUtils.isNotEmpty(cpc.getClZbh()) && !cpc.getClZbh().equals(sch.getClZbh())) { | |
| 3248 | 3355 | set.add(sch); |
| 3249 | 3356 | set.addAll(dayOfSchedule.changeCar(sch, cpc.getClZbh())); |
| 3250 | 3357 | } |
| 3251 | 3358 | |
| 3252 | 3359 | dayOfSchedule.save(sch); |
| 3360 | + set.add(sch); | |
| 3253 | 3361 | |
| 3254 | 3362 | } |
| 3255 | 3363 | rs.put("ts", set); |
| ... | ... | @@ -3261,9 +3369,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3261 | 3369 | * @Title: persoChange |
| 3262 | 3370 | * @Description: TODO(班次换驾驶员) |
| 3263 | 3371 | */ |
| 3264 | - public void persoChange(ScheduleRealInfo sch, String jGh) { | |
| 3372 | + public boolean persoChange(ScheduleRealInfo sch, String jGh) { | |
| 3265 | 3373 | if (sch.getjGh().equals(jGh)) |
| 3266 | - return; | |
| 3374 | + return false; | |
| 3267 | 3375 | String jName = getPersonName(sch.getGsBm() , jGh); |
| 3268 | 3376 | if (StringUtils.isNotEmpty(jName)) { |
| 3269 | 3377 | |
| ... | ... | @@ -3273,16 +3381,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3273 | 3381 | sch.setjGh(jGh); |
| 3274 | 3382 | |
| 3275 | 3383 | sch.setjName(jName); |
| 3384 | + return true; | |
| 3276 | 3385 | } |
| 3386 | + return false; | |
| 3277 | 3387 | } |
| 3278 | 3388 | |
| 3279 | 3389 | /** |
| 3280 | 3390 | * @Title: persoChange |
| 3281 | 3391 | * @Description: TODO(班次换售票员) |
| 3282 | 3392 | */ |
| 3283 | - public void persoChangeSPY(ScheduleRealInfo sch, String sGh) { | |
| 3393 | + public boolean persoChangeSPY(ScheduleRealInfo sch, String sGh) { | |
| 3284 | 3394 | if (sch.getsGh().equals(sGh)) |
| 3285 | - return; | |
| 3395 | + return false; | |
| 3286 | 3396 | String sName = getPersonName(sch.getGsBm() , sGh); |
| 3287 | 3397 | if (StringUtils.isNotEmpty(sName)) { |
| 3288 | 3398 | if (sGh.indexOf("-") != -1) |
| ... | ... | @@ -3290,7 +3400,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3290 | 3400 | else |
| 3291 | 3401 | sch.setsGh(sGh); |
| 3292 | 3402 | sch.setsName(sName); |
| 3403 | + return true; | |
| 3293 | 3404 | } |
| 3405 | + return false; | |
| 3294 | 3406 | } |
| 3295 | 3407 | |
| 3296 | 3408 | /** | ... | ... |
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
| ... | ... | @@ -801,6 +801,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 801 | 801 | String nbbm = map.get("nbbm").toString(); |
| 802 | 802 | String type = map.get("type").toString(); |
| 803 | 803 | |
| 804 | + String companyName = ""; | |
| 805 | + String subCompanyName = ""; | |
| 806 | + String lineName = ""; | |
| 807 | + | |
| 804 | 808 | if(startDate.length() == 0){ |
| 805 | 809 | startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); |
| 806 | 810 | } |
| ... | ... | @@ -934,8 +938,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 934 | 938 | tempList.add(m7); |
| 935 | 939 | } |
| 936 | 940 | |
| 937 | - String companyName = ""; | |
| 938 | - String subCompanyName = ""; | |
| 939 | 941 | |
| 940 | 942 | //按时间段分组 |
| 941 | 943 | for(ScheduleRealInfo schedule : list){ |
| ... | ... | @@ -947,6 +949,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 947 | 949 | &&schedule.getFgsName().trim().length()!=0){ |
| 948 | 950 | subCompanyName = schedule.getFgsName(); |
| 949 | 951 | } |
| 952 | + if(lineName.length()==0&&schedule.getXlName()!=null | |
| 953 | + &&schedule.getXlName().trim().length()!=0){ | |
| 954 | + lineName = schedule.getXlName(); | |
| 955 | + } | |
| 950 | 956 | |
| 951 | 957 | if(schedule.getFcsjActualTime()!=null && schedule.getZdsjActualTime()!=null){ |
| 952 | 958 | Long fcsjA = schedule.getFcsjActualTime(); |
| ... | ... | @@ -1005,6 +1011,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1005 | 1011 | for(String key : keyMap.keySet()){ |
| 1006 | 1012 | Map<String, Object> m = null; |
| 1007 | 1013 | for(Map<String, Object> map2 : tempList){ |
| 1014 | + map2.put("line", lineName.trim()); | |
| 1015 | + map2.put("company", companyName.trim()); | |
| 1016 | + map2.put("subCompany", subCompanyName.trim()); | |
| 1008 | 1017 | if(map2.get("time").toString().equals(key)){ |
| 1009 | 1018 | m = map2; |
| 1010 | 1019 | } |
| ... | ... | @@ -1020,18 +1029,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1020 | 1029 | dnbc++; |
| 1021 | 1030 | dnys += schedule.getZdsjActualTime() - schedule.getFcsjActualTime(); |
| 1022 | 1031 | } |
| 1023 | - | |
| 1024 | - if(schedule.getXlName() != null && schedule.getXlName().trim().length() != 0){ | |
| 1025 | - m.put("line", schedule.getXlName()); | |
| 1026 | - } | |
| 1027 | 1032 | } |
| 1028 | 1033 | m.put("upbc", upbc); |
| 1029 | 1034 | m.put("dnbc", dnbc); |
| 1030 | 1035 | m.put("upys", upbc > 0 ? nf.format((float)upys / upbc) : "/"); |
| 1031 | 1036 | m.put("dnys", dnbc > 0 ? nf.format((float)dnys / dnbc) : "/"); |
| 1032 | 1037 | m.put("pjys", (upbc + dnbc) > 0 ? nf.format((float) (upys + dnys) / (upbc + dnbc)) : "/"); |
| 1033 | - m.put("company", companyName.trim()); | |
| 1034 | - m.put("subCompany", subCompanyName.trim()); | |
| 1035 | 1038 | } |
| 1036 | 1039 | |
| 1037 | 1040 | if(flag){ | ... | ... |
src/main/java/com/bsth/util/ReportUtils.java
| ... | ... | @@ -47,6 +47,10 @@ public class ReportUtils { |
| 47 | 47 | POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream( |
| 48 | 48 | sourcePath)); |
| 49 | 49 | HSSFWorkbook wb = new HSSFWorkbook(fs); |
| 50 | + Map<String, Object> m = (Map<String, Object>)tArray[0]; | |
| 51 | + if(m.containsKey("sheetName") && m.get("sheetName")!=null | |
| 52 | + && m.get("sheetName").toString().trim().length()!=0) | |
| 53 | + wb.setSheetName(0, m.get("sheetName").toString()); | |
| 50 | 54 | HSSFSheet sheet = wb.getSheetAt(0); |
| 51 | 55 | HSSFRow row; |
| 52 | 56 | HSSFCell cell = null; | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
| ... | ... | @@ -325,11 +325,9 @@ var BaseFun = function() { |
| 325 | 325 | }, |
| 326 | 326 | |
| 327 | 327 | BXPplaceClassesTime01 : function(saa,cara,map,seMap,dataMap,lpNoA) { |
| 328 | - var allJsonD = baseF.plgfbc(saa,cara,map,seMap,dataMap); | |
| 329 | - var jsonArray = baseF.tzsmbcsj01(baseF.setbcsAndfcno(allJsonD),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj),lpNoA,dataMap; | |
| 328 | + var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap); | |
| 330 | 329 | var list = baseF.splitBxRc(map.bxrc); |
| 331 | 330 | baseF.fprclp01(list,cara); |
| 332 | - console.log(list); | |
| 333 | 331 | var bxrclist = list.data; |
| 334 | 332 | var rs = new Array(),bxrcgs= new Array(); |
| 335 | 333 | // 遍历已分配好路牌的班型人次数组. |
| ... | ... | @@ -356,12 +354,19 @@ var BaseFun = function() { |
| 356 | 354 | // 按照发车序号顺序排序. |
| 357 | 355 | lpbc.sort(function(a,b){return b.fcno-a.fcno}); |
| 358 | 356 | // 调整班次数.也就是说调整工时. |
| 359 | - baseF.tzlpgs01(lpbc,hoursV,map,dataMap,lpNo,saa); | |
| 360 | - rs = rs.concat(lpbc); | |
| 357 | + rs = rs.concat(baseF.tzlpgs01(lpbc,hoursV,map,dataMap,lpNo,saa,bxrclist[x].type,lpNo,cara.length)); | |
| 361 | 358 | } |
| 362 | 359 | } |
| 363 | - var jar = baseF.tzsmbcsj01(baseF.setbcsAndfcno(rs),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj),lpNoA,dataMap; | |
| 364 | - //var jar = baseF.tzsmbcsj(baseF.setbcsAndfcno(rs),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj),lpNoA,dataMap; | |
| 360 | + var jar01 = baseF.tzsmbcsj01( | |
| 361 | + baseF.setbcsAndfcno( | |
| 362 | + baseF.tzsztest(cara, | |
| 363 | + baseF.tzsmbcsj01(baseF.setbcsAndfcno(rs),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap), | |
| 364 | + dataMap)), | |
| 365 | + dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap); | |
| 366 | + baseF.jhfcjx01(jar01,dataMap); | |
| 367 | + var jar = baseF.tzsmbcsj01( | |
| 368 | + baseF.setbcsAndfcno(baseF.tzsmbcsj01(baseF.setbcsAndfcno(baseF.tzsztest(cara,jar01,dataMap)),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap)), | |
| 369 | + dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap); | |
| 365 | 370 | var resultJA = new Array(); |
| 366 | 371 | for(var m = 0 ; m < cara.length; m++) { |
| 367 | 372 | // 获取路牌编号. |
| ... | ... | @@ -369,17 +374,138 @@ var BaseFun = function() { |
| 369 | 374 | // 定义路牌下的所有班次. |
| 370 | 375 | var lpbc_ = new Array(); |
| 371 | 376 | // 遍历班次数. |
| 372 | - for(var j =0 ; j <jar.length; j++) { | |
| 377 | + for(var x =0 ; x <jar.length; x++) { | |
| 373 | 378 | // 判断当期遍历的班次是否属于当前的路牌. |
| 374 | - if(jar[j].lpNo == lpNo_) | |
| 375 | - lpbc_.push(jar[j]); | |
| 379 | + if(jar[x].lpNo == lpNo_) | |
| 380 | + lpbc_.push(jar[x]); | |
| 376 | 381 | } |
| 377 | 382 | // 按照发车序号顺序排序. |
| 378 | 383 | lpbc_.sort(function(a,b){return a.fcno-b.fcno}); |
| 379 | 384 | resultJA = resultJA.concat(baseF.addjclbbc01(lpbc_,dataMap,saa[0].lbsj,map)); |
| 380 | - // resultJA = resultJA.concat(lpbc_); | |
| 381 | 385 | } |
| 382 | - return {'json':resultJA,'bxrcgs':null}; | |
| 386 | + return {'json':resultJA,'bxrcgs':bxrcgs}; | |
| 387 | + }, | |
| 388 | + | |
| 389 | + tzsztest : function(cara,tempa,dataMap) { | |
| 390 | + var jsrs = new Array(); | |
| 391 | + for(var t = 0 ; t < cara.length; t++) { | |
| 392 | + var sslpbcA = new Array(); | |
| 393 | + for(var j =0 ; j <tempa.length; j++) { | |
| 394 | + // 判断当期遍历的班次是否属于当前的路牌. | |
| 395 | + if(tempa[j].lpNo == cara[t].lpNo) | |
| 396 | + sslpbcA.push(tempa[j]); | |
| 397 | + } | |
| 398 | + sslpbcA.sort(function(a,b){return a.fcno-b.fcno}); | |
| 399 | + baseF.isbczt(sslpbcA,dataMap); | |
| 400 | + baseF.istccf(sslpbcA,dataMap); | |
| 401 | + baseF.tztzsjInit01(sslpbcA,dataMap); | |
| 402 | + jsrs = jsrs.concat(sslpbcA); | |
| 403 | + } | |
| 404 | + return jsrs; | |
| 405 | + }, | |
| 406 | + | |
| 407 | + isbczt : function(ar,dataMap) { | |
| 408 | + for(var r = 0 ; r< ar.length-1;r++) { | |
| 409 | + if(ar[r].bcType==dataMap.bcTypeArr.cf) | |
| 410 | + continue; | |
| 411 | + if(ar[r].xlDir == ar[r+1].xlDir) { | |
| 412 | + ar.splice(r, 1); | |
| 413 | + r--; | |
| 414 | + } | |
| 415 | + | |
| 416 | + } | |
| 417 | + }, | |
| 418 | + | |
| 419 | + istccf : function(ar,dataMap) { | |
| 420 | + for(var r = 0 ; r < ar.length;r++) { | |
| 421 | + if(ar[r].bcType==dataMap.bcTypeArr.cf){ | |
| 422 | + if(r == ar.length-1){ | |
| 423 | + ar.splice(r, 1); | |
| 424 | + break; | |
| 425 | + }else { | |
| 426 | + var xbcsj = baseF.getDateTime(ar[r+1].fcsj); | |
| 427 | + if(dataMap.wgfsjd[0].st <= xbcsj && xbcsj <= dataMap.wgfsjd[0].ed) { | |
| 428 | + ar.splice(r, 1); | |
| 429 | + r--; | |
| 430 | + } | |
| 431 | + } | |
| 432 | + } | |
| 433 | + } | |
| 434 | + | |
| 435 | + }, | |
| 436 | + | |
| 437 | + tztzsjInit01 : function(ar,dataMap) { | |
| 438 | + for(var r = 0 ; r< ar.length-1;r++) { | |
| 439 | + var sgbcfcsj = baseF.getDateTime(ar[r+1].fcsj),dqbcddsj = baseF.getDateTime(ar[r].ARRIVALTIME); | |
| 440 | + var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000); | |
| 441 | + if(dxmin<0 || ar[r].STOPTIME<0) { | |
| 442 | + var cctag = baseF.dirDmToIndex(ar[r].xlDir); | |
| 443 | + dxmin = ar[r].bcType == dataMap.bcTypeArr.cf ? 0 : baseF.isgfsjd01(baseF.getDateTime(ar[r].fcsj),dataMap) ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag]; | |
| 444 | + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin); | |
| 445 | + ar[r+1].fcsj = baseF.getTimeStr(dqbcddsj); | |
| 446 | + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + ar[r+1].bcsj); | |
| 447 | + ar[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj); | |
| 448 | + /*sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - dxmin); | |
| 449 | + ar[r].ARRIVALTIME = baseF.getTimeStr(sgbcfcsj); | |
| 450 | + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - ar[r].bcsj); | |
| 451 | + ar[r].fcsj = baseF.getTimeStr(sgbcfcsj);*/ | |
| 452 | + } | |
| 453 | + ar[r].STOPTIME = dxmin>180 ? 0 : dxmin; | |
| 454 | + } | |
| 455 | + }, | |
| 456 | + | |
| 457 | + /** | |
| 458 | + * @description : (TODO) 均匀发车间隙 | |
| 459 | + * | |
| 460 | + * @params : [arr--某个方向下的班次数组;dir--方向;zzsj--周转时间] | |
| 461 | + * | |
| 462 | + * @return : 返回一个数组.这里返回的是调整过后 发车间距均匀的班次数组 | |
| 463 | + **/ | |
| 464 | + jhfcjx01 : function(bcArr,dataMap) { | |
| 465 | + if(bcArr.length<=0) | |
| 466 | + return; | |
| 467 | + var dirA = dataMap.dira; | |
| 468 | + for(var d = 0 ; d < dirA.length; d++) { | |
| 469 | + var fxdm = dirA[d],fxbc = new Array(); | |
| 470 | + var cctag = baseF.dirDmToIndex(fxdm); | |
| 471 | + for(var b = 0;b<bcArr.length ; b++) { | |
| 472 | + bcArr[b].fcint = baseF.getDateTime(bcArr[b].fcsj).getTime(); | |
| 473 | + if(bcArr[b].xlDir == fxdm) | |
| 474 | + fxbc.push(bcArr[b]); | |
| 475 | + } | |
| 476 | + var kssj = baseF.getDateTime(dataMap.smbcsjArr[cctag].kssj),// 开始时间. | |
| 477 | + jssj = baseF.getDateTime(dataMap.smbcsjArr[cctag].jssj);// 结束时间. | |
| 478 | + fxbc.sort(function(m,n){return m.fcint - n.fcint}); | |
| 479 | + while(kssj<=jssj) { | |
| 480 | + var tagboolean = baseF.isgfsjd01(kssj,dataMap); | |
| 481 | + var zzsj = tagboolean ? dataMap.zzsj.gfzzsj : dataMap.zzsj.dgzzsj; | |
| 482 | + if(!tagboolean){ | |
| 483 | + var temp = new Date(); | |
| 484 | + temp.setHours(kssj.getHours()); | |
| 485 | + temp.setMinutes(kssj.getMinutes()+zzsj); | |
| 486 | + var sjdbcArr = baseF.getObjRegion(kssj,temp,fxbc,dataMap); | |
| 487 | + var len_ = sjdbcArr.length; | |
| 488 | + var bcCount = baseF.getlpNum(sjdbcArr);// 定长度 | |
| 489 | + if(len_>0 && bcCount > 0) { | |
| 490 | + var _fcjx = parseInt(Math.ceil(zzsj/bcCount)); | |
| 491 | + var fcnosj = new Date(kssj); | |
| 492 | + for(var l = 0 ; l< len_ ; l++) { | |
| 493 | + sjdbcArr[l].fcsj = baseF.getTimeStr(fcnosj); | |
| 494 | + var _xxsj = baseF.getxssj(dataMap.zgfsjd, | |
| 495 | + dataMap.wgfsjd,fcnosj,dataMap.pcxssjArr, | |
| 496 | + dataMap.gfxxsjArr,baseF.dirDmToIndex(sjdbcArr[l].xlDir));// 获取行驶时间 | |
| 497 | + sjdbcArr[l].bcsj = _xxsj; | |
| 498 | + var ddsj = new Date(); | |
| 499 | + ddsj.setHours(fcnosj.getHours()); | |
| 500 | + ddsj.setMinutes(fcnosj.getMinutes()+_xxsj); | |
| 501 | + sjdbcArr[l].ARRIVALTIME = baseF.getTimeStr(ddsj); | |
| 502 | + fcnosj.setMinutes(fcnosj.getMinutes() + _fcjx); | |
| 503 | + } | |
| 504 | + } | |
| 505 | + } | |
| 506 | + kssj = new Date(kssj.setMinutes(kssj.getMinutes() + zzsj)); | |
| 507 | + } | |
| 508 | + } | |
| 383 | 509 | }, |
| 384 | 510 | |
| 385 | 511 | /** |
| ... | ... | @@ -432,20 +558,10 @@ var BaseFun = function() { |
| 432 | 558 | * @param [arr--当前路牌下的班次数组;gs--当前路牌的总工时;dataMap--参数信息;lpNo--路牌编码;saa--参数信息] |
| 433 | 559 | * |
| 434 | 560 | * */ |
| 435 | - tzlpgs01 : function(arr,gs,map,dataMap,lpNo,saa) { | |
| 561 | + tzlpgs01 : function(arr,gs,map,dataMap,lpNo,saa,type,lpNo,cla) { | |
| 436 | 562 | // 定义当前路牌的进场时间、早晚例保时间. |
| 437 | 563 | var jczwsj = saa[0].lbsj*2 + dataMap.ccsjArr[baseF.dirDmToIndex(arr[0].xlDir)] + |
| 438 | 564 | dataMap.jcsjArr[baseF.dirDmToIndex(arr[arr.length-1].xlDir)]; |
| 439 | - // 定义开始、结束时间. | |
| 440 | - //var st = null , ed = null; | |
| 441 | - // 根据路牌编码依次轮流取高峰之间和晚高峰之后的时间段. | |
| 442 | - /*if(lpNo%2!=0) { | |
| 443 | - st = dataMap.gfzjsjd[0].st; | |
| 444 | - ed = dataMap.gfzjsjd[0].ed; | |
| 445 | - }else { | |
| 446 | - st = dataMap.wgfzhsjd[0].st; | |
| 447 | - ed = dataMap.wgfzhsjd[0].ed; | |
| 448 | - }*/ | |
| 449 | 565 | // 定义路牌总工时.第一次切高峰之间和晚高峰之后的班次. |
| 450 | 566 | var lpdqzgs = parseFloat(((baseF.getlpzgs(arr) + jczwsj)/60).toFixed(2)); |
| 451 | 567 | while(lpdqzgs>gs) { |
| ... | ... | @@ -453,31 +569,66 @@ var BaseFun = function() { |
| 453 | 569 | // 得到当前路牌下的发车时间. |
| 454 | 570 | var dqbcfcsj = baseF.getDateTime(arr[t].fcsj); |
| 455 | 571 | // 判断时间范围. |
| 456 | - if(!baseF.isgfsjd01(dqbcfcsj,dataMap)) { | |
| 572 | + if(!baseF.issplice(dqbcfcsj,dataMap,type,lpNo,cla)) { | |
| 457 | 573 | arr.splice(t,1); |
| 458 | 574 | break; |
| 459 | 575 | } |
| 460 | 576 | } |
| 461 | 577 | lpdqzgs = parseFloat(((baseF.getlpzgs(arr) + jczwsj)/60).toFixed(2)); |
| 462 | 578 | } |
| 463 | - // 判断总工时是否大于班型对应的工时. | |
| 464 | - /*if(lpdqzgs>gs) { | |
| 465 | - // 定义相差值. | |
| 466 | - var dx = parseFloat((lpdqzgs - gs).toFixed(2)); | |
| 467 | - // 定义圈数. | |
| 468 | - var qs = Math.round(dx*60/70); | |
| 469 | - for(var t = 0 ; t<arr.length;t++) { | |
| 470 | - // 得到当前路牌下的发车时间. | |
| 471 | - var dqbcfcsj = baseF.getDateTime(arr[t].fcsj); | |
| 472 | - // 判断时间范围. | |
| 473 | - if(dqbcfcsj>st && dqbcfcsj<ed) { | |
| 474 | - arr[t-1].STOPTIME = 0; | |
| 475 | - // 切割. | |
| 476 | - arr.splice(t,qs*2); | |
| 477 | - break; | |
| 579 | + for(var c = 0 ; c<arr.length;c++) { | |
| 580 | + var cfsjbc = baseF.getDateTime(arr[c].fcsj); | |
| 581 | + if(dataMap.gfzjsjd[0].st <= cfsjbc && cfsjbc <= dataMap.gfzjsjd[0].ed && arr[c].bcType == dataMap.bcTypeArr.cf ) | |
| 582 | + gfzjst = baseF.getDateTime(arr[c].ARRIVALTIME); | |
| 583 | + } | |
| 584 | + gfzjst == null ? dataMap.gfzjsjd[0].st : gfzjst; | |
| 585 | + var gfzjbc = new Array(),wgfbc = new Array(),zgfbc = new Array(); | |
| 586 | + for(var a = 0 ; a<arr.length;a++) { | |
| 587 | + var tmkssj = baseF.getDateTime(arr[a].fcsj) | |
| 588 | + if(gfzjst <= tmkssj && tmkssj <= dataMap.gfzjsjd[0].ed) | |
| 589 | + gfzjbc.push(arr[a]); | |
| 590 | + else if(dataMap.wgfsjd[0].st <= tmkssj && tmkssj <= dataMap.wgfsjd[0].ed) | |
| 591 | + wgfbc.push(arr[a]); | |
| 592 | + else | |
| 593 | + zgfbc.push(arr[a]); | |
| 594 | + } | |
| 595 | + gfzjbc.sort(function(a,b){return a.fcno-b.fcno}); | |
| 596 | + wgfbc.sort(function(a,b){return a.fcno-b.fcno}); | |
| 597 | + if(gfzjbc[gfzjbc.length-1].xlDir == wgfbc[0].xlDir) | |
| 598 | + gfzjbc.splice(gfzjbc.length-1,1); | |
| 599 | + if(type!='五工二休') { | |
| 600 | + var gfzjst = null; | |
| 601 | + var dxmin = parseInt((baseF.getDateTime(wgfbc[0].fcsj) - baseF.getDateTime(gfzjbc[gfzjbc.length-1].ARRIVALTIME))/60000); | |
| 602 | + var addmin = parseInt(dxmin/gfzjbc.length); | |
| 603 | + for(var g = 0 ;g < gfzjbc.length;g++) { | |
| 604 | + if(gfzjbc[g].bcType != dataMap.bcTypeArr.cf) | |
| 605 | + gfzjbc[g].STOPTIME = gfzjbc[g].STOPTIME + addmin; | |
| 606 | + if(g==0) { | |
| 607 | + continue; | |
| 608 | + }else { | |
| 609 | + var tempd = baseF.getDateTime(gfzjbc[g-1].ARRIVALTIME); | |
| 610 | + tempd.setMinutes(tempd.getMinutes() + gfzjbc[g-1].STOPTIME); | |
| 611 | + gfzjbc[g].fcsj = baseF.getTimeStr(tempd); | |
| 612 | + tempd.setMinutes(tempd.getMinutes() + gfzjbc[g].bcsj); | |
| 613 | + gfzjbc[g].ARRIVALTIME = baseF.getTimeStr(tempd); | |
| 478 | 614 | } |
| 479 | 615 | } |
| 480 | - }*/ | |
| 616 | + gfzjbc[gfzjbc.length-1].STOPTIME = parseInt((baseF.getDateTime(wgfbc[0].fcsj) - baseF.getDateTime(gfzjbc[gfzjbc.length-1].ARRIVALTIME))/60000); | |
| 617 | + } | |
| 618 | + return gfzjbc.concat(wgfbc).concat(zgfbc); | |
| 619 | + }, | |
| 620 | + | |
| 621 | + issplice : function (kssj,dataMap,type,lpNo,cla){ | |
| 622 | + var tag = false; | |
| 623 | + if(type=='五工二休' || lpNo <Math.round(cla/2)) { | |
| 624 | + if((dataMap.zgfsjd[0].st <=kssj && kssj<= dataMap.zgfsjd[0].ed ) || | |
| 625 | + ( dataMap.wgfsjd[0].st <= kssj && kssj <= dataMap.wgfsjd[0].ed)) | |
| 626 | + tag = true; | |
| 627 | + }else { | |
| 628 | + if(dataMap.zgfsjd[0].ed >= kssj || kssj >= dataMap.wgfsjd[0].st) | |
| 629 | + tag = true; | |
| 630 | + } | |
| 631 | + return tag; | |
| 481 | 632 | }, |
| 482 | 633 | |
| 483 | 634 | /** |
| ... | ... | @@ -966,6 +1117,15 @@ var BaseFun = function() { |
| 966 | 1117 | return tag; |
| 967 | 1118 | }, |
| 968 | 1119 | |
| 1120 | + getcfdd : function(value,dirc) { | |
| 1121 | + var inv; | |
| 1122 | + if(value =='allYes') | |
| 1123 | + inv = parseInt(dirc); | |
| 1124 | + else | |
| 1125 | + inv = parseInt(value); | |
| 1126 | + return inv; | |
| 1127 | + }, | |
| 1128 | + | |
| 969 | 1129 | plgfbc : function(saa , cara , map, seMap ,dataMap) { |
| 970 | 1130 | var len = cara.length,rs = new Array(); |
| 971 | 1131 | var lbsj = map.lb=='' ? 0:parseInt(map.lb); |
| ... | ... | @@ -982,14 +1142,16 @@ var BaseFun = function() { |
| 982 | 1142 | while(kssj<=endTime) { |
| 983 | 1143 | cctag = map.linePlayType=='1' ? 0 : baseF.getfx(fxTagDm,cctag); |
| 984 | 1144 | fxTagDm = 1; |
| 1145 | + var cfdd = baseF.getcfdd(map.cfdd,cctag); | |
| 985 | 1146 | if(kssj> new Date (baseF.getCFDate(10,30)) && |
| 986 | - kssj<new Date (baseF.getCFDate(12,0)) && $_cfn<1 ) { | |
| 1147 | + kssj<new Date (baseF.getCFDate(11,30)) && $_cfn<1 && cfdd == cctag) { | |
| 987 | 1148 | $_cfn++; |
| 988 | 1149 | rs.push(baseF.getbcObj( |
| 989 | 1150 | kssj,dataMap.zwcArr[0],cara[c],dataMap.bcTypeArr.cf, |
| 990 | 1151 | dataMap.dira[cctag],xhNo++,0,map,0,null,null,null,0,0));// 午餐班次 |
| 991 | 1152 | }else if(kssj> new Date (baseF.getCFDate(18,30)) && |
| 992 | - kssj<new Date (baseF.getCFDate(20,0)) && $_cfw<1 ) { | |
| 1153 | + kssj<new Date (baseF.getCFDate(19,30)) && $_cfw<1 && cfdd == cctag && | |
| 1154 | + parseInt((endTime-kssj)/60000) > parseInt(dataMap.zwcArr[1])) { | |
| 993 | 1155 | $_cfw++; |
| 994 | 1156 | rs.push(baseF.getbcObj( |
| 995 | 1157 | kssj,dataMap.zwcArr[1],cara[c],dataMap.bcTypeArr.cf, |
| ... | ... | @@ -1009,8 +1171,7 @@ var BaseFun = function() { |
| 1009 | 1171 | return rs; |
| 1010 | 1172 | }, |
| 1011 | 1173 | |
| 1012 | - isgfsjd01 : function(kssj,dataMap) { | |
| 1013 | - | |
| 1174 | + isgfsjd01 : function(kssj,dataMap,type) { | |
| 1014 | 1175 | var tag = false; |
| 1015 | 1176 | if((dataMap.zgfsjd[0].st <=kssj && kssj<= dataMap.zgfsjd[0].ed ) || ( dataMap.wgfsjd[0].st <= kssj && kssj <= dataMap.wgfsjd[0].ed)) |
| 1016 | 1177 | tag = true; |
| ... | ... | @@ -1178,8 +1339,8 @@ var BaseFun = function() { |
| 1178 | 1339 | * |
| 1179 | 1340 | * @return : 返回一个数组对象。这里返回的是时刻表明细数据 |
| 1180 | 1341 | **/ |
| 1181 | - tzsmbcsj01 : function(list,smbcsj,sj,cl,zd,lbsj) { | |
| 1182 | - var _obj = baseF.getsxAndxxbc(list); | |
| 1342 | + tzsmbcsj01 : function(list,smbcsj,sj,cl,zd,lbsj,dm) { | |
| 1343 | + var _obj = baseF.getsxAndxxbc(list,dm); | |
| 1183 | 1344 | baseF.tcbc(_obj.sxbc,smbcsj[0].kssj,smbcsj[0].jssj ,_obj.xxbc);// 剔除上行不在时间范围内的班次 |
| 1184 | 1345 | baseF.tcbc(_obj.xxbc,smbcsj[1].kssj,smbcsj[1].jssj,_obj.sxbc);// 剔除下行不在时间范围内的班次 |
| 1185 | 1346 | baseF.dzsmsj(_obj.sxbc,smbcsj[0].kssj,smbcsj[0].jssj,_obj.xxbc);// 调整上行首末班车时间 |
| ... | ... | @@ -1191,7 +1352,7 @@ var BaseFun = function() { |
| 1191 | 1352 | if(baseF.isDelete(baseF.getDateTime(kssj), |
| 1192 | 1353 | baseF.getDateTime(jssj), |
| 1193 | 1354 | baseF.getDateTime(ar[s].fcsj))) { |
| 1194 | - var tempa = ar.concat(ppar),sslpA = new Array(); | |
| 1355 | + /*var tempa = ar.concat(ppar),sslpA = new Array(); | |
| 1195 | 1356 | for(var r = 0 ; r<tempa.length;r++) { |
| 1196 | 1357 | if(tempa[r].lpNo == ar[s].lpNo) |
| 1197 | 1358 | sslpA.push(tempa[r]); |
| ... | ... | @@ -1211,7 +1372,7 @@ var BaseFun = function() { |
| 1211 | 1372 | break; |
| 1212 | 1373 | } |
| 1213 | 1374 | } |
| 1214 | - } | |
| 1375 | + }*/ | |
| 1215 | 1376 | ar.splice(s, 1); |
| 1216 | 1377 | s--; |
| 1217 | 1378 | } |
| ... | ... | @@ -1331,15 +1492,19 @@ var BaseFun = function() { |
| 1331 | 1492 | return tag; |
| 1332 | 1493 | }, |
| 1333 | 1494 | |
| 1334 | - getsxAndxxbc : function(json) { | |
| 1495 | + getsxAndxxbc : function(json,dataMap) { | |
| 1335 | 1496 | var upArray = new Array(),downArray = new Array(),qt = new Array(); |
| 1336 | 1497 | for(var j = 0 ; j< json.length ; j++) { |
| 1337 | - if(json[j].bcType=='normal' || json[j].bcType=='region') { | |
| 1498 | + //json[j].fcint = baseF.getDateTime(json[j].fcsj).getTime(); | |
| 1499 | + if(json[j].bcType== dataMap.bcTypeArr.normal || | |
| 1500 | + json[j].bcType== dataMap.bcTypeArr.region || | |
| 1501 | + json[j].bcType== dataMap.bcTypeArr.major || | |
| 1502 | + json[j].bcType== dataMap.bcTypeArr.venting) { | |
| 1338 | 1503 | if(json[j].xlDir == 'relationshipGraph-up') |
| 1339 | 1504 | upArray.push(json[j]); |
| 1340 | 1505 | else if(json[j].xlDir == 'relationshipGraph-down') |
| 1341 | 1506 | downArray.push(json[j]); |
| 1342 | - }else { | |
| 1507 | + }else if(json[j].bcType == dataMap.bcTypeArr.cf) { | |
| 1343 | 1508 | qt.push(json[j]); |
| 1344 | 1509 | } |
| 1345 | 1510 | } |
| ... | ... | @@ -1676,24 +1841,26 @@ var BaseFun = function() { |
| 1676 | 1841 | dqbcddsj.setMinutes(dqbcddsj.getMinutes() + _xxsj); |
| 1677 | 1842 | xgbc.ARRIVALTIME = baseF.getTimeStr(dqbcddsj);// 修改下个班次的到达时间 |
| 1678 | 1843 | }, |
| 1679 | - getObjRegion : function(t1,t2,arr) { | |
| 1844 | + getObjRegion : function(t1,t2,arr,dataMap) { | |
| 1680 | 1845 | var _r = new Array(); |
| 1681 | 1846 | for(var p= 0; p<arr.length ; p++) { |
| 1682 | 1847 | var _t = baseF.getDateTime(arr[p].fcsj); |
| 1683 | - if(_t >= t1 && _t <= t2) | |
| 1848 | + if(_t >= t1 && _t <= t2 && arr[p].bcType != dataMap.bcTypeArr.cf ) | |
| 1684 | 1849 | _r.push(arr[p]); |
| 1685 | 1850 | } |
| 1686 | - /*return baseF.sortDirArray(_r);*/ | |
| 1687 | 1851 | return _r.sort(function(a,b){return a.fcno-b.fcno}); |
| 1688 | 1852 | }, |
| 1689 | 1853 | |
| 1690 | - getlpNum : function(arr) { | |
| 1691 | - var array = new Array(); | |
| 1692 | - for(var r = 0 ; r < arr.length ; r++) { | |
| 1693 | - if(array.indexOf(arr[r].lpNo)<0) | |
| 1694 | - array.push(arr[r].lpNo); | |
| 1854 | + getlpNum : function(sz) { | |
| 1855 | + var temparray = new Array(),len_ = 0; | |
| 1856 | + for(var r = 0 ; r <sz.length ; r++) { | |
| 1857 | + if(temparray.indexOf(sz[r].lpNo)<0){ | |
| 1858 | + temparray.push(sz[r].lpNo); | |
| 1859 | + } | |
| 1695 | 1860 | } |
| 1696 | - return (array.length-1); | |
| 1861 | + len_ = temparray.length; | |
| 1862 | + temparray = null; | |
| 1863 | + return len_; | |
| 1697 | 1864 | }, |
| 1698 | 1865 | /** |
| 1699 | 1866 | * @description : (TODO)更新进场与离场班次 | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
| ... | ... | @@ -219,11 +219,11 @@ $('.updownread').on('click',function() { |
| 219 | 219 | // 执行选择框关闭函数. |
| 220 | 220 | RelationshipGraph.gClose(); |
| 221 | 221 | // 执行均匀发车间隙函数. |
| 222 | - RelationshipGraph.updownread(); | |
| 222 | + RelationshipGraph.updownread01(); | |
| 223 | 223 | }); |
| 224 | 224 | }else { |
| 225 | 225 | // 执行均匀发车间隙函数 |
| 226 | - RelationshipGraph.updownread(); | |
| 226 | + RelationshipGraph.updownread01(); | |
| 227 | 227 | } |
| 228 | 228 | }); |
| 229 | 229 | /************************************************************************************************************************************************/ |
| ... | ... | @@ -1226,6 +1226,43 @@ var RelationshipGraph = function () { |
| 1226 | 1226 | } |
| 1227 | 1227 | } |
| 1228 | 1228 | }, { |
| 1229 | + key : 'updownread01', | |
| 1230 | + value : function updownread01() { | |
| 1231 | + // 1、获取所有班次数. | |
| 1232 | + var list = $_GlobalGraph.getDataArray(); | |
| 1233 | + var dataMap = $_GlobalGraph.configuration.dataMap; | |
| 1234 | + var rsmap = BaseFun.getsxAndxxbc(list,dataMap); | |
| 1235 | + var cara = $_GlobalGraph.configuration.taskTypes; | |
| 1236 | + var jar01 = rsmap.qt.concat(rsmap.sxbc).concat(rsmap.xxbc); | |
| 1237 | + BaseFun.jhfcjx01(jar01,dataMap); | |
| 1238 | + var jar = BaseFun.tzsmbcsj01( | |
| 1239 | + BaseFun.setbcsAndfcno(BaseFun.tzsmbcsj01(BaseFun.setbcsAndfcno(BaseFun.tzsztest(cara,jar01,dataMap)),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,dataMap.lbsj,dataMap)), | |
| 1240 | + dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,dataMap.lbsj,dataMap); | |
| 1241 | + var resultJA = new Array(); | |
| 1242 | + for(var m = 0 ; m < cara.length; m++) { | |
| 1243 | + // 获取路牌编号. | |
| 1244 | + var lpNo_ = cara[m].lpNo; | |
| 1245 | + // 定义路牌下的所有班次. | |
| 1246 | + var lpbc_ = new Array(); | |
| 1247 | + // 遍历班次数. | |
| 1248 | + for(var x =0 ; x <jar.length; x++) { | |
| 1249 | + // 判断当期遍历的班次是否属于当前的路牌. | |
| 1250 | + if(jar[x].lpNo == lpNo_) | |
| 1251 | + lpbc_.push(jar[x]); | |
| 1252 | + } | |
| 1253 | + // 按照发车序号顺序排序. | |
| 1254 | + lpbc_.sort(function(a,b){return a.fcno-b.fcno}); | |
| 1255 | + resultJA = resultJA.concat(BaseFun.addjclbbc01(lpbc_,dataMap,dataMap.lbsj,dataMap.map)); | |
| 1256 | + } | |
| 1257 | + // 删除图形. | |
| 1258 | + $('svg.svg-chart').remove(); | |
| 1259 | + // 重新创建图形. | |
| 1260 | + var graph_ = d3.select('#ganttSvg').relationshipGraph($_GlobalGraph.configuration); | |
| 1261 | + // 根据数据重新渲染图形. | |
| 1262 | + graph_.data(resultJA); | |
| 1263 | + $_GlobalGraph = graph_; | |
| 1264 | + } | |
| 1265 | + }, { | |
| 1229 | 1266 | key : 'updownread', |
| 1230 | 1267 | value : function updownread() { |
| 1231 | 1268 | //var index = layer.load(1, {shade: [0.1,'#fff'] });//0.1透明度的白色背景 | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/gantt.js
src/main/resources/static/pages/base/timesmodel/tepms/bctype_temp.html
| ... | ... | @@ -267,8 +267,8 @@ |
| 267 | 267 | <div class="col-md-5"> |
| 268 | 268 | <select type="text" class="form-control" name="cfdd" id="cfddSelect"> |
| 269 | 269 | <option value="">请选择...</option> |
| 270 | - <option value="{{map.line.startStationName}}">{{map.line.startStationName}}</option> | |
| 271 | - <option value="{{map.line.endStationName}}">{{map.line.endStationName}}</option> | |
| 270 | + <option value="0">{{map.line.startStationName}}</option> | |
| 271 | + <option value="1">{{map.line.endStationName}}</option> | |
| 272 | 272 | <option value="allYes">起终点站都可以</option> |
| 273 | 273 | </select> |
| 274 | 274 | </div> | ... | ... |
src/main/resources/static/pages/forms/mould/list.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/account.html
| ... | ... | @@ -38,8 +38,11 @@ |
| 38 | 38 | <div style="display: inline-block;margin-left: 15px"> |
| 39 | 39 | <span class="item-label" style="width: 140px;">内部编码: </span> |
| 40 | 40 | <select class="form-control" name="code" id="code" style="width: 180px;"></select> |
| 41 | + <input class="btn btn-default" type="button" id="czcl" value="X"/> | |
| 42 | + | |
| 41 | 43 | </div> |
| 42 | 44 | <div class="form-group"> |
| 45 | + | |
| 43 | 46 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 44 | 47 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 45 | 48 | </div> |
| ... | ... | @@ -52,7 +55,7 @@ |
| 52 | 55 | <tr> |
| 53 | 56 | <th>序号</th> |
| 54 | 57 | <th>线路</th> |
| 55 | - <th>车辆</th> | |
| 58 | + <th class="nbbmPx">车辆</th> | |
| 56 | 59 | <th>所属公司</th> |
| 57 | 60 | <th>请求类型</th> |
| 58 | 61 | <th>请求时间</th> |
| ... | ... | @@ -89,19 +92,22 @@ |
| 89 | 92 | for(var code in result){ |
| 90 | 93 | data.push({id: code, text: result[code]}); |
| 91 | 94 | } |
| 92 | - console.log(data); | |
| 93 | 95 | initPinYinSelect2('#line',data,''); |
| 94 | 96 | |
| 95 | 97 | }) |
| 96 | - | |
| 97 | - | |
| 98 | + //重置 | |
| 99 | + $('#czcl').on('click', function () { | |
| 100 | + $('#code').val('').change(); | |
| 101 | + }); | |
| 102 | + $("#line").on("change",initCl); | |
| 103 | + function initCl(){ | |
| 98 | 104 | $('#code').select2({ |
| 99 | 105 | ajax: { |
| 100 | - url: '/realSchedule/sreachVehic', | |
| 106 | + url: '/report/carList', | |
| 101 | 107 | dataType: 'json', |
| 102 | 108 | delay: 150, |
| 103 | 109 | data: function(params){ |
| 104 | - return{nbbm: params.term}; | |
| 110 | + return{nbbm: params.term,xlbm:$('#line').val()}; | |
| 105 | 111 | }, |
| 106 | 112 | processResults: function (data) { |
| 107 | 113 | return { |
| ... | ... | @@ -133,11 +139,38 @@ |
| 133 | 139 | } |
| 134 | 140 | } |
| 135 | 141 | }); |
| 136 | - | |
| 137 | - var line = $("#line").val(); | |
| 138 | - var xlName = $("#select2-line-container").html(); | |
| 139 | - var date = $("#date").val(); | |
| 140 | - var code = $("#code").val(); | |
| 142 | + } | |
| 143 | + var line = $("#line").val(); | |
| 144 | + var xlName = $("#select2-line-container").html(); | |
| 145 | + var date = $("#date").val(); | |
| 146 | + var code = $("#code").val(); | |
| 147 | + var px="desc"; | |
| 148 | + $(".nbbmPx").on("click",function(){ | |
| 149 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | |
| 150 | + layer.msg("请选择时间"); | |
| 151 | + return; | |
| 152 | + } | |
| 153 | + if(px=="desc"){ | |
| 154 | + px="asc"; | |
| 155 | + }else{ | |
| 156 | + px="desc"; | |
| 157 | + } | |
| 158 | + line = $("#line").val(); | |
| 159 | + xlName = $("#select2-line-container").html(); | |
| 160 | + date = $("#date").val(); | |
| 161 | + code = $("#code").val(); | |
| 162 | + | |
| 163 | + $get('/realSchedule/accountPx',{line:line,date:date,code:code,xlName:xlName,px:px},function(result){ | |
| 164 | + $.each(result, function(i, obj) { | |
| 165 | + obj.requestType = reqCodeMap[obj.requestType]; | |
| 166 | + }); | |
| 167 | + // 把数据填充到模版中 | |
| 168 | + var tbodyHtml = template('list_account',{list:result}); | |
| 169 | + // 把渲染好的模版html文本追加到表格中 | |
| 170 | + $('#forms tbody').html(tbodyHtml); | |
| 171 | + }); | |
| 172 | + }) | |
| 173 | + | |
| 141 | 174 | $("#query").on("click",function(){ |
| 142 | 175 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 143 | 176 | layer.msg("请选择时间"); | ... | ... |
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -263,14 +263,13 @@ |
| 263 | 263 | }); |
| 264 | 264 | jName = params[0].split("\\")[0]; |
| 265 | 265 | jGh = params[0].split("\\")[1]; |
| 266 | - var id = $("#"+params[1]).val(); | |
| 266 | + var id = params[3]; | |
| 267 | 267 | $get('/realSchedule/MapById',{id:id},function(result){ |
| 268 | 268 | result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD"); |
| 269 | 269 | var ludan_1 = template('ludan_1',result); |
| 270 | 270 | // 把渲染好的模版html文本追加到表格中 |
| 271 | 271 | $('#forms .ludan_1').html(ludan_1); |
| 272 | 272 | }); |
| 273 | - console.log(params); | |
| 274 | 273 | $get('/realSchedule/queryListWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){ |
| 275 | 274 | getTime(result); |
| 276 | 275 | var ludan_2 = template('ludan_2',{list:result}); |
| ... | ... | @@ -336,7 +335,8 @@ |
| 336 | 335 | <tr> |
| 337 | 336 | <td width="45%">{{obj[4]}}\{{obj[1]}}</td> |
| 338 | 337 | <td width="32%">{{obj[2]}}</td> |
| 339 | - <td width="23%">{{obj[3]}}<input type="hidden" id="{{obj[2]}}" value="{{obj[0]}}"></td> | |
| 338 | + <td width="20%">{{obj[3]}}</td> | |
| 339 | + <td width="3%" hidden="true">{{obj[0]}}</td> | |
| 340 | 340 | </tr> |
| 341 | 341 | {{/each}} |
| 342 | 342 | {{if list.length == 0}} |
| ... | ... | @@ -348,9 +348,11 @@ |
| 348 | 348 | <script type="text/html" id="list_info_px"> |
| 349 | 349 | {{each list as obj i}} |
| 350 | 350 | <tr> |
| 351 | + | |
| 351 | 352 | <td width="45%">{{obj.jName}}\{{obj.jGh}}</td> |
| 352 | 353 | <td width="32%">{{obj.clZbh}}</td> |
| 353 | - <td width="23%">{{obj.lpName}}<input type="hidden" id="{{obj.clZbh}}" value="{{obj.id}}"></td> | |
| 354 | + <td width="23%">{{obj.lpName}}</td> | |
| 355 | + <td hidden="true">{{obj.id}}</td> | |
| 354 | 356 | </tr> |
| 355 | 357 | {{/each}} |
| 356 | 358 | {{if list.length == 0}} | ... | ... |
src/main/resources/static/pages/oil/add.html