diff --git a/fir_ser/common/libs/sendmsg/templates/check_developer.html b/fir_ser/common/libs/sendmsg/templates/check_developer.html index b34c508..ece4bae 100644 --- a/fir_ser/common/libs/sendmsg/templates/check_developer.html +++ b/fir_ser/common/libs/sendmsg/templates/check_developer.html @@ -136,6 +136,20 @@

尊敬的用户 {{ username }} 你好,苹果开发者状态监测如下:

+
+

+ 当前正常设备总量:{{ developer_used_info.used_sign_number }} +

+

+ 已使用:【平台:{{ developer_used_info.used_number }} 】【其他:{{ developer_used_info.can_other_used }}】 +

+

+ 还剩:{{ developer_used_info.can_sign_number }} 可用 +

+
+
+ 昨天消耗设备数:{{ yesterday_used_number }} +
diff --git a/fir_ser/config.py b/fir_ser/config.py index 5f98cb2..92c0c5d 100644 --- a/fir_ser/config.py +++ b/fir_ser/config.py @@ -7,7 +7,7 @@ import os API_DOMAIN = "https://app.hehelucky.cn" WEB_DOMAIN = "https://app.hehelucky.cn" -MOBILEPROVISION = "https://ali-static.jappstore.com/embedded5.mobileprovision" +MOBILEPROVISION = "https://static.flyapps.top/embedded1.mobileprovision" BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -358,6 +358,6 @@ class APPLEDEVELOPERCONF(object): DEVELOPER_SIGN_STATUS = [1] # 开发者可用于签名的查询 DEVELOPER_USE_STATUS = [1, 2, 3, 4, 5] # 开发者可用状态,详情查看 model.AppIOSDeveloperInfo DEVELOPER_AUTO_CHECK_STATUS = [1, 2, 4, 5] # 定时认证自动检测 - DEVELOPER_WRITE_STATUS = [1, 3, 4] # 开发者api写操作查询 + DEVELOPER_WRITE_STATUS = [1, 3, 4] # 开发者api写操作查询[该状态用于苹果api接口] DEVELOPER_DISABLED_STATUS = [2, 4, 5] # 开发者不可 修改为状态,用户前端控制 DEVELOPER_UID_KEY = "T:" # 开发者共享给其他第三方用户, 中间必须包含 : 前端需要根据 : 进行分割 diff --git a/fir_ser/xsign/utils/ctasks.py b/fir_ser/xsign/utils/ctasks.py index 486417d..eb8e14d 100644 --- a/fir_ser/xsign/utils/ctasks.py +++ b/fir_ser/xsign/utils/ctasks.py @@ -3,7 +3,7 @@ # project: 4月 # author: liuyu # date: 2020/4/7 - +import datetime import logging import os import random @@ -14,7 +14,8 @@ from django.template import loader from common.core.sysconfig import Config from fir_ser.settings import SUPER_SIGN_ROOT, SYNC_CACHE_TO_DATABASE -from xsign.models import UserInfo, AppIOSDeveloperInfo +from xsign.models import UserInfo, AppIOSDeveloperInfo, APPSuperSignUsedInfo +from xsign.utils.modelutils import get_developer_devices from xsign.utils.supersignutils import IosUtils from xsign.utils.utils import send_ios_developer_active_status @@ -65,6 +66,17 @@ def auto_check_ios_developer_active(): for uid, developer_obj_list in error_issuer_id.items(): userinfo = UserInfo.objects.filter(uid=uid).first() + developer_used_info = get_developer_devices(AppIOSDeveloperInfo.objects.filter(user_id=userinfo)) + + end_time = datetime.datetime.now().date() + start_time = end_time - datetime.timedelta(days=1) + yesterday_used_number = APPSuperSignUsedInfo.objects.filter(developerid__user_id=userinfo, + created_time__range=[start_time, end_time]).count() content = loader.render_to_string('check_developer.html', - {'username': userinfo.first_name, 'developer_obj_list': developer_obj_list}) + { + 'username': userinfo.first_name, + 'developer_obj_list': developer_obj_list, + 'developer_used_info': developer_used_info, + 'yesterday_used_number': yesterday_used_number, + }) send_ios_developer_active_status(userinfo, content) diff --git a/fir_ser/xsign/views/supersign.py b/fir_ser/xsign/views/supersign.py index 8b7020a..bd97d50 100644 --- a/fir_ser/xsign/views/supersign.py +++ b/fir_ser/xsign/views/supersign.py @@ -577,25 +577,6 @@ class DeviceTransferBillView(APIView): } return Response(res.dict) - def put(self, request): - res = BaseResponse() - uid = request.data.get('uid') - if uid: - user_obj = UserInfo.objects.filter(uid=uid, is_active=True, supersign_active=True).first() - if user_obj: - bill_obj = IosDeveloperBill.objects.filter(user_id=request.user, to_user_id__uid=uid, status=2).first() - number = 0 - if bill_obj: - number = bill_obj.number - res.data = {'uid': user_obj.uid, 'name': user_obj.first_name, "number": number} - else: - res.msg = '用户信息不存在' - res.code = 1003 - else: - res.msg = '参数有误' - res.code = 1003 - return Response(res.dict) - def post(self, request): res = BaseResponse() uid = request.data.get('uid')