Commit c7a85169a0671a1234661ce104be44e1c7d0b6cb

Authored by yiming
1 parent 7757aa5b

“行车路单”根据车辆能耗类型显示油耗和电耗;

src/main/java/com/bsth/entity/Refuel.java
... ... @@ -26,25 +26,26 @@ public class Refuel {
26 26 private String car;
27 27  
28 28 private String driver;
29   -
  29 +
  30 + //出场油量
30 31 private String outOil;
31   -
  32 + //进场油量
32 33 private String inOil;
33   -
  34 + //场内0号
34 35 private String inStation0;
35   -
  36 + //场内B5#
36 37 private String inStation5;
37   -
  38 + //油卡0号
38 39 private String oilCard0;
39   -
  40 + //油卡-10#
40 41 private String oilCard10;
41   -
  42 + //东站0#
42 43 private String eastStation0;
43   -
  44 + //东站-10#
44 45 private String eastStation10;
45   -
  46 + //场外0#
46 47 private String outStation0;
47   -
  48 + //场外-10#
48 49 private String outStation10;
49 50  
50 51 private String createBy;
... ...
src/main/java/com/bsth/repository/oil/JdlReceptionRepository.java
... ... @@ -13,5 +13,7 @@ public interface JdlReceptionRepository extends PagingAndSortingRepository<JdlRe
13 13  
14 14 @Query(value="SELECT j FROM JdlReception j where j.dateStr = ?")
15 15 List<JdlReception> queryListByDateStr(String dateStr);
16   -
  16 +
  17 + @Query(value="SELECT j FROM JdlReception j where j.dateStr = ?1 and j.carCode like ?2 order by j.createDate")
  18 + List<JdlReception> queryListByDateStrAndCar(String dateStr,String car);
17 19 }
18 20 \ No newline at end of file
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -21,11 +21,9 @@ import com.bsth.data.schedule.edit_logs.loggers.FcxxwtLogger;
21 21 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
22 22 import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
23 23 import com.bsth.data.utils.CustomStringUtils;
24   -import com.bsth.entity.CarDevice;
25   -import com.bsth.entity.Cars;
26   -import com.bsth.entity.Line;
27   -import com.bsth.entity.Personnel;
  24 +import com.bsth.entity.*;
28 25 import com.bsth.entity.oil.Dlb;
  26 +import com.bsth.entity.oil.JdlReception;
29 27 import com.bsth.entity.oil.Ylb;
30 28 import com.bsth.entity.oil.Ylxxb;
31 29 import com.bsth.entity.realcontrol.ChildTaskPlan;
... ... @@ -43,7 +41,9 @@ import com.bsth.entity.sys.SysUser;
43 41 import com.bsth.repository.CarDeviceRepository;
44 42 import com.bsth.repository.CarsRepository;
45 43 import com.bsth.repository.LineRepository;
  44 +import com.bsth.repository.RefuelRepository;
46 45 import com.bsth.repository.oil.DlbRepository;
  46 +import com.bsth.repository.oil.JdlReceptionRepository;
47 47 import com.bsth.repository.oil.YlbRepository;
48 48 import com.bsth.repository.oil.YlxxbRepository;
49 49 import com.bsth.repository.realcontrol.ChildTaskPlanRepository;
... ... @@ -164,6 +164,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
164 164  
165 165 @Autowired
166 166 CarsRepository carsRepository;
  167 +
  168 + @Autowired
  169 + JdlReceptionRepository jdlReceptionRepository;
  170 +
  171 + @Autowired
  172 + RefuelRepository refuelRepository;
  173 +
167 174 Logger logger = LoggerFactory.getLogger(this.getClass());
168 175  
169 176 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
... ... @@ -4761,6 +4768,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4761 4768 Double yh = 0.0;
4762 4769 Double jzl = 0.0;
4763 4770 Double zlc = 0.0;
  4771 + Double ccdl = 0.0;
  4772 + Double jcdl = 0.0;
  4773 + Double dh = 0.0;
  4774 + Double jdl = 0.0;
4764 4775 // List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
4765 4776 // List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
4766 4777 // if(listYlb.size()>0){
... ... @@ -4806,16 +4817,63 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4806 4817 //
4807 4818 // }
4808 4819 // }
4809   -
4810   - List<Ylxxb> listylxxb = ylxxbRepository.queryListYlxxb(s.getClZbh(), fcrq);
4811   - for (int i = 0; i < listylxxb.size(); i++) {
4812   - Ylxxb t = listylxxb.get(i);
4813   - jzl = Arith.add(jzl, t.getJzl());
  4820 + //加油数据
  4821 + List<Refuel> refuels=refuelRepository.findByDate(fcrq, s.getClZbh(),"%%");
  4822 + for (Refuel refuel : refuels) {
  4823 + if(refuel.getInOil()!=null && !"".equals(refuel.getInOil())){
  4824 + jcyl=Double.parseDouble(refuel.getInOil());
  4825 + }
  4826 + if(ccyl==0 && refuel.getOutOil()!=null && !"".equals(refuel.getOutOil())){
  4827 + ccyl=Double.parseDouble(refuel.getOutOil());
  4828 + }
  4829 + if(refuel.getInStation0()!=null && !"".equals(refuel.getInStation0())){
  4830 + jzl = Arith.add(jzl, refuel.getInStation0());
  4831 + }
  4832 + if(refuel.getInStation5()!=null && !"".equals(refuel.getInStation5())){
  4833 + jzl = Arith.add(jzl, refuel.getInStation5());
  4834 + }
  4835 + if(refuel.getOilCard0()!=null && !"".equals(refuel.getOilCard0())){
  4836 + jzl = Arith.add(jzl, refuel.getOilCard0());
  4837 + }
  4838 + if(refuel.getOilCard10()!=null && !"".equals(refuel.getOilCard10())){
  4839 + jzl = Arith.add(jzl, refuel.getOilCard10());
  4840 + }
  4841 + if(refuel.getEastStation0()!=null && !"".equals(refuel.getEastStation0())){
  4842 + jzl = Arith.add(jzl, refuel.getEastStation0());
  4843 + }
  4844 + if(refuel.getEastStation10()!=null && !"".equals(refuel.getEastStation10())){
  4845 + jzl = Arith.add(jzl, refuel.getEastStation10());
  4846 + }
  4847 + if(refuel.getOutStation0()!=null && !"".equals(refuel.getOutStation0())){
  4848 + jzl = Arith.add(jzl, refuel.getOutStation0());
  4849 + }
  4850 + if(refuel.getOutStation10()!=null && !"".equals(refuel.getOutStation10())){
  4851 + jzl = Arith.add(jzl, refuel.getOutStation10());
  4852 + }
4814 4853 }
  4854 + yh=Arith.sub(Arith.add(ccyl,jzl),jcyl);
4815 4855 map.put("jzl", jzl);
4816 4856 map.put("yh", yh);
4817 4857 map.put("ccyl", ccyl);
4818 4858 map.put("jcyl", jcyl);
  4859 + //充电数据
  4860 + List<JdlReception> jdlReceptionList=jdlReceptionRepository.queryListByDateStrAndCar(fcrq, s.getClZbh());
  4861 + for (JdlReception jdlReception : jdlReceptionList) {
  4862 + if(jdlReception.getEndSoc()!=null && !"".equals(jdlReception.getEndSoc())){
  4863 + jcdl=jdlReception.getEndSoc();
  4864 + }
  4865 + if(ccdl==0 && jdlReception.getStartSoc()!=null && !"".equals(jdlReception.getStartSoc())){
  4866 + ccdl=jdlReception.getStartSoc();
  4867 + }
  4868 + if(jdlReception.getChargeCapacity()!=null && !"".equals(jdlReception.getChargeCapacity())){
  4869 + jdl = Arith.add(jdl, jdlReception.getChargeCapacity());
  4870 + }
  4871 + }
  4872 + dh=jdl;
  4873 + map.put("jdl", jdl);
  4874 + map.put("dh", dh);
  4875 + map.put("jcdl", jcdl);
  4876 + map.put("ccdl", ccdl);
4819 4877 map.put("type", type);
4820 4878 map.put("zlc", zlc);
4821 4879 map.put("xlName", s.getXlName());
... ...
src/main/resources/static/pages/forms/statement/waybillQp.html
... ... @@ -272,12 +272,19 @@
272 272 <td colspan="17">路别:{{map.xlName}} 车号:{{map.clZbh}} 出场时间:{{map.fcsjActual}} 到达站名:{{map.zdzName}} 日期:{{map.scheduleDate}}</td>
273 273 </tr>
274 274 <tr>
275   - <td colspan="2">出场存油 &nbsp;升</td>
  275 + <td colspan="2">出场 {{map.ccyl}}升</td>
276 276 <td colspan="3">加注油量 {{map.jzl}}升</td>
277   - <td colspan="2">进场存油 &nbsp;升</td>
  277 + <td colspan="2">进场存油 &nbsp{{map.jcyl}}升</td>
278 278 <td colspan="5">加注机油 &nbsp;升</td>
279   - <td colspan="5">本日耗油 &nbsp;升</td>
  279 + <td colspan="5">本日耗油 &nbsp;{{map.yh}}升</td>
280 280 </tr>
  281 + <tr>
  282 + <td colspan="2">出场 {{map.ccdl}}</td>
  283 + <td colspan="3">加注电量 {{map.jdl}}度</td>
  284 + <td colspan="2">进场存电 &nbsp{{map.jcdl}}</td>
  285 + <td colspan="5"></td>
  286 + <td colspan="5">本日耗电 &nbsp;{{map.dh}}度</td>
  287 + </tr>
281 288 <tr>
282 289 <td colspan="2">调度员</td>
283 290 <td colspan="2">早班(职号)</td>
... ...