Commit ea6e08f9 by 张晓

Merge branch 'zx-dispatch' into develop

2 parents 7b2db42d f176cdea
......@@ -55,7 +55,9 @@ public class PrepareController {
SolverConfig solverConfig = new SolverConfig().withSolutionClass(DispatchSolution.class);
solverConfig.withEntityClassList(Arrays.asList(Technician.class, Customer.class));// 这里不能漏掉,否则约束不生效
solverConfig.withConstraintProviderClass(DispatchConstraintProvider.class);
solverConfig.withTerminationSpentLimit(Duration.ofSeconds(60 * 5));
// solverConfig.withTerminationSpentLimit(Duration.ofSeconds(60 * 5));
// 手工触发计算,为尽快看到效果,先给2分钟时间
solverConfig.withTerminationSpentLimit(Duration.ofSeconds(60 * 2));
solverFactory = SolverFactory.create(solverConfig);
solver = solverFactory.buildSolver();
......
......@@ -2,12 +2,9 @@ package com.dituhui.pea.dispatch.dao;
import com.dituhui.pea.dispatch.entity.DispatchBatch;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
......
......@@ -129,6 +129,9 @@ public class OrderInfo implements Serializable {
@Column(name = "appointment_status")
private String appointmentStatus;
@Column(name = "dispatcher")
private String dispatcher;
@Column(name = "order_status")
private String orderStatus;
......
......@@ -122,7 +122,7 @@ public class BatchScheduler {
// Set the output file.
exporter.write(solution, new File("dispatchSolution_%s_%s.json".format(groupId, currDay)));
exporter.write(solution, new File(String.format("dispatchSolution_%s_%s.json",groupId, currDay)));
Thread.sleep(1000 * 5);
......
......@@ -109,7 +109,7 @@ public class BatchServiceImpl implements BatchService {
" concat(a.brand, '-', a.type, '-', a.skill) skills , a.take_time , a.appointment_status\n" +
" from order_info a \n" +
" where a.org_group_id=? and a.dt = ? and bean_status='OPEN'\n" +
" and appointment_method like 'AUTO%' and a.appointment_status in ('INIT','VIRTUAL', 'PRE')\n" +
" and appointment_method like 'AUTO%' and a.appointment_status in ('INIT', 'PRE')\n" +
" and order_status ='NORMAL' and service_status='INIT'\n" +
" order by a.expect_time_begin asc ";
int orderCount = jdbcTemplate.update(sqlOrder, batchNo, groupId, batchDay);
......
......@@ -100,7 +100,7 @@ public class ExtractServiceImpl implements ExtractService {
if (!("OPEN".equals(orderInfo.getBeanStatus()) &&
Set.of("AUTO_NOW", "AUTO_BATCH").contains(orderInfo.getAppointmentMethod()) &&
Set.of("INIT", "VIRTUAL", "PRE").contains(orderInfo.getAppointmentStatus()) &&
Set.of("INIT", "PRE").contains(orderInfo.getAppointmentStatus()) &&
"NORMAL".equals(orderInfo.getOrderStatus()) && "INIT".equals(orderInfo.getServiceStatus()))) {
log.warn("算法结果更新到工单, step1.1-loop, 工单状态异常, groupId:{}, batchNo:{}, orderId:{}, bean-status:{}, appointment-status:{}, order-status:{}, service-status:{}",
......@@ -132,6 +132,7 @@ public class ExtractServiceImpl implements ExtractService {
orderInfo.setArriveElapsed(dispatchOrder.getPathTime());
orderInfo.setArriveDistance(dispatchOrder.getPathDistance());
orderInfo.setAppointmentStatus(isConfirm ? "CONFIRM" : "PRE");
orderInfo.setDispatcher("AUTO_BATCH");
orderInfo.setUpdateTime(LocalDateTime.now());
orderInfoRepo.save(orderInfo);
......@@ -159,8 +160,14 @@ public class ExtractServiceImpl implements ExtractService {
orderInfo.setArriveElapsed(0);
orderInfo.setArriveDistance(0);
orderInfo.setAppointmentStatus("INIT");
orderInfo.setDispatcher("AUTO_BATCH");
orderInfo.setUpdateTime(LocalDateTime.now());
orderInfoRepo.save(orderInfo);
OrderLog orderLog = new OrderLog().setOrderId(orderId).setSuborderId(orderInfo.getSubId()).setSource("PEA-DISPATCH").setOperator("DISPATCH")
.setContent(String.format("批量自动指派:<%s,%s>", "", "抹掉技术员")).setContentOld("")
.setMemo("批量自动指派").setCreateTime(LocalDateTime.now()).setUpdateTime(LocalDateTime.now());
orderLogRepo.save(orderLog);
}
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!