Enhanced error handling and route saving mechanism, improved UI modal behavior:
- **Frontend**: Updated `CalculationAssistant.vue` modal to disable backdrop closing via `:close-on-backdrop="false"`. - **Backend**: - Adjusted error message processing in `CalculationExecutionService` to handle potential `null` values gracefully. - Improved route saving in `DestinationService` by correcting source node logic and refining `RouteIds` assignments.
This commit is contained in:
parent
e1c1b2918f
commit
302967e645
3 changed files with 7 additions and 4 deletions
|
|
@ -14,7 +14,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<modal :state="showPartNumberModal" @close="closeModal('partNumber')">
|
||||
<modal :state="showPartNumberModal" @close="closeModal('partNumber')" :close-on-backdrop="false">
|
||||
<div class="part-number-modal-container">
|
||||
<h3 class="sub-header">Drop part numbers here</h3>
|
||||
<div class="part-number-drop-container">
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public class DestinationService {
|
|||
Node source = premise.getSupplierNodeId() == null ? userNodeRepository.getById(premise.getUserSupplierNodeId()).orElseThrow() : nodeRepository.getById(premise.getSupplierNodeId()).orElseThrow();
|
||||
|
||||
//noinspection SpringTransactionalMethodCallsInspection
|
||||
saveRoute(routes.get(new RouteIds(premise.getSupplierNodeId(), destinationNodeId, premise.getSupplierNodeId() == null)), destination.getId());
|
||||
saveRoute(routes.get(new RouteIds(source.getId(), destinationNodeId, premise.getSupplierNodeId() == null)), destination.getId());
|
||||
|
||||
destinations.add(destination);
|
||||
}
|
||||
|
|
@ -180,7 +180,7 @@ public class DestinationService {
|
|||
for(var premise : premisses) {
|
||||
for(var destinationId : destinationIds) {
|
||||
boolean isUserSupplierNode = (premise.getSupplierNodeId() == null);
|
||||
var ids = new RouteIds(premise.getSupplierNodeId(), destinationId, isUserSupplierNode);
|
||||
var ids = new RouteIds(isUserSupplierNode ? premise.getUserSupplierNodeId() : premise.getSupplierNodeId(), destinationId, isUserSupplierNode);
|
||||
if(routes.containsKey(ids)) continue;
|
||||
|
||||
if(!nodes.containsKey(destinationId)) {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,10 @@ public class CalculationExecutionService {
|
|||
error.setType(SysErrorType.CALCULATION);
|
||||
error.setCode(e.getClass().getSimpleName().substring(0, Math.min(e.getClass().getSimpleName().length(), 253)));
|
||||
error.setTitle("Calculation operation execution " + calculationId + " failed");
|
||||
error.setMessage(e.getMessage().substring(0, Math.min(e.getMessage().length(), 1000)));
|
||||
|
||||
var msg = e.getMessage() == null ? "" : e.getMessage();
|
||||
|
||||
error.setMessage(msg.substring(0, Math.min(e.getMessage().length(), 1000)));
|
||||
error.setUserId(calc == null ? null : calc.getUserId());
|
||||
error.setCalculationJobId(calculationId);
|
||||
error.setTrace(Arrays.stream(e.getStackTrace()).map(sysErrorTransformer::toSysErrorTraceItem).toList());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue