Commit 1a85c2f5 authored by hanbing's avatar hanbing

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

parent c5341973
......@@ -26,4 +26,6 @@ public interface CrossPlanMapper {
List<RunningPlanDTO.DailyPlanListElement> selectDailyPlanList(String crossId);
CrossPlanPO selectById(@Param("planId") Integer planId);
List<CrossPlanPO> selectByCrossId(String crossId);
}
......@@ -136,6 +136,18 @@ public class RunningPlanServiceImpl implements RunningPlanService {
private List<RunningPlanDTO.DailyPlanListElement> buildDailyPlanList(String crossId) {
List<RunningPlanDTO.DailyPlanListElement> dailyPlanList = new ArrayList<>();
dailyPlanList = crossPlanMapper.selectDailyPlanList(crossId);
if (CollectionUtil.isEmpty(dailyPlanList)) {
List<CrossPlanPO> crossPlanPOList = crossPlanMapper.selectByCrossId(crossId);
if (CollectionUtil.isNotEmpty(crossPlanPOList)) {
for (CrossPlanPO crossPlanPO : crossPlanPOList) {
RunningPlanDTO.DailyPlanListElement dailyPlan = new RunningPlanDTO.DailyPlanListElement();
dailyPlan.setPlanNo(crossPlanPO.getPlanNo());
dailyPlan.setName(crossPlanPO.getName());
dailyPlan.setTimeList(new ArrayList<>());
dailyPlanList.add(dailyPlan);
}
}
} else {
for (RunningPlanDTO.DailyPlanListElement dailyPlan : dailyPlanList) {
List<RunningPlanDTO.TimeListElement> timeList = dailyPlan.getTimeList();
for (RunningPlanDTO.TimeListElement timeListElement : timeList) {
......@@ -147,6 +159,7 @@ public class RunningPlanServiceImpl implements RunningPlanService {
timeListElement.setStartEndTime(startEndTime);
}
}
}
return dailyPlanList;
}
......
......@@ -62,5 +62,12 @@
where id = #{planId}
</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>
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