Commit 60a6ff302d40e7dd5d7bf53f5cd6f56d442adf0b

Authored by sgz
1 parent 35a6161f

异常报表修改

src/main/java/com/bsth/entity/excep/Offline.java
@@ -6,6 +6,7 @@ import javax.persistence.Entity; @@ -6,6 +6,7 @@ import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue; 6 import javax.persistence.GeneratedValue;
7 import javax.persistence.Id; 7 import javax.persistence.Id;
8 import javax.persistence.Table; 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10
10 /** 11 /**
11 * 掉线 12 * 掉线
@@ -65,7 +66,12 @@ public class Offline { @@ -65,7 +66,12 @@ public class Offline {
65 */ 66 */
66 private Date createDate; 67 private Date createDate;
67 68
68 - 69 + @Transient
  70 + private String nbbm;
  71 + @Transient
  72 + private String jsy;
  73 + @Transient
  74 + private String lpname;
69 public Integer getId() { 75 public Integer getId() {
70 return id; 76 return id;
71 } 77 }
@@ -146,5 +152,29 @@ public class Offline { @@ -146,5 +152,29 @@ public class Offline {
146 this.timestampDate = timestampDate; 152 this.timestampDate = timestampDate;
147 } 153 }
148 154
  155 + public String getNbbm() {
  156 + return nbbm;
  157 + }
  158 +
  159 + public void setNbbm(String nbbm) {
  160 + this.nbbm = nbbm;
  161 + }
149 162
  163 + public String getJsy() {
  164 + return jsy;
  165 + }
  166 +
  167 + public void setJsy(String jsy) {
  168 + this.jsy = jsy;
  169 + }
  170 +
  171 + public String getLpname() {
  172 + return lpname;
  173 + }
  174 +
  175 + public void setLpname(String lpname) {
  176 + this.lpname = lpname;
  177 + }
  178 +
  179 +
150 } 180 }
src/main/java/com/bsth/entity/excep/Outbound.java
@@ -6,6 +6,7 @@ import javax.persistence.Entity; @@ -6,6 +6,7 @@ import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue; 6 import javax.persistence.GeneratedValue;
7 import javax.persistence.Id; 7 import javax.persistence.Id;
8 import javax.persistence.Table; 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10
10 /** 11 /**
11 * 越界 12 * 越界
@@ -72,7 +73,12 @@ public class Outbound { @@ -72,7 +73,12 @@ public class Outbound {
72 * 时间 73 * 时间
73 */ 74 */
74 private Date createDate; 75 private Date createDate;
75 - 76 + @Transient
  77 + private String nbbm;
  78 + @Transient
  79 + private String jsy;
  80 + @Transient
  81 + private String lpname;
76 82
77 public Integer getId() { 83 public Integer getId() {
78 return id; 84 return id;
@@ -162,5 +168,29 @@ public class Outbound { @@ -162,5 +168,29 @@ public class Outbound {
162 this.timestampDate = timestampDate; 168 this.timestampDate = timestampDate;
163 } 169 }
164 170
  171 + public String getNbbm() {
  172 + return nbbm;
  173 + }
  174 +
  175 + public void setNbbm(String nbbm) {
  176 + this.nbbm = nbbm;
  177 + }
  178 +
  179 + public String getJsy() {
  180 + return jsy;
  181 + }
  182 +
  183 + public void setJsy(String jsy) {
  184 + this.jsy = jsy;
  185 + }
  186 +
  187 + public String getLpname() {
  188 + return lpname;
  189 + }
  190 +
  191 + public void setLpname(String lpname) {
  192 + this.lpname = lpname;
  193 + }
  194 +
165 195
166 } 196 }
src/main/java/com/bsth/entity/excep/Speeding.java
@@ -6,6 +6,7 @@ import javax.persistence.Entity; @@ -6,6 +6,7 @@ import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue; 6 import javax.persistence.GeneratedValue;
7 import javax.persistence.Id; 7 import javax.persistence.Id;
8 import javax.persistence.Table; 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10
10 /** 11 /**
11 * 超速 12 * 超速
@@ -66,6 +67,13 @@ public class Speeding { @@ -66,6 +67,13 @@ public class Speeding {
66 private String timestampDate; 67 private String timestampDate;
67 68
68 69
  70 + @Transient
  71 + private String nbbm;
  72 + @Transient
  73 + private String jsy;
  74 + @Transient
  75 + private String lpname;
  76 +
69 /** 77 /**
70 * 创建时间 78 * 创建时间
71 */ 79 */
@@ -161,6 +169,30 @@ public class Speeding { @@ -161,6 +169,30 @@ public class Speeding {
161 this.timestampDate = timestampDate; 169 this.timestampDate = timestampDate;
162 } 170 }
163 171
  172 + public String getNbbm() {
  173 + return nbbm;
  174 + }
  175 +
  176 + public void setNbbm(String nbbm) {
  177 + this.nbbm = nbbm;
  178 + }
  179 +
  180 + public String getJsy() {
  181 + return jsy;
  182 + }
  183 +
  184 + public void setJsy(String jsy) {
  185 + this.jsy = jsy;
  186 + }
  187 +
  188 + public String getLpname() {
  189 + return lpname;
  190 + }
  191 +
  192 + public void setLpname(String lpname) {
  193 + this.lpname = lpname;
  194 + }
  195 +
164 196
165 197
166 } 198 }
src/main/java/com/bsth/service/excep/impl/OfflineServiceImpl.java
@@ -12,10 +12,15 @@ import java.util.HashMap; @@ -12,10 +12,15 @@ import java.util.HashMap;
12 import java.util.List; 12 import java.util.List;
13 import java.util.Map; 13 import java.util.Map;
14 14
  15 +import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.jdbc.core.JdbcTemplate;
  17 +import org.springframework.jdbc.core.RowMapper;
15 import org.springframework.stereotype.Service; 18 import org.springframework.stereotype.Service;
16 19
17 import com.bsth.data.BasicData; 20 import com.bsth.data.BasicData;
18 import com.bsth.entity.excep.Offline; 21 import com.bsth.entity.excep.Offline;
  22 +import com.bsth.entity.oil.Ylb;
  23 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
19 import com.bsth.service.excep.OfflineService; 24 import com.bsth.service.excep.OfflineService;
20 import com.bsth.util.EchartConver; 25 import com.bsth.util.EchartConver;
21 import com.bsth.util.PageHelper; 26 import com.bsth.util.PageHelper;
@@ -27,6 +32,8 @@ import com.google.gson.Gson; @@ -27,6 +32,8 @@ import com.google.gson.Gson;
27 @Service 32 @Service
28 public class OfflineServiceImpl implements OfflineService { 33 public class OfflineServiceImpl implements OfflineService {
29 34
  35 + @Autowired
  36 + JdbcTemplate jdbcTemplate;
30 // @Override 37 // @Override
31 static List<Offline> findAll(Map<String, Object> map) { 38 static List<Offline> findAll(Map<String, Object> map) {
32 // TODO Auto-generated method stub 39 // TODO Auto-generated method stub
@@ -53,7 +60,9 @@ public class OfflineServiceImpl implements OfflineService { @@ -53,7 +60,9 @@ public class OfflineServiceImpl implements OfflineService {
53 } 60 }
54 61
55 if(nbbm!=null){ 62 if(nbbm!=null){
56 - sql +=" and vehicle like '%"+nbbm.toString()+"%'"; 63 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  64 + if(nbbm!=null)
  65 + sql +=" and vehicle like '%"+nbbm+"%'";
57 } 66 }
58 67
59 if(updown!=null){ 68 if(updown!=null){
@@ -61,7 +70,7 @@ public class OfflineServiceImpl implements OfflineService { @@ -61,7 +70,7 @@ public class OfflineServiceImpl implements OfflineService {
61 } 70 }
62 if(date!=null){ 71 if(date!=null){
63 if (date.toString().length()>0) { 72 if (date.toString().length()>0) {
64 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); 73 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
65 try { 74 try {
66 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); 75 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
67 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); 76 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
@@ -112,7 +121,7 @@ public class OfflineServiceImpl implements OfflineService { @@ -112,7 +121,7 @@ public class OfflineServiceImpl implements OfflineService {
112 offline.setTimestamp(Long.valueOf(rs.getObject("timestamp").toString())); 121 offline.setTimestamp(Long.valueOf(rs.getObject("timestamp").toString()));
113 offline.setTimestampDate(sdf.format(new Date(offline.getTimestamp()))); 122 offline.setTimestampDate(sdf.format(new Date(offline.getTimestamp())));
114 offline.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); 123 offline.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
115 - offline.setVehicle(rs.getObject("vehicle").toString()); 124 + offline.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
116 list.add(offline); 125 list.add(offline);
117 } 126 }
118 return list; 127 return list;
@@ -135,7 +144,9 @@ public class OfflineServiceImpl implements OfflineService { @@ -135,7 +144,9 @@ public class OfflineServiceImpl implements OfflineService {
135 } 144 }
136 145
137 if(nbbm!=null){ 146 if(nbbm!=null){
138 - sql +=" and vehicle like '%"+nbbm.toString()+"%'"; 147 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  148 + if(nbbm!=null)
  149 + sql +=" and vehicle like '%"+nbbm+"%'";
139 } 150 }
140 151
141 if(updown!=null){ 152 if(updown!=null){
@@ -143,7 +154,7 @@ public class OfflineServiceImpl implements OfflineService { @@ -143,7 +154,7 @@ public class OfflineServiceImpl implements OfflineService {
143 } 154 }
144 if(date!=null){ 155 if(date!=null){
145 if (date.toString().length()>0) { 156 if (date.toString().length()>0) {
146 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); 157 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
147 try { 158 try {
148 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); 159 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
149 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); 160 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
@@ -177,8 +188,41 @@ public class OfflineServiceImpl implements OfflineService { @@ -177,8 +188,41 @@ public class OfflineServiceImpl implements OfflineService {
177 PageHelper pageHelper = new PageHelper(totalData, map); 188 PageHelper pageHelper = new PageHelper(totalData, map);
178 // List<T> list = this.baseDao.queryByObject(pageHelper.getMap()); 189 // List<T> list = this.baseDao.queryByObject(pageHelper.getMap());
179 List<Offline> list=findAll(pageHelper.getMap()); 190 List<Offline> list=findAll(pageHelper.getMap());
  191 + for (int i = 0; i < list.size(); i++) {
  192 + String nbbm2=list.get(i).getVehicle() ;
  193 + Long d1=list.get(i).getTimestamp();
  194 + Date datess = new Date(d1);
  195 + String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
  196 + String sk=new SimpleDateFormat("HH:mm").format(datess);
  197 + String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  198 + + " real_exec_date='"+dates+"' ";
  199 +// + "and fcsj_actual > '"+sk+"' ";
  200 +// + "and '"+sk+"' <dfsj";
  201 + List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
  202 + new RowMapper<ScheduleRealInfo>(){
  203 + @Override
  204 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  205 + ScheduleRealInfo s = new ScheduleRealInfo();
  206 + s.setjGh(rs.getString("j_gh"));
  207 + s.setjName(rs.getString("j_name"));
  208 + s.setLpName(rs.getString("lp_name"));
  209 + return s;
  210 + }
  211 + });
  212 + if(pbb.size()>0){
  213 + list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());
  214 + list.get(i).setLpname(pbb.get(0).getLpName());
  215 +
  216 + }
  217 +
  218 + }
180 PageObject<Offline> pageObject = pageHelper.getPageObject(); 219 PageObject<Offline> pageObject = pageHelper.getPageObject();
181 - pageObject.setDataList(list); 220 +// for (int i = 0; i < list.size(); i++) {
  221 +// if(list.get(i).getLpname()!=null){
  222 + pageObject.setDataList(list);
  223 +// }
  224 +// }
  225 +
182 return pageObject; 226 return pageObject;
183 } 227 }
184 public static void main(String[] args) { 228 public static void main(String[] args) {
src/main/java/com/bsth/service/excep/impl/OutboundServiceImpl.java
@@ -12,10 +12,14 @@ import java.util.HashMap; @@ -12,10 +12,14 @@ import java.util.HashMap;
12 import java.util.List; 12 import java.util.List;
13 import java.util.Map; 13 import java.util.Map;
14 14
  15 +import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.jdbc.core.JdbcTemplate;
  17 +import org.springframework.jdbc.core.RowMapper;
15 import org.springframework.stereotype.Service; 18 import org.springframework.stereotype.Service;
16 19
17 import com.bsth.data.BasicData; 20 import com.bsth.data.BasicData;
18 import com.bsth.entity.excep.Outbound; 21 import com.bsth.entity.excep.Outbound;
  22 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
19 import com.bsth.service.excep.OutboundService; 23 import com.bsth.service.excep.OutboundService;
20 import com.bsth.util.EchartConver; 24 import com.bsth.util.EchartConver;
21 import com.bsth.util.PageHelper; 25 import com.bsth.util.PageHelper;
@@ -25,8 +29,9 @@ import com.github.abel533.echarts.Option; @@ -25,8 +29,9 @@ import com.github.abel533.echarts.Option;
25 import com.google.gson.Gson; 29 import com.google.gson.Gson;
26 @Service 30 @Service
27 public class OutboundServiceImpl implements OutboundService{ 31 public class OutboundServiceImpl implements OutboundService{
28 -  
29 - static List<Outbound> findAll(Map<String, Object> map) { 32 + @Autowired
  33 + JdbcTemplate jdbcTemplate;
  34 + static List<Outbound> findAll(Map<String, Object> map) {
30 Connection conn = null; 35 Connection conn = null;
31 PreparedStatement ps = null; 36 PreparedStatement ps = null;
32 ResultSet rs = null; 37 ResultSet rs = null;
@@ -37,12 +42,13 @@ public class OutboundServiceImpl implements OutboundService{ @@ -37,12 +42,13 @@ public class OutboundServiceImpl implements OutboundService{
37 Object nbbm=map.get("nbbm"); 42 Object nbbm=map.get("nbbm");
38 Object updown=map.get("updown"); 43 Object updown=map.get("updown");
39 Object date=map.get("date"); 44 Object date=map.get("date");
40 -  
41 if(line!=null){ 45 if(line!=null){
42 sql +=" and line like'%"+line.toString()+"%'"; 46 sql +=" and line like'%"+line.toString()+"%'";
43 } 47 }
44 48
45 if(nbbm!=null){ 49 if(nbbm!=null){
  50 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  51 + if(nbbm!=null)
46 sql +=" and vehicle like '%"+nbbm.toString()+"%'"; 52 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
47 } 53 }
48 54
@@ -51,7 +57,7 @@ public class OutboundServiceImpl implements OutboundService{ @@ -51,7 +57,7 @@ public class OutboundServiceImpl implements OutboundService{
51 } 57 }
52 if(date!=null){ 58 if(date!=null){
53 if (date.toString().length()>0) { 59 if (date.toString().length()>0) {
54 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); 60 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
55 try { 61 try {
56 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); 62 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
57 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); 63 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
@@ -98,7 +104,7 @@ public class OutboundServiceImpl implements OutboundService{ @@ -98,7 +104,7 @@ public class OutboundServiceImpl implements OutboundService{
98 outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); 104 outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
99 outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); 105 outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp())));
100 outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); 106 outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
101 - outbound.setVehicle(rs.getObject("vehicle").toString()); 107 + outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
102 outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString()); 108 outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString());
103 list.add(outbound); 109 list.add(outbound);
104 } 110 }
@@ -119,6 +125,8 @@ public class OutboundServiceImpl implements OutboundService{ @@ -119,6 +125,8 @@ public class OutboundServiceImpl implements OutboundService{
119 } 125 }
120 126
121 if(nbbm!=null){ 127 if(nbbm!=null){
  128 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  129 + if(nbbm!=null)
122 sql +=" and vehicle like '%"+nbbm.toString()+"%'"; 130 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
123 } 131 }
124 132
@@ -160,7 +168,34 @@ public class OutboundServiceImpl implements OutboundService{ @@ -160,7 +168,34 @@ public class OutboundServiceImpl implements OutboundService{
160 168
161 PageHelper pageHelper = new PageHelper(totalData, map); 169 PageHelper pageHelper = new PageHelper(totalData, map);
162 List<Outbound> list=findAll(pageHelper.getMap()); 170 List<Outbound> list=findAll(pageHelper.getMap());
163 - 171 + for (int i = 0; i < list.size(); i++) {
  172 + String nbbm2=list.get(i).getVehicle() ;
  173 + Long d1=list.get(i).getTimestamp();
  174 + Date datess = new Date(d1);
  175 + String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
  176 + String sk=new SimpleDateFormat("HH:mm").format(datess);
  177 + String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  178 + + " real_exec_date='"+dates+"' ";
  179 +// + "and fcsj_actual > '"+sk+"' ";
  180 +// + "and '"+sk+"' <dfsj";
  181 + List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
  182 + new RowMapper<ScheduleRealInfo>(){
  183 + @Override
  184 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  185 + ScheduleRealInfo s = new ScheduleRealInfo();
  186 + s.setjGh(rs.getString("j_gh"));
  187 + s.setjName(rs.getString("j_name"));
  188 + s.setLpName(rs.getString("lp_name"));
  189 + return s;
  190 + }
  191 + });
  192 + if(pbb.size()>0){
  193 + list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());
  194 + list.get(i).setLpname(pbb.get(0).getLpName());
  195 +
  196 + }
  197 +
  198 + }
164 PageObject<Outbound> pageObject = pageHelper.getPageObject(); 199 PageObject<Outbound> pageObject = pageHelper.getPageObject();
165 pageObject.setDataList(list); 200 pageObject.setDataList(list);
166 return pageObject; 201 return pageObject;
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
@@ -12,10 +12,14 @@ import java.util.HashMap; @@ -12,10 +12,14 @@ import java.util.HashMap;
12 import java.util.List; 12 import java.util.List;
13 import java.util.Map; 13 import java.util.Map;
14 14
  15 +import org.springframework.jdbc.core.JdbcTemplate;
  16 +import org.springframework.jdbc.core.RowMapper;
15 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
  18 +import org.springframework.beans.factory.annotation.Autowired;
16 19
17 import com.bsth.data.BasicData; 20 import com.bsth.data.BasicData;
18 import com.bsth.entity.excep.Speeding; 21 import com.bsth.entity.excep.Speeding;
  22 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
19 import com.bsth.service.excep.SpeedingService; 23 import com.bsth.service.excep.SpeedingService;
20 import com.bsth.util.EchartConver; 24 import com.bsth.util.EchartConver;
21 import com.bsth.util.PageHelper; 25 import com.bsth.util.PageHelper;
@@ -27,7 +31,8 @@ import com.google.gson.Gson; @@ -27,7 +31,8 @@ import com.google.gson.Gson;
27 @Service 31 @Service
28 public class SpeedingServiceImpl implements SpeedingService { 32 public class SpeedingServiceImpl implements SpeedingService {
29 33
30 - 34 + @Autowired
  35 + JdbcTemplate jdbcTemplate;
31 static List<Speeding> findAll(Map<String, Object> map) { 36 static List<Speeding> findAll(Map<String, Object> map) {
32 Connection conn = null; 37 Connection conn = null;
33 PreparedStatement ps = null; 38 PreparedStatement ps = null;
@@ -45,6 +50,8 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -45,6 +50,8 @@ public class SpeedingServiceImpl implements SpeedingService {
45 } 50 }
46 51
47 if(nbbm!=null){ 52 if(nbbm!=null){
  53 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  54 + if(nbbm!=null)
48 sql +=" and vehicle like '%"+nbbm.toString()+"%'"; 55 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
49 } 56 }
50 57
@@ -53,7 +60,7 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -53,7 +60,7 @@ public class SpeedingServiceImpl implements SpeedingService {
53 } 60 }
54 if(date!=null){ 61 if(date!=null){
55 if (date.toString().length()>0) { 62 if (date.toString().length()>0) {
56 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); 63 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
57 try { 64 try {
58 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); 65 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
59 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); 66 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
@@ -102,7 +109,7 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -102,7 +109,7 @@ public class SpeedingServiceImpl implements SpeedingService {
102 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); 109 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
103 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp()))); 110 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp())));
104 speeding.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); 111 speeding.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
105 - speeding.setVehicle(rs.getObject("vehicle").toString()); 112 + speeding.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
106 list.add(speeding); 113 list.add(speeding);
107 } 114 }
108 return list; 115 return list;
@@ -122,9 +129,10 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -122,9 +129,10 @@ public class SpeedingServiceImpl implements SpeedingService {
122 } 129 }
123 130
124 if(nbbm!=null){ 131 if(nbbm!=null){
  132 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  133 + if(nbbm!=null)
125 sql +=" and vehicle like '%"+nbbm.toString()+"%'"; 134 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
126 } 135 }
127 -  
128 if(updown!=null){ 136 if(updown!=null){
129 sql +="and up_down like '%"+updown.toString()+"%'"; 137 sql +="and up_down like '%"+updown.toString()+"%'";
130 } 138 }
@@ -163,7 +171,34 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -163,7 +171,34 @@ public class SpeedingServiceImpl implements SpeedingService {
163 171
164 PageHelper pageHelper = new PageHelper(totalData, map); 172 PageHelper pageHelper = new PageHelper(totalData, map);
165 List<Speeding> list=findAll(pageHelper.getMap()); 173 List<Speeding> list=findAll(pageHelper.getMap());
166 - 174 + for (int i = 0; i < list.size(); i++) {
  175 + String nbbm2=list.get(i).getVehicle() ;
  176 + Long d1=list.get(i).getTimestamp();
  177 + Date datess = new Date(d1);
  178 + String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
  179 + String sk=new SimpleDateFormat("HH:mm").format(datess);
  180 + String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  181 + + " real_exec_date='"+dates+"' ";
  182 +// + "and fcsj_actual > '"+sk+"' ";
  183 +// + "and '"+sk+"' <dfsj";
  184 + List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
  185 + new RowMapper<ScheduleRealInfo>(){
  186 + @Override
  187 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  188 + ScheduleRealInfo s = new ScheduleRealInfo();
  189 + s.setjGh(rs.getString("j_gh"));
  190 + s.setjName(rs.getString("j_name"));
  191 + s.setLpName(rs.getString("lp_name"));
  192 + return s;
  193 + }
  194 + });
  195 + if(pbb.size()>0){
  196 + list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());
  197 + list.get(i).setLpname(pbb.get(0).getLpName());
  198 +
  199 + }
  200 +
  201 + }
167 PageObject<Speeding> pageObject = pageHelper.getPageObject(); 202 PageObject<Speeding> pageObject = pageHelper.getPageObject();
168 pageObject.setDataList(list); 203 pageObject.setDataList(list);
169 return pageObject; 204 return pageObject;
src/main/resources/static/pages/excep/boundList.html
@@ -55,9 +55,9 @@ @@ -55,9 +55,9 @@
55 <tr role="row" class="heading"> 55 <tr role="row" class="heading">
56 <th width="3%">#</th> 56 <th width="3%">#</th>
57 <th width="15%">线路</th> 57 <th width="15%">线路</th>
58 - <th width="13%">内部编码</th>  
59 - <th width="100">经度</th>  
60 - <th width="11%">纬度</th> 58 + <th width="13%">车辆自编号</th>
  59 + <th width="100">工号/名字</th>
  60 + <th width="11%">路牌名</th>
61 <th width="10%">上下行</th> 61 <th width="10%">上下行</th>
62 <th width="18%">时间</th> 62 <th width="18%">时间</th>
63 <th width="18%">操作</th> 63 <th width="18%">操作</th>
@@ -66,10 +66,11 @@ @@ -66,10 +66,11 @@
66 <td></td> 66 <td></td>
67 <td> 67 <td>
68 <!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> --> 68 <!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> -->
69 - <select class="form-control" name="line" id="line" style="width: 180px;"></select> 69 + <select class="form-control" name="line" id="line" style="width: 150px;"></select>
70 </td> 70 </td>
71 <td> 71 <td>
72 - <input type="text" class="form-control form-filter input-sm" name="nbbm"> 72 +<!-- <input type="text" class="form-control form-filter input-sm" name="nbbm"> -->
  73 + <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select>
73 </td> 74 </td>
74 <td> 75 <td>
75 </td> 76 </td>
@@ -119,10 +120,10 @@ @@ -119,10 +120,10 @@
119 </td> 120 </td>
120 121
121 <td> 122 <td>
122 - {{obj.lon}} 123 + {{obj.jsy}}
123 </td> 124 </td>
124 <td> 125 <td>
125 - {{obj.lat}} 126 + {{obj.lpname}}
126 </td> 127 </td>
127 <td> 128 <td>
128 {{if obj.upDown==0}} 129 {{if obj.upDown==0}}
@@ -271,45 +272,67 @@ $(function(){ @@ -271,45 +272,67 @@ $(function(){
271 }); 272 });
272 273
273 //搜索线路 274 //搜索线路
274 - $('#line').select2({  
275 - ajax: {  
276 - url: '/realSchedule/findLine',  
277 - type: 'post',  
278 - dataType: 'json',  
279 - delay: 150,  
280 - data: function(params){  
281 - return{line: params.term};  
282 - },  
283 - processResults: function (data) {  
284 - return {  
285 - results: data  
286 - };  
287 - },  
288 - cache: true  
289 - },  
290 - templateResult: function(repo){  
291 - if (repo.loading) return repo.text;  
292 - var h = '<span>'+repo.text+'</span>';  
293 - return h;  
294 - },  
295 - escapeMarkup: function (markup) { return markup; },  
296 - minimumInputLength: 1,  
297 - templateSelection: function(repo){  
298 - return repo.text;  
299 - },  
300 - language: {  
301 - noResults: function(){  
302 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
303 - },  
304 - inputTooShort : function(e) {  
305 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
306 - },  
307 - searching : function() {  
308 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
309 - }  
310 - } 275 + $.get('/basic/lineCode2Name',function(result){
  276 + var data=[];
  277 + data.push({id: " ", text: "全部线路"});
  278 + for(var code in result){
  279 + data.push({id: code, text: result[code]});
  280 + }
  281 + initPinYinSelect2('#line',data,'');
  282 +
311 }); 283 });
312 -}); 284 +
  285 + $("#line").on("change",initXl);
  286 +
  287 +function initXl(){
  288 +$('#nbbm').select2({
  289 + placeholder: '搜索车辆...',
  290 + ajax: {
  291 + url: '/report/carList',
  292 + dataType: 'json',
  293 + delay: 150,
  294 + data: function (params) {
  295 + return {nbbm: params.term,
  296 + gsbm:" ",
  297 + fgsbm:" ",
  298 + xlbm:$('#line').val()};
  299 + },
  300 + processResults: function (data) {
  301 + return {
  302 + results: data
  303 + };
  304 + },
  305 + cache: true
  306 + },
  307 + templateResult: function (repo) {
  308 + if (repo.loading) return repo.text;
  309 + var h = '<span>' + repo.text + '</span>';
  310 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  311 + return h;
  312 + },
  313 + escapeMarkup: function (markup) {
  314 + return markup;
  315 + },
  316 + minimumInputLength: 1,
  317 + templateSelection: function (repo) {
  318 + return repo.text;
  319 + },
  320 + language: {
  321 + noResults: function () {
  322 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  323 + },
  324 + inputTooShort: function (e) {
  325 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  326 + },
  327 + searching: function () {
  328 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  329 + }
  330 + }
  331 +})
  332 +};
  333 +
  334 +
  335 +
313 //改变状态 336 //改变状态
314 function changeEnabled(id,enabled){ 337 function changeEnabled(id,enabled){
315 debugger 338 debugger
@@ -317,4 +340,5 @@ function changeEnabled(id,enabled){ @@ -317,4 +340,5 @@ function changeEnabled(id,enabled){
317 jsDoQuery(null, true); 340 jsDoQuery(null, true);
318 }) 341 })
319 } 342 }
  343 +});
320 </script> 344 </script>
321 \ No newline at end of file 345 \ No newline at end of file
src/main/resources/static/pages/excep/offlineList.html
@@ -55,9 +55,9 @@ @@ -55,9 +55,9 @@
55 <tr role="row" class="heading"> 55 <tr role="row" class="heading">
56 <th width="3%">#</th> 56 <th width="3%">#</th>
57 <th width="15%">线路</th> 57 <th width="15%">线路</th>
58 - <th width="13%">内部编码</th>  
59 - <th width="100">经度</th>  
60 - <th width="11%">纬度</th> 58 + <th width="13%">车辆自编号</th>
  59 + <th width="100">工号/名字</th>
  60 + <th width="11%">路牌名</th>
61 <th width="10%">上下行</th> 61 <th width="10%">上下行</th>
62 <th width="18%">时间</th> 62 <th width="18%">时间</th>
63 <th width="18%">操作</th> 63 <th width="18%">操作</th>
@@ -66,10 +66,12 @@ @@ -66,10 +66,12 @@
66 <td></td> 66 <td></td>
67 <td> 67 <td>
68 <!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> --> 68 <!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> -->
69 - <select class="form-control" name="line" id="line" style="width: 180px;"></select> 69 + <select class="form-control" name="line" id="line" style="width: 150px;"></select>
70 </td> 70 </td>
71 <td> 71 <td>
72 - <input type="text" class="form-control form-filter input-sm" name="nbbm"> 72 +<!-- <input type="text" class="form-control form-filter input-sm" name="nbbm" id="nbbm"> -->
  73 +
  74 + <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select>
73 </td> 75 </td>
74 <td> 76 <td>
75 </td> 77 </td>
@@ -119,10 +121,10 @@ @@ -119,10 +121,10 @@
119 </td> 121 </td>
120 122
121 <td> 123 <td>
122 - {{obj.lon}} 124 + {{obj.jsy}}
123 </td> 125 </td>
124 <td> 126 <td>
125 - {{obj.lat}} 127 + {{obj.lpname}}
126 </td> 128 </td>
127 <td> 129 <td>
128 {{if obj.upDown==0}} 130 {{if obj.upDown==0}}
@@ -275,43 +277,64 @@ $(function(){ @@ -275,43 +277,64 @@ $(function(){
275 }); 277 });
276 278
277 //搜索线路 279 //搜索线路
278 - $('#line').select2({  
279 - ajax: {  
280 - url: '/realSchedule/findLine',  
281 - type: 'post',  
282 - dataType: 'json',  
283 - delay: 150,  
284 - data: function(params){  
285 - return{line: params.term};  
286 - },  
287 - processResults: function (data) {  
288 - return {  
289 - results: data  
290 - };  
291 - },  
292 - cache: true  
293 - },  
294 - templateResult: function(repo){  
295 - if (repo.loading) return repo.text;  
296 - var h = '<span>'+repo.text+'</span>';  
297 - return h;  
298 - },  
299 - escapeMarkup: function (markup) { return markup; },  
300 - minimumInputLength: 1,  
301 - templateSelection: function(repo){  
302 - return repo.text;  
303 - },  
304 - language: {  
305 - noResults: function(){  
306 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
307 - },  
308 - inputTooShort : function(e) {  
309 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
310 - },  
311 - searching : function() {  
312 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
313 - }  
314 - } 280 +
  281 + $.get('/basic/lineCode2Name',function(result){
  282 + var data=[];
  283 + data.push({id: " ", text: "全部线路"});
  284 + for(var code in result){
  285 + data.push({id: code, text: result[code]});
  286 + }
  287 + initPinYinSelect2('#line',data,'');
  288 +
315 }); 289 });
  290 +
  291 + $("#line").on("change",initXl);
  292 +function initXl(){
  293 + $('#nbbm').select2({
  294 + placeholder: '搜索车辆...',
  295 + ajax: {
  296 + url: '/report/carList',
  297 + dataType: 'json',
  298 + delay: 150,
  299 + data: function (params) {
  300 + return {nbbm: params.term,
  301 + gsbm:"",
  302 + fgsbm:"",
  303 + xlbm:$('#line').val()};
  304 + },
  305 + processResults: function (data) {
  306 + return {
  307 + results: data
  308 + };
  309 + },
  310 + cache: true
  311 + },
  312 + templateResult: function (repo) {
  313 + if (repo.loading) return repo.text;
  314 + var h = '<span>' + repo.text + '</span>';
  315 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  316 + return h;
  317 + },
  318 + escapeMarkup: function (markup) {
  319 + return markup;
  320 + },
  321 + minimumInputLength: 1,
  322 + templateSelection: function (repo) {
  323 + return repo.text;
  324 + },
  325 + language: {
  326 + noResults: function () {
  327 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  328 + },
  329 + inputTooShort: function (e) {
  330 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  331 + },
  332 + searching: function () {
  333 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  334 + }
  335 + }
  336 + });
  337 +}
  338 +
316 }); 339 });
317 </script> 340 </script>
318 \ No newline at end of file 341 \ No newline at end of file
src/main/resources/static/pages/excep/speedingList.html
@@ -55,9 +55,9 @@ @@ -55,9 +55,9 @@
55 <tr role="row" class="heading"> 55 <tr role="row" class="heading">
56 <th width="3%">#</th> 56 <th width="3%">#</th>
57 <th width="15%">线路</th> 57 <th width="15%">线路</th>
58 - <th width="13%">内部编码</th>  
59 - <th width="100">经度</th>  
60 - <th width="11%">纬度</th> 58 + <th width="13%">车辆自编号</th>
  59 + <th width="100">工号/名字</th>
  60 + <th width="11%">路牌名</th>
61 <th width="10%">上下行</th> 61 <th width="10%">上下行</th>
62 <th width="18%">时间</th> 62 <th width="18%">时间</th>
63 <th width="18%">操作</th> 63 <th width="18%">操作</th>
@@ -69,10 +69,11 @@ @@ -69,10 +69,11 @@
69 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 69 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
70 </td> 70 </td>
71 <td> 71 <td>
72 - <input type="text" class="form-control form-filter input-sm" name="nbbm"> 72 +<!-- <input type="text" class="form-control form-filter input-sm" name="nbbm"> -->
  73 + <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select>
73 </td> 74 </td>
74 <td> 75 <td>
75 - <input class="form-control" type="date" name="date" /> 76 +
76 </td> 77 </td>
77 <td></td> 78 <td></td>
78 <td> 79 <td>
@@ -83,7 +84,7 @@ @@ -83,7 +84,7 @@
83 <option value="-1">无效</option> 84 <option value="-1">无效</option>
84 </select> 85 </select>
85 </td> 86 </td>
86 - <td></td> 87 + <td> <input class="form-control" type="date" name="date" /></td>
87 <td> 88 <td>
88 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > 89 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
89 <i class="fa fa-search"></i> 搜索</button> 90 <i class="fa fa-search"></i> 搜索</button>
@@ -118,10 +119,10 @@ @@ -118,10 +119,10 @@
118 </td> 119 </td>
119 120
120 <td> 121 <td>
121 - {{obj.lon}} 122 + {{obj.jsy}}
122 </td> 123 </td>
123 <td> 124 <td>
124 - {{obj.lat}} 125 + {{obj.lpname}}
125 </td> 126 </td>
126 <td> 127 <td>
127 {{if obj.upDown==0}} 128 {{if obj.upDown==0}}
@@ -270,45 +271,65 @@ $(function(){ @@ -270,45 +271,65 @@ $(function(){
270 }); 271 });
271 272
272 //搜索线路 273 //搜索线路
273 - $('#line').select2({  
274 - ajax: {  
275 - url: '/realSchedule/findLine',  
276 - type: 'post',  
277 - dataType: 'json',  
278 - delay: 150,  
279 - data: function(params){  
280 - return{line: params.term};  
281 - },  
282 - processResults: function (data) {  
283 - return {  
284 - results: data  
285 - };  
286 - },  
287 - cache: true  
288 - },  
289 - templateResult: function(repo){  
290 - if (repo.loading) return repo.text;  
291 - var h = '<span>'+repo.text+'</span>';  
292 - return h;  
293 - },  
294 - escapeMarkup: function (markup) { return markup; },  
295 - minimumInputLength: 1,  
296 - templateSelection: function(repo){  
297 - return repo.text;  
298 - },  
299 - language: {  
300 - noResults: function(){  
301 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
302 - },  
303 - inputTooShort : function(e) {  
304 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
305 - },  
306 - searching : function() {  
307 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
308 - } 274 + $.get('/basic/lineCode2Name',function(result){
  275 + var data=[];
  276 + data.push({id: " ", text: "全部线路"});
  277 + for(var code in result){
  278 + data.push({id: code, text: result[code]});
309 } 279 }
310 - }); 280 + initPinYinSelect2('#line',data,'');
  281 +
  282 +});
  283 +
  284 +$("#line").on("change",initXl);
  285 +function initXl(){
  286 +$('#nbbm').select2({
  287 + placeholder: '搜索车辆...',
  288 + ajax: {
  289 + url: '/report/carList',
  290 + dataType: 'json',
  291 + delay: 150,
  292 + data: function (params) {
  293 + return {nbbm: params.term,
  294 + gsbm:"",
  295 + fgsbm:"",
  296 + xlbm:$('#line').val()};
  297 + },
  298 + processResults: function (data) {
  299 + return {
  300 + results: data
  301 + };
  302 + },
  303 + cache: true
  304 + },
  305 + templateResult: function (repo) {
  306 + if (repo.loading) return repo.text;
  307 + var h = '<span>' + repo.text + '</span>';
  308 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  309 + return h;
  310 + },
  311 + escapeMarkup: function (markup) {
  312 + return markup;
  313 + },
  314 + minimumInputLength: 1,
  315 + templateSelection: function (repo) {
  316 + return repo.text;
  317 + },
  318 + language: {
  319 + noResults: function () {
  320 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  321 + },
  322 + inputTooShort: function (e) {
  323 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  324 + },
  325 + searching: function () {
  326 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  327 + }
  328 + }
311 }); 329 });
  330 +}
  331 +
  332 +
312 //改变状态 333 //改变状态
313 function changeEnabled(id,enabled){ 334 function changeEnabled(id,enabled){
314 debugger 335 debugger
@@ -316,4 +337,5 @@ function changeEnabled(id,enabled){ @@ -316,4 +337,5 @@ function changeEnabled(id,enabled){
316 jsDoQuery(null, true); 337 jsDoQuery(null, true);
317 }) 338 })
318 } 339 }
  340 +});
319 </script> 341 </script>
320 \ No newline at end of file 342 \ No newline at end of file