|
@@ -174,6 +174,7 @@ class ProductsSchemeManageView(View):
|
|
|
'storage_code': storage_code, # 使用生成的编码
|
|
|
'order_number': request_dict.get('orderNumber', ''),
|
|
|
'device_type': device_type,
|
|
|
+ 'product_model': int(request_dict.get('productModel', 0)),
|
|
|
'flash': request_dict.get('flash', ''),
|
|
|
'ddr': request_dict.get('ddr', ''),
|
|
|
'main_controller': request_dict.get('mainController', ''),
|
|
@@ -185,6 +186,9 @@ class ProductsSchemeManageView(View):
|
|
|
'customer_code': request_dict.get('customerCode', ''),
|
|
|
'phy': request_dict.get('phy', ''),
|
|
|
'remark': request_dict.get('remark', ''),
|
|
|
+ 'sku': request_dict.get('sku', ''),
|
|
|
+ 'scheme_code': request_dict.get('schemeCode', ''),
|
|
|
+ 'hw_version':request_dict.get('hwVersion', ''),
|
|
|
'created_time': int(time.time()),
|
|
|
'updated_time': int(time.time()),
|
|
|
'created_by': user_id,
|
|
@@ -221,13 +225,18 @@ class ProductsSchemeManageView(View):
|
|
|
'orderQuantity': 'order_quantity',
|
|
|
'customerCode': 'customer_code',
|
|
|
'phy': 'phy',
|
|
|
- 'remark': 'remark'
|
|
|
+ 'remark': 'remark',
|
|
|
+ 'sku': 'sku',
|
|
|
+ 'schemeCode': 'scheme_code',
|
|
|
+ 'productModel': 'product_model',
|
|
|
+ 'hwVersion':'hw_version'
|
|
|
}
|
|
|
|
|
|
# 需要类型转换的字段配置(字段名: 转换函数)
|
|
|
FIELD_CONVERTERS = {
|
|
|
'deviceType': int,
|
|
|
- 'orderQuantity': int
|
|
|
+ 'orderQuantity': int,
|
|
|
+ 'productModel': int
|
|
|
}
|
|
|
|
|
|
@transaction.atomic
|
|
@@ -338,8 +347,8 @@ class ProductsSchemeManageView(View):
|
|
|
"""方案对象序列化(优化点:集中管理序列化逻辑)"""
|
|
|
# 定义需要包含在str_schema中的字段
|
|
|
schema_fields = [
|
|
|
- 'flash', 'main_controller', 'wifi', 'four_g',
|
|
|
- 'sensor', 'ddr', 'ad', 'phy'
|
|
|
+ 'order_number','hw_version', 'main_controller', 'sensor', 'ad', 'wifi', 'four_g',
|
|
|
+ 'flash', 'ddr', 'phy'
|
|
|
]
|
|
|
|
|
|
# 获取字段值,过滤掉空值
|
|
@@ -366,6 +375,10 @@ class ProductsSchemeManageView(View):
|
|
|
'phy': scheme.phy,
|
|
|
'remark': scheme.remark,
|
|
|
'strSchema': str_schema,
|
|
|
+ 'productModel': scheme.product_model,
|
|
|
+ 'sku': scheme.sku,
|
|
|
+ 'schemeCode': scheme.scheme_code,
|
|
|
+ 'hwVersion': scheme.hw_version,
|
|
|
'createdTime': scheme.created_time,
|
|
|
'createdBy': scheme.created_by
|
|
|
}
|
|
@@ -388,13 +401,14 @@ class ProductsSchemeManageView(View):
|
|
|
qr_data = json.dumps({
|
|
|
"sc": scheme.storage_code,
|
|
|
"t": 'NVR' if scheme.device_type == 1 else 'IPC',
|
|
|
- "f": scheme.flash,
|
|
|
- "ddr": scheme.ddr,
|
|
|
+ "hw": scheme.hw_version,
|
|
|
"mc": scheme.main_controller,
|
|
|
+ "s": scheme.sensor,
|
|
|
+ "ad": scheme.ad,
|
|
|
"wifi": scheme.wifi,
|
|
|
"mode4G": scheme.four_g,
|
|
|
- "ad": scheme.ad,
|
|
|
- "s": scheme.sensor,
|
|
|
+ "f": scheme.flash,
|
|
|
+ "ddr": scheme.ddr,
|
|
|
'uc': scheme.customer_code,
|
|
|
'phy': scheme.phy,
|
|
|
"num": scheme.order_quantity,
|