Commit edda8d6071dfdd8151f32fc5fd725a96bf5a4332
1 parent
586108c2
1.上电科计划配车接口变更,加入自编号串,以','分割
Showing
2 changed files
with
138 additions
and
80 deletions
src/main/java/com/bsth/server_rs/dks/DksRestService.java
| ... | ... | @@ -156,6 +156,7 @@ public class DksRestService { |
| 156 | 156 | String oldLineCode = ""; |
| 157 | 157 | BusVo vo = null; |
| 158 | 158 | int max = 0; |
| 159 | + String maxCodes = ""; | |
| 159 | 160 | for (int i = 0, len = configs.size();i < len;i++) { |
| 160 | 161 | LineServiceConfig config = configs.get(i); |
| 161 | 162 | if (i == 0) { |
| ... | ... | @@ -165,9 +166,12 @@ public class DksRestService { |
| 165 | 166 | vo.setLineName(config.getLineName()); |
| 166 | 167 | vo.setMonth(month); |
| 167 | 168 | vo.setBusFirstCount(config.getCarCount()); |
| 169 | + vo.setBusFirstCodes(config.getCarCodes()); | |
| 168 | 170 | } else if (!oldLineCode.equals(config.getLineCode())) { |
| 169 | 171 | oldLineCode = config.getLineCode(); |
| 170 | 172 | vo.setBusMaxCount(max); |
| 173 | + vo.setBusMaxCount(max); | |
| 174 | + vo.setBusMaxCodes(maxCodes); | |
| 171 | 175 | result.add(vo); |
| 172 | 176 | max = 0; |
| 173 | 177 | vo = new BusVo(); |
| ... | ... | @@ -175,13 +179,20 @@ public class DksRestService { |
| 175 | 179 | vo.setLineName(config.getLineName()); |
| 176 | 180 | vo.setMonth(month); |
| 177 | 181 | vo.setBusFirstCount(config.getCarCount()); |
| 182 | + vo.setBusFirstCodes(config.getCarCodes()); | |
| 183 | + } | |
| 184 | + if (max < config.getCarCount()) { | |
| 185 | + max = config.getCarCount(); | |
| 186 | + maxCodes = config.getCarCodes(); | |
| 187 | + log.error(maxCodes); | |
| 178 | 188 | } |
| 179 | - max = Math.max(max, config.getCarCount()); | |
| 180 | 189 | if (i == len - 1) { |
| 181 | 190 | vo.setBusMaxCount(max); |
| 191 | + vo.setBusMaxCodes(maxCodes); | |
| 182 | 192 | result.add(vo); |
| 183 | 193 | } |
| 184 | 194 | vo.setBusLastCount(config.getCarCount()); |
| 195 | + vo.setBusLastCodes(config.getCarCodes()); | |
| 185 | 196 | } |
| 186 | 197 | |
| 187 | 198 | return result; |
| ... | ... | @@ -310,7 +321,13 @@ public class DksRestService { |
| 310 | 321 | object.setScheduleDate(dateTime.toString("yyyy-MM-dd")); |
| 311 | 322 | object.setConductorCount(line2conductors.get(lineCode).size()); |
| 312 | 323 | object.setDriverCount(line2drivers.get(lineCode).size()); |
| 324 | + Set<String> cars = line2cars.get(lineCode); | |
| 313 | 325 | object.setCarCount(line2cars.get(lineCode).size()); |
| 326 | + StringBuilder sb = new StringBuilder(); | |
| 327 | + for (String car : cars) { | |
| 328 | + sb.append(car).append(","); | |
| 329 | + } | |
| 330 | + object.setCarCodes(sb.toString()); | |
| 314 | 331 | |
| 315 | 332 | objects.add(object); |
| 316 | 333 | } |
| ... | ... | @@ -323,7 +340,7 @@ public class DksRestService { |
| 323 | 340 | |
| 324 | 341 | try { |
| 325 | 342 | jdbcTemplate.update("delete from control_interface.bsth_t_plan where schedule_date = ?", new Object[]{ dateTime.toString("yyyy-MM-dd") }); |
| 326 | - jdbcTemplate.batchUpdate("insert into control_interface.bsth_t_plan (line_code, line_name, schedule_date, conductor_count, driver_count, car_count) values (?,?,?,?,?,?)", new BatchPreparedStatementSetter() { | |
| 343 | + jdbcTemplate.batchUpdate("insert into control_interface.bsth_t_plan (line_code, line_name, schedule_date, conductor_count, driver_count, car_count, car_codes) values (?,?,?,?,?,?,?)", new BatchPreparedStatementSetter() { | |
| 327 | 344 | @Override |
| 328 | 345 | public void setValues(PreparedStatement ps, int i) throws SQLException { |
| 329 | 346 | LineServiceConfig object = objects.get(i); |
| ... | ... | @@ -333,6 +350,7 @@ public class DksRestService { |
| 333 | 350 | ps.setInt(4, object.getConductorCount()); |
| 334 | 351 | ps.setInt(5, object.getDriverCount()); |
| 335 | 352 | ps.setInt(6, object.getCarCount()); |
| 353 | + ps.setString(7, object.getCarCodes()); | |
| 336 | 354 | } |
| 337 | 355 | |
| 338 | 356 | @Override |
| ... | ... | @@ -692,6 +710,12 @@ public class DksRestService { |
| 692 | 710 | |
| 693 | 711 | private Integer busMaxCount; |
| 694 | 712 | |
| 713 | + private String busFirstCodes; | |
| 714 | + | |
| 715 | + private String busLastCodes; | |
| 716 | + | |
| 717 | + private String busMaxCodes; | |
| 718 | + | |
| 695 | 719 | public String getLineCode() { |
| 696 | 720 | return lineCode; |
| 697 | 721 | } |
| ... | ... | @@ -739,6 +763,30 @@ public class DksRestService { |
| 739 | 763 | public void setBusMaxCount(Integer busMaxCount) { |
| 740 | 764 | this.busMaxCount = busMaxCount; |
| 741 | 765 | } |
| 766 | + | |
| 767 | + public String getBusFirstCodes() { | |
| 768 | + return busFirstCodes; | |
| 769 | + } | |
| 770 | + | |
| 771 | + public void setBusFirstCodes(String busFirstCodes) { | |
| 772 | + this.busFirstCodes = busFirstCodes; | |
| 773 | + } | |
| 774 | + | |
| 775 | + public String getBusLastCodes() { | |
| 776 | + return busLastCodes; | |
| 777 | + } | |
| 778 | + | |
| 779 | + public void setBusLastCodes(String busLastCodes) { | |
| 780 | + this.busLastCodes = busLastCodes; | |
| 781 | + } | |
| 782 | + | |
| 783 | + public String getBusMaxCodes() { | |
| 784 | + return busMaxCodes; | |
| 785 | + } | |
| 786 | + | |
| 787 | + public void setBusMaxCodes(String busMaxCodes) { | |
| 788 | + this.busMaxCodes = busMaxCodes; | |
| 789 | + } | |
| 742 | 790 | } |
| 743 | 791 | |
| 744 | 792 | /** | ... | ... |
src/main/java/com/bsth/server_rs/dks/LineServiceConfig.java
| 1 | -package com.bsth.server_rs.dks; | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * 线路运营司、售、车辆配档信息 | |
| 5 | - * @author Hill | |
| 6 | - */ | |
| 7 | -public class LineServiceConfig { | |
| 8 | - | |
| 9 | - private String lineCode; | |
| 10 | - | |
| 11 | - private String lineName; | |
| 12 | - | |
| 13 | - private String month; | |
| 14 | - | |
| 15 | - private String scheduleDate; | |
| 16 | - | |
| 17 | - private int driverCount; | |
| 18 | - | |
| 19 | - private int conductorCount; | |
| 20 | - | |
| 21 | - private int carCount; | |
| 22 | - | |
| 23 | - public String getLineCode() { | |
| 24 | - return lineCode; | |
| 25 | - } | |
| 26 | - | |
| 27 | - public void setLineCode(String lineCode) { | |
| 28 | - this.lineCode = lineCode; | |
| 29 | - } | |
| 30 | - | |
| 31 | - public String getLineName() { | |
| 32 | - return lineName; | |
| 33 | - } | |
| 34 | - | |
| 35 | - public void setLineName(String lineName) { | |
| 36 | - this.lineName = lineName; | |
| 37 | - } | |
| 38 | - | |
| 39 | - public String getMonth() { | |
| 40 | - return month; | |
| 41 | - } | |
| 42 | - | |
| 43 | - public void setMonth(String month) { | |
| 44 | - this.month = month; | |
| 45 | - } | |
| 46 | - | |
| 47 | - public String getScheduleDate() { | |
| 48 | - return scheduleDate; | |
| 49 | - } | |
| 50 | - | |
| 51 | - public void setScheduleDate(String scheduleDate) { | |
| 52 | - this.scheduleDate = scheduleDate; | |
| 53 | - } | |
| 54 | - | |
| 55 | - public int getDriverCount() { | |
| 56 | - return driverCount; | |
| 57 | - } | |
| 58 | - | |
| 59 | - public void setDriverCount(int driverCount) { | |
| 60 | - this.driverCount = driverCount; | |
| 61 | - } | |
| 62 | - | |
| 63 | - public int getConductorCount() { | |
| 64 | - return conductorCount; | |
| 65 | - } | |
| 66 | - | |
| 67 | - public void setConductorCount(int conductorCount) { | |
| 68 | - this.conductorCount = conductorCount; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public int getCarCount() { | |
| 72 | - return carCount; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public void setCarCount(int carCount) { | |
| 76 | - this.carCount = carCount; | |
| 77 | - } | |
| 78 | -} | |
| 1 | +package com.bsth.server_rs.dks; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 线路运营司、售、车辆配档信息 | |
| 5 | + * @author Hill | |
| 6 | + */ | |
| 7 | +public class LineServiceConfig { | |
| 8 | + | |
| 9 | + private String lineCode; | |
| 10 | + | |
| 11 | + private String lineName; | |
| 12 | + | |
| 13 | + private String month; | |
| 14 | + | |
| 15 | + private String scheduleDate; | |
| 16 | + | |
| 17 | + private int driverCount; | |
| 18 | + | |
| 19 | + private int conductorCount; | |
| 20 | + | |
| 21 | + private int carCount; | |
| 22 | + | |
| 23 | + private String carCodes; | |
| 24 | + | |
| 25 | + public String getLineCode() { | |
| 26 | + return lineCode; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public void setLineCode(String lineCode) { | |
| 30 | + this.lineCode = lineCode; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public String getLineName() { | |
| 34 | + return lineName; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public void setLineName(String lineName) { | |
| 38 | + this.lineName = lineName; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public String getMonth() { | |
| 42 | + return month; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setMonth(String month) { | |
| 46 | + this.month = month; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public String getScheduleDate() { | |
| 50 | + return scheduleDate; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setScheduleDate(String scheduleDate) { | |
| 54 | + this.scheduleDate = scheduleDate; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public int getDriverCount() { | |
| 58 | + return driverCount; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setDriverCount(int driverCount) { | |
| 62 | + this.driverCount = driverCount; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public int getConductorCount() { | |
| 66 | + return conductorCount; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public void setConductorCount(int conductorCount) { | |
| 70 | + this.conductorCount = conductorCount; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public int getCarCount() { | |
| 74 | + return carCount; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setCarCount(int carCount) { | |
| 78 | + this.carCount = carCount; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public String getCarCodes() { | |
| 82 | + return carCodes; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public void setCarCodes(String carCodes) { | |
| 86 | + this.carCodes = carCodes; | |
| 87 | + } | |
| 88 | +} | ... | ... |