Injury form changes in model
parent
b08932e0f6
commit
ba7ae22220
|
@ -75,6 +75,7 @@ public class InjuryFormOne extends AppCompatActivity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loginViewModel.getDailyWageWorkerData(etEmpId.getText().toString());
|
loginViewModel.getDailyWageWorkerData(etEmpId.getText().toString());
|
||||||
|
StorageManager.getInstance().getInjuryRecordModel().get(0).setWorkerType("DailyWageWorker");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (etEmpId.getText().toString().isEmpty()) {
|
if (etEmpId.getText().toString().isEmpty()) {
|
||||||
|
@ -82,6 +83,7 @@ public class InjuryFormOne extends AppCompatActivity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loginViewModel.getEmployeeData(etEmpId.getText().toString());
|
loginViewModel.getEmployeeData(etEmpId.getText().toString());
|
||||||
|
StorageManager.getInstance().getInjuryRecordModel().get(0).setWorkerType("Employee/Contractor-Worker");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -91,7 +93,7 @@ public class InjuryFormOne extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (isValidate()) {
|
if (isValidate()) {
|
||||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setEmployeeId(Integer.parseInt(etEmpId.getText().toString()));
|
StorageManager.getInstance().getInjuryRecordModel().get(0).setWorkerId(Integer.parseInt(etEmpId.getText().toString()));
|
||||||
Intent intent = new Intent(InjuryFormOne.this, InjuryFormTwo.class);
|
Intent intent = new Intent(InjuryFormOne.this, InjuryFormTwo.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,10 @@ import androidx.core.view.ViewCompat;
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
import com.utopiaindustries.hseobservationsapp.R;
|
import com.utopiaindustries.hseobservationsapp.R;
|
||||||
import com.utopiaindustries.hseobservationsapp.activities.ObservationForms.ObservationOneActivity;
|
|
||||||
import com.utopiaindustries.hseobservationsapp.adapters.BodyPartAdapter;
|
import com.utopiaindustries.hseobservationsapp.adapters.BodyPartAdapter;
|
||||||
import com.utopiaindustries.hseobservationsapp.adapters.IncidentTypeAdapter;
|
import com.utopiaindustries.hseobservationsapp.adapters.IncidentTypeAdapter;
|
||||||
import com.utopiaindustries.hseobservationsapp.adapters.InjuryTypeAdapter;
|
import com.utopiaindustries.hseobservationsapp.adapters.InjuryTypeAdapter;
|
||||||
import com.utopiaindustries.hseobservationsapp.adapters.KpiAdapter;
|
import com.utopiaindustries.hseobservationsapp.adapters.KpiAdapter;
|
||||||
import com.utopiaindustries.hseobservationsapp.adapters.ObservationSubClassAdapter;
|
|
||||||
import com.utopiaindustries.hseobservationsapp.adapters.PersonalIllnessAdapter;
|
import com.utopiaindustries.hseobservationsapp.adapters.PersonalIllnessAdapter;
|
||||||
import com.utopiaindustries.hseobservationsapp.adapters.ShiftAdapter;
|
import com.utopiaindustries.hseobservationsapp.adapters.ShiftAdapter;
|
||||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||||
|
@ -31,8 +29,6 @@ import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjuredBodyPart
|
||||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjury;
|
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjury;
|
||||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjuryType;
|
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjuryType;
|
||||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseKpi;
|
import com.utopiaindustries.hseobservationsapp.models.HseData.HseKpi;
|
||||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationClass;
|
|
||||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationSubClass;
|
|
||||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Shift;
|
import com.utopiaindustries.hseobservationsapp.models.HseData.Shift;
|
||||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||||
|
|
||||||
|
@ -113,7 +109,8 @@ public class InjuryFormTwo extends AppCompatActivity {
|
||||||
|
|
||||||
kpiTextview.setOnItemClickListener((v, position, id, item) -> {
|
kpiTextview.setOnItemClickListener((v, position, id, item) -> {
|
||||||
kpi = kpiArrayList.get(id).getTitle();
|
kpi = kpiArrayList.get(id).getTitle();
|
||||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setKpi(kpi);
|
StorageManager.getInstance().getInjuryRecordModel().get(0).setKpiId(kpiArrayList.get(id).getId());
|
||||||
|
StorageManager.getInstance().getInjuryRecordModel().get(0).setKpiName(kpi);
|
||||||
});
|
});
|
||||||
|
|
||||||
incidentTypeTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
incidentTypeTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
|
@ -121,7 +118,7 @@ public class InjuryFormTwo extends AppCompatActivity {
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
HseIncidentType clickedItem = incidentTypeArrayList.get(position);
|
HseIncidentType clickedItem = incidentTypeArrayList.get(position);
|
||||||
int selectedId = clickedItem.getId();
|
int selectedId = clickedItem.getId();
|
||||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentTypeId(selectedId);
|
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentId(selectedId);
|
||||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentTypeName(clickedItem.getTitle());
|
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentTypeName(clickedItem.getTitle());
|
||||||
//Near Miss = 1, Property Damage = 2, Fire = 5, RTA = 6
|
//Near Miss = 1, Property Damage = 2, Fire = 5, RTA = 6
|
||||||
//Personal Illness = 4
|
//Personal Illness = 4
|
||||||
|
@ -199,7 +196,7 @@ public class InjuryFormTwo extends AppCompatActivity {
|
||||||
});
|
});
|
||||||
|
|
||||||
riskTypeTextview.setOnItemClickListener((v, position, id, item) -> {
|
riskTypeTextview.setOnItemClickListener((v, position, id, item) -> {
|
||||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setRiskTypeName(riskTypeArrayList.get(id).getTitle());
|
StorageManager.getInstance().getInjuryRecordModel().get(0).setRiskLevel(riskTypeArrayList.get(id).getTitle());
|
||||||
});
|
});
|
||||||
|
|
||||||
btnNext.setOnClickListener(new View.OnClickListener() {
|
btnNext.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@ -292,19 +289,19 @@ public class InjuryFormTwo extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showPersistData() {
|
private void showPersistData() {
|
||||||
kpiTextview.post(() -> kpiTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getKpi(), false));
|
kpiTextview.post(() -> kpiTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getKpiName(), false));
|
||||||
incidentTypeTextview.post(() -> incidentTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentTypeName(), false));
|
incidentTypeTextview.post(() -> incidentTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentTypeName(), false));
|
||||||
personalIllnessTextview.post(() -> personalIllnessTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getAccidentTypeName(), false));
|
personalIllnessTextview.post(() -> personalIllnessTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getAccidentTypeName(), false));
|
||||||
injuryTypeTextview.post(() -> injuryTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getInjuryTypeName(), false));
|
injuryTypeTextview.post(() -> injuryTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getInjuryTypeName(), false));
|
||||||
bodyPartTextview.post(() -> bodyPartTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getBodyPartName(), false));
|
bodyPartTextview.post(() -> bodyPartTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getBodyPartName(), false));
|
||||||
riskTypeTextview.post(() -> riskTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getRiskTypeName(), false));
|
riskTypeTextview.post(() -> riskTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getRiskLevel(), false));
|
||||||
|
|
||||||
showLayouts();
|
showLayouts();
|
||||||
|
|
||||||
if (!personalIllnessArrayList_temp.isEmpty()) {
|
if (!personalIllnessArrayList_temp.isEmpty()) {
|
||||||
|
|
||||||
List<HseInjury> filteredUnitItems = personalIllnessArrayList_temp.stream()
|
List<HseInjury> filteredUnitItems = personalIllnessArrayList_temp.stream()
|
||||||
.filter(item -> Objects.equals(item.getIncidentId(), StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentTypeId()))
|
.filter(item -> Objects.equals(item.getIncidentId(), StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
personalIllnessArrayList.clear();
|
personalIllnessArrayList.clear();
|
||||||
|
|
|
@ -3,12 +3,18 @@ package com.utopiaindustries.hseobservationsapp.utils.StorageManager;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class InjuryRecordModel {
|
public class InjuryRecordModel {
|
||||||
private int employeeId;
|
private int workerId;
|
||||||
private String Kpi;
|
private String workerType;
|
||||||
|
|
||||||
private int incidentTypeId;
|
private int kpiId;
|
||||||
|
private String KpiName;
|
||||||
|
|
||||||
|
private int incidentId;
|
||||||
private String incidentTypeName;
|
private String incidentTypeName;
|
||||||
|
|
||||||
|
private int injuryId;
|
||||||
|
private String injuryName;
|
||||||
|
|
||||||
private int accidentTypeId;
|
private int accidentTypeId;
|
||||||
private String accidentTypeName;
|
private String accidentTypeName;
|
||||||
|
|
||||||
|
@ -18,27 +24,27 @@ public class InjuryRecordModel {
|
||||||
private int bodyPartId;
|
private int bodyPartId;
|
||||||
private String bodyPartName;
|
private String bodyPartName;
|
||||||
|
|
||||||
private int riskTypeId;
|
private int riskLevelId;
|
||||||
private String riskTypeName;
|
private String riskLevel;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private List<byte[]> pictures;
|
private List<byte[]> pictures;
|
||||||
|
|
||||||
public int getEmployeeId() {
|
public int getWorkerId() {
|
||||||
return employeeId;
|
return workerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEmployeeId(int employeeId) {
|
public void setWorkerId(int workerId) {
|
||||||
this.employeeId = employeeId;
|
this.workerId = workerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getKpi() {
|
public String getKpiName() {
|
||||||
return Kpi;
|
return KpiName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKpi(String kpi) {
|
public void setKpiName(String kpiName) {
|
||||||
Kpi = kpi;
|
KpiName = kpiName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBodyPartId() {
|
public int getBodyPartId() {
|
||||||
|
@ -81,12 +87,12 @@ public class InjuryRecordModel {
|
||||||
this.pictures = pictures;
|
this.pictures = pictures;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getIncidentTypeId() {
|
public int getIncidentId() {
|
||||||
return incidentTypeId;
|
return incidentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIncidentTypeId(int incidentTypeId) {
|
public void setIncidentId(int incidentId) {
|
||||||
this.incidentTypeId = incidentTypeId;
|
this.incidentId = incidentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIncidentTypeName() {
|
public String getIncidentTypeName() {
|
||||||
|
@ -113,20 +119,20 @@ public class InjuryRecordModel {
|
||||||
this.accidentTypeName = accidentTypeName;
|
this.accidentTypeName = accidentTypeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRiskTypeId() {
|
public int getRiskLevelId() {
|
||||||
return riskTypeId;
|
return riskLevelId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRiskTypeId(int riskTypeId) {
|
public void setRiskLevelId(int riskLevelId) {
|
||||||
this.riskTypeId = riskTypeId;
|
this.riskLevelId = riskLevelId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRiskTypeName() {
|
public String getRiskLevel() {
|
||||||
return riskTypeName;
|
return riskLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRiskTypeName(String riskTypeName) {
|
public void setRiskLevel(String riskLevel) {
|
||||||
this.riskTypeName = riskTypeName;
|
this.riskLevel = riskLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
|
@ -137,12 +143,28 @@ public class InjuryRecordModel {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getWorkerType() {
|
||||||
|
return workerType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkerType(String workerType) {
|
||||||
|
this.workerType = workerType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getKpiId() {
|
||||||
|
return kpiId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKpiId(int kpiId) {
|
||||||
|
this.kpiId = kpiId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "InjuryRecordModel{" +
|
return "InjuryRecordModel{" +
|
||||||
"employeeId=" + employeeId +
|
"employeeId=" + workerId +
|
||||||
", Kpi='" + Kpi + '\'' +
|
", Kpi='" + KpiName + '\'' +
|
||||||
", incidentTypeId=" + incidentTypeId +
|
", incidentTypeId=" + incidentId +
|
||||||
", incidentTypeName='" + incidentTypeName + '\'' +
|
", incidentTypeName='" + incidentTypeName + '\'' +
|
||||||
", accidentTypeId=" + accidentTypeId +
|
", accidentTypeId=" + accidentTypeId +
|
||||||
", accidentTypeName='" + accidentTypeName + '\'' +
|
", accidentTypeName='" + accidentTypeName + '\'' +
|
||||||
|
@ -150,8 +172,8 @@ public class InjuryRecordModel {
|
||||||
", injuryTypeName='" + injuryTypeName + '\'' +
|
", injuryTypeName='" + injuryTypeName + '\'' +
|
||||||
", bodyPartId=" + bodyPartId +
|
", bodyPartId=" + bodyPartId +
|
||||||
", bodyPartName='" + bodyPartName + '\'' +
|
", bodyPartName='" + bodyPartName + '\'' +
|
||||||
", riskTypeId=" + riskTypeId +
|
", riskTypeId=" + riskLevelId +
|
||||||
", riskTypeName='" + riskTypeName + '\'' +
|
", riskTypeName='" + riskLevel + '\'' +
|
||||||
", description='" + description + '\'' +
|
", description='" + description + '\'' +
|
||||||
", pictures=" + pictures +
|
", pictures=" + pictures +
|
||||||
'}';
|
'}';
|
||||||
|
|
Loading…
Reference in New Issue