|
|
@@ -324,4 +324,23 @@ class PlatformIOTCardViewSet(viewsets.ModelViewSet):
|
|
|
now_dir = os.path.dirname(__file__)
|
|
|
save_path = os.path.join(now_dir,"excel_folder",save_filename)
|
|
|
df.to_excel(save_path,index=False)
|
|
|
- return Response(save_filename)
|
|
|
+ return Response(save_filename)
|
|
|
+
|
|
|
+ @action(methods=['post'], detail=False, url_path='inquiries', url_name='inquiries')
|
|
|
+ def inquiries(self,request):
|
|
|
+ iccid = request.data.get("iccid")
|
|
|
+ if iccid:
|
|
|
+ sim_operators,account_status,active_date,data_plan,data_usage,data_balance,expiry_date = Get_SIM_info(iccid).get_sim_info()
|
|
|
+ data = {
|
|
|
+ "simId": iccid,
|
|
|
+ "sim_operators" : "合宙" if sim_operators==1 else "SIMBoss" if sim_operators==2 else "未知",
|
|
|
+ "account_status" : account_status,
|
|
|
+ "active_date" : active_date,
|
|
|
+ "data_plan" : data_plan,
|
|
|
+ "data_usage" : data_usage,
|
|
|
+ "data_balance" : data_balance,
|
|
|
+ "expiry_date" : expiry_date
|
|
|
+ }
|
|
|
+ return Response(data)
|
|
|
+ else:
|
|
|
+ raise ValidationError("iccid参数缺失")
|