Commit d135bab3 by 张晓

兼容suborderid不存在的数据

1 parent 53b2d650
...@@ -80,10 +80,10 @@ public class PrepareController { ...@@ -80,10 +80,10 @@ public class PrepareController {
return Result.success(resultMap); return Result.success(resultMap);
} }
// 重新进行数据准备、异步任务运行 // 重新进行数据准备、任务运行
@GetMapping("/solveStart/{groupId}/{day}") @GetMapping("/solveStart/{groupId}/{day}")
public Result<?> solveAsync(@PathVariable String groupId, @PathVariable String day) { public Result<?> solveAsync(@PathVariable String groupId, @PathVariable String day) {
log.info("调用引擎处理-异步处理, groupId:{}, day:{}", groupId, day); log.info("调用引擎处理-处理, groupId:{}, day:{}", groupId, day);
String batchNo = batchService.buildBatchData(groupId, day); String batchNo = batchService.buildBatchData(groupId, day);
// DispatchBatch newBatch= batchService.queryBatchInfoByDay(groupId, day); // DispatchBatch newBatch= batchService.queryBatchInfoByDay(groupId, day);
...@@ -110,11 +110,11 @@ public class PrepareController { ...@@ -110,11 +110,11 @@ public class PrepareController {
solverManager.solveAndListen(problemId, id -> problem, solverManager.solveAndListen(problemId, id -> problem,
this.solveService::saveAndExtractSolution); this.solveService::saveAndExtractSolution);
log.error("调用引擎处理-异步处理, 已触发异步, groupId:{}, batchNo:{}", groupId, batchNo); log.error("调用引擎处理-处理, 已触发, groupId:{}, batchNo:{}", groupId, batchNo);
*/ */
return Result.success("已触发异步执行"); return Result.success("已触发执行");
} }
@GetMapping("/solveStatus/{groupId}/{day}") @GetMapping("/solveStatus/{groupId}/{day}")
......
...@@ -163,9 +163,10 @@ public class ExtractServiceImpl implements ExtractService { ...@@ -163,9 +163,10 @@ public class ExtractServiceImpl implements ExtractService {
} else { } else {
// 如果有记录:1虚拟指派 2排量预派 3 // 如果有记录:1虚拟指派 2排量预派 3
if (Set.of("PRE", "VIRTUAL").contains(appointmentOpt.get().getPreStatus()) &&
Set.of("NOT_ASSIGNED", "ASSIGNED").contains(appointmentOpt.get().getStatus())) {
OrderAppointment appointment = appointmentOpt.get(); OrderAppointment appointment = appointmentOpt.get();
if (Set.of("PRE", "VIRTUAL").contains(appointment.getPreStatus()) &&
Set.of("NOT_ASSIGNED", "ASSIGNED").contains(appointment.getStatus())) {
String lastContent = String.format("批量自动指派:<%s,%s>", appointment.getEngineerCode(), appointment.getEngineerName()); String lastContent = String.format("批量自动指派:<%s,%s>", appointment.getEngineerCode(), appointment.getEngineerName());
appointment.setStatus("ASSIGNED"); appointment.setStatus("ASSIGNED");
appointment.setPreStatus(isConfirm ? "CONFIRM" : "PRE"); appointment.setPreStatus(isConfirm ? "CONFIRM" : "PRE");
...@@ -178,6 +179,9 @@ public class ExtractServiceImpl implements ExtractService { ...@@ -178,6 +179,9 @@ public class ExtractServiceImpl implements ExtractService {
appointment.setExpectEndTime(dispatchOrder.getTimeEnd()); appointment.setExpectEndTime(dispatchOrder.getTimeEnd());
appointment.setUpdateTime(LocalDateTime.now()); appointment.setUpdateTime(LocalDateTime.now());
orderAppointmentRepo.save(appointment); orderAppointmentRepo.save(appointment);
if (null == appointment.getSuborderId()) {
appointment.setSuborderId(appointment.getOrderId());
}
OrderLog orderLog = new OrderLog().setOrderId(orderId).setSuborderId(appointment.getSuborderId()).setSource("PEA-BACKEND").setOperator("DISPATCH") OrderLog orderLog = new OrderLog().setOrderId(orderId).setSuborderId(appointment.getSuborderId()).setSource("PEA-BACKEND").setOperator("DISPATCH")
.setContent(String.format("批量自动指派:<%s,%s>", engCode, engName)).setContentOld(lastContent) .setContent(String.format("批量自动指派:<%s,%s>", engCode, engName)).setContentOld(lastContent)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!