Example #1
0
@time: 2018-04-06 12:20
"""

from copy import copy
from datetime import datetime
from sqlalchemy.sql import func
from app_backend import db
from app_common.libs.mysql_orm_op import DbInstance
from app_backend.models.bearing_project import BankAccount
from app_common.maps.default import DEFAULT_SEARCH_CHOICES_INT, DEFAULT_SELECT_CHOICES_INT
from app_common.tools.date_time import get_current_day_time_ends, get_hours, time_local_to_utc, \
    get_current_month_time_ends, get_days, get_current_year_time_ends, get_months
from app_common.maps.status_order import STATUS_ORDER_OK
from app_common.maps.status_delete import STATUS_DEL_NO

db_instance = DbInstance(db)


def get_bank_account_row_by_id(bank_account_id):
    """
    通过 id 获取信息
    :param bank_account_id:
    :return: None/object
    """
    return db_instance.get_row_by_id(BankAccount, bank_account_id)


def get_bank_account_row(*args, **kwargs):
    """
    获取信息
    :param args:
Example #2
0
from copy import copy
from datetime import datetime
from sqlalchemy.sql import func
from app_backend.databases.bearing import db_bearing
from app_backend.api.customer import get_customer_rows_by_ids
from app_backend.api.user import get_user_rows_by_ids
from app_common.libs.mysql_orm_op import DbInstance
from app_backend.models.model_bearing import Purchase, PurchaseItems, Inventory, Warehouse, Rack
from app_common.maps.default import DEFAULT_SEARCH_CHOICES_INT
from app_common.maps.status_delete import STATUS_DEL_NO
from app_common.tools.date_time import get_current_day_time_ends, get_hours, time_local_to_utc, \
    get_current_month_time_ends, get_days, get_current_year_time_ends, get_months
from app_common.maps.status_order import STATUS_ORDER_OK
from app_common.maps.status_audit import STATUS_AUDIT_OK, STATUS_AUDIT_NO

db_instance = DbInstance(db_bearing)


def get_purchase_row_by_id(purchase_id):
    """
    通过 id 获取信息
    :param purchase_id:
    :return: None/object
    """
    return db_instance.get_row_by_id(Purchase, purchase_id)


def get_purchase_row(*args, **kwargs):
    """
    获取信息
    :param args: