Commit 0b70499d68b8229d5167ec50187570eb15eb4ea9

Authored by 廖磊
1 parent 7d3ef5ea

报表,油量去掉分页,计算车厢存油保存整数

src/main/java/com/bsth/controller/oil/YlbController.java
... ... @@ -157,6 +157,23 @@ public class YlbController extends BaseController<Ylb, Integer>{
157 157 }
158 158  
159 159  
  160 +
  161 +
  162 + /**
  163 + *
  164 + * @Title: list
  165 + * @Description: TODO(多条件分页查询)
  166 + * @param @param map 查询条件
  167 + * @param @param page 页码
  168 + * @param @param size 每页显示数量
  169 + * @throws
  170 + */
  171 + @RequestMapping(value = "/ylbList",method = RequestMethod.GET)
  172 + public List<Ylb> ylbList(@RequestParam Map<String, Object> map){
  173 + List<Ylb> ylbList=yblService.listYlb(map);
  174 + return ylbList;
  175 + }
  176 +
160 177 @RequestMapping(value="/oilListMonth")
161 178 public List<Ylb> oilListMonth(@RequestParam String line,@RequestParam String date){
162 179 return yblService.oilListMonth(line, date);
... ...
src/main/java/com/bsth/repository/oil/YlbRepository.java
... ... @@ -88,4 +88,14 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
88 88 + " and xlbm like %?4% "
89 89 + " and nbbm like %?5%",nativeQuery=true)
90 90 List<Object[]> sumYlb2(String rq, String gsbm,String fgsbm,String xlbm,String nbbm);
  91 +
  92 +
  93 +
  94 + @Query(value="select s from Ylb s "
  95 + + " where to_days(?1)=to_days(s.rq) "
  96 + + " and s.ssgsdm like %?2% "
  97 + + " and s.fgsdm like %?3%"
  98 + + " and s.xlbm like %?4% "
  99 + + " and s.nbbm in ?5 ")
  100 + List<Ylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm);
91 101 }
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -125,7 +125,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
125 125 @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj")
126 126 List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date);
127 127  
128   - @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.bcType not in ('in','out') order by s.xlBm")
  128 + @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.bcType not in ('in','out') order by s.xlBm")
129 129 List<ScheduleRealInfo> scheduleByDateAndLine2(String line,String date);
130 130  
131 131 //按月统计
... ... @@ -136,7 +136,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
136 136 @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm")
137 137 List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2);
138 138  
139   - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY xlBm,clZbh")
  139 + //按照时间段统计
  140 + @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm")
  141 + List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2);
  142 +
  143 + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY clZbh,fcsj")
140 144 List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm);
141 145  
142 146 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir")
... ...
src/main/java/com/bsth/service/oil/YlbService.java
... ... @@ -18,6 +18,6 @@ public interface YlbService extends BaseService&lt;Ylb, Integer&gt;{
18 18 Map<String, Object> sumYlb(Map<String, Object> map);
19 19  
20 20 List<Ylb> oilListMonth(String line,String date);
21   -
  21 + List<Ylb> listYlb(Map<String, Object> map);
22 22 StringBuffer checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int lx);
23 23 }
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -173,6 +173,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
173 173 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
174 174 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
175 175 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
  176 + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
176 177 t.setRq(sdf.parse(rq));
177 178 repository.save(t);
178 179  
... ... @@ -323,8 +324,8 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
323 324 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
324 325 t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString());
325 326 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString());
  327 + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
326 328 t.setRq(sdf.parse(rq));
327   -
328 329 if(type.equals("add")){
329 330 addList.add(t);
330 331 }else{
... ... @@ -381,6 +382,8 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
381 382 nbbm=map.get("nbbm_eq").toString();
382 383 }
383 384  
  385 + List<Cyl> cylListAdd=new ArrayList<Cyl>();
  386 + Map<String, Object> cylMapAdd=new HashMap<String,Object>();
384 387 Map<String, Object> newMap=new HashMap<String,Object>();
385 388 Map<String, Object> map2=new HashMap<String,Object>();
386 389 try {
... ... @@ -391,7 +394,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
391 394 // 获取车辆存油信息
392 395 List<Cyl> cylList = cylRepository.obtainCyl(nbbm,gsbm);
393 396 // 指定日期YLB信息
394   - List<Ylb> ylbList =repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm");
  397 + List<Ylb> ylbList =repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx");
395 398 List<Ylb> iterator2=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx");
396 399 for (int i=0;i<ylbList.size();i++) {
397 400 Ylb ylb = ylbList.get(i);
... ... @@ -427,31 +430,40 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
427 430 // Iterator<Ylb> iterator2 = repository
428 431 // .findAll(new CustomerSpecs<Ylb>(map), new Sort(Direction.ASC, "jcsx")).iterator();
429 432 for (int j = 0; j < iterator2.size(); j++) {
430   -
431 433 Ylb t = iterator2.get(j);
432 434 if(t.getNbbm().equals(ylb.getNbbm())){
433 435 if (t.getJcsx() == 1) {
434 436 // 进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量
435 437 Double yl = t.getCzyl();
436 438 Double jcyl = t.getCzyl();
437   -// zyl = jcyl + jzl - yl;
438 439 zyl =Arith.sub( Arith.add(jcyl, jzl),yl);
439   - Double yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc)));
440   - t.setYh(yh);
441   -// nextJzyl = t.getJzl() + t.getCzyl() - yh;
  440 + Double yh=0.0;
  441 + if(zlc>0){
  442 + yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc)));
  443 + }
442 444 nextJzyl =Arith.sub( Arith.add(t.getJzl(), t.getCzyl()),yh);
443   -// t.setJzyl(Double.parseDouble(df.format(nextJzyl)));
444   - t.setJzyl(nextJzyl);
  445 + //把进场油量的小数和整数分别取出
  446 +// int ylxs=(int) nextJzyl; 10.6--11 10.3--10
  447 + long l=Math.round(nextJzyl);
  448 + double ylxs=l*100/100;
  449 +// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs));
  450 + yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl));
  451 + t.setYh(yh);
  452 + t.setJzyl(ylxs);
  453 + nextJzyl=ylxs;
445 454 } else {
446   -// t.setCzyl(Double.parseDouble(df.format(nextJzyl)));
447 455 t.setCzyl(nextJzyl);
448 456 Double yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc)));
449   - t.setYh(yh);
450   -// nextJzyl = t.getJzl() + nextJzyl - yh;
451 457 nextJzyl =Arith.sub( Arith.add(t.getJzl(),nextJzyl),yh);
452   -// t.setJzyl(Double.parseDouble(df.format(nextJzyl)));
453   - t.setJzyl(nextJzyl);
  458 + long l=Math.round(nextJzyl);
  459 + double ylxs=l*100/100;
  460 +// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs));
  461 + yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl));
  462 + t.setYh(yh);
  463 + t.setJzyl(ylxs);
  464 + nextJzyl= ylxs;
454 465 }
  466 +
455 467 repository.save(t);
456 468 }
457 469  
... ... @@ -470,17 +482,36 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
470 482 if (fage) {
471 483 cylRepository.save(cyl);
472 484 } else {
473   - cyl = new Cyl();
474   - cyl.setNbbm(t.getNbbm());
475   - cyl.setCyl(t.getJzyl());
476   - cyl.setGsdm(t.getSsgsdm());
477   - cyl.setUpdatetime(t.getRq());
478   - cylRepository.save(cyl);
  485 + if(cylMapAdd.get(t.getNbbm())!=null){
  486 + for (int l = 0; l < cylListAdd.size(); l++) {
  487 + cyl=cylListAdd.get(l);
  488 + if(cyl.getNbbm().equals(t.getNbbm())){
  489 + cyl.setNbbm(t.getNbbm());
  490 + cyl.setCyl(t.getJzyl());
  491 + cyl.setGsdm(t.getSsgsdm());
  492 + cyl.setFgsdm(t.getFgsdm());
  493 + cyl.setUpdatetime(t.getRq());
  494 + }
  495 + }
  496 + }else{
  497 + cyl = new Cyl();
  498 + cyl.setNbbm(t.getNbbm());
  499 + cyl.setCyl(t.getJzyl());
  500 + cyl.setGsdm(t.getSsgsdm());
  501 + cyl.setFgsdm(t.getFgsdm());
  502 + cyl.setUpdatetime(t.getRq());
  503 + cylListAdd.add(cyl);
  504 + }
  505 +
  506 +
479 507 }
480 508 map2.put("status", ResponseCode.SUCCESS);
481 509 }
482 510 }
483 511 }
  512 + for (int i = 0; i < cylListAdd.size(); i++) {
  513 + cylRepository.save(cylListAdd.get(i));
  514 + }
484 515 } catch (Exception e) {
485 516 map2.put("status", ResponseCode.ERROR);
486 517 logger.error("save erro.", e);
... ... @@ -507,7 +538,8 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
507 538 Double sh= Double.parseDouble(map.get("sh").toString());
508 539 String shyy=map.get("shyy").toString();
509 540 Ylb ylb = repository.findOne(id);
510   -
  541 + List<Cyl> cylListAdd=new ArrayList<Cyl>();
  542 + Map<String, Object> cylMapAdd=new HashMap<String,Object>();
511 543 String nbbm_eq = ylb.getNbbm();
512 544 Date rq_eq = ylb.getRq();
513 545 // 得到一天总的加油和里程(根据车,时间)
... ... @@ -527,12 +559,9 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
527 559  
528 560 //新的 损耗不等于 旧的损耗 总损耗从新算
529 561 if(Arith.sub(ylb.getSh(),sh )!=0){
530   -// zsh =zsh-ylb.getSh()+sh;
531 562 zsh =Arith.add(Arith.sub(zsh, ylb.getSh()), sh);
532   -// jzl =jzl-zsh;
533 563 jzl =Arith.sub(jzl, zsh);
534 564 }else{
535   -// jzl=jzl-zsh;
536 565 jzl =Arith.sub(jzl, zsh);
537 566 }
538 567 map.put("nbbm_eq", nbbm_eq);
... ... @@ -555,33 +584,37 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
555 584 t.setShyy(shyy);
556 585 }
557 586 Double jcyl = t.getCzyl();
558   -// zyl = jcyl + jzl - yl;
559 587 zyl = Arith.sub(Arith.add(jcyl, jzl), yl);
560 588 Double yh = 0.0;
561 589 if (zlc > 0 && t.getZlc() > 0) {
562 590 yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc)));
563 591 }
564   - t.setYh(yh);
565   -// nextJzyl = t.getJzl() + t.getCzyl() - yh-t.getSh();
566 592 nextJzyl =Arith.sub(Arith.add(t.getJzl(), t.getCzyl()), Arith.add(yh, t.getSh()));
567   -// t.setJzyl(Double.parseDouble(df.format(nextJzyl)));
568   - t.setJzyl(nextJzyl);
  593 + long l=Math.round(nextJzyl);
  594 + double ylxs=l*100/100;
  595 +// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs));
  596 + yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl));
  597 + t.setJzyl(ylxs);
  598 + t.setYh(yh);
  599 + nextJzyl=ylxs;
569 600 } else {
570 601 if(t.getId()==id){
571 602 t.setSh(sh);
572 603 t.setShyy(shyy);
573 604 }
574   - if (t.getZlc() != 0) {
575   -// t.setCzyl(Double.parseDouble(df.format(nextJzyl)));
576 605 t.setCzyl(nextJzyl);
577   - Double yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc)));
578   - t.setYh(yh);
579   -// nextJzyl = t.getJzl() + nextJzyl - yh-t.getSh();
  606 + Double yh =0.0;
  607 + if (t.getZlc() != 0) {
  608 + yh= Double.parseDouble(df.format(zyl * (t.getZlc() / zlc)));
  609 + }
580 610 nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), Arith.add(yh, t.getSh()));
581   -// t.setJzyl(Double.parseDouble(df.format(nextJzyl)));
582   - t.setJzyl(nextJzyl);
583   - }
584   -
  611 + long l=Math.round(nextJzyl);
  612 + double ylxs=l*100/100;
  613 +// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs));
  614 + yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl));
  615 + t.setJzyl(ylxs);
  616 + t.setYh(yh);
  617 + nextJzyl=ylxs;
585 618 }
586 619 repository.save(t);
587 620  
... ... @@ -600,16 +633,33 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
600 633 if (fage) {
601 634 cylRepository.save(cyl);
602 635 } else {
603   - cyl = new Cyl();
604   - cyl.setNbbm(t.getNbbm());
605   - cyl.setCyl(t.getJzyl());
606   - cyl.setGsdm(t.getSsgsdm());
607   - cyl.setUpdatetime(t.getRq());
608   - cylRepository.save(cyl);
  636 + if(cylMapAdd.get(t.getNbbm())!=null){
  637 + for (int l = 0; l < cylListAdd.size(); l++) {
  638 + cyl=cylListAdd.get(l);
  639 + if(cyl.getNbbm().equals(t.getNbbm())){
  640 + cyl.setNbbm(t.getNbbm());
  641 + cyl.setCyl(t.getJzyl());
  642 + cyl.setGsdm(t.getSsgsdm());
  643 + cyl.setFgsdm(t.getFgsdm());
  644 + cyl.setUpdatetime(t.getRq());
  645 + }
  646 + }
  647 + }else{
  648 + cyl = new Cyl();
  649 + cyl.setNbbm(t.getNbbm());
  650 + cyl.setCyl(t.getJzyl());
  651 + cyl.setGsdm(t.getSsgsdm());
  652 + cyl.setFgsdm(t.getFgsdm());
  653 + cyl.setUpdatetime(t.getRq());
  654 + cylListAdd.add(cyl);
  655 + }
609 656 }
610 657  
611 658 newMap.put("status", ResponseCode.SUCCESS);
612 659 }
  660 + for (int i = 0; i < cylListAdd.size(); i++) {
  661 + cylRepository.save(cylListAdd.get(i));
  662 + }
613 663 } catch (Exception e) {
614 664 newMap.put("status", ResponseCode.ERROR);
615 665 logger.error("save erro.", e);
... ... @@ -845,6 +895,55 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
845 895 // }
846 896 return sumMap;
847 897 }
  898 +
  899 + @Override
  900 + public List<Ylb> listYlb(Map<String, Object> map) {
  901 + // TODO Auto-generated method stub
  902 + List<Ylb> listYlb=new ArrayList<Ylb>();
  903 + List<String> stringList=new ArrayList<String>();
  904 + String rq=map.get("rq").toString();
  905 + String gsbm=map.get("ssgsdm_like").toString();
  906 + String fgsbm=map.get("fgsdm_like").toString();
  907 + String xlbm=map.get("xlbm_like").toString().trim();
  908 + String nbbm=map.get("nbbm_eq").toString();
  909 + String sxtj=map.get("sxtj").toString();
  910 + if(nbbm.trim()!=""){
  911 + stringList.add(nbbm);
  912 + listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList);
  913 + }else{
  914 + //全部
  915 + if(sxtj.equals("0")){
  916 + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm);
  917 + for (int i = 0; i < objectLists.size(); i++) {
  918 + String clbm=objectLists.get(i)[0].toString();
  919 + stringList.add(clbm);
  920 + }
  921 +
  922 + listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList);
  923 + }else{
  924 + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm);
  925 + for (int i = 0; i < objectLists.size(); i++) {
  926 + String clbm=objectLists.get(i)[0].toString();
  927 + int cs=Integer.parseInt(objectLists.get(i)[1].toString());
  928 + //一车一单
  929 + if(sxtj.equals("1")){
  930 + if(cs==1){
  931 + stringList.add(clbm);
  932 + }
  933 + }
  934 + //一车多单
  935 + if(sxtj.equals("2")){
  936 + if(cs>1){
  937 + stringList.add(clbm);
  938 + }
  939 + }
  940 + }
  941 + listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList);
  942 + }
  943 + }
  944 +
  945 + return listYlb;
  946 + }
848 947  
849 948  
850 949 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -1299,7 +1299,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1299 1299 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
1300 1300 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
1301 1301 int jhbc = 0, cjbc = 0, ljbc = 0;
1302   - double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0;
  1302 + double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0,jhlcOrig=0, jcclc = 0;
1303 1303 float addMileage = 0l, remMileage = 0l,addMileageYy = 0l,addMileageJc =0l;
1304 1304 Map<String, Object> map = new HashMap<String, Object>();
1305 1305 for (ScheduleRealInfo scheduleRealInfo : list) {
... ... @@ -1309,6 +1309,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1309 1309 //临加里程(主任务临加),
1310 1310 //计划班次,烂班班次,增加班次
1311 1311 tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc();
  1312 + jhlcOrig = scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig();
  1313 +
1312 1314 if (scheduleRealInfo.isSflj()) {
1313 1315 addMileage += tempJhlc;
1314 1316 if (scheduleRealInfo.getBcType().equals("in")
... ... @@ -1323,9 +1325,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1323 1325 if (!(scheduleRealInfo.getBcType().equals("in")
1324 1326 || scheduleRealInfo.getBcType().equals("out"))) {
1325 1327 jhbc++;
1326   - jhlc += tempJhlc;
  1328 + jhlc += jhlcOrig;
1327 1329 if (scheduleRealInfo.getStatus() == -1) {
1328   - remMileage += tempJhlc;
  1330 + remMileage += jhlcOrig;
1329 1331 cjbc++;
1330 1332 }
1331 1333 }
... ... @@ -1372,12 +1374,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1372 1374 }
1373 1375 }
1374 1376 }
  1377 +
  1378 + //yygl 包含了临加的营运公里 jcclc包含了临加的进出场里程
1375 1379 map.put("jhlc", format.format(jhlc));
1376 1380 map.put("remMileage", format.format(remMileage));
1377 1381 map.put("addMileage", format.format(addMileage));
1378   - map.put("yygl", format.format(yygl+addMileageYy));
  1382 + map.put("yygl", format.format(yygl));
1379 1383 map.put("ksgl", format.format(ksgl));
1380   - map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileageYy));
  1384 + map.put("realMileage", format.format(yygl + ksgl + jcclc));
1381 1385 // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage));
1382 1386 map.put("jhbc", jhbc);
1383 1387 map.put("cjbc", cjbc);
... ... @@ -2129,7 +2133,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2129 2133 public List<Map<String, Object>> statisticsDailyTj(String line, String date,String date2,
2130 2134 String xlName, String type) {
2131 2135 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
2132   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2);
  2136 + if(line!=null){
  2137 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
  2138 + }else{
  2139 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2);
  2140 + }
  2141 +
2133 2142  
2134 2143 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
2135 2144 DecimalFormat format = new DecimalFormat("0.00");
... ... @@ -2896,12 +2905,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2896 2905 //前一天日期
2897 2906 // String date = sdfMonth.format(org.apache.commons.lang.time.DateUtils.addDays(new Date(), -1));
2898 2907 // String date = "2016-09-20";
2899   - System.out.println("shijian1:"+new Date());
  2908 +// System.out.println("shijian1:"+new Date());
2900 2909 List<Map<String, Object>> yesterdayDataList = scheduleRealInfoRepository.yesterdayDataList(line, date,gsbm,fgsbm);
2901   - System.out.println("shijian2:"+new Date());
  2910 +// System.out.println("shijian2:"+new Date());
2902 2911 // List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
2903 2912 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm);
2904   - System.out.println("shijian3:"+new Date());
  2913 +// System.out.println("shijian3:"+new Date());
2905 2914 for (int x = 0; x < yesterdayDataList.size(); x++) {
2906 2915 String jName = yesterdayDataList.get(x).get("jGh").toString();
2907 2916 String clZbh = yesterdayDataList.get(x).get("clZbh").toString();
... ... @@ -2928,18 +2937,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2928 2937 tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc();
2929 2938 if (scheduleRealInfo.isSflj()) {
2930 2939 if(scheduleRealInfo.getStatus() == -1){
2931   -// addMileage += tempJhlc;
2932 2940 addMileage =Arith.add(addMileage, tempJhlc);
2933 2941 }
2934 2942 } else {
2935 2943 if (!(scheduleRealInfo.getBcType().equals("in")
2936 2944 || scheduleRealInfo.getBcType().equals("out"))) {
2937   -// jhlc += tempJhlc;
2938 2945 jhlc =Arith.add(jhlc,tempJhlc);
2939 2946 }
2940 2947  
2941 2948 if (scheduleRealInfo.getStatus() == -1) {
2942   -// remMileage += tempJhlc;
2943 2949 remMileage =Arith.add(remMileage,tempJhlc);
2944 2950 }
2945 2951 }
... ... @@ -2949,7 +2955,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2949 2955 if (scheduleRealInfo.getBcType().equals("in") ||
2950 2956 scheduleRealInfo.getBcType().equals("out")) {
2951 2957 if (scheduleRealInfo.getStatus() != -1) {
2952   -// jcclc += tempJhlc;
2953 2958 jcclc=Arith.add(jcclc,tempJhlc);
2954 2959 }
2955 2960 }
... ... @@ -2959,7 +2964,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2959 2964 // }
2960 2965 else {
2961 2966 if (scheduleRealInfo.getStatus() != -1) {
2962   -// yygl += tempJhlc;
2963 2967 yygl=Arith.add(yygl,tempJhlc);
2964 2968 }
2965 2969 }
... ... @@ -2969,19 +2973,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2969 2973 ChildTaskPlan childTaskPlan = it.next();
2970 2974 if (childTaskPlan.getMileageType().equals("empty")) {
2971 2975 if (childTaskPlan.isDestroy()) {
2972   -// remMileage += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
2973 2976 remMileage=Arith.add(remMileage,childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage());
2974 2977 } else {
2975   -// ksgl += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
2976 2978 ksgl += Arith.add(ksgl,childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage());
2977 2979 }
2978 2980 } else {
2979 2981 if (childTaskPlan.isDestroy()) {
2980   -// remMileage += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
2981 2982 remMileage=Arith.add(remMileage,childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage());
2982 2983  
2983 2984 } else {
2984   -// yygl += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
2985 2985 yygl=Arith.add(yygl,childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage());
2986 2986  
2987 2987 }
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -473,25 +473,22 @@
473 473 } */
474 474  
475 475 var l = layer.load(2);
476   - $get('/ylb', params, function (data) {
477   -
478   - $.each(data.content, function (i, obj) {
  476 + $get('/ylb/ylbList', params, function (data) {
  477 + $.each(data, function (i, obj) {
479 478 obj.rq = moment(obj.rq).format("YYYY-MM-DD");
480 479 });
481   - var bodyHtm = template('ylb_list_temp', {list: data.content});
482   -
483   - $('#datatable_ylb tbody').html(bodyHtm)
  480 + var bodyHtm = template('ylb_list_temp', {list:data});
  481 + $('#datatable_ylb tbody').html(bodyHtm);
  482 + /* $('#datatable_ylb tbody').html(bodyHtm)
484 483 .find('.icheck').iCheck(icheckOptions)
485 484 .on('ifChanged', iCheckChange);
486 485 if (pagination && data.content.length > 0) {
487 486 //重新分页
488 487 initPagination = true;
489 488 showPagination(data);
490   - }
  489 + } */
491 490 layer.close(l);
492 491 $get('/ylb/sumYlb',params,function(returns){
493   - console.log(returns);
494   - console.log(returns.jzl);
495 492 $("#sumJzl").html(returns.jzl);
496 493 $("#sumYh").html(returns.yh);
497 494 $("#sumSh").html(returns.sh);
... ...