예제 #1
0
    def update_project(self, project_id):
        if project_id is not None:
            project = Project.objects.get(id=project_id)
            if project:
                # 验收成功
                project.receive_status = BusinessPublic.GetProjectStatusObjectByKey('checked')
                project.save()

                # 商务人员以及项目经理积分及米值分配
                projectpoints = ProjectPoints.objects.filter(project_id=project_id, task__isnull=True, is_created=0)
                if projectpoints:
                    for projectpoint in projectpoints:
                        if projectpoint:
                            self.create_user_points(None, projectpoint.user.id, projectpoint.points, 1, 1,
                                                    projectpoint.type)
                            project_points = ProjectPoints.objects.get(id=projectpoint.id)
                            project_points.is_created = 1
                            project_points.save()

                # 任务负责人积分及米值分配
                taskpoints = Task.objects.filter(project_id=project_id, is_active=1)
                if taskpoints:
                    for taskpoint in taskpoints:
                        if taskpoint:
                            self.create_user_points(taskpoint.task.id, taskpoint.receiver.id, taskpoint.points, 1, 1, 1)

                BusinessPublic.create_message(project.auditor_id, project.receiver_id, menu_id=2,
                                              messages='恭喜,你的项目已验收通过!')
예제 #2
0
 def update_project(self, project_id):
     project = Project.objects.get(id=project_id)
     if project:
         # 项目负责人已接手,项目正式开始
         project.receive_status = BusinessPublic.GetProjectStatusObjectByKey('accepted')
         project.save()
         BusinessPublic.create_message(project.receiver_id, project.sender_id, menu_id=2,
                                       messages='项目负责人已接手!')
예제 #3
0
    def update_project(self, project_id):
        if project_id is not None:
            project = Project.objects.get(id=project_id)
            if project:
                # 验收提交
                project.receive_status = BusinessPublic.GetProjectStatusObjectByKey('wait_check')
                project.save()

                BusinessPublic.create_message(project.receiver.id, project.auditor.id, menu_id=2,
                                              messages='该项目已完成,等待你的验收,请尽快处理!')
예제 #4
0
    def update_project(self, project_id, reason):
        project = Project.objects.get(id=project_id)
        if project is not None:
            # 拒接
            project.receive_status = BusinessPublic.GetProjectStatusObjectByKey('rejected')
            project.save()

            reason_type_id = BusinessPublic.GetReasonTypeIdByKey('project_reject')

            BusinessPublic.create_reason(project.id, project.receiver.id, project.sender.id, reason_type_id, reason)
            BusinessPublic.create_message(project.receiver.id, project.sender.id, menu_id=2,
                                          messages='项目负责人拒接了你的项目,请尽快处理!')
예제 #5
0
    def update_project(self, project_id, reason):
        if project_id is not None:
            project = Project.objects.get(id=project_id)
            if project:
                # 验收不通过
                project.receive_status = BusinessPublic.GetProjectStatusObjectByKey('check_rejected')
                project.save()

                BusinessPublic.create_reason(project.id, project.receiver.id, project.auditor.id,
                                             BusinessPublic.GetReasonTypeIdByKey('project_check_reject'),
                                             reason)
                BusinessPublic.create_message(project.receiver.id, project.auditor.id, menu_id=2,
                                              messages='你的项目验收不通过,请尽快检查!')