コード例 #1
0
ファイル: pricing.py プロジェクト: maqg/tundra
def query_server_price(db, paras):

    pricing = PricingResult(db)

    pricing.paras = paras
    pricing.type = PRICING_TYPE_SERVER
    pricing.name = paras["name"] + "-报价-" + getCurrentStrDate()
    pricing.points = paras["point"]
    pricing.desc = paras["desc"]

    pricing.infrastructure = paras["infrastructure"]
    pricing.infrastructureCount = pricing.points

    pricing.cpu = paras["cpu"]
    pricing.cpuCount = paras["cpuCount"]

    pricing.memory = paras["memory"]
    pricing.memoryCount = paras["memoryCount"]

    pricing.disk = paras["disk"]
    pricing.diskCount = paras["diskCount"]

    pricing.disk1 = paras["disk1"]
    pricing.disk1Count = paras["disk1Count"]

    pricing.raid = paras["raid"]
    pricing.raidCount = pricing.points

    pricing.pricing_server()

    ret = pricing.add()

    return ret, pricing.toObj()
コード例 #2
0
ファイル: pricing.py プロジェクト: maqg/tundra
def query_allinone_price(db, paras, type=SOFTWARE_TYPE_OCTDESK):

    pricing = PricingResult(db)

    pricing.paras = paras
    pricing.type = type
    pricing.name = paras["name"] + "-报价-" + getCurrentStrDate()
    pricing.desc = paras["desc"]

    pricing.points = paras["point"]

    if type == SOFTWARE_TYPE_OCTDESK:
        pricing.pointCpu = paras["pointCpu"]
        pricing.pointMemory = paras["pointMemory"]
        pricing.pointDisk = paras["pointDisk"]

        pricing.disk1 = paras["disk1"]
        pricing.disk1Count = paras["disk1Count"]

    pricing.infrastructure = paras["infrastructure"]
    pricing.infrastructureCount = paras["infrastructureCount"]

    pricing.cpu = paras["cpu"]
    pricing.cpuCount = paras["cpuCount"]

    pricing.memory = paras["memory"]
    pricing.memoryCount = paras["memoryCount"]

    pricing.disk = paras["disk"]
    pricing.diskCount = paras["diskCount"]

    pricing.raid = paras["raid"]
    pricing.raidCount = pricing.infrastructureCount

    pricing.thinClient = paras["thinClient"]
    pricing.thinclientCount = paras["thinClientCount"] or pricing.points

    pricing.monitor = paras["monitor"]
    pricing.monitorCount = paras["monitorCount"] or pricing.points

    pricing.keyMouse = paras["keyMouse"]
    pricing.keymouseCount = paras["keyMouseCount"] or pricing.points

    pricing.ukey = paras.get("ukey")
    pricing.ukeyCount = paras.get("ukeyCount") or pricing.points

    pricing.switch = paras["switch"]
    pricing.switchCount = paras["switchCount"]

    pricing.wifiRouter = paras["wifiRouter"]
    pricing.wifiRouterCount = paras["wifiRouterCount"]

    pricing.service = paras["service"]

    pricing.pricing(type)

    ret = pricing.add()

    return ret, pricing.toObj()
コード例 #3
0
ファイル: pricing.py プロジェクト: maqg/tundra
def query_classsoft_price(db, paras):
    pricing = PricingResult(db)

    pricing.paras = paras
    pricing.type = PRICING_TYPE_OCTCLASS_SOFT
    pricing.name = paras["name"] + "-报价-" + getCurrentStrDate()
    pricing.desc = paras["desc"]

    pricing.points = paras["point"]
    pricing.pricing_software(SOFTWARE_TYPE_OCTCLASS)

    ret = pricing.add()

    return ret, pricing.toObj()
コード例 #4
0
ファイル: pricing.py プロジェクト: maqg/tundra
def query_thinclient_price(db, paras):

    pricing = PricingResult(db)

    pricing.paras = paras
    pricing.type = PRICING_TYPE_THINCLIENT
    pricing.name = paras["name"] + "-报价-" + getCurrentStrDate()
    pricing.points = paras["point"]

    pricing.thinClient = paras["thinClient"]
    pricing.monitor = paras["monitor"]
    pricing.keyMouse = paras["keyMouse"]
    pricing.thinclientCount = paras["thinClientCount"] or pricing.points
    pricing.monitorCount = paras["monitorCount"] or pricing.points
    pricing.keymouseCount = paras["keyMouseCount"] or pricing.points
    pricing.desc = paras["desc"]

    pricing.pricing_thinclient()

    ret = pricing.add()

    return ret, pricing.toObj()