Commit 80d8f39e by chamberone

fix: 解决重复orderid问题

1 parent cea6e6e4
...@@ -14,8 +14,8 @@ public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long>, JpaS ...@@ -14,8 +14,8 @@ public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long>, JpaS
List<OrderInfoEntity> findByOrderId(String orderId); List<OrderInfoEntity> findByOrderId(String orderId);
List<OrderInfoEntity> findByDtAndEngineerCodeIn(LocalDate date, List<String> engineerCodes); List<OrderInfoEntity> findByDtAndEngineerCodeIn(LocalDate date, List<String> engineerCodes);
List<OrderInfoEntity> findByDtAndEngineerCode(LocalDate date, String engineerCode); List<OrderInfoEntity> findByDtAndEngineerCode(LocalDate date, String engineerCode);
@Query("SELECT o.orderId, s.skillCategory as skillCaption FROM OrderInfoEntity o JOIN SkillInfoEntity s on o.brand=s.brand and o.type=s.type and o.skill=s.skill WHERE o.orderId = :orderId") @Query("SELECT o.orderId, s.skillCategory as skillCaption FROM OrderInfoEntity o JOIN SkillInfoEntity s on o.brand=s.brand and o.type=s.type and o.skill=s.skill WHERE o.orderId = :orderId and o.dt = :dt")
OrderSkillProjection getOrderSkillCaptionByOrderId(String orderId); OrderSkillProjection getOrderSkillCaptionByOrderIdAndDt(String orderId, LocalDate dt);
List<OrderInfoEntity> findAllByOrderIdIn(List<String> orderIds); List<OrderInfoEntity> findAllByOrderIdIn(List<String> orderIds);
List<OrderInfoEntity> findAllByDtAndOrderIdIn(LocalDate dt, List<String> orderIds); List<OrderInfoEntity> findAllByDtAndOrderIdIn(LocalDate dt, List<String> orderIds);
List<OrderInfoEntity> findByEngineerCodeAndDtAndAppointmentStatusIn(String engineerCode, LocalDate dt, List<String> appointmentStatus); List<OrderInfoEntity> findByEngineerCodeAndDtAndAppointmentStatusIn(String engineerCode, LocalDate dt, List<String> appointmentStatus);
......
...@@ -53,7 +53,8 @@ public class EngineerGanttServiceImpl implements EngineerGanttService { ...@@ -53,7 +53,8 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
log.info("根据多条件,查询返回符合条件的技术员列表:{}", engineerCodes); log.info("根据多条件,查询返回符合条件的技术员列表:{}", engineerCodes);
} }
List<OrderInfoEntity> orders = orderInfoDao.findByDtAndEngineerCodeIn(LocalDate.parse(reqDTO.getDate()), engineerCodes); LocalDate localDate = LocalDate.parse(reqDTO.getDate());
List<OrderInfoEntity> orders = orderInfoDao.findByDtAndEngineerCodeIn(localDate, engineerCodes);
HashMap<String, List<EngineersGanttDTO.Slot>> mapEngineers = new HashMap<>(); HashMap<String, List<EngineersGanttDTO.Slot>> mapEngineers = new HashMap<>();
for (OrderInfoEntity order : orders) { for (OrderInfoEntity order : orders) {
// 服务工单本体 // 服务工单本体
...@@ -71,7 +72,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService { ...@@ -71,7 +72,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
slot.setEtime(getHourMinute(order.getExpectTimeEnd())); slot.setEtime(getHourMinute(order.getExpectTimeEnd()));
} }
slot.setTooltip(getOrderTips(order)); slot.setTooltip(getOrderTips(order));
OrderSkillProjection orderSkill = orderInfoDao.getOrderSkillCaptionByOrderId(order.getOrderId()); OrderSkillProjection orderSkill = orderInfoDao.getOrderSkillCaptionByOrderIdAndDt(order.getOrderId(), localDate);
if (orderSkill != null) { if (orderSkill != null) {
slot.setText(orderSkill.getSkillCaption()); slot.setText(orderSkill.getSkillCaption());
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!