Commit de5b9043 authored by Antonius's avatar Antonius

Vcare finish documentation in package activity

parent aeb33760
This diff is collapsed.
...@@ -793,6 +793,7 @@ public class DetailEdcAll extends AppCompatActivity implements TerminalFeatureAd ...@@ -793,6 +793,7 @@ public class DetailEdcAll extends AppCompatActivity implements TerminalFeatureAd
}); });
} }
// function post data asset1 to API https://demo.visionet.co.id/crmmultibankapi/api/MaintenanceAsset
private void SubmitAsset1(final String TerminalId, String MerchantId, String AccountId, String AccountName, String MerchantName, private void SubmitAsset1(final String TerminalId, String MerchantId, String AccountId, String AccountName, String MerchantName,
String MerchantAddress, String MID, String TID, String ServicePoint, String ServicePointName, String MerchantAddress, String MID, String TID, String ServicePoint, String ServicePointName,
String KPT, String SN, String MerchantKondisi, String EDCkondisi, String reason, boolean isvalid, String KPT, String SN, String MerchantKondisi, String EDCkondisi, String reason, boolean isvalid,
...@@ -851,6 +852,7 @@ public class DetailEdcAll extends AppCompatActivity implements TerminalFeatureAd ...@@ -851,6 +852,7 @@ public class DetailEdcAll extends AppCompatActivity implements TerminalFeatureAd
}); });
} }
// function check sn data asset to API https://demo.visionet.co.id/crmmultibankapi/api/MaintenanceAsset/CheckAsset
private void checkSN(String SN) { private void checkSN(String SN) {
progressDialog.setMessage("Please wait..."); progressDialog.setMessage("Please wait...");
progressDialog.show(); progressDialog.show();
...@@ -925,6 +927,7 @@ public class DetailEdcAll extends AppCompatActivity implements TerminalFeatureAd ...@@ -925,6 +927,7 @@ public class DetailEdcAll extends AppCompatActivity implements TerminalFeatureAd
}); });
} }
// function check sn data asset to API https://demo.visionet.co.id/crmmultibankapi/api/MaintenanceAsset/CheckAsset
private void checkSN1(String SN) { private void checkSN1(String SN) {
progressDialog.setMessage("Please wait..."); progressDialog.setMessage("Please wait...");
progressDialog.show(); progressDialog.show();
...@@ -980,6 +983,7 @@ public class DetailEdcAll extends AppCompatActivity implements TerminalFeatureAd ...@@ -980,6 +983,7 @@ public class DetailEdcAll extends AppCompatActivity implements TerminalFeatureAd
}); });
} }
// function give watermark to Bitmap result photo
private void prosesGambar(int type,Bitmap gambarFoto) { private void prosesGambar(int type,Bitmap gambarFoto) {
if (gambarFoto != null) { if (gambarFoto != null) {
Bitmap gambar = null; Bitmap gambar = null;
...@@ -1147,7 +1151,7 @@ public class DetailEdcAll extends AppCompatActivity implements TerminalFeatureAd ...@@ -1147,7 +1151,7 @@ public class DetailEdcAll extends AppCompatActivity implements TerminalFeatureAd
} }
} }
// function save photo to realm database
private void savePhoto(final int type,String photo) { private void savePhoto(final int type,String photo) {
final AssetFoto obj = new AssetFoto(); final AssetFoto obj = new AssetFoto();
final AssetFoto lastFoto = mRealm.where(AssetFoto.class).findAllSorted("id_foto", Sort.DESCENDING).where().findFirst(); final AssetFoto lastFoto = mRealm.where(AssetFoto.class).findAllSorted("id_foto", Sort.DESCENDING).where().findFirst();
......
...@@ -316,9 +316,11 @@ public class DetailHistoryIncident extends AppCompatActivity { ...@@ -316,9 +316,11 @@ public class DetailHistoryIncident extends AppCompatActivity {
tvPhones.setText(workOrder.getTaskParameter().get(0).getPhone()); tvPhones.setText(workOrder.getTaskParameter().get(0).getPhone());
tvCommunicationlineCode.setText(workOrder.getTaskParameter().get(0).getCommunicationLine()); tvCommunicationlineCode.setText(workOrder.getTaskParameter().get(0).getCommunicationLine());
if (!workOrder.getPhotoEDC().equals("")) { if (!workOrder.getPhotoEDC().equals("")) {
// function call picasso from libary to load url string photo EDC
Picasso.with(DetailHistoryIncident.this).load(workOrder.getPhotoEDC()).into(ivEDC); Picasso.with(DetailHistoryIncident.this).load(workOrder.getPhotoEDC()).into(ivEDC);
} }
if (!workOrder.getPhotoMerchant().equals("")) { if (!workOrder.getPhotoMerchant().equals("")) {
// function call picasso from libary to load url string photo Merchant
Picasso.with(DetailHistoryIncident.this).load(workOrder.getPhotoMerchant()).into(ivMerchant); Picasso.with(DetailHistoryIncident.this).load(workOrder.getPhotoMerchant()).into(ivMerchant);
} }
...@@ -414,6 +416,7 @@ public class DetailHistoryIncident extends AppCompatActivity { ...@@ -414,6 +416,7 @@ public class DetailHistoryIncident extends AppCompatActivity {
} }
} }
// function convert date format api to format user request in view history
private String getECD(String input) { private String getECD(String input) {
SimpleDateFormat input_format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); SimpleDateFormat input_format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
SimpleDateFormat output_format = new SimpleDateFormat("dd/MMM/yyyy HH.mm"); SimpleDateFormat output_format = new SimpleDateFormat("dd/MMM/yyyy HH.mm");
...@@ -430,6 +433,7 @@ public class DetailHistoryIncident extends AppCompatActivity { ...@@ -430,6 +433,7 @@ public class DetailHistoryIncident extends AppCompatActivity {
return after_format; return after_format;
} }
// function declare item view dialog photo
private void setDialog() { private void setDialog() {
dialogViewPhoto = new Dialog(this); dialogViewPhoto = new Dialog(this);
dialogViewPhoto.setContentView(R.layout.view_photo); dialogViewPhoto.setContentView(R.layout.view_photo);
...@@ -443,6 +447,7 @@ public class DetailHistoryIncident extends AppCompatActivity { ...@@ -443,6 +447,7 @@ public class DetailHistoryIncident extends AppCompatActivity {
btnSave = (Button) dialogViewPhoto.findViewById(R.id.btnSave); btnSave = (Button) dialogViewPhoto.findViewById(R.id.btnSave);
} }
// function add array dinamis image view to photo struk place
private void addStruk(int size) { private void addStruk(int size) {
ivStruk = null; ivStruk = null;
LinearLayout ll = llStrukhis; LinearLayout ll = llStrukhis;
...@@ -462,6 +467,7 @@ public class DetailHistoryIncident extends AppCompatActivity { ...@@ -462,6 +467,7 @@ public class DetailHistoryIncident extends AppCompatActivity {
} }
} }
// function mapping checklist item checkbok materi training
private void setMateriTraining() { private void setMateriTraining() {
String a1 = "0"; String a1 = "0";
//String[] materiPromo = workOrder.getTaskParameter().get(0).getMaterial_Promo().split("\\+"); //String[] materiPromo = workOrder.getTaskParameter().get(0).getMaterial_Promo().split("\\+");
...@@ -617,6 +623,8 @@ public class DetailHistoryIncident extends AppCompatActivity { ...@@ -617,6 +623,8 @@ public class DetailHistoryIncident extends AppCompatActivity {
} }
} }
// function convert binary to array string
private String getDigit(int digit, String string) { private String getDigit(int digit, String string) {
StringBuffer sb = new StringBuffer(string); StringBuffer sb = new StringBuffer(string);
int zero = digit - string.length(); int zero = digit - string.length();
...@@ -627,6 +635,7 @@ public class DetailHistoryIncident extends AppCompatActivity { ...@@ -627,6 +635,7 @@ public class DetailHistoryIncident extends AppCompatActivity {
return sb.toString(); return sb.toString();
} }
// function mapping checklist item checkbok kelengkapan EDC dan dongle
private void setKelGAB() { private void setKelGAB() {
if(!workOrder.getTaskParameter().get(0).getEDC_Component().equals("") && workOrder.getTaskParameter().get(0).getEDC_Component()!=null){ if(!workOrder.getTaskParameter().get(0).getEDC_Component().equals("") && workOrder.getTaskParameter().get(0).getEDC_Component()!=null){
String[] EDCComponent = workOrder.getTaskParameter().get(0).getEDC_Component().split("\\+"); String[] EDCComponent = workOrder.getTaskParameter().get(0).getEDC_Component().split("\\+");
...@@ -824,9 +833,9 @@ public class DetailHistoryIncident extends AppCompatActivity { ...@@ -824,9 +833,9 @@ public class DetailHistoryIncident extends AppCompatActivity {
} }
} }
// function mapping checklist item checkbok promomaterial
private void setPromoMaterial() { private void setPromoMaterial() {
String a1 = "0"; String a1 = "0";
//String[] materiPromo = workOrder.getTaskParameter().get(0).getMaterial_Promo().split("\\+");
if(workOrder.getTaskParameter().get(0).getMaterial_Promo()==null){ if(workOrder.getTaskParameter().get(0).getMaterial_Promo()==null){
a1 = "0"; a1 = "0";
}else if(workOrder.getTaskParameter().get(0).getMaterial_Promo().equals("")){ }else if(workOrder.getTaskParameter().get(0).getMaterial_Promo().equals("")){
...@@ -948,6 +957,8 @@ public class DetailHistoryIncident extends AppCompatActivity { ...@@ -948,6 +957,8 @@ public class DetailHistoryIncident extends AppCompatActivity {
} }
} }
} }
// function set view item from list array terminalcustomes & list array asset
private void setRecyclerView() { private void setRecyclerView() {
historyterminalCustomerAdapter = new HistoryTerminalCustomerAdapter(this, terminalCustomers); historyterminalCustomerAdapter = new HistoryTerminalCustomerAdapter(this, terminalCustomers);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
......
...@@ -257,7 +257,6 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -257,7 +257,6 @@ public class DetailHistoryPm extends AppCompatActivity{
HistoryLinearPABX.setVisibility(View.GONE); HistoryLinearPABX.setVisibility(View.GONE);
} }
} }
//HistoryPABXLinePm.setText(pmHistoryModel.getPABXLine());
HistoryPICPm.setText(pmHistoryModel.getPIC()); HistoryPICPm.setText(pmHistoryModel.getPIC());
HistoryPhonePICPm.setText(pmHistoryModel.getPhonePIC()); HistoryPhonePICPm.setText(pmHistoryModel.getPhonePIC());
HistoryEDCPm.setText(pmHistoryModel.getEDC()); HistoryEDCPm.setText(pmHistoryModel.getEDC());
...@@ -309,11 +308,13 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -309,11 +308,13 @@ public class DetailHistoryPm extends AppCompatActivity{
if(pmHistoryModel.getPhotoMerchant().equals("")){ if(pmHistoryModel.getPhotoMerchant().equals("")){
HistoryMerchantPm.setVisibility(View.GONE); HistoryMerchantPm.setVisibility(View.GONE);
}else{ }else{
// function view photo from url string photo use picasso from libary
Picasso.with(DetailHistoryPm.this).load(pmHistoryModel.getPhotoMerchant()).into(HistoryMerchantPm); Picasso.with(DetailHistoryPm.this).load(pmHistoryModel.getPhotoMerchant()).into(HistoryMerchantPm);
} }
if(pmHistoryModel.getPhotoEDC().equals("")){ if(pmHistoryModel.getPhotoEDC().equals("")){
HistoryEdcPm.setVisibility(View.GONE); HistoryEdcPm.setVisibility(View.GONE);
}else{ }else{
// function view photo from url string photo use picasso from libary
Picasso.with(DetailHistoryPm.this).load(pmHistoryModel.getPhotoEDC()).into(HistoryEdcPm); Picasso.with(DetailHistoryPm.this).load(pmHistoryModel.getPhotoEDC()).into(HistoryEdcPm);
} }
...@@ -322,7 +323,7 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -322,7 +323,7 @@ public class DetailHistoryPm extends AppCompatActivity{
public void onClick(View view) { public void onClick(View view) {
dialogViewPhoto.show(); dialogViewPhoto.show();
btnDelete.setVisibility(View.GONE); btnDelete.setVisibility(View.GONE);
// ivPhoto.setImageBitmap(decodeImage(woFotoHelper.getFotoMerchantPm(pmModel.getPreventiveMaintenanceId()).getFoto())); // function view photo from url string photo use picasso from libary
Picasso.with(DetailHistoryPm.this).load(pmHistoryModel.getPhotoMerchant()).into(ivPhoto); Picasso.with(DetailHistoryPm.this).load(pmHistoryModel.getPhotoMerchant()).into(ivPhoto);
btnCancel.setOnClickListener(new View.OnClickListener() { btnCancel.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -339,7 +340,7 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -339,7 +340,7 @@ public class DetailHistoryPm extends AppCompatActivity{
if (pmHistoryModel.getMerchantCondition().equalsIgnoreCase("Buka") || pmHistoryModel.getMerchantCondition().equalsIgnoreCase("Renovasi dapat di check")) { if (pmHistoryModel.getMerchantCondition().equalsIgnoreCase("Buka") || pmHistoryModel.getMerchantCondition().equalsIgnoreCase("Renovasi dapat di check")) {
dialogViewPhoto.show(); dialogViewPhoto.show();
btnDelete.setVisibility(View.GONE); btnDelete.setVisibility(View.GONE);
// ivPhoto.setImageBitmap(decodeImage(woFotoHelper.getFotoMerchantPm(pmModel.getPreventiveMaintenanceId()).getFoto())); // function view photo from url string photo use picasso from libary
Picasso.with(DetailHistoryPm.this).load(pmHistoryModel.getPhotoEDC()).into(ivPhoto); Picasso.with(DetailHistoryPm.this).load(pmHistoryModel.getPhotoEDC()).into(ivPhoto);
btnCancel.setOnClickListener(new View.OnClickListener() { btnCancel.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -355,7 +356,6 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -355,7 +356,6 @@ public class DetailHistoryPm extends AppCompatActivity{
addStruk(photoStruckListModels.size()); addStruk(photoStruckListModels.size());
for (int i=0; i<ivHistoryStrukList.size(); i++){ for (int i=0; i<ivHistoryStrukList.size(); i++){
Picasso.with(DetailHistoryPm.this).load(photoStruckListModels.get(i).getImage()).into(ivHistoryStrukList.get(i)); Picasso.with(DetailHistoryPm.this).load(photoStruckListModels.get(i).getImage()).into(ivHistoryStrukList.get(i));
//final int finalI = i;
final int finalI = i; final int finalI = i;
ivHistoryStrukList.get(i).setOnClickListener(new View.OnClickListener() { ivHistoryStrukList.get(i).setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -363,6 +363,7 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -363,6 +363,7 @@ public class DetailHistoryPm extends AppCompatActivity{
if (pmHistoryModel.getMerchantCondition().equalsIgnoreCase("Buka") || pmHistoryModel.getMerchantCondition().equalsIgnoreCase("Renovasi dapat di check")) { if (pmHistoryModel.getMerchantCondition().equalsIgnoreCase("Buka") || pmHistoryModel.getMerchantCondition().equalsIgnoreCase("Renovasi dapat di check")) {
dialogViewPhoto.show(); dialogViewPhoto.show();
btnDelete.setVisibility(View.GONE); btnDelete.setVisibility(View.GONE);
// function view photo from url string photo use picasso from libary
Picasso.with(DetailHistoryPm.this).load(photoStruckListModels.get(finalI).getImage()).into(ivPhoto); Picasso.with(DetailHistoryPm.this).load(photoStruckListModels.get(finalI).getImage()).into(ivPhoto);
btnCancel.setOnClickListener(new View.OnClickListener() { btnCancel.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -376,7 +377,10 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -376,7 +377,10 @@ public class DetailHistoryPm extends AppCompatActivity{
} }
} }
void addStruk(int jumlah){
// function add array dinamis image view to photo struk place
private void addStruk(int jumlah){
ivStruk = null; ivStruk = null;
LinearLayout ll = llHistoryStrukPm; LinearLayout ll = llHistoryStrukPm;
for (int i = 0; i < jumlah; i++) { for (int i = 0; i < jumlah; i++) {
...@@ -397,6 +401,7 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -397,6 +401,7 @@ public class DetailHistoryPm extends AppCompatActivity{
} }
} }
// function set view item from list array terminalcustomes,list array asset, & cashier
private void setRecyclerView() { private void setRecyclerView() {
terminalCustomerAdapter = new TerminalCustomerAdapterHistoryPm(this, terminalCustomers); terminalCustomerAdapter = new TerminalCustomerAdapterHistoryPm(this, terminalCustomers);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
...@@ -509,6 +514,7 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -509,6 +514,7 @@ public class DetailHistoryPm extends AppCompatActivity{
rvCashierPm.setAdapter(cashierTrainingAdapterpm); rvCashierPm.setAdapter(cashierTrainingAdapterpm);
} }
// function mapping checklist item checkbok materi training
private void setMateriTraining() { private void setMateriTraining() {
String[] materi = pmHistoryModel.getMateriTraining().split("\\+"); String[] materi = pmHistoryModel.getMateriTraining().split("\\+");
String materitraining = Integer.toBinaryString(Integer.parseInt(materi[0])); String materitraining = Integer.toBinaryString(Integer.parseInt(materi[0]));
...@@ -692,6 +698,7 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -692,6 +698,7 @@ public class DetailHistoryPm extends AppCompatActivity{
} }
} }
// function convert binary to array string
private String getDigit(int digit, String string) { private String getDigit(int digit, String string) {
StringBuffer sb = new StringBuffer(string); StringBuffer sb = new StringBuffer(string);
int zero = digit - string.length(); int zero = digit - string.length();
...@@ -702,6 +709,7 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -702,6 +709,7 @@ public class DetailHistoryPm extends AppCompatActivity{
return sb.toString(); return sb.toString();
} }
// function declare item view dialog photo
private void setDialog() { private void setDialog() {
dialogViewPhoto = new Dialog(this); dialogViewPhoto = new Dialog(this);
dialogViewPhoto.setContentView(R.layout.view_photo); dialogViewPhoto.setContentView(R.layout.view_photo);
...@@ -714,6 +722,7 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -714,6 +722,7 @@ public class DetailHistoryPm extends AppCompatActivity{
btnSave = (Button) dialogViewPhoto.findViewById(R.id.btnSave); btnSave = (Button) dialogViewPhoto.findViewById(R.id.btnSave);
} }
// function convert date format api to format user request in view history
private String reformatERD(String input){ private String reformatERD(String input){
String ssq =""; String ssq ="";
if(input == null){ if(input == null){
...@@ -723,7 +732,6 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -723,7 +732,6 @@ public class DetailHistoryPm extends AppCompatActivity{
}else { }else {
SimpleDateFormat input_format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); SimpleDateFormat input_format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
SimpleDateFormat output_format = new SimpleDateFormat("dd-MMM-yyyy HH:mm"); SimpleDateFormat output_format = new SimpleDateFormat("dd-MMM-yyyy HH:mm");
// SimpleDateFormat output_format = new SimpleDateFormat("dd-MMM HH:mm");
Date before_format; Date before_format;
String after_format = null; String after_format = null;
...@@ -732,7 +740,6 @@ public class DetailHistoryPm extends AppCompatActivity{ ...@@ -732,7 +740,6 @@ public class DetailHistoryPm extends AppCompatActivity{
after_format = output_format.format(before_format); after_format = output_format.format(before_format);
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
//ssq = after_format;
} }
ssq = after_format; ssq = after_format;
} }
......
...@@ -144,8 +144,8 @@ public class HistoryImportantActivity extends AppCompatActivity { ...@@ -144,8 +144,8 @@ public class HistoryImportantActivity extends AppCompatActivity {
}; };
} }
// function get data history important from API https://demo.visionet.co.id/crmmultibankapi/api/Data?getWorkOrderHistory
private void getIncidentData() { private void getIncidentData() {
//rvIncident.setVisibility(View.GONE);
Call<GetWorkOrderResponseHistory> callWorkOrder = workOrderService.getListHistoryWo(session.getUserToken(), systemUser.getSystemUserId()); Call<GetWorkOrderResponseHistory> callWorkOrder = workOrderService.getListHistoryWo(session.getUserToken(), systemUser.getSystemUserId());
callWorkOrder.enqueue(new Callback<GetWorkOrderResponseHistory>() { callWorkOrder.enqueue(new Callback<GetWorkOrderResponseHistory>() {
@Override @Override
...@@ -211,6 +211,7 @@ public class HistoryImportantActivity extends AppCompatActivity { ...@@ -211,6 +211,7 @@ public class HistoryImportantActivity extends AppCompatActivity {
android.R.color.holo_red_light); android.R.color.holo_red_light);
} }
// function set item list from array realmlist workOrderHistories
private void setRecyclerView() { private void setRecyclerView() {
incidentAdapter = new HistoryIncidentAdapter(HistoryImportantActivity.this, workOrderHistories); incidentAdapter = new HistoryIncidentAdapter(HistoryImportantActivity.this, workOrderHistories);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(HistoryImportantActivity.this); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(HistoryImportantActivity.this);
......
...@@ -66,16 +66,19 @@ public class HistoryRoutineActivity extends AppCompatActivity { ...@@ -66,16 +66,19 @@ public class HistoryRoutineActivity extends AppCompatActivity {
tabLayout.setupWithViewPager(viewPager); tabLayout.setupWithViewPager(viewPager);
} }
// public function setup numbering item tabbar history routine Rollout
public void setupHisRoll(){ public void setupHisRoll(){
workOrderHistoriesRollout = workOrderHelper.getHistoryRoutineRolloutAsc(); workOrderHistoriesRollout = workOrderHelper.getHistoryRoutineRolloutAsc();
setupViewPager(viewPager,workOrderHistoriesRollout.size(),HisRoutinePm); setupViewPager(viewPager,workOrderHistoriesRollout.size(),HisRoutinePm);
} }
// public function setup numbering item tabbar history routine PM
public void setupHisPm(){ public void setupHisPm(){
pmHistoryModels = workOrderHelper.getListAllHistoryRoutinePM(); pmHistoryModels = workOrderHelper.getListAllHistoryRoutinePM();
setupViewPager(viewPager,HisRoutineRoll,pmHistoryModels.size()); setupViewPager(viewPager,HisRoutineRoll,pmHistoryModels.size());
} }
// function set up fragment for tabbar history routine
private void setupViewPager(ViewPager viewPager, int HisRoutineRoll, int HisRoutinePm) { private void setupViewPager(ViewPager viewPager, int HisRoutineRoll, int HisRoutinePm) {
HistoryRoutineActivity.ViewPagerAdapter adapter = new HistoryRoutineActivity.ViewPagerAdapter(getSupportFragmentManager()); HistoryRoutineActivity.ViewPagerAdapter adapter = new HistoryRoutineActivity.ViewPagerAdapter(getSupportFragmentManager());
adapter.addFragment(new HistoryRolloutFragment(), "Rollout ("+HisRoutineRoll+")"); adapter.addFragment(new HistoryRolloutFragment(), "Rollout ("+HisRoutineRoll+")");
......
...@@ -123,6 +123,7 @@ public class HistorySettlement extends AppCompatActivity { ...@@ -123,6 +123,7 @@ public class HistorySettlement extends AppCompatActivity {
}; };
} }
// function get data history receive asset from Api https://demo.visionet.co.id/crmmultibankapi/api/Data?GetSettlementAssetEngineer
private void getHistoryAsset() { private void getHistoryAsset() {
Call<GetSettlementAssetEngineer> callSettelment = workOrderService.getSettlementAssetEngineer(session.getUserToken(), user.getSystemUserId(),user.getAttributeId()); Call<GetSettlementAssetEngineer> callSettelment = workOrderService.getSettlementAssetEngineer(session.getUserToken(), user.getSystemUserId(),user.getAttributeId());
callSettelment.enqueue(new Callback<GetSettlementAssetEngineer>() { callSettelment.enqueue(new Callback<GetSettlementAssetEngineer>() {
...@@ -190,6 +191,7 @@ public class HistorySettlement extends AppCompatActivity { ...@@ -190,6 +191,7 @@ public class HistorySettlement extends AppCompatActivity {
android.R.color.holo_red_light); android.R.color.holo_red_light);
} }
// function set item list from array realmlist historySettlement
private void setRecyclerViewHistorySettlement() { private void setRecyclerViewHistorySettlement() {
returnAssetAdapter = new ReturnAssetAdapter(HistorySettlement.this, historySettlement); returnAssetAdapter = new ReturnAssetAdapter(HistorySettlement.this, historySettlement);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(HistorySettlement.this); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(HistorySettlement.this);
......
...@@ -67,16 +67,19 @@ public class HistoryUrgentActivity extends AppCompatActivity { ...@@ -67,16 +67,19 @@ public class HistoryUrgentActivity extends AppCompatActivity {
tabLayout.setupWithViewPager(viewPager); tabLayout.setupWithViewPager(viewPager);
} }
// public function set numbering item tabbar history urgent Install
public void setupHisSpk(){ public void setupHisSpk(){
workOrderHistoriesSPK = workOrderHelper.getHistoryUrgentSPKasc(); workOrderHistoriesSPK = workOrderHelper.getHistoryUrgentSPKasc();
setupViewPager(viewPager,workOrderHistoriesSPK.size(),HisSpkCase); setupViewPager(viewPager,workOrderHistoriesSPK.size(),HisSpkCase);
} }
// public function set numbering item tabbar history urgent case
public void setupHisCase(){ public void setupHisCase(){
workOrderHistoriesCase = workOrderHelper.getHistoryUrgentCaseasc(); workOrderHistoriesCase = workOrderHelper.getHistoryUrgentCaseasc();
setupViewPager(viewPager,HisSpkInstall,workOrderHistoriesCase.size()); setupViewPager(viewPager,HisSpkInstall,workOrderHistoriesCase.size());
} }
// function set fragment item tabbar history urgent
private void setupViewPager(ViewPager viewPager, int HisSpkInstall, int HisSpkCase) { private void setupViewPager(ViewPager viewPager, int HisSpkInstall, int HisSpkCase) {
HistoryUrgentActivity.ViewPagerAdapter adapter = new HistoryUrgentActivity.ViewPagerAdapter(getSupportFragmentManager()); HistoryUrgentActivity.ViewPagerAdapter adapter = new HistoryUrgentActivity.ViewPagerAdapter(getSupportFragmentManager());
adapter.addFragment(new HistoryIncidentFragment(), "Install ("+HisSpkInstall+")"); adapter.addFragment(new HistoryIncidentFragment(), "Install ("+HisSpkInstall+")");
......
...@@ -74,9 +74,8 @@ public class InitActivity extends AppCompatActivity { ...@@ -74,9 +74,8 @@ public class InitActivity extends AppCompatActivity {
progressDialog.setMessage("Loading..."); progressDialog.setMessage("Loading...");
progressDialog.show(); progressDialog.show();
//TODO: Do Login //TODO: Do Login
// post data login SAE to API https://demo.visionet.co.id/crmmultibankapi/api/login
Call<GetLoginTokenResponse> login = systemUserService.login(etKPT.getText().toString(), etImei.getText().toString(), "password"); Call<GetLoginTokenResponse> login = systemUserService.login(etKPT.getText().toString(), etImei.getText().toString(), "password");
//Toast.makeText(getApplicationContext(),etKPT.getText().toString()+""+etImei.getText().toString(),Toast.LENGTH_LONG).show();
// Call<GetLoginTokenResponse> login = systemUserService.login(etKPT.getText().toString(), "1234567890", "password");
login.enqueue(new Callback<GetLoginTokenResponse>() { login.enqueue(new Callback<GetLoginTokenResponse>() {
@Override @Override
public void onResponse(Call<GetLoginTokenResponse> call, Response<GetLoginTokenResponse> response) { public void onResponse(Call<GetLoginTokenResponse> call, Response<GetLoginTokenResponse> response) {
...@@ -98,13 +97,8 @@ public class InitActivity extends AppCompatActivity { ...@@ -98,13 +97,8 @@ public class InitActivity extends AppCompatActivity {
session.setUserToken("bearer " + response.body().getAccess_token()); session.setUserToken("bearer " + response.body().getAccess_token());
session.setKPT(etKPT.getText().toString()); session.setKPT(etKPT.getText().toString());
session.setKeyUserImei(etImei.getText().toString()); session.setKeyUserImei(etImei.getText().toString());
//getLinkApp(etKPT.getText().toString(),etImei.getText().toString());
progressDialog.dismiss(); progressDialog.dismiss();
Intent intent = new Intent(InitActivity.this, CreatePasswordActivity.class); Intent intent = new Intent(InitActivity.this, CreatePasswordActivity.class);
// intent.putExtra("KPT", etKPT.getText().toString());
// intent.putExtra("imei",etImei.getText().toString());
// intent.putExtra("package",getPackageName());
session.setNewLogin(etKPT.getText().toString()); session.setNewLogin(etKPT.getText().toString());
startActivity(intent); startActivity(intent);
finish(); finish();
...@@ -131,6 +125,7 @@ public class InitActivity extends AppCompatActivity { ...@@ -131,6 +125,7 @@ public class InitActivity extends AppCompatActivity {
}); });
} }
// function get data imei Smartpone SAE
private void getImeiNumber() { private void getImeiNumber() {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) { if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
btnLogin.setEnabled(false); btnLogin.setEnabled(false);
...@@ -142,22 +137,22 @@ public class InitActivity extends AppCompatActivity { ...@@ -142,22 +137,22 @@ public class InitActivity extends AppCompatActivity {
int compare = imei1.compareTo(imei2); int compare = imei1.compareTo(imei2);
if (compare < 0) { if (compare < 0) {
etImei.setText(imei1); etImei.setText(imei1);
//etImei.setHint(imei1); // etImei disable insert function in API Production lock
//etImei.setEnabled(false); //etImei.setEnabled(false);
} else { } else {
etImei.setText(imei2); etImei.setText(imei2);
//etImei.setHint(imei2); // etImei disable insert function in API Production lock
//etImei.setEnabled(false); //etImei.setEnabled(false);
} }
if (imei2.equals("")) { if (imei2.equals("")) {
etImei.setText(imei1); etImei.setText(imei1);
//etImei.setHint(imei1); // etImei disable insert function in API Production lock
//etImei.setEnabled(false); //etImei.setEnabled(false);
} }
if (etImei.getText().toString().equalsIgnoreCase("")) { if (etImei.getText().toString().equalsIgnoreCase("")) {
TelephonyManager telephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); TelephonyManager telephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
//etImei.setHint(telephonyManager.getDeviceId());
etImei.setText(telephonyManager.getDeviceId()); etImei.setText(telephonyManager.getDeviceId());
// etImei disable insert function in API Production lock
//etImei.setEnabled(false); //etImei.setEnabled(false);
} }
} }
...@@ -170,8 +165,8 @@ public class InitActivity extends AppCompatActivity { ...@@ -170,8 +165,8 @@ public class InitActivity extends AppCompatActivity {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
btnLogin.setEnabled(true); btnLogin.setEnabled(true);
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); TelephonyManager telephonyManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
//etImei.setHint(telephonyManager.getDeviceId());
etImei.setText(telephonyManager.getDeviceId()); etImei.setText(telephonyManager.getDeviceId());
// etImei disable insert function in API Production lock
//etImei.setEnabled(false); //etImei.setEnabled(false);
} }
} }
......
...@@ -54,24 +54,13 @@ public class InitDataActivity extends AppCompatActivity { ...@@ -54,24 +54,13 @@ public class InitDataActivity extends AppCompatActivity {
private void refreshData(String type) { private void refreshData(String type) {
tvProgress.setText("Loading " + type + " Data"); tvProgress.setText("Loading " + type + " Data");
switch (type){ switch (type){
// case "Incident Asset":
// getIncidentAsset();
// break;
// case "Task Parameter":
// getTaskParameter();
// break;
// case "Task":
// getTask();
// break;
// case "Terminal Feature":
// getTerminalFeature();
// break;
case "Work Order": case "Work Order":
getWorkOrder(); getWorkOrder();
break; break;
} }
} }
// function get data WO from API https://demo.visionet.co.id/crmmultibankapi/api/Data?getWorkOrdersNew
private void getWorkOrder(){ private void getWorkOrder(){
Call<GetWorkOrderResponse> callWorkOrder = workOrderService.getListWorkOrders(session.getUserToken(), systemUser.getSystemUserId()); Call<GetWorkOrderResponse> callWorkOrder = workOrderService.getListWorkOrders(session.getUserToken(), systemUser.getSystemUserId());
callWorkOrder.enqueue(new Callback<GetWorkOrderResponse>() { callWorkOrder.enqueue(new Callback<GetWorkOrderResponse>() {
......
...@@ -73,6 +73,7 @@ public class KameraKastemActivity extends Activity implements ...@@ -73,6 +73,7 @@ public class KameraKastemActivity extends Activity implements
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
this.getWindow().setFormat(PixelFormat.TRANSLUCENT); this.getWindow().setFormat(PixelFormat.TRANSLUCENT);
// set first default result take photo with kameraKastemActivity
lebarKotak = this.getIntent().getIntExtra(kameraKastemLebarKotak, 480); lebarKotak = this.getIntent().getIntExtra(kameraKastemLebarKotak, 480);
tinggiKotak = this.getIntent() tinggiKotak = this.getIntent()
.getIntExtra(kameraKastemTinggiKotak, 640); .getIntExtra(kameraKastemTinggiKotak, 640);
......
...@@ -68,8 +68,8 @@ public class LocationEngineer extends Service { ...@@ -68,8 +68,8 @@ public class LocationEngineer extends Service {
// for ActivityCompat#requestPermissions for more details. // for ActivityCompat#requestPermissions for more details.
return; return;
} }
// function declare request location with network provider
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000, 0, listener); locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000, 0, listener);
//locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 0, listener);
} }
@Override @Override
...@@ -177,8 +177,6 @@ public class LocationEngineer extends Service { ...@@ -177,8 +177,6 @@ public class LocationEngineer extends Service {
intent.putExtra("Provider", loc.getProvider()); intent.putExtra("Provider", loc.getProvider());
intent.putExtra("lokasi", lokasi); intent.putExtra("lokasi", lokasi);
startActivity(intent); startActivity(intent);
// sendBroadcast(intent);
} }
} }
......
...@@ -129,21 +129,6 @@ public class MapsActivity extends AppCompatActivity implements OnMapReadyCallbac ...@@ -129,21 +129,6 @@ public class MapsActivity extends AppCompatActivity implements OnMapReadyCallbac
} }
// @Override
// public void onStatusChanged(String provider, int status, Bundle extras) {
//
// }
//
// @Override
// public void onProviderEnabled(String provider) {
//
// }
//
// @Override
// public void onProviderDisabled(String provider) {
//
// }
@Override @Override
public void onConnected(Bundle bundle) { public void onConnected(Bundle bundle) {
mLocationRequest = new LocationRequest(); mLocationRequest = new LocationRequest();
......
...@@ -31,17 +31,15 @@ public class OfflineActivity extends AppCompatActivity { ...@@ -31,17 +31,15 @@ public class OfflineActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_offline); setContentView(R.layout.activity_offline);
toolbar = (Toolbar) findViewById(R.id.toolbarOffline); toolbar = (Toolbar) findViewById(R.id.toolbarOffline);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
viewPager = (ViewPager) findViewById(R.id.viewpagerOffline); viewPager = (ViewPager) findViewById(R.id.viewpagerOffline);
setupViewPager(viewPager); setupViewPager(viewPager);
tabLayout = (TabLayout) findViewById(R.id.tabLayoutOffline); tabLayout = (TabLayout) findViewById(R.id.tabLayoutOffline);
tabLayout.setupWithViewPager(viewPager); tabLayout.setupWithViewPager(viewPager);
} }
// function set fragment item tabbar on menu offline
private void setupViewPager(ViewPager viewPager) { private void setupViewPager(ViewPager viewPager) {
OfflineActivity.ViewPagerAdapter adapter = new OfflineActivity.ViewPagerAdapter(getSupportFragmentManager()); OfflineActivity.ViewPagerAdapter adapter = new OfflineActivity.ViewPagerAdapter(getSupportFragmentManager());
adapter.addFragment(new IncidentOfflineFragment(), "SPK/Case"); adapter.addFragment(new IncidentOfflineFragment(), "SPK/Case");
......
Markdown is supported
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