Commit e8ac11d3 authored by hanbing's avatar hanbing

方案管理-计划数据增加开始时间、结束时间数组

parent 71bdf70e
...@@ -39,6 +39,8 @@ public class RunningPlanDTO { ...@@ -39,6 +39,8 @@ public class RunningPlanDTO {
private String startTime; private String startTime;
@ApiModelProperty(value = "结束时间", required = true) @ApiModelProperty(value = "结束时间", required = true)
private String endTime; private String endTime;
@ApiModelProperty(value = "开始时间、结束时间", required = true)
private String[] startEndTime;
@ApiModelProperty(value = "方案名", required = true) @ApiModelProperty(value = "方案名", required = true)
private String schemeName; private String schemeName;
} }
......
...@@ -136,6 +136,17 @@ public class RunningPlanServiceImpl implements RunningPlanService { ...@@ -136,6 +136,17 @@ public class RunningPlanServiceImpl implements RunningPlanService {
private List<RunningPlanDTO.DailyPlanListElement> buildDailyPlanList(String crossId) { private List<RunningPlanDTO.DailyPlanListElement> buildDailyPlanList(String crossId) {
List<RunningPlanDTO.DailyPlanListElement> dailyPlanList = new ArrayList<>(); List<RunningPlanDTO.DailyPlanListElement> dailyPlanList = new ArrayList<>();
dailyPlanList = crossPlanMapper.selectDailyPlanList(crossId); dailyPlanList = crossPlanMapper.selectDailyPlanList(crossId);
for (RunningPlanDTO.DailyPlanListElement dailyPlan : dailyPlanList) {
List<RunningPlanDTO.TimeListElement> timeList = dailyPlan.getTimeList();
for (RunningPlanDTO.TimeListElement timeListElement : timeList) {
String[] startEndTime = new String[2];
String startTime = timeListElement.getStartTime();
String endTime = timeListElement.getEndTime();
startEndTime[0] = startTime;
startEndTime[1] = endTime;
timeListElement.setStartEndTime(startEndTime);
}
}
return dailyPlanList; return dailyPlanList;
} }
...@@ -217,16 +228,17 @@ public class RunningPlanServiceImpl implements RunningPlanService { ...@@ -217,16 +228,17 @@ public class RunningPlanServiceImpl implements RunningPlanService {
CrossSchemePO crossSchemePO = crossSchemeMapper.selectByCrossIdAndSchemeName(crossId, schemeName); CrossSchemePO crossSchemePO = crossSchemeMapper.selectByCrossIdAndSchemeName(crossId, schemeName);
Integer schemeId = crossSchemePO.getId(); Integer schemeId = crossSchemePO.getId();
// 更新时段表 // 更新时段表
updateCrossSection(crossId, dailyPlan, crossPlanId, schemeId, time); updateCrossSection(crossId, crossPlanId, schemeId, time);
} }
} }
} }
private void updateCrossSection(String crossId, RunningPlanDTO.DailyPlanListElement dailyPlan, private void updateCrossSection(String crossId, Integer crossPlanId, Integer schemeId,
Integer crossPlanId, Integer schemeId, RunningPlanDTO.TimeListElement time) { RunningPlanDTO.TimeListElement time) {
CrossSectionPO crossSectionPO = new CrossSectionPO(); CrossSectionPO crossSectionPO = new CrossSectionPO();
String startTime = time.getStartTime(); String[] startEndTime = time.getStartEndTime();
String endTime = time.getEndTime(); String startTime = startEndTime[0];
String endTime = startEndTime[1];
String s = startTime + endTime; String s = startTime + endTime;
String sectionNo = s.replaceAll(":", ""); String sectionNo = s.replaceAll(":", "");
crossSectionPO.setSectionNo(sectionNo); crossSectionPO.setSectionNo(sectionNo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment