Commit 068db64aa6daa302f01e864fd9b968e1271aa634
1 parent
b9f88b59
1.车辆信息加入第二路sim号(成都情况特殊)
Showing
2 changed files
with
14 additions
and
2 deletions
src/main/java/com/bsth/server_rs/base_info/car/Car.java
| ... | ... | @@ -71,6 +71,8 @@ public class Car implements Serializable { |
| 71 | 71 | |
| 72 | 72 | private String sim; |
| 73 | 73 | |
| 74 | + private String sim2; | |
| 75 | + | |
| 74 | 76 | public String getNbbm() { |
| 75 | 77 | return nbbm; |
| 76 | 78 | } |
| ... | ... | @@ -198,4 +200,12 @@ public class Car implements Serializable { |
| 198 | 200 | public void setSim(String sim) { |
| 199 | 201 | this.sim = sim; |
| 200 | 202 | } |
| 203 | + | |
| 204 | + public String getSim2() { | |
| 205 | + return sim2; | |
| 206 | + } | |
| 207 | + | |
| 208 | + public void setSim2(String sim2) { | |
| 209 | + this.sim2 = sim2; | |
| 210 | + } | |
| 201 | 211 | } | ... | ... |
src/main/java/com/bsth/server_rs/base_info/car/buffer/CarRefreshThread.java
| ... | ... | @@ -33,10 +33,11 @@ public class CarRefreshThread extends Thread{ |
| 33 | 33 | List<Car> list = jdbcTemplate.query("SELECT DISTINCT t1.*,t2.line_code,t2.name as line_name FROM(SELECT c.inside_code as nbbm,c.business_code as company_code,c.branche_company_code,c.car_plate,c.equipment_code,c.car_type,c.vehicle_stats,c.sfdc,c.scrap_state,c.id_rfid,c.tag_rfid,c.update_date,c2.xl,c2.qyrq FROM bsth_c_cars c LEFT JOIN bsth_c_s_ccinfo c2 ON c.id = c2.cl and c2.is_cancel=0) t1 LEFT JOIN bsth_c_line t2 on t1.xl=t2.id ORDER BY nbbm,qyrq" |
| 34 | 34 | , BeanPropertyRowMapper.newInstance(Car.class)); |
| 35 | 35 | JdbcTemplate msJdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 36 | - Map<String, String> code2sim = new HashMap<>(); | |
| 37 | - List<Map<String, Object>> mappings = msJdbcTemplate.queryForList("select in_code,sim from bsth_c_device_sim_mapping"); | |
| 36 | + Map<String, String> code2sim = new HashMap<>(), code2sim2 = new HashMap<>(); | |
| 37 | + List<Map<String, Object>> mappings = msJdbcTemplate.queryForList("select in_code,sim,relation_sim from bsth_c_device_sim_mapping"); | |
| 38 | 38 | for (Map<String, Object> map : mappings) { |
| 39 | 39 | code2sim.put((String) map.get("in_code"), (String) map.get("sim")); |
| 40 | + code2sim2.put((String) map.get("in_code"), (String) map.get("relation_sim")); | |
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | Map<String, Car> map = new HashMap<>(); |
| ... | ... | @@ -44,6 +45,7 @@ public class CarRefreshThread extends Thread{ |
| 44 | 45 | for(Car c : list){ |
| 45 | 46 | map.put(c.getNbbm(), c); |
| 46 | 47 | c.setSim(code2sim.get(c.getNbbm())); |
| 48 | + c.setSim2(code2sim2.get(c.getNbbm())); | |
| 47 | 49 | } |
| 48 | 50 | |
| 49 | 51 | if(list != null && list.size() > 0) | ... | ... |