ソースを参照

完成入库系统的管理

flower_mr 2 ヶ月 前
コミット
5f5e7a51cf
100 ファイル変更4417 行追加108 行削除
  1. BIN
      asn/__pycache__/__init__.cpython-38.pyc
  2. BIN
      asn/__pycache__/admin.cpython-38.pyc
  3. BIN
      asn/__pycache__/apps.cpython-38.pyc
  4. BIN
      asn/__pycache__/files.cpython-38.pyc
  5. BIN
      asn/__pycache__/filter.cpython-38.pyc
  6. BIN
      asn/__pycache__/models.cpython-38.pyc
  7. BIN
      asn/__pycache__/serializers.cpython-38.pyc
  8. BIN
      asn/__pycache__/urls.cpython-38.pyc
  9. BIN
      asn/__pycache__/views.cpython-38.pyc
  10. BIN
      asn/migrations/__pycache__/0001_initial.cpython-38.pyc
  11. BIN
      asn/migrations/__pycache__/__init__.cpython-38.pyc
  12. 11 4
      asn/views.py
  13. 5 0
      backend_start windows.ps1
  14. 1 1
      backend_start.sh
  15. 0 0
      bound/__init__.py
  16. BIN
      bound/__pycache__/__init__.cpython-38.pyc
  17. BIN
      bound/__pycache__/admin.cpython-38.pyc
  18. BIN
      bound/__pycache__/apps.cpython-38.pyc
  19. BIN
      bound/__pycache__/filter.cpython-38.pyc
  20. BIN
      bound/__pycache__/models.cpython-38.pyc
  21. BIN
      bound/__pycache__/serializers.cpython-38.pyc
  22. BIN
      bound/__pycache__/urls.cpython-38.pyc
  23. BIN
      bound/__pycache__/views.cpython-38.pyc
  24. 7 0
      bound/admin.py
  25. 6 0
      bound/apps.py
  26. 73 0
      bound/files.py
  27. 93 0
      bound/filter.py
  28. 80 0
      bound/migrations/0001_initial.py
  29. 0 0
      bound/migrations/__init__.py
  30. BIN
      bound/migrations/__pycache__/0001_initial.cpython-38.pyc
  31. BIN
      bound/migrations/__pycache__/0002_boundlistmodel_bound_desc.cpython-38.pyc
  32. BIN
      bound/migrations/__pycache__/__init__.cpython-38.pyc
  33. 67 0
      bound/models.py
  34. 52 0
      bound/serializers.py
  35. 3 0
      bound/tests.py
  36. 19 0
      bound/urls.py
  37. 124 0
      bound/views.py
  38. 3 1
      data_base/import_data.py
  39. BIN
      db.sqlite3
  40. BIN
      greaterwms/__pycache__/__init__.cpython-38.pyc
  41. BIN
      greaterwms/__pycache__/asgi.cpython-38.pyc
  42. BIN
      greaterwms/__pycache__/settings.cpython-38.pyc
  43. BIN
      greaterwms/__pycache__/urls.cpython-38.pyc
  44. BIN
      greaterwms/__pycache__/views.cpython-38.pyc
  45. 2 1
      greaterwms/settings.py
  46. 4 1
      greaterwms/urls.py
  47. 1844 0
      logs/error.log
  48. 2010 0
      logs/server.log
  49. 0 97
      nginx.conf
  50. BIN
      reportcenter/__pycache__/__init__.cpython-38.pyc
  51. BIN
      reportcenter/__pycache__/admin.cpython-38.pyc
  52. BIN
      reportcenter/__pycache__/apps.cpython-38.pyc
  53. BIN
      reportcenter/__pycache__/files.cpython-38.pyc
  54. BIN
      reportcenter/__pycache__/filter.cpython-38.pyc
  55. BIN
      reportcenter/__pycache__/models.cpython-38.pyc
  56. BIN
      reportcenter/__pycache__/serializers.cpython-38.pyc
  57. BIN
      reportcenter/__pycache__/urls.cpython-38.pyc
  58. BIN
      reportcenter/__pycache__/views.cpython-38.pyc
  59. BIN
      reportcenter/migrations/__pycache__/0001_initial.cpython-38.pyc
  60. BIN
      reportcenter/migrations/__pycache__/__init__.cpython-38.pyc
  61. 7 0
      shelflist.sql
  62. BIN
      staff/__pycache__/__init__.cpython-38.pyc
  63. BIN
      staff/__pycache__/admin.cpython-38.pyc
  64. BIN
      staff/__pycache__/apps.cpython-38.pyc
  65. BIN
      staff/__pycache__/files.cpython-38.pyc
  66. BIN
      staff/__pycache__/filter.cpython-38.pyc
  67. BIN
      staff/__pycache__/models.cpython-38.pyc
  68. BIN
      staff/__pycache__/serializers.cpython-38.pyc
  69. BIN
      staff/__pycache__/urls.cpython-38.pyc
  70. BIN
      staff/__pycache__/views.cpython-38.pyc
  71. BIN
      staff/migrations/__pycache__/0001_initial.cpython-38.pyc
  72. BIN
      staff/migrations/__pycache__/0002_listmodel_is_look.cpython-38.pyc
  73. BIN
      staff/migrations/__pycache__/0003_listmodel_appid.cpython-38.pyc
  74. BIN
      staff/migrations/__pycache__/0004_alter_listmodel_appid.cpython-38.pyc
  75. BIN
      staff/migrations/__pycache__/0005_listmodel_is_edit.cpython-38.pyc
  76. BIN
      staff/migrations/__pycache__/__init__.cpython-38.pyc
  77. BIN
      stock/__pycache__/__init__.cpython-38.pyc
  78. BIN
      stock/__pycache__/admin.cpython-38.pyc
  79. BIN
      stock/__pycache__/apps.cpython-38.pyc
  80. BIN
      stock/__pycache__/files.cpython-38.pyc
  81. BIN
      stock/__pycache__/filter.cpython-38.pyc
  82. BIN
      stock/__pycache__/models.cpython-38.pyc
  83. BIN
      stock/__pycache__/serializers.cpython-38.pyc
  84. BIN
      stock/__pycache__/urls.cpython-38.pyc
  85. BIN
      stock/__pycache__/views.cpython-38.pyc
  86. BIN
      stock/migrations/__pycache__/0001_initial.cpython-38.pyc
  87. BIN
      stock/migrations/__pycache__/__init__.cpython-38.pyc
  88. 0 1
      templates/dist/spa/css/3.22b1adf9.css
  89. 1 0
      templates/dist/spa/css/3.668a8a6d.css
  90. 1 0
      templates/dist/spa/css/4.a164a49b.css
  91. 0 1
      templates/dist/spa/css/4.d7aabfa2.css
  92. 1 0
      templates/dist/spa/css/5.eccd2a4b.css
  93. 1 0
      templates/dist/spa/css/6.f721cf95.css
  94. 1 0
      templates/dist/spa/css/7.8c912396.css
  95. 0 0
      templates/dist/spa/css/8.74c09acd.css
  96. BIN
      templates/dist/spa/css/vendor.2ac1ba6a.css.gz
  97. 1 1
      templates/dist/spa/index.html
  98. 0 0
      templates/dist/spa/js/1.66e8190d.js
  99. BIN
      templates/dist/spa/js/1.96fff813.js.gz
  100. 0 0
      templates/dist/spa/js/10.6e754992.js

BIN
asn/__pycache__/__init__.cpython-38.pyc


BIN
asn/__pycache__/admin.cpython-38.pyc


BIN
asn/__pycache__/apps.cpython-38.pyc


BIN
asn/__pycache__/files.cpython-38.pyc


BIN
asn/__pycache__/filter.cpython-38.pyc


BIN
asn/__pycache__/models.cpython-38.pyc


BIN
asn/__pycache__/serializers.cpython-38.pyc


BIN
asn/__pycache__/urls.cpython-38.pyc


BIN
asn/__pycache__/views.cpython-38.pyc


BIN
asn/migrations/__pycache__/0001_initial.cpython-38.pyc


BIN
asn/migrations/__pycache__/__init__.cpython-38.pyc


+ 11 - 4
asn/views.py

@@ -21,6 +21,10 @@ from warehouse.models import ListModel as warehouse
 from warehouse.models import ListModel as warehouse
 from staff.models import ListModel as staff
 
+from rest_framework.permissions import AllowAny
+
+
+
 
 class AsnListViewSet(viewsets.ModelViewSet):
     """
@@ -35,6 +39,9 @@ class AsnListViewSet(viewsets.ModelViewSet):
             Delete a data line(delete)
 
     """
+    authentication_classes = []  # 禁用所有认证类
+    permission_classes = [AllowAny]  # 允许任意访问
+    
     pagination_class = MyPageNumberPagination
     filter_backends = [DjangoFilterBackend, OrderingFilter, ]
     ordering_fields = ['id', "create_time", "update_time", ]
@@ -51,9 +58,9 @@ class AsnListViewSet(viewsets.ModelViewSet):
         id = self.get_project()
         if self.request.user:
             if id is None:
-                return AsnListModel.objects.filter(openid=self.request.auth.openid, is_delete=False)
+                return AsnListModel.objects.filter( is_delete=False)
             else:
-                return AsnListModel.objects.filter(openid=self.request.auth.openid, id=id, is_delete=False)
+                return AsnListModel.objects.filter( id=id, is_delete=False)
         else:
             return AsnListModel.objects.none()
 
@@ -167,9 +174,9 @@ class AsnDetailViewSet(viewsets.ModelViewSet):
         id = self.get_project()
         if self.request.user:
             if id is None:
-                return AsnDetailModel.objects.filter(openid=self.request.auth.openid, is_delete=False)
+                return AsnDetailModel.objects.filter( is_delete=False)
             else:
-                return AsnDetailModel.objects.filter(openid=self.request.auth.openid, id=id, is_delete=False)
+                return AsnDetailModel.objects.filter( id=id, is_delete=False)
         else:
             return AsnDetailModel.objects.none()
 

+ 5 - 0
backend_start windows.ps1

@@ -0,0 +1,5 @@
+#!/bin/bash
+python manage.py makemigrations
+python manage.py migrate
+
+daphne -b 0.0.0.0 -p 8008 greaterwms.asgi:application

+ 1 - 1
backend_start.sh

@@ -2,4 +2,4 @@
 python3 manage.py makemigrations
 python3 manage.py migrate
 
-daphne  -p 8008 greaterwms.asgi:application
+daphne -b 0.0.0.0 -p 8008 greaterwms.asgi:application

+ 0 - 0
bound/__init__.py


BIN
bound/__pycache__/__init__.cpython-38.pyc


BIN
bound/__pycache__/admin.cpython-38.pyc


BIN
bound/__pycache__/apps.cpython-38.pyc


BIN
bound/__pycache__/filter.cpython-38.pyc


BIN
bound/__pycache__/models.cpython-38.pyc


BIN
bound/__pycache__/serializers.cpython-38.pyc


BIN
bound/__pycache__/urls.cpython-38.pyc


BIN
bound/__pycache__/views.cpython-38.pyc


+ 7 - 0
bound/admin.py

@@ -0,0 +1,7 @@
+from django.contrib import admin
+from .models import BoundListModel, BoundDetailModel,BoundBatchModel
+
+admin.site.register(BoundListModel)
+admin.site.register(BoundDetailModel)
+admin.site.register(BoundBatchModel)
+

+ 6 - 0
bound/apps.py

@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class BoundConfig(AppConfig):
+    default_auto_field = 'django.db.models.BigAutoField'
+    name = 'bound'

+ 73 - 0
bound/files.py

@@ -0,0 +1,73 @@
+from rest_framework_csv.renderers import CSVStreamingRenderer
+
+def list_file_headers():
+    return [
+
+    ]
+
+def list_cn_data_header():
+    return dict([
+        ('asn_code', u'ASN单号'),
+        ('asn_status', u'ASN状态'),
+        ('total_weight', u'总重量'),
+        ('total_volume', u'总体积'),
+        ('total_cost', u'总成本'),
+        ('supplier', u'供应商'),
+        ('creater', u'创建人'),
+        ('create_time', u'创建时间'),
+        ('update_time', u'更新时间')
+    ])
+
+
+def detail_file_headers():
+    return [
+        'asn_code',
+        'asn_status',
+        'supplier',
+        'goods_code',
+        'goods_desc',
+        'goods_qty',
+        'goods_actual_qty',
+        'sorted_qty',
+        'goods_shortage_qty',
+        'goods_more_qty',
+        'goods_damage_qty',
+        'goods_weight',
+        'goods_volume',
+        'goods_cost',
+        'creater',
+        'create_time',
+        'update_time'
+    ]
+
+def detail_cn_data_header():
+    return dict([
+        ('asn_code', u'ASN单号'),
+        ('asn_status', u'ASN状态'),
+        ('supplier', u'供应商'),
+        ('goods_code', u'商品编码'),
+        ('goods_desc', u'商品描述'),
+        ('goods_qty', u'订单数量'),
+        ('goods_actual_qty', u'实际到货数量'),
+        ('sorted_qty', u'已分拣数量'),
+        ('goods_shortage_qty', u'少到货数量'),
+        ('goods_more_qty', u'多到货数量'),
+        ('goods_damage_qty', u'破损数量'),
+        ('goods_weight', u'商品重量'),
+        ('goods_volume', u'商品体积'),
+        ('goods_cost', u'商品成本'),
+        ('creater', u'创建人'),
+        ('create_time', u'创建时间'),
+        ('update_time', u'更新时间')
+    ])
+
+class FileListRenderCN(CSVStreamingRenderer):
+    header = list_file_headers()
+    labels = list_cn_data_header()
+
+
+class FileDetailRenderCN(CSVStreamingRenderer):
+    header = detail_file_headers()
+    labels = detail_cn_data_header()
+
+

+ 93 - 0
bound/filter.py

@@ -0,0 +1,93 @@
+from django_filters import FilterSet
+from .models import BoundListModel, BoundDetailModel,BoundBatchModel
+
+
+class BoundListFilter(FilterSet):
+
+    class Meta:
+        model = BoundListModel
+        fields = {
+            "id": ['exact', 'gt', 'gte', 'lt', 'lte', 'isnull', 'in', 'range'],
+            'bound_month': ['exact', 'gt', 'gte', 'lt', 'lte', 'icontains','range'],
+            'bound_date': ['exact', 'gt', 'gte', 'lt', 'lte', 'icontains','range'],
+            'bound_code': ['icontains', 'exact'],
+            'bound_code_type': ['exact', 'icontains'],
+            'bound_bs_type': ['exact', 'icontains'],
+            'bound_type': ['exact', 'icontains'],
+            'bound_desc' : ['icontains', 'exact'],
+            'bound_department': ['exact', 'icontains'],
+            'bound_status': ['exact', 'icontains'],
+
+            'creater': ['icontains', 'exact'],
+            'openid': ['exact'],
+            'is_delete': ['exact'],
+            'create_time': ['exact', 'gt', 'gte', 'lt', 'lte',
+             'year', 'year__gt', 'year__gte', 'year__lt', 'year__lte', 'year__range', 'year__in', 
+             'month','month__gt','month__gte','month__lt','month__lte','month__range','month__in', 
+             'day', 'day__gt', 'day__gte', 'day__lt', 'day__lte', 'day__range', 'day__in',
+              'week_day', 'week_day__gt', 'week_day__gte', 'week_day__lt', 'week_day__lte', 'week_day__range', 'week_day__in', 
+              'hour', 'hour__gt', 'hour__gte', 'hour__lt', 'hour__lte', 'hour__range', 'hour__in',
+
+              'date', 'date__gt', 'date__gte', 'date__lt', 'date__lte', 'date__range', 'date__in', 
+              'time', 'time__gt', 'time__gte', 'time__lt', 'time__lte', 'time__range', 'time__in', 'isnull', 'in', 'range'],
+            'update_time':
+             ['exact', 'gt', 'gte', 'lt', 'lte',
+             'year', 'year__gt', 'year__gte', 'year__lt', 'year__lte', 'year__range', 'year__in', 
+             'month','month__gt','month__gte','month__lt','month__lte','month__range','month__in', 
+             'day', 'day__gt', 'day__gte', 'day__lt', 'day__lte', 'day__range', 'day__in',
+              'week_day', 'week_day__gt', 'week_day__gte', 'week_day__lt', 'week_day__lte', 'week_day__range', 'week_day__in', 
+              'hour', 'hour__gt', 'hour__gte', 'hour__lt', 'hour__lte', 'hour__range', 'hour__in',
+
+              'date', 'date__gt', 'date__gte', 'date__lt', 'date__lte', 'date__range', 'date__in', 
+              'time', 'time__gt', 'time__gte', 'time__lt', 'time__lte', 'time__range', 'time__in', 'isnull', 'in', 'range'],
+            
+        }
+
+
+class BoundDetailFilter(FilterSet):
+    class Meta:
+        model = BoundDetailModel
+        fields = {
+            "id": ['exact', 'gt', 'gte', 'lt', 'lte', 'isnull', 'in', 'range'],
+           
+            'creater': ['icontains', 'exact'],
+            'openid': ['exact'],
+            'is_delete': ['exact'],
+            'create_time':  ['exact', 'gt', 'gte', 'lt', 'lte',
+             'year', 'year__gt', 'year__gte', 'year__lt', 'year__lte', 'year__range', 'year__in', 
+             'month','month__gt','month__gte','month__lt','month__lte','month__range','month__in', 
+             'day', 'day__gt', 'day__gte', 'day__lt', 'day__lte', 'day__range', 'day__in',
+              'week_day', 'week_day__gt', 'week_day__gte', 'week_day__lt', 'week_day__lte', 'week_day__range', 'week_day__in', 
+              'hour', 'hour__gt', 'hour__gte', 'hour__lt', 'hour__lte', 'hour__range', 'hour__in',
+
+              'date', 'date__gt', 'date__gte', 'date__lt', 'date__lte', 'date__range', 'date__in', 
+              'time', 'time__gt', 'time__gte', 'time__lt', 'time__lte', 'time__range', 'time__in', 'isnull', 'in', 'range'],
+              
+            'update_time': ['exact', 'gt', 'gte', 'lt', 'lte',
+             'year', 'year__gt', 'year__gte', 'year__lt', 'year__lte', 'year__range', 'year__in', 
+             'month','month__gt','month__gte','month__lt','month__lte','month__range','month__in', 
+             'day', 'day__gt', 'day__gte', 'day__lt', 'day__lte', 'day__range', 'day__in',
+              'week_day', 'week_day__gt', 'week_day__gte', 'week_day__lt', 'week_day__lte', 'week_day__range', 'week_day__in', 
+              'hour', 'hour__gt', 'hour__gte', 'hour__lt', 'hour__lte', 'hour__range', 'hour__in',
+
+              'date', 'date__gt', 'date__gte', 'date__lt', 'date__lte', 'date__range', 'date__in', 
+              'time', 'time__gt', 'time__gte', 'time__lt', 'time__lte', 'time__range', 'time__in', 'isnull', 'in', 'range'],
+        }
+
+class BoundBatchFilter(FilterSet):
+    class Meta:
+        model = BoundBatchModel
+        fields = {
+            "id": ['exact', 'gt', 'gte', 'lt', 'lte', 'isnull', 'in', 'range'],
+            'bound_number': ['exact', 'gt', 'gte', 'lt', 'lte', 'icontains','range'],
+            
+            'warehouse_code': ['icontains', 'exact'],
+            'warehouse_name': ['icontains','exact'],
+            
+            'goods_code': ['icontains', 'exact'],
+            'goods_desc': ['icontains', 'exact'],
+            'goods_qty': ['exact', 'gt', 'gte', 'lt', 'lte', 'icontains','range'],
+            'goods_weight': ['exact', 'gt', 'gte', 'lt', 'lte', 'icontains','range'],
+            'goods_total_weight': ['exact', 'gt', 'gte', 'lt', 'lte', 'icontains','range'],
+
+        }

+ 80 - 0
bound/migrations/0001_initial.py

@@ -0,0 +1,80 @@
+# Generated by Django 4.1.2 on 2025-03-26 19:31
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='BoundBatchModel',
+            fields=[
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('bound_number', models.CharField(max_length=255, verbose_name='入库批次号')),
+                ('warehouse_code', models.CharField(max_length=255, verbose_name='仓库编码')),
+                ('warehouse_name', models.CharField(max_length=255, verbose_name='仓库名称')),
+                ('goods_code', models.CharField(max_length=255, verbose_name='商品编码')),
+                ('goods_desc', models.CharField(max_length=255, verbose_name='商品描述')),
+                ('goods_qty', models.BigIntegerField(default=0, verbose_name='商品数量')),
+                ('goods_weight', models.FloatField(default=0, verbose_name='商品单重')),
+                ('goods_total_weight', models.FloatField(default=0, verbose_name='商品总重')),
+            ],
+            options={
+                'verbose_name': 'Bound Batch',
+                'verbose_name_plural': 'Bound Batch',
+                'db_table': 'boundbatch',
+                'ordering': ['-id'],
+            },
+        ),
+        migrations.CreateModel(
+            name='BoundListModel',
+            fields=[
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('bound_month', models.CharField(max_length=255, verbose_name='月份')),
+                ('bound_date', models.DateField(verbose_name='单据日期')),
+                ('bound_code', models.CharField(max_length=255, unique=True, verbose_name='出入库编号')),
+                ('bound_code_type', models.CharField(max_length=255, verbose_name='单据类型')),
+                ('bound_bs_type', models.CharField(max_length=255, verbose_name='业务类型')),
+                ('bound_type', models.CharField(max_length=255, verbose_name='出入库类型')),
+                ('bound_desc', models.CharField(default='', max_length=255, verbose_name='出入库描述')),
+                ('bound_department', models.CharField(max_length=255, verbose_name='部门')),
+                ('bound_status', models.CharField(max_length=255, verbose_name='单据状态')),
+                ('creater', models.CharField(default='uesr', max_length=255, verbose_name='Who Created')),
+                ('openid', models.CharField(max_length=255, verbose_name='Openid')),
+                ('is_delete', models.BooleanField(default=False, verbose_name='Delete Label')),
+                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='Create Time')),
+                ('update_time', models.DateTimeField(auto_now=True, null=True, verbose_name='Update Time')),
+            ],
+            options={
+                'verbose_name': 'Bound List',
+                'verbose_name_plural': 'Bound List',
+                'db_table': 'boundlist',
+                'ordering': ['-id'],
+            },
+        ),
+        migrations.CreateModel(
+            name='BoundDetailModel',
+            fields=[
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('creater', models.CharField(default='uesr', max_length=255, verbose_name='Who Created')),
+                ('openid', models.CharField(max_length=255, verbose_name='Openid')),
+                ('is_delete', models.BooleanField(default=False, verbose_name='Delete Label')),
+                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='Create Time')),
+                ('update_time', models.DateTimeField(auto_now=True, null=True, verbose_name='Update Time')),
+                ('bound_batch', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='bound_batch_detail', to='bound.boundbatchmodel', verbose_name='Bound Batch')),
+                ('bound_list', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bound_detail', to='bound.boundlistmodel', verbose_name='Bound List')),
+            ],
+            options={
+                'verbose_name': 'Bound Detail',
+                'verbose_name_plural': 'Bound Detail',
+                'db_table': 'bounddetail',
+                'ordering': ['-id'],
+            },
+        ),
+    ]

+ 0 - 0
bound/migrations/__init__.py


BIN
bound/migrations/__pycache__/0001_initial.cpython-38.pyc


BIN
bound/migrations/__pycache__/0002_boundlistmodel_bound_desc.cpython-38.pyc


BIN
bound/migrations/__pycache__/__init__.cpython-38.pyc


+ 67 - 0
bound/models.py

@@ -0,0 +1,67 @@
+from django.db import models
+
+
+
+class BoundListModel(models.Model):
+    bound_month = models.CharField(max_length=255, verbose_name="月份")
+    bound_date = models.DateField(verbose_name="单据日期")
+    bound_code = models.CharField(max_length=255, verbose_name="出入库编号",unique=True)
+    bound_code_type = models.CharField(max_length=255, verbose_name="单据类型")
+    bound_bs_type = models.CharField(max_length=255, verbose_name="业务类型")
+    bound_type = models.CharField(max_length=255, verbose_name="出入库类型")
+    bound_desc = models.CharField(default='', max_length=255, verbose_name="出入库描述")
+    bound_department = models.CharField(max_length=255, verbose_name="部门")
+
+    bound_status = models.CharField(max_length=255, verbose_name="单据状态")
+
+    creater = models.CharField(default='uesr', max_length=255, verbose_name="Who Created")
+    openid = models.CharField(max_length=255, verbose_name="Openid")
+    is_delete = models.BooleanField(default=False, verbose_name='Delete Label')
+    create_time = models.DateTimeField(auto_now_add=True, verbose_name="Create Time")
+    update_time = models.DateTimeField(auto_now=True, blank=True, null=True, verbose_name="Update Time")
+
+    class Meta:
+        db_table = 'boundlist'
+        verbose_name = 'Bound List'
+        verbose_name_plural = "Bound List"
+        ordering = ['-id']
+
+
+
+class BoundBatchModel(models.Model):
+    bound_number = models.CharField(max_length=255, verbose_name="入库批次号")
+    
+    warehouse_code = models.CharField(max_length=255, verbose_name="仓库编码")
+    warehouse_name = models.CharField(max_length=255, verbose_name="仓库名称")
+
+    
+    goods_code = models.CharField(max_length=255, verbose_name="商品编码")
+    goods_desc = models.CharField(max_length=255, verbose_name="商品描述")
+    goods_qty = models.BigIntegerField(default=0, verbose_name="商品数量")
+    goods_weight = models.FloatField(default=0, verbose_name="商品单重")
+    goods_total_weight = models.FloatField(default=0, verbose_name="商品总重")
+
+    class Meta:
+        db_table = 'boundbatch'
+        verbose_name = 'Bound Batch'
+        verbose_name_plural = "Bound Batch"
+        ordering = ['-id']
+        
+
+class BoundDetailModel(models.Model):
+    
+    bound_list = models.ForeignKey(BoundListModel, on_delete=models.CASCADE, verbose_name="Bound List", related_name='bound_detail')
+    bound_batch = models.ForeignKey(BoundBatchModel, on_delete=models.PROTECT, verbose_name="Bound Batch", related_name='bound_batch_detail')
+
+    
+    creater = models.CharField(default='uesr', max_length=255, verbose_name="Who Created")
+    openid = models.CharField(max_length=255, verbose_name="Openid")
+    is_delete = models.BooleanField(default=False, verbose_name='Delete Label')
+    create_time = models.DateTimeField(auto_now_add=True, verbose_name="Create Time")
+    update_time = models.DateTimeField(auto_now=True, blank=True, null=True, verbose_name="Update Time")
+
+    class Meta:
+        db_table = 'bounddetail'
+        verbose_name = 'Bound Detail'
+        verbose_name_plural = "Bound Detail"
+        ordering = ['-id']

+ 52 - 0
bound/serializers.py

@@ -0,0 +1,52 @@
+from rest_framework import serializers
+from .models import BoundListModel, BoundDetailModel,BoundBatchModel
+from utils import datasolve
+
+
+class BoundListGetSerializer(serializers.ModelSerializer):
+    bound_month = serializers.CharField(read_only=True, required=False)
+    bound_date = serializers.DateField(read_only=True, format='%Y-%m-%d')
+    bound_code = serializers.CharField(read_only=True, required=False)
+    bound_code_type = serializers.CharField(read_only=True, required=False)
+    bound_bs_type = serializers.CharField(read_only=True, required=False)
+    bound_type = serializers.CharField(read_only=True, required=False)
+    bound_desc = serializers.CharField(read_only=True, required=False)
+    bound_department = serializers.CharField(read_only=True, required=False)
+    
+    bound_status = serializers.CharField(read_only=True, required=False)
+
+    # warehouse_code = serializers.CharField(read_only=True, required=False)
+    # warehouse_name = serializers.CharField(read_only=True, required=False)
+
+    creater = serializers.CharField(read_only=True, required=False)
+    create_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M:%S')
+    update_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M:%S')
+    class Meta:
+        model = BoundListModel
+        exclude = ['openid', 'is_delete', ]
+        read_only_fields = ['id', 'openid', ]
+
+class BoundListPostSerializer(serializers.ModelSerializer):
+    bound_month = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate])
+    bound_date = serializers.DateField(read_only=False, required=False, validators=[datasolve.data_validate])
+    bound_code = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate])
+    bound_code_type = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate])
+    bound_bs_type = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate])
+    bound_type = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate])
+    bound_desc = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate])
+    bound_department = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate])
+    bound_status = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate])
+
+    # warehouse_code = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate])
+    # warehouse_name = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate])
+
+    creater = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate])
+    is_delete = serializers.BooleanField(read_only=False, required=False)
+    class Meta:
+        model = BoundListModel
+        exclude = ['openid']
+        read_only_fields = ['id', 'create_time', 'update_time', ]
+
+
+
+

+ 3 - 0
bound/tests.py

@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.

+ 19 - 0
bound/urls.py

@@ -0,0 +1,19 @@
+from django.urls import path, re_path
+from . import views
+
+urlpatterns = [
+path(r'list/', views.BoundListViewSet.as_view({"get": "list", "post": "create"}), name="boundlist"),
+re_path(r'^list/(?P<pk>\d+)/$', views.BoundListViewSet.as_view({
+    'get': 'retrieve',
+    'put': 'update',
+    'patch': 'partial_update',
+}), name="boundlist_1"),
+
+# path(r'detail/', views.BoundDetailViewSet.as_view({"get": "list",  }), name="bounddetail"), 
+
+# re_path(r'^detail/(?P<pk>\d+)/$', views.BoundDetailViewSet.as_view({
+#     'get': 'retrieve',
+#     'put': 'update',
+# }), name="bounddetail_1"),
+
+]

+ 124 - 0
bound/views.py

@@ -0,0 +1,124 @@
+from rest_framework import viewsets
+from utils.page import MyPageNumberPagination
+from utils.datasolve import sumOfList, transportation_calculate
+from utils.md5 import Md5
+from rest_framework.filters import OrderingFilter
+from django_filters.rest_framework import DjangoFilterBackend
+
+from rest_framework.response import Response
+from rest_framework.exceptions import APIException
+from django.utils import timezone
+
+
+
+from .models import BoundListModel, BoundDetailModel,BoundBatchModel
+# from .files import FileListRenderCN, FileDetailRenderCN
+
+from .serializers import BoundListGetSerializer,BoundListPostSerializer
+from .filter import BoundListFilter, BoundDetailFilter
+
+from warehouse.models import ListModel as warehouse
+from staff.models import ListModel as staff
+from rest_framework.permissions import AllowAny
+
+
+
+
+class BoundListViewSet(viewsets.ModelViewSet):
+    """
+        retrieve:
+            Response a data list(get)
+        list:
+            Response a data list(all)
+        create:
+            Create a data line(post)
+
+        delete:
+            Delete a data line(delete)
+
+    """
+    # authentication_classes = []  # 禁用所有认证类
+    # permission_classes = [AllowAny]  # 允许任意访问
+    
+    pagination_class = MyPageNumberPagination
+    filter_backends = [DjangoFilterBackend, OrderingFilter, ]
+    ordering_fields = ['id', "create_time", "update_time", ]
+    filter_class = BoundListFilter
+
+    def get_project(self):
+        try:
+            id = self.kwargs.get('pk')
+            return id
+        except:
+            return None
+
+    def get_queryset(self):
+        id = self.get_project()
+        if self.request.user:
+            if id is None:
+                return BoundListModel.objects.filter( is_delete=False)
+            else:
+                return BoundListModel.objects.filter( id=id, is_delete=False)
+        else:
+            return BoundListModel.objects.none()
+
+    def get_serializer_class(self):
+        if self.action in ['list', 'destroy','retrieve']:
+            return BoundListGetSerializer
+        elif self.action in ['create', 'update']:
+            return BoundListPostSerializer
+        else:
+            return self.http_method_not_allowed(request=self.request)
+
+    def create(self, request, *args, **kwargs):
+
+        data = self.request.data
+        # if BoundListModel.objects.filter(code=data['code'], is_delete=False).exists():
+        #     raise APIException({"detail": "Data exists"})
+        # else:
+        data['openid'] = self.request.auth.openid
+        data['bound_date'] =str(timezone.now().strftime('%Y-%m-%d'))
+        order_day=str(timezone.now().strftime('%Y-%m-'))
+        data['bound_month'] =str(timezone.now().strftime('%Y%m'))
+        if data['bound_type'] == 'in':
+            data['bound_status'] = '100'
+        else:
+            data['bound_status'] = '200'
+        
+
+        qs_set = BoundListModel.objects.filter(bound_month=data['bound_month'], bound_code_type=data['bound_code_type'], is_delete=False)
+        print('qs_set是:', len(qs_set))
+        if len(qs_set) > 0:
+            bound_last_code = qs_set.order_by('-id').first().bound_code
+            data['bound_code'] = data['bound_code_type'] +'-'+ order_day + str(int(bound_last_code.split('-')[-1])+1).zfill(4)
+        else:
+            data['bound_code'] = data['bound_code_type'] +'-'+ order_day + '0001'
+
+        serializer = self.get_serializer(data=data)
+        serializer.is_valid(raise_exception=True)
+        serializer.save()
+
+        headers = self.get_success_headers(serializer.data)
+        return Response(serializer.data, status=200, headers=headers)
+    
+    def update(self, request, pk):
+        qs = self.get_object()
+        data = self.request.data
+        serializer = self.get_serializer(qs, data=data)
+        serializer.is_valid(raise_exception=True)
+        serializer.save()
+        headers = self.get_success_headers(serializer.data)
+        return Response(serializer.data, status=200, headers=headers)
+
+
+    def destroy(self, request, pk):
+        qs = self.get_object()
+        if qs.openid != self.request.auth.openid:
+            raise APIException({"detail": "该入库非您所属,禁止删除,您可以进行编辑"})
+        else:
+            qs.is_delete = True
+            qs.save()
+            serializer = self.get_serializer(qs, many=False)
+            headers = self.get_success_headers(serializer.data)
+            return Response(serializer.data, status=200, headers=headers)
+       

+ 3 - 1
data_base/import_data.py

@@ -21,7 +21,9 @@ try:
     csv_file = 'flow.csv'
     print(f"\n[{time.strftime('%H:%M:%S')}] 开始导入文件: {csv_file}")
     
-    with open(csv_file, 'r') as f:
+  
+    with open(csv_file, 'r', encoding='utf-8') as f:
+
         reader = csv.reader(f)
         
         # 读取标题行

BIN
db.sqlite3


BIN
greaterwms/__pycache__/__init__.cpython-38.pyc


BIN
greaterwms/__pycache__/asgi.cpython-38.pyc


BIN
greaterwms/__pycache__/settings.cpython-38.pyc


BIN
greaterwms/__pycache__/urls.cpython-38.pyc


BIN
greaterwms/__pycache__/views.cpython-38.pyc


+ 2 - 1
greaterwms/settings.py

@@ -36,7 +36,8 @@ INSTALLED_APPS = [
     'stock.apps.StockConfig',
     'warehouse.apps.WarehouseConfig',
     'reportcenter.apps.ReportcenterConfig',
-    'asn.apps.AsnConfig',
+    # 'asn.apps.AsnConfig',
+    'bound.apps.BoundConfig',
 
     'throttle.apps.ThrottleConfig',
     'rest_framework',

+ 4 - 1
greaterwms/urls.py

@@ -24,7 +24,10 @@ urlpatterns = [
     path('stock/', include('stock.urls')),
     path('warehouse/', include('warehouse.urls')),
     path('reportcenter/', include('reportcenter.urls')),
-    path('asn/', include('asn.urls')),
+    # path('asn/', include('asn.urls')),
+
+    path('bound/', include('bound.urls')),
+
 
     re_path(r'^favicon\.ico$', views.favicon, name='favicon'),
     re_path('^css/.*$', views.css, name='css'),

ファイルの差分が大きいため隠しています
+ 1844 - 0
logs/error.log


ファイルの差分が大きいため隠しています
+ 2010 - 0
logs/server.log


+ 0 - 97
nginx.conf

@@ -1,97 +0,0 @@
-
-user root;
-worker_processes auto;
-
-events {
-    worker_connections  1024;
-}
-
-http {
-    include         mime.types;
-    default_type    application/octet-stream;
-    sendfile        on;
-    gzip            on;
-    gzip_min_length 1k;
-    gzip_comp_level 4;
-    gzip_types      text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
-    gzip_disable    "MSIE [1-6]\.";
-    gzip_vary       on;
-	proxy_redirect off;
-	proxy_set_header Host $host;
-	proxy_set_header  https $https;
-	proxy_set_header X-Real-IP $remote_addr;
-	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-	client_max_body_size 75M;
-	client_body_buffer_size 256k;
-	client_header_timeout 3m;
-	client_body_timeout 3m;
-	send_timeout 3m;
-	proxy_connect_timeout 300s;
-	proxy_read_timeout 300s;
-	proxy_send_timeout 300s;
-	proxy_buffer_size 64k;
-	proxy_buffers 4 32k;
-	proxy_busy_buffers_size 64k;
-	proxy_temp_file_write_size 64k;
-	proxy_ignore_client_abort on;
-
-	upstream GreaterWMS{
-  server 127.0.0.1:8008;
-}
-	server {
-	listen      80;
-	server_name {{ Domin Name }};
-	rewrite ^(.*)$ https://{{ Domin Name }}$1;
-
-	}
-
-      server {
-	listen      443 ssl;
-
-    server_name  {{ Domin Name }};
-	root /path/to/GreaterWMS;
-	charset utf-8;
-	add_header X-Frame-Options "SAMEORIGIN";
-	add_header X-XSS-Protection "1; mode=block";
-	add_header X-Content-Type-Options "nosniff";
-
-	client_max_body_size 75M;
-
- 	ssl_certificate   /path/to/GreaterWMS.pem;
- 	ssl_certificate_key  /path/to/GreaterWMS.key;
- 	ssl_session_timeout 5m;
- 	ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
- 	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
-	ssl_prefer_server_ciphers on;
-
-    access_log off;
-	error_log  /path/to/GreaterWMS/greaterwms-error.log error;
-
-	 location /websocket/ {
-       proxy_pass http://GreaterWMS/;
-			 proxy_read_timeout 60s;
-       proxy_set_header Host $host;
-       proxy_set_header X-Real_IP $remote_addr;
-       proxy_set_header X-Forwarded-for $remote_addr;
-       proxy_http_version 1.1;
-       proxy_set_header Upgrade $http_upgrade;
-       proxy_set_header Connection 'Upgrade';
-    }
-
-    location / {
-        #root   html;
-        #index  testssl.html index.html index.htm;
-       proxy_redirect off;
-       proxy_set_header Host $host;
-       proxy_set_header X-Real-IP $remote_addr;
-       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-       proxy_pass http://127.0.0.1:8008/;
-    }
-		location /static/ {
-			alias /path/to/GreaterWMS/static_new/;
-		}
-	location /media/{
-		alias /path/to/GreaterWMS/media/;
-	}
-    }
-}

BIN
reportcenter/__pycache__/__init__.cpython-38.pyc


BIN
reportcenter/__pycache__/admin.cpython-38.pyc


BIN
reportcenter/__pycache__/apps.cpython-38.pyc


BIN
reportcenter/__pycache__/files.cpython-38.pyc


BIN
reportcenter/__pycache__/filter.cpython-38.pyc


BIN
reportcenter/__pycache__/models.cpython-38.pyc


BIN
reportcenter/__pycache__/serializers.cpython-38.pyc


BIN
reportcenter/__pycache__/urls.cpython-38.pyc


BIN
reportcenter/__pycache__/views.cpython-38.pyc


BIN
reportcenter/migrations/__pycache__/0001_initial.cpython-38.pyc


BIN
reportcenter/migrations/__pycache__/__init__.cpython-38.pyc


+ 7 - 0
shelflist.sql

@@ -0,0 +1,7 @@
+
+
+
+INSERT INTO `shelflist` VALUES (1, 'W01', '仓库1', 'W01-01-01-01', 'Point', 1, 1, 1, '192.168.18.100', 8080, 'offline', '2025-03-25 00:00:00', '0', '货架部门1', '货架状态1', '商品编码1', '商品名称1', '商品规格1', '商品描述1', 100, '商品单位1', 10.00, '商品批次1', '商品备注1', 10, 0);
+INSERT INTO `shelflist` VALUES (2, 'W01', '仓库1', 'W01-02-01-01', 'CrossPoint', 1, 1, 1, '192.168.18.100', 8080, 'offline', '2025-03-25 00:00:00', '0', '货架部门2', '货架状态2', '商品编码2', '商品名称2', '商品规格2', '商品描述2', 100, '商品单位2', 10.00, '商品批次2', '商品备注2', 10, 0);
+INSERT INTO `shelflist` VALUES (3, 'W01', '仓库1', 'W01-03-01-01', 'Point', 1, 1, 1, '192.168.18.100', 8080, 'offline', '2025-03-25 00:00:00', '0', '货架部门3', '货架状态3', '商品编码3', '商品名称3', '商品规格3', '商品描述3', 100, '商品单位3', 10.00, '商品批次3', '商品备注3', 10, 0);
+INSERT INTO `shelflist` VALUES (4, 'W01', '仓库1', 'W01-04-01-01', 'Ponit', 1, 1, 1, '192.168.18.100', 8080, 'offline', '2025-03-25 00:00:00', '0', '货架部门4', '货架状态4', '商品编码4', '商品名称4', '商品规格4', '商品描述4', 100, '商品单位4', 10.00, '商品批次4', '商品备注4', 10, 0);

BIN
staff/__pycache__/__init__.cpython-38.pyc


BIN
staff/__pycache__/admin.cpython-38.pyc


BIN
staff/__pycache__/apps.cpython-38.pyc


BIN
staff/__pycache__/files.cpython-38.pyc


BIN
staff/__pycache__/filter.cpython-38.pyc


BIN
staff/__pycache__/models.cpython-38.pyc


BIN
staff/__pycache__/serializers.cpython-38.pyc


BIN
staff/__pycache__/urls.cpython-38.pyc


BIN
staff/__pycache__/views.cpython-38.pyc


BIN
staff/migrations/__pycache__/0001_initial.cpython-38.pyc


BIN
staff/migrations/__pycache__/0002_listmodel_is_look.cpython-38.pyc


BIN
staff/migrations/__pycache__/0003_listmodel_appid.cpython-38.pyc


BIN
staff/migrations/__pycache__/0004_alter_listmodel_appid.cpython-38.pyc


BIN
staff/migrations/__pycache__/0005_listmodel_is_edit.cpython-38.pyc


BIN
staff/migrations/__pycache__/__init__.cpython-38.pyc


BIN
stock/__pycache__/__init__.cpython-38.pyc


BIN
stock/__pycache__/admin.cpython-38.pyc


BIN
stock/__pycache__/apps.cpython-38.pyc


BIN
stock/__pycache__/files.cpython-38.pyc


BIN
stock/__pycache__/filter.cpython-38.pyc


BIN
stock/__pycache__/models.cpython-38.pyc


BIN
stock/__pycache__/serializers.cpython-38.pyc


BIN
stock/__pycache__/urls.cpython-38.pyc


BIN
stock/__pycache__/views.cpython-38.pyc


BIN
stock/migrations/__pycache__/0001_initial.cpython-38.pyc


BIN
stock/migrations/__pycache__/__init__.cpython-38.pyc


ファイルの差分が大きいため隠しています
+ 0 - 1
templates/dist/spa/css/3.22b1adf9.css


ファイルの差分が大きいため隠しています
+ 1 - 0
templates/dist/spa/css/3.668a8a6d.css


+ 1 - 0
templates/dist/spa/css/4.a164a49b.css

@@ -0,0 +1 @@
+.q-date__calendar-item--selected[data-v-76685cd4]{transition:all 0.3s ease;background-color:#1976d2!important}.q-date__range[data-v-76685cd4]{background-color:rgba(25,118,210,0.1)}

+ 0 - 1
templates/dist/spa/css/4.d7aabfa2.css

@@ -1 +0,0 @@
-.q-date__calendar-item--selected[data-v-263b2135]{transition:all 0.3s ease;background-color:#1976d2!important}.q-date__range[data-v-263b2135]{background-color:rgba(25,118,210,0.1)}

+ 1 - 0
templates/dist/spa/css/5.eccd2a4b.css

@@ -0,0 +1 @@
+.q-date__calendar-item--selected[data-v-0f20c145]{transition:all 0.3s ease;background-color:#1976d2!important}.q-date__range[data-v-0f20c145]{background-color:rgba(25,118,210,0.1)}

+ 1 - 0
templates/dist/spa/css/6.f721cf95.css

@@ -0,0 +1 @@
+.q-date__calendar-item--selected[data-v-c72a1b14]{transition:all 0.3s ease;background-color:#1976d2!important}.q-date__range[data-v-c72a1b14]{background-color:rgba(25,118,210,0.1)}

+ 1 - 0
templates/dist/spa/css/7.8c912396.css

@@ -0,0 +1 @@
+.q-date__calendar-item--selected[data-v-32740af8]{transition:all 0.3s ease;background-color:#1976d2!important}.q-date__range[data-v-32740af8]{background-color:rgba(25,118,210,0.1)}

templates/dist/spa/css/5.01c6672a.css → templates/dist/spa/css/8.74c09acd.css


BIN
templates/dist/spa/css/vendor.2ac1ba6a.css.gz


ファイルの差分が大きいため隠しています
+ 1 - 1
templates/dist/spa/index.html


templates/dist/spa/js/1.96fff813.js → templates/dist/spa/js/1.66e8190d.js


BIN
templates/dist/spa/js/1.96fff813.js.gz


+ 0 - 0
templates/dist/spa/js/10.6e754992.js


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません