Injury record report submission done

master
saad.siddiq 2025-05-29 17:24:14 +05:00
parent ba7ae22220
commit 8e5b35e344
3 changed files with 31 additions and 36 deletions

View File

@ -275,7 +275,7 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
String jsonRequest = gson.toJson(hseTrainingRequest);
Log.e("RequestModel JSON", jsonRequest);*/
//loginViewModel.saveHSEData(hseTrainingRequest);
loginViewModel.saveHSEData(hseTrainingRequest);
}

View File

@ -119,7 +119,7 @@ public class InjuryFormTwo extends AppCompatActivity {
HseIncidentType clickedItem = incidentTypeArrayList.get(position);
int selectedId = clickedItem.getId();
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentId(selectedId);
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentTypeName(clickedItem.getTitle());
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentName(clickedItem.getTitle());
//Near Miss = 1, Property Damage = 2, Fire = 5, RTA = 6
//Personal Illness = 4
//Accident = 3
@ -189,8 +189,8 @@ public class InjuryFormTwo extends AppCompatActivity {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
hseInjury = personalIllnessArrayList.get(position).getTitle();
StorageManager.getInstance().getInjuryRecordModel().get(0).setAccidentTypeId(personalIllnessArrayList.get(position).getId());
StorageManager.getInstance().getInjuryRecordModel().get(0).setAccidentTypeName(personalIllnessArrayList.get(position).getTitle());
StorageManager.getInstance().getInjuryRecordModel().get(0).setInjuryId(personalIllnessArrayList.get(position).getId());
StorageManager.getInstance().getInjuryRecordModel().get(0).setInjuryName(personalIllnessArrayList.get(position).getTitle());
}
});
@ -290,8 +290,8 @@ public class InjuryFormTwo extends AppCompatActivity {
private void showPersistData() {
kpiTextview.post(() -> kpiTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getKpiName(), false));
incidentTypeTextview.post(() -> incidentTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentTypeName(), false));
personalIllnessTextview.post(() -> personalIllnessTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getAccidentTypeName(), false));
incidentTypeTextview.post(() -> incidentTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentName(), false));
personalIllnessTextview.post(() -> personalIllnessTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getInjuryName(), false));
injuryTypeTextview.post(() -> injuryTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getInjuryTypeName(), false));
bodyPartTextview.post(() -> bodyPartTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getBodyPartName(), false));
riskTypeTextview.post(() -> riskTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getRiskLevel(), false));
@ -314,9 +314,9 @@ public class InjuryFormTwo extends AppCompatActivity {
}
private void showLayouts() {
if (StorageManager.getInstance().getInjuryRecordModel().get(0).getAccidentTypeName() != null
&& !StorageManager.getInstance().getInjuryRecordModel().get(0).getAccidentTypeName().isEmpty()) {
switch (StorageManager.getInstance().getInjuryRecordModel().get(0).getAccidentTypeName()) {
if (StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentName() != null
&& !StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentName().isEmpty()) {
switch (StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentName()) {
case "Near Miss":
case "Property Damage":
case "RTA":

View File

@ -10,14 +10,11 @@ public class InjuryRecordModel {
private String KpiName;
private int incidentId;
private String incidentTypeName;
private String incidentName;
private int injuryId;
private String injuryName;
private int accidentTypeId;
private String accidentTypeName;
private int injuryTypeId;
private String injuryTypeName;
@ -95,28 +92,12 @@ public class InjuryRecordModel {
this.incidentId = incidentId;
}
public String getIncidentTypeName() {
return incidentTypeName;
public String getIncidentName() {
return incidentName;
}
public void setIncidentTypeName(String incidentTypeName) {
this.incidentTypeName = incidentTypeName;
}
public int getAccidentTypeId() {
return accidentTypeId;
}
public void setAccidentTypeId(int accidentTypeId) {
this.accidentTypeId = accidentTypeId;
}
public String getAccidentTypeName() {
return accidentTypeName;
}
public void setAccidentTypeName(String accidentTypeName) {
this.accidentTypeName = accidentTypeName;
public void setIncidentName(String incidentName) {
this.incidentName = incidentName;
}
public int getRiskLevelId() {
@ -159,15 +140,29 @@ public class InjuryRecordModel {
this.kpiId = kpiId;
}
public int getInjuryId() {
return injuryId;
}
public void setInjuryId(int injuryId) {
this.injuryId = injuryId;
}
public String getInjuryName() {
return injuryName;
}
public void setInjuryName(String injuryName) {
this.injuryName = injuryName;
}
@Override
public String toString() {
return "InjuryRecordModel{" +
"employeeId=" + workerId +
", Kpi='" + KpiName + '\'' +
", incidentTypeId=" + incidentId +
", incidentTypeName='" + incidentTypeName + '\'' +
", accidentTypeId=" + accidentTypeId +
", accidentTypeName='" + accidentTypeName + '\'' +
", incidentTypeName='" + incidentName + '\'' +
", injuryTypeId=" + injuryTypeId +
", injuryTypeName='" + injuryTypeName + '\'' +
", bodyPartId=" + bodyPartId +