增加count_doing
This commit is contained in:
parent
1d0de666b8
commit
e7fdc7984a
|
@ -0,0 +1,3 @@
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
|
@ -0,0 +1,5 @@
|
||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class CmsConfig(AppConfig):
|
||||||
|
name = 'cms'
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
|
@ -121,10 +121,12 @@ class UpdateFIFONumber(APIView):
|
||||||
i.save()
|
i.save()
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
class CorrectWproductState(APIView):
|
class CorrectWproduct(APIView):
|
||||||
permission_classes = [IsAdminUser]
|
permission_classes = [IsAdminUser]
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
pass
|
"""
|
||||||
|
"""
|
||||||
|
# WProduct.objects.filter(is_hidden=True).update(act_state=WProduct.WPR_ACT_STATE_USED)
|
||||||
|
|
||||||
|
|
||||||
class ReloadServer(APIView):
|
class ReloadServer(APIView):
|
||||||
|
|
|
@ -3,7 +3,7 @@ from apps.pm.models import ProductionPlan
|
||||||
from apps.sam.models import Order
|
from apps.sam.models import Order
|
||||||
from apps.wpm.models import WProduct, WproductFlow
|
from apps.wpm.models import WProduct, WproductFlow
|
||||||
from django.db.models import F
|
from django.db.models import F
|
||||||
|
from apps.wpm.serializers import WProductDetailSerializer
|
||||||
class SrmServices:
|
class SrmServices:
|
||||||
"""
|
"""
|
||||||
数据统计分析
|
数据统计分析
|
||||||
|
@ -34,7 +34,13 @@ class SrmServices:
|
||||||
).count()
|
).count()
|
||||||
count_selled = objs.filter(act_state=WProduct.WPR_ACT_STATE_SELLED).count()
|
count_selled = objs.filter(act_state=WProduct.WPR_ACT_STATE_SELLED).count()
|
||||||
count_mtestok = objs.filter(is_mtestok=True).count()
|
count_mtestok = objs.filter(is_mtestok=True).count()
|
||||||
return dict(count=count,count_ok=count_ok, count_notok=count_notok, count_selled=count_selled, count_mtestok=count_mtestok)
|
count_mtestnotok = objs.filter(is_mtestok=False).count()
|
||||||
|
count_doing = objs.filter(act_state__in=[
|
||||||
|
WProduct.WPR_ACT_STATE_TOTEST, WProduct.WPR_ACT_STATE_TOCOMBTEST, WProduct.WPR_ACT_STATE_TOFINALTEST,
|
||||||
|
WProduct.WPR_ACT_STATE_TORETEST, WProduct.WPR_ACT_STATE_DOWAIT, WProduct.WPR_ACT_STATE_DOING
|
||||||
|
], subproduction_plan__product=F('material')).count()
|
||||||
|
return dict(count=count,count_ok=count_ok, count_notok=count_notok,
|
||||||
|
count_selled=count_selled, count_mtestok=count_mtestok, count_mtestnotok=count_mtestnotok, count_doing=count_doing)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_plan_count(cls, datetime_start=None, datetime_end=None):
|
def get_plan_count(cls, datetime_start=None, datetime_end=None):
|
||||||
|
|
Loading…
Reference in New Issue