Example #1
0
    def destroy(self, request, *args, **kwargs):
        instance = self.get_object()
        instance.is_active = 0
        instance.save()

        # self.perform_destroy(instance)

        project_id = instance.project_id
        BusinessPublic.update_progress_by_project_id(project_id)

        return Response(status=status.HTTP_204_NO_CONTENT)
Example #2
0
    def update_task(self, task_id, assessment_id, comments):
        if task_id is not None:
            if assessment_id is not None and comments is not None:
                assessment = TaskAssessment.objects.get(id=assessment_id)
                task = Task.objects.get(id=task_id)
                if task is not None:
                    # 任务已通过验收
                    task.receive_status = BusinessPublic.GetTaskStatusObjectByKey(
                        'checked')
                    task.task_assessment = assessment
                    task.comments = comments
                    task.save()

                    project_id = task.project_id
                    BusinessPublic.update_progress_by_project_id(project_id)

                BusinessPublic.create_message(task.sender.id,
                                              task.receiver.id,
                                              menu_id=2,
                                              messages='任务已通过验收!')
Example #3
0
 def update_project_progress(self, project_id):
     # 更新项目进度
     BusinessPublic.update_progress_by_project_id(project_id)