Commit 3296963aed11b2144960ee3c717225e1cb53b926
1 parent
209cf915
解决跨线路一次多单获取时重复加注量
Showing
6 changed files
with
136 additions
and
59 deletions
src/main/java/com/bsth/entity/oil/Dlb.java
| ... | ... | @@ -58,6 +58,8 @@ public class Dlb { |
| 58 | 58 | private int nylx; |
| 59 | 59 | //进场顺序(根据最先出场和最后进场来关联车辆的存电量) |
| 60 | 60 | private int jcsx; |
| 61 | + | |
| 62 | + private String jname; | |
| 61 | 63 | @Transient |
| 62 | 64 | private String name; |
| 63 | 65 | @Transient |
| ... | ... | @@ -73,6 +75,7 @@ public class Dlb { |
| 73 | 75 | private String fgsname; |
| 74 | 76 | |
| 75 | 77 | |
| 78 | + | |
| 76 | 79 | private String lp; |
| 77 | 80 | |
| 78 | 81 | public Integer getId() { |
| ... | ... | @@ -391,6 +394,14 @@ public class Dlb { |
| 391 | 394 | public void setLp(String lp) { |
| 392 | 395 | this.lp = lp; |
| 393 | 396 | } |
| 397 | + | |
| 398 | + public String getJname() { | |
| 399 | + return jname; | |
| 400 | + } | |
| 401 | + | |
| 402 | + public void setJname(String jname) { | |
| 403 | + this.jname = jname; | |
| 404 | + } | |
| 394 | 405 | |
| 395 | 406 | |
| 396 | 407 | ... | ... |
src/main/java/com/bsth/entity/oil/Ylb.java
| ... | ... | @@ -26,6 +26,7 @@ public class Ylb { |
| 26 | 26 | private String fgsdm; |
| 27 | 27 | private String nbbm; |
| 28 | 28 | private String jsy; |
| 29 | + private String jname; | |
| 29 | 30 | private Double czlc=0.0; |
| 30 | 31 | private Double jzlc=0.0; |
| 31 | 32 | private Double czyl=0.0; |
| ... | ... | @@ -339,6 +340,14 @@ public class Ylb { |
| 339 | 340 | public void setLp(String lp) { |
| 340 | 341 | this.lp = lp; |
| 341 | 342 | } |
| 343 | + | |
| 344 | + public String getJname() { | |
| 345 | + return jname; | |
| 346 | + } | |
| 347 | + | |
| 348 | + public void setJname(String jname) { | |
| 349 | + this.jname = jname; | |
| 350 | + } | |
| 342 | 351 | |
| 343 | 352 | |
| 344 | 353 | } | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -193,10 +193,10 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 193 | 193 | List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2); |
| 194 | 194 | |
| 195 | 195 | |
| 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 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") | |
| 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,s.jName as jName ) 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,jName ORDER BY clZbh,realExecDate,fcsj") | |
| 197 | 197 | List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String nbbm); |
| 198 | 198 | |
| 199 | - @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") | |
| 199 | + @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,s.jName as jName ) 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,jName ORDER BY clZbh,realExecDate,fcsj") | |
| 200 | 200 | List<Map<String,Object>> yesterdayDataList_eq(String line,String date,String gsbm,String fgsbm,String nbbm); |
| 201 | 201 | |
| 202 | 202 | @Query(value="select s from ScheduleRealInfo s where s.scheduleDateStr = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") | ... | ... |
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| ... | ... | @@ -203,6 +203,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 203 | 203 | t.setLp(map.get("lpName").toString()); |
| 204 | 204 | t.setRq(sdf.parse(rq)); |
| 205 | 205 | t.setCreatetime(new Date()); |
| 206 | + t.setJname(map.get("jName").toString()); | |
| 206 | 207 | /*if(type.equals("add")){ |
| 207 | 208 | addList.add(t); |
| 208 | 209 | }else{ |
| ... | ... | @@ -257,13 +258,13 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 257 | 258 | // 保留两位小数 |
| 258 | 259 | DecimalFormat df = new DecimalFormat("#.00"); |
| 259 | 260 | // TODO Auto-generated method stub |
| 260 | - // 当天YLB信息 | |
| 261 | - List<Dlb> dlList = this.listOrderBy(rq,gsbm,fgsbm,line,nbbm,"nbbm"); | |
| 261 | + // 当天DLB信息 | |
| 262 | + List<Dlb> dlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); | |
| 262 | 263 | // 当天YLXXB信息 |
| 263 | 264 | List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm); |
| 264 | 265 | // 从排班表中计算出行驶的总里程 |
| 265 | 266 | List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); |
| 266 | - List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm); | |
| 267 | + List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList("", rq, gsbm, fgsbm, "", nbbm); | |
| 267 | 268 | Map<String, Double> lcMap=new HashMap<String,Double>(); |
| 268 | 269 | for (int i = 0; i < listpbs.size(); i++) { |
| 269 | 270 | String cl=listpbs.get(i).get("clZbh").toString(); |
| ... | ... | @@ -295,7 +296,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 295 | 296 | if(sxtj.equals("0")){ |
| 296 | 297 | listpb=listpbs; |
| 297 | 298 | }else{ |
| 298 | - List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, line,nbbm); | |
| 299 | + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, "",nbbm); | |
| 299 | 300 | List<String> stringList=new ArrayList<String>(); |
| 300 | 301 | for (int i = 0; i < objectLists.size(); i++) { |
| 301 | 302 | String clbm=objectLists.get(i)[0].toString(); |
| ... | ... | @@ -468,6 +469,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 468 | 469 | t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); |
| 469 | 470 | t.setRq(sdf.parse(rq)); |
| 470 | 471 | t.setLp(map.get("lpName").toString()); |
| 472 | + t.setJname(map.get("jName").toString()); | |
| 471 | 473 | if (!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))) { |
| 472 | 474 | if (t.getHd() < 0) { |
| 473 | 475 | t.setHd(0.0); |
| ... | ... | @@ -1023,7 +1025,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 1023 | 1025 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
| 1024 | 1026 | // 保留两位小数 |
| 1025 | 1027 | DecimalFormat df = new DecimalFormat("#.00"); |
| 1026 | - List<Dlb> dlbList=this.listOrderBy(date,gsdm,fgsdm,line,"","nbbm"); | |
| 1028 | + List<Dlb> dlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); | |
| 1027 | 1029 | List<Dlb> dlbList_upd=new ArrayList<Dlb>(); |
| 1028 | 1030 | List<Dlb> dlbList_del=new ArrayList<Dlb>(); |
| 1029 | 1031 | try{ |
| ... | ... | @@ -1047,7 +1049,9 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 1047 | 1049 | } |
| 1048 | 1050 | |
| 1049 | 1051 | if(fage){ |
| 1050 | - dlbList_del.add(t); | |
| 1052 | + if(t.getXlbm().equals(line)){ | |
| 1053 | + dlbList_del.add(t); | |
| 1054 | + } | |
| 1051 | 1055 | } |
| 1052 | 1056 | } |
| 1053 | 1057 | mapList.put("delList", dlbList_del); |
| ... | ... | @@ -1140,12 +1144,12 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 1140 | 1144 | } |
| 1141 | 1145 | nextJzyl =Arith.sub(zjzl,dh); |
| 1142 | 1146 | if(zlc>0){ |
| 1143 | - long l=Math.round(nextJzyl); | |
| 1144 | - double ylxs=l*100/100; | |
| 1147 | +// long l=Math.round(nextJzyl); | |
| 1148 | + double ylxs=nextJzyl; | |
| 1145 | 1149 | dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); |
| 1146 | 1150 | if(dh<0){ |
| 1147 | - t.setHd(dh); | |
| 1148 | - t.setCdl(dh); | |
| 1151 | + t.setHd(0.0); | |
| 1152 | + t.setCdl(0.0); | |
| 1149 | 1153 | nextJzyl=Arith.add(ylxs, dh); |
| 1150 | 1154 | }else{ |
| 1151 | 1155 | t.setHd(dh); |
| ... | ... | @@ -1163,21 +1167,21 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 1163 | 1167 | } |
| 1164 | 1168 | nextJzyl =Arith.sub( nextJzyl,dh); |
| 1165 | 1169 | if(zlc>0){ |
| 1166 | - long l=0l; | |
| 1170 | +// long l=0l; | |
| 1167 | 1171 | double ylxs=0.0; |
| 1168 | 1172 | if(i==listpbDc.size()-1){ |
| 1169 | 1173 | // ylxs=czyl; |
| 1170 | 1174 | }else{ |
| 1171 | 1175 | if(listpbDc.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){ |
| 1172 | - l=Math.round(nextJzyl); | |
| 1173 | - ylxs=l*100/100; | |
| 1176 | +// l=Math.round(nextJzyl); | |
| 1177 | + ylxs=nextJzyl; | |
| 1174 | 1178 | } |
| 1175 | 1179 | |
| 1176 | 1180 | } |
| 1177 | 1181 | dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); |
| 1178 | 1182 | if(dh<0){ |
| 1179 | - t.setHd(dh); | |
| 1180 | - t.setCdl(dh); | |
| 1183 | + t.setHd(0.0); | |
| 1184 | + t.setCdl(0.0); | |
| 1181 | 1185 | nextJzyl=Arith.add(ylxs, dh); |
| 1182 | 1186 | }else{ |
| 1183 | 1187 | t.setHd(dh); |
| ... | ... | @@ -1211,7 +1215,6 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 1211 | 1215 | } |
| 1212 | 1216 | } |
| 1213 | 1217 | |
| 1214 | - | |
| 1215 | 1218 | if(t.getHd()<0){ |
| 1216 | 1219 | t.setHd(0.0); |
| 1217 | 1220 | } | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -198,6 +198,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 198 | 198 | t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); |
| 199 | 199 | t.setLp(map.get("lpName")==null?"":map.get("lpName").toString()); |
| 200 | 200 | t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); |
| 201 | + t.setJname(map.get("jName").toString()); | |
| 201 | 202 | t.setRq(sdf.parse(rq)); |
| 202 | 203 | t.setCreatetime(dNow); |
| 203 | 204 | if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ |
| ... | ... | @@ -272,24 +273,24 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 272 | 273 | DecimalFormat df = new DecimalFormat("#.00"); |
| 273 | 274 | // TODO Auto-generated method stub |
| 274 | 275 | // 当天YLB信息 |
| 275 | - List<Ylb> ylList = this.listOrderBy(rq,gsbm,fgsbm,line,nbbm,"nbbm"); | |
| 276 | + List<Ylb> ylList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); | |
| 276 | 277 | |
| 277 | 278 | // 当天YLXXB信息 |
| 278 | 279 | List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm); |
| 279 | 280 | |
| 280 | 281 | // 前一天所有车辆最后进场班次信息 |
| 281 | - List<Ylb> ylListBe = this.listByRqJcsx(rq, gsbm, fgsbm, line, nbbm); | |
| 282 | + List<Ylb> ylListBe = this.listByRqJcsx(rq, gsbm, fgsbm, "", nbbm); | |
| 282 | 283 | List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm); |
| 283 | 284 | |
| 284 | 285 | // 从排班表中计算出行驶的总里程 |
| 285 | 286 | List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); |
| 286 | - List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm); | |
| 287 | + List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList("", rq, gsbm, fgsbm, "", nbbm); | |
| 287 | 288 | |
| 288 | 289 | String sxtj=map2.get("sxtj").toString(); |
| 289 | 290 | if(sxtj.equals("0")){ |
| 290 | 291 | listpb=listpbs; |
| 291 | 292 | }else{ |
| 292 | - List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, line,nbbm); | |
| 293 | + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, "",nbbm); | |
| 293 | 294 | List<String> stringList=new ArrayList<String>(); |
| 294 | 295 | for (int i = 0; i < objectLists.size(); i++) { |
| 295 | 296 | String clbm=objectLists.get(i)[0].toString(); |
| ... | ... | @@ -363,49 +364,90 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 363 | 364 | // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 |
| 364 | 365 | if (map.get("seqNumber").toString().equals("1")) { |
| 365 | 366 | boolean fage = true; |
| 366 | - for (int i = 0; i < ylListBe.size(); i++) { | |
| 367 | - Ylb ylb = ylListBe.get(i); | |
| 368 | - if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | |
| 369 | - if(ylb.getJzyl()>0){ | |
| 370 | - t.setCzyl(ylb.getJzyl()); | |
| 371 | - fage = false; | |
| 372 | - break; | |
| 367 | + if(line.equals("")){ | |
| 368 | + for (int i = 0; i < ylListBe.size(); i++) { | |
| 369 | + Ylb ylb = ylListBe.get(i); | |
| 370 | + if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | |
| 371 | + if(ylb.getJzyl()>0){ | |
| 372 | + t.setCzyl(ylb.getJzyl()); | |
| 373 | + fage = false; | |
| 374 | + break; | |
| 375 | + } | |
| 376 | + | |
| 373 | 377 | } |
| 374 | - | |
| 375 | 378 | } |
| 376 | - } | |
| 377 | - if (fage) { | |
| 378 | - for (int y = 0; y < clyList.size(); y++) { | |
| 379 | - Cyl cyl = clyList.get(y); | |
| 380 | - if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | |
| 381 | - if(cyl!=null){ | |
| 382 | - if(cyl.getCyl()>=0){ | |
| 383 | - t.setCzyl(cyl.getCyl()); | |
| 379 | + if (fage) { | |
| 380 | + for (int y = 0; y < clyList.size(); y++) { | |
| 381 | + Cyl cyl = clyList.get(y); | |
| 382 | + if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | |
| 383 | + if(cyl!=null){ | |
| 384 | + if(cyl.getCyl()>=0){ | |
| 385 | + t.setCzyl(cyl.getCyl()); | |
| 386 | + fage = false; | |
| 387 | + break; | |
| 388 | + }else { | |
| 389 | + if(cyl.getCxrl()!=null){ | |
| 390 | + if(cyl.getCxrl()>0){ | |
| 391 | + t.setCzyl(cyl.getCxrl()); | |
| 392 | + fage = false; | |
| 393 | + break; | |
| 394 | + } | |
| 395 | + } | |
| 396 | + } | |
| 397 | + } | |
| 398 | + } | |
| 399 | + } | |
| 400 | + } | |
| 401 | + if (fage) { | |
| 402 | + t.setCzyl(0.0); | |
| 403 | + } | |
| 404 | + }else{ | |
| 405 | + if (line.equals(map.get("xlBm").toString())) { | |
| 406 | + for (int i = 0; i < ylListBe.size(); i++) { | |
| 407 | + Ylb ylb = ylListBe.get(i); | |
| 408 | + if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | |
| 409 | + if(ylb.getJzyl()>0){ | |
| 410 | + t.setCzyl(ylb.getJzyl()); | |
| 384 | 411 | fage = false; |
| 385 | 412 | break; |
| 386 | - }else { | |
| 387 | - if(cyl.getCxrl()!=null){ | |
| 388 | - if(cyl.getCxrl()>0){ | |
| 389 | - t.setCzyl(cyl.getCxrl()); | |
| 413 | + } | |
| 414 | + | |
| 415 | + } | |
| 416 | + } | |
| 417 | + if (fage) { | |
| 418 | + for (int y = 0; y < clyList.size(); y++) { | |
| 419 | + Cyl cyl = clyList.get(y); | |
| 420 | + if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | |
| 421 | + if(cyl!=null){ | |
| 422 | + if(cyl.getCyl()>=0){ | |
| 423 | + t.setCzyl(cyl.getCyl()); | |
| 390 | 424 | fage = false; |
| 391 | 425 | break; |
| 426 | + }else { | |
| 427 | + if(cyl.getCxrl()!=null){ | |
| 428 | + if(cyl.getCxrl()>0){ | |
| 429 | + t.setCzyl(cyl.getCxrl()); | |
| 430 | + fage = false; | |
| 431 | + break; | |
| 432 | + } | |
| 433 | + } | |
| 392 | 434 | } |
| 393 | 435 | } |
| 394 | 436 | } |
| 395 | 437 | } |
| 396 | 438 | } |
| 439 | + if (fage) { | |
| 440 | + t.setCzyl(0.0); | |
| 441 | + } | |
| 397 | 442 | } |
| 398 | 443 | } |
| 399 | - if (fage) { | |
| 400 | - t.setCzyl(0.0); | |
| 401 | - } | |
| 444 | + | |
| 402 | 445 | } |
| 403 | 446 | |
| 404 | 447 | Double jzl = 0.0; |
| 405 | 448 | //一人一车加注量只匹配一次 |
| 406 | - if(ylMap.get(map.get("clZbh").toString()+"_"+ map.get("jGh").toString())!=null){ | |
| 449 | + if(ylMap.get(map.get("clZbh").toString()+"_"+ map.get("jGh").toString())==null){ | |
| 407 | 450 | |
| 408 | - }else{ | |
| 409 | 451 | boolean fage2=false; |
| 410 | 452 | for (int i = 0; i < ylxxList.size(); i++) { |
| 411 | 453 | Ylxxb ylxxb = ylxxList.get(i); |
| ... | ... | @@ -455,6 +497,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 455 | 497 | t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); |
| 456 | 498 | t.setRq(sdf.parse(rq)); |
| 457 | 499 | t.setLp(map.get("lpName")==null?"":map.get("lpName").toString()); |
| 500 | + t.setJname(map.get("jName").toString()); | |
| 458 | 501 | if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ |
| 459 | 502 | if(type.equals("add")){ |
| 460 | 503 | t.setCreatetime(date); |
| ... | ... | @@ -760,7 +803,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 760 | 803 | nbbm=map.get("nbbm_eq").toString(); |
| 761 | 804 | } |
| 762 | 805 | // List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm); |
| 763 | - List<Ylb> ylListBe=this.listByRqJcsx(rq, gsbm, fgsbm, xlbm, nbbm); | |
| 806 | + List<Ylb> ylListBe=this.listByRqJcsx(rq, gsbm, fgsbm, "", nbbm); | |
| 764 | 807 | List<Ylb> ylbList=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); |
| 765 | 808 | // repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); |
| 766 | 809 | // List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm); |
| ... | ... | @@ -815,6 +858,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 815 | 858 | t.setNbbm(y1.getNbbm()); |
| 816 | 859 | t.setRq(y1.getYyrq()); |
| 817 | 860 | t.setJsy(y1.getJsy()); |
| 861 | + t.setJname(BasicData.allPerson.get(y1.getGsdm()+"-"+y1.getJsy())); | |
| 818 | 862 | t.setJzl(y1.getJzl()); |
| 819 | 863 | t.setSsgsdm(y1.getGsdm()); |
| 820 | 864 | String fgsdm=""; |
| ... | ... | @@ -1635,9 +1679,15 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1635 | 1679 | fgsdm=l.getBrancheCompany(); |
| 1636 | 1680 | } |
| 1637 | 1681 | |
| 1682 | + String nbbmstr=""; | |
| 1638 | 1683 | List<Map<String, Object>> listpbYc=new ArrayList<Map<String, Object>>();//油车数据 |
| 1639 | 1684 | List<Map<String, Object>> listpbDc=new ArrayList<Map<String, Object>>();//电车数据 |
| 1640 | - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line, date,gsdm, fgsdm, "", ""); | |
| 1685 | + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("", date,gsdm, fgsdm, "", ""); | |
| 1686 | + for (int i = 0; i < listpb.size(); i++) { | |
| 1687 | + if(listpb.get(i).get("xlBm").toString().equals(line)){ | |
| 1688 | + nbbmstr +=listpb.get(i).get("clZbh").toString(); | |
| 1689 | + } | |
| 1690 | + } | |
| 1641 | 1691 | for (int i = 0; i < listpb.size(); i++) { |
| 1642 | 1692 | boolean sfdc=true; |
| 1643 | 1693 | Map<String, Object> m = listpb.get(i); |
| ... | ... | @@ -1646,10 +1696,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1646 | 1696 | } else { |
| 1647 | 1697 | sfdc = true; |
| 1648 | 1698 | } |
| 1649 | - if(sfdc){ | |
| 1650 | - listpbDc.add(m); | |
| 1651 | - }else{ | |
| 1652 | - listpbYc.add(m); | |
| 1699 | + if(nbbmstr.indexOf(m.get("clZbh").toString())>-1){ | |
| 1700 | + if(sfdc){ | |
| 1701 | + listpbDc.add(m); | |
| 1702 | + }else{ | |
| 1703 | + listpbYc.add(m); | |
| 1704 | + } | |
| 1653 | 1705 | } |
| 1654 | 1706 | } |
| 1655 | 1707 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| ... | ... | @@ -1657,8 +1709,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1657 | 1709 | List<Cyl> clyList = cylRepository.obtainCyl("",gsdm); |
| 1658 | 1710 | List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(date, 0,gsdm); |
| 1659 | 1711 | //重新统计油车数据开始 |
| 1660 | - List<Ylb> ylListBe =repository.listMaxRqJcsx(date, gsdm, fgsdm, line, ""); | |
| 1661 | - List<Ylb> ylbList=this.listOrderBy(date,gsdm,fgsdm,line,"","nbbm"); | |
| 1712 | + List<Ylb> ylListBe =repository.listByRqJcsx(date, gsdm, fgsdm, "", ""); | |
| 1713 | + List<Ylb> ylbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); | |
| 1662 | 1714 | List<Ylb> ylbList_upd=new ArrayList<Ylb>(); |
| 1663 | 1715 | List<Ylb> ylbList_del=new ArrayList<Ylb>(); |
| 1664 | 1716 | |
| ... | ... | @@ -1681,7 +1733,9 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1681 | 1733 | } |
| 1682 | 1734 | } |
| 1683 | 1735 | if(fage){ |
| 1684 | - ylbList_del.add(t); | |
| 1736 | + if(t.getXlbm().equals(line)){ | |
| 1737 | + ylbList_del.add(t); | |
| 1738 | + } | |
| 1685 | 1739 | } |
| 1686 | 1740 | |
| 1687 | 1741 | } |
| ... | ... | @@ -1790,6 +1844,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1790 | 1844 | t.setJzl(jzl); |
| 1791 | 1845 | t.setNbbm(maps.get("clZbh").toString()); |
| 1792 | 1846 | t.setJsy(maps.get("jGh") == null ? "" : maps.get("jGh").toString()); |
| 1847 | + t.setJname(maps.get("jName").toString()); | |
| 1793 | 1848 | t.setZlc(maps.get("totalKilometers") == null ? 0.0 |
| 1794 | 1849 | : Double.parseDouble(maps.get("totalKilometers").toString())); |
| 1795 | 1850 | t.setXlbm(maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); |
| ... | ... | @@ -1820,7 +1875,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1820 | 1875 | } |
| 1821 | 1876 | |
| 1822 | 1877 | } |
| 1823 | - | |
| 1824 | 1878 | for (int i = 0; i < ylbList_del.size(); i++) { |
| 1825 | 1879 | Ylb y=ylbList_del.get(i); |
| 1826 | 1880 | if(nbbmStr.indexOf(y.getNbbm())<0){ |
| ... | ... | @@ -1831,7 +1885,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1831 | 1885 | |
| 1832 | 1886 | //重新计算删除了的或者新增了的车的车的油耗信息(考虑车辆可能跨线路,从分公司赛选计算) |
| 1833 | 1887 | double czyl=0.0; |
| 1834 | - List<Ylb> iterator2=this.listOrderBy(date,gsdm,fgsdm,line,"","nbbm,jcsx"); | |
| 1888 | + List<Ylb> iterator2=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm,jcsx"); | |
| 1835 | 1889 | String[] nbbms=nbbmStr.split(","); |
| 1836 | 1890 | for (int i = 0; i < nbbms.length; i++) { |
| 1837 | 1891 | String clzbm=nbbms[i]; | ... | ... |
src/main/resources/static/pages/oil/history/history.html
| ... | ... | @@ -43,7 +43,7 @@ |
| 43 | 43 | <div style="display: inline-block;margin-left: 24px;"> |
| 44 | 44 | <span class="item-label" style="width: 80px;"> 时间: </span> |
| 45 | 45 | <select class="form-control" id="date" style="width: 180px;"> |
| 46 | - <option value="2017-11-07">2017-11-07</option> | |
| 46 | + <option value="2017-12-05">2017-12-05</option> | |
| 47 | 47 | </select> |
| 48 | 48 | </div> |
| 49 | 49 | <div class="form-group"> | ... | ... |