|
|
|
@ -32,62 +32,60 @@ public class HomePageActivity extends AppCompatActivity {
|
|
|
|
|
getSupportActionBar().hide();
|
|
|
|
|
Intent intent1 = getIntent();
|
|
|
|
|
roles = intent1.getStringArrayListExtra("role");
|
|
|
|
|
String json=intent1.getStringExtra("info");
|
|
|
|
|
LoginInfoBeen infoBeen=new Gson().fromJson(json, LoginInfoBeen.class);
|
|
|
|
|
String json = intent1.getStringExtra("info");
|
|
|
|
|
LoginInfoBeen infoBeen = new Gson().fromJson(json, LoginInfoBeen.class);
|
|
|
|
|
Log.e("TAG", "onCreate:" + infoBeen);
|
|
|
|
|
InfoDialog infoDialog=new InfoDialog(this);
|
|
|
|
|
InfoDialog infoDialog = new InfoDialog(this);
|
|
|
|
|
String stationCode = null;
|
|
|
|
|
try {
|
|
|
|
|
User user = infoBeen.getUser();
|
|
|
|
|
user.setTeamName(SharedPreferencesUtils.getstring("teamName",null));
|
|
|
|
|
user.setTeamCode(SharedPreferencesUtils.getstring("teamCode",null));
|
|
|
|
|
user.setTeamName(SharedPreferencesUtils.getstring("teamName", null));
|
|
|
|
|
user.setTeamCode(SharedPreferencesUtils.getstring("teamCode", null));
|
|
|
|
|
stationCode = user.getStationCode();
|
|
|
|
|
infoDialog.setInfoData(infoBeen, user);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
|
|
String finalStationCode = stationCode;
|
|
|
|
|
binding.homeButton1.setOnClickListener(v -> {
|
|
|
|
|
if (!roles.contains("quality_inspection")) {
|
|
|
|
|
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
intent = new Intent(this, CheckActivity.class);
|
|
|
|
|
intent.putExtra("stationCode", finalStationCode);
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
});
|
|
|
|
|
binding.homeButton2.setOnClickListener(v -> {
|
|
|
|
|
if (!roles.contains("shell_bile_binding")) {
|
|
|
|
|
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
intent = new Intent(this, BindingActivity.class);
|
|
|
|
|
intent.putExtra("title", "壳胆绑定");
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
});
|
|
|
|
|
binding.homeButton3.setOnClickListener(v -> {
|
|
|
|
|
if (!roles.contains("quality_repair")) {
|
|
|
|
|
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
intent = new Intent(this, RepairActivity.class);
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
});
|
|
|
|
|
binding.homeButton4.setOnClickListener(v -> {
|
|
|
|
|
if (!roles.contains("barcode_binding")) {
|
|
|
|
|
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
intent = new Intent(this, BindingActivity.class);
|
|
|
|
|
intent.putExtra("title", "条码绑定");
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
});
|
|
|
|
|
binding.homeButton5.setOnClickListener(v -> {
|
|
|
|
|
infoDialog.show();
|
|
|
|
|
});
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// String final StationCode = stationCode;
|
|
|
|
|
binding.homeButton1.setOnClickListener(v -> {
|
|
|
|
|
if (!roles.contains("quality_inspection")) {
|
|
|
|
|
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
intent = new Intent(this, CheckActivity.class);
|
|
|
|
|
intent.putExtra("stationCode", "2001");
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
});
|
|
|
|
|
binding.homeButton2.setOnClickListener(v -> {
|
|
|
|
|
if (!roles.contains("shell_bile_binding")) {
|
|
|
|
|
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
intent = new Intent(this, BindingActivity.class);
|
|
|
|
|
intent.putExtra("title", "壳胆绑定");
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
});
|
|
|
|
|
binding.homeButton3.setOnClickListener(v -> {
|
|
|
|
|
if (!roles.contains("quality_repair")) {
|
|
|
|
|
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
intent = new Intent(this, RepairActivity.class);
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
});
|
|
|
|
|
binding.homeButton4.setOnClickListener(v -> {
|
|
|
|
|
if (!roles.contains("barcode_binding")) {
|
|
|
|
|
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
intent = new Intent(this, BindingActivity.class);
|
|
|
|
|
intent.putExtra("title", "条码绑定");
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
});
|
|
|
|
|
binding.homeButton5.setOnClickListener(v -> {
|
|
|
|
|
infoDialog.show();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|