parent
e531cf7982
commit
d45e457efb
|
@ -309,7 +309,7 @@ public class HseTwoActivity extends AppCompatActivity implements EasyPermissions
|
|||
String jsonRequest = gson.toJson(hseTrainingRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
|
||||
//loginViewModel.saveHSEData(hseTrainingRequest);
|
||||
loginViewModel.saveHSEData(hseTrainingRequest);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -271,9 +271,9 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
hseTrainingRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
hseTrainingRequest.setReportData(reportList);
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
/*Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(hseTrainingRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);*/
|
||||
|
||||
//loginViewModel.saveHSEData(hseTrainingRequest);
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import com.utopiaindustries.hseobservationsapp.activities.ObservationForms.Obser
|
|||
import com.utopiaindustries.hseobservationsapp.adapters.BodyPartAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.IncidentTypeAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.InjuryTypeAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.KpiAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.ObservationSubClassAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PersonalIllnessAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.ShiftAdapter;
|
||||
|
@ -28,6 +29,8 @@ import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
|||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseIncidentType;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjuredBodyPart;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjury;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjuryType;
|
||||
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;
|
||||
|
@ -47,7 +50,9 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
injuryTypeTextview, personalIllnessTextview, bodyPartTextview, riskTypeTextview ;
|
||||
String kpi = "";
|
||||
private ShiftAdapter shiftAdapter;
|
||||
private ArrayList<Shift> kpiArrayList = new ArrayList<>();
|
||||
|
||||
private KpiAdapter kpiAdapter;
|
||||
private ArrayList<HseKpi> kpiArrayList = new ArrayList<>();
|
||||
|
||||
private ArrayList<HseIncidentType> incidentTypeArrayList = new ArrayList<>();
|
||||
private IncidentTypeAdapter incidentTypeAdapter;
|
||||
|
@ -60,9 +65,9 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
private ArrayList<HseInjury> personalIllnessArrayList = new ArrayList<>();
|
||||
private PersonalIllnessAdapter personalIllnessAdapter;
|
||||
|
||||
private ArrayList<Shift> injuryTypeArrayList = new ArrayList<>();
|
||||
//private InjuryTypeAdapter injuryTypeAdapter;
|
||||
private ShiftAdapter injuryTypeAdapter;
|
||||
private ArrayList<HseInjuryType> injuryTypeArrayList = new ArrayList<>();
|
||||
private InjuryTypeAdapter injuryTypeAdapter;
|
||||
//private ShiftAdapter injuryTypeAdapter;
|
||||
|
||||
private ArrayList<HseInjuredBodyPart> bodyPartArrayList = new ArrayList<>();
|
||||
private BodyPartAdapter bodyPartAdapter;
|
||||
|
@ -241,14 +246,9 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
showLayouts();
|
||||
|
||||
//kpi -----------
|
||||
kpiArrayList.add(new Shift(1, "First Aid Case"));
|
||||
kpiArrayList.add(new Shift(2, "Reportable Injury"));
|
||||
kpiArrayList.add(new Shift(3, "LTI"));
|
||||
kpiArrayList.add(new Shift(4, "Fire Accident"));
|
||||
kpiArrayList.add(new Shift(5, "Causality/Fatality"));
|
||||
|
||||
shiftAdapter = new ShiftAdapter(this, kpiArrayList);
|
||||
kpiTextview.setAdapter(shiftAdapter);
|
||||
kpiArrayList.addAll(Helper.getList(Helper.hseKpis, this, HseKpi.class));
|
||||
kpiAdapter = new KpiAdapter(this, kpiArrayList);
|
||||
kpiTextview.setAdapter(kpiAdapter);
|
||||
|
||||
//incident type ------------
|
||||
incidentTypeArrayList.addAll(Helper.getList(Helper.hseIncidentTypes, this, HseIncidentType.class));
|
||||
|
@ -259,15 +259,8 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
personalIllnessArrayList_temp.addAll(Helper.getList(Helper.hseInjuries, this, HseInjury.class));
|
||||
|
||||
//Injury Type
|
||||
//injuryTypeArrayList.addAll(Helper.getList(Helper.hseInjuries, this, HseInjury.class));
|
||||
injuryTypeArrayList.add(new Shift(1, "Cut Injury"));
|
||||
injuryTypeArrayList.add(new Shift(2, "Muscle Injury"));
|
||||
injuryTypeArrayList.add(new Shift(3, "Fracture"));
|
||||
injuryTypeArrayList.add(new Shift(4, "Electric Shock"));
|
||||
injuryTypeArrayList.add(new Shift(5, "Burn Injury"));
|
||||
injuryTypeArrayList.add(new Shift(6, "Entanglement"));
|
||||
injuryTypeArrayList.add(new Shift(7, "Others"));
|
||||
injuryTypeAdapter = new ShiftAdapter(this, injuryTypeArrayList);
|
||||
injuryTypeArrayList.addAll(Helper.getList(Helper.hseInjuryTypes, this, HseInjuryType.class));
|
||||
injuryTypeAdapter = new InjuryTypeAdapter(this, injuryTypeArrayList);
|
||||
injuryTypeTextview.setAdapter(injuryTypeAdapter);
|
||||
|
||||
//body part
|
||||
|
|
|
@ -47,17 +47,17 @@ public class LoginActivity extends AppCompatActivity {
|
|||
|
||||
btnLogin.setOnClickListener(v -> {
|
||||
if (isValidate()) {
|
||||
/*loginViewModel.isUserAuthenticated(tfEmail.getText().toString().trim(),
|
||||
loginViewModel.isUserAuthenticated(tfEmail.getText().toString().trim(),
|
||||
tfPassword.getText().toString(),
|
||||
new String[]{"ROLE_UIM_QC_APP_ACCESS_YES"});*/
|
||||
new String[]{"ROLE_UIM_HSE_APP_ACCESS_YES"});
|
||||
|
||||
Preference.setMyBooleanPref(Helper.project_file, "isLoggedIn", getApplicationContext(), true);
|
||||
/*Preference.setMyBooleanPref(Helper.project_file, "isLoggedIn", getApplicationContext(), true);
|
||||
Preference.setMyStringPref(Helper.project_file,Helper.logInUser,this,tfEmail.getText().toString());
|
||||
|
||||
Intent intent = new Intent(this, DashboardActivity.class);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
finish();
|
||||
finish();*/
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -248,9 +248,9 @@ public class ObservationTwoActivity extends AppCompatActivity {
|
|||
observationRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
observationRequest.setReportData(observationList);
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
/*Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(observationRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);*/
|
||||
|
||||
loginViewModel.saveHSEData(observationRequest);
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ public class OtherHseActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
StorageManager.getInstance().getReportActivityModel().get(0).setActivityName(s.toString());
|
||||
StorageManager.getInstance().getOtherActivityModel().get(0).setActivityName(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -94,7 +94,7 @@ public class OtherHseActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
StorageManager.getInstance().getReportActivityModel().get(0).setDescription(s.toString());
|
||||
StorageManager.getInstance().getOtherActivityModel().get(0).setDescription(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -140,6 +140,7 @@ public class OtherHseActivity extends AppCompatActivity {
|
|||
|
||||
loginViewModel.getUserSaveLiveData().observe(this, hseSaveResponse -> {
|
||||
if (hseSaveResponse != null && hseSaveResponse.getStatus().equals("success")) {
|
||||
StorageManager.getInstance().clearOtherActivityModule();
|
||||
Toast.makeText(this, "Reported Submitted", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(OtherHseActivity.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
@ -193,7 +194,7 @@ public class OtherHseActivity extends AppCompatActivity {
|
|||
|
||||
alertDialog.dismiss();
|
||||
|
||||
List<ReportActivityModel> reportList = StorageManager.getInstance().getReportActivityModel();
|
||||
List<ReportActivityModel> reportList = StorageManager.getInstance().getOtherActivityModel();
|
||||
HseReportRequest<ReportActivityModel> reportRequest = new HseReportRequest<>();
|
||||
reportRequest.setObservation_date(StorageManager.getInstance().getObservation_date());
|
||||
reportRequest.setUserId(StorageManager.getInstance().getUserId());
|
||||
|
@ -201,6 +202,9 @@ public class OtherHseActivity extends AppCompatActivity {
|
|||
reportRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
reportRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
reportRequest.setShift(StorageManager.getInstance().getShift());
|
||||
reportRequest.setDepartmentId(StorageManager.getInstance().getDepartmentId());
|
||||
reportRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
reportRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
reportRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
reportRequest.setReportData(reportList);
|
||||
|
||||
|
|
|
@ -404,6 +404,7 @@ public class PermitTwoActivity extends AppCompatActivity implements EasyPermissi
|
|||
|
||||
loginViewModel.getUserSaveLiveData().observe(this, hseSaveResponse -> {
|
||||
if (hseSaveResponse != null && hseSaveResponse.getStatus().equals("success")) {
|
||||
StorageManager.getInstance().clearPermitToWorkModule();
|
||||
Toast.makeText(this, "Reported Submitted", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(PermitTwoActivity.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
|
|
@ -250,7 +250,7 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
StorageManager.getInstance().getReportActivityModel().get(0).setDescription(s.toString());
|
||||
StorageManager.getInstance().getProgressiveActivityModel().get(0).setDescription(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -282,7 +282,7 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
|
||||
alertDialog.dismiss();
|
||||
|
||||
List<ReportActivityModel> reportList = StorageManager.getInstance().getReportActivityModel();
|
||||
List<ReportActivityModel> reportList = StorageManager.getInstance().getProgressiveActivityModel();
|
||||
HseReportRequest<ReportActivityModel> reportRequest = new HseReportRequest<>();
|
||||
reportRequest.setObservation_date(StorageManager.getInstance().getObservation_date());
|
||||
reportRequest.setUserId(StorageManager.getInstance().getUserId());
|
||||
|
@ -290,6 +290,9 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
reportRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
reportRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
reportRequest.setShift(StorageManager.getInstance().getShift());
|
||||
reportRequest.setDepartmentId(StorageManager.getInstance().getDepartmentId());
|
||||
reportRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
reportRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
reportRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
reportRequest.setReportData(reportList);
|
||||
|
||||
|
@ -353,6 +356,7 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
|
||||
loginViewModel.getUserSaveLiveData().observe(this, hseSaveResponse -> {
|
||||
if (hseSaveResponse != null && hseSaveResponse.getStatus().equals("success")) {
|
||||
StorageManager.getInstance().getReportActivityModel().clear();
|
||||
Toast.makeText(this, "Reported Submitted", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(ProgressiveActivity.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
|
|
@ -292,6 +292,7 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
loginViewModel.getUserSaveLiveData().observe(this, hseSaveResponse -> {
|
||||
if (hseSaveResponse != null && hseSaveResponse.getStatus().equals("success")) {
|
||||
Toast.makeText(this, "Reported Submitted", Toast.LENGTH_SHORT).show();
|
||||
StorageManager.getInstance().clearReportActivityModule();
|
||||
Intent intent = new Intent(WeeklyFormOne.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
@ -675,6 +676,9 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
reportRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
reportRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
reportRequest.setShift(StorageManager.getInstance().getShift());
|
||||
reportRequest.setDepartmentId(StorageManager.getInstance().getDepartmentId());
|
||||
reportRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
reportRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
reportRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
reportRequest.setReportData(reportList);
|
||||
|
||||
|
|
|
@ -9,16 +9,17 @@ import android.widget.TextView;
|
|||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseIncidentType;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjuryType;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Shift;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InjuryTypeAdapter extends ArrayAdapter<HseIncidentType> {
|
||||
public class InjuryTypeAdapter extends ArrayAdapter<HseInjuryType> {
|
||||
|
||||
private final Context context;
|
||||
private final List<HseIncidentType> items;
|
||||
private final List<HseInjuryType> items;
|
||||
|
||||
public InjuryTypeAdapter(Context context, List<HseIncidentType> items) {
|
||||
public InjuryTypeAdapter(Context context, List<HseInjuryType> items) {
|
||||
super(context, 0, items);
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
|
@ -30,7 +31,7 @@ public class InjuryTypeAdapter extends ArrayAdapter<HseIncidentType> {
|
|||
convertView = LayoutInflater.from(context).inflate(R.layout.list_items, parent, false);
|
||||
}
|
||||
|
||||
HseIncidentType item = items.get(position);
|
||||
HseInjuryType item = items.get(position);
|
||||
|
||||
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package com.utopiaindustries.hseobservationsapp.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseKpi;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Shift;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class KpiAdapter extends ArrayAdapter<HseKpi> {
|
||||
|
||||
private final Context context;
|
||||
private final List<HseKpi> items;
|
||||
|
||||
public KpiAdapter(Context context, List<HseKpi> items) {
|
||||
super(context, 0, items);
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.list_items, parent, false);
|
||||
}
|
||||
|
||||
HseKpi item = items.get(position);
|
||||
|
||||
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||
|
||||
titleTextView.setText(item.getTitle());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
|
@ -325,6 +325,14 @@ public class HomeFragment extends Fragment {
|
|||
loginViewModel.getUserLiveData().observe(getActivity(), qcResponse -> {
|
||||
if (qcResponse != null) {
|
||||
|
||||
if (!qcResponse.getHseInjuryTypes().isEmpty()) {
|
||||
Helper.saveList(qcResponse.getHseInjuryTypes(), Helper.hseInjuryTypes, getActivity());
|
||||
}
|
||||
|
||||
if (!qcResponse.getHseKpis().isEmpty()) {
|
||||
Helper.saveList(qcResponse.getHseKpis(), Helper.hseKpis, getActivity());
|
||||
}
|
||||
|
||||
if (!qcResponse.getSites().isEmpty()) {
|
||||
|
||||
Helper.saveList(qcResponse.getSites(), Helper.homeSite, getActivity());
|
||||
|
|
|
@ -43,6 +43,9 @@ public class Helper {
|
|||
public static final String hseFloors = "hseFloors";
|
||||
public static final String hseActivities = "hseActivities";
|
||||
|
||||
public static final String hseInjuryTypes = "hseInjuryTypes";
|
||||
public static final String hseKpis = "hseKpis";
|
||||
|
||||
public static final String hseDepartment = "hseDepartment";
|
||||
public static final String hseIncidentTypes = "hseIncidentTypes";
|
||||
public static final String hseInjuredBodyPart = "hseInjuredBodyPart";
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package com.utopiaindustries.hseobservationsapp.models.HseData;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class HseInjuryType {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.utopiaindustries.hseobservationsapp.models.HseData;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class HseKpi {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
}
|
|
@ -7,6 +7,9 @@ import com.google.gson.annotations.SerializedName;
|
|||
|
||||
public class HseResponse {
|
||||
|
||||
@SerializedName("hseInjuryTypes")
|
||||
@Expose
|
||||
private List<HseInjuryType> hseInjuryTypes;
|
||||
@SerializedName("hseFloors")
|
||||
@Expose
|
||||
private List<HseFloor> hseFloors;
|
||||
|
@ -28,6 +31,9 @@ public class HseResponse {
|
|||
@SerializedName("hseDepartment")
|
||||
@Expose
|
||||
private List<HseDepartment> hseDepartment;
|
||||
@SerializedName("hseKpis")
|
||||
@Expose
|
||||
private List<HseKpi> hseKpis;
|
||||
@SerializedName("hseIncidentTypes")
|
||||
@Expose
|
||||
private List<HseIncidentType> hseIncidentTypes;
|
||||
|
@ -53,6 +59,14 @@ public class HseResponse {
|
|||
@Expose
|
||||
private List<Supervisor> supervisors;
|
||||
|
||||
public List<HseInjuryType> getHseInjuryTypes() {
|
||||
return hseInjuryTypes;
|
||||
}
|
||||
|
||||
public void setHseInjuryTypes(List<HseInjuryType> hseInjuryTypes) {
|
||||
this.hseInjuryTypes = hseInjuryTypes;
|
||||
}
|
||||
|
||||
public List<HseFloor> getHseFloors() {
|
||||
return hseFloors;
|
||||
}
|
||||
|
@ -109,6 +123,14 @@ public class HseResponse {
|
|||
this.hseDepartment = hseDepartment;
|
||||
}
|
||||
|
||||
public List<HseKpi> getHseKpis() {
|
||||
return hseKpis;
|
||||
}
|
||||
|
||||
public void setHseKpis(List<HseKpi> hseKpis) {
|
||||
this.hseKpis = hseKpis;
|
||||
}
|
||||
|
||||
public List<HseIncidentType> getHseIncidentTypes() {
|
||||
return hseIncidentTypes;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public class HseReportRequest<T> {
|
|||
private int buildingId;
|
||||
private int floorId;
|
||||
|
||||
private List<T> reportData;
|
||||
private List<T> hseReportRecord;
|
||||
|
||||
public String getObservation_date() {
|
||||
return observation_date;
|
||||
|
@ -75,15 +75,15 @@ public class HseReportRequest<T> {
|
|||
}
|
||||
|
||||
public List<T> getReportData() {
|
||||
return reportData;
|
||||
return hseReportRecord;
|
||||
}
|
||||
|
||||
public void setReportData(List<T> reportData) {
|
||||
this.reportData = reportData;
|
||||
this.hseReportRecord = reportData;
|
||||
}
|
||||
|
||||
public HseReportRequest() {
|
||||
this.reportData = new ArrayList<>();
|
||||
this.hseReportRecord = new ArrayList<>();
|
||||
}
|
||||
|
||||
public int getDepartmentId() {
|
||||
|
@ -121,6 +121,6 @@ public class HseReportRequest<T> {
|
|||
this.departmentId = departmentId;
|
||||
this.buildingId = buildingId;
|
||||
this.floorId = floorId;
|
||||
this.reportData = reportData;
|
||||
this.hseReportRecord = reportData;
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
|
||||
public class PermitToWorkModel {
|
||||
|
||||
private String typeId;
|
||||
private String typeIds;
|
||||
private String typeName;
|
||||
private int workingTeamId;
|
||||
private String workingTeamName;
|
||||
|
@ -15,11 +15,11 @@ public class PermitToWorkModel {
|
|||
private List<byte[]> pictures;
|
||||
|
||||
public String getTypeId() {
|
||||
return typeId;
|
||||
return typeIds;
|
||||
}
|
||||
|
||||
public void setTypeId(String typeId) {
|
||||
this.typeId = typeId;
|
||||
this.typeIds = typeId;
|
||||
}
|
||||
|
||||
public int getWorkingTeamId() {
|
||||
|
|
|
@ -26,6 +26,7 @@ public class StorageManager {
|
|||
private List<ObservationModel> observationsModel;
|
||||
private List<ReportActivityModel> reportActivityModel;
|
||||
private List<ReportActivityModel> progressiveActivityModel;
|
||||
private List<ReportActivityModel> otherActivityModel;
|
||||
private List<PermitToWorkModel> permitToWorkModel;
|
||||
private List<HseTrainingModel> hseTrainingModel;
|
||||
private List<InjuryRecordModel> injuryRecordModel;
|
||||
|
@ -61,6 +62,9 @@ public class StorageManager {
|
|||
|
||||
injuryRecordModel = new ArrayList<>();
|
||||
injuryRecordModel.add(new InjuryRecordModel());
|
||||
|
||||
otherActivityModel = new ArrayList<>();
|
||||
otherActivityModel.add(new ReportActivityModel());
|
||||
}
|
||||
|
||||
public String getObservation_date() {
|
||||
|
@ -215,6 +219,14 @@ public class StorageManager {
|
|||
this.injuryRecordModel = injuryRecordModel;
|
||||
}
|
||||
|
||||
public List<ReportActivityModel> getOtherActivityModel() {
|
||||
return otherActivityModel;
|
||||
}
|
||||
|
||||
public void setOtherActivityModel(List<ReportActivityModel> otherActivityModel) {
|
||||
this.otherActivityModel = otherActivityModel;
|
||||
}
|
||||
|
||||
public void clearObservationModule() {
|
||||
if (observationsModel != null) {
|
||||
observationsModel.clear();
|
||||
|
@ -262,4 +274,12 @@ public class StorageManager {
|
|||
injuryRecordModel.add(new InjuryRecordModel());
|
||||
}
|
||||
|
||||
public void clearOtherActivityModule() {
|
||||
if (otherActivityModel != null) {
|
||||
otherActivityModel.clear();
|
||||
}
|
||||
|
||||
otherActivityModel.add(new ReportActivityModel());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.utopiaindustries.hseobservationsapp.viewmodels;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
@ -66,9 +68,9 @@ public class LoginViewModel extends ViewModel {
|
|||
@Override
|
||||
public void onResponse(@NonNull Call<Boolean> call, @NonNull Response<Boolean> response) {
|
||||
isLoading.setValue(false);
|
||||
//Log.e("onResponse-1: ", "Successful: "+response);
|
||||
Log.e("onResponse-1: ", "Successful: "+response);
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
//Log.e("onResponse-2: ", "Successful: "+response);
|
||||
Log.e("onResponse-2: ", "Successful: "+response);
|
||||
userLoginLiveData.setValue(response.body());
|
||||
} else {
|
||||
userLoginLiveData.setValue(false);
|
||||
|
|
Loading…
Reference in New Issue