diff --git a/src/main/java/com/tarento/formservice/controllers/FormsController.java b/src/main/java/com/tarento/formservice/controllers/FormsController.java index 542db9d9298dabfe873b6b3316dafe5807ea3ad9..7512082e5a4c29d737eea977d5a08646e306d224 100644 --- a/src/main/java/com/tarento/formservice/controllers/FormsController.java +++ b/src/main/java/com/tarento/formservice/controllers/FormsController.java @@ -288,6 +288,7 @@ public class FormsController { String validation = validationService.validateInspectionObject(incomingData); if (validation.equals(Constants.ResponseCodes.SUCCESS)) { IncomingData inspectionData = new IncomingData(); + inspectionData.setInspectionCompleted(incomingData.getInspectionCompleted()); inspectionData.setInspectorDataObject(incomingData); inspectionData.setApplicationId(incomingData.getApplicationId()); inspectionData.setInspectorSummaryDataObject(incomingData.getInspectorSummaryDataObject()); diff --git a/src/main/java/com/tarento/formservice/model/IncomingData.java b/src/main/java/com/tarento/formservice/model/IncomingData.java index 929698e7ff88d1add0b52b84e64c5127a2d5b731..deeb452c162f64f609f6379184d93a7725455386 100644 --- a/src/main/java/com/tarento/formservice/model/IncomingData.java +++ b/src/main/java/com/tarento/formservice/model/IncomingData.java @@ -33,6 +33,6 @@ public class IncomingData { private String reviewedDate; private String inspectionDate; private String inspectionCompletedDate; - private Boolean inspectionCompleted = false; + private Boolean inspectionCompleted = Boolean.FALSE; } diff --git a/src/main/java/com/tarento/formservice/service/impl/FormsServiceImpl.java b/src/main/java/com/tarento/formservice/service/impl/FormsServiceImpl.java index 5a3ef3c29fc557c0942a10d6afa8ebe3891b0f4d..476d021ea873470164c742641210348a67b504e0 100644 --- a/src/main/java/com/tarento/formservice/service/impl/FormsServiceImpl.java +++ b/src/main/java/com/tarento/formservice/service/impl/FormsServiceImpl.java @@ -892,6 +892,7 @@ public class FormsServiceImpl implements FormsService { @Override public Boolean submitInspection(IncomingData incomingData, UserInfo userInfo) { try { + Boolean inspectionCompleted = incomingData.getInspectionCompleted(); Map<String, Object> applicationMap = getApplicationById(incomingData.getApplicationId(), userInfo); if (applicationMap != null) { IncomingData applicationData = objectMapper.convertValue(applicationMap, IncomingData.class); @@ -902,7 +903,6 @@ public class FormsServiceImpl implements FormsService { // update assignee inspection status in data object Boolean isLeadIns = Boolean.FALSE; - Boolean inspectionCompleted = Boolean.TRUE; if (applicationData != null && applicationData.getInspection() != null && applicationData.getInspection().getAssignedTo() != null) { @@ -921,10 +921,7 @@ public class FormsServiceImpl implements FormsService { }*/ } } - if(incomingData.getInspectionCompleted()) { - inspectionCompleted = Boolean.TRUE; - } - + // allow only lead inspector to submit inspection details //if (isLeadIns) { incomingData.setInspection(applicationData.getInspection());