Commit 60a6ff302d40e7dd5d7bf53f5cd6f56d442adf0b
1 parent
35a6161f
异常报表修改
Showing
9 changed files
with
428 additions
and
153 deletions
src/main/java/com/bsth/entity/excep/Offline.java
| ... | ... | @@ -6,6 +6,7 @@ import javax.persistence.Entity; |
| 6 | 6 | import javax.persistence.GeneratedValue; |
| 7 | 7 | import javax.persistence.Id; |
| 8 | 8 | import javax.persistence.Table; |
| 9 | +import javax.persistence.Transient; | |
| 9 | 10 | |
| 10 | 11 | /** |
| 11 | 12 | * 掉线 |
| ... | ... | @@ -65,7 +66,12 @@ public class Offline { |
| 65 | 66 | */ |
| 66 | 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 | 75 | public Integer getId() { |
| 70 | 76 | return id; |
| 71 | 77 | } |
| ... | ... | @@ -146,5 +152,29 @@ public class Offline { |
| 146 | 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 | import javax.persistence.GeneratedValue; |
| 7 | 7 | import javax.persistence.Id; |
| 8 | 8 | import javax.persistence.Table; |
| 9 | +import javax.persistence.Transient; | |
| 9 | 10 | |
| 10 | 11 | /** |
| 11 | 12 | * 越界 |
| ... | ... | @@ -72,7 +73,12 @@ public class Outbound { |
| 72 | 73 | * 时间 |
| 73 | 74 | */ |
| 74 | 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 | 83 | public Integer getId() { |
| 78 | 84 | return id; |
| ... | ... | @@ -162,5 +168,29 @@ public class Outbound { |
| 162 | 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 | import javax.persistence.GeneratedValue; |
| 7 | 7 | import javax.persistence.Id; |
| 8 | 8 | import javax.persistence.Table; |
| 9 | +import javax.persistence.Transient; | |
| 9 | 10 | |
| 10 | 11 | /** |
| 11 | 12 | * 超速 |
| ... | ... | @@ -66,6 +67,13 @@ public class Speeding { |
| 66 | 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 | 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 | 12 | import java.util.List; |
| 13 | 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 | 18 | import org.springframework.stereotype.Service; |
| 16 | 19 | |
| 17 | 20 | import com.bsth.data.BasicData; |
| 18 | 21 | import com.bsth.entity.excep.Offline; |
| 22 | +import com.bsth.entity.oil.Ylb; | |
| 23 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 19 | 24 | import com.bsth.service.excep.OfflineService; |
| 20 | 25 | import com.bsth.util.EchartConver; |
| 21 | 26 | import com.bsth.util.PageHelper; |
| ... | ... | @@ -27,6 +32,8 @@ import com.google.gson.Gson; |
| 27 | 32 | @Service |
| 28 | 33 | public class OfflineServiceImpl implements OfflineService { |
| 29 | 34 | |
| 35 | + @Autowired | |
| 36 | + JdbcTemplate jdbcTemplate; | |
| 30 | 37 | // @Override |
| 31 | 38 | static List<Offline> findAll(Map<String, Object> map) { |
| 32 | 39 | // TODO Auto-generated method stub |
| ... | ... | @@ -53,7 +60,9 @@ public class OfflineServiceImpl implements OfflineService { |
| 53 | 60 | } |
| 54 | 61 | |
| 55 | 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 | 68 | if(updown!=null){ |
| ... | ... | @@ -61,7 +70,7 @@ public class OfflineServiceImpl implements OfflineService { |
| 61 | 70 | } |
| 62 | 71 | if(date!=null){ |
| 63 | 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 | 74 | try { |
| 66 | 75 | Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); |
| 67 | 76 | Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); |
| ... | ... | @@ -112,7 +121,7 @@ public class OfflineServiceImpl implements OfflineService { |
| 112 | 121 | offline.setTimestamp(Long.valueOf(rs.getObject("timestamp").toString())); |
| 113 | 122 | offline.setTimestampDate(sdf.format(new Date(offline.getTimestamp()))); |
| 114 | 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 | 125 | list.add(offline); |
| 117 | 126 | } |
| 118 | 127 | return list; |
| ... | ... | @@ -135,7 +144,9 @@ public class OfflineServiceImpl implements OfflineService { |
| 135 | 144 | } |
| 136 | 145 | |
| 137 | 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 | 152 | if(updown!=null){ |
| ... | ... | @@ -143,7 +154,7 @@ public class OfflineServiceImpl implements OfflineService { |
| 143 | 154 | } |
| 144 | 155 | if(date!=null){ |
| 145 | 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 | 158 | try { |
| 148 | 159 | Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); |
| 149 | 160 | Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); |
| ... | ... | @@ -177,8 +188,41 @@ public class OfflineServiceImpl implements OfflineService { |
| 177 | 188 | PageHelper pageHelper = new PageHelper(totalData, map); |
| 178 | 189 | // List<T> list = this.baseDao.queryByObject(pageHelper.getMap()); |
| 179 | 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 | 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 | 226 | return pageObject; |
| 183 | 227 | } |
| 184 | 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 | 12 | import java.util.List; |
| 13 | 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 | 18 | import org.springframework.stereotype.Service; |
| 16 | 19 | |
| 17 | 20 | import com.bsth.data.BasicData; |
| 18 | 21 | import com.bsth.entity.excep.Outbound; |
| 22 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 19 | 23 | import com.bsth.service.excep.OutboundService; |
| 20 | 24 | import com.bsth.util.EchartConver; |
| 21 | 25 | import com.bsth.util.PageHelper; |
| ... | ... | @@ -25,8 +29,9 @@ import com.github.abel533.echarts.Option; |
| 25 | 29 | import com.google.gson.Gson; |
| 26 | 30 | @Service |
| 27 | 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 | 35 | Connection conn = null; |
| 31 | 36 | PreparedStatement ps = null; |
| 32 | 37 | ResultSet rs = null; |
| ... | ... | @@ -37,12 +42,13 @@ public class OutboundServiceImpl implements OutboundService{ |
| 37 | 42 | Object nbbm=map.get("nbbm"); |
| 38 | 43 | Object updown=map.get("updown"); |
| 39 | 44 | Object date=map.get("date"); |
| 40 | - | |
| 41 | 45 | if(line!=null){ |
| 42 | 46 | sql +=" and line like'%"+line.toString()+"%'"; |
| 43 | 47 | } |
| 44 | 48 | |
| 45 | 49 | if(nbbm!=null){ |
| 50 | + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm); | |
| 51 | + if(nbbm!=null) | |
| 46 | 52 | sql +=" and vehicle like '%"+nbbm.toString()+"%'"; |
| 47 | 53 | } |
| 48 | 54 | |
| ... | ... | @@ -51,7 +57,7 @@ public class OutboundServiceImpl implements OutboundService{ |
| 51 | 57 | } |
| 52 | 58 | if(date!=null){ |
| 53 | 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 | 61 | try { |
| 56 | 62 | Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); |
| 57 | 63 | Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); |
| ... | ... | @@ -98,7 +104,7 @@ public class OutboundServiceImpl implements OutboundService{ |
| 98 | 104 | outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); |
| 99 | 105 | outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); |
| 100 | 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 | 108 | outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString()); |
| 103 | 109 | list.add(outbound); |
| 104 | 110 | } |
| ... | ... | @@ -119,6 +125,8 @@ public class OutboundServiceImpl implements OutboundService{ |
| 119 | 125 | } |
| 120 | 126 | |
| 121 | 127 | if(nbbm!=null){ |
| 128 | + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm); | |
| 129 | + if(nbbm!=null) | |
| 122 | 130 | sql +=" and vehicle like '%"+nbbm.toString()+"%'"; |
| 123 | 131 | } |
| 124 | 132 | |
| ... | ... | @@ -160,7 +168,34 @@ public class OutboundServiceImpl implements OutboundService{ |
| 160 | 168 | |
| 161 | 169 | PageHelper pageHelper = new PageHelper(totalData, map); |
| 162 | 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 | 199 | PageObject<Outbound> pageObject = pageHelper.getPageObject(); |
| 165 | 200 | pageObject.setDataList(list); |
| 166 | 201 | return pageObject; | ... | ... |
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
| ... | ... | @@ -12,10 +12,14 @@ import java.util.HashMap; |
| 12 | 12 | import java.util.List; |
| 13 | 13 | import java.util.Map; |
| 14 | 14 | |
| 15 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 16 | +import org.springframework.jdbc.core.RowMapper; | |
| 15 | 17 | import org.springframework.stereotype.Service; |
| 18 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 16 | 19 | |
| 17 | 20 | import com.bsth.data.BasicData; |
| 18 | 21 | import com.bsth.entity.excep.Speeding; |
| 22 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 19 | 23 | import com.bsth.service.excep.SpeedingService; |
| 20 | 24 | import com.bsth.util.EchartConver; |
| 21 | 25 | import com.bsth.util.PageHelper; |
| ... | ... | @@ -27,7 +31,8 @@ import com.google.gson.Gson; |
| 27 | 31 | @Service |
| 28 | 32 | public class SpeedingServiceImpl implements SpeedingService { |
| 29 | 33 | |
| 30 | - | |
| 34 | + @Autowired | |
| 35 | + JdbcTemplate jdbcTemplate; | |
| 31 | 36 | static List<Speeding> findAll(Map<String, Object> map) { |
| 32 | 37 | Connection conn = null; |
| 33 | 38 | PreparedStatement ps = null; |
| ... | ... | @@ -45,6 +50,8 @@ public class SpeedingServiceImpl implements SpeedingService { |
| 45 | 50 | } |
| 46 | 51 | |
| 47 | 52 | if(nbbm!=null){ |
| 53 | + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm); | |
| 54 | + if(nbbm!=null) | |
| 48 | 55 | sql +=" and vehicle like '%"+nbbm.toString()+"%'"; |
| 49 | 56 | } |
| 50 | 57 | |
| ... | ... | @@ -53,7 +60,7 @@ public class SpeedingServiceImpl implements SpeedingService { |
| 53 | 60 | } |
| 54 | 61 | if(date!=null){ |
| 55 | 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 | 64 | try { |
| 58 | 65 | Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); |
| 59 | 66 | Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); |
| ... | ... | @@ -102,7 +109,7 @@ public class SpeedingServiceImpl implements SpeedingService { |
| 102 | 109 | speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); |
| 103 | 110 | speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp()))); |
| 104 | 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 | 113 | list.add(speeding); |
| 107 | 114 | } |
| 108 | 115 | return list; |
| ... | ... | @@ -122,9 +129,10 @@ public class SpeedingServiceImpl implements SpeedingService { |
| 122 | 129 | } |
| 123 | 130 | |
| 124 | 131 | if(nbbm!=null){ |
| 132 | + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm); | |
| 133 | + if(nbbm!=null) | |
| 125 | 134 | sql +=" and vehicle like '%"+nbbm.toString()+"%'"; |
| 126 | 135 | } |
| 127 | - | |
| 128 | 136 | if(updown!=null){ |
| 129 | 137 | sql +="and up_down like '%"+updown.toString()+"%'"; |
| 130 | 138 | } |
| ... | ... | @@ -163,7 +171,34 @@ public class SpeedingServiceImpl implements SpeedingService { |
| 163 | 171 | |
| 164 | 172 | PageHelper pageHelper = new PageHelper(totalData, map); |
| 165 | 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 | 202 | PageObject<Speeding> pageObject = pageHelper.getPageObject(); |
| 168 | 203 | pageObject.setDataList(list); |
| 169 | 204 | return pageObject; | ... | ... |
src/main/resources/static/pages/excep/boundList.html
| ... | ... | @@ -55,9 +55,9 @@ |
| 55 | 55 | <tr role="row" class="heading"> |
| 56 | 56 | <th width="3%">#</th> |
| 57 | 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 | 61 | <th width="10%">上下行</th> |
| 62 | 62 | <th width="18%">时间</th> |
| 63 | 63 | <th width="18%">操作</th> |
| ... | ... | @@ -66,10 +66,11 @@ |
| 66 | 66 | <td></td> |
| 67 | 67 | <td> |
| 68 | 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 | 70 | </td> |
| 71 | 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 | 74 | </td> |
| 74 | 75 | <td> |
| 75 | 76 | </td> |
| ... | ... | @@ -119,10 +120,10 @@ |
| 119 | 120 | </td> |
| 120 | 121 | |
| 121 | 122 | <td> |
| 122 | - {{obj.lon}} | |
| 123 | + {{obj.jsy}} | |
| 123 | 124 | </td> |
| 124 | 125 | <td> |
| 125 | - {{obj.lat}} | |
| 126 | + {{obj.lpname}} | |
| 126 | 127 | </td> |
| 127 | 128 | <td> |
| 128 | 129 | {{if obj.upDown==0}} |
| ... | ... | @@ -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 ? ' <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 | 337 | function changeEnabled(id,enabled){ |
| 315 | 338 | debugger |
| ... | ... | @@ -317,4 +340,5 @@ function changeEnabled(id,enabled){ |
| 317 | 340 | jsDoQuery(null, true); |
| 318 | 341 | }) |
| 319 | 342 | } |
| 343 | +}); | |
| 320 | 344 | </script> |
| 321 | 345 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/excep/offlineList.html
| ... | ... | @@ -55,9 +55,9 @@ |
| 55 | 55 | <tr role="row" class="heading"> |
| 56 | 56 | <th width="3%">#</th> |
| 57 | 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 | 61 | <th width="10%">上下行</th> |
| 62 | 62 | <th width="18%">时间</th> |
| 63 | 63 | <th width="18%">操作</th> |
| ... | ... | @@ -66,10 +66,12 @@ |
| 66 | 66 | <td></td> |
| 67 | 67 | <td> |
| 68 | 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 | 70 | </td> |
| 71 | 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 | 75 | </td> |
| 74 | 76 | <td> |
| 75 | 77 | </td> |
| ... | ... | @@ -119,10 +121,10 @@ |
| 119 | 121 | </td> |
| 120 | 122 | |
| 121 | 123 | <td> |
| 122 | - {{obj.lon}} | |
| 124 | + {{obj.jsy}} | |
| 123 | 125 | </td> |
| 124 | 126 | <td> |
| 125 | - {{obj.lat}} | |
| 127 | + {{obj.lpname}} | |
| 126 | 128 | </td> |
| 127 | 129 | <td> |
| 128 | 130 | {{if obj.upDown==0}} |
| ... | ... | @@ -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 ? ' <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 | 340 | </script> |
| 318 | 341 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/excep/speedingList.html
| ... | ... | @@ -55,9 +55,9 @@ |
| 55 | 55 | <tr role="row" class="heading"> |
| 56 | 56 | <th width="3%">#</th> |
| 57 | 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 | 61 | <th width="10%">上下行</th> |
| 62 | 62 | <th width="18%">时间</th> |
| 63 | 63 | <th width="18%">操作</th> |
| ... | ... | @@ -69,10 +69,11 @@ |
| 69 | 69 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 70 | 70 | </td> |
| 71 | 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 | 74 | </td> |
| 74 | 75 | <td> |
| 75 | - <input class="form-control" type="date" name="date" /> | |
| 76 | + | |
| 76 | 77 | </td> |
| 77 | 78 | <td></td> |
| 78 | 79 | <td> |
| ... | ... | @@ -83,7 +84,7 @@ |
| 83 | 84 | <option value="-1">无效</option> |
| 84 | 85 | </select> |
| 85 | 86 | </td> |
| 86 | - <td></td> | |
| 87 | + <td> <input class="form-control" type="date" name="date" /></td> | |
| 87 | 88 | <td> |
| 88 | 89 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 89 | 90 | <i class="fa fa-search"></i> 搜索</button> |
| ... | ... | @@ -118,10 +119,10 @@ |
| 118 | 119 | </td> |
| 119 | 120 | |
| 120 | 121 | <td> |
| 121 | - {{obj.lon}} | |
| 122 | + {{obj.jsy}} | |
| 122 | 123 | </td> |
| 123 | 124 | <td> |
| 124 | - {{obj.lat}} | |
| 125 | + {{obj.lpname}} | |
| 125 | 126 | </td> |
| 126 | 127 | <td> |
| 127 | 128 | {{if obj.upDown==0}} |
| ... | ... | @@ -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 ? ' <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 | 334 | function changeEnabled(id,enabled){ |
| 314 | 335 | debugger |
| ... | ... | @@ -316,4 +337,5 @@ function changeEnabled(id,enabled){ |
| 316 | 337 | jsDoQuery(null, true); |
| 317 | 338 | }) |
| 318 | 339 | } |
| 340 | +}); | |
| 319 | 341 | </script> |
| 320 | 342 | \ No newline at end of file | ... | ... |