Commit 1a85c2f5 authored by hanbing's avatar hanbing

方案管理-运行计划,兼容日计划无时段

parent c5341973
...@@ -26,4 +26,6 @@ public interface CrossPlanMapper { ...@@ -26,4 +26,6 @@ public interface CrossPlanMapper {
List<RunningPlanDTO.DailyPlanListElement> selectDailyPlanList(String crossId); List<RunningPlanDTO.DailyPlanListElement> selectDailyPlanList(String crossId);
CrossPlanPO selectById(@Param("planId") Integer planId); CrossPlanPO selectById(@Param("planId") Integer planId);
List<CrossPlanPO> selectByCrossId(String crossId);
} }
...@@ -136,15 +136,28 @@ public class RunningPlanServiceImpl implements RunningPlanService { ...@@ -136,15 +136,28 @@ 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) { if (CollectionUtil.isEmpty(dailyPlanList)) {
List<RunningPlanDTO.TimeListElement> timeList = dailyPlan.getTimeList(); List<CrossPlanPO> crossPlanPOList = crossPlanMapper.selectByCrossId(crossId);
for (RunningPlanDTO.TimeListElement timeListElement : timeList) { if (CollectionUtil.isNotEmpty(crossPlanPOList)) {
String[] startEndTime = new String[2]; for (CrossPlanPO crossPlanPO : crossPlanPOList) {
String startTime = timeListElement.getStartTime(); RunningPlanDTO.DailyPlanListElement dailyPlan = new RunningPlanDTO.DailyPlanListElement();
String endTime = timeListElement.getEndTime(); dailyPlan.setPlanNo(crossPlanPO.getPlanNo());
startEndTime[0] = startTime; dailyPlan.setName(crossPlanPO.getName());
startEndTime[1] = endTime; dailyPlan.setTimeList(new ArrayList<>());
timeListElement.setStartEndTime(startEndTime); dailyPlanList.add(dailyPlan);
}
}
} else {
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;
......
...@@ -62,5 +62,12 @@ ...@@ -62,5 +62,12 @@
where id = #{planId} where id = #{planId}
</select> </select>
<select id="selectByCrossId" resultType="net.wanji.web.po.scheme.CrossPlanPO">
select
id,plan_no,name,cross_id,gmt_create,gmt_modified
from t_base_cross_plan
where cross_id = #{crossId}
</select>
</mapper> </mapper>
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