Blame view

scripts/py/test_tianwang_api.py 2.51 KB
3d98506d   “wangming”   feat: 增强合同管理功能
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
  #!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  import json
  import sys
  from datetime import datetime
  
  # 测试接口
  import subprocess
  
  # 测试2025年1月的数据
  cmd1 = [
      'curl', '-s', '-X', 'POST',
      'http://localhost:2011/api/Extend/LqDailyReport/get-tianwang-group-performance-completion',
      '-H', 'Content-Type: application/json',
      '-d', '{"startTime": "2025-01-01", "endTime": "2025-01-31"}'
  ]
  
  result1 = subprocess.run(cmd1, capture_output=True, text=True)
  data1 = json.loads(result1.stdout)
  
  print("=" * 60)
  print("2025年1月数据")
  print("=" * 60)
  print(f"接口状态: {data1.get('code')}")
  print(f"返回消息: {data1.get('msg')}")
  
  depts1 = [d for d in data1.get('data', []) if '教育' in d.get('DepartmentName', '')]
  print("\n=== 教育部数据 ===")
  for d in depts1:
      print(f"{d.get('DepartmentName')}:")
      print(f"  BillingPerformance: {d.get('BillingPerformance')}")
      print(f"  RefundPerformance: {d.get('RefundPerformance')}")
      print(f"  DeductAmount: {d.get('DeductAmount')}")
      print(f"  CompletedPerformance: {d.get('CompletedPerformance')}")
      print(f"  StoreCount: {d.get('StoreCount')}")
  
  total1 = sum([d.get('BillingPerformance', 0) for d in depts1])
  print(f"\n教育一部+教育二部合计 BillingPerformance: {total1}")
  
  # 测试当前月份的数据
  current_month = datetime.now().strftime("%Y-%m")
  start_date = f"{current_month}-01"
  end_date = datetime.now().strftime("%Y-%m-%d")
  
  cmd2 = [
      'curl', '-s', '-X', 'POST',
      'http://localhost:2011/api/Extend/LqDailyReport/get-tianwang-group-performance-completion',
      '-H', 'Content-Type: application/json',
      '-d', f'{{"startTime": "{start_date}", "endTime": "{end_date}"}}'
  ]
  
  result2 = subprocess.run(cmd2, capture_output=True, text=True)
  data2 = json.loads(result2.stdout)
  
  print("\n" + "=" * 60)
  print(f"当前月份 ({current_month}) 数据")
  print("=" * 60)
  print(f"接口状态: {data2.get('code')}")
  
  depts2 = [d for d in data2.get('data', []) if '教育' in d.get('DepartmentName', '')]
  print("\n=== 教育部数据 ===")
  for d in depts2:
      print(f"{d.get('DepartmentName')}:")
      print(f"  BillingPerformance: {d.get('BillingPerformance')}")
      print(f"  RefundPerformance: {d.get('RefundPerformance')}")
      print(f"  DeductAmount: {d.get('DeductAmount')}")
      print(f"  CompletedPerformance: {d.get('CompletedPerformance')}")
      print(f"  StoreCount: {d.get('StoreCount')}")
  
  total2 = sum([d.get('BillingPerformance', 0) for d in depts2])
  print(f"\n教育一部+教育二部合计 BillingPerformance: {total2}")
166f3801   “wangming”   分润统计相关功能及储扣ItemCa...

b79763af   “wangming”   fix: 修正店助主任底薪来源描述...

6af31905   “wangming”   feat: 优化多个接口功能

8b44d4bd   “wangming”   feat: 添加健康师额外工资和合...

1ac23a9d   “wangming”   feat: 优化库存管理和工资计算功能

1fffa876   “wangming”   优化储扣列表接口:增加门店、时间、...

ac14c8db   “wangming”   chore: update das...

3ca01a2d   “wangming”   feat: 更新多个文件和接口,优...