Commit feed90ad by 刘鑫

fix: 预约单统计接口

1 parent e24f9c0f
......@@ -4,6 +4,7 @@ import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.enums.StatusCodeEnum;
import com.dituhui.pea.order.common.SaasUtils;
import com.dituhui.pea.order.common.Stapial4jUtil;
import com.dituhui.pea.order.common.jackson.DateTimeUtil;
import com.dituhui.pea.order.common.jackson.DateUtil;
import com.dituhui.pea.order.dao.EngineerInfoDao;
import com.dituhui.pea.order.dao.EngineerSkillGroupDao;
......@@ -34,6 +35,7 @@ import org.locationtech.spatial4j.shape.Rectangle;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
......@@ -226,7 +228,8 @@ public class PeaOuterAPIServiceImpl implements PeaOuterAPIService {
result.setEngineerCode(engineerCode);
result.setDate(DateUtil.toDate(localDate));
List<OrderInfoEntity> finishedOrder = orderInfoDao.findByServiceStatusAndEngineerCode("INIT", engineerCode);
// 查询工程师指定日期的工单
List<OrderInfoEntity> finishedOrder = orderInfoDao.getEngineerDateOrder(engineerCode, DateTimeUtil.formatDate(localDate));
List<OrderDTO.AppointmentOrderResult> collect = Optional.ofNullable(finishedOrder).orElse(Collections.emptyList())
.stream()
.map(this::order2AppointmentOrderResult)
......@@ -241,11 +244,11 @@ public class PeaOuterAPIServiceImpl implements PeaOuterAPIService {
result.setOrderId(orderInfo.getOrderId());
result.setOrderStatus(orderInfo.getServiceStatus());
result.setPlanBeginTime(DateUtil.toDate(orderInfo.getPlanStartTime()));
// result.setPlanDistance();
result.setPlanDistance(orderInfo.getArriveDistance());
result.setPlanDuration(orderInfo.getTakeTime() * 60);
if (Objects.nonNull(orderInfo.getActualStartTime())) {
result.setActualBeginTime(DateUtil.toDate(orderInfo.getActualStartTime()));
result.setActualDuration(orderInfo.getArriveElapsed() * 60);
result.setActualDuration((int) Duration.between(orderInfo.getActualStartTime(), orderInfo.getActualEndTime()).abs().toSeconds());
result.setActualDistance(orderInfo.getArriveDistance());
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!