重複した出席番号を表示する処理を追加
This commit is contained in:
parent
6bd8a4ab81
commit
5a9d1d83be
|
@ -135,6 +135,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
startActivity(toSubmission);
|
||||
}
|
||||
}
|
||||
|
||||
//UUIDを表示するかのダイアログ
|
||||
private void showUUIDYesNoDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this); // この 'this' が問題でないか確認
|
||||
|
@ -159,6 +160,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
alertDialog.show();
|
||||
|
||||
}
|
||||
|
||||
//ルート作成の非同期処理
|
||||
private void fetchDataAndCreateRoute() {
|
||||
//非同期処理の開始
|
||||
|
@ -205,7 +207,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
if (notDuplicates) {
|
||||
Log.d("MainActivity", "スケジュール作成成功");
|
||||
} else {
|
||||
showErrorDialog(latch);
|
||||
showErrorDialog(latch, myDataList);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -223,6 +225,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
|
||||
executor.shutdown();
|
||||
}
|
||||
|
||||
//ルート作成のダイアログ
|
||||
private void showRouteCreationDialog(CountDownLatch latch) {
|
||||
new AlertDialog.Builder(MainActivity.this)
|
||||
|
@ -242,11 +245,24 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
})
|
||||
.show();
|
||||
}
|
||||
public void showErrorDialog(CountDownLatch latch) {
|
||||
|
||||
public void showErrorDialog(CountDownLatch latch, List<MyDataClass> myDataList) {
|
||||
List<Integer> studentNumbers = new ArrayList<>();
|
||||
for (int i = 0; i < myDataList.size(); i++) {
|
||||
if (myDataList.get(i).getSchedule() == 0) {
|
||||
studentNumbers.add(myDataList.get(i).getStudentNumber());
|
||||
}
|
||||
}
|
||||
StringBuilder message = new StringBuilder("保護者の重複が重大でルート作成ができません。調整してください。\n出席番号: ");
|
||||
for (int i = 0; i < studentNumbers.size(); i++) {
|
||||
message.append(studentNumbers.get(i));
|
||||
if (i < studentNumbers.size() - 1) {
|
||||
message.append(", ");
|
||||
}
|
||||
}
|
||||
new AlertDialog.Builder(MainActivity.this)
|
||||
.setTitle("警告")
|
||||
.setMessage("保護者の重複が重大でルート作成ができません。調整してください")
|
||||
.setMessage(message.toString())
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user