Commit b048feffb78822de0349fde7f4eaec75952eaffd

Authored by 廖磊
1 parent adf0b5a1

油量、电量表中添加线路字段

新增路单数据表 按线路查询
修改了油量、电量查询中的日期查询条件
src/main/java/com/bsth/controller/oil/DlbController.java
... ... @@ -152,7 +152,11 @@ public class DlbController extends BaseController<Dlb, Integer>{
152 152 m.put("rq", y.getRq());
153 153 m.put("gsname",y.getGsname() );
154 154 m.put("fgsname", y.getFgsname());
155   - m.put("xlname", y.getXlname());
  155 + if(y.getLinename()==null){
  156 + m.put("xlname", y.getXlname()==null?"":y.getXlname());
  157 + }else{
  158 + m.put("xlname", y.getLinename());
  159 + }
156 160 m.put("nbbm", y.getNbbm());
157 161 m.put("jsy", y.getJsy());
158 162 m.put("name", y.getName());
... ...
src/main/java/com/bsth/controller/oil/YlbController.java
... ... @@ -255,7 +255,11 @@ public class YlbController extends BaseController<Ylb, Integer>{
255 255 m.put("rq", sdfMonth.format(y.getRq()));
256 256 m.put("gsname",y.getGsname() );
257 257 m.put("fgsname", y.getFgsname());
258   - m.put("xlname", y.getXlname()==null?"":y.getXlname());
  258 + if(y.getLinename()==null){
  259 + m.put("xlname", y.getXlname()==null?"":y.getXlname());
  260 + }else{
  261 + m.put("xlname", y.getLinename());
  262 + }
259 263 m.put("nbbm", y.getNbbm());
260 264 m.put("jsy", y.getJsy());
261 265 m.put("name", y.getName());
... ...
src/main/java/com/bsth/controller/report/ReportController.java
... ... @@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
19 19 import com.bsth.data.BasicData;
20 20 import com.bsth.entity.StationRoute;
21 21 import com.bsth.entity.excep.ArrivalInfo;
  22 +import com.bsth.entity.mcy_forms.Singledata;
22 23 import com.bsth.entity.realcontrol.ScheduleRealInfo;
23 24 import com.bsth.service.report.ReportService;
24 25 import com.bsth.util.ReportUtils;
... ... @@ -357,10 +358,17 @@ public class ReportController {
357 358  
358 359 return lMap;
359 360 }
360   -
361   -
362 361 @RequestMapping(value="/online")
363 362 public Map<String, Object> online(@RequestParam Map<String, Object> map){
364 363 return service.online(map);
365 364 }
  365 +
  366 +
  367 +
  368 + @RequestMapping(value = "/singledatatj", method = RequestMethod.GET)
  369 + public List<Singledata> singledatatj(@RequestParam Map<String, Object> map) {
  370 +
  371 + return service.singledatatj(map);
  372 + }
  373 +
366 374 }
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -55,6 +55,7 @@ public class BasicData {
55 55 //线路编码和名称对照
56 56 public static Map<String, String> lineCode2NameMap;
57 57  
  58 + public static Map<String, String> lineCodeAllNameMap;
58 59 //停车场
59 60 public static List<String> parkCodeList;
60 61  
... ... @@ -315,6 +316,14 @@ public class BasicData {
315 316 lineId2ShangHaiCodeMap = id2SHcode;
316 317 lineCode2ShangHaiCodeMap = code2SHcode;
317 318 stationName2YgcNumber = tempStationName2YgcNumber;
  319 +
  320 + Map<String, String> code2nameAll = new HashMap<>();
  321 + Iterator<Line> iteratorAll = lineRepository.findAll().iterator();
  322 + while (iteratorAll.hasNext()) {
  323 + line = iteratorAll.next();
  324 + code2nameAll.put(line.getLineCode(), line.getName());
  325 + }
  326 + lineCodeAllNameMap=code2nameAll;
318 327 }
319 328  
320 329 /**
... ...
src/main/java/com/bsth/entity/oil/Dlb.java
... ... @@ -22,6 +22,7 @@ public class Dlb {
22 22 @DateTimeFormat(pattern="yyyy-MM-dd")
23 23 private Date rq;
24 24 private String xlbm;
  25 + private String linename;
25 26 private String ssgsdm;
26 27 private String fgsdm;
27 28 private String nbbm;
... ... @@ -102,6 +103,14 @@ public class Dlb {
102 103 this.xlbm = xlbm;
103 104 }
104 105  
  106 + public String getLinename() {
  107 + return linename;
  108 + }
  109 +
  110 + public void setLinename(String linename) {
  111 + this.linename = linename;
  112 + }
  113 +
105 114 public String getSsgsdm() {
106 115 return ssgsdm;
107 116 }
... ... @@ -348,7 +357,7 @@ public class Dlb {
348 357 }
349 358  
350 359 public String getXlname() {
351   - return BasicData.lineCode2NameMap.get(this.xlbm);
  360 + return BasicData.lineCodeAllNameMap.get(this.xlbm);
352 361 }
353 362  
354 363 public void setXlname(String xlname) {
... ...
src/main/java/com/bsth/entity/oil/Ylb.java
... ... @@ -22,6 +22,7 @@ public class Ylb {
22 22 @DateTimeFormat(pattern="yyyy-MM-dd")
23 23 private Date rq;
24 24 private String xlbm;
  25 + private String linename;
25 26 private String ssgsdm;
26 27 private String fgsdm;
27 28 private String nbbm;
... ... @@ -95,6 +96,15 @@ public class Ylb {
95 96 public void setXlbm(String xlbm) {
96 97 this.xlbm = xlbm;
97 98 }
  99 +
  100 + public String getLinename() {
  101 + return linename;
  102 + }
  103 +
  104 + public void setLinename(String linename) {
  105 + this.linename = linename;
  106 + }
  107 +
98 108 public String getSsgsdm() {
99 109 return ssgsdm;
100 110 }
... ... @@ -292,7 +302,7 @@ public class Ylb {
292 302 }
293 303  
294 304 public String getXlname() {
295   - return BasicData.lineCode2NameMap.get(this.xlbm);
  305 + return BasicData.lineCodeAllNameMap.get(this.xlbm);
296 306 }
297 307  
298 308 public void setXlname(String xlname) {
... ...
src/main/java/com/bsth/repository/LineRepository.java
... ... @@ -51,6 +51,8 @@ public interface LineRepository extends BaseRepository&lt;Line, Integer&gt; {
51 51 @Query("SELECT L FROM Line L where L.destroy=0 and L.remove !=1")
52 52 List<Line> findAllService();
53 53  
  54 + @Query("SELECT L FROM Line L")
  55 + List<Line> findAll();
54 56  
55 57 @Modifying
56 58 @Query(value = "UPDATE Line l set l.name=?1 , l.company=?2, l.brancheCompany=?3, "
... ...
src/main/java/com/bsth/repository/oil/CwjyRepository.java
... ... @@ -22,8 +22,8 @@ public interface CwjyRepository extends BaseRepository&lt;Cwjy, Integer&gt;{
22 22 */
23 23 @Query(value="SELECT a.gsdm as gsdm,a.nbbm as nbbm,b.jsy as jsy,b.jzl as jzl ,b.stationid as stationid,"
24 24 + "b.nylx as nylx,b.yj as yj,b.bz as bz,c.jsy as ldgh FROM bsth_c_cwjy a "+
25   - " left join ( select * from bsth_c_ylxxb b where to_days(b.yyrq)=to_days(?1) and jylx=1) b " +
26   - " on a.nbbm=b.nbbm left join (select nbbm,group_concat(jsy) as jsy from bsth_c_ylb where to_days(rq)= to_days(?1 ) group by nbbm "+
  25 + " left join ( select * from bsth_c_ylxxb b where b.yyrq=?1 and jylx=1) b " +
  26 + " on a.nbbm=b.nbbm left join (select nbbm,group_concat(jsy) as jsy from bsth_c_ylb where rq= ?1 group by nbbm "+
27 27 " ) c on a.nbbm=c.nbbm where a.nbbm like %?2% ",nativeQuery=true)
28 28 List<Object[]> obtainCwjycl(String rq,String nbbm);
29 29  
... ...
src/main/java/com/bsth/repository/oil/DlbRepository.java
... ... @@ -28,13 +28,13 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
28 28 * @param rq
29 29 * @return
30 30 */
31   - @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and ssgsdm like %?2% "
  31 + @Query(value="SELECT * FROM bsth_c_dlb where rq=?1 and ssgsdm like %?2% "
32 32 + " and fgsdm like %?3%"
33 33 + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc",nativeQuery=true)
34 34 List<Dlb> obtainDl(String rq,String gsbm,String fgsdm,String xlbm,String nbbm,String px);
35 35  
36 36 @Query(value="select s from Dlb s "
37   - + " where to_days(?1)=to_days(s.rq) "
  37 + + " where to_days(s.rq)=to_days(?1) "
38 38 + " and s.ssgsdm like %?2% "
39 39 + " and s.fgsdm like %?3%"
40 40 + " and s.xlbm like %?4% "
... ... @@ -49,14 +49,14 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
49 49 * @param xlbm
50 50 * @return
51 51 */
52   - @Query(value="select nbbm,count(nbbm) from bsth_c_dlb where to_days(?1)=to_days(rq) and "
  52 + @Query(value="select nbbm,count(nbbm) from bsth_c_dlb where rq=?1 and "
53 53 + " ssgsdm like %?2% "
54 54 + " and fgsdm like %?3%"
55 55 + " and xlbm like %?4% and nbbm like %?5% "
56 56 + " group by nbbm,rq,ssgsdm,fgsdm",nativeQuery=true)
57 57 List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm);
58 58  
59   - @Query(value="select nbbm,sum(cdl*100) as cdl ,sum(zlc*100) as zlc from bsth_c_dlb where to_days(?1)=to_days(rq) and "
  59 + @Query(value="select nbbm,sum(cdl*100) as cdl ,sum(zlc*100) as zlc from bsth_c_dlb where rq= ?1 and "
60 60 + " ssgsdm like %?2% "
61 61 + " and fgsdm like %?3%"
62 62 + " and xlbm like %?4% and nbbm like %?5% "
... ... @@ -66,7 +66,7 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
66 66  
67 67  
68 68 @Query(value="select cdl,hd,sh from Dlb s "
69   - + " where to_days(?1)=to_days(s.rq) "
  69 + + " where to_days(s.rq)=to_days(?1) "
70 70 + " and s.ssgsdm like %?2% "
71 71 + " and s.fgsdm like %?3%"
72 72 + " and s.xlbm like %?4% "
... ... @@ -74,7 +74,7 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
74 74 List<Object[]> sumDlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm);
75 75  
76 76 @Query(value="select ifnull(cdl,0),ifnull(hd,0),ifnull(sh,0) from bsth_c_dlb "
77   - + " where to_days(?1)=to_days(rq) "
  77 + + " where rq=?1 "
78 78 + " and ssgsdm like %?2% "
79 79 + " and fgsdm like %?3%"
80 80 + " and xlbm like %?4% "
... ... @@ -93,10 +93,10 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
93 93 " WHERE id = ?1", nativeQuery=true)
94 94 public void dlbUpdate(Integer id,double czcd,double jzcd,double hd, double sh,String shyy,int yhlx);
95 95  
96   - @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true)
  96 + @Query(value="SELECT * FROM bsth_c_dlb where rq=?1 and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true)
97 97 List<Dlb> queryListDlb(String rq,String nbbm,String jgh,String xlbm);
98 98  
99   - @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and xlbm=?2",nativeQuery=true)
  99 + @Query(value="SELECT * FROM bsth_c_dlb where rq=?1 and xlbm=?2",nativeQuery=true)
100 100 List<Dlb> queryDlbByRqXlbm(String rq, String xlbm);
101 101  
102 102 }
... ...
src/main/java/com/bsth/repository/oil/LsylbRepository.java
... ... @@ -22,7 +22,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{
22 22 * @param xlbm
23 23 * @return
24 24 */
25   - @Query(value="select nbbm,count(nbbm) from bsth_ls_ylb where to_days(?1)=to_days(rq) and "
  25 + @Query(value="select nbbm,count(nbbm) from bsth_ls_ylb where rq=?1 and "
26 26 + " ssgsdm like %?2% "
27 27 + " and fgsdm like %?3%"
28 28 + " and xlbm like %?4% and nbbm like %?5% and nylx= ?6 "
... ... @@ -30,7 +30,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{
30 30 List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int nylx);
31 31  
32 32 @Query(value="select s from Lsylb s "
33   - + " where to_days(?1)=to_days(s.rq) "
  33 + + " where to_days(s.rq)=to_days(?1) "
34 34 + " and s.ssgsdm =?2 "
35 35 + " and s.fgsdm =?3 "
36 36 + " and s.xlbm like %?4% "
... ... @@ -38,7 +38,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{
38 38 + " and s.nbbm in ?6 order by nbbm,jhsj")
39 39 List<Lsylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,int nylx,List<String> listNbbm);
40 40  
41   - @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_ls_ylb where to_days(?1)=to_days(rq) and "
  41 + @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_ls_ylb where rq=?1 and "
42 42 + " ssgsdm like %?2% "
43 43 + " and fgsdm like %?3%"
44 44 + " and xlbm like %?4% and nbbm like %?5% and nylx =?6 "
... ... @@ -47,7 +47,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{
47 47  
48 48  
49 49 @Query(value="select ifnull(jzl,0),ifnull(yh,0),ifnull(sh,0) from bsth_ls_ylb "
50   - + " where to_days(?1)=to_days(rq) "
  50 + + " where rq=?1 "
51 51 + " and ssgsdm like %?2% "
52 52 + " and fgsdm like %?3%"
53 53 + " and xlbm like %?4% "
... ... @@ -57,7 +57,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{
57 57  
58 58  
59 59 @Query(value="select jzl,yh,sh from Lsylb s "
60   - + " where to_days(?1)=to_days(s.rq) "
  60 + + " where to_days(s.rq)=to_days(?1) "
61 61 + " and s.ssgsdm like %?2% "
62 62 + " and s.fgsdm like %?3%"
63 63 + " and s.xlbm like %?4% "
... ...
src/main/java/com/bsth/repository/oil/YlbRepository.java
... ... @@ -33,7 +33,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
33 33 @Query(value="select y.* from (select max(d.id) as id ,d.nbbm from ("
34 34 + " select b.rq,b.nbbm,max(b.jcsx) as jcsx from ("
35 35 + " select max(t.rq) as rq ,t.nbbm from bsth_c_ylb t "
36   - + " where to_days(t.rq)< to_days(?1) "
  36 + + " where t.rq< ?1 "
37 37 + " and t.ssgsdm like %?2% and t.fgsdm like %?3% "
38 38 + " and t.xlbm like %?4% and t.nbbm like %?5% group by nbbm ) a "
39 39 + " left join bsth_c_ylb b on a.rq=b.rq and a.nbbm=b.nbbm "
... ... @@ -63,29 +63,29 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
63 63 * @param rq
64 64 * @return
65 65 */
66   - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% "
  66 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and ssgsdm like %?2% "
67 67 + " and fgsdm like %?3%"
68 68 + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc ",nativeQuery=true)
69 69 List<Ylb> obtainYl(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px);
70 70  
71   - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% "
  71 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and ssgsdm like %?2% "
72 72 + " and fgsdm like %?3%"
73 73 + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true)
74 74 List<Ylb> obtainYlEq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px);
75 75  
76   - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% "
  76 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and ssgsdm like %?2% "
77 77 + " and fgsdm like %?3%"
78 78 + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true)
79 79 List<Ylb> obtainYl_eq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px);
80 80  
81 81  
82   - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true)
  82 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true)
83 83 List<Ylb> queryListYlb(String rq,String nbbm,String jgh,String xlbm);
84 84  
85   - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and xlbm=?2",nativeQuery=true)
  85 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and xlbm=?2",nativeQuery=true)
86 86 List<Ylb> queryYlbByRqXlbm(String rq,String xlbm);
87 87  
88   - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4 order by ?5 asc",nativeQuery=true)
  88 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and nbbm =?2 and jsy=?3 and xlbm=?4 order by ?5 asc",nativeQuery=true)
89 89 List<Ylb> checkYlb(String rq,String nbbm,String jgh,String xlbm,String px);
90 90 /**
91 91 * 查询当天总的加注量和总里程
... ... @@ -102,7 +102,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
102 102 * @param xlbm
103 103 * @return
104 104 */
105   - @Query(value="select nbbm,count(nbbm) from bsth_c_ylb where to_days(?1)=to_days(rq) and "
  105 + @Query(value="select nbbm,count(nbbm) from bsth_c_ylb where rq=?1 and "
106 106 + " ssgsdm like %?2% "
107 107 + " and fgsdm like %?3%"
108 108 + " and xlbm like %?4% and nbbm like %?5% "
... ... @@ -117,7 +117,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
117 117 * @param xlbm
118 118 * @return
119 119 */
120   - @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_c_ylb where to_days(?1)=to_days(rq) and "
  120 + @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_c_ylb where rq=?1 and "
121 121 + " ssgsdm like %?2% "
122 122 + " and fgsdm like %?3%"
123 123 + " and xlbm like %?4% and nbbm like %?5% "
... ... @@ -126,7 +126,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
126 126  
127 127  
128 128 @Query(value="select jzl,yh,sh from Ylb s "
129   - + " where to_days(?1)=to_days(s.rq) "
  129 + + " where to_days(s.rq)=to_days(?1) "
130 130 + " and s.ssgsdm like %?2% "
131 131 + " and s.fgsdm like %?3%"
132 132 + " and s.xlbm like %?4% "
... ... @@ -134,7 +134,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
134 134 List<Object[]> sumYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm);
135 135  
136 136 @Query(value="select ifnull(jzl,0),ifnull(yh,0),ifnull(sh,0) from bsth_c_ylb "
137   - + " where to_days(?1)=to_days(rq) "
  137 + + " where rq=?1 "
138 138 + " and ssgsdm like %?2% "
139 139 + " and fgsdm like %?3%"
140 140 + " and xlbm like %?4% "
... ... @@ -144,7 +144,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
144 144  
145 145  
146 146 @Query(value="select s from Ylb s "
147   - + " where to_days(?1)=to_days(s.rq) "
  147 + + " where to_days(s.rq)=to_days(?1) "
148 148 + " and s.ssgsdm =?2 "
149 149 + " and s.fgsdm =?3 "
150 150 + " and s.xlbm like %?4% "
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -1724,7 +1724,7 @@ public class FormsServiceImpl implements FormsService {
1724 1724 startDate = map.get("startDate").toString();
1725 1725  
1726 1726 String sql="select r.s_gh,r.s_name, "
1727   - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
  1727 + + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm,xl_name"
1728 1728 + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'";
1729 1729 if(!xlbm.equals("")){
1730 1730 sql += " and r.xl_bm = '"+xlbm+"'";
... ... @@ -1736,7 +1736,7 @@ public class FormsServiceImpl implements FormsService {
1736 1736 sql += " and r.fgs_bm='"+fgsdm+"'";
1737 1737 }
1738 1738 sql += " group by r.s_gh,r.s_name,"
1739   - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
  1739 + + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm,xl_name order by r.xl_bm,r.cl_zbh";
1740 1740  
1741 1741 List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
1742 1742 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
... ... @@ -1750,6 +1750,7 @@ public class FormsServiceImpl implements FormsService {
1750 1750 sin.setjName(arg0.getString("j_name"));
1751 1751 sin.setSgh(arg0.getString("s_gh"));
1752 1752 sin.setsName(arg0.getString("s_name"));
  1753 + sin.setXlmc(arg0.getString("xl_name"));
1753 1754 sin.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm")));
1754 1755  
1755 1756 return sin;
... ... @@ -1767,7 +1768,7 @@ public class FormsServiceImpl implements FormsService {
1767 1768 String clzbh=sin.getClzbh();
1768 1769 String xl=sin.getxL();
1769 1770 String spy=sin.getSgh();
1770   - sin.setxL(BasicData.lineCode2NameMap.get(xl));
  1771 + sin.setxL(sin.getXlmc());
1771 1772 for (int j = 0; j < listReal.size(); j++) {
1772 1773 ScheduleRealInfo s=listReal.get(j);
1773 1774 if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)
... ... @@ -1912,7 +1913,12 @@ public class FormsServiceImpl implements FormsService {
1912 1913 sin.setEmptMileage(String.valueOf(zksgl));
1913 1914 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
1914 1915 sin.setxL(y.getXlbm());
1915   - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm()));
  1916 + if(y.getLinename()==null){
  1917 + sin.setXlmc(y.getXlname());
  1918 + }else{
  1919 + sin.setXlmc(y.getLinename());
  1920 + }
  1921 +
1916 1922 sin.setClzbh(clzbh);
1917 1923 sin.setJsy(jsy);
1918 1924 sin.setrQ(startDate);
... ... @@ -1994,8 +2000,11 @@ public class FormsServiceImpl implements FormsService {
1994 2000 sin.setEmptMileage(String.valueOf(zksgl));
1995 2001 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
1996 2002 sin.setxL(y.getXlbm());
1997   - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm()));
1998   - sin.setClzbh(clzbh);
  2003 + if(y.getLinename()==null){
  2004 + sin.setXlmc(y.getXlname());
  2005 + }else{
  2006 + sin.setXlmc(y.getLinename());
  2007 + } sin.setClzbh(clzbh);
1999 2008 sin.setJsy(jsy);
2000 2009 sin.setrQ(startDate);
2001 2010 if(newList.size()>0){
... ... @@ -2019,7 +2028,7 @@ public class FormsServiceImpl implements FormsService {
2019 2028 list.addAll(listD);
2020 2029 }else{
2021 2030 String sql="select r.s_gh,r.s_name, "
2022   - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm"
  2031 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name"
2023 2032 + " from bsth_c_s_sp_info_real r where "
2024 2033 + " r.schedule_date_str = '"+startDate+"'"
2025 2034 + " and r.s_gh !='' and r.s_gh is not null ";
... ... @@ -2033,7 +2042,7 @@ public class FormsServiceImpl implements FormsService {
2033 2042 sql += " and r.fgs_bm='"+fgsdm+"'";
2034 2043 }
2035 2044 sql += " group by r.s_gh,r.s_name,"
2036   - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
  2045 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name order by r.xl_bm,r.cl_zbh";
2037 2046  
2038 2047 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
2039 2048 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
... ... @@ -2045,6 +2054,7 @@ public class FormsServiceImpl implements FormsService {
2045 2054 sin.setClzbh(arg0.getString("cl_zbh"));
2046 2055 sin.setSgh(arg0.getString("s_gh"));
2047 2056 sin.setsName(arg0.getString("s_name"));
  2057 + sin.setXlmc(arg0.getString("xl_name"));
2048 2058 return sin;
2049 2059 }
2050 2060 });
... ... @@ -2054,6 +2064,7 @@ public class FormsServiceImpl implements FormsService {
2054 2064 String jsy=sin.getSgh();
2055 2065 String line=sin.getxL();
2056 2066 String clzbh=sin.getClzbh();
  2067 + String xl_name=sin.getXlmc();
2057 2068 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
2058 2069 List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>();
2059 2070  
... ... @@ -2086,7 +2097,7 @@ public class FormsServiceImpl implements FormsService {
2086 2097  
2087 2098 sin.setEmptMileage(String.valueOf(zksgl));
2088 2099 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
2089   - sin.setXlmc(BasicData.lineCode2NameMap.get(line));
  2100 + sin.setXlmc(xl_name);
2090 2101 sin.setClzbh(clzbh);
2091 2102 sin.setJsy("");
2092 2103 sin.setjName("");
... ... @@ -2192,8 +2203,11 @@ public class FormsServiceImpl implements FormsService {
2192 2203 sin.setEmptMileage(String.valueOf(zksgl));
2193 2204 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
2194 2205 sin.setxL(y.getXlbm());
2195   - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm()));
2196   - sin.setClzbh(clzbh);
  2206 + if(y.getLinename()==null){
  2207 + sin.setXlmc(y.getXlname());
  2208 + }else{
  2209 + sin.setXlmc(y.getLinename());
  2210 + } sin.setClzbh(clzbh);
2197 2211 sin.setJsy(jsy);
2198 2212 sin.setrQ(startDate);
2199 2213 if(newList.size()>0){
... ... @@ -2274,7 +2288,11 @@ public class FormsServiceImpl implements FormsService {
2274 2288 sin.setEmptMileage(String.valueOf(zksgl));
2275 2289 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
2276 2290 sin.setxL(y.getXlbm());
2277   - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm()));
  2291 + if(y.getLinename()==null){
  2292 + sin.setXlmc(y.getXlname());
  2293 + }else{
  2294 + sin.setXlmc(y.getLinename());
  2295 + }
2278 2296 sin.setClzbh(clzbh);
2279 2297 sin.setJsy(jsy);
2280 2298 sin.setrQ(startDate);
... ... @@ -2299,7 +2317,7 @@ public class FormsServiceImpl implements FormsService {
2299 2317 list.addAll(listD);
2300 2318 }else{
2301 2319 String sql="select r.s_gh,r.s_name, "
2302   - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm"
  2320 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name"
2303 2321 + " from bsth_c_s_sp_info_real r where "
2304 2322 + " r.schedule_date_str = '"+startDate+"'"
2305 2323 + " and r.s_gh !='' and r.s_gh is not null ";
... ... @@ -2313,7 +2331,7 @@ public class FormsServiceImpl implements FormsService {
2313 2331 sql += " and r.fgs_bm='"+fgsdm+"'";
2314 2332 }
2315 2333 sql += " group by r.s_gh,r.s_name,"
2316   - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
  2334 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,xl_name order by r.xl_bm,r.cl_zbh";
2317 2335  
2318 2336 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
2319 2337 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
... ... @@ -2325,6 +2343,7 @@ public class FormsServiceImpl implements FormsService {
2325 2343 sin.setClzbh(arg0.getString("cl_zbh"));
2326 2344 sin.setSgh(arg0.getString("s_gh"));
2327 2345 sin.setsName(arg0.getString("s_name"));
  2346 + sin.setXlmc(arg0.getString("xl_name"));
2328 2347 return sin;
2329 2348 }
2330 2349 });
... ... @@ -2334,6 +2353,7 @@ public class FormsServiceImpl implements FormsService {
2334 2353 String jsy=sin.getSgh();
2335 2354 String line=sin.getxL();
2336 2355 String clzbh=sin.getClzbh();
  2356 + String xl_name=sin.getXlmc();
2337 2357 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
2338 2358 List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>();
2339 2359  
... ... @@ -2367,7 +2387,7 @@ public class FormsServiceImpl implements FormsService {
2367 2387  
2368 2388 sin.setEmptMileage(String.valueOf(zksgl));
2369 2389 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
2370   - sin.setXlmc(BasicData.lineCode2NameMap.get(line));
  2390 + sin.setXlmc(xl_name);
2371 2391 sin.setClzbh(clzbh);
2372 2392 sin.setJsy("");
2373 2393 sin.setjName("");
... ...
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
... ... @@ -328,7 +328,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
328 328 }
329 329  
330 330 String sql_ylb="SELECT nbbm,group_concat(jsy) AS jsy FROM bsth_c_ylb WHERE "
331   - + " to_days(rq) = to_days('"+rq+"') AND ssgsdm = '"+gsdm+"' AND "
  331 + + " rq = '"+rq+"' AND ssgsdm = '"+gsdm+"' AND "
332 332 + " fgsdm = '"+fgsdm+"' GROUP BY nbbm";
333 333  
334 334 List<Map<String, String>> ylbList= jdbcTemplate.query(sql_ylb,
... ...
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
... ... @@ -197,6 +197,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
197 197 t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString());
198 198 t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString()))));
199 199 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
  200 + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString());
200 201 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
201 202 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
202 203 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
... ... @@ -464,6 +465,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
464 465 t.setZlc(map.get("totalKilometers") == null ? 0.0
465 466 : Double.parseDouble(map.get("totalKilometers").toString()));
466 467 t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString());
  468 + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString());
467 469 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
468 470 t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString());
469 471 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString());
... ... @@ -884,7 +886,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
884 886 String px) {
885 887 // TODO Auto-generated method stub
886 888 String sql="SELECT * FROM bsth_c_dlb "
887   - + " where to_days('"+rq+"')=to_days(rq) and ssgsdm like '%"+gsdm+"%' "
  889 + + " where rq='"+rq+"' and ssgsdm like '%"+gsdm+"%' "
888 890 + " and fgsdm like '%"+fgsdm+"%'";
889 891 if(xlbm.equals("")){
890 892 sql+= " and xlbm like '%"+xlbm+"%' ";
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -194,6 +194,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
194 194 t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString());
195 195 t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString()));
196 196 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
  197 + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString());
197 198 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
198 199 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
199 200 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
... ... @@ -492,6 +493,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
492 493 t.setZlc(map.get("totalKilometers") == null ? 0.0
493 494 : Double.parseDouble(map.get("totalKilometers").toString()));
494 495 t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString());
  496 + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString());
495 497 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
496 498 t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString());
497 499 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString());
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -3257,6 +3257,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3257 3257 * 对计划发车时间相同的班次进行排序 out最前 in最后
3258 3258 */
3259 3259 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  3260 + SimpleDateFormat sdfnyr =new SimpleDateFormat("yyyy-MM-dd");
3260 3261 String minfcsj = "02:00";
3261 3262 List<Line> lineList = lineRepository.findLineByCode(line);
3262 3263 if (lineList.size() > 0) {
... ... @@ -3285,9 +3286,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3285 3286 Calendar calendar = new GregorianCalendar();
3286 3287 calendar.setTime(s.getScheduleDate());
3287 3288 calendar.add(calendar.DATE, 1);
3288   - s.setScheduleDate(calendar.getTime());
  3289 + Date date_sch= calendar.getTime();
3289 3290 try {
3290   - fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
  3291 + fscjT = sdf.parse(sdfnyr.format(date_sch) + " " + s.getFcsj()).getTime();
3291 3292 } catch (ParseException e) {
3292 3293 // TODO Auto-generated catch block
3293 3294 e.printStackTrace();
... ... @@ -3299,15 +3300,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3299 3300 } catch (ParseException e) {
3300 3301 // TODO Auto-generated catch block
3301 3302 e.printStackTrace();
3302   - }
3303   - ;
  3303 + };
3304 3304 }
3305 3305 s.setFcsjT(fscjT);
3306 3306 }
3307 3307 List<ScheduleRealInfo> listInfo2=new ArrayList<ScheduleRealInfo>();
3308 3308 listInfo2.addAll(listInfo);
3309 3309 Collections.sort(listInfo, new compareLpFcsjType());
3310   - System.out.println(listInfo);
3311 3310 Collections.sort(listInfo2,new compareDirLpFcsjType());
3312 3311 for (int i = 0; i < listInfo.size(); i++) {
3313 3312 ScheduleRealInfo t = listInfo.get(i);
... ... @@ -3446,6 +3445,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3446 3445 * 对计划发车时间相同的班次进行排序 out最前 in最后
3447 3446 */
3448 3447 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  3448 + SimpleDateFormat sdfnyr = new SimpleDateFormat("yyyy-MM-dd");
  3449 +
3449 3450 String minfcsj = "02:00";
3450 3451 List<Line> lineList = lineRepository.findLineByCode(line);
3451 3452 if (lineList.size() > 0) {
... ... @@ -3474,9 +3475,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3474 3475 Calendar calendar = new GregorianCalendar();
3475 3476 calendar.setTime(s.getScheduleDate());
3476 3477 calendar.add(calendar.DATE, 1);
3477   - s.setScheduleDate(calendar.getTime());
  3478 + Date date_sch=calendar.getTime();
3478 3479 try {
3479   - fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
  3480 + fscjT = sdf.parse(sdfnyr.format(date_sch) + " " + s.getFcsj()).getTime();
3480 3481 } catch (ParseException e) {
3481 3482 // TODO Auto-generated catch block
3482 3483 e.printStackTrace();
... ... @@ -3765,6 +3766,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3765 3766 boolean fage = true;
3766 3767 String company = "";
3767 3768 String bCompany = "";
  3769 + String lineName="";
3768 3770 List<ScheduleRealInfo> listS = new ArrayList<ScheduleRealInfo>();
3769 3771 for (ScheduleRealInfo scheduleRealInfo : lists) {
3770 3772 if (scheduleRealInfo.getjGh().equals(jName)
... ... @@ -3775,6 +3777,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3775 3777 //根据线路代码获取公司
3776 3778 company = scheduleRealInfo.getGsBm();
3777 3779 bCompany = scheduleRealInfo.getFgsBm();
  3780 + lineName = scheduleRealInfo.getXlName();
3778 3781 fage = false;
3779 3782 }
3780 3783 Set<ChildTaskPlan> cts = scheduleRealInfo.getcTasks();
... ... @@ -3789,6 +3792,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3789 3792 }
3790 3793 yesterdayDataList.get(x).put("company", company);
3791 3794 yesterdayDataList.get(x).put("bCompany", bCompany);
  3795 + yesterdayDataList.get(x).put("lineName", lineName);
3792 3796 Double ljgl = culateMieageService.culateLjgl(listS);
3793 3797 Double sjgl = culateMieageService.culateSjgl(listS);
3794 3798 Double ksgl = culateMieageService.culateKsgl(listS);
... ...
src/main/java/com/bsth/service/report/ReportService.java
... ... @@ -5,6 +5,7 @@ import java.util.Map;
5 5  
6 6 import com.bsth.entity.StationRoute;
7 7 import com.bsth.entity.excep.ArrivalInfo;
  8 +import com.bsth.entity.mcy_forms.Singledata;
8 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
9 10  
10 11  
... ... @@ -56,4 +57,6 @@ public interface ReportService {
56 57 List<Map<String, Object>> countDjg(Map<String, Object> map);
57 58  
58 59 Map<String, Object> online(Map<String, Object> map);
  60 +
  61 + List<Singledata> singledatatj(Map<String, Object> map);
59 62 }
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -6,6 +6,7 @@ import com.bsth.entity.Personnel;
6 6 import com.bsth.entity.StationRoute;
7 7 import com.bsth.entity.excep.ArrivalInfo;
8 8 import com.bsth.entity.mcy_forms.Daily;
  9 +import com.bsth.entity.mcy_forms.Singledata;
9 10 import com.bsth.entity.oil.Dlb;
10 11 import com.bsth.entity.oil.Ylb;
11 12 import com.bsth.entity.realcontrol.ChildTaskPlan;
... ... @@ -52,6 +53,9 @@ public class ReportServiceImpl implements ReportService{
52 53  
53 54 private Logger logger = LoggerFactory.getLogger(this.getClass());
54 55  
  56 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  57 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  58 +
55 59 @Autowired
56 60 JdbcTemplate jdbcTemplate;
57 61  
... ... @@ -65,7 +69,10 @@ public class ReportServiceImpl implements ReportService{
65 69 LineRepository lineRepository;
66 70 @Autowired
67 71 StationRouteRepository stationRouteRepository;
68   -
  72 + @Autowired
  73 + CulateMileageService culateMileageService;
  74 +
  75 +
69 76 @Override
70 77 public List<ScheduleRealInfo> queryListBczx(String line, String date,String clzbh) {
71 78 // TODO Auto-generated method stub
... ... @@ -3549,6 +3556,393 @@ public class ReportServiceImpl implements ReportService{
3549 3556 }
3550 3557 return list;
3551 3558 }
  3559 + @Override
  3560 + public List<Singledata> singledatatj(Map<String, Object> map) {
  3561 + String sfyy="";
  3562 + if(map.get("sfyy")!=null){
  3563 + sfyy=map.get("sfyy").toString();
  3564 + }
  3565 + String gsdm="";
  3566 + if(map.get("gsdmSing")!=null){
  3567 + gsdm=map.get("gsdmSing").toString();
  3568 + }
  3569 + String fgsdm="";
  3570 + if(map.get("fgsdmSing")!=null){
  3571 + fgsdm=map.get("fgsdmSing").toString();
  3572 + }
  3573 + String type="";
  3574 + if(map.get("type")!=null){
  3575 + type=map.get("type").toString();
  3576 + }
  3577 + String tjtype=map.get("tjtype").toString();
  3578 + String xlbm=map.get("line").toString().trim();
  3579 + String startDate = map.get("startDate").toString();
  3580 + String endDate = map.get("endDate").toString();
  3581 +
  3582 + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>();
  3583 + if(xlbm.equals("")){
  3584 + listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj(xlbm, startDate, endDate, gsdm, fgsdm);
  3585 + }else{
  3586 + listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj2(xlbm, startDate, endDate);
  3587 + }
  3588 + List<Singledata> list=new ArrayList<Singledata>();
  3589 + List<Singledata> list_=new ArrayList<Singledata>();
  3590 + if(tjtype.equals("jsy")){
  3591 + //油统计
  3592 + String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.fgs_bm"
  3593 + + " from bsth_c_s_sp_info_real r where "
  3594 + + " r.schedule_date_str >= '"+startDate+"'"
  3595 + + " and r.schedule_date_str<='"+endDate+"'";
  3596 + if(xlbm.length() != 0){
  3597 + sql += " and r.xl_bm = '"+xlbm+"'";
  3598 + }
  3599 + if(gsdm.length() != 0){
  3600 + sql += " and r.gs_bm ='"+gsdm+"'";
  3601 + }
  3602 + if(fgsdm.length() != 0){
  3603 + sql += " and r.fgs_bm ='"+fgsdm+"'";
  3604 + }
  3605 + sql += " group by r.j_gh,r.xl_bm,r.cl_zbh order by r.xl_bm,r.cl_zbh";
  3606 +
  3607 + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
  3608 + @Override
  3609 + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
  3610 + Singledata sin = new Singledata();
  3611 + sin.setxL(arg0.getString("xl_bm"));
  3612 + sin.setJsy(arg0.getString("j_gh"));
  3613 + sin.setClzbh(arg0.getString("cl_zbh"));
  3614 + sin.setgS(arg0.getString("fgs_bm"));
  3615 + return sin;
  3616 + }
  3617 + });
  3618 +
  3619 +
  3620 + String linesql="";
  3621 + if(!xlbm.equals("")){
  3622 + linesql +=" and xlbm ='"+xlbm+"' ";
  3623 + }
  3624 + if(!gsdm.equals("")){
  3625 + linesql +=" and ssgsdm ='"+gsdm+"' ";
  3626 + }
  3627 + if(!fgsdm.equals("")){
  3628 + linesql +=" and fgsdm ='"+fgsdm+"' ";
  3629 + }
  3630 + /*String nysql="SELECT id,xlbm,nbbm,jsy,jzl as jzl,yh as yh,sh as sh,fgsdm FROM bsth_c_ylb"
  3631 + + " WHERE rq >= '"+startDate+"' and rq <='"+endDate+"'"
  3632 + + linesql
  3633 + + " union"
  3634 + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb"
  3635 + + " WHERE rq = '"+startDate+"' and rq <='"+endDate+"'"
  3636 + + linesql;*/
  3637 +
  3638 + String nysql="SELECT 'yh' as type,xlbm,nbbm,jsy,sum(jzl*1000)/1000 as jzl,"
  3639 + + " sum(yh*1000)/1000 as yh,"
  3640 + + " sum(sh*1000)/1000 as sh FROM "
  3641 + + "bsth_c_ylb where rq>='"+startDate+"' "
  3642 + + " and rq <='"+endDate+"' " +linesql
  3643 + + " group by xlbm ,nbbm,jsy "
  3644 + + " union SELECT 'dh' as type,xlbm,nbbm,jsy, "
  3645 + + " sum(cdl*1000)/1000 as jzl,sum(hd*1000)/1000 as yh,"
  3646 + + " sum(sh * 1000) / 1000 AS sh"
  3647 + + " FROM bsth_c_dlb where rq>='"+startDate+"' "
  3648 + + " and rq <='"+endDate+"'" +linesql
  3649 + + " group by xlbm ,nbbm,jsy" ;
  3650 +
  3651 + List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() {
  3652 + @Override
  3653 + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
  3654 + Singledata sin = new Singledata();
  3655 + sin.setxL(arg0.getString("xlbm"));
  3656 + sin.setJsy(arg0.getString("jsy"));
  3657 + sin.setClzbh(arg0.getString("nbbm"));
  3658 + sin.setJzl(arg0.getString("jzl"));
  3659 + sin.setHyl(arg0.getString("yh"));
  3660 + sin.setUnyyyl(arg0.getString("sh"));
  3661 + return sin;
  3662 + }
  3663 + });
  3664 + //统计油,电表中手动添加的或者有加注没里程的数据
  3665 + for (int i = 0; i < listNy.size(); i++) {
  3666 + Singledata sin_=listNy.get(i);
  3667 + String jsy=sin_.getJsy();
  3668 + String line=sin_.getxL();
  3669 + String clzbh=sin_.getClzbh();
  3670 + boolean fages=true;
  3671 + for (int j = 0; j < list.size(); j++) {
  3672 + Singledata sin=list.get(j);
  3673 + String jsy_=sin.getJsy();
  3674 + String line_=sin.getxL();
  3675 + String clzbh_=sin.getClzbh();
  3676 + if(jsy.equals(jsy_)
  3677 + &&line.equals(line_)
  3678 + &&clzbh.equals(clzbh_)){
  3679 + fages=false;
  3680 + }
  3681 + }
  3682 + if(fages){
  3683 + Singledata s=new Singledata();
  3684 + s.setJsy(jsy);
  3685 + s.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  3686 + s.setClzbh(clzbh);
  3687 + s.setSgh("");
  3688 + s.setsName("");
  3689 + s.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3690 + s.setxL(line);
  3691 + s.setXlmc(BasicData.lineCodeAllNameMap.get(line));
  3692 + s.setJzl(sin_.getJzl());
  3693 + s.setHyl(sin_.getHyl());
  3694 + s.setUnyyyl(sin_.getUnyyyl());
  3695 + s.setJhlc("0.0");
  3696 + s.setEmptMileage("0.0");
  3697 + s.setJhjl("0.0");
  3698 + if(startDate.equals(endDate))
  3699 + s.setrQ(startDate);
  3700 + else
  3701 + s.setrQ(startDate+"-"+endDate);
  3702 +
  3703 + list_.add(s);
  3704 + }
  3705 + }
  3706 + for (int i= 0; i < list.size(); i++) {
  3707 + Singledata sin=list.get(i);
  3708 + String jsy=sin.getJsy();
  3709 + String line=sin.getxL();
  3710 + String clzbh=sin.getClzbh();
  3711 + double jzl=0.0;
  3712 + double yh=0.0;
  3713 + double sh=0.0;
  3714 + for (int j = 0; j < listNy.size(); j++) {
  3715 + Singledata y=listNy.get(j);
  3716 + if(y.getJsy().equals(jsy)
  3717 + &&y.getClzbh().equals(clzbh)
  3718 + &&y.getxL().equals(line)){
  3719 + jzl=Arith.add(jzl, y.getJzl());
  3720 + yh=Arith.add(yh, y.getHyl());
  3721 + sh=Arith.add(sh, y.getUnyyyl());
  3722 + }
  3723 + }
  3724 + sin.setHyl(String.valueOf(yh));
  3725 + sin.setJzl(String.valueOf(jzl));
  3726 + sin.setUnyyyl(String.valueOf(sh));
  3727 +
  3728 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  3729 + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>();
  3730 + for (int j = 0; j < listReal.size(); j++) {
  3731 + ScheduleRealInfo s=listReal.get(j);
  3732 + if(s.getjGh().equals(jsy)
  3733 + && s.getClZbh().equals(clzbh)
  3734 + &&s.getXlBm().equals(line)){
  3735 + newList.add(s);
  3736 + Set<ChildTaskPlan> cts = s.getcTasks();
  3737 + if(cts != null && cts.size() > 0){
  3738 + newList_.add(s);
  3739 + }else{
  3740 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  3741 + newList_.add(s);
  3742 + }
  3743 + }
  3744 + }
  3745 + }
  3746 + double jhgl=culateMileageService.culateJhgl(newList);
  3747 + double jhjcc=culateMileageService.culateJhJccgl(newList);
  3748 + double yygl=culateMileageService.culateSjgl(newList_);
  3749 + double ljgl=culateMileageService.culateLjgl(newList_);
  3750 + double ksgl=culateMileageService.culateKsgl(newList_);
  3751 + double jcgl=culateMileageService.culateJccgl(newList_);
  3752 +
  3753 + double zyygl=Arith.add(yygl, ljgl);
  3754 + double zksgl=Arith.add(ksgl, jcgl);
  3755 + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl)));
  3756 + sin.setEmptMileage(String.valueOf(zksgl));
  3757 + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
  3758 + if(newList.size()>0){
  3759 + sin.setXlmc(newList.get(0).getXlName());
  3760 + sin.setjName(newList.get(0).getjName());
  3761 + }else{
  3762 + sin.setXlmc(BasicData.lineCodeAllNameMap.get(line));
  3763 + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  3764 +
  3765 + }
  3766 + if(startDate.equals(endDate))
  3767 + sin.setrQ(startDate);
  3768 + else
  3769 + sin.setrQ(startDate+"-"+endDate);
  3770 +// sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  3771 + sin.setSgh("");
  3772 + sin.setsName("");
  3773 + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3774 + list_.add(sin);
  3775 +
  3776 + }
  3777 + }else{
  3778 + String sql="select r.s_gh,r.s_name, "
  3779 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm"
  3780 + + " from bsth_c_s_sp_info_real r where "
  3781 + + " r.schedule_date_str >= '"+startDate+"'"
  3782 + + " schedule_date_str <='"+endDate+"'"
  3783 + + " and r.s_gh !='' and r.s_gh is not null ";
  3784 + if(!xlbm.equals("")){
  3785 + sql += " and r.xl_bm = '"+xlbm+"'";
  3786 + }
  3787 + if(!gsdm.equals("")){
  3788 + sql += " and r.gs_bm = '"+gsdm+"'";
  3789 + }
  3790 + if(!fgsdm.equals("")){
  3791 + sql += " and r.fgs_bm = '"+fgsdm+"'";
  3792 + }
  3793 + sql += " group by r.s_gh,r.s_name,"
  3794 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
  3795 +
  3796 + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
  3797 + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  3798 + @Override
  3799 + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
  3800 + Singledata sin = new Singledata();
  3801 +// sin.setrQ(startDate);
  3802 + sin.setxL(arg0.getString("xl_bm"));
  3803 + sin.setClzbh(arg0.getString("cl_zbh"));
  3804 + sin.setSgh(arg0.getString("s_gh"));
  3805 + sin.setsName(arg0.getString("s_name"));
  3806 + sin.setgS(arg0.getString("fgs_bm"));
  3807 + return sin;
  3808 + }
  3809 + });
  3810 +
  3811 + String spy="";
  3812 + if(map.get("map")!=null){
  3813 + spy=map.get("spy").toString();
  3814 + }
  3815 + for (int i = 0; i < list.size(); i++) {
  3816 + Singledata sin=list.get(i);
  3817 + sin.setrQ(startDate+"-"+endDate);
  3818 + String jsy=sin.getSgh();
  3819 + String line=sin.getxL();
  3820 + String clzbh=sin.getClzbh();
  3821 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  3822 + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>();
  3823 +
  3824 + for (int j = 0; j < listReal.size(); j++) {
  3825 + ScheduleRealInfo s=listReal.get(j);
  3826 + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh)
  3827 + &&s.getXlBm().equals(line)){
  3828 + newList.add(s);
  3829 + Set<ChildTaskPlan> cts = s.getcTasks();
  3830 + if(cts != null && cts.size() > 0){
  3831 + newList_.add(s);
  3832 + }else{
  3833 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  3834 + newList_.add(s);
  3835 + }
  3836 + }
  3837 + }
  3838 + }
  3839 + double jhgl=culateMileageService.culateJhgl(newList);;
  3840 + double jhjcc=culateMileageService.culateJhJccgl(newList);
  3841 + double yygl=0.0;
  3842 + double ljgl=0.0;
  3843 + double zksgl=0.0;
  3844 + if(spy.equals("zrw")){
  3845 + yygl=culateMileageService.culateSjgl_spy(newList_);
  3846 + ljgl=culateMileageService.culateLjgl_spy(newList_);
  3847 + zksgl=culateMileageService.culateSjfyylc_spy(newList_);
  3848 + }else{
  3849 + yygl=culateMileageService.culateSjgl(newList_);
  3850 + ljgl=culateMileageService.culateLjgl(newList_);
  3851 + double ksgl=culateMileageService.culateKsgl(newList_);
  3852 + double jcgl=culateMileageService.culateJccgl(newList_);
  3853 + zksgl=Arith.add(ksgl, jcgl);
  3854 + }
  3855 + double zyygl=Arith.add(yygl, ljgl);
  3856 + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl)));
  3857 + sin.setEmptMileage(String.valueOf(zksgl));
  3858 + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
  3859 + if(newList.size()>0)
  3860 + sin.setXlmc(newList.get(0).getXlName());
  3861 + else
  3862 + sin.setXlmc(BasicData.lineCodeAllNameMap.get(line));
  3863 + sin.setClzbh(clzbh);
  3864 + sin.setJsy("");
  3865 + sin.setjName("");
  3866 + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3867 + sin.setHyl("");
  3868 + sin.setJzl("");
  3869 + sin.setUnyyyl("");
  3870 + list_.add(sin);
  3871 + }
  3872 + }
  3873 +
  3874 + /*Map<String, Boolean> lineNature = lineService.lineNature();
  3875 + List<Singledata> resList = new ArrayList<Singledata>();
  3876 + for(Singledata s : list_){
  3877 + String xlBm = s.getxL();
  3878 + if(sfyy.length() != 0){
  3879 + if(sfyy.equals("0")){
  3880 + resList.add(s);
  3881 + } else if(sfyy.equals("1")){
  3882 + if(lineNature.containsKey(xlBm) && lineNature.get(xlBm)){
  3883 + resList.add(s);
  3884 + }
  3885 + } else {
  3886 + if(lineNature.containsKey(xlBm) && !lineNature.get(xlBm)){
  3887 + resList.add(s);
  3888 + }
  3889 + }
  3890 + } else {
  3891 + resList.add(s);
  3892 + }
  3893 + }*/
  3894 +
  3895 +
  3896 + if (type.equals("export")) {
  3897 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  3898 + ReportUtils ee = new ReportUtils();
  3899 +
  3900 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  3901 + int i = 1;
  3902 + for (Singledata l : list_) {
  3903 + Map<String, Object> m = new HashMap<String, Object>();
  3904 + m.put("i", i);
  3905 + m.put("rQ", l.getrQ());
  3906 + m.put("gS", l.getgS());
  3907 + m.put("xL", l.getXlmc());
  3908 + m.put("clzbh", l.getClzbh());
  3909 + m.put("jsy", l.getJsy());
  3910 + m.put("jName", l.getjName());
  3911 + m.put("sgh", l.getSgh());
  3912 + m.put("sName", l.getsName());
  3913 + m.put("jhlc", l.getJhlc());
  3914 + m.put("emptMileage", l.getEmptMileage());
  3915 + m.put("hyl", l.getHyl());
  3916 + m.put("jzl", l.getJzl());
  3917 + m.put("unyyyl", l.getUnyyyl());
  3918 + m.put("jhjl", l.getJhjl());
  3919 + resList.add(m);
  3920 +
  3921 + i++;
  3922 + }
  3923 +
  3924 + listI.add(resList.iterator());
  3925 + try {
  3926 + String exportDate="";
  3927 + if(startDate.equals(endDate)){
  3928 + exportDate =sdfSimple.format(sdfMonth.parse(startDate)) ;
  3929 + }else{
  3930 + exportDate =sdfSimple.format(sdfMonth.parse(startDate))+"-"+sdfSimple.format(sdfMonth.parse(endDate)) ;
  3931 + }
  3932 + String lineName = "";
  3933 + if(map.containsKey("lineName"))
  3934 + lineName = map.get("lineName").toString();
  3935 +
  3936 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  3937 + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls",
  3938 + path + "export/" +exportDate
  3939 + + "-" + lineName + "-路单统计.xls");
  3940 + } catch (ParseException e) {
  3941 + e.printStackTrace();
  3942 + }
  3943 + }
  3944 + return list_;
  3945 + }
3552 3946  
3553 3947  
3554 3948 }
... ...
src/main/resources/static/index.html
... ... @@ -632,6 +632,7 @@
632 632 data-exclude=1></script>
633 633 <!-- echarts4 误删 -->
634 634 <script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script>
  635 +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script>
635 636  
636 637 </body>
637 638 </html>
638 639 \ No newline at end of file
... ...
src/main/resources/static/pages/electricity/list/list.html
... ... @@ -183,7 +183,11 @@
183 183 {{obj.gsname}}
184 184 </td>
185 185 <td>
186   - {{obj.xlname}}
  186 + {{if obj.linename=='' || obj.linename==null}}
  187 + {{obj.xlname}}
  188 + {{else}}
  189 + {{obj.linename}}
  190 + {{/if}}
187 191 </td>
188 192 <td>
189 193 <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable>
... ... @@ -194,7 +198,11 @@
194 198 <input data-id="{{obj.id}}" style=" width:100%" type="text" class="in_carpark_jsy" ></input>
195 199 <button class="btn btn-sm blue btn-jsyUpdate" style=" width:100%" data-id="{{obj.id}}">填写工号</button>
196 200 {{else}}
197   - {{obj.jsy}}/{{obj.name}}
  201 + {{if obj.jname=='' || obj.jname==null}}
  202 + {{obj.jsy}}/{{obj.name}}
  203 + {{else}}
  204 + {{obj.jsy}}/{{obj.jname}}
  205 + {{/if}}
198 206 {{/if}}
199 207 </td>
200 208 <td>
... ...
src/main/resources/static/pages/mforms/singledatas/singledata_date.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px;
  14 + text-align: center; }
  15 +
  16 + .table > tbody + tbody {
  17 + border-top: 1px solid; }
  18 +</style>
  19 +
  20 +<div class="page-head">
  21 + <div class="page-title">
  22 + <h1>路单统计</h1>
  23 + </div>
  24 +</div>
  25 +
  26 +<div class="row">
  27 + <div class="col-md-12">
  28 + <div class="portlet light porttlet-fit bordered">
  29 + <div class="portlet-title">
  30 + <form class="form-inline" action="">
  31 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_sing">
  32 + <span class="item-label" style="width: 140px;">&nbsp;&nbsp;&nbsp;&nbsp;
  33 + &nbsp;
  34 + 公司: </span>
  35 + <select class="form-control" name="company" id="gsdmSing" style="width: 140px;"></select>
  36 + </div>
  37 + <div style="display: inline-block; margin-left: 10px;" id="fgsdmDiv_sing">
  38 + <span class="item-label" style="width: 140px;">&nbsp;&nbsp;&nbsp;&nbsp;分公司: </span>
  39 + <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
  40 + </div>
  41 + <div style="display: inline-block; margin-left: 15px;">
  42 + <span class="item-label" style="width: 80px;">线路: </span>
  43 + <select class="form-control" name="line" id="line" style="width: 140px;"></select>
  44 + </div>
  45 + <div style="margin-top: 10px"></div>
  46 +
  47 + <div style="display: inline-block;margin-left: 33px;">
  48 + <span class="item-label" style="width: 140px;">开始时间: </span>
  49 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
  50 + </div>
  51 + <div style="display: inline-block;margin-left: 15px;">
  52 + <span class="item-label" style="width: 140px;">结束时间: </span>
  53 + <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
  54 + </div>
  55 +
  56 + <div style="display: inline-block;margin-left: 15px">
  57 + <span class="item-label" style="width: 150px;">统计: </span>
  58 + <select class="form-control" name="tjtype" id="tjtype" style="width: 140px;">
  59 + <option value="jsy">驾驶员</option>
  60 + <option value="spy">售票员</option>
  61 + </select>
  62 +
  63 + </div>
  64 + <div class="form-group">
  65 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  66 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  67 + </div>
  68 + </form>
  69 + </div>
  70 + <div class="portlet-body">
  71 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  72 + <table class="table table-bordered table-hover table-checkable" id="forms">
  73 + <thead>
  74 + <tr>
  75 + <th>序号</th>
  76 + <th>日期</th>
  77 + <th>所属公司</th>
  78 + <th>线路</th>
  79 + <th>车号</th>
  80 + <th>司机职号</th>
  81 + <th>司机姓名</th>
  82 + <th>售票员职号</th>
  83 + <th>售票员姓名</th>
  84 + <th>行驶里程(包括空放)</th>
  85 + <th>空驶里程</th>
  86 + <th>耗油量</th>
  87 + <th>加注量</th>
  88 + <th>非营业用油</th>
  89 + <th>计划公里</th>
  90 + </tr>
  91 + </thead>
  92 + <tbody>
  93 +
  94 + </tbody>
  95 + </table>
  96 + </div>
  97 + </div>
  98 + </div>
  99 + </div>
  100 +</div>
  101 +
  102 +<script>
  103 + $(function(){
  104 + // 关闭左侧栏
  105 + if (!$('body').hasClass('page-sidebar-closed'))
  106 + $('.menu-toggler.sidebar-toggler').click();
  107 +
  108 + $("#startDate,#endDate").datetimepicker({
  109 + format : 'YYYY-MM-DD',
  110 + locale : 'zh-cn'
  111 + });
  112 + var d = new Date();
  113 + var year = d.getFullYear();
  114 + var month = d.getMonth() + 1;
  115 + var day = d.getDate();
  116 + if(month < 10)
  117 + month = "0" + month;
  118 + if(day < 10)
  119 + day = "0" + day;
  120 + $("#startDate").val(year + "-" + month + "-" + day);
  121 + $("#endDate").val(year + "-" + month + "-" + day);
  122 +
  123 +
  124 + var fage=false;
  125 + var xlList;
  126 + var obj = [];
  127 +
  128 + $.get('/report/lineList',function(result){
  129 + xlList=result;
  130 + $.get('/user/companyData', function(result){
  131 + obj = result;
  132 + var options = '';
  133 + for(var i = 0; i < obj.length; i++){
  134 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  135 + }
  136 +
  137 + if(obj.length ==0){
  138 + $("#gsdmDiv_sing").css('display','none');
  139 + }else if(obj.length ==1){
  140 + $("#gsdmDiv_sing").css('display','none');
  141 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  142 + $('#fgsdmDiv_sing').css('display','none');
  143 + }
  144 + $('#gsdmSing').html(options);
  145 + updateCompany();
  146 + });
  147 + })
  148 + $("#gsdmSing").on("change",updateCompany);
  149 + function updateCompany(){
  150 + var company = $('#gsdmSing').val();
  151 + var options ='';
  152 +// var options = '<option value="">全部分公司</option>';
  153 + for(var i = 0; i < obj.length; i++){
  154 + if(obj[i].companyCode == company){
  155 + var children = obj[i].children;
  156 + for(var j = 0; j < children.length; j++){
  157 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  158 + }
  159 + }
  160 + }
  161 + $('#fgsdmSing').html(options);
  162 + }
  163 +
  164 + var tempData = {};
  165 + $.get('/report/lineList',function(xlList){
  166 + var data = [];
  167 + data.push({id: " ", text: "全部线路"});
  168 + $.get('/user/companyData', function(result){
  169 + for(var i = 0; i < result.length; i++){
  170 + var companyCode = result[i].companyCode;
  171 + var children = result[i].children;
  172 + for(var j = 0; j < children.length; j++){
  173 + var code = children[j].code;
  174 + for(var k=0;k < xlList.length;k++ ){
  175 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  176 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  177 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  178 + }
  179 + }
  180 + }
  181 + }
  182 + initPinYinSelect2('#line',data,'');
  183 +
  184 + });
  185 + });
  186 +
  187 + $("#line").on("change", function(){
  188 + if($("#line").val() == " "){
  189 + $("#gsdmSing").attr("disabled", false);
  190 + $("#fgsdmSing").attr("disabled", false);
  191 + } else {
  192 + var temp = tempData[$("#line").val()].split(":");
  193 + $("#gsdmSing").val(temp[0]);
  194 + updateCompany();
  195 + $("#fgsdmSing").val(temp[1]);
  196 +// $("#fgsdmSing").val("");
  197 + $("#gsdmSing").attr("disabled", true);
  198 + $("#fgsdmSing").attr("disabled", true);
  199 + }
  200 + });
  201 +
  202 +
  203 + $("#query").on("click",function(){
  204 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  205 + layer.msg("请选择时间!");
  206 + return;
  207 + }
  208 + var i = layer.load(2);
  209 + var params = {};
  210 + params['sfyy'] = $("#sfyy").val();
  211 + params['gsdmSing'] = $("#gsdmSing").val();
  212 + params['fgsdmSing'] = $("#fgsdmSing").val();
  213 + params['line'] = $("#line").val();
  214 + params['startDate'] = $("#startDate").val();
  215 + params['endDate'] = $("#endDate").val();
  216 + params['lpName'] = $("#lpName").val();
  217 + params['tjtype'] = $("#tjtype").val();
  218 + params['spy'] = "zrw";
  219 +
  220 + $get("/report/singledatatj",params,function(result){
  221 + layer.close(i);
  222 + var singledata = template('singledata',{list:result});
  223 + // 把渲染好的模版html文本追加到表格中
  224 + $('#forms tbody').html(singledata);
  225 +
  226 + });
  227 +
  228 + });
  229 +
  230 + $("#export").on("click",function(){
  231 + var params = {};
  232 + params['sfyy'] = $("#sfyy").val();
  233 + params['gsdmSing'] = $("#gsdmSing").val();
  234 + params['fgsdmSing'] = $("#fgsdmSing").val();
  235 + params['line'] = $("#line").val();
  236 + params['startDate'] = $("#startDate").val();
  237 + params['endDate'] = $("#endDate").val();
  238 + params['lpName'] = $("#lpName").val();
  239 + params['tjtype'] = $("#tjtype").val();
  240 + params['spy'] = "zrw";
  241 + var lineName = $('#line option:selected').text();
  242 + if(lineName == "全部线路")
  243 + lineName = $('#fgsdmSing option:selected').text();
  244 +
  245 + params['lineName'] =lineName;
  246 + params['type'] ='export';
  247 + var i = layer.load(2);
  248 + $get('/report/singledatatj',params,function(result){
  249 + var exportDate="";
  250 + if( $("#startDate").val()==$("#endDate").val()){
  251 + exportDate=moment($("#startDate").val()).format("YYYYMMDD");
  252 + }else{
  253 + exportDate=moment($("#startDate").val()).format("YYYYMMDD")
  254 + +"-"+moment($("#endDate").val()).format("YYYYMMDD");
  255 +
  256 + }
  257 + console.log("exportDate:"+exportDate);
  258 + window.open("/downloadFile/download?fileName="
  259 + +exportDate
  260 + +"-"+lineName+"-路单统计");
  261 + layer.close(i);
  262 + });
  263 +
  264 + });
  265 + });
  266 +</script>
  267 +<script type="text/html" id="singledata">
  268 + {{each list as obj i}}
  269 + <tr>
  270 + <td>{{i+1}}</td>
  271 + <td>{{obj.rQ}}</td>
  272 + <td>{{obj.gS}}</td>
  273 + <td>{{obj.xlmc}}</td>
  274 + <td>{{obj.clzbh}}</td>
  275 + <td>{{obj.jsy}}</td>
  276 + <td>{{obj.jName}}</td>
  277 + <td>{{obj.sgh}}</td>
  278 + <td>{{obj.sName}}</td>
  279 + <td>{{obj.jhlc}}</td>
  280 + <td>{{obj.emptMileage}}</td>
  281 + <td>{{obj.hyl}}</td>
  282 + <td>{{obj.jzl}}</td>
  283 + <td>{{obj.unyyyl}}</td>
  284 + <td>{{obj.jhjl}}</td>
  285 + </tr>
  286 + {{/each}}
  287 + {{if list.length == 0}}
  288 + <tr>
  289 + <td colspan="16"><h6 class="muted">没有找到相关数据</h6></td>
  290 + </tr>
  291 + {{/if}}
  292 +</script>
  293 +<script type="text/html" id="singledata2">
  294 + {{each list as obj i}}
  295 + <tr>
  296 + <td>{{i+1}}</td>
  297 + <td>{{obj.rQ}}</td>
  298 + <td>{{obj.gS}}</td>
  299 + <td>{{obj.xlmc}}</td>
  300 + <td>{{obj.clzbh}}</td>
  301 + <td></td>
  302 + <td></td>
  303 + <td>{{obj.sgh}}</td>
  304 + <td>{{obj.sName}}</td>
  305 + <td>{{obj.jhlc}}</td>
  306 + <td>{{obj.emptMileage}}</td>
  307 + <td></td>
  308 + <td></td>
  309 + <td></td>
  310 + <td>{{obj.jhjl}}</td>
  311 + </tr>
  312 + {{/each}}
  313 + {{if list.length == 0}}
  314 + <tr>
  315 + <td colspan="16"><h6 class="muted">没有找到相关数据</h6></td>
  316 + </tr>
  317 + {{/if}}
  318 +</script>
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -242,7 +242,12 @@
242 242 {{obj.fgsname}}
243 243 </td>
244 244 <td width="8%">
245   - {{obj.xlname}}
  245 + {{if obj.linename=='' || obj.linename==null}}
  246 + {{obj.xlname}}
  247 + {{else}}
  248 + {{obj.linename}}
  249 + {{/if}}
  250 +
246 251 </td>
247 252 <td width="5%">
248 253 <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable>
... ... @@ -253,7 +258,11 @@
253 258 <input data-id="{{obj.id}}" style=" width:100%" type="text" class="in_carpark_jsy" ></input>
254 259 <button class="btn btn-sm blue btn-jsyUpdate" style=" width:100%" data-id="{{obj.id}}">填写工号</button>
255 260 {{else}}
256   - {{obj.jsy}}/{{obj.name}}
  261 + {{if obj.jname=='' || obj.jname==null}}
  262 + {{obj.jsy}}/{{obj.name}}
  263 + {{else}}
  264 + {{obj.jsy}}/{{obj.jname}}
  265 + {{/if}}
257 266 {{/if}}
258 267  
259 268 </td>
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/editor.html
... ... @@ -374,7 +374,7 @@
374 374 $('[name=bcType]', f).trigger('change');
375 375 }
376 376  
377   -
  377 +
378 378 function initScheduleTypeChange(f, cb) {
379 379 (function (f, cb) {
380 380 $('[name=bcType]', f).on('change', function () {
... ... @@ -396,7 +396,8 @@
396 396 var time, mileage;
397 397 switch (bcType_e.val()) {
398 398 case 'out':
399   - qdz.html(park_opts).val(information.carPark);
  399 + if (gb_sch && gb_sch.qdzCode) qdz.html(park_opts).val(gb_sch.qdzCode);
  400 + else qdz.html(park_opts).val(information.carPark);
400 401 zdz.html(opts);
401 402 //出场结束时间
402 403 time = updown == 0 ? information.upOutTimer : information.downOutTimer;
... ... @@ -404,7 +405,8 @@
404 405 break;
405 406 case 'in':
406 407 qdz.html(opts);
407   - zdz.html(park_opts).val(information.carPark);
  408 + if (gb_sch && gb_sch.zdzCode) zdz.html(park_opts).val(gb_sch.zdzCode);
  409 + else zdz.html(park_opts).val(information.carPark);
408 410 //进场结束时间
409 411 time = updown == 0 ? information.upInTimer : information.downInTimer;
410 412 mileage = updown == 0 ? information.upInMileage : information.downInMileage;
... ...