Commit 33bb9af7a452aa98ff24ffb15d5809ddca407b82

Authored by 廖磊
1 parent 31ad6156

加油信息更改

src/main/java/com/bsth/repository/oil/YlbRepository.java
... ... @@ -37,6 +37,10 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{
37 37 List<Ylb> obtainYl(String rq);
38 38  
39 39  
  40 + @Transactional
  41 + @Modifying
  42 + @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and fgsdm=?3 ",nativeQuery=true)
  43 + List<Ylb> queryListYlb(String rq,String nbbm);
40 44 /**
41 45 * 查询当天总的加注量和总里程
42 46 * @param rq
... ...
src/main/java/com/bsth/repository/oil/YlxxbRepository.java
... ... @@ -24,6 +24,11 @@ public interface YlxxbRepository extends BaseRepository&lt;Ylxxb, Integer&gt;{
24 24  
25 25 @Transactional
26 26 @Modifying
  27 + @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and ssgs=?2",nativeQuery=true)
  28 + List<Ylxxb> checkYlxx(String rq,String gs);
  29 +
  30 + @Transactional
  31 + @Modifying
27 32 @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nbbm =?2 and jylx=1",nativeQuery=true)
28 33 List<Ylxxb> obtainYlxx2(String rq,String nbbm);
29 34  
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -25,6 +25,7 @@ import org.springframework.jdbc.core.RowMapper;
25 25 import org.springframework.stereotype.Service;
26 26  
27 27 import com.bsth.common.ResponseCode;
  28 +import com.bsth.data.BasicData;
28 29 import com.bsth.entity.oil.Cyl;
29 30 import com.bsth.entity.oil.Ylb;
30 31 import com.bsth.entity.oil.Ylxxb;
... ... @@ -435,6 +436,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
435 436 @Override
436 437 public Map<String, Object> checkYl(Map<String, Object> map) {
437 438 Map<String, Object> newMap=new HashMap<String,Object>();
  439 + String xlbm=map.get("xlbm_eq").toString();
438 440 // TODO Auto-generated method stub
439 441 try{
440 442 //获取车辆存油信息
... ... @@ -460,7 +462,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
460 462 t.setJsy(y1.getJsy());
461 463 t.setJzl(y1.getJzl());
462 464 t.setSsgsdm(y1.getGsdm());
463   - t.setXlbm("1024");
  465 + t.setXlbm(xlbm);
464 466 repository.save(t);
465 467  
466 468 //设置存油量
... ...
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
1 1 package com.bsth.service.oil.impl;
2 2  
  3 +import java.sql.ResultSet;
  4 +import java.sql.SQLException;
3 5 import java.text.ParseException;
4 6 import java.text.SimpleDateFormat;
5 7 import java.util.ArrayList;
... ... @@ -10,9 +12,12 @@ import java.util.Map;
10 12 import org.slf4j.Logger;
11 13 import org.slf4j.LoggerFactory;
12 14 import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.jdbc.core.JdbcTemplate;
  16 +import org.springframework.jdbc.core.RowMapper;
13 17 import org.springframework.stereotype.Service;
14 18  
15 19 import com.bsth.common.ResponseCode;
  20 +import com.bsth.entity.excep.Offline;
16 21 import com.bsth.entity.oil.Ylb;
17 22 import com.bsth.entity.oil.Ylxxb;
18 23 import com.bsth.entity.search.CustomerSpecs;
... ... @@ -31,27 +36,23 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
31 36 YlxxbRepository repository;
32 37 @Autowired
33 38 YlbRepository ylbRepository;
34   -
  39 + @Autowired
  40 + JdbcTemplate jdbcTemplate;
35 41 @Override
36 42 public PageObject<Ylxxb> Pagequery(Map<String, Object> map) {
37 43  
38 44 String rq=map.get("yyrq").toString();
39   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
40   - try {
41   - map.put("yyrq_eq", sdf.parseObject(rq));
42   - } catch (ParseException e) {
43   - // TODO Auto-generated catch block
44   - e.printStackTrace();
45   - }
  45 + String gsdm=map.get("gsdm_like").toString();
  46 + String fgsdm=map.get("fgsdm_like").toString();
  47 +
  48 + String sql=" select x.*,y.jsy as ldgh,y.fgsdm as fgsdm from bsth_c_ylxxb x "
  49 + + " left join bsth_c_ylb y on x.nbbm = y.nbbm and x.jsy !=y.jsy "
  50 + + " where DATE_FORMAT(y.rq,'%Y-%m-%d')='"+rq+"' and y.ssgsdm='"+gsdm+"' "
  51 + + " and y.fgsdm='"+fgsdm+"' and DATE_FORMAT(x.yyrq,'%Y-%m-%d')='"+rq+"' "
  52 + + " and x.gsdm='"+gsdm+"'";
  53 +
46 54 //根具条件查询指定日期Ylxxb的数据
47   - List<Ylxxb> iterator=repository.findAll(new CustomerSpecs<Ylxxb>(map));
48   - map.remove("yyrq_eq");
49   - try {
50   - map.put("rq_eq", sdf.parse(rq));
51   - } catch (ParseException e) {
52   - // TODO Auto-generated catch block
53   - e.printStackTrace();
54   - }
  55 +// List<Ylxxb> iterator=repository.checkYlxx(rq,gsdm);
55 56 /*if(map.get("gsdm_in")!=null){
56 57 map.put("ssgsdm_in", map.get("gsdm_in"));
57 58 map.remove("gsdm_in");
... ... @@ -62,30 +63,54 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
62 63 }*/
63 64  
64 65 //根具条件查询指定日期Ylb的数据
65   - List<Ylb> ylbIterator=(List<Ylb>) ylbRepository.findAll(new CustomerSpecs<Ylb>(map));
66   - List<Ylxxb> list=new ArrayList<Ylxxb>();
67   - for (int i = 0; i < iterator.size(); i++) {
68   - Ylxxb y1=iterator.get(i);
69   - boolean fage=true;
70   - String ldgh="";
71   - for (int j = 0; j < ylbIterator.size(); j++) {
72   - Ylb y2 = ylbIterator.get(j);
73   - if(y1.getNbbm().equals(y2.getNbbm())){
74   - if(y1.getJsy().equals(y2.getJsy())){
75   - fage=false;
76   - }
77   - ldgh +=y2.getJsy()+"/";
78   - }
79   - }
80   - if(fage){
81   - y1.setLdgh(ldgh);
82   - list.add(y1);
83   - }
84   - }
  66 +// List<Ylb> ylbIterator=ylbRepository.checkYl(rq,gsdm,fgsdm);
  67 + List<Ylxxb> list=jdbcTemplate.query(sql,
  68 + new RowMapper<Ylxxb>(){
  69 + @Override
  70 + public Ylxxb mapRow(ResultSet rs, int rowNum) throws SQLException {
  71 + Ylxxb s = new Ylxxb();
  72 + s.setId(rs.getInt("id"));
  73 + s.setYyrq(rs.getDate("yyrq"));
  74 + s.setNbbm(rs.getString("nbbm"));
  75 + s.setGsdm(rs.getString("gsdm"));
  76 + s.setFgsdm(rs.getString("fgsdm"));
  77 + s.setJsy(rs.getString("jsy"));
  78 + s.setJzl(rs.getDouble("jzl"));
  79 + s.setStationid(rs.getString("stationid"));
  80 + s.setNylx(rs.getInt("nylx"));
  81 + s.setJyggh(rs.getString("jyggh"));
  82 + s.setYj(rs.getDouble("yj"));
  83 + s.setLdgh(rs.getString("ldgh"));
  84 + s.setBz(rs.getString("bz"));
  85 + return s;
  86 + }
  87 + });
  88 +
  89 + //正式使用用下面代码
  90 +// for (int i = 0; i < iterator.size(); i++) {
  91 +// Ylxxb y1=iterator.get(i);
  92 +// boolean fage=true;
  93 +// String ldgh="";
  94 +// for (int j = 0; j < ylbIterator.size(); j++) {
  95 +// Ylb y2 = ylbIterator.get(j);
  96 +// if(y1.getNbbm().equals(y2.getNbbm())){
  97 +// if(y1.getJsy().equals(y2.getJsy())){
  98 +// fage=false;
  99 +// }
  100 +// ldgh +=y2.getJsy()+"/";
  101 +// }
  102 +// }
  103 +// if(fage){
  104 +// y1.setLdgh(ldgh);
  105 +// list.add(y1);
  106 +// }
  107 +// }
  108 +
  109 +
85 110  
86 111 PageHelper pageHelper = new PageHelper(list.size(), map);
87 112 pageHelper.getMap();
88   - PageObject<Ylxxb> pageObject=pageHelper.getPageObject();
  113 + PageObject<Ylxxb> pageObject = pageHelper.getPageObject();
89 114 pageObject.setDataList(list);
90 115 return pageObject;
91 116 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -17,6 +17,7 @@ import com.bsth.data.schedule.ScheduleComparator;
17 17 import com.bsth.entity.Cars;
18 18 import com.bsth.entity.Line;
19 19 import com.bsth.entity.Personnel;
  20 +import com.bsth.entity.oil.Ylb;
20 21 import com.bsth.entity.oil.Ylxxb;
21 22 import com.bsth.entity.realcontrol.ChildTaskPlan;
22 23 import com.bsth.entity.realcontrol.LineConfig;
... ... @@ -29,6 +30,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo;
29 30 import com.bsth.entity.sys.DutyEmployee;
30 31 import com.bsth.entity.sys.SysUser;
31 32 import com.bsth.repository.LineRepository;
  33 +import com.bsth.repository.oil.YlbRepository;
32 34 import com.bsth.repository.oil.YlxxbRepository;
33 35 import com.bsth.repository.realcontrol.ChildTaskPlanRepository;
34 36 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
... ... @@ -116,6 +118,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
116 118  
117 119 @Autowired
118 120 YlxxbRepository ylxxbRepository;
  121 +
  122 + @Autowired
  123 + YlbRepository ylbRepository;
119 124  
120 125 Logger logger = LoggerFactory.getLogger(this.getClass());
121 126  
... ... @@ -457,12 +462,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
457 462 @Override
458 463 public List<ScheduleRealInfo> queryUserInfoPx(String line, String date, String state,String type) {
459 464 // List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
  465 + state=state+"";
460 466 String sqlPlan="select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh,"
461 467 + " s.lp_Name as lpName,s.j_Name as jName,s.s_Gh as sGh,s.s_Name as sName"
462 468 + " from bsth_c_s_sp_info_real s "
463 469 + " where s.xl_Bm = '"+line+"' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='"+date+"' "
464 470 + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name,s.s_Gh,"
465   - + " s.s_Name order by "+state+" "+type;
  471 + + " s.s_Name order by ("+state+") "+type;
466 472 List<ScheduleRealInfo> list= jdbcTemplate.query(sqlPlan,
467 473 new RowMapper<ScheduleRealInfo>(){
468 474 @Override
... ... @@ -1662,7 +1668,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1662 1668 jhbc_a++;
1663 1669 jhbc_aZ++;
1664 1670 }
1665   - if (scheduleRealInfo.getStatus() == 2) {
  1671 + if (scheduleRealInfo.getStatus() != -1) {
1666 1672 sjbc++;
1667 1673 sjbcZ++;
1668 1674 if ((Integer.parseInt(fcsjActual[0]) * 60 + Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0]) * 60 + Integer.parseInt(fcsjActual[1])) < sj_1) {
... ... @@ -2982,7 +2988,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2982 2988 Ylxxb y=listYlxxb.get(t);
2983 2989 jzl += y.getJzl();
2984 2990 }
  2991 +
  2992 + List<Ylb> listYlb=ylbRepository.queryListYlb(s.getClZbh(), fcrq);
  2993 + Double ccyl=0.0;
  2994 + Double jcyl=0.0;
  2995 + Double yh=0.0;
  2996 + for (int i = 0; i < listYlb.size(); i++) {
  2997 + Ylb y=listYlb.get(i);
  2998 + ccyl +=y.getCzyl();
  2999 + jcyl+= y.getJzyl();
  3000 + yh+=y.getYh();
  3001 +
  3002 + }
2985 3003 map.put("jzl", jzl);
  3004 + map.put("yh", yh);
  3005 + map.put("ccyl", ccyl);
  3006 + map.put("jcyl", jcyl);
2986 3007 map.put("xlName", s.getXlName());
2987 3008 map.put("clZbh", s.getClZbh());
2988 3009 map.put("fcsjActual", s.getFcsjActual());
... ...
src/main/resources/static/pages/forms/statement/scheduleDaily.html
... ... @@ -273,7 +273,7 @@
273 273 day = "0" + day;
274 274 $("#date").val(year + "-" + month + "-" + day);
275 275  
276   - $("#ddrbBody").height($(window).height()-250);
  276 + $("#ddrbBody").height($(window).height()-280);
277 277 $.get('/basic/lineCode2Name',function(result){
278 278 var data=[];
279 279  
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -232,7 +232,7 @@
232 232 });
233 233 jName = params[0].split("\\")[0];
234 234 var id = $("#"+params[1]).val();
235   - $get('/realSchedule/'+id,null,function(result){
  235 + $get('/realSchedule/MapById',{id:id},function(result){
236 236 result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD");
237 237 var ludan_1 = template('ludan_1',result);
238 238 // 把渲染好的模版html文本追加到表格中
... ... @@ -330,11 +330,11 @@
330 330 <td colspan="14">路别:{{xlName}} 路牌:{{lpName}} 车号:{{clZbh}} 出场时间:{{fcsjActual}} 到达站名:{{zdzName}} 当班调派:&nbsp; 日期:{{scheduleDate}}</td>
331 331 </tr>
332 332 <tr>
333   - <td colspan="2">出场存油 &nbsp;升</td>
334   - <td colspan="2">加注油量 &nbsp;升</td>
335   - <td colspan="2">进场存油 &nbsp;升</td>
  333 + <td colspan="2">出场存油 {{map.ccyl}};升</td>
  334 + <td colspan="2">加注油量 {{map.jzl}}升</td>
  335 + <td colspan="2">进场存油 {{map.jcyl}}升</td>
336 336 <td colspan="4">加注机油 &nbsp;升</td>
337   - <td colspan="4">本日耗油 &nbsp;升</td>
  337 + <td colspan="4">本日耗油 {{map.yh}}升</td>
338 338 </tr>
339 339 <tr>
340 340 <td rowspan="2">调度章</td>
... ...
src/main/resources/static/pages/oil/checkJyryList.html
... ... @@ -58,8 +58,8 @@
58 58 <th width="10%">日期</th>
59 59 <th width="10%">公司</th>
60 60 <th width="10%">分公司</th>
61   - <th width="6%">车辆</th>
62   - <th width="10%">驾驶员</th>
  61 + <th width="4%">车辆</th>
  62 + <th width="12%">驾驶员</th>
63 63 <th width="2%">加注量</th>
64 64 <th width="4%">加油站</th>
65 65 <th width="4%">加油类型</th>
... ...