Commit 3b6ee8534365b2fbb40c5add8ffcaa60857cf7df

Authored by 廖磊
1 parent 4d5e7aa3

油,电 对于同人同车同线路不同路的处理

src/main/java/com/bsth/entity/oil/Dlb.java
@@ -73,7 +73,7 @@ public class Dlb { @@ -73,7 +73,7 @@ public class Dlb {
73 private String fgsname; 73 private String fgsname;
74 74
75 75
76 - 76 + private String lp;
77 77
78 public Integer getId() { 78 public Integer getId() {
79 return id; 79 return id;
@@ -383,6 +383,15 @@ public class Dlb { @@ -383,6 +383,15 @@ public class Dlb {
383 public void setUpdatetime(Date updatetime) { 383 public void setUpdatetime(Date updatetime) {
384 this.updatetime = updatetime; 384 this.updatetime = updatetime;
385 } 385 }
  386 +
  387 + public String getLp() {
  388 + return lp;
  389 + }
  390 +
  391 + public void setLp(String lp) {
  392 + this.lp = lp;
  393 + }
  394 +
386 395
387 396
388 } 397 }
src/main/java/com/bsth/entity/oil/Ylb.java
@@ -56,6 +56,7 @@ public class Ylb { @@ -56,6 +56,7 @@ public class Ylb {
56 //进场顺序(根据最先出场和最后进场来关联车辆的存油量) 56 //进场顺序(根据最先出场和最后进场来关联车辆的存油量)
57 private int jcsx; 57 private int jcsx;
58 58
  59 + private String lp;
59 @Transient 60 @Transient
60 private String bglyh; 61 private String bglyh;
61 62
@@ -330,5 +331,14 @@ public class Ylb { @@ -330,5 +331,14 @@ public class Ylb {
330 public void setUpdatetime(Date updatetime) { 331 public void setUpdatetime(Date updatetime) {
331 this.updatetime = updatetime; 332 this.updatetime = updatetime;
332 } 333 }
  334 +
  335 + public String getLp() {
  336 + return lp;
  337 + }
  338 +
  339 + public void setLp(String lp) {
  340 + this.lp = lp;
  341 + }
  342 +
333 343
334 } 344 }
src/main/java/com/bsth/repository/oil/YlbRepository.java
@@ -125,8 +125,8 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ @@ -125,8 +125,8 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{
125 125
126 @Query(value="select s from Ylb s " 126 @Query(value="select s from Ylb s "
127 + " where to_days(?1)=to_days(s.rq) " 127 + " where to_days(?1)=to_days(s.rq) "
128 - + " and s.ssgsdm like %?2% "  
129 - + " and s.fgsdm like %?3%" 128 + + " and s.ssgsdm =?2 "
  129 + + " and s.fgsdm =?3 "
130 + " and s.xlbm like %?4% " 130 + " and s.xlbm like %?4% "
131 + " and s.nbbm in ?5 order by nbbm,jcsx") 131 + " and s.nbbm in ?5 order by nbbm,jcsx")
132 List<Ylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); 132 List<Ylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm);
src/main/java/com/bsth/repository/oil/YlxxbRepository.java
@@ -17,17 +17,17 @@ public interface YlxxbRepository extends BaseRepository&lt;Ylxxb, Integer&gt;{ @@ -17,17 +17,17 @@ public interface YlxxbRepository extends BaseRepository&lt;Ylxxb, Integer&gt;{
17 * @param rq 17 * @param rq
18 * @return 18 * @return
19 */ 19 */
20 - @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nylx=?2 and gsdm like %?3%",nativeQuery=true) 20 + @Query(value="SELECT * FROM bsth_c_ylxxb where yyrq=?1 and nylx=?2 and gsdm like %?3%",nativeQuery=true)
21 List<Ylxxb> obtainYlxx(String rq,int nylx,String gsdm); 21 List<Ylxxb> obtainYlxx(String rq,int nylx,String gsdm);
22 22
23 - @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and gsdm=?2",nativeQuery=true) 23 + @Query(value="SELECT * FROM bsth_c_ylxxb where yyrq=?1 and gsdm=?2",nativeQuery=true)
24 List<Ylxxb> checkYlxx(String rq,String gs); 24 List<Ylxxb> checkYlxx(String rq,String gs);
25 25
26 - @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nbbm =?2 and jylx=1",nativeQuery=true) 26 + @Query(value="SELECT * FROM bsth_c_ylxxb where yyrq=?1 and nbbm =?2 and jylx=1",nativeQuery=true)
27 List<Ylxxb> obtainYlxx2(String rq,String nbbm); 27 List<Ylxxb> obtainYlxx2(String rq,String nbbm);
28 28
29 @Query(value="select * from bsth_c_ylxxb s where s.nbbm = ?1 and " 29 @Query(value="select * from bsth_c_ylxxb s where s.nbbm = ?1 and "
30 - + "to_days(s.yyrq) = to_days(?2)",nativeQuery=true) 30 + + "s.yyrq=?2",nativeQuery=true)
31 List<Ylxxb> queryListYlxxb(String clZbh,String date); 31 List<Ylxxb> queryListYlxxb(String clZbh,String date);
32 32
33 33
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -190,10 +190,10 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -190,10 +190,10 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
190 List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2); 190 List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2);
191 191
192 192
193 - @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 s.scheduleDateStr = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate ORDER BY clZbh,fcsj") 193 + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,s.lpName as lpName,min(s.fcsj) as fcsj,min(s.realExecDate) as realExecDate ) from ScheduleRealInfo s where s.xlBm like %?1% and s.scheduleDateStr = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate,lpName ORDER BY clZbh,realExecDate,fcsj")
194 List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String nbbm); 194 List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String nbbm);
195 195
196 - @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 =?1 and s.scheduleDateStr = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate ORDER BY clZbh,fcsj") 196 + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,s.lpName as lpName,min(s.fcsj) as fcsj,min(s.realExecDate) as realExecDate ) from ScheduleRealInfo s where s.xlBm =?1 and s.scheduleDateStr = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate,lpName ORDER BY clZbh,realExecDate,fcsj")
197 List<Map<String,Object>> yesterdayDataList_eq(String line,String date,String gsbm,String fgsbm,String nbbm); 197 List<Map<String,Object>> yesterdayDataList_eq(String line,String date,String gsbm,String fgsbm,String nbbm);
198 198
199 @Query(value="select s from ScheduleRealInfo s where s.scheduleDateStr = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") 199 @Query(value="select s from ScheduleRealInfo s where s.scheduleDateStr = ?1 ORDER BY xlBm,lpName,clZbh,xlDir")
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -739,15 +739,29 @@ public class FormsServiceImpl implements FormsService { @@ -739,15 +739,29 @@ public class FormsServiceImpl implements FormsService {
739 ScheduleRealInfo s=listReal.get(j); 739 ScheduleRealInfo s=listReal.get(j);
740 if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) 740 if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)
741 &&s.getXlBm().equals(line)){ 741 &&s.getXlBm().equals(line)){
742 - newList.add(s);  
743 - Set<ChildTaskPlan> cts = s.getcTasks();  
744 - if(cts != null && cts.size() > 0){  
745 - newList_.add(s);  
746 - }else{  
747 - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ 742 + if(y.getLp()==null){
  743 + newList.add(s);
  744 + Set<ChildTaskPlan> cts = s.getcTasks();
  745 + if(cts != null && cts.size() > 0){
748 newList_.add(s); 746 newList_.add(s);
  747 + }else{
  748 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  749 + newList_.add(s);
  750 + }
749 } 751 }
750 - } 752 + }else{
  753 + if(y.getLp().equals(s.getLpName())){
  754 + newList.add(s);
  755 + Set<ChildTaskPlan> cts = s.getcTasks();
  756 + if(cts != null && cts.size() > 0){
  757 + newList_.add(s);
  758 + }else{
  759 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  760 + newList_.add(s);
  761 + }
  762 + }
  763 + }
  764 + }
751 } 765 }
752 } 766 }
753 double jhgl=culateMileageService.culateJhgl(newList); 767 double jhgl=culateMileageService.culateJhgl(newList);
@@ -793,8 +807,9 @@ public class FormsServiceImpl implements FormsService { @@ -793,8 +807,9 @@ public class FormsServiceImpl implements FormsService {
793 ScheduleRealInfo s=listReal.get(j); 807 ScheduleRealInfo s=listReal.get(j);
794 if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) 808 if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)
795 &&s.getXlBm().equals(line)){ 809 &&s.getXlBm().equals(line)){
796 - newList.add(s);  
797 - Set<ChildTaskPlan> cts = s.getcTasks(); 810 + if(y.getLp()==null){
  811 + newList.add(s);
  812 + Set<ChildTaskPlan> cts = s.getcTasks();
798 if(cts != null && cts.size() > 0){ 813 if(cts != null && cts.size() > 0){
799 newList_.add(s); 814 newList_.add(s);
800 }else{ 815 }else{
@@ -802,6 +817,19 @@ public class FormsServiceImpl implements FormsService { @@ -802,6 +817,19 @@ public class FormsServiceImpl implements FormsService {
802 newList_.add(s); 817 newList_.add(s);
803 } 818 }
804 } 819 }
  820 + }else{
  821 + if(y.getLp().equals(s.getLpName())){
  822 + newList.add(s);
  823 + Set<ChildTaskPlan> cts = s.getcTasks();
  824 + if(cts != null && cts.size() > 0){
  825 + newList_.add(s);
  826 + }else{
  827 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  828 + newList_.add(s);
  829 + }
  830 + }
  831 + }
  832 + }
805 } 833 }
806 } 834 }
807 double jhgl=culateMileageService.culateJhgl(newList); 835 double jhgl=culateMileageService.culateJhgl(newList);
@@ -1604,7 +1632,7 @@ public class FormsServiceImpl implements FormsService { @@ -1604,7 +1632,7 @@ public class FormsServiceImpl implements FormsService {
1604 @Override 1632 @Override
1605 public int compare(Singledata o1, Singledata o2) { 1633 public int compare(Singledata o1, Singledata o2) {
1606 // TODO Auto-generated method stub 1634 // TODO Auto-generated method stub
1607 - return o2.getxL().compareTo(o1.getxL()); 1635 + return (o2.getxL()+o2.getClzbh()).compareTo((o1.getxL()+o1.getClzbh()));
1608 } 1636 }
1609 } 1637 }
1610 } 1638 }
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -184,6 +184,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -184,6 +184,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
184 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); 184 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
185 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); 185 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
186 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); 186 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
  187 + t.setLp(map.get("lpName")==null?"":map.get("lpName").toString());
187 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); 188 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
188 t.setRq(sdf.parse(rq)); 189 t.setRq(sdf.parse(rq));
189 t.setCreatetime(dNow); 190 t.setCreatetime(dNow);
@@ -262,13 +263,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -262,13 +263,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
262 // TODO Auto-generated method stub 263 // TODO Auto-generated method stub
263 // 当天YLB信息 264 // 当天YLB信息
264 List<Ylb> ylList = this.listOrderBy(rq,gsbm,fgsbm,line,nbbm,"nbbm"); 265 List<Ylb> ylList = this.listOrderBy(rq,gsbm,fgsbm,line,nbbm,"nbbm");
265 -// repository.obtainYl(rq,gsbm,fgsbm,line,nbbm,"nbbm"); 266 +
266 // 当天YLXXB信息 267 // 当天YLXXB信息
267 List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm); 268 List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm);
  269 +
268 // 前一天所有车辆最后进场班次信息 270 // 前一天所有车辆最后进场班次信息
269 // List<Ylb> ylListBe = repository.obtainYlbefore(rq, gsbm, fgsbm, line, nbbm); 271 // List<Ylb> ylListBe = repository.obtainYlbefore(rq, gsbm, fgsbm, line, nbbm);
270 List<Ylb> ylListBe =repository.listMaxRqJcsx(rq, gsbm, fgsbm, line, nbbm); 272 List<Ylb> ylListBe =repository.listMaxRqJcsx(rq, gsbm, fgsbm, line, nbbm);
  273 +
271 List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm); 274 List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm);
  275 +
272 // 从排班表中计算出行驶的总里程 276 // 从排班表中计算出行驶的总里程
273 List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); 277 List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>();
274 List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm); 278 List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm);
@@ -307,11 +311,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -307,11 +311,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
307 } 311 }
308 } 312 }
309 } 313 }
310 - 314 +
311 List<Ylb> addList = new ArrayList<Ylb>(); 315 List<Ylb> addList = new ArrayList<Ylb>();
312 List<Ylb> updateList = new ArrayList<Ylb>(); 316 List<Ylb> updateList = new ArrayList<Ylb>();
313 - String ins="";  
314 Map<String, Object> ylMap=new HashMap<String, Object>(); 317 Map<String, Object> ylMap=new HashMap<String, Object>();
  318 +
  319 + Map<String, Object> cMap=new HashMap<String, Object>();
315 for (int x = 0; x < listpb.size(); x++) { 320 for (int x = 0; x < listpb.size(); x++) {
316 String type = "add"; 321 String type = "add";
317 boolean sfdc = true; 322 boolean sfdc = true;
@@ -328,12 +333,25 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -328,12 +333,25 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
328 Ylb t1 = ylList.get(k); 333 Ylb t1 = ylList.get(k);
329 if (t1.getNbbm().equals(map.get("clZbh").toString()) 334 if (t1.getNbbm().equals(map.get("clZbh").toString())
330 && t1.getJsy().equals(map.get("jGh").toString()) 335 && t1.getJsy().equals(map.get("jGh").toString())
331 - && t1.getXlbm().equals(map.get("xlBm").toString())) {  
332 - t = t1;  
333 - type = "update"; 336 + && t1.getXlbm().equals(map.get("xlBm").toString()
  337 + )) {
  338 + if(t1.getLp()==null){
  339 + //同人同车同线路不同路牌的过滤 (考虑到历史数据)
  340 + if (cMap.get(map.get("clZbh").toString()+map.get("jGh").toString()+map.get("xlBm").toString())==null) {
  341 + t = t1;
  342 + type = "update";
  343 + cMap.put(map.get("clZbh").toString()+map.get("jGh").toString()+map.get("xlBm").toString(),
  344 + map.get("clZbh").toString());
  345 + }
  346 + }else{
  347 + if(t1.getLp().equals(map.get("lpName").toString())){
  348 + t = t1;
  349 + type = "update";
  350 + }
  351 +
  352 + }
334 } 353 }
335 } 354 }
336 -  
337 // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 355 // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
338 if (map.get("seqNumber").toString().equals("1")) { 356 if (map.get("seqNumber").toString().equals("1")) {
339 boolean fage = true; 357 boolean fage = true;
@@ -428,7 +446,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -428,7 +446,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
428 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); 446 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString());
429 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); 447 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
430 t.setRq(sdf.parse(rq)); 448 t.setRq(sdf.parse(rq));
431 - 449 + t.setLp(map.get("lpName")==null?"":map.get("lpName").toString());
432 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ 450 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){
433 if(type.equals("add")){ 451 if(type.equals("add")){
434 t.setCreatetime(date); 452 t.setCreatetime(date);
@@ -436,7 +454,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -436,7 +454,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
436 }else{ 454 }else{
437 t.setUpdatetime(date); 455 t.setUpdatetime(date);
438 updateList.add(t); 456 updateList.add(t);
439 - ins += t.getId().toString()+",";  
440 } 457 }
441 } 458 }
442 // repository.save(t); 459 // repository.save(t);
@@ -456,7 +473,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -456,7 +473,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
456 } 473 }
457 474
458 } 475 }
459 -  
460 if(updateList.size()>0){ 476 if(updateList.size()>0){
461 for (int i = 0; i < updateList.size(); i++) { 477 for (int i = 0; i < updateList.size(); i++) {
462 repository.save(updateList.get(i)); 478 repository.save(updateList.get(i));
@@ -1437,23 +1453,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1437,23 +1453,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1437 t.setYh(yh); 1453 t.setYh(yh);
1438 t.setJzyl(ylxs); 1454 t.setJzyl(ylxs);
1439 nextJzyl=ylxs; 1455 nextJzyl=ylxs;
1440 -  
1441 -  
1442 }else{ 1456 }else{
1443 t.setYh(yh); 1457 t.setYh(yh);
1444 t.setJzyl(nextJzyl); 1458 t.setJzyl(nextJzyl);
1445 } 1459 }
1446 } 1460 }
1447 repository.save(t); 1461 repository.save(t);
1448 - for (int z = 0; z < cylList.size(); z++) {  
1449 - Cyl cyl = cylList.get(z);  
1450 - if (t.getNbbm().equals(cyl.getNbbm())) {  
1451 - cyl.setCyl(t.getJzyl());  
1452 - cyl.setUpdatetime(t.getRq());  
1453 - break;  
1454 - }  
1455 - cylRepository.save(cyl);  
1456 - }  
1457 } 1462 }
1458 newMap.put("status", ResponseCode.SUCCESS); 1463 newMap.put("status", ResponseCode.SUCCESS);
1459 } 1464 }
@@ -1547,7 +1552,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1547,7 +1552,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1547 String px) { 1552 String px) {
1548 // TODO Auto-generated method stub 1553 // TODO Auto-generated method stub
1549 String sql="SELECT * FROM bsth_c_ylb " 1554 String sql="SELECT * FROM bsth_c_ylb "
1550 - + " where to_days('"+rq+"')=to_days(rq) and ssgsdm like '%"+gsdm+"%' " 1555 + + " where rq ='"+rq+"' and ssgsdm like '%"+gsdm+"%' "
1551 + " and fgsdm like '%"+fgsdm+"%'"; 1556 + " and fgsdm like '%"+fgsdm+"%'";
1552 if(xlbm.equals("")){ 1557 if(xlbm.equals("")){
1553 sql+= " and xlbm like '%"+xlbm+"%' "; 1558 sql+= " and xlbm like '%"+xlbm+"%' ";
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -2949,21 +2949,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2949,21 +2949,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2949 }else{ 2949 }else{
2950 yesterdayDataList=scheduleRealInfoRepository.yesterdayDataList_eq(line, date,gsbm,fgsbm,nbbm); 2950 yesterdayDataList=scheduleRealInfoRepository.yesterdayDataList_eq(line, date,gsbm,fgsbm,nbbm);
2951 } 2951 }
2952 - System.out.println("time2:"+new Date());  
2953 -  
2954 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm); 2952 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm);
2955 for (int x = 0; x < yesterdayDataList.size(); x++) { 2953 for (int x = 0; x < yesterdayDataList.size(); x++) {
2956 String jName = yesterdayDataList.get(x).get("jGh").toString(); 2954 String jName = yesterdayDataList.get(x).get("jGh").toString();
2957 String clZbh = yesterdayDataList.get(x).get("clZbh").toString(); 2955 String clZbh = yesterdayDataList.get(x).get("clZbh").toString();
2958 String xlbm = yesterdayDataList.get(x).get("xlBm").toString(); 2956 String xlbm = yesterdayDataList.get(x).get("xlBm").toString();
  2957 + String lp =yesterdayDataList.get(x).get("lpName").toString();
2959 Map<String, Object> map = new HashMap<String, Object>(); 2958 Map<String, Object> map = new HashMap<String, Object>();
2960 boolean fage = true; 2959 boolean fage = true;
2961 String company=""; 2960 String company="";
2962 String bCompany=""; 2961 String bCompany="";
2963 List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>(); 2962 List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>();
2964 for (ScheduleRealInfo scheduleRealInfo : lists) { 2963 for (ScheduleRealInfo scheduleRealInfo : lists) {
2965 - if(scheduleRealInfo.getjGh().equals(jName) && scheduleRealInfo.getClZbh().equals(clZbh)  
2966 - && scheduleRealInfo.getXlBm().equals(xlbm)){ 2964 + if(scheduleRealInfo.getjGh().equals(jName)
  2965 + && scheduleRealInfo.getClZbh().equals(clZbh)
  2966 + && scheduleRealInfo.getXlBm().equals(xlbm)
  2967 + && scheduleRealInfo.getLpName().equals(lp)){
2967 if (fage) { 2968 if (fage) {
2968 //根据线路代码获取公司 2969 //根据线路代码获取公司
2969 company=scheduleRealInfo.getGsBm(); 2970 company=scheduleRealInfo.getGsBm();
@@ -2980,7 +2981,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2980,7 +2981,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2980 } 2981 }
2981 } 2982 }
2982 } 2983 }
2983 -  
2984 yesterdayDataList.get(x).put("company", company); 2984 yesterdayDataList.get(x).put("company", company);
2985 yesterdayDataList.get(x).put("bCompany", bCompany); 2985 yesterdayDataList.get(x).put("bCompany", bCompany);
2986 Double ljgl=culateMieageService.culateLjgl(listS); 2986 Double ljgl=culateMieageService.culateLjgl(listS);
@@ -3005,6 +3005,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3005,6 +3005,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3005 } 3005 }
3006 } 3006 }
3007 } 3007 }
  3008 +
3008 return yesterdayDataList; 3009 return yesterdayDataList;
3009 } 3010 }
3010 3011
@@ -3550,7 +3551,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3550,7 +3551,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3550 map.put("fast", ""); 3551 map.put("fast", "");
3551 map.put("slow", ""); 3552 map.put("slow", "");
3552 } 3553 }
3553 - System.out.println(map);  
3554 listMap.add(map); 3554 listMap.add(map);
3555 } catch (Exception e) { 3555 } catch (Exception e) {
3556 e.printStackTrace(); 3556 e.printStackTrace();
@@ -3741,26 +3741,46 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3741,26 +3741,46 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3741 type=0; 3741 type=0;
3742 for (int i = 0; i < listYlb.size(); i++) { 3742 for (int i = 0; i < listYlb.size(); i++) {
3743 Ylb y = listYlb.get(i); 3743 Ylb y = listYlb.get(i);
3744 - ccyl=Arith.add(ccyl, y.getCzyl());  
3745 - jcyl=Arith.add(jcyl, y.getJzyl());  
3746 - yh =Arith.add(yh ,y.getYh());  
3747 - jzl =Arith.add(jzl, y.getJzl());  
3748 - zlc =Arith.add(zlc, y.getZlc()); 3744 + if(y.getLp()==null){
  3745 + ccyl=Arith.add(ccyl, y.getCzyl());
  3746 + jcyl=Arith.add(jcyl, y.getJzyl());
  3747 + yh =Arith.add(yh ,y.getYh());
  3748 + jzl =Arith.add(jzl, y.getJzl());
  3749 + zlc =Arith.add(zlc, y.getZlc());
  3750 + }else{
  3751 + if(y.getLp().equals(s.getLpName())){
  3752 + ccyl=Arith.add(ccyl, y.getCzyl());
  3753 + jcyl=Arith.add(jcyl, y.getJzyl());
  3754 + yh =Arith.add(yh ,y.getYh());
  3755 + jzl =Arith.add(jzl, y.getJzl());
  3756 + zlc =Arith.add(zlc, y.getZlc());
  3757 + }
  3758 + }
  3759 +
3749 } 3760 }
3750 }else{ 3761 }else{
3751 type=1; 3762 type=1;
3752 for (int i = 0; i < listDlb.size(); i++) { 3763 for (int i = 0; i < listDlb.size(); i++) {
3753 Dlb d=listDlb.get(i); 3764 Dlb d=listDlb.get(i);
3754 - ccyl=Arith.add(ccyl, d.getCzcd());  
3755 - jcyl=Arith.add(jcyl, d.getJzcd());  
3756 - yh =Arith.add(yh ,d.getHd());  
3757 - jzl =Arith.add(jzl, d.getCdl());  
3758 - zlc =Arith.add(zlc, d.getZlc()); 3765 + if(d.getLp()==null){
  3766 + ccyl=Arith.add(ccyl, d.getCzcd());
  3767 + jcyl=Arith.add(jcyl, d.getJzcd());
  3768 + yh =Arith.add(yh ,d.getHd());
  3769 + jzl =Arith.add(jzl, d.getCdl());
  3770 + zlc =Arith.add(zlc, d.getZlc());
  3771 + }else{
  3772 + if(d.getLp().equals(s.getLpName())){
  3773 + ccyl=Arith.add(ccyl, d.getCzcd());
  3774 + jcyl=Arith.add(jcyl, d.getJzcd());
  3775 + yh =Arith.add(yh ,d.getHd());
  3776 + jzl =Arith.add(jzl, d.getCdl());
  3777 + zlc =Arith.add(zlc, d.getZlc());
  3778 + }
  3779 + }
  3780 +
3759 } 3781 }
3760 } 3782 }
3761 3783
3762 -  
3763 -  
3764 map.put("jzl", jzl); 3784 map.put("jzl", jzl);
3765 map.put("yh", yh); 3785 map.put("yh", yh);
3766 map.put("ccyl", ccyl); 3786 map.put("ccyl", ccyl);