Commit 7838805faaf1af944b0ae00033cb1fbdceaf78aa
1 parent
71e82ae3
Update
Showing
6 changed files
with
93 additions
and
23 deletions
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
| ... | ... | @@ -157,6 +157,7 @@ public class SchedulePlanInfo { |
| 157 | 157 | Line xl, |
| 158 | 158 | ScheduleResult_output scheduleResult_output, |
| 159 | 159 | TTInfoDetail ttInfoDetail, |
| 160 | + Boolean isFb, | |
| 160 | 161 | CarConfigInfo carConfigInfo, |
| 161 | 162 | List<EmployeeConfigInfo> employeeConfigInfoList, |
| 162 | 163 | SchedulePlan schedulePlan) { |
| ... | ... | @@ -191,7 +192,7 @@ public class SchedulePlanInfo { |
| 191 | 192 | // TODO:报道时间,出场时间没有 |
| 192 | 193 | // 关联的驾驶员 |
| 193 | 194 | EmployeeConfigInfo employeeConfigInfo = null; |
| 194 | - if (ttInfoDetail.getIsFB()) { | |
| 195 | + if (isFb) { | |
| 195 | 196 | if (employeeConfigInfoList.size() > 1) { |
| 196 | 197 | employeeConfigInfo = employeeConfigInfoList.get(1); |
| 197 | 198 | } else { | ... | ... |
src/main/java/com/bsth/repository/schedule/SchedulePlanInfoRepository.java
| ... | ... | @@ -33,17 +33,18 @@ public interface SchedulePlanInfoRepository extends BaseRepository<SchedulePlanI |
| 33 | 33 | "lp_name as lpName, " + |
| 34 | 34 | "cl as clId, " + |
| 35 | 35 | "cl_zbh as clZbh, " + |
| 36 | - "group_concat(distinct fcsj) ccsj, " + | |
| 36 | + "group_concat(fcsj) ccsj, " + | |
| 37 | + "group_concat(bc_type) bctype, " + | |
| 37 | 38 | "group_concat(distinct j) jsyId, " + |
| 38 | 39 | "group_concat(distinct j_gh) jsyGh, " + |
| 39 | 40 | "group_concat(distinct j_name) jsyName, " + |
| 40 | 41 | "group_concat(distinct s) spyId, " + |
| 41 | 42 | "group_concat(distinct s_gh) spyGh, " + |
| 42 | 43 | "group_concat(distinct s_name) spyName, " + |
| 43 | - "max(create_date) as createDate " + | |
| 44 | + "max(create_date) as createDate, " + | |
| 45 | + "group_concat(fcno) fcno " + | |
| 44 | 46 | "from bsth_c_s_sp_info " + |
| 45 | - "where bc_type = 'out' and " + | |
| 46 | - "xl = ?1 and " + | |
| 47 | + "where xl = ?1 and " + | |
| 47 | 48 | "schedule_date = ?2 " + |
| 48 | 49 | "group by xl_name, schedule_date, lp, lp_name, cl, cl_zbh " + |
| 49 | 50 | "order by xl_name, schedule_date, lp ", nativeQuery = true) |
| ... | ... | @@ -71,14 +72,16 @@ public interface SchedulePlanInfoRepository extends BaseRepository<SchedulePlanI |
| 71 | 72 | "scpinfo.scheduleDate = :p3 and " + |
| 72 | 73 | "scpinfo.lpName = :p4 and " + |
| 73 | 74 | "scpinfo.fcsj = :p5 and " + |
| 74 | - "scpinfo.bcType = :p6 ") | |
| 75 | + "scpinfo.bcType = :p6 and " + | |
| 76 | + "scpinfo.fcno = :p7 " ) | |
| 75 | 77 | int updateGroupInfo_type_2_4( |
| 76 | 78 | @Param("p1") String fcsj, |
| 77 | 79 | @Param("p2") Integer xlid, |
| 78 | 80 | @Param("p3") Date scheduleDate, |
| 79 | 81 | @Param("p4") String lpName, |
| 80 | 82 | @Param("p5") String fcsj_src, |
| 81 | - @Param("p6") String bcType); | |
| 83 | + @Param("p6") String bcType, | |
| 84 | + @Param("p7") Integer fcno); | |
| 82 | 85 | |
| 83 | 86 | @Modifying |
| 84 | 87 | @Query(value = "update " + | ... | ... |
src/main/java/com/bsth/service/schedule/SchedulePlanInfoService.java
| ... | ... | @@ -4,6 +4,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo; |
| 4 | 4 | import com.bsth.service.BaseService; |
| 5 | 5 | import org.joda.time.DateTime; |
| 6 | 6 | |
| 7 | +import java.util.ArrayList; | |
| 7 | 8 | import java.util.Date; |
| 8 | 9 | import java.util.List; |
| 9 | 10 | |
| ... | ... | @@ -117,6 +118,11 @@ public interface SchedulePlanInfoService extends BaseService<SchedulePlanInfo, L |
| 117 | 118 | /** 创建时间 */ |
| 118 | 119 | private Date createDate; |
| 119 | 120 | |
| 121 | + /** 出场班次1发车的顺序号 */ | |
| 122 | + private Integer fcno1; | |
| 123 | + /** 出场班次2发车的顺序号 */ | |
| 124 | + private Integer fcno2; | |
| 125 | + | |
| 120 | 126 | public GroupInfo() {} |
| 121 | 127 | |
| 122 | 128 | public GroupInfo(Object[] datas) { |
| ... | ... | @@ -132,19 +138,40 @@ public interface SchedulePlanInfoService extends BaseService<SchedulePlanInfo, L |
| 132 | 138 | this.clId = Integer.valueOf(String.valueOf(datas[4])); |
| 133 | 139 | // 车辆自编号 |
| 134 | 140 | this.clZbh = String.valueOf(datas[5]); |
| 135 | - // 出场时间,如果有多个,需要分开 | |
| 141 | + // 出场时间,出场班次,如果有多个,需要分开 | |
| 136 | 142 | Object ccsj = datas[6]; |
| 143 | + Object bctype = datas[7]; | |
| 144 | + Object fcno = datas[15]; | |
| 145 | + | |
| 137 | 146 | if (ccsj != null) { |
| 138 | 147 | String[] ccsj_array = ((String) ccsj).split(","); |
| 139 | - if (ccsj_array.length > 1) { | |
| 140 | - this.ccsj1 = String.valueOf(ccsj_array[0]); | |
| 141 | - this.ccsj2 = String.valueOf(ccsj_array[1]); | |
| 142 | - } else { | |
| 143 | - this.ccsj1 = String.valueOf(ccsj_array[0]); | |
| 148 | + String[] bctype_array = ((String) bctype).split(","); | |
| 149 | + String[] fcno_array = ((String) fcno).split(","); | |
| 150 | + List<Integer> bctype_index = new ArrayList<>(); | |
| 151 | + | |
| 152 | + for (int i = 0; i < bctype_array.length; i++) { | |
| 153 | + if (bctype_index.size() == 2) { // 只记录2个出场 | |
| 154 | + break; | |
| 155 | + } | |
| 156 | + if (bctype_array[i].equals("out")) { | |
| 157 | + bctype_index.add(i); | |
| 158 | + } | |
| 159 | + } | |
| 160 | + | |
| 161 | + if (bctype_index.size() == 1) { | |
| 162 | + this.ccsj1 = String.valueOf(ccsj_array[bctype_index.get(0)]); | |
| 163 | + this.fcno1 = Integer.valueOf(fcno_array[bctype_index.get(0)]); | |
| 164 | + } else if (bctype_index.size() == 2) { | |
| 165 | + this.ccsj1 = String.valueOf(ccsj_array[bctype_index.get(0)]); | |
| 166 | + this.ccsj2 = String.valueOf(ccsj_array[bctype_index.get(1)]); | |
| 167 | + | |
| 168 | + this.fcno1 = Integer.valueOf(fcno_array[bctype_index.get(0)]); | |
| 169 | + this.fcno2 = Integer.valueOf(fcno_array[bctype_index.get(1)]); | |
| 144 | 170 | } |
| 171 | + | |
| 145 | 172 | } |
| 146 | 173 | // 驾驶员id,如果有多个,需要分开 |
| 147 | - Object jsyId = datas[7]; | |
| 174 | + Object jsyId = datas[8]; | |
| 148 | 175 | if (jsyId != null) { |
| 149 | 176 | String[] jsyId_array = ((String) jsyId).split(","); |
| 150 | 177 | if (jsyId_array.length > 1) { |
| ... | ... | @@ -155,7 +182,7 @@ public interface SchedulePlanInfoService extends BaseService<SchedulePlanInfo, L |
| 155 | 182 | } |
| 156 | 183 | } |
| 157 | 184 | // 驾驶员工号,如果有多个,需要分开 |
| 158 | - Object jsyGh = datas[8]; | |
| 185 | + Object jsyGh = datas[9]; | |
| 159 | 186 | if (jsyGh != null) { |
| 160 | 187 | String[] jsyGh_array = ((String) jsyGh).split(","); |
| 161 | 188 | if (jsyGh_array.length > 1) { |
| ... | ... | @@ -166,7 +193,7 @@ public interface SchedulePlanInfoService extends BaseService<SchedulePlanInfo, L |
| 166 | 193 | } |
| 167 | 194 | } |
| 168 | 195 | // 驾驶员名字,如果有多个,需要分开 |
| 169 | - Object jsyName = datas[9]; | |
| 196 | + Object jsyName = datas[10]; | |
| 170 | 197 | if (jsyName != null) { |
| 171 | 198 | String[] jsyName_array = ((String) jsyName).split(","); |
| 172 | 199 | if (jsyName_array.length > 1) { |
| ... | ... | @@ -178,7 +205,7 @@ public interface SchedulePlanInfoService extends BaseService<SchedulePlanInfo, L |
| 178 | 205 | } |
| 179 | 206 | |
| 180 | 207 | // 售票员id,如果有多个,需要分开 |
| 181 | - Object spyId = datas[10]; | |
| 208 | + Object spyId = datas[11]; | |
| 182 | 209 | if (spyId != null) { |
| 183 | 210 | String[] spyId_array = ((String) spyId).split(","); |
| 184 | 211 | if (spyId_array.length > 1) { |
| ... | ... | @@ -190,7 +217,7 @@ public interface SchedulePlanInfoService extends BaseService<SchedulePlanInfo, L |
| 190 | 217 | } |
| 191 | 218 | |
| 192 | 219 | // 售票员工号,如果有多个,需要分开 |
| 193 | - Object spyGh = datas[11]; | |
| 220 | + Object spyGh = datas[12]; | |
| 194 | 221 | if (spyGh != null) { |
| 195 | 222 | String[] spyGh_array = ((String) spyGh).split(","); |
| 196 | 223 | if (spyGh_array.length > 1) { |
| ... | ... | @@ -201,7 +228,7 @@ public interface SchedulePlanInfoService extends BaseService<SchedulePlanInfo, L |
| 201 | 228 | } |
| 202 | 229 | } |
| 203 | 230 | // 售票员名字,如果有多个,需要分开 |
| 204 | - Object spyName = datas[12]; | |
| 231 | + Object spyName = datas[13]; | |
| 205 | 232 | if (spyName != null) { |
| 206 | 233 | String[] spyName_array = ((String) spyName).split(","); |
| 207 | 234 | if (spyName_array.length > 1) { |
| ... | ... | @@ -212,7 +239,7 @@ public interface SchedulePlanInfoService extends BaseService<SchedulePlanInfo, L |
| 212 | 239 | } |
| 213 | 240 | } |
| 214 | 241 | // 创建时间 |
| 215 | - this.createDate = new DateTime(datas[13]).toDate(); | |
| 242 | + this.createDate = new DateTime(datas[14]).toDate(); | |
| 216 | 243 | |
| 217 | 244 | // TODO:可能还有其他字段 |
| 218 | 245 | } |
| ... | ... | @@ -384,5 +411,21 @@ public interface SchedulePlanInfoService extends BaseService<SchedulePlanInfo, L |
| 384 | 411 | public void setXlId(Integer xlId) { |
| 385 | 412 | this.xlId = xlId; |
| 386 | 413 | } |
| 414 | + | |
| 415 | + public Integer getFcno1() { | |
| 416 | + return fcno1; | |
| 417 | + } | |
| 418 | + | |
| 419 | + public void setFcno1(Integer fcno1) { | |
| 420 | + this.fcno1 = fcno1; | |
| 421 | + } | |
| 422 | + | |
| 423 | + public Integer getFcno2() { | |
| 424 | + return fcno2; | |
| 425 | + } | |
| 426 | + | |
| 427 | + public void setFcno2(Integer fcno2) { | |
| 428 | + this.fcno2 = fcno2; | |
| 429 | + } | |
| 387 | 430 | } |
| 388 | 431 | } | ... | ... |
src/main/java/com/bsth/service/schedule/SchedulePlanInfoServiceImpl.java
| ... | ... | @@ -55,7 +55,8 @@ public class SchedulePlanInfoServiceImpl extends BaseServiceImpl<SchedulePlanInf |
| 55 | 55 | groupInfoUpdate.getUpdate().getScheduleDate(), |
| 56 | 56 | groupInfoUpdate.getSrc().getLpName(), |
| 57 | 57 | groupInfoUpdate.getSrc().getCcsj1(), |
| 58 | - "out" | |
| 58 | + "out", | |
| 59 | + groupInfoUpdate.getSrc().getFcno1() | |
| 59 | 60 | ); |
| 60 | 61 | } |
| 61 | 62 | |
| ... | ... | @@ -94,7 +95,8 @@ public class SchedulePlanInfoServiceImpl extends BaseServiceImpl<SchedulePlanInf |
| 94 | 95 | groupInfoUpdate.getUpdate().getScheduleDate(), |
| 95 | 96 | groupInfoUpdate.getSrc().getLpName(), |
| 96 | 97 | groupInfoUpdate.getSrc().getCcsj2(), |
| 97 | - "out" | |
| 98 | + "out", | |
| 99 | + groupInfoUpdate.getSrc().getFcno2() | |
| 98 | 100 | ); |
| 99 | 101 | } |
| 100 | 102 | ... | ... |
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
| ... | ... | @@ -119,13 +119,28 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im |
| 119 | 119 | employeeConfigInfoList.add(employeeConfigMaps.get(Long.valueOf(eid))); |
| 120 | 120 | } |
| 121 | 121 | // 排班明细(这个要迭代的) |
| 122 | - Collection<TTInfoDetail> ttInfoDetails = gbdTTinfoMaps.get(scheduleResult_output.getSd().toDate()).get( | |
| 122 | + Collection<TTInfoDetail> ttInfoDetails_ = gbdTTinfoMaps.get(scheduleResult_output.getSd().toDate()).get( | |
| 123 | 123 | Long.parseLong(scheduleResult_output.getGuideboardId())); |
| 124 | + List<TTInfoDetail> ttInfoDetails = new ArrayList<>(ttInfoDetails_); | |
| 125 | + | |
| 126 | + // 排序ttInfoDetails | |
| 127 | + Collections.sort(ttInfoDetails, new Comparator<TTInfoDetail>() { | |
| 128 | + @Override | |
| 129 | + public int compare(TTInfoDetail o1, TTInfoDetail o2) { | |
| 130 | + return o1.getFcno().compareTo(o2.getFcno()); | |
| 131 | + } | |
| 132 | + }); | |
| 133 | + | |
| 134 | + Boolean isFb = false; // 是否分班 | |
| 124 | 135 | for (TTInfoDetail ttInfoDetail : ttInfoDetails) { |
| 136 | + if (ttInfoDetail.getIsFB()) | |
| 137 | + isFb = ttInfoDetail.getIsFB(); | |
| 138 | + | |
| 125 | 139 | SchedulePlanInfo schedulePlanInfo = new SchedulePlanInfo( |
| 126 | 140 | xl, |
| 127 | 141 | scheduleResult_output, |
| 128 | 142 | ttInfoDetail, |
| 143 | + isFb, | |
| 129 | 144 | configInfo, |
| 130 | 145 | employeeConfigInfoList, |
| 131 | 146 | schedulePlan); |
| ... | ... | @@ -138,6 +153,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im |
| 138 | 153 | |
| 139 | 154 | schedulePlanInfos.add(schedulePlanInfo); |
| 140 | 155 | ttInfoMap.put(ttInfoDetail.getTtinfo().getId(), ttInfoDetail.getTtinfo().getName()); |
| 156 | + | |
| 141 | 157 | } |
| 142 | 158 | } |
| 143 | 159 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html
| ... | ... | @@ -12,6 +12,7 @@ |
| 12 | 12 | <th style="width: 150px;">驾驶员(工号)</th> |
| 13 | 13 | <th style="width: 150px;">售票员(工号)</th> |
| 14 | 14 | <th style="width: 80px;">班次类型</th> |
| 15 | + <th style="width: 80px;">上下行</th> | |
| 15 | 16 | <th style="width: 80px;">发车时间</th> |
| 16 | 17 | <th style="width: 100%">时刻表</th> |
| 17 | 18 | |
| ... | ... | @@ -42,6 +43,7 @@ |
| 42 | 43 | <td></td> |
| 43 | 44 | <td></td> |
| 44 | 45 | <td></td> |
| 46 | + <td></td> | |
| 45 | 47 | |
| 46 | 48 | </tr> |
| 47 | 49 | </thead> |
| ... | ... | @@ -74,6 +76,9 @@ |
| 74 | 76 | <span ng-bind="info.bcType | dict:'ScheduleType':'未知' "></span> |
| 75 | 77 | </td> |
| 76 | 78 | <td> |
| 79 | + <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span> | |
| 80 | + </td> | |
| 81 | + <td> | |
| 77 | 82 | <span ng-bind="info.fcsj"></span> |
| 78 | 83 | </td> |
| 79 | 84 | <td> | ... | ... |