Commit 010d956e4dbe3a55ed6d0e832b983bfafd96551e

Authored by 娄高锋
2 parents fa0f958a 2ea4eec3

Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into minhang

src/main/java/com/bsth/entity/oil/Ylxxb.java
@@ -35,11 +35,11 @@ public class Ylxxb { @@ -35,11 +35,11 @@ public class Ylxxb {
35 private Date xgrq; 35 private Date xgrq;
36 private String xgr; 36 private String xgr;
37 private String fromgsdm; 37 private String fromgsdm;
38 - private int nylx; 38 + private Integer nylx;
39 @Transient 39 @Transient
40 private String ldgh; 40 private String ldgh;
41 //0为接口数据,1为手工输入 41 //0为接口数据,1为手工输入
42 - private int jylx=0; 42 + private Integer jylx=0;
43 @Transient 43 @Transient
44 private String gsname; 44 private String gsname;
45 @Transient 45 @Transient
src/main/java/com/bsth/repository/oil/YlxxbRepository.java
@@ -27,4 +27,12 @@ public interface YlxxbRepository extends BaseRepository<Ylxxb, Integer>{ @@ -27,4 +27,12 @@ public interface YlxxbRepository extends BaseRepository<Ylxxb, Integer>{
27 @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nbbm =?2 and jylx=1",nativeQuery=true) 27 @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nbbm =?2 and jylx=1",nativeQuery=true)
28 List<Ylxxb> obtainYlxx2(String rq,String nbbm); 28 List<Ylxxb> obtainYlxx2(String rq,String nbbm);
29 29
  30 + @Transactional
  31 + @Modifying
  32 + @Query(value="select * from bsth_c_ylxxb s where s.nbbm = ?1 and "
  33 + + "to_days(s.yyrq) = to_days(?2)",nativeQuery=true)
  34 + List<Ylxxb> queryListYlxxb(String clZbh,String date);
  35 +
  36 +
  37 +
30 } 38 }
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -39,12 +39,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -39,12 +39,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
39 + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName") 39 + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName")
40 List<Map<String, Object>> dailyInfo(String line,String date); 40 List<Map<String, Object>> dailyInfo(String line,String date);
41 41
42 - @Query(value="select t.car_code,d.sender,d.txt_content,d.timestamp,0 as xlbm from ("  
43 - + " select equipment_code,car_code from bsth_c_cars where id in(" 42 + @Query(value="select t.inside_code,d.sender,d.txt_content,d.timestamp,0 as xlbm from ("
  43 + + " select equipment_code,inside_code from bsth_c_cars where id in("
44 + " select cl from bsth_c_s_ccinfo where xl in ( " 44 + " select cl from bsth_c_s_ccinfo where xl in ( "
45 + " select id from bsth_c_line where line_code=?1 ))) t" 45 + " select id from bsth_c_line where line_code=?1 ))) t"
46 + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id " 46 + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id "
47 - + " where d.timestamp >=?2 and d.timestamp <=?3 and t.car_code like %?4% ",nativeQuery=true) 47 + + " where d.timestamp >=?2 and d.timestamp <=?3 and t.inside_code like %?4% ",nativeQuery=true)
48 List<Object[]> historyMessage(String line,long d,long t,String code); 48 List<Object[]> historyMessage(String line,long d,long t,String code);
49 49
50 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs " 50 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs "
@@ -74,7 +74,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -74,7 +74,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
74 @Query(value="select count(jName) from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and sflj != 0") 74 @Query(value="select count(jName) from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and sflj != 0")
75 int findLjbc(String jName,String clZbh,String lpName); 75 int findLjbc(String jName,String clZbh,String lpName);
76 76
77 - @Query(value="SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T'),c.inside_code FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c ON c.equipment_code = r.device_id where FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = ?2 and r.line_id = ?1 and c.inside_code = ?3",nativeQuery=true) 77 + @Query(value="SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T'),c.inside_code FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c ON c.equipment_code = r.device_id where FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = ?2 and r.line_id = ?1 and c.inside_code like %?3%",nativeQuery=true)
78 List<Object[]> account(String line,String date,String code); 78 List<Object[]> account(String line,String date,String code);
79 79
80 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDate >= str_to_date(?2,'%Y-%m-%d') " 80 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDate >= str_to_date(?2,'%Y-%m-%d') "
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -15,6 +15,7 @@ import com.bsth.data.schedule.ScheduleComparator; @@ -15,6 +15,7 @@ import com.bsth.data.schedule.ScheduleComparator;
15 import com.bsth.entity.Cars; 15 import com.bsth.entity.Cars;
16 import com.bsth.entity.Line; 16 import com.bsth.entity.Line;
17 import com.bsth.entity.Personnel; 17 import com.bsth.entity.Personnel;
  18 +import com.bsth.entity.oil.Ylxxb;
18 import com.bsth.entity.realcontrol.ChildTaskPlan; 19 import com.bsth.entity.realcontrol.ChildTaskPlan;
19 import com.bsth.entity.realcontrol.LineConfig; 20 import com.bsth.entity.realcontrol.LineConfig;
20 import com.bsth.entity.realcontrol.ScheduleRealInfo; 21 import com.bsth.entity.realcontrol.ScheduleRealInfo;
@@ -25,6 +26,7 @@ import com.bsth.entity.schedule.GuideboardInfo; @@ -25,6 +26,7 @@ import com.bsth.entity.schedule.GuideboardInfo;
25 import com.bsth.entity.sys.DutyEmployee; 26 import com.bsth.entity.sys.DutyEmployee;
26 import com.bsth.entity.sys.SysUser; 27 import com.bsth.entity.sys.SysUser;
27 import com.bsth.repository.LineRepository; 28 import com.bsth.repository.LineRepository;
  29 +import com.bsth.repository.oil.YlxxbRepository;
28 import com.bsth.repository.realcontrol.ChildTaskPlanRepository; 30 import com.bsth.repository.realcontrol.ChildTaskPlanRepository;
29 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 31 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
30 import com.bsth.repository.realcontrol.SvgAttributeRepository; 32 import com.bsth.repository.realcontrol.SvgAttributeRepository;
@@ -99,6 +101,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -99,6 +101,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
99 101
100 @Autowired 102 @Autowired
101 DutyEmployeeService dutyEmployeeService; 103 DutyEmployeeService dutyEmployeeService;
  104 +
  105 + @Autowired
  106 + YlxxbRepository ylxxbRepository;
102 107
103 Logger logger = LoggerFactory.getLogger(this.getClass()); 108 Logger logger = LoggerFactory.getLogger(this.getClass());
104 109
@@ -2433,6 +2438,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2433,6 +2438,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2433 try { 2438 try {
2434 scheduleRealInfo.setBcs(xyz); 2439 scheduleRealInfo.setBcs(xyz);
2435 xyz++; 2440 xyz++;
  2441 + Set<ChildTaskPlan> cs = scheduleRealInfo.getcTasks();
  2442 + Double sjlc=0.0;
  2443 + if(!cs.isEmpty()){
  2444 + Iterator<ChildTaskPlan> it = cs.iterator();
  2445 + while(it.hasNext()){
  2446 + ChildTaskPlan c = it.next();
  2447 + if(!c.isDestroy()){
  2448 + sjlc += c.getMileage()==null?0:c.getMileage();
  2449 + }
  2450 +
  2451 + }
  2452 + }else{
  2453 + if(scheduleRealInfo.getStatus() != -1){
  2454 + sjlc =scheduleRealInfo.getJhlc();
  2455 + }
  2456 + }
  2457 + scheduleRealInfo.setSjlc(format.format(sjlc));
2436 map = rru.getMapValue(scheduleRealInfo); 2458 map = rru.getMapValue(scheduleRealInfo);
2437 String zdsj = scheduleRealInfo.getZdsj(); 2459 String zdsj = scheduleRealInfo.getZdsj();
2438 String zdsjActual = scheduleRealInfo.getZdsjActual(); 2460 String zdsjActual = scheduleRealInfo.getZdsjActual();
@@ -2457,8 +2479,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2457,8 +2479,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2457 } 2479 }
2458 } 2480 }
2459 2481
  2482 +
  2483 + List<Ylxxb> listYlxxb=ylxxbRepository.queryListYlxxb( clZbh, date);
  2484 + Double jzl=0.0;
  2485 + for(int t=0;t<listYlxxb.size();t++){
  2486 + Ylxxb y=listYlxxb.get(t);
  2487 + jzl += y.getJzl();
  2488 + }
  2489 +
2460 //计算里程和班次数,并放入Map里 2490 //计算里程和班次数,并放入Map里
2461 map = new HashMap<String, Object>(); 2491 map = new HashMap<String, Object>();
  2492 + map.put("jzl", jzl);
2462 map.put("jhlc", format.format(jhlc+jcclc)); 2493 map.put("jhlc", format.format(jhlc+jcclc));
2463 map.put("yygljh", format.format(jhlc)); 2494 map.put("yygljh", format.format(jhlc));
2464 map.put("ssgl", format.format(remMileage)); 2495 map.put("ssgl", format.format(remMileage));
@@ -2632,7 +2663,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2632,7 +2663,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2632 while(it.hasNext()){ 2663 while(it.hasNext()){
2633 ChildTaskPlan c = it.next(); 2664 ChildTaskPlan c = it.next();
2634 if(c.getRemarks()!=null && c.getRemarks().length()>0){ 2665 if(c.getRemarks()!=null && c.getRemarks().length()>0){
2635 - remarks += c.getRemarks(); 2666 + if(remarks.indexOf(c.getRemarks())==-1){
  2667 + remarks += c.getRemarks();
  2668 + }
2636 } 2669 }
2637 2670
2638 if(!c.isDestroy()){ 2671 if(!c.isDestroy()){
@@ -2664,7 +2697,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2664,7 +2697,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2664 String xlbm=s.getXlBm(); 2697 String xlbm=s.getXlBm();
2665 String fcrq=s.getScheduleDateStr(); 2698 String fcrq=s.getScheduleDateStr();
2666 2699
2667 - 2700 + List<Ylxxb> listYlxxb=ylxxbRepository.queryListYlxxb( s.getClZbh(), fcrq);
  2701 + Double jzl=0.0;
  2702 + for(int t=0;t<listYlxxb.size();t++){
  2703 + Ylxxb y=listYlxxb.get(t);
  2704 + jzl += y.getJzl();
  2705 + }
  2706 + map.put("jzl", jzl);
2668 map.put("xlName", s.getXlName()); 2707 map.put("xlName", s.getXlName());
2669 map.put("clZbh", s.getClZbh()); 2708 map.put("clZbh", s.getClZbh());
2670 map.put("fcsjActual", s.getFcsjActual()); 2709 map.put("fcsjActual", s.getFcsjActual());
src/main/resources/static/pages/forms/statement/scheduleDaily.html
@@ -158,31 +158,31 @@ @@ -158,31 +158,31 @@
158 <td colspan="40">&nbsp;</td> 158 <td colspan="40">&nbsp;</td>
159 </tr> --> 159 </tr> -->
160 <tr> 160 <tr>
161 - <td colspan="2">班序</td> 161 + <td colspan="2">路牌</td>
162 <td colspan="2">车号</td> 162 <td colspan="2">车号</td>
163 <td>司早</td> 163 <td>司早</td>
164 <td>售早</td> 164 <td>售早</td>
165 <td>司晚</td> 165 <td>司晚</td>
166 <td>售晚</td> 166 <td>售晚</td>
167 - <td colspan="2">班序</td> 167 + <td colspan="2">路牌</td>
168 <td colspan="2">车号</td> 168 <td colspan="2">车号</td>
169 <td>司早</td> 169 <td>司早</td>
170 <td>售早</td> 170 <td>售早</td>
171 <td>司晚</td> 171 <td>司晚</td>
172 <td>售晚</td> 172 <td>售晚</td>
173 - <td colspan="2">班序</td> 173 + <td colspan="2">路牌</td>
174 <td colspan="2">车号</td> 174 <td colspan="2">车号</td>
175 <td>司早</td> 175 <td>司早</td>
176 <td>售早</td> 176 <td>售早</td>
177 <td>司晚</td> 177 <td>司晚</td>
178 <td>售晚</td> 178 <td>售晚</td>
179 - <td colspan="2">班序</td> 179 + <td colspan="2">路牌</td>
180 <td colspan="2">车号</td> 180 <td colspan="2">车号</td>
181 <td>司早</td> 181 <td>司早</td>
182 <td>售早</td> 182 <td>售早</td>
183 <td>司晚</td> 183 <td>司晚</td>
184 <td>售晚</td> 184 <td>售晚</td>
185 - <td colspan="2">班序</td> 185 + <td colspan="2">路牌</td>
186 <td colspan="2">车号</td> 186 <td colspan="2">车号</td>
187 <td>司早</td> 187 <td>司早</td>
188 <td>售早</td> 188 <td>售早</td>
src/main/resources/static/pages/forms/statement/waybillQp.html
@@ -252,7 +252,7 @@ @@ -252,7 +252,7 @@
252 </tr> 252 </tr>
253 <tr> 253 <tr>
254 <td colspan="2">出场存油 &nbsp;升</td> 254 <td colspan="2">出场存油 &nbsp;升</td>
255 - <td colspan="3">加注油量 &nbsp;升</td> 255 + <td colspan="3">加注油量 {{map.jzl}}升</td>
256 <td colspan="2">进场存油 &nbsp;升</td> 256 <td colspan="2">进场存油 &nbsp;升</td>
257 <td colspan="4">加注机油 &nbsp;升</td> 257 <td colspan="4">加注机油 &nbsp;升</td>
258 <td colspan="5">本日耗油 &nbsp;升</td> 258 <td colspan="5">本日耗油 &nbsp;升</td>
@@ -350,8 +350,8 @@ @@ -350,8 +350,8 @@
350 <td>{{map.ljgl}}</td> 350 <td>{{map.ljgl}}</td>
351 <td colspan="2">损失班次</td> 351 <td colspan="2">损失班次</td>
352 <td colspan="1">{{map.ssbc}}</td> 352 <td colspan="1">{{map.ssbc}}</td>
353 - <td colspan="3">运送公里</td>  
354 - <td colspan="2">{{map.ysgl}}</td> 353 + <td colspan="3"></td>
  354 + <td colspan="2"></td>
355 </tr> 355 </tr>
356 <tr> 356 <tr>
357 357