Commit 47540644 by wangli

修改

1 parent f43c4c68
package com.dituhui.pea.order.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.TimeUtils;
import com.dituhui.pea.order.dao.*;
......@@ -12,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
......@@ -92,11 +94,17 @@ public class OrderServiceDetailImpl implements OrderServiceDetail {
@Transactional
@Override
public Result<?> getOrderAppointmentList(String orderId) {
public Result<?> getOrderAppointmentList(String orderId) throws BusinessException{
// 获取预约单里列表
OrderAppointmentListResp res = new OrderAppointmentListResp();
OrderRequest order = orderRequestMPDao.getByOrderId(orderId);
if(order == null){
throw new BusinessException("订单不存在");
}
LocalDate curDate = order.getDt();
// 查询预约单列表
List<OrderAppointment> appoints = orderAppointmentMPDao.selectByOrderId(orderId);
if (appoints.isEmpty()) {
......@@ -140,8 +148,8 @@ public class OrderServiceDetailImpl implements OrderServiceDetail {
// 获取title
String title = engineerName;
if (!lastSubOrderId.equals(subOrderId)) {
title = String.format("%s_%s", engineerName, TimeUtils.timestamp2DateTime(o.getExpectStartTime(), TimeUtils.DATE_NO_GAP_FORMAT));
if (!lastSubOrderId.equals(subOrderId) || o.getDt().isBefore(curDate)) {
title = String.format("%s_%s", engineerName, TimeUtils.IsoLocalDate2String(o.getDt()));
}
OrderAppointmentListResp.OrderAppointment item = new OrderAppointmentListResp.OrderAppointment();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!