Commit a9de53df by 丁伟峰

代码优化

1 parent 0770a1aa
...@@ -48,8 +48,6 @@ public class EngineerGanttServiceImpl implements EngineerGanttService { ...@@ -48,8 +48,6 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
} }
List<OrderInfoEntity> orders = orderInfoDao.findByDtAndEngineerCodeIn(reqDTO.getDate(), engineerCodes); List<OrderInfoEntity> orders = orderInfoDao.findByDtAndEngineerCodeIn(reqDTO.getDate(), engineerCodes);
List<String> orderIds = orders.stream().map(OrderInfoEntity::getOrderId).collect(Collectors.toList());
Map<String, OrderInfoEntity> mapOrderRequest = getOrdersByOrderIds(orderIds);
HashMap<String, List<EngineersGanttDTO.Slot>> mapEngineers = new HashMap<>(); HashMap<String, List<EngineersGanttDTO.Slot>> mapEngineers = new HashMap<>();
for (OrderInfoEntity e : orders) { for (OrderInfoEntity e : orders) {
// log.info("===== order_id: [{}]", e.getOrderId()); // log.info("===== order_id: [{}]", e.getOrderId());
...@@ -63,7 +61,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService { ...@@ -63,7 +61,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
if (orderSkill != null) { if (orderSkill != null) {
slot.setText(orderSkill.getSkillCaption()); slot.setText(orderSkill.getSkillCaption());
} }
slot.setBgColor(mapOrderRequest.get(e.getOrderId()).getAppointmentStatus().toString()); slot.setBgColor(e.getAppointmentStatus());
List<EngineersGanttDTO.Slot> slots = null; List<EngineersGanttDTO.Slot> slots = null;
if (mapEngineers.containsKey(e.getEngineerCode())) { if (mapEngineers.containsKey(e.getEngineerCode())) {
slots = mapEngineers.get(e.getEngineerCode()); slots = mapEngineers.get(e.getEngineerCode());
...@@ -73,7 +71,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService { ...@@ -73,7 +71,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
slots.add(slot); slots.add(slot);
mapEngineers.put(e.getEngineerCode(), slots); mapEngineers.put(e.getEngineerCode(), slots);
} }
log.info("mapEngineers ===> {}", mapEngineers);
List<EngineersGanttDTO.GanttChart> engineers = new ArrayList<>(); List<EngineersGanttDTO.GanttChart> engineers = new ArrayList<>();
for (String engineerCode : engineerCodes) { for (String engineerCode : engineerCodes) {
EngineerInfoEntity engineerInfo = engineerInfoDao.getByEngineerCode(engineerCode); EngineerInfoEntity engineerInfo = engineerInfoDao.getByEngineerCode(engineerCode);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!