以下是一个简单的现货购销交收系统的部分代码示例:[ V:zzwx1212 QQ:2247238820 TG:@zztg001 ]
|
class PurchaseOrder: |
def __init__(self, order_id, buyer, seller, quantity, price): |
self.order_id = order_id |
self.buyer = buyer |
self.seller = seller |
self.quantity = quantity |
self.price = price |
|
def get_total_price(self): |
return self.quantity * self.price |
|
|
class PurchaseDelivery: |
def __init__(self, order_id, buyer, seller, quantity, price, delivery_date): |
self.order_id = order_id |
self.buyer = buyer |
self.seller = seller |
self.quantity = quantity |
self.price = price |
self.delivery_date = delivery_date |
|
def get_total_price(self): |
return self.quantity * self.price |
|
|
class Buyer: |
def __init__(self, buyer_id, name): |
self.buyer_id = buyer_id |
self.name = name |
|
def place_order(self, seller, quantity, price): |
order_id = generate_order_id() |
相关评论 共0条