Commit 901c1349660ab7c2df7f8999bec3c6ff96f446a7
1 parent
d56180d5
1、调度值勤日报添加新的类似时刻表的排班视图
Showing
14 changed files
with
948 additions
and
30 deletions
src/main/java/com/bsth/controller/schedule/core/legacy/SchedulePlanInfoController.java
| @@ -37,6 +37,25 @@ public class SchedulePlanInfoController extends BController<SchedulePlanInfo, Lo | @@ -37,6 +37,25 @@ public class SchedulePlanInfoController extends BController<SchedulePlanInfo, Lo | ||
| 37 | MyHttpUtils.responseStreamFile(response, dataToolsFile.getFile()); | 37 | MyHttpUtils.responseStreamFile(response, dataToolsFile.getFile()); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | + // 获取排班计划时刻表显示用数据 | ||
| 41 | + @GetMapping(value = "/saPlanInfoView/data/{xlid}/{date}") | ||
| 42 | + public Map<String, Object> getDirectiveDataWithPlanInfo( | ||
| 43 | + @PathVariable(value = "xlid") Integer xlid, | ||
| 44 | + @PathVariable(value = "date") Date scheduleDate) { | ||
| 45 | + Map<String, Object> resultMap = new HashMap<>(); | ||
| 46 | + try { | ||
| 47 | + resultMap.put("status", ResponseCode.SUCCESS); | ||
| 48 | + resultMap.put("data", this.schedulePlanInfoService.getDirectiveDataWithPlanInfo(xlid, scheduleDate)); | ||
| 49 | + | ||
| 50 | + } catch (Exception exp) { | ||
| 51 | + exp.printStackTrace(); | ||
| 52 | + resultMap.put("status", ResponseCode.ERROR); | ||
| 53 | + resultMap.put("msg", exp.getLocalizedMessage()); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + return resultMap; | ||
| 57 | + } | ||
| 58 | + | ||
| 40 | @RequestMapping(value = "/groupextinfos/{xlid}/{date}", method = RequestMethod.GET) | 59 | @RequestMapping(value = "/groupextinfos/{xlid}/{date}", method = RequestMethod.GET) |
| 41 | public Map<String, Object> findGroupInfoExt( | 60 | public Map<String, Object> findGroupInfoExt( |
| 42 | @PathVariable(value = "xlid") Integer xlid, | 61 | @PathVariable(value = "xlid") Integer xlid, |
src/main/java/com/bsth/service/schedule/SchedulePlanInfoService.java
| 1 | package com.bsth.service.schedule; | 1 | package com.bsth.service.schedule; |
| 2 | 2 | ||
| 3 | import com.bsth.entity.schedule.SchedulePlanInfo; | 3 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 4 | +import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; | ||
| 4 | import com.bsth.service.schedule.exception.ScheduleException; | 5 | import com.bsth.service.schedule.exception.ScheduleException; |
| 5 | import com.bsth.service.schedule.utils.DataToolsFile; | 6 | import com.bsth.service.schedule.utils.DataToolsFile; |
| 6 | import org.apache.commons.lang3.StringUtils; | 7 | import org.apache.commons.lang3.StringUtils; |
| @@ -28,6 +29,16 @@ public interface SchedulePlanInfoService extends BService<SchedulePlanInfo, Long | @@ -28,6 +29,16 @@ public interface SchedulePlanInfoService extends BService<SchedulePlanInfo, Long | ||
| 28 | DataToolsFile exportPlanTimetableInfo(Integer xlId, Date scheduleDate) throws ScheduleException; | 29 | DataToolsFile exportPlanTimetableInfo(Integer xlId, Date scheduleDate) throws ScheduleException; |
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 32 | + * 获取排班计划时刻表显示用数据。 | ||
| 33 | + * @param xlId 线路Id | ||
| 34 | + * @param scheduleDate 排班日期 | ||
| 35 | + * @return | ||
| 36 | + * @throws ScheduleException | ||
| 37 | + */ | ||
| 38 | + TTInfoDetailForEdit.EditInfo getDirectiveDataWithPlanInfo( | ||
| 39 | + Integer xlId, Date scheduleDate) throws ScheduleException; | ||
| 40 | + | ||
| 41 | + /** | ||
| 31 | * 查找最近的排班的日期。 | 42 | * 查找最近的排班的日期。 |
| 32 | * @param xlId 线路Id | 43 | * @param xlId 线路Id |
| 33 | * @return | 44 | * @return |
src/main/java/com/bsth/service/schedule/impl/SchedulePlanInfoServiceImpl.java
| @@ -4,9 +4,11 @@ import com.bsth.entity.schedule.SchedulePlanInfo; | @@ -4,9 +4,11 @@ import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 4 | import com.bsth.repository.LineRepository; | 4 | import com.bsth.repository.LineRepository; |
| 5 | import com.bsth.repository.schedule.SchedulePlanInfoRepository; | 5 | import com.bsth.repository.schedule.SchedulePlanInfoRepository; |
| 6 | import com.bsth.service.schedule.SchedulePlanInfoService; | 6 | import com.bsth.service.schedule.SchedulePlanInfoService; |
| 7 | +import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; | ||
| 7 | import com.bsth.service.schedule.exception.ScheduleException; | 8 | import com.bsth.service.schedule.exception.ScheduleException; |
| 8 | import com.bsth.service.schedule.timetable.TimetableExcelData; | 9 | import com.bsth.service.schedule.timetable.TimetableExcelData; |
| 9 | import com.bsth.service.schedule.timetable.strategy.impl.TimetableExcelWithPlanInfoExportStrategyImpl; | 10 | import com.bsth.service.schedule.timetable.strategy.impl.TimetableExcelWithPlanInfoExportStrategyImpl; |
| 11 | +import com.bsth.service.schedule.timetable.strategy.impl.TimetableExcelWithPlanInfoViewStrategyImpl; | ||
| 10 | import com.bsth.service.schedule.utils.DataToolsFile; | 12 | import com.bsth.service.schedule.utils.DataToolsFile; |
| 11 | import com.bsth.service.schedule.utils.DataToolsProperties; | 13 | import com.bsth.service.schedule.utils.DataToolsProperties; |
| 12 | import com.bsth.service.schedule.utils.DataToolsService; | 14 | import com.bsth.service.schedule.utils.DataToolsService; |
| @@ -57,6 +59,19 @@ public class SchedulePlanInfoServiceImpl extends BServiceImpl<SchedulePlanInfo, | @@ -57,6 +59,19 @@ public class SchedulePlanInfoServiceImpl extends BServiceImpl<SchedulePlanInfo, | ||
| 57 | } | 59 | } |
| 58 | 60 | ||
| 59 | @Override | 61 | @Override |
| 62 | + public TTInfoDetailForEdit.EditInfo getDirectiveDataWithPlanInfo(Integer xlId, Date scheduleDate) throws ScheduleException { | ||
| 63 | + TimetableExcelData timetableExcelData = TimetableExcelData.withPlanInfoExcelViewBuilder() | ||
| 64 | + .setXlId(xlId) | ||
| 65 | + .setScheduleDate(scheduleDate) | ||
| 66 | + .setLineRepository(this.lineRepository) | ||
| 67 | + .setDataToolsService(this.dataToolsService) | ||
| 68 | + .setDataToolsProperties(this.dataToolsProperties) | ||
| 69 | + .setTimetableExcelWithPlanInfoViewStrategy(new TimetableExcelWithPlanInfoViewStrategyImpl()) | ||
| 70 | + .build(); | ||
| 71 | + return timetableExcelData.doGetDirectiveDataWithPlanInfo(); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + @Override | ||
| 60 | public SchedulePlanInfo save(SchedulePlanInfo schedulePlanInfo) { | 75 | public SchedulePlanInfo save(SchedulePlanInfo schedulePlanInfo) { |
| 61 | // 生成计划不是save,使用的是spring batch插入的 | 76 | // 生成计划不是save,使用的是spring batch插入的 |
| 62 | // 这里是单独修改的时候,需要记录修改次数,用于标识被修改过 | 77 | // 这里是单独修改的时候,需要记录修改次数,用于标识被修改过 |
src/main/java/com/bsth/service/schedule/timetable/TimetableExcelData.java
| @@ -11,11 +11,10 @@ import com.bsth.repository.schedule.TTInfoRepository; | @@ -11,11 +11,10 @@ import com.bsth.repository.schedule.TTInfoRepository; | ||
| 11 | import com.bsth.service.LineService; | 11 | import com.bsth.service.LineService; |
| 12 | import com.bsth.service.LsStationRouteService; | 12 | import com.bsth.service.LsStationRouteService; |
| 13 | import com.bsth.service.schedule.GuideboardInfoService; | 13 | import com.bsth.service.schedule.GuideboardInfoService; |
| 14 | +import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; | ||
| 14 | import com.bsth.service.schedule.exception.ScheduleException; | 15 | import com.bsth.service.schedule.exception.ScheduleException; |
| 15 | -import com.bsth.service.schedule.timetable.strategy.TimetableExcelDataImportStrategy; | ||
| 16 | -import com.bsth.service.schedule.timetable.strategy.TimetableExcelDataValidateStrategy; | ||
| 17 | -import com.bsth.service.schedule.timetable.strategy.TimetableExcelPVDataExportStrategy; | ||
| 18 | -import com.bsth.service.schedule.timetable.strategy.TimetableExcelWithPlanInfoExportStrategy; | 16 | +import com.bsth.service.schedule.timetable.strategy.*; |
| 17 | +import com.bsth.service.schedule.timetable.strategy.impl.TimetableExcelWithPlanInfoViewStrategyImpl; | ||
| 19 | import com.bsth.service.schedule.utils.*; | 18 | import com.bsth.service.schedule.utils.*; |
| 20 | import org.apache.commons.lang3.StringUtils; | 19 | import org.apache.commons.lang3.StringUtils; |
| 21 | import org.apache.poi.ss.usermodel.Sheet; | 20 | import org.apache.poi.ss.usermodel.Sheet; |
| @@ -27,10 +26,7 @@ import org.springframework.util.Assert; | @@ -27,10 +26,7 @@ import org.springframework.util.Assert; | ||
| 27 | import org.springframework.util.CollectionUtils; | 26 | import org.springframework.util.CollectionUtils; |
| 28 | 27 | ||
| 29 | import java.io.File; | 28 | import java.io.File; |
| 30 | -import java.util.Date; | ||
| 31 | -import java.util.HashMap; | ||
| 32 | -import java.util.List; | ||
| 33 | -import java.util.Map; | 29 | +import java.util.*; |
| 34 | 30 | ||
| 35 | /** | 31 | /** |
| 36 | * 时刻表Excel数据类,用于验证,导入,导出时刻表数据。 | 32 | * 时刻表Excel数据类,用于验证,导入,导出时刻表数据。 |
| @@ -180,7 +176,6 @@ public class TimetableExcelData { | @@ -180,7 +176,6 @@ public class TimetableExcelData { | ||
| 180 | 176 | ||
| 181 | /** 导出策略 */ | 177 | /** 导出策略 */ |
| 182 | private TimetableExcelWithPlanInfoExportStrategy timetableExcelWithPlanInfoExportStrategy; | 178 | private TimetableExcelWithPlanInfoExportStrategy timetableExcelWithPlanInfoExportStrategy; |
| 183 | - | ||
| 184 | /** | 179 | /** |
| 185 | * 导出排班时刻表数据。 | 180 | * 导出排班时刻表数据。 |
| 186 | */ | 181 | */ |
| @@ -192,6 +187,30 @@ public class TimetableExcelData { | @@ -192,6 +187,30 @@ public class TimetableExcelData { | ||
| 192 | this.dataToolsProperties); | 187 | this.dataToolsProperties); |
| 193 | } | 188 | } |
| 194 | 189 | ||
| 190 | + // ------------------ 获取显示排班时刻表数据相关属性及方法,如下:----------------- // | ||
| 191 | + /** | ||
| 192 | + * 注意:line共用验证相关属性 | ||
| 193 | + */ | ||
| 194 | + /** | ||
| 195 | + * 注意:schedule共用导出排班时刻表相关属性 | ||
| 196 | + */ | ||
| 197 | + /** | ||
| 198 | + * 注意:dataToolsService和dataToolsProperties共用导入相关属性 | ||
| 199 | + */ | ||
| 200 | + | ||
| 201 | + /** 获取显示数据策略 */ | ||
| 202 | + private TimetableExcelWithPlanInfoViewStrategy timetableExcelWithPlanInfoViewStrategy; | ||
| 203 | + /** | ||
| 204 | + * 获取前端angular指令用数据。 | ||
| 205 | + */ | ||
| 206 | + public TTInfoDetailForEdit.EditInfo doGetDirectiveDataWithPlanInfo() throws ScheduleException { | ||
| 207 | + return this.timetableExcelWithPlanInfoViewStrategy.doGetDirectiveDataWithPlanInfo( | ||
| 208 | + this.line, | ||
| 209 | + this.scheduleDate, | ||
| 210 | + this.dataToolsService, | ||
| 211 | + this.dataToolsProperties); | ||
| 212 | + } | ||
| 213 | + | ||
| 195 | // ----------- 构造函数 ---------- // | 214 | // ----------- 构造函数 ---------- // |
| 196 | public TimetableExcelData(ValidateBuilder validateBuilder) { | 215 | public TimetableExcelData(ValidateBuilder validateBuilder) { |
| 197 | // 公共属性 | 216 | // 公共属性 |
| @@ -249,6 +268,17 @@ public class TimetableExcelData { | @@ -249,6 +268,17 @@ public class TimetableExcelData { | ||
| 249 | planInfoExcelExportBuilder.timetableExcelWithPlanInfoExportStrategy; | 268 | planInfoExcelExportBuilder.timetableExcelWithPlanInfoExportStrategy; |
| 250 | } | 269 | } |
| 251 | 270 | ||
| 271 | + public TimetableExcelData(PlanInfoExcelViewBuilder planInfoExcelViewBuilder) { | ||
| 272 | + // 公共属性 | ||
| 273 | + this.line = planInfoExcelViewBuilder.line; | ||
| 274 | + this.scheduleDate = planInfoExcelViewBuilder.scheduleDate; | ||
| 275 | + this.dataToolsService = planInfoExcelViewBuilder.dataToolsService; | ||
| 276 | + this.dataToolsProperties = planInfoExcelViewBuilder.dataToolsProperties; | ||
| 277 | + // 获取显示数据策略 | ||
| 278 | + this.timetableExcelWithPlanInfoViewStrategy = | ||
| 279 | + planInfoExcelViewBuilder.timetableExcelWithPlanInfoViewStrategy; | ||
| 280 | + } | ||
| 281 | + | ||
| 252 | // ----------- builder类 ----------- // | 282 | // ----------- builder类 ----------- // |
| 253 | public static ValidateBuilder withValidateBuilder() { | 283 | public static ValidateBuilder withValidateBuilder() { |
| 254 | return new ValidateBuilder(); | 284 | return new ValidateBuilder(); |
| @@ -681,4 +711,75 @@ public class TimetableExcelData { | @@ -681,4 +711,75 @@ public class TimetableExcelData { | ||
| 681 | 711 | ||
| 682 | } | 712 | } |
| 683 | 713 | ||
| 714 | + public static PlanInfoExcelViewBuilder withPlanInfoExcelViewBuilder() { | ||
| 715 | + return new PlanInfoExcelViewBuilder(); | ||
| 716 | + } | ||
| 717 | + public static class PlanInfoExcelViewBuilder { | ||
| 718 | + private PlanInfoExcelViewBuilder() {} | ||
| 719 | + | ||
| 720 | + /** 线路 */ | ||
| 721 | + private Integer xlId; | ||
| 722 | + /** 排班日期 */ | ||
| 723 | + private Date scheduleDate; | ||
| 724 | + /** 线路repo */ | ||
| 725 | + private LineRepository lineRepository; | ||
| 726 | + /** 数据工具服务 */ | ||
| 727 | + private DataToolsService dataToolsService; | ||
| 728 | + /** 配置数据导入导出用到的配置信息 */ | ||
| 729 | + private DataToolsProperties dataToolsProperties; | ||
| 730 | + /** view策略 */ | ||
| 731 | + private TimetableExcelWithPlanInfoViewStrategyImpl timetableExcelWithPlanInfoViewStrategy; | ||
| 732 | + | ||
| 733 | + public PlanInfoExcelViewBuilder setXlId(Integer xlId) { | ||
| 734 | + this.xlId = xlId; | ||
| 735 | + return this; | ||
| 736 | + } | ||
| 737 | + | ||
| 738 | + public PlanInfoExcelViewBuilder setScheduleDate(Date scheduleDate) { | ||
| 739 | + this.scheduleDate = scheduleDate; | ||
| 740 | + return this; | ||
| 741 | + } | ||
| 742 | + | ||
| 743 | + public PlanInfoExcelViewBuilder setLineRepository(LineRepository lineRepository) { | ||
| 744 | + this.lineRepository = lineRepository; | ||
| 745 | + return this; | ||
| 746 | + } | ||
| 747 | + | ||
| 748 | + public PlanInfoExcelViewBuilder setDataToolsService(DataToolsService dataToolsService) { | ||
| 749 | + this.dataToolsService = dataToolsService; | ||
| 750 | + return this; | ||
| 751 | + } | ||
| 752 | + | ||
| 753 | + public PlanInfoExcelViewBuilder setDataToolsProperties(DataToolsProperties dataToolsProperties) { | ||
| 754 | + this.dataToolsProperties = dataToolsProperties; | ||
| 755 | + return this; | ||
| 756 | + } | ||
| 757 | + | ||
| 758 | + public PlanInfoExcelViewBuilder setTimetableExcelWithPlanInfoViewStrategy(TimetableExcelWithPlanInfoViewStrategyImpl timetableExcelWithPlanInfoViewStrategy) { | ||
| 759 | + this.timetableExcelWithPlanInfoViewStrategy = timetableExcelWithPlanInfoViewStrategy; | ||
| 760 | + return this; | ||
| 761 | + } | ||
| 762 | + | ||
| 763 | + // ---------------- 内部生成的属性 ---------------- // | ||
| 764 | + /** 线路信息 */ | ||
| 765 | + private Line line; | ||
| 766 | + | ||
| 767 | + public TimetableExcelData build() { | ||
| 768 | + // 1、参数验证 | ||
| 769 | + Assert.notNull(this.xlId, "线路Id为空!"); | ||
| 770 | + Assert.notNull(this.scheduleDate, "排班日期为空!"); | ||
| 771 | + Assert.notNull(this.lineRepository, "线路repo为空!"); | ||
| 772 | + Assert.notNull(this.dataToolsService, "数据工具服务为空!"); | ||
| 773 | + Assert.notNull(this.dataToolsProperties, "配置数据导入导出用到的配置信息为空!"); | ||
| 774 | + Assert.notNull(this.timetableExcelWithPlanInfoViewStrategy, "获取显示数据策略为空!"); | ||
| 775 | + | ||
| 776 | + // 2、获取线路信息 | ||
| 777 | + Optional<Line> optionalLine = this.lineRepository.findById(this.xlId); | ||
| 778 | + Assert.isTrue(optionalLine.isPresent(), "线路[id=" + this.xlId + "]为空!"); | ||
| 779 | + this.line = optionalLine.get(); | ||
| 780 | + | ||
| 781 | + return new TimetableExcelData(this); | ||
| 782 | + } | ||
| 783 | + } | ||
| 784 | + | ||
| 684 | } | 785 | } |
src/main/java/com/bsth/service/schedule/timetable/strategy/TimetableExcelWithPlanInfoViewStrategy.java
0 → 100644
| 1 | +package com.bsth.service.schedule.timetable.strategy; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.Line; | ||
| 4 | +import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; | ||
| 5 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 6 | +import com.bsth.service.schedule.utils.DataToolsProperties; | ||
| 7 | +import com.bsth.service.schedule.utils.DataToolsService; | ||
| 8 | + | ||
| 9 | +import java.util.Date; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 排班时刻数据(时刻表的格式,附加驾驶员,车牌信息)前端angular指令数据策略接口。 | ||
| 13 | + */ | ||
| 14 | +public interface TimetableExcelWithPlanInfoViewStrategy { | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * 获取前端angular指令用数据。 | ||
| 18 | + * @param xl 线路信息 | ||
| 19 | + * @param scheduleDate 排班日期 | ||
| 20 | + * @param dataToolsService dataToolsService | ||
| 21 | + * @param dataToolsProperties dataToolsProperties | ||
| 22 | + */ | ||
| 23 | + TTInfoDetailForEdit.EditInfo doGetDirectiveDataWithPlanInfo( | ||
| 24 | + Line xl, | ||
| 25 | + Date scheduleDate, | ||
| 26 | + DataToolsService dataToolsService, | ||
| 27 | + DataToolsProperties dataToolsProperties | ||
| 28 | + ) throws ScheduleException; | ||
| 29 | +} |
src/main/java/com/bsth/service/schedule/timetable/strategy/impl/TimetableExcelWithPlanInfoViewStrategyImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.timetable.strategy.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.Line; | ||
| 4 | +import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; | ||
| 5 | +import com.bsth.service.schedule.exception.ScheduleException; | ||
| 6 | +import com.bsth.service.schedule.timetable.strategy.TimetableExcelWithPlanInfoViewStrategy; | ||
| 7 | +import com.bsth.service.schedule.utils.*; | ||
| 8 | +import org.apache.poi.ss.usermodel.Row; | ||
| 9 | +import org.slf4j.Logger; | ||
| 10 | +import org.slf4j.LoggerFactory; | ||
| 11 | + | ||
| 12 | +import java.io.File; | ||
| 13 | +import java.time.ZoneId; | ||
| 14 | +import java.time.format.DateTimeFormatter; | ||
| 15 | +import java.util.*; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 排班时刻数据(时刻表的格式,附加驾驶员,车牌信息)前端angular指令数据策略接口实现。 | ||
| 19 | + */ | ||
| 20 | +public class TimetableExcelWithPlanInfoViewStrategyImpl implements TimetableExcelWithPlanInfoViewStrategy { | ||
| 21 | + /** 日志记录器 */ | ||
| 22 | + private final static Logger LOG = LoggerFactory.getLogger(TimetableExcelWithPlanInfoViewStrategyImpl.class); | ||
| 23 | + | ||
| 24 | + @Override | ||
| 25 | + public TTInfoDetailForEdit.EditInfo doGetDirectiveDataWithPlanInfo( | ||
| 26 | + Line xl, | ||
| 27 | + Date scheduleDate, | ||
| 28 | + DataToolsService dataToolsService, | ||
| 29 | + DataToolsProperties dataToolsProperties) throws ScheduleException { | ||
| 30 | + | ||
| 31 | + LOG.info("---------------- 开始获取显示数据 线路=[{}],日期=[{}]排班时刻信息... --------------", xl.getName(), scheduleDate); | ||
| 32 | + | ||
| 33 | + try { | ||
| 34 | + // ---------- 1、ktr生成的导出文件 --------- // | ||
| 35 | + // ---------- 1-1、创建ktr参数 --------- // | ||
| 36 | + Map<String, Object> ktrParams = new HashMap<>(); | ||
| 37 | + // 导出用元数据ktr | ||
| 38 | + File ktrMetaFile = new File(this.getClass().getResource( | ||
| 39 | + dataToolsProperties.getTtinfodetailPlaninfoMetaoutput()).toURI()); | ||
| 40 | + // 导出ktr | ||
| 41 | + File ktrFile = new File(this.getClass().getResource( | ||
| 42 | + dataToolsProperties.getTtinfodetailPlaninfoOutput()).toURI()); | ||
| 43 | + | ||
| 44 | + // 通用参数,转换文件路径,excel输出文件名 | ||
| 45 | + ktrParams.put("transpath", ktrMetaFile.getAbsolutePath()); | ||
| 46 | + ktrParams.put("filename", "排班时刻表导出数据temp"); | ||
| 47 | + // ktr附加命名参数 | ||
| 48 | + ktrParams.put("xlid", xl.getId()); // 线路Id | ||
| 49 | + ktrParams.put("injectktrfile", ktrFile.getAbsolutePath()); // 注入元数据的ktr文件 | ||
| 50 | + ktrParams.put("sdate", scheduleDate.toInstant() | ||
| 51 | + .atZone(ZoneId.systemDefault()).toLocalDate() | ||
| 52 | + .format(DateTimeFormatter.ISO_DATE)); // 排班日期 | ||
| 53 | + | ||
| 54 | + // ---------- 1-2、执行ktr --------- // | ||
| 55 | + DataToolsFile exportFile = dataToolsService.exportData(ktrParams); | ||
| 56 | + | ||
| 57 | + // ---------- 2、处理生成的导出文件 --------- // | ||
| 58 | + TTInfoDetailForEdit.EditInfo viewData = new TTInfoDetailForEdit.EditInfo(); | ||
| 59 | + | ||
| 60 | + // 将导出的数据表头重新处理一遍,祛除->数字 | ||
| 61 | + // poi api,并读取第一行数据 | ||
| 62 | + org.apache.poi.ss.usermodel.Workbook poi_workbook; | ||
| 63 | + org.apache.poi.ss.usermodel.Sheet poi_sheet; | ||
| 64 | + if (DataToolsFileType.XLS.isThisType(exportFile.getFile())) { | ||
| 65 | + poi_workbook = DataToolsFileType.XLS.getWorkBook(exportFile.getFile()); | ||
| 66 | + } else if (DataToolsFileType.XLSX.isThisType(exportFile.getFile())) { | ||
| 67 | + poi_workbook = DataToolsFileType.XLSX.getWorkBook(exportFile.getFile()); | ||
| 68 | + } else { | ||
| 69 | + throw new Exception("不是xls xlsx文件!"); | ||
| 70 | + } | ||
| 71 | + poi_sheet = poi_workbook.getSheet("Sheet1"); | ||
| 72 | + if (poi_sheet == null || poi_sheet.getRow(0) == null) { // 空sheet | ||
| 73 | + return viewData; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + int rownums = poi_sheet.getLastRowNum() + 1; | ||
| 77 | + int colnums = poi_sheet.getRow(0).getLastCellNum(); | ||
| 78 | + Row firstrow = poi_sheet.getRow(0); | ||
| 79 | + for (int i = 0; i < colnums; i++) { | ||
| 80 | + org.apache.poi.ss.usermodel.Cell cell = firstrow.getCell(i); | ||
| 81 | + viewData.getHeader().add( | ||
| 82 | + PoiUtils.getStringValueFromCell(cell).trim().replaceAll("(->\\d+)", "")); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + for (int i = 1; i < rownums; i++) { // 第二行开始 | ||
| 86 | + List<TTInfoDetailForEdit.FcInfo> fcInfoList = new ArrayList<>(); | ||
| 87 | + for (int j = 0; j < colnums; j++) { | ||
| 88 | + // poi读 | ||
| 89 | + String cellContent = PoiUtils.getStringValueFromCell( | ||
| 90 | + poi_sheet.getRow(i).getCell(j) | ||
| 91 | + ).replaceAll("\\s*", ""); | ||
| 92 | + | ||
| 93 | + TTInfoDetailForEdit.FcInfo fcInfo = new TTInfoDetailForEdit.FcInfo(); | ||
| 94 | + fcInfo.setFcsj(cellContent); | ||
| 95 | + fcInfoList.add(fcInfo); | ||
| 96 | + } | ||
| 97 | + viewData.getContents().add(fcInfoList); | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + | ||
| 101 | + return viewData; | ||
| 102 | + } catch (Exception exp) { | ||
| 103 | + LOG.error("---------------- 获取显示数据 线路=[{}],日期=[{}]排班时刻信息失败! --------------", xl.getName(), scheduleDate); | ||
| 104 | + throw new ScheduleException(exp); | ||
| 105 | + } | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | +} |
src/main/resources/static/pages/scheduleApp/Gruntfile.js
| @@ -95,7 +95,10 @@ module.exports = function (grunt) { | @@ -95,7 +95,10 @@ module.exports = function (grunt) { | ||
| 95 | 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排班计划form中使用) | 95 | 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排班计划form中使用) |
| 96 | 'module/common/dts2/scheduleplan/saSrule.js', // saSrule指令(非通用指令,只在排班计划form中使用) | 96 | 'module/common/dts2/scheduleplan/saSrule.js', // saSrule指令(非通用指令,只在排班计划form中使用) |
| 97 | 'module/common/dts2/scheduleplan/saPlaninfoedit.js', // saPlaninfoedit指令(非通用指令,只在调度执勤日报中使用) | 97 | 'module/common/dts2/scheduleplan/saPlaninfoedit.js', // saPlaninfoedit指令(非通用指令,只在调度执勤日报中使用) |
| 98 | - 'module/common/dts2/scheduleplan/saPlaninfoedit2.js' // saPlaninfoedit2指令(非通用指令,只在调度执勤日报中使用) | 98 | + 'module/common/dts2/scheduleplan/saPlaninfoedit2.js', // saPlaninfoedit2指令(非通用指令,只在调度执勤日报中使用) |
| 99 | + 'module/common/dts2/scheduleplan/saPlanInfoView.js' // saPlanInfoView指令(非通用指令,只在调度值勤日报中使用) | ||
| 100 | + | ||
| 101 | + | ||
| 99 | ], | 102 | ], |
| 100 | dest: 'module/common/prj-common-directive.js' | 103 | dest: 'module/common/prj-common-directive.js' |
| 101 | }, | 104 | }, |
src/main/resources/static/pages/scheduleApp/module/common/dts2/scheduleplan/saPlanInfoView.js
0 → 100644
| 1 | +/** | ||
| 2 | + * saPlanInfoView指令,排班明细显示指令(以类似时刻表的形式显示) | ||
| 3 | + */ | ||
| 4 | +angular.module('ScheduleApp').directive( | ||
| 5 | + 'saPlaninfoview', | ||
| 6 | + [ | ||
| 7 | + '$compile', | ||
| 8 | + '$window', | ||
| 9 | + '$timeout', | ||
| 10 | + function($compile, $window, $timeout) { | ||
| 11 | + return { | ||
| 12 | + restrict: 'E', | ||
| 13 | + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saPlanInfoViewTemplate.html', | ||
| 14 | + scope: { // 独立作用域 | ||
| 15 | + ds: "=ngModel" | ||
| 16 | + }, | ||
| 17 | + controllerAs: "$saPlanInfoViewCtrl", | ||
| 18 | + bindToController: true, | ||
| 19 | + controller: function() { | ||
| 20 | + var self = this; | ||
| 21 | + // TODO: | ||
| 22 | + | ||
| 23 | + }, | ||
| 24 | + /** | ||
| 25 | + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom | ||
| 26 | + * @param tElem | ||
| 27 | + * @param tAttrs | ||
| 28 | + * @returns {{pre: Function, post: Function}} | ||
| 29 | + */ | ||
| 30 | + compile: function(tElem, tAttrs) { | ||
| 31 | + // 获取属性 | ||
| 32 | + var $attr_name = tAttrs["name"]; // 控件的名字 | ||
| 33 | + if (!$attr_name) { | ||
| 34 | + throw new Error("saPlanInfoView指令 name属性required"); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + // 内部controlAs名字 | ||
| 38 | + var ctrlAs = '$saTimeTableCtrl'; | ||
| 39 | + | ||
| 40 | + return { | ||
| 41 | + pre: function(scope, element, attr) { | ||
| 42 | + // TODO: | ||
| 43 | + | ||
| 44 | + }, | ||
| 45 | + post: function(scope, element, attr) { | ||
| 46 | + // TODO: | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + }; | ||
| 50 | + | ||
| 51 | + } | ||
| 52 | + }; | ||
| 53 | + } | ||
| 54 | + ] | ||
| 55 | +); |
src/main/resources/static/pages/scheduleApp/module/common/dts2/scheduleplan/saPlanInfoViewTemplate.html
0 → 100644
| 1 | +<style> | ||
| 2 | + .ttInfo_detail { | ||
| 3 | + height: 100%; | ||
| 4 | + /*overflow: hidden;*/ | ||
| 5 | + } | ||
| 6 | + .ttInfo_detail .container-fluid { | ||
| 7 | + height: 100%; | ||
| 8 | + margin-left: 0; | ||
| 9 | + } | ||
| 10 | + .ttInfo_detail .container-fluid>* { | ||
| 11 | + padding: 0; | ||
| 12 | + } | ||
| 13 | + .ttInfo_detail .container-fluid.top-container { | ||
| 14 | + margin-top: 5px; | ||
| 15 | + padding: 0; | ||
| 16 | + /*overflow: hidden;*/ | ||
| 17 | + } | ||
| 18 | + .ttInfo_detail .detail-wrap { | ||
| 19 | + height: calc(100% - 1px); | ||
| 20 | + padding: 0; | ||
| 21 | + } | ||
| 22 | + .ttInfo_detail .detail-wrap .header-title { | ||
| 23 | + cursor: pointer; /* 图例点击按钮 */ | ||
| 24 | + font-size: 14px; | ||
| 25 | + color: #cccaca; | ||
| 26 | + } | ||
| 27 | + .ttInfo_detail .detail-wrap h3 { | ||
| 28 | + margin: 7px 0 5px; | ||
| 29 | + text-indent: 5px; | ||
| 30 | + margin: 0; | ||
| 31 | + height: 31px; | ||
| 32 | + line-height: 31px; | ||
| 33 | + } | ||
| 34 | + .ttInfo_detail .detail-wrap.up h3 { | ||
| 35 | + color: #2765A7; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + .ttInfo_detail .detail-panel { | ||
| 39 | + padding: 0; | ||
| 40 | + height: 100%; | ||
| 41 | + border: 1px solid #ddd; | ||
| 42 | + background: #fafafa; | ||
| 43 | + border-radius: 10px !important; | ||
| 44 | + moz-user-select: -moz-none; | ||
| 45 | + -moz-user-select: none; | ||
| 46 | + -o-user-select: none; | ||
| 47 | + -khtml-user-select: none; | ||
| 48 | + -webkit-user-select: none; | ||
| 49 | + -ms-user-select: none; | ||
| 50 | + user-select: none; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + .ttInfo_detail .tt_table { | ||
| 54 | + padding-top: 36px; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + .ttInfo_detail .tt_table>.tt_table_head { | ||
| 58 | + height: 36px; | ||
| 59 | + line-height: 36px; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + .detail-body { | ||
| 63 | + height: calc(100% - 37px); | ||
| 64 | + background: #fff; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + .detail-body .tt_table_wrap { | ||
| 68 | + height: 100%; | ||
| 69 | + border-bottom: 0; | ||
| 70 | + /*overflow-x: hidden;*/ | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + .detail-body .tt_table_wrap .tt_table .tt_table_body dl:last-child { | ||
| 74 | + border-bottom: 0; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + .detail-body .tt_table>.tt_table_body dl:hover dd:nth-of-type(1) { | ||
| 78 | + background: #fafafa; | ||
| 79 | + background: linear-gradient(to right, #fafafa, #f5fbff); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + .detail-body .tt_table dl dd, .detail-body .tt_table dl dt { | ||
| 83 | + font-size: 14px; | ||
| 84 | + line-height: 37px; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + .tt_table dl dt:nth-of-type(1), .tt_table dl dd:nth-of-type(1) { | ||
| 88 | + width: 50px; | ||
| 89 | + } | ||
| 90 | + .tt_table dl dd:nth-of-type(1) { | ||
| 91 | + background: #eae8e8; | ||
| 92 | + /*border-bottom: 1px solid #b3b3b3;*/ | ||
| 93 | + border-right: 1px solid #b3b3b3; | ||
| 94 | + text-align: center; | ||
| 95 | + text-indent: -3px; | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + .tt_table dl dt:nth-of-type(2), .tt_table dl dd:nth-of-type(2) { | ||
| 99 | + width: 55px; | ||
| 100 | + text-align: center; | ||
| 101 | + } | ||
| 102 | + .tt_table dl dt:nth-of-type(n + 3), .tt_table dl dd:nth-of-type(n + 3) { | ||
| 103 | + width: 50px; | ||
| 104 | + text-align: center; | ||
| 105 | + } | ||
| 106 | + .tt_table dl dt:nth-last-child(1), .tt_table dl dd:nth-last-child(1) { | ||
| 107 | + width: 130px; | ||
| 108 | + text-align: center; | ||
| 109 | + } | ||
| 110 | + .tt_table dl dt:nth-last-child(2), .tt_table dl dd:nth-last-child(2) { | ||
| 111 | + width: 130px; | ||
| 112 | + text-align: center; | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | +</style> | ||
| 116 | + | ||
| 117 | +<style> | ||
| 118 | + .tt_table_wrap { | ||
| 119 | + width: 100%; | ||
| 120 | + height: 100%; | ||
| 121 | + overflow: auto; | ||
| 122 | + /*position: relative;*/ | ||
| 123 | + | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + .tt_table { | ||
| 127 | + position: relative; | ||
| 128 | + padding-top: 30px; | ||
| 129 | + font-size: 13px; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + .tt_table>.tt_table_head { | ||
| 133 | + position: absolute; | ||
| 134 | + top: 0; | ||
| 135 | + height: 30px; | ||
| 136 | + background: #f5f5f5; | ||
| 137 | + /*width: 100%;*/ | ||
| 138 | + line-height: 30px; | ||
| 139 | + z-index: 1; | ||
| 140 | + | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + .tt_table>.tt_table_head dl { | ||
| 144 | + border-bottom: 0; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + .tt_table>.tt_table_head dl dt { | ||
| 148 | + font-weight: normal; | ||
| 149 | + font-size: 12px; | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + .tt_table>.tt_table_body { | ||
| 153 | + /*width: 100%;*/ | ||
| 154 | + | ||
| 155 | + position: absolute; | ||
| 156 | + | ||
| 157 | + border-bottom: 1px solid #dedede; | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + .tt_table dl { | ||
| 161 | + display: block; | ||
| 162 | + /*width: 100%;*/ | ||
| 163 | + margin: 0; | ||
| 164 | + /*border-bottom: 1px solid;*/ | ||
| 165 | + height: 30px; | ||
| 166 | + cursor: default; | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + .tt_table>.tt_table_body dl:hover, .tt_table>.tt_table_body dl.context-menu-active { | ||
| 170 | + box-shadow: 0 0 4px #656c71; | ||
| 171 | + background: #f5fbff; | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + .tt_table dl dd, .tt_table dl dt { | ||
| 175 | + display: inline-block; | ||
| 176 | + white-space: nowrap; | ||
| 177 | + overflow: hidden; | ||
| 178 | + text-overflow: ellipsis; | ||
| 179 | + height: 100%; | ||
| 180 | + line-height: 30px; | ||
| 181 | + border-right: 1px solid; | ||
| 182 | + text-indent: 5px; | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + .tt_table_wrap { | ||
| 186 | + /*border: 1px solid #e6e6e6;*/ | ||
| 187 | + border-left: 0; | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + .tt_table>.tt_table_head { | ||
| 191 | + border-bottom: 2px solid #96b9d7; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + .tt_table dl { | ||
| 195 | + font-size: 0; | ||
| 196 | + white-space: nowrap; | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + .tt_table dl dd, .tt_table dl dt { | ||
| 200 | + border-right-color: #dedede; | ||
| 201 | + font-size: 13px; | ||
| 202 | + /*border-bottom: 1px solid #dedede;*/ | ||
| 203 | + border-top: 1px solid #dedede; | ||
| 204 | + } | ||
| 205 | + .tt_table dl{ | ||
| 206 | + transition: all .1s ease; | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + .tt_table dd { | ||
| 210 | + color: #2765A7; | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + .tt_table dd.active { | ||
| 214 | + /*background: #8baabf !important;*/ | ||
| 215 | + /*color: white;*/ | ||
| 216 | + border: 2px solid #09284a; | ||
| 217 | + } | ||
| 218 | + | ||
| 219 | + .tt_table dd.error { | ||
| 220 | + background: #e43a45 !important; | ||
| 221 | + color: white; | ||
| 222 | + } | ||
| 223 | + .tt_table dd.ists { | ||
| 224 | + background: #105383 !important; | ||
| 225 | + color: white; | ||
| 226 | + } | ||
| 227 | + .tt_table dd.region { | ||
| 228 | + background: #686d7b !important; | ||
| 229 | + color: white; | ||
| 230 | + } | ||
| 231 | + .tt_table dd.isfb { | ||
| 232 | + background: #adff00 !important; | ||
| 233 | + color: #501a1a; | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + .tt_table_no_border .tt_table>.tt_table_head dl dt { | ||
| 237 | + font-weight: 600; | ||
| 238 | + font-size: 13px; | ||
| 239 | + } | ||
| 240 | + .tt_table_no_border .tt_table dl dd,.tt_table_no_border .tt_table dl dt { | ||
| 241 | + font-size: 14px; | ||
| 242 | + border-right: 0; | ||
| 243 | + } | ||
| 244 | + | ||
| 245 | + | ||
| 246 | + | ||
| 247 | +</style> | ||
| 248 | + | ||
| 249 | +<style> | ||
| 250 | + .table_scrollbar::-webkit-scrollbar { | ||
| 251 | + width: 18px; | ||
| 252 | + height: 18px; | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + .table_scrollbar::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb { | ||
| 256 | + border-radius: 999px; | ||
| 257 | + border: 5px solid transparent; | ||
| 258 | + } | ||
| 259 | + | ||
| 260 | + .table_scrollbar::-webkit-scrollbar-track { | ||
| 261 | + box-shadow: 1px 1px 5px rgba(0, 0, 0, .2) inset; | ||
| 262 | + } | ||
| 263 | + | ||
| 264 | + .table_scrollbar::-webkit-scrollbar-thumb { | ||
| 265 | + min-height: 20px; | ||
| 266 | + background-clip: content-box; | ||
| 267 | + box-shadow: 0 0 0 5px rgba(0, 0, 0, .2) inset; | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + .table_scrollbar::-webkit-scrollbar-corner { | ||
| 271 | + background: transparent; | ||
| 272 | + } | ||
| 273 | +</style> | ||
| 274 | + | ||
| 275 | +<style> | ||
| 276 | + /* Specify styling for tooltip contents */ | ||
| 277 | + .tooltip.headClass .tooltip-inner { | ||
| 278 | + color: #880000; | ||
| 279 | + background-color: #ffff66; | ||
| 280 | + box-shadow: 0 6px 12px rgba(0,0,0,.175); | ||
| 281 | + } | ||
| 282 | + /* Hide arrow */ | ||
| 283 | + .tooltip.headClass .tooltip-arrow { | ||
| 284 | + display: none; | ||
| 285 | + } | ||
| 286 | +</style> | ||
| 287 | + | ||
| 288 | +<style> | ||
| 289 | + /** | ||
| 290 | + 针对 <div class="tt_table_head" style="z-index: 110; top: 0;"> 下的dt样式指定 | ||
| 291 | + */ | ||
| 292 | + | ||
| 293 | + /** 路牌 */ | ||
| 294 | + .tt_table_head dl dt:nth-of-type(2) { | ||
| 295 | + width: 55px; | ||
| 296 | + text-align: center; | ||
| 297 | + } | ||
| 298 | + /*!** 班型1 *!*/ | ||
| 299 | + /*.tt_table_head dl dt:nth-of-type(3) {*/ | ||
| 300 | + /*width: 60px;*/ | ||
| 301 | + /*text-align: center;*/ | ||
| 302 | + /*}*/ | ||
| 303 | + /*!** 班型2 *!*/ | ||
| 304 | + /*.tt_table_head dl dt:nth-of-type(4) {*/ | ||
| 305 | + /*width: 60px;*/ | ||
| 306 | + /*text-align: center;*/ | ||
| 307 | + /*}*/ | ||
| 308 | +</style> | ||
| 309 | + | ||
| 310 | + | ||
| 311 | +<div class="ttInfo_detail"> | ||
| 312 | + <div class="container-fluid top-container"> | ||
| 313 | + <div class="col-md-12 container-fluid schedule-wrap"> | ||
| 314 | + <div class="col-md-12" style="height: 100%"> | ||
| 315 | + <div class="detail-panel"> | ||
| 316 | + <div class="detail-wrap up"> | ||
| 317 | + <!--<h3 class="header-title">--> | ||
| 318 | + <!--{{$saTimeTableCtrl.ds.yydesc}}--> | ||
| 319 | + <!--</h3>--> | ||
| 320 | + | ||
| 321 | + <div class="detail-body"> | ||
| 322 | + <div class="tt_table_wrap table_scrollbar" sa-tscrolly1> | ||
| 323 | + <div class="tt_table"> | ||
| 324 | + | ||
| 325 | + <div class="tt_table_head" style="z-index: 120; top: 0;"> | ||
| 326 | + <dl style="height: 36px; border-bottom: 2px solid #96b9d7;"> | ||
| 327 | + <dt style="width: 50px; text-align: center;"> | ||
| 328 | + 序号 | ||
| 329 | + </dt> | ||
| 330 | + | ||
| 331 | + <dt style="width: 55px; border-right: 2px solid #96b9d7;"> | ||
| 332 | + 路牌 | ||
| 333 | + </dt> | ||
| 334 | + | ||
| 335 | + </dl> | ||
| 336 | + </div> | ||
| 337 | + | ||
| 338 | + | ||
| 339 | + <div class="tt_table_head" style="z-index: 110; top: 0;"> | ||
| 340 | + <dl> | ||
| 341 | + <dt> | ||
| 342 | + 序号 | ||
| 343 | + </dt> | ||
| 344 | + | ||
| 345 | + <dt ng-repeat="head in $saPlanInfoViewCtrl.ds.header track by $index"> | ||
| 346 | + {{(head != '路牌' && head != '驾驶员' && head != '车牌号') ? (head.substr(0, 1) + ($index)): head}} | ||
| 347 | + </dt> | ||
| 348 | + </dl> | ||
| 349 | + </div> | ||
| 350 | + | ||
| 351 | + <div class="tt_table_body" style="z-index: 100; background: white;"> | ||
| 352 | + <dl ng-repeat="info in $saPlanInfoViewCtrl.ds.contents track by $index" | ||
| 353 | + ng-init="rowIndex = $index"> | ||
| 354 | + | ||
| 355 | + <dd style="width: 50px;"> | ||
| 356 | + {{rowIndex + 1}} | ||
| 357 | + </dd> | ||
| 358 | + | ||
| 359 | + <dd ng-repeat="cell in info track by $index" | ||
| 360 | + ng-init="colIndex = $index" | ||
| 361 | + ng-if="$index == 0" style="width: 55px; border-right: 2px solid #96b9d7;"> | ||
| 362 | + {{cell.fcsj}} | ||
| 363 | + </dd> | ||
| 364 | + | ||
| 365 | + </dl> | ||
| 366 | + </div> | ||
| 367 | + | ||
| 368 | + <div class="tt_table_body"> | ||
| 369 | + <dl ng-repeat="info in $saPlanInfoViewCtrl.ds.contents track by $index" | ||
| 370 | + ng-init="rowIndex = $index"> | ||
| 371 | + | ||
| 372 | + <dd> | ||
| 373 | + {{rowIndex + 1}} | ||
| 374 | + </dd> | ||
| 375 | + | ||
| 376 | + <dd> | ||
| 377 | + 路牌 | ||
| 378 | + </dd> | ||
| 379 | + | ||
| 380 | + <dd ng-repeat="cell in info track by $index" | ||
| 381 | + ng-init="colIndex = $index" | ||
| 382 | + ng-if="$index > 0" | ||
| 383 | + ng-class="{ | ||
| 384 | + lpName: true, | ||
| 385 | + error: false, | ||
| 386 | + active: false, | ||
| 387 | + ists: false, | ||
| 388 | + region: false, | ||
| 389 | + isfb: false | ||
| 390 | + }"> | ||
| 391 | + {{cell.fcsj}} | ||
| 392 | + </dd> | ||
| 393 | + | ||
| 394 | + </dl> | ||
| 395 | + | ||
| 396 | + </div> | ||
| 397 | + | ||
| 398 | + </div> | ||
| 399 | + | ||
| 400 | + | ||
| 401 | + </div> | ||
| 402 | + | ||
| 403 | + </div> | ||
| 404 | + | ||
| 405 | + <!--TODO--> | ||
| 406 | + </div> | ||
| 407 | + | ||
| 408 | + </div> | ||
| 409 | + </div> | ||
| 410 | + | ||
| 411 | + | ||
| 412 | + </div> | ||
| 413 | + | ||
| 414 | + | ||
| 415 | + | ||
| 416 | + </div> | ||
| 417 | + | ||
| 418 | +</div> |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
| @@ -6607,4 +6607,59 @@ angular.module('ScheduleApp').directive( | @@ -6607,4 +6607,59 @@ angular.module('ScheduleApp').directive( | ||
| 6607 | }; | 6607 | }; |
| 6608 | } | 6608 | } |
| 6609 | ] | 6609 | ] |
| 6610 | -); | ||
| 6611 | \ No newline at end of file | 6610 | \ No newline at end of file |
| 6611 | +); | ||
| 6612 | +/** | ||
| 6613 | + * saPlanInfoView指令,排班明细显示指令(以类似时刻表的形式显示) | ||
| 6614 | + */ | ||
| 6615 | +angular.module('ScheduleApp').directive( | ||
| 6616 | + 'saPlaninfoview', | ||
| 6617 | + [ | ||
| 6618 | + '$compile', | ||
| 6619 | + '$window', | ||
| 6620 | + '$timeout', | ||
| 6621 | + function($compile, $window, $timeout) { | ||
| 6622 | + return { | ||
| 6623 | + restrict: 'E', | ||
| 6624 | + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saPlanInfoViewTemplate.html', | ||
| 6625 | + scope: { // 独立作用域 | ||
| 6626 | + ds: "=ngModel" | ||
| 6627 | + }, | ||
| 6628 | + controllerAs: "$saPlanInfoViewCtrl", | ||
| 6629 | + bindToController: true, | ||
| 6630 | + controller: function() { | ||
| 6631 | + var self = this; | ||
| 6632 | + // TODO: | ||
| 6633 | + | ||
| 6634 | + }, | ||
| 6635 | + /** | ||
| 6636 | + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom | ||
| 6637 | + * @param tElem | ||
| 6638 | + * @param tAttrs | ||
| 6639 | + * @returns {{pre: Function, post: Function}} | ||
| 6640 | + */ | ||
| 6641 | + compile: function(tElem, tAttrs) { | ||
| 6642 | + // 获取属性 | ||
| 6643 | + var $attr_name = tAttrs["name"]; // 控件的名字 | ||
| 6644 | + if (!$attr_name) { | ||
| 6645 | + throw new Error("saPlanInfoView指令 name属性required"); | ||
| 6646 | + } | ||
| 6647 | + | ||
| 6648 | + // 内部controlAs名字 | ||
| 6649 | + var ctrlAs = '$saTimeTableCtrl'; | ||
| 6650 | + | ||
| 6651 | + return { | ||
| 6652 | + pre: function(scope, element, attr) { | ||
| 6653 | + // TODO: | ||
| 6654 | + | ||
| 6655 | + }, | ||
| 6656 | + post: function(scope, element, attr) { | ||
| 6657 | + // TODO: | ||
| 6658 | + } | ||
| 6659 | + | ||
| 6660 | + }; | ||
| 6661 | + | ||
| 6662 | + } | ||
| 6663 | + }; | ||
| 6664 | + } | ||
| 6665 | + ] | ||
| 6666 | +); |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| @@ -720,9 +720,30 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$reso | @@ -720,9 +720,30 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$reso | ||
| 720 | } | 720 | } |
| 721 | } | 721 | } |
| 722 | } | 722 | } |
| 723 | + ), | ||
| 724 | + | ||
| 725 | + getSaPlanInfoViewData: $resource( | ||
| 726 | + '/spic/saPlanInfoView/data/:xlid/:sdate', | ||
| 727 | + {}, | ||
| 728 | + { | ||
| 729 | + list: { | ||
| 730 | + method: 'GET', | ||
| 731 | + isArray: false, | ||
| 732 | + transformResponse: function(rs) { | ||
| 733 | + var dst = angular.fromJson(rs); | ||
| 734 | + if (dst.status == 'SUCCESS') { | ||
| 735 | + return dst.data; | ||
| 736 | + } else { | ||
| 737 | + return dst; // 业务错误留给控制器处理 | ||
| 738 | + } | ||
| 739 | + } | ||
| 740 | + } | ||
| 741 | + } | ||
| 723 | ) | 742 | ) |
| 724 | 743 | ||
| 725 | 744 | ||
| 745 | + | ||
| 746 | + | ||
| 726 | }; | 747 | }; |
| 727 | }]); | 748 | }]); |
| 728 | 749 |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/list.html
| @@ -4,39 +4,58 @@ | @@ -4,39 +4,58 @@ | ||
| 4 | <div class="portlet"> | 4 | <div class="portlet"> |
| 5 | <div class="portlet-title"> | 5 | <div class="portlet-title"> |
| 6 | <div class="caption caption-subject font-red-sunglo bold uppercase"> | 6 | <div class="caption caption-subject font-red-sunglo bold uppercase"> |
| 7 | + <span ng-bind="ctrl.searchCondition().xlname"></span> | ||
| 7 | 最近排班至 | 8 | 最近排班至 |
| 8 | <span ng-bind="ctrl.lsd | date: 'yyyy年MM月dd日'"> | 9 | <span ng-bind="ctrl.lsd | date: 'yyyy年MM月dd日'"> |
| 9 | - </span> | 10 | + </span> |
| 11 | + 当前排班日期 | ||
| 12 | + <span ng-bind="ctrl.searchCondition().sdate | date: 'yyyy年MM月dd日'"></span> | ||
| 13 | + </div> | ||
| 14 | + | ||
| 15 | + <div class="actions"> | ||
| 16 | + <div class="btn-group"> | ||
| 17 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;" | ||
| 18 | + ng-click="ctrl.switchView()"> | ||
| 19 | + <i class="fa fa-search"></i> 切换视图 | ||
| 20 | + </button> | ||
| 21 | + </div> | ||
| 22 | + | ||
| 10 | </div> | 23 | </div> |
| 11 | </div> | 24 | </div> |
| 12 | </div> | 25 | </div> |
| 13 | 26 | ||
| 14 | - <div class="fixDiv"> | 27 | + <div ng-if="ctrl.viewId == 1" style="height: {{ctrl.ttHeight}}px;"> |
| 28 | + <sa-Planinfoview name="saPlanView" ng-model="ctrl.saPlanInfoViewData.infos" ng-model-options="{ getterSetter: true }" > | ||
| 29 | + </sa-Planinfoview> | ||
| 30 | + </div> | ||
| 31 | + | ||
| 32 | + <div class="fixDiv" ng-if="ctrl.viewId == 0"> | ||
| 15 | <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column" | 33 | <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column" |
| 16 | - style="width: 1600px; min-height: 500px;"> | 34 | + style="width: 1600px; min-height: 320px;"> |
| 17 | <thead> | 35 | <thead> |
| 18 | <tr role="row" class="heading"> | 36 | <tr role="row" class="heading"> |
| 19 | - <th style="width: 70px;">序号</th> | ||
| 20 | - <th style="width: 80px;">操作</th> | ||
| 21 | - <th style="width: 170px;">操作人/操作时间</th> | ||
| 22 | - <th style="width: 180px;">线路</th> | ||
| 23 | - <th style="width: 180px">日期</th> | ||
| 24 | - <th style="width: 50px">路牌</th> | ||
| 25 | - <th style="width: 100px;">车辆</th> | ||
| 26 | - <th style="width: 80px;">出场时间</th> | ||
| 27 | - <th style="width: 80px;">进场时间</th> | ||
| 28 | - <th style="width: 150px;">驾驶员</th> | ||
| 29 | - <th style="width: 150px;">售票员</th> | ||
| 30 | - <th>关联时刻表</th> | 37 | + <th style="width: 70px; max-width: 70px;white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">序号</th> |
| 38 | + <th style="width: 100px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">操作</th> | ||
| 39 | + <th style="width: 170px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">操作人/操作时间</th> | ||
| 40 | + <th style="width: 150px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">线路</th> | ||
| 41 | + <th style="width: 150px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">日期</th> | ||
| 42 | + <th style="width: 70px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">路牌</th> | ||
| 43 | + <th style="width: 100px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">车辆</th> | ||
| 44 | + <th style="width: 100px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">出场时间</th> | ||
| 45 | + <th style="width: 100px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">进场时间</th> | ||
| 46 | + <th style="width: 150px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">驾驶员</th> | ||
| 47 | + <th style="width: 150px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">售票员</th> | ||
| 48 | + <th style="width: 290px; white-space: pre-wrap;word-wrap: break-word;text-align: center;vertical-align: middle;">关联时刻表</th> | ||
| 31 | </tr> | 49 | </tr> |
| 32 | <tr role="row" class="filter"> | 50 | <tr role="row" class="filter"> |
| 33 | <td></td> | 51 | <td></td> |
| 34 | - <td></td> | 52 | + <td> |
| 53 | + </td> | ||
| 35 | <td></td> | 54 | <td></td> |
| 36 | <td> | 55 | <td> |
| 37 | <sa-Select5 name="xl" | 56 | <sa-Select5 name="xl" |
| 38 | model="ctrl.searchCondition()" | 57 | model="ctrl.searchCondition()" |
| 39 | - cmaps="{'xlid': 'id'}" | 58 | + cmaps="{'xlid': 'id', 'xlname': 'name'}" |
| 40 | dcname="xlid" | 59 | dcname="xlid" |
| 41 | icname="id" | 60 | icname="id" |
| 42 | dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}" | 61 | dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}" |
| @@ -196,4 +215,4 @@ | @@ -196,4 +215,4 @@ | ||
| 196 | </table> | 215 | </table> |
| 197 | </div> | 216 | </div> |
| 198 | 217 | ||
| 199 | -</div> | ||
| 200 | \ No newline at end of file | 218 | \ No newline at end of file |
| 219 | +</div> |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js
| @@ -70,6 +70,22 @@ angular.module('ScheduleApp').factory( | @@ -70,6 +70,22 @@ angular.module('ScheduleApp').factory( | ||
| 70 | }, | 70 | }, |
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| 73 | + * 获取SaPlanInfoViewData显示用数据。 | ||
| 74 | + * @param params 查询参数 | ||
| 75 | + * @return 返回一个 promise | ||
| 76 | + */ | ||
| 77 | + getSaPlanInfoViewData: function() { | ||
| 78 | + if (!currentSearchCondition['xlid']) { | ||
| 79 | + return null; | ||
| 80 | + } | ||
| 81 | + if (!currentSearchCondition['sdate']) { | ||
| 82 | + return null; | ||
| 83 | + } | ||
| 84 | + return service.getSaPlanInfoViewData.list(currentSearchCondition).$promise; | ||
| 85 | + | ||
| 86 | + }, | ||
| 87 | + | ||
| 88 | + /** | ||
| 73 | * 批量保存排班明细。 | 89 | * 批量保存排班明细。 |
| 74 | * @param rs | 90 | * @param rs |
| 75 | */ | 91 | */ |
| @@ -175,7 +191,8 @@ angular.module('ScheduleApp').controller( | @@ -175,7 +191,8 @@ angular.module('ScheduleApp').controller( | ||
| 175 | 'SchedulePlanReportExtManageService', | 191 | 'SchedulePlanReportExtManageService', |
| 176 | '$scope', | 192 | '$scope', |
| 177 | '$state', | 193 | '$state', |
| 178 | - function(service, $scope, $state) { | 194 | + '$window', |
| 195 | + function(service, $scope, $state, $window) { | ||
| 179 | 196 | ||
| 180 | var self = this; | 197 | var self = this; |
| 181 | self.pageInfo = { | 198 | self.pageInfo = { |
| @@ -270,6 +287,32 @@ angular.module('ScheduleApp').controller( | @@ -270,6 +287,32 @@ angular.module('ScheduleApp').controller( | ||
| 270 | 287 | ||
| 271 | //// 初始创建的时候,获取一次列表数据 | 288 | //// 初始创建的时候,获取一次列表数据 |
| 272 | //self.pageChanaged(); | 289 | //self.pageChanaged(); |
| 290 | + self.saPlanInfoViewData = { | ||
| 291 | + infos: {} | ||
| 292 | + }; | ||
| 293 | + self.viewId = 0; | ||
| 294 | + self.switchView = function() { | ||
| 295 | + if (self.viewId === 0) { | ||
| 296 | + self.viewId = 1; | ||
| 297 | + if (service.getSaPlanInfoViewData() != null) { | ||
| 298 | + service.getSaPlanInfoViewData().then( | ||
| 299 | + function(rst) { | ||
| 300 | + self.saPlanInfoViewData.infos = rst; | ||
| 301 | + console.log(rst); | ||
| 302 | + }, | ||
| 303 | + function(err) { | ||
| 304 | + | ||
| 305 | + } | ||
| 306 | + ); | ||
| 307 | + } | ||
| 308 | + } else { | ||
| 309 | + self.viewId = 0; | ||
| 310 | + } | ||
| 311 | + }; | ||
| 312 | + | ||
| 313 | + self.ttHeight = 500; // sa-Planinfoview组件的高度 | ||
| 314 | + | ||
| 315 | + | ||
| 273 | } | 316 | } |
| 274 | 317 | ||
| 275 | ] | 318 | ] |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js
| @@ -174,8 +174,29 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$reso | @@ -174,8 +174,29 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$reso | ||
| 174 | } | 174 | } |
| 175 | } | 175 | } |
| 176 | } | 176 | } |
| 177 | + ), | ||
| 178 | + | ||
| 179 | + getSaPlanInfoViewData: $resource( | ||
| 180 | + '/spic/saPlanInfoView/data/:xlid/:sdate', | ||
| 181 | + {}, | ||
| 182 | + { | ||
| 183 | + list: { | ||
| 184 | + method: 'GET', | ||
| 185 | + isArray: false, | ||
| 186 | + transformResponse: function(rs) { | ||
| 187 | + var dst = angular.fromJson(rs); | ||
| 188 | + if (dst.status == 'SUCCESS') { | ||
| 189 | + return dst.data; | ||
| 190 | + } else { | ||
| 191 | + return dst; // 业务错误留给控制器处理 | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + } | ||
| 195 | + } | ||
| 177 | ) | 196 | ) |
| 178 | 197 | ||
| 179 | 198 | ||
| 199 | + | ||
| 200 | + | ||
| 180 | }; | 201 | }; |
| 181 | }]); | 202 | }]); |