Commit d627c170 authored by sarojsingh2021's avatar sarojsingh2021
Browse files

inspection-flow-change

Showing with 17 additions and 0 deletions
+17 -0
......@@ -33,5 +33,6 @@ public class IncomingData {
private String reviewedDate;
private String inspectionDate;
private String inspectionCompletedDate;
private Boolean inspectionCompleted;
}
......@@ -903,6 +903,7 @@ 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) {
for (Assignee assignee : applicationData.getInspection().getAssignedTo()) {
......@@ -910,19 +911,34 @@ public class FormsServiceImpl implements FormsService {
&& assignee.getLeadInspector()) {
isLeadIns = Boolean.TRUE;
assignee.setStatus(workflowDto.getNextState());
if(incomingData.getInspectionCompleted()) {
assignee.setStatus(Constants.WorkflowActions.COMPLETED_INSPECTION);
}
assignee.setConsentDate(DateUtils.getYyyyMmDdInUTC());
} 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) {
incomingData.setInspection(applicationData.getInspection());
incomingData.setInspectionDate(DateUtils.getYyyyMmDdInUTC());
incomingData.getInspection().setInspectionDate(DateUtils.getYyyyMmDdInUTC());
/*
String nextStatus = inspectionCompleted ? workflowDto.getNextState()
: Status.LEADINSCOMPLETED.name();
*/
String nextStatus = inspectionCompleted ? Status.INSCOMPLETED.name()
: Status.LEADINSCOMPLETED.name();
incomingData.getInspection().setStatus(nextStatus);
if (inspectionCompleted) {
incomingData.setStatus(workflowDto.getNextState());
......
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