From f04c4411c7226c52ab3590bb00fd01f9a2e8a579 Mon Sep 17 00:00:00 2001 From: youngS Date: Tue, 14 Dec 2021 17:26:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E4=BF=AE=E6=AD=A3=20=E4=B8=93=E5=B1=9E?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=EF=BC=8C=E5=85=B6=E4=BB=96=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_client/src/components/FirBase.vue | 3 +- fir_client/src/components/FirFooter.vue | 2 +- .../components/apps/FirAppInfossupersign.vue | 2 +- .../components/base/AppleDeveloperBindApp.vue | 3 +- .../src/components/user/FirSuperSignBase.vue | 12 ++++---- fir_ser/api/utils/app/supersignutils.py | 20 +++++++++---- fir_ser/api/utils/serializer.py | 30 ++++++++++++++----- fir_ser/api/utils/utils.py | 2 +- 8 files changed, 49 insertions(+), 25 deletions(-) diff --git a/fir_client/src/components/FirBase.vue b/fir_client/src/components/FirBase.vue index e0de402..7fd2c6f 100644 --- a/fir_client/src/components/FirBase.vue +++ b/fir_client/src/components/FirBase.vue @@ -18,8 +18,7 @@ effect="dark" type="error">
- 应用分发请绑定您自己的域名,平台分发域名可能因不可违因素更换,将导致您的应用无法访问 + 应用分发请绑定您自己的域名,平台分发域名可能因不可违因素更换,将导致您的应用无法访问 立即绑定
diff --git a/fir_client/src/components/FirFooter.vue b/fir_client/src/components/FirFooter.vue index 8a564d2..043f031 100644 --- a/fir_client/src/components/FirFooter.vue +++ b/fir_client/src/components/FirFooter.vue @@ -18,7 +18,7 @@
-
+
{{ footer.ipcBeiAn.text }} diff --git a/fir_client/src/components/apps/FirAppInfossupersign.vue b/fir_client/src/components/apps/FirAppInfossupersign.vue index 0e3065a..7953daa 100644 --- a/fir_client/src/components/apps/FirAppInfossupersign.vue +++ b/fir_client/src/components/apps/FirAppInfossupersign.vue @@ -36,7 +36,7 @@ 配置专属苹果开发账户 拥有 - {{ currentapp.private_developer_number }} 个专属苹果开发者 + {{ currentapp.private_developer_number }} 个专属苹果开发者,使用了 {{ currentapp.private_developer_used_number }} 个设备数 diff --git a/fir_client/src/components/base/AppleDeveloperBindApp.vue b/fir_client/src/components/base/AppleDeveloperBindApp.vue index c055403..3a526f8 100644 --- a/fir_client/src/components/base/AppleDeveloperBindApp.vue +++ b/fir_client/src/components/base/AppleDeveloperBindApp.vue @@ -22,7 +22,7 @@ 专属应用账户,存在其他应用单独使用该开发者 公共应用账户,所有应用公用此开发者

开发者ID: {{ option.issuer_id }}

-

应用签名数: {{ option.app_used_number }}

+

应用签名数: {{ option.app_used_count }}

已分配专属应用数: {{ option.app_private_number }}

开发者账户已使用设备数: {{ option.developer_used_number }}

开发者账户可用设备数: {{ 100 - option.developer_used_number }}

@@ -37,6 +37,7 @@ label="分配数量" size="small"/> 保存修改

+

该应用已经消耗 {{ option.app_used_number }} 个设备数

描述: {{ option.description }}

diff --git a/fir_client/src/components/user/FirSuperSignBase.vue b/fir_client/src/components/user/FirSuperSignBase.vue index b971b61..4308c2c 100644 --- a/fir_client/src/components/user/FirSuperSignBase.vue +++ b/fir_client/src/components/user/FirSuperSignBase.vue @@ -330,18 +330,18 @@ @@ -355,7 +355,7 @@

专属开发者被分配给了 {{ scope.row.app_private_number }} 个应用

-

专属开发者一共分配了 {{ scope.row.app_private_usable_number }} 个设备名额

+

专属开发者一共分配了 {{ scope.row.private_usable_number }} 个设备名额

专属开发者已经被专属应用使用了 {{ scope.row.app_private_used_number }} 个设备名额

0: @@ -714,6 +721,7 @@ class IosUtils(object): logger.warning( "call_loop download_profile appid:%s developer:%s count:%s" % (self.app_obj, self.developer_obj, count)) if self.developer_obj: + return 11111 # register_devices_prefix = f"check_or_register_devices_{self.developer_obj.issuer_id}_{self.udid}" register_devices_prefix = f"check_or_register_devices_{self.developer_obj.issuer_id}" add_new_bundles_prefix = f"check_or_add_new_bundles_{self.developer_obj.issuer_id}_{self.app_obj.app_id}" diff --git a/fir_ser/api/utils/serializer.py b/fir_ser/api/utils/serializer.py index fc651cf..c7b924b 100644 --- a/fir_ser/api/utils/serializer.py +++ b/fir_ser/api/utils/serializer.py @@ -159,6 +159,12 @@ class AppsSerializer(serializers.ModelSerializer): def get_private_developer_number(self, obj): return models.AppleDeveloperToAppUse.objects.filter(app_id=obj).count() + private_developer_used_number = serializers.SerializerMethodField() + + def get_private_developer_used_number(self, obj): + return models.DeveloperDevicesID.objects.filter(app_id=obj, + developerid__appledevelopertoappuse__app_id=obj).distinct().count() + domain_name = serializers.SerializerMethodField() def get_domain_name(self, obj): @@ -456,12 +462,13 @@ class DeveloperSerializer(serializers.ModelSerializer): developer_used_number = serializers.SerializerMethodField() developer_used_other_number = serializers.SerializerMethodField() use_number = serializers.SerializerMethodField() - app_used_number = serializers.SerializerMethodField() + app_used_count = serializers.SerializerMethodField() is_disabled = serializers.SerializerMethodField() app_private_number = serializers.SerializerMethodField() app_private_used_number = serializers.SerializerMethodField() app_usable_number = serializers.SerializerMethodField() - app_private_usable_number = serializers.SerializerMethodField() + app_used_number = serializers.SerializerMethodField() + private_usable_number = serializers.SerializerMethodField() def get_app_usable_number(self, obj): app_id = self.context.get('app_id') @@ -472,6 +479,13 @@ class DeveloperSerializer(serializers.ModelSerializer): return apple_to_app_obj.usable_number return 0 + def get_app_used_number(self, obj): + app_id = self.context.get('app_id', '') + if app_id: + return models.DeveloperDevicesID.objects.filter(developerid=obj, + app_id__app_id=app_id).distinct().count() + return 0 + def get_developer_used_number(self, obj): return models.UDIDsyncDeveloper.objects.filter(developerid=obj).count() @@ -484,7 +498,7 @@ class DeveloperSerializer(serializers.ModelSerializer): def get_app_private_number(self, obj): return models.AppleDeveloperToAppUse.objects.filter(developerid=obj).count() - def get_app_private_usable_number(self, obj): + def get_private_usable_number(self, obj): used_number = models.AppleDeveloperToAppUse.objects.filter(developerid=obj).values('usable_number').aggregate( Sum('usable_number')).get('usable_number__sum') if not used_number: @@ -492,12 +506,14 @@ class DeveloperSerializer(serializers.ModelSerializer): return used_number def get_app_private_used_number(self, obj): - return models.DeveloperDevicesID.objects.filter(developerid=obj, app_id__appledevelopertoappuse__developerid=obj).values('udid').distinct().count() + return models.DeveloperDevicesID.objects.filter(developerid=obj, + app_id__appledevelopertoappuse__developerid=obj).values( + 'udid').distinct().count() def get_use_number(self, obj): return models.DeveloperDevicesID.objects.filter(developerid=obj).values('udid').distinct().count() - def get_app_used_number(self, obj): + def get_app_used_count(self, obj): return models.DeveloperAppID.objects.filter(developerid=obj).count() @@ -858,5 +874,5 @@ class AppleDeveloperToAppUseAppsSerializer(serializers.ModelSerializer): def get_app_used_number(self, obj): issuer_id = self.context.get('issuer_id') if issuer_id: - return models.DeveloperDevicesID.objects.filter(app_id=obj,developerid__issuer_id=issuer_id).count() - return 0 \ No newline at end of file + return models.DeveloperDevicesID.objects.filter(app_id=obj, developerid__issuer_id=issuer_id).count() + return 0 diff --git a/fir_ser/api/utils/utils.py b/fir_ser/api/utils/utils.py index e24d1e8..01c9875 100644 --- a/fir_ser/api/utils/utils.py +++ b/fir_ser/api/utils/utils.py @@ -61,7 +61,7 @@ def get_developer_devices(developer_obj_lists): other_used_sum = 0 flyapp_used_sum = 0 max_total = 0 - for dev_obj in developer_obj_lists: + for dev_obj in developer_obj_lists.filter(is_actived=True): other_used, flyapp_used, _ = get_developer_udided(dev_obj) other_used_sum += other_used flyapp_used_sum += flyapp_used