Commit 1bf0d372 by 王力

Merge branch 'dev_rescheduling20230711' into 'develop'

增加日志

See merge request !190
2 parents 2bbdf3cb 78959a94
......@@ -9,6 +9,7 @@ import com.dituhui.pea.order.entity.OrderAppointment;
import com.dituhui.pea.order.entity.OrderRequest;
import com.dituhui.pea.order.entity.SkillInfo;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.sql.Timestamp;
......@@ -21,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
public class OrderAssignCheck {
private String orderId;
private String engineerCode;
......@@ -62,6 +64,8 @@ public class OrderAssignCheck {
}
public Result orderAssignCheck() {
log.info("begin orderAssignCheck:orderId={}, engineerCode={}", this.orderId, this.engineerCode);
OrderRequest order = orderRequestMPDao.getByOrderId(this.orderId);
double curX = Double.parseDouble(order.getX());
double curY = Double.parseDouble(order.getY());
......@@ -73,17 +77,21 @@ public class OrderAssignCheck {
// 获取客户期望时间段
int start = this.timestamp2Point(order.getExpectTimeBegin());
int end = this.timestamp2Point(order.getExpectTimeEnd());
log.info("客户期望的时间段:{}-{}, 技能所需时长:{}, 坐标:{},{}", start, end, takeTime, curX, curY);
// 获取技术员的已分配订单的时间段, 根据时间段排序
List<OrderSegment> orderSegments = getEngineerOrderSegments(engineerCode, order.getDt());
// 转化为SegmentInsertion需要的时间段
List<SegmentInsertion.Segment> segments = this.orderSegment2Segment(orderSegments);
log.info("技术员已分配时间段列表:{}", segments);
int index = SegmentInsertion.insertSegment(takeTime, start, end, segments);
if (index == -1) {
log.info("没有可连续插入的空间");
return new Result(false, "没有连续可插入空间(没计算时间)", 0, 0, null, null);
}
log.info("插入位置为第{}单", index);
// 计算距离 & 时间
if(index == 0) {
// 第一订单为出发地
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!