use of com.axelor.apps.production.service.operationorder.OperationOrderWorkflowService in project axelor-open-suite by axelor.
the class OperationOrderTimesheetServiceImpl method updateAllRealDuration.
@Override
public void updateAllRealDuration(List<TimesheetLine> timesheetLineList) {
if (timesheetLineList == null) {
return;
}
List<OperationOrder> operationOrderList = timesheetLineList.stream().map(TimesheetLine::getOperationOrder).filter(Objects::nonNull).distinct().collect(Collectors.toList());
OperationOrderWorkflowService operationOrderWorkflowService = Beans.get(OperationOrderWorkflowService.class);
operationOrderList.forEach(operationOrderWorkflowService::updateRealDuration);
}
use of com.axelor.apps.production.service.operationorder.OperationOrderWorkflowService in project axelor-open-suite by axelor.
the class OperationOrderController method machineChange.
public void machineChange(ActionRequest request, ActionResponse response) {
try {
OperationOrder operationOrder = request.getContext().asType(OperationOrder.class);
OperationOrderRepository operationOrderRepo = Beans.get(OperationOrderRepository.class);
OperationOrderWorkflowService operationOrderWorkflowService = Beans.get(OperationOrderWorkflowService.class);
operationOrder = operationOrderRepo.find(operationOrder.getId());
if (operationOrder != null && operationOrder.getStatusSelect() == OperationOrderRepository.STATUS_PLANNED) {
operationOrder = operationOrderWorkflowService.replan(operationOrder);
List<OperationOrder> operationOrderList = operationOrderRepo.all().filter("self.manufOrder = ?1 AND self.priority >= ?2 AND self.statusSelect = 3 AND self.id != ?3", operationOrder.getManufOrder(), operationOrder.getPriority(), operationOrder.getId()).order("priority").order("plannedEndDateT").fetch();
for (OperationOrder operationOrderIt : operationOrderList) {
operationOrderWorkflowService.replan(operationOrderIt);
}
response.setReload(true);
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations