feat: 批次统计分析中关于decimal的处理
This commit is contained in:
parent
c0d504ecfe
commit
1bc9cd2c60
|
@ -5,6 +5,8 @@ from apps.mtm.models import Mgroup
|
|||
import decimal
|
||||
from django.db.models import Sum
|
||||
from apps.wpm.services_2 import get_f_l_date
|
||||
import json
|
||||
from apps.utils.tools import MyJSONEncoder
|
||||
myLogger = logging.getLogger("log")
|
||||
|
||||
def main(batch: str, mgroup_obj:Mgroup=None):
|
||||
|
@ -93,7 +95,7 @@ def main(batch: str, mgroup_obj:Mgroup=None):
|
|||
else:
|
||||
old_data = {}
|
||||
old_data.update(data)
|
||||
batchst.data = old_data
|
||||
batchst.data = json.loads(json.dumps(old_data, cls=MyJSONEncoder))
|
||||
if batchst.first_time is None or (res["first_time"] and res["first_time"] < batchst.first_time):
|
||||
batchst.first_time = res["first_time"]
|
||||
if batchst.last_time is None or (res["last_time"] and res["last_time"] > batchst.last_time):
|
||||
|
|
|
@ -7,6 +7,8 @@ import decimal
|
|||
from django.db.models import Sum
|
||||
from datetime import datetime
|
||||
from apps.wpm.services_2 import get_f_l_date
|
||||
import json
|
||||
from apps.utils.tools import MyJSONEncoder
|
||||
myLogger = logging.getLogger("log")
|
||||
|
||||
def main(batch: str, mgroup_obj):
|
||||
|
@ -137,7 +139,7 @@ def main(batch: str, mgroup_obj):
|
|||
res = get_f_l_date(data)
|
||||
|
||||
|
||||
batchst.data = data
|
||||
batchst.data = json.loads(json.dumps(data, cls=MyJSONEncoder))
|
||||
if batchst.first_time is None or (res["first_time"] and res["first_time"] < batchst.first_time):
|
||||
batchst.first_time = res["first_time"]
|
||||
if batchst.last_time is None or (res["last_time"] and res["last_time"] > batchst.last_time):
|
||||
|
|
|
@ -7,6 +7,8 @@ from apps.system.models import Dept
|
|||
from apps.inm.models import MIOItem
|
||||
from apps.qm.models import FtestWork
|
||||
from apps.wpm.services_2 import get_f_l_date
|
||||
import json
|
||||
from apps.utils.tools import MyJSONEncoder
|
||||
myLogger = logging.getLogger("log")
|
||||
|
||||
def main(batch: str, mgroup_obj):
|
||||
|
@ -463,7 +465,7 @@ def main(batch: str, mgroup_obj):
|
|||
|
||||
res = get_f_l_date(data)
|
||||
|
||||
batchst.data = data
|
||||
batchst.data = json.loads(json.dumps(data, cls=MyJSONEncoder))
|
||||
batchst.material_start = material_start
|
||||
if batchst.first_time is None or (res["first_time"] and res["first_time"] < batchst.first_time):
|
||||
batchst.first_time = res["first_time"]
|
||||
|
|
Loading…
Reference in New Issue