Commit 80d8f39e by chamberone

fix: 解决重复orderid问题

1 parent cea6e6e4
......@@ -14,8 +14,8 @@ public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long>, JpaS
List<OrderInfoEntity> findByOrderId(String orderId);
List<OrderInfoEntity> findByDtAndEngineerCodeIn(LocalDate date, List<String> engineerCodes);
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")
OrderSkillProjection getOrderSkillCaptionByOrderId(String 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 getOrderSkillCaptionByOrderIdAndDt(String orderId, LocalDate dt);
List<OrderInfoEntity> findAllByOrderIdIn(List<String> orderIds);
List<OrderInfoEntity> findAllByDtAndOrderIdIn(LocalDate dt, List<String> orderIds);
List<OrderInfoEntity> findByEngineerCodeAndDtAndAppointmentStatusIn(String engineerCode, LocalDate dt, List<String> appointmentStatus);
......
......@@ -53,7 +53,8 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
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<>();
for (OrderInfoEntity order : orders) {
// 服务工单本体
......@@ -71,7 +72,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
slot.setEtime(getHourMinute(order.getExpectTimeEnd()));
}
slot.setTooltip(getOrderTips(order));
OrderSkillProjection orderSkill = orderInfoDao.getOrderSkillCaptionByOrderId(order.getOrderId());
OrderSkillProjection orderSkill = orderInfoDao.getOrderSkillCaptionByOrderIdAndDt(order.getOrderId(), localDate);
if (orderSkill != null) {
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!