You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
43 lines
1.3 KiB
4 months ago
|
# -*- coding: utf-8 -*-
|
||
|
# @Time : 2023/9/27 13:13
|
||
|
# @Author : tx
|
||
|
# @File : report_use.py
|
||
|
# @Description : 库存量统计报表导出
|
||
|
|
||
|
from helper.export.base import ReportExport
|
||
|
from helper.report import report_remain_drug
|
||
|
|
||
|
|
||
|
class ReportRemain(ReportExport):
|
||
|
def __init__(self, request, keyword):
|
||
|
super().__init__()
|
||
|
self.title = "库存信息汇总"
|
||
|
self.stateDict = {0: "待入库", 1: "在库", 2: "出库", 3: "空瓶", 4: "报废"}
|
||
|
self.request = request
|
||
|
self.keyword = keyword
|
||
|
|
||
|
async def parse_data(self, request, keyword):
|
||
|
keyword.page_no = 0
|
||
|
result = await report_remain_drug(request, keyword)
|
||
|
self.drug_attribute_key_list = result.get("attribute_key")
|
||
|
return result.get("data")
|
||
|
|
||
|
def parse_key_finds_list(self):
|
||
|
"""
|
||
|
解析键列名
|
||
|
:return:
|
||
|
"""
|
||
|
key_list = ["cas_code", "count"]
|
||
|
finds_list = ["CAS码", "在库数量"]
|
||
|
self.key_list = self.drug_attribute_key_list + key_list
|
||
|
self.finds_list = self.drug_attribute_key_list + finds_list
|
||
|
|
||
|
async def main(self):
|
||
|
"""
|
||
|
主函数
|
||
|
:param kwargs:
|
||
|
:return:
|
||
|
"""
|
||
|
self.data_list = await self.parse_data(self.request, self.keyword)
|
||
|
self.parse_key_finds_list()
|