Skip to content

Commit

Permalink
files sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
LeChatelier-Lenz committed Jun 10, 2024
1 parent 898ae7f commit 2819d2f
Show file tree
Hide file tree
Showing 95 changed files with 960 additions and 6,123 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
frontend/node_modules
dist
dist-ssr
*.local
Expand Down
7 changes: 0 additions & 7 deletions README.md

This file was deleted.

Binary file modified backend/bank_site/bank_app/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified backend/bank_site/bank_app/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file modified backend/bank_site/bank_app/__pycache__/apps.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified backend/bank_site/bank_app/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file modified backend/bank_site/bank_app/__pycache__/user_urls.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 12 additions & 5 deletions backend/bank_site/bank_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ class cashier(models.Model):
manage_authority = models.BooleanField(null = False)


class online_bank_manager(models.Model):
online_bank_manager_id = models.AutoField(primary_key = True)
employee = models.ForeignKey(employee, on_delete = models.CASCADE)
account = models.CharField(max_length = 100, null = False)
password = models.CharField(max_length = 20, null = False)


class online_user(models.Model):
objects = models.Manager()
user_id = models.AutoField(primary_key = True,default = 1)
Expand All @@ -47,7 +54,7 @@ class account(models.Model):
objects = models.Manager()
account_id = models.AutoField(primary_key=True)
password = models.CharField(max_length=20, null=False)
identity_card = models.ForeignKey(online_user, on_delete=models.PROTECT,to_field='identity_card',db_column='identity_card')
identity_card = models.ForeignKey(online_user, on_delete=models.PROTECT , to_field='identity_card', db_column='identity_card')
card_type = models.IntegerField(null=False)
balance = models.FloatField(null=False, default=0.0)
current_deposit = models.FloatField(null=False, default=0.0)
Expand All @@ -60,7 +67,7 @@ class account(models.Model):
class deposit_record(models.Model):
objects = models.Manager()
deposit_record_id = models.AutoField(primary_key = True)
account_id = models.AutoField(null = False)
account_id = models.IntegerField(null = False)
deposit_type = models.CharField(max_length = 10, null = False)
auto_renew_status = models.BooleanField()
deposit_start_date = models.DateField(null = False)
Expand All @@ -73,7 +80,7 @@ class deposit_record(models.Model):
class withdrawal_record(models.Model):
objects = models.Manager()
withdrawal_record_id = models.AutoField(primary_key = True)
account_id = models.AutoField(null = False)
account_id = models.IntegerField(null = False)
withdrawal_date = models.DateField(null = False)
withdrawal_amount = models.FloatField(null = False)
cashier_id = models.IntegerField(null = False)
Expand All @@ -83,8 +90,8 @@ class withdrawal_record(models.Model):
class transfer_record(models.Model):
objects = models.Manager()
transfer_record_id = models.AutoField(primary_key = True)
account_in_id = models.AutoField(null = False)
account_out_id = models.AutoField(null = False)
account_in_id = models.IntegerField(null = False)
account_out_id = models.IntegerField(null = False)
transfer_date = models.DateField(null = False)
transfer_amount = models.FloatField(null = False)
cashier_id = models.IntegerField(null = False)
Expand Down
10 changes: 5 additions & 5 deletions backend/bank_site/bank_app/user_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def user_account_all_records(request):
else:
result = []
queryset = []
filter_deposit_records = deposit_record.objects.filter(account_id=request.GET.get('account_id'))
filter_deposit_records = deposit_record.objects.filter(account_id=int(request.GET.get('account_id')))
if filter_deposit_records.exists():
queryset.extend(filter_deposit_records)
queryset = queryset.sort(key=lambda x: x.deposit_start_date)
Expand All @@ -207,7 +207,7 @@ def user_account_all_records(request):
result.append({"deposit": []})
queryset = []

filter_withdrawal_records = withdrawal_record.objects.filter(account_id=request.GET.get('account_id'))
filter_withdrawal_records = withdrawal_record.objects.filter(account_id=int(request.GET.get('account_id')))
if filter_withdrawal_records.exists():
queryset = []
queryset.extend(filter_withdrawal_records)
Expand All @@ -216,7 +216,7 @@ def user_account_all_records(request):
else:
result.append({"withdrawal": []})
queryset = []
filter_transfer_records = transfer_record.objects.filter(account_in_id=request.GET.get('account_id'))
filter_transfer_records = transfer_record.objects.filter(account_in_id=int(request.GET.get('account_id')))
if filter_transfer_records.exists():
queryset = []
queryset.extend(filter_transfer_records)
Expand All @@ -236,8 +236,8 @@ def user_account_transfer(request):
data = json.loads(request.body.decode('utf-8'))
if data.get('transfer_amount') <= 0:
return JsonResponse({"error": "转账金额错误"}, status=403)
filter_out_account = account.objects.filter(account_id=data.get('account_out_id'), password=data.get('password'))
filter_in_account = account.objects.filter(account_id=data.get('account_in_id'))
filter_out_account = account.objects.filter(account_id=int(data.get('account_out_id')), password=data.get('password'))
filter_in_account = account.objects.filter(account_id=int(data.get('account_in_id')))
if not filter_in_account.exists():
return JsonResponse({"error": "接收转账用户不存在"}, status=403)
if not filter_out_account.exists():
Expand Down
Binary file modified backend/bank_site/bank_site/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified backend/bank_site/bank_site/__pycache__/settings.cpython-312.pyc
Binary file not shown.
Binary file modified backend/bank_site/bank_site/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file modified backend/bank_site/bank_site/__pycache__/wsgi.cpython-312.pyc
Binary file not shown.
13 changes: 0 additions & 13 deletions frontend/manager.html

This file was deleted.

86 changes: 0 additions & 86 deletions frontend/src/cashier/assets/base.css

This file was deleted.

Binary file removed frontend/src/cashier/assets/logo.png
Binary file not shown.
35 changes: 0 additions & 35 deletions frontend/src/cashier/assets/main.css

This file was deleted.

1 change: 0 additions & 1 deletion frontend/src/cashier/assets/vue.svg

This file was deleted.

131 changes: 0 additions & 131 deletions frontend/src/cashier/cashier.vue

This file was deleted.

20 changes: 0 additions & 20 deletions frontend/src/cashier/cashier_main.js

This file was deleted.

Loading

0 comments on commit 2819d2f

Please sign in to comment.