Unverified Commit 11defa9e authored by Mahesh Maney R's avatar Mahesh Maney R Committed by GitHub
Browse files

Merge pull request #6 from UPHRH-platform/inspection-flow-changes

Inspection flow changes
No related merge requests found
Showing with 8 additions and 10 deletions
+8 -10
......@@ -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());
......
......@@ -33,6 +33,6 @@ public class IncomingData {
private String reviewedDate;
private String inspectionDate;
private String inspectionCompletedDate;
private Boolean inspectionCompleted;
private Boolean inspectionCompleted = Boolean.FALSE;
}
......@@ -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) {
......@@ -916,17 +916,14 @@ public class FormsServiceImpl implements FormsService {
}
assignee.setConsentDate(DateUtils.getYyyyMmDdInUTC());
} else if (StringUtils.isBlank(assignee.getStatus())) {
} /*else if (StringUtils.isBlank(assignee.getStatus())) {
inspectionCompleted = Boolean.FALSE;
}
}*/
}
}
if(incomingData.getInspectionCompleted()) {
inspectionCompleted = Boolean.TRUE;
}
// allow only lead inspector to submit inspection details
if (isLeadIns) {
//if (isLeadIns) {
incomingData.setInspection(applicationData.getInspection());
incomingData.setInspectionDate(DateUtils.getYyyyMmDdInUTC());
incomingData.getInspection().setInspectionDate(DateUtils.getYyyyMmDdInUTC());
......@@ -949,7 +946,7 @@ public class FormsServiceImpl implements FormsService {
inspectionCompleted ? Constants.WorkflowActions.COMPLETED_INSPECTION
: Constants.WorkflowActions.LEAD_INSPECTION_COMPLETED);
return response;
}
//}
}
} catch (Exception e) {
LOGGER.error(String.format(Constants.EXCEPTION, "submitInspection", e.getMessage()));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment