Fehler Merge behoben
This commit is contained in:
1 parent
721dbd861c
commit
eb1e18d042
10 files changed
+205
-148
No files matched your search
@@ -379,13 +379,13 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
});
|
||||
}
|
||||
|
||||
void _processSignature(TaskInfo taskInfo) {
|
||||
void _processSignature(TaskInfo taskInfo) async {
|
||||
MyApp.suppressAcceptDialog = true;
|
||||
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
|
||||
|
||||
Future.delayed(const Duration(seconds: 1), () async {
|
||||
showSignaturePopup(context, taskInfo, (String? signature) {
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
showSignaturePopup(context, taskInfo, (String? signature) async {
|
||||
MyApp.suppressAcceptDialog = false;
|
||||
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
@@ -399,15 +399,15 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
|
||||
_sendFinTourMessage();
|
||||
|
||||
_finishTaskProcessing(taskInfo);
|
||||
await _finishTaskProcessing(taskInfo);
|
||||
|
||||
MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: PopContentViewMessage(count: 2));
|
||||
MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: PopContentViewMessage(count: widget.job.state == 1 ? 2 : 3));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
_finishTaskProcessing(TaskInfo taskInfo) async {
|
||||
Future<void> _finishTaskProcessing(TaskInfo taskInfo) async {
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.taskInfos.put(taskInfo);
|
||||
});
|
||||
@@ -444,7 +444,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
message.task.pos!.long = position.longitude;
|
||||
}
|
||||
|
||||
MqttCore.instance.publishText("job", jsonEncode(message.toJson()));
|
||||
MqttCore.instance.publishText("fin_task", jsonEncode(message.toJson()));
|
||||
}
|
||||
|
||||
FinTourTask _createAnswerHeader(TaskInfo taskInfo) {
|
||||
@@ -463,10 +463,10 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
return finTourTask;
|
||||
}
|
||||
|
||||
_sendFinTourMessage() async {
|
||||
Future<void> _sendFinTourMessage() async {
|
||||
var message = FinTour();
|
||||
message.trId = widget.tour.id;
|
||||
message.com = "Mir doch egal!";
|
||||
message.com = _commisionNumber;
|
||||
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
@@ -489,8 +489,31 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
MqttCore.instance.publishText("fin_tour", jsonEncode(message.toJson()));
|
||||
|
||||
widget.tour.state = Constants.stateFinishedNotConfirmed;
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.jobs.put(widget.job);
|
||||
});
|
||||
|
||||
checkJobFinished();
|
||||
}
|
||||
|
||||
void checkJobFinished() async {
|
||||
var jobFinished = true;
|
||||
|
||||
for(var tour in widget.job.tours) {
|
||||
if (tour.state < 1) {
|
||||
jobFinished = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (jobFinished) {
|
||||
widget.job.state = 2;
|
||||
for(var tour in widget.job.tours) {
|
||||
tour.state = 1;
|
||||
}
|
||||
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.jobs.put(widget.job);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user