Commit 3076d693057f13350cb43feab6d28d75f685a87d

Authored by 廖磊
1 parent b2ed1902

调度历史消息

src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -46,12 +46,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI @@ -46,12 +46,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI
46 + " s.xlBm = ?1 and s.scheduleDateStr = ?2 group by clZbh,jGh,jName") 46 + " s.xlBm = ?1 and s.scheduleDateStr = ?2 group by clZbh,jGh,jName")
47 List<Map<String, Object>> dailyInfo(String line,String date); 47 List<Map<String, Object>> dailyInfo(String line,String date);
48 48
49 - @Query(value="select t.inside_code,d.sender,d.txt_content,d.timestamp,0 as xlbm from ("  
50 - + " select equipment_code,inside_code from bsth_c_cars where id in("  
51 - + " select cl from bsth_c_s_ccinfo where xl in ( "  
52 - + " select id from bsth_c_line where line_code=?1 ))) t"  
53 - + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id "  
54 - + " where d.timestamp >=?2 and d.timestamp <=?3 and t.inside_code like %?4% ",nativeQuery=true) 49 + @Query(value="select d.device_id,d.sender,d.txt_content,d.timestamp,d.line_code from "
  50 + + " bsth_v_directive_60 d where d.line_code=?1 and d.timestamp >=?2 and "
  51 + + "d.timestamp <=?3 and d.device_id like %?4% ",nativeQuery=true)
55 List<Object[]> historyMessage(String line,long d,long t,String code); 52 List<Object[]> historyMessage(String line,long d,long t,String code);
56 53
57 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs " 54 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs "
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -1098,10 +1098,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1098,10 +1098,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1098 } 1098 }
1099 1099
1100 } 1100 }
1101 -  
1102 - List<Object[]> list = scheduleRealInfoRepository.historyMessage(line, d, t, code); 1101 + String device="";
  1102 + if(!code.equals("")){
  1103 + device=BasicData.deviceId2NbbmMap.inverse().get(code);
  1104 + }
  1105 + List<Object[]> list = scheduleRealInfoRepository.historyMessage(line, d, t, device);
1103 for (Object[] obj : list) { 1106 for (Object[] obj : list) {
1104 if (obj != null) { 1107 if (obj != null) {
  1108 + obj[0] =BasicData.deviceId2NbbmMap.get(obj[0].toString());
1105 obj[3] = sdf.format(new Date(Long.parseLong(obj[3].toString()))); 1109 obj[3] = sdf.format(new Date(Long.parseLong(obj[3].toString())));
1106 obj[4] = BasicData.lineCode2NameMap.get(line); 1110 obj[4] = BasicData.lineCode2NameMap.get(line);
1107 } 1111 }
@@ -2493,8 +2497,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2493,8 +2497,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2493 map.put("ssgl", ssgl); 2497 map.put("ssgl", ssgl);
2494 2498
2495 //计划+临加-少驶=实驶 2499 //计划+临加-少驶=实驶
2496 - double jl=Arith.add(jhyygl, ljgl);  
2497 - if(Arith.sub(jl, ssgl)==sjyygl){ 2500 + double jl=Arith.sub(Arith.add(jhyygl, ljgl),ssgl);
  2501 + if(jl==zyygl){
2498 map.put("zt", 0); 2502 map.put("zt", 0);
2499 }else{ 2503 }else{
2500 map.put("zt", 1); 2504 map.put("zt", 1);
@@ -2610,8 +2614,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2610,8 +2614,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2610 double ssgl= culateService.culateLbgl(list); 2614 double ssgl= culateService.culateLbgl(list);
2611 map.put("ssgl", ssgl); 2615 map.put("ssgl", ssgl);
2612 //计划+临加-少驶=实驶 2616 //计划+临加-少驶=实驶
2613 - double jl=Arith.add(jhyygl, ljgl);  
2614 - if(Arith.sub(jl, ssgl)==sjyygl){ 2617 + double jl=Arith.sub(Arith.add(jhyygl, ljgl),ssgl);
  2618 + if(jl==zyygl){
2615 map.put("zt", 0); 2619 map.put("zt", 0);
2616 }else{ 2620 }else{
2617 map.put("zt", 1); 2621 map.put("zt", 1);
src/main/resources/static/pages/oil/list_ph.html
@@ -674,7 +674,6 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep @@ -674,7 +674,6 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
674 674
675 var l = layer.load(2); 675 var l = layer.load(2);
676 $get('/ylb/ylbList', params, function (data) { 676 $get('/ylb/ylbList', params, function (data) {
677 - console.log(data);  
678 for(var i=1;i<data.length;i++){ 677 for(var i=1;i<data.length;i++){
679 moveArray[i]=new Array(); 678 moveArray[i]=new Array();
680 for(var j=1;j<6;j++){ 679 for(var j=1;j<6;j++){