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