コード例 #1
0
class GoodsFilter(graphene.InputObjectType):
    manufacturer = IntID()
    storage = IntID()
    responsible = IntID()
    project = IntID()
    quantity = graphene.Float()
    quantity_type = graphene.String()
コード例 #2
0
	class Input:
		id = IntID(required=True)
		code = String(required=True)
		name = String(required=True)
		manufacturer_name = String(required=True)
		action = String(required=True)
		default_unit = IntID()
コード例 #3
0
 class Input:
     user_id = IntID(required=True)
     project_id = IntID(required=True)
     amount = graphene.Int(required=True)
     cash = graphene.Boolean(required=True)
     installments = graphene.Int(required=True)
     description = graphene.String(required=True)
コード例 #4
0
	class Input:
		old_warehouse = IntID(required=True)
		new_warehouse = IntID(required=True)
		id_good = IntID(required=True)
		count = Float(required=True)
		project_id = IntID()
		responsible_id = IntID(required=True)
コード例 #5
0
ファイル: mutations.py プロジェクト: Uttah/syn_app
 class Input:
     worker = IntID(required=True)
     begin = DateTime(required=True)
     end = DateTime(required=True)
     time = Time()
     reason = IntID(required=True)
     comment = String()
コード例 #6
0
ファイル: mutations.py プロジェクト: Uttah/syn_app
 class Input:
     id = IntID(required=True, description='ID отсутствия для изменения')
     worker = IntID(required=True)
     begin = DateTime(required=True)
     end = DateTime(required=True)
     time = Time()
     reason = IntID(required=True)
     comment = String()
コード例 #7
0
ファイル: mutation.py プロジェクト: Uttah/syn_app
 class Input:
     description = graphene.String(required=True)
     gip_id = IntID()
     state_id = IntID(required=True)
     budget = graphene.Int()
     customer_id = IntID()
     manager_id = IntID()
     comment = graphene.String()
コード例 #8
0
 class Input:
     id = IntID(required=True)
     last_name = graphene.String(required=True)
     first_name = graphene.String(required=True)
     patronum = graphene.String()
     position = graphene.String()
     phone_number = graphene.String()
     client_id = IntID(required=True)
コード例 #9
0
 class Input:
     id = IntID(required=True)
     client_id = IntID()
     contacts = graphene.List(IntID)
     date = graphene.String()
     interaction = graphene.String()
     result = graphene.String()
     next_step_date = graphene.String()
     next_step = graphene.String()
コード例 #10
0
ファイル: types.py プロジェクト: Uttah/syn_app
class ReportsFilter(graphene.InputObjectType):
    only_own_projects = graphene.Boolean()
    worker = IntID()
    projects = graphene.List(IntID)
    state = IntID()
    func_role = IntID()
    process = IntID()
    sub_process = IntID()
    date_range = DateRangeType()
コード例 #11
0
	class Input:
		code = String()
		name = String(required=True)
		manufacturer_name = String(required=True)
		mass = Float()
		good_group_id = IntID()
		analogs = List(IntID)
		gosts = List(String, required=True)
		default_unit = IntID()
コード例 #12
0
	class Input:
		count = Float(required=True)
		unit_id = IntID(required=True)
		note = String()
		defect = Boolean(required=True)
		project_id = IntID()
		good_kind_id = IntID(required=True)
		location_id = IntID(required=True)
		responsible_id = IntID(required=True)
コード例 #13
0
ファイル: types.py プロジェクト: Uttah/syn_app
class TransferPositionSubRowsType(graphene.ObjectType):
    id = IntID()
    number = IntID()
    serial_number = IntID()
    location = graphene.Field(WarehouseType)
    project = graphene.Field(ProjectType)
    count = graphene.Float()
    transfer = graphene.Float()
    unit = graphene.Field(UnitType)
    all_count = graphene.Float()
コード例 #14
0
ファイル: types.py プロジェクト: Uttah/syn_app
class LogisticsRequestType(DjangoObjectType):
    purpose = graphene.String()
    project = graphene.String()
    goal = graphene.Field(LogisticsGoal)
    need_attention = graphene.Boolean()
    gip_id = IntID()
    reason_id = IntID()
    request_completed = graphene.Boolean()

    class Meta:
        model = LogisticsRequest

    def resolve_purpose(self, info, **kwargs):
        return 'Спец-ия %s' % self.reason.pressmark

    def resolve_project(self, info, **kwargs):
        return '%05d - %s' % (self.reason.project.number,
                              self.reason.project.description)

    def resolve_goal(self, info, **kwargs):
        if isinstance(self.reason, Specification):
            return LogisticsGoal(id=self.reason.id,
                                 project=self.reason.project,
                                 name=self.reason.pressmark)
        else:
            return None

    def resolve_gip_id(self, info, **kwargs):
        return self.reason.project.gip.id

    def resolve_reason_id(self, info, **kwargs):
        return self.reason.id

    def resolve_request_completed(self, info, **kwargs):
        lrp = LogisticsRequestPosition.objects.filter(request_id=self.id)
        competed = True
        # array = []

        # for position in lrp:
        # 	array.append(position)

        # for position in lrp:
        # 	if position.canceled_position:
        # 		array.remove(position.canceled_position)

        for position in lrp:
            if not position.task:
                competed = False
                break
            if not position.canceled and not position.finished_date:
                competed = False
                break
        return competed
コード例 #15
0
ファイル: types.py プロジェクト: Uttah/syn_app
class LogisticsRequestPositionFilter(graphene.InputObjectType):
    late_delivery = graphene.Boolean()
    overdue = graphene.Boolean()
    row_status = graphene.String()
    expected_date = DateDayRangeType()
    deadline = DateDayRangeType()
    order_date = DateDayRangeType()
    projects = graphene.List(IntID)
    responsible = graphene.List(IntID)
    worker = IntID()
    moved = IntID()
    count_in_stock = graphene.Float()
    status_in_stock = graphene.String()
コード例 #16
0
 class Input:
     name = graphene.String(required=True)
     kind_id = IntID()
     relation_id = IntID()
     full_name = graphene.String()
     INN = graphene.String()
     KPP = graphene.String()
     OKPO = graphene.String()
     OGRN = graphene.String()
     legal_address = graphene.String()
     street_address = graphene.String()
     phone_number = graphene.String()
     manager_id = IntID()
     other = graphene.String()
コード例 #17
0
ファイル: user.py プロジェクト: Uttah/syn_app
 class Input:
     id = IntID(required=True)
     login = String(required=True)
     last_name = String(required=True)
     first_name = String(required=True)
     patronym = String()
     work_phone = String()
     personal_phone = String()
     email = String()
     gender = GenderChoicesPropertyEnum(required=True)
     healthy = Boolean(required=True)
     birth_date = DateTime()
     hire_date = DateTime(required=True)
     fire_date = DateTime()
     head = IntID()
コード例 #18
0
class UserType(Interface):
    class Meta:
        description = 'Абстрактный интерфейс пользователя'

    id = IntID(required=True)
    full_name = String()
    short_name = String()
    func_roles = List(IntID)
    gender = GenderChoicesPropertyEnum()
    positions = List(String, description='Список должностей')
    avatar = String()

    @staticmethod
    def resolve_func_roles(self, info):
        values = FuncRole.objects.filter(
            positions__user__id=self.id).values('id')
        return map(lambda item: item['id'], values)

    def resolve_gender(self, info, **kwargs):
        return self.gender

    def resolve_positions(self, info, **kwargs):
        # noinspection PyUnresolvedReferences
        positions = self.positions.select_related('company__client').all()
        return [
            '{} в {}'.format(position.name, position.company.client.name)
            for position in positions
        ]

    def resolve_avatar(self, info, **kwargs):
        if self.avatar:
            return self.avatar.url
        else:
            return None
コード例 #19
0
class AbsenceFilter(InputObjectType):
    class Meta:
        description = 'Фильтр'

    reason = List(IntID, required=True, description='Причина отсутствия')
    position = IntID(description='Должность отсутствующего')
    show_fired = Boolean(description='Показывать уволенных')
    date_range = DateRangeType(description='Период')
コード例 #20
0
ファイル: user.py プロジェクト: Uttah/syn_app
 class Input:
     login = String(required=True)
     last_name = String(required=True)
     first_name = String(required=True)
     patronym = String()
     password = String(required=True)
     hire_date = Date(required=True)
     company = IntID(required=True)
コード例 #21
0
ファイル: types.py プロジェクト: Uttah/syn_app
class LogisticsRequestPositionSubRowsType(graphene.ObjectType):
    id = IntID()
    expected_date = graphene.String()
    deadline = graphene.String()
    order_date = graphene.String()
    count = graphene.Float()
    available_in_stock = graphene.Float()
    count_in_stock = graphene.Float()
    unit = graphene.String()
    # transfer - колонка "Задачи на перемещение"
    transfer = graphene.List(TransferCountType)
    logistic_request_id = IntID()
    logistic_task_id = IntID()
    number = IntID()
    project = graphene.Field(ProjectType)
    responsible = graphene.List(UserType)
    worker = graphene.Field(UserType)
コード例 #22
0
ファイル: mutation.py プロジェクト: Uttah/syn_app
 class Input:
     id = IntID(required=True)
     worker = IntID(required=True)
     report_date = Date(required=True)
     func_role = IntID(required=True)
     projects = graphene.List(IntID, required=True)
     process = IntID()
     sub_process = IntID()
     tasks = IntID()
     task = graphene.String()
     time_spent = Time(required=True)
     time_from = Time()
     time_to = Time()
     place = IntID(required=True)
     distance = graphene.Float()
     car = graphene.String()
     gas = graphene.String()
     where_from = graphene.String()
     where_to = graphene.String()
     money_spent = graphene.Int()
     vc_project = graphene.Int()
     vc_digits = graphene.Int()
     vc_digits_minor = graphene.Int()
     model = graphene.String()
     night_shift = graphene.Boolean()
     quality_grade = graphene.Int()
     time_grade = graphene.Int()
     comment = graphene.String()
コード例 #23
0
class GoodSubRowsType(graphene.ObjectType):
    id = IntID()
    location = graphene.Field(WarehouseType)
    count = graphene.Float()
    unit = graphene.Field(UnitType)
    project = graphene.Field(ProjectType)
    responsible = graphene.Field(UserType)
    note = graphene.String()
    defect = graphene.Boolean()
コード例 #24
0
 class Input:
     occupation_id = IntID(required=True)
     salary = Int()
     fraction = Int()
     base = Int()
     advance = Int()
     by_hours = Boolean()
     fixed_hour = Int()
     transportation = Int()
コード例 #25
0
ファイル: coefficients.py プロジェクト: Uttah/syn_app
	class Input:
		id = IntID(required=True)
		general = graphene.Float()
		welding = graphene.Float()
		experience = graphene.Float()
		etech = graphene.Float()
		schematic = graphene.Float()
		initiative = graphene.Float()
		discipline = graphene.Float()
コード例 #26
0
ファイル: query.py プロジェクト: Uttah/syn_app
class Query(ObjectType):
	paged_specification = Field(PagedSpecificationType, paged=PagedInput(required=True))
	specifications_positions = List(SpecificationsPositionsType, filters=IntID())
	all_specification = List(SpecificationType)
	all_gosts = List(GOSTType)
	descriptions_info = List(graphene.String, filters=IntID(required=True))
	selected_specification = Field(SpecificationType, specification_id=IntID())
	get_specification_id_by_logistic = Field(IntID, logistic_id=IntID(required=True))

	def resolve_paged_specification(self, info, paged):
		specifications, total_count = Specification.objects.list_paged_specifications(info.context.user, **paged)
		return PagedSpecificationType(specifications=specifications, total_count=total_count)

	def resolve_specifications_positions(self, info, **kwargs):
		result = SpecificationsPositions.objects.load_specifications_positions(info, **kwargs)
		if result:
			return result
		return []

	def resolve_all_specification(self, info):
		user = info.context.user
		return Specification.objects.filter(models.Q(project__gip=user) | models.Q(editors=user))

	def resolve_all_gosts(self, info):
		return GOST.objects.all()

	def resolve_descriptions_info(self, info, **kwargs):
		return SpecificationsPositions.objects.load_descriptions_info(info, **kwargs)

	def resolve_selected_specification(self, info, specification_id=None):
		try:
			if not specification_id:
				return None
			return Specification.objects.get(id=specification_id)
		except Specification.DoesNotExist:
			raise SngyException('Спецификация не найдена')

	def resolve_get_specification_id_by_logistic(self, info, logistic_id):
		try:
			lr = LogisticsRequest.objects.get(id=logistic_id)
			return Specification.objects.get(id=lr.reason.id).id
		except Specification.DoesNotExist:
			raise SngyException('Спецификация не найдена')
コード例 #27
0
ファイル: query.py プロジェクト: Uttah/syn_app
class Query(graphene.ObjectType):
    all_states = graphene.List(StateType,
                               description="Список всех этапов проектов")
    all_projects = graphene.List(
        ProjectType,
        current_gip=graphene.Boolean(),
        search=graphene.String(),
        gip=IntID(),
        require=graphene.List(
            IntID,
            description=
            'Список ID проектов, информацию о которых необходимо вернуть вне зависимости от прочих совпавших условий'
        ),
        description="Список проектов с фильтрацией")
    paged_projects = graphene.Field(PagedProjects,
                                    paged=PagedInput(required=True),
                                    filters=ProjectsFilter())
    get_hour_prime_cost = graphene.Int()
    filter_schemas = graphene.List(ProjectAnalysisSchemaType)

    def resolve_all_states(self, info):
        return State.objects.all()

    def resolve_all_projects(self, info, **kwargs):
        return Project.objects.load_projects(info, **kwargs)

    def resolve_paged_projects(self, info, paged, **kwargs):
        projects, total_count = Project.objects.paged_projects(
            **paged, **kwargs)
        return PagedProjects(projects=projects, total_count=total_count)

    def resolve_filter_schemas(self, info):
        return ProjectAnalysisSchema.objects.load_schemas(
            user=info.context.user)

    def resolve_get_hour_prime_cost(self, info):
        try:
            return GlobalCoefficient.objects.get(name='hour_prime_cost').value
        except:
            return 450
コード例 #28
0
	class Input:
		name = String(required=True)
		project_id = IntID()
		user_id = IntID()
コード例 #29
0
ファイル: types.py プロジェクト: Uttah/syn_app
class InStockType(graphene.ObjectType):
    id = IntID()
    count = graphene.Float()
    unit = graphene.Field(UnitType)
    available = graphene.Float()
コード例 #30
0
	class Input:
		id = IntID(required=True)