Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
967b349e97
|
@ -14,4 +14,4 @@ class IProductFilterSet(filters.FilterSet):
|
|||
order = filters.NumberFilter(field_name="wproduct__subproduction_plan__production_plan__order")
|
||||
class Meta:
|
||||
model = IProduct
|
||||
fields = ['material', 'warehouse', 'batch', 'order']
|
||||
fields = ['material', 'warehouse', 'batch', 'order', 'is_mtested', 'is_mtestok']
|
|
@ -0,0 +1,28 @@
|
|||
# Generated by Django 3.2.9 on 2021-12-08 06:08
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inm', '0021_fifoitemproduct_iproduct'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='iproduct',
|
||||
name='is_mtested',
|
||||
field=models.BooleanField(default=False, verbose_name='是否军检'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='iproduct',
|
||||
name='is_mtestok',
|
||||
field=models.BooleanField(blank=True, null=True, verbose_name='是否军检合格'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='iproduct',
|
||||
name='remark_mtest',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='军检备注'),
|
||||
),
|
||||
]
|
|
@ -93,6 +93,9 @@ class IProduct(BaseModel):
|
|||
warehouse = models.ForeignKey(WareHouse, on_delete=models.CASCADE, verbose_name='所在仓库')
|
||||
batch = models.CharField('所属批次号', max_length=100, default='')
|
||||
wproduct = models.ForeignKey('wpm.wproduct', on_delete=models.CASCADE, verbose_name='关联的动态产品', db_constraint=False, null=True, blank=True)
|
||||
is_mtested = models.BooleanField('是否军检', default=False)
|
||||
is_mtestok = models.BooleanField('是否军检合格', null=True, blank=True)
|
||||
remark_mtest = models.TextField('军检备注', null=True, blank=True)
|
||||
is_saled = models.BooleanField('是否售出', default=False)
|
||||
|
||||
class FIFOItemProduct(BaseModel):
|
||||
|
|
|
@ -146,4 +146,10 @@ class InmTestRecordCreateSerializer(serializers.ModelSerializer):
|
|||
is_testok = serializers.BooleanField()
|
||||
class Meta:
|
||||
model = TestRecord
|
||||
fields = ['form', 'record_data', 'is_testok', 'fifo_item']
|
||||
fields = ['form', 'record_data', 'is_testok', 'fifo_item']
|
||||
|
||||
|
||||
class IProductMtestSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = IProduct
|
||||
fields = ['remark_mtest', 'is_mtestok']
|
|
@ -1,13 +1,15 @@
|
|||
from django.shortcuts import render
|
||||
from rest_framework import serializers
|
||||
from rest_framework import exceptions
|
||||
from rest_framework.exceptions import APIException
|
||||
from rest_framework.mixins import DestroyModelMixin, ListModelMixin, RetrieveModelMixin
|
||||
from rest_framework.viewsets import GenericViewSet, ModelViewSet
|
||||
from apps.inm.filters import IProductFilterSet, MbFilterSet
|
||||
|
||||
from apps.inm.models import FIFO, FIFOItem, IProduct, MaterialBatch, WareHouse,Inventory
|
||||
from apps.inm.serializers import FIFOItemSerializer, FIFOInPurSerializer, FIFOListSerializer, IProductListSerializer, InmTestRecordCreateSerializer, MaterialBatchQuerySerializer, MaterialBatchSerializer, WareHouseSerializer, WareHouseCreateUpdateSerializer,InventorySerializer
|
||||
from apps.inm.serializers import FIFOItemSerializer, FIFOInPurSerializer, FIFOListSerializer, IProductListSerializer, IProductMtestSerializer, InmTestRecordCreateSerializer, MaterialBatchQuerySerializer, MaterialBatchSerializer, WareHouseSerializer, WareHouseCreateUpdateSerializer,InventorySerializer
|
||||
from apps.inm.signals import update_inm
|
||||
from apps.mtm.models import Material
|
||||
from apps.qm.models import TestRecordItem
|
||||
from apps.system.mixins import CreateUpdateModelAMixin, OptimizationMixin
|
||||
from rest_framework.decorators import action
|
||||
|
@ -172,4 +174,21 @@ class IProductViewSet(ListModelMixin, GenericViewSet):
|
|||
filterset_class = IProductFilterSet
|
||||
search_fields = []
|
||||
ordering_fields = ['create_time']
|
||||
ordering = ['-create_time']
|
||||
ordering = ['-create_time']
|
||||
|
||||
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=IProductMtestSerializer)
|
||||
def mtest(self, request, pk=None):
|
||||
"""
|
||||
军检
|
||||
"""
|
||||
obj = self.get_object()
|
||||
if obj.is_mtested:
|
||||
raise exceptions.APIException('已进行军检')
|
||||
if obj.wproduct:
|
||||
if obj.wproduct.material.type != Material.MA_TYPE_GOOD:
|
||||
raise exceptions.APIException('军检必须是成品')
|
||||
obj.remark_mtest = request.data.get('remark_mtest', None)
|
||||
obj.is_mtested = True
|
||||
obj.is_mtestok = request.data.get('is_mtestok')
|
||||
obj.save()
|
||||
return Response()
|
|
@ -0,0 +1,15 @@
|
|||
from django_filters import rest_framework as filters
|
||||
from apps.mtm.models import TechDoc
|
||||
|
||||
|
||||
|
||||
|
||||
class TechDocFilterset(filters.FilterSet):
|
||||
# operation = filters.NumberFilter(method='filter_operation')
|
||||
operation = filters.CharFilter(field_name="subproduction__subplan_subprod__ow_subplan__operation")
|
||||
class Meta:
|
||||
model = TechDoc
|
||||
fields = ['subproduction', 'operation']
|
||||
|
||||
# def filter_operation(self, queryset, name, value):
|
||||
# return queryset.filter(subproduction__subplan_subprod__ow_subplan__operation=value)
|
|
@ -130,6 +130,20 @@ class RecordFormField(CommonAModel):
|
|||
"""
|
||||
记录字段表
|
||||
"""
|
||||
FIELD_STRING = 'string'
|
||||
FIELD_INT = 'int'
|
||||
FIELD_FLOAT = 'float'
|
||||
FIELD_BOOL = 'boolean'
|
||||
FIELD_DATE = 'date'
|
||||
FIELD_TIME = 'time'
|
||||
FIELD_DATETIME = 'datetime'
|
||||
FIELD_RADIO = 'radio'
|
||||
FIELD_CHECKBOX = 'checkbox'
|
||||
FIELD_SELECT = 'select'
|
||||
FIELD_SELECTS = 'selects'
|
||||
FIELD_TEXTAREA = 'textarea'
|
||||
FIELD_DRAW = 'draw'
|
||||
FIELD_FROMSYSTEM = 'fromsystem'
|
||||
field_type_choices = (
|
||||
('string', '字符串'),
|
||||
('int', '整型'),
|
||||
|
@ -143,7 +157,7 @@ class RecordFormField(CommonAModel):
|
|||
('select', '单选下拉'),
|
||||
('selects', '多选下拉'),
|
||||
('textarea', '文本域'),
|
||||
('draw', '绘图')
|
||||
('draw', '绘图'),
|
||||
)
|
||||
high_rule_choices = (
|
||||
(1, '小于'),
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from django.shortcuts import render
|
||||
from rest_framework.viewsets import ModelViewSet, GenericViewSet
|
||||
from rest_framework.mixins import CreateModelMixin, ListModelMixin, UpdateModelMixin, RetrieveModelMixin, DestroyModelMixin
|
||||
from apps.mtm.filters import TechDocFilterset
|
||||
|
||||
from apps.mtm.models import Material, Process, RecordForm, RecordFormField, Step, SubprodctionMaterial, TechDoc, UsedStep, SubProduction
|
||||
from apps.mtm.serializers import InputMaterialSerializer, InputMaterialUpdateSerializer, MaterialDetailSerializer, MaterialSerializer, MaterialSimpleSerializer, OtherMaterialSerializer, OutputMaterialSerializer, OutputMaterialUpdateSerializer, ProcessSerializer, RecordFormCreateSerializer, RecordFormDetailSerializer, RecordFormFieldCreateSerializer, RecordFormFieldSerializer, RecordFormFieldUpdateSerializer, RecordFormSerializer, RecordFormUpdateSerializer, StepDetailSerializer, StepSerializer, SubProductionSerializer, SubprodctionMaterialListSerializer, TechDocCreateSerializer, TechDocListSerializer, TechDocUpdateSerializer, UsedStepCreateSerializer, UsedStepListSerializer, UsedStepUpdateSerializer
|
||||
|
@ -201,7 +202,7 @@ class TechDocViewSet(OptimizationMixin, CreateUpdateModelAMixin, ModelViewSet):
|
|||
"""
|
||||
perms_map = {'*':'*'}
|
||||
queryset = TechDoc.objects.select_related('file').all()
|
||||
filterset_fields = ['subproduction']
|
||||
filterset_class = TechDocFilterset
|
||||
search_fields = ['name']
|
||||
ordering = ['-id']
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.2.9 on 2021-12-09 08:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pm', '0015_auto_20211122_1556'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='productionplan',
|
||||
name='count_ok',
|
||||
field=models.IntegerField(default=0, verbose_name='合格数'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='productionplan',
|
||||
name='count_real',
|
||||
field=models.IntegerField(default=0, verbose_name='实际产出数'),
|
||||
),
|
||||
]
|
|
@ -18,6 +18,8 @@ class ProductionPlan(CommonAModel):
|
|||
order = models.ForeignKey(Order, verbose_name='关联订单', null=True, blank=True, on_delete=models.SET_NULL)
|
||||
product = models.ForeignKey(Material, verbose_name='生产产品', on_delete=models.CASCADE)
|
||||
count = models.IntegerField('生产数量', default=1)
|
||||
count_real = models.IntegerField('实际产出数', default=0)
|
||||
count_ok = models.IntegerField('合格数', default=0)
|
||||
start_date = models.DateField('计划开工日期')
|
||||
end_date = models.DateField('计划完工日期')
|
||||
is_planed = models.BooleanField('是否已排产', default=False)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.db.models.signals import post_save
|
||||
from django.dispatch import receiver
|
||||
from apps.mtm.models import Material
|
||||
from apps.pm.models import SubProductionPlan, SubProductionProgress
|
||||
|
||||
@receiver(post_save, sender=SubProductionProgress)
|
||||
|
@ -18,6 +19,13 @@ def update_subplan_main(sender, instance, created, **kwargs):
|
|||
subplan.state = SubProductionPlan.SUBPLAN_STATE_DONE
|
||||
elif instance.count_ok < instance.count and instance.count_ok > 0:
|
||||
subplan.state = SubProductionPlan.SUBPLAN_STATE_WORKING
|
||||
subplan.save()
|
||||
subplan.save()
|
||||
if subplan.main_product.type == Material.MA_TYPE_GOOD:
|
||||
# 如果是产品,更新主计划进度
|
||||
plan = subplan.production_plan
|
||||
plan.count_real = subplan.count_real
|
||||
plan.count_ok = subplan.count_ok
|
||||
plan.save()
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.9 on 2021-12-08 06:08
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('qm', '0013_auto_20211202_1620'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='testrecord',
|
||||
name='type',
|
||||
field=models.PositiveSmallIntegerField(choices=[(10, '子工序检验'), (20, '工序检验'), (30, '工序复检'), (36, '夹层检验'), (40, '成品检验')], default=20),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 3.2.9 on 2021-12-09 08:38
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('qm', '0014_alter_testrecord_type'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='testrecord',
|
||||
name='test_record',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='qm.testrecord', verbose_name='关联的检验记录'),
|
||||
),
|
||||
]
|
|
@ -50,11 +50,13 @@ class TestRecord(CommonAModel):
|
|||
TEST_STEP = 10
|
||||
TEST_PROCESS = 20
|
||||
TEST_PROCESS_RE = 30
|
||||
TEST_COMB = 36
|
||||
TEST_FINAL = 40
|
||||
type_choice = (
|
||||
(TEST_STEP, '子工序检验'),
|
||||
(TEST_PROCESS, '工序检验'),
|
||||
(TEST_PROCESS_RE, '工序复检'),
|
||||
(TEST_COMB, '夹层检验'),
|
||||
(TEST_FINAL, '成品检验')
|
||||
)
|
||||
form = models.ForeignKey('mtm.recordform', verbose_name='所用表格', on_delete=models.CASCADE)
|
||||
|
@ -67,7 +69,7 @@ class TestRecord(CommonAModel):
|
|||
step = models.ForeignKey('mtm.step', verbose_name='关联的工序步骤', on_delete=models.CASCADE, null=True, blank=True)
|
||||
subproduction_plan = models.ForeignKey('pm.subproductionplan', verbose_name='关联的生产子计划', on_delete=models.CASCADE, null=True, blank=True)
|
||||
fifo_item = models.ForeignKey('inm.fifoitem', verbose_name='关联的出入库批次', on_delete=models.CASCADE, null=True, blank=True)
|
||||
test_record = models.ForeignKey('self', verbose_name='关联检验记录', on_delete=models.CASCADE, null=True, blank=True)
|
||||
test_record = models.ForeignKey('self', verbose_name='关联的检验记录', on_delete=models.CASCADE, null=True, blank=True)
|
||||
remark = models.TextField('备注', default='')
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# Generated by Django 3.2.9 on 2021-12-08 06:08
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('sam', '0009_alter_saleproduct_is_mtestok'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='saleproduct',
|
||||
name='is_mtested',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='saleproduct',
|
||||
name='is_mtestok',
|
||||
),
|
||||
]
|
|
@ -89,8 +89,6 @@ class SaleProduct(BaseModel):
|
|||
sale = models.ForeignKey(Sale, verbose_name='关联销售记录', on_delete=models.CASCADE)
|
||||
number = models.CharField('物品编号', max_length=50)
|
||||
iproduct = models.ForeignKey('inm.iproduct', verbose_name='关联库存产品', on_delete=models.CASCADE, related_name='sale_iproduct')
|
||||
is_mtested = models.BooleanField('是否军检', default=False)
|
||||
is_mtestok = models.BooleanField('是否军检合格', null=True, blank=True)
|
||||
remark = models.TextField('备注', null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
|
|
|
@ -72,7 +72,7 @@ class SaleCreateSerializer(serializers.ModelSerializer):
|
|||
attrs['customer'] = order.customer
|
||||
attrs['product'] = order.product
|
||||
for i in attrs['iproducts']:
|
||||
if i.material is not attrs['product']:
|
||||
if i.material != attrs['product']:
|
||||
raise exceptions.APIException('产品选取错误')
|
||||
return super().validate(attrs)
|
||||
|
||||
|
@ -101,9 +101,4 @@ class SaleProductCreateSerializer(serializers.ModelSerializer):
|
|||
instance = SaleProduct.objects.create(**validated_data)
|
||||
instance.sale.count = SaleProduct.objects.filter(sale=instance.sale).count()
|
||||
instance.sale.save()
|
||||
return instance
|
||||
|
||||
class SaleProductMtestSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = SaleProduct
|
||||
fields = ['remark', 'is_mtestok']
|
||||
return instance
|
|
@ -5,7 +5,7 @@ from rest_framework.mixins import CreateModelMixin, DestroyModelMixin, ListModel
|
|||
from apps.mtm.models import Material
|
||||
from apps.inm.models import FIFO, FIFOItem, FIFOItemProduct, IProduct, WareHouse
|
||||
from apps.inm.signals import update_inm
|
||||
from apps.sam.serializers import ContractCreateUpdateSerializer, ContractSerializer, CustomerCreateUpdateSerializer, CustomerSerializer, OrderCreateUpdateSerializer, OrderSerializer, SaleCreateSerializer, SaleListSerializer, SaleProductCreateSerializer, SaleProductListSerializer, SaleProductMtestSerializer
|
||||
from apps.sam.serializers import ContractCreateUpdateSerializer, ContractSerializer, CustomerCreateUpdateSerializer, CustomerSerializer, OrderCreateUpdateSerializer, OrderSerializer, SaleCreateSerializer, SaleListSerializer, SaleProductCreateSerializer, SaleProductListSerializer
|
||||
from apps.sam.models import Contract, Customer, Order, Sale, SaleProduct
|
||||
from rest_framework.viewsets import GenericViewSet, ModelViewSet
|
||||
from apps.system.mixins import CreateUpdateCustomMixin
|
||||
|
@ -133,13 +133,13 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C
|
|||
fifo.inout_date = timezone.now()
|
||||
fifo.create_by = request.user
|
||||
fifo.save()
|
||||
# 出库条目
|
||||
spds = SaleProduct.objects.filter(sale=obj)
|
||||
for i in spds:
|
||||
if i.is_mtested and i.is_mtestok:
|
||||
pass
|
||||
else:
|
||||
raise exceptions.APIException('存在未军检产品')
|
||||
# 出库条目 暂时不校验是否军检
|
||||
# spds = SaleProduct.objects.filter(sale=obj)
|
||||
# for i in spds:
|
||||
# if i.is_mtested and i.is_mtestok:
|
||||
# pass
|
||||
# else:
|
||||
# raise exceptions.APIException('存在未军检产品')
|
||||
# 创建出库条目
|
||||
ips = IProduct.objects.filter(sale_iproduct__sale=obj)
|
||||
items = ips.values('warehouse', 'material', 'batch').annotate(total=Count('id'))
|
||||
|
@ -199,21 +199,12 @@ class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, Ge
|
|||
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
obj = self.get_object()
|
||||
obj.sale.count = SaleProduct.objects.filter(sale=obj.sale).count()
|
||||
obj.sale.save()
|
||||
sale = obj.sale
|
||||
if sale.is_audited:
|
||||
raise exceptions.APIException('该销售记录已审核,不可删除产品')
|
||||
sale.count = SaleProduct.objects.filter(sale=obj.sale).count()
|
||||
sale.save()
|
||||
obj.delete()
|
||||
return Response()
|
||||
|
||||
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=SaleProductMtestSerializer)
|
||||
def mtest(self, request, pk=None):
|
||||
"""
|
||||
军检
|
||||
"""
|
||||
obj = self.get_object()
|
||||
if obj.is_mtested:
|
||||
raise exceptions.APIException('已进行军检')
|
||||
obj.remark = request.data.get('remark', None)
|
||||
obj.is_mtested = True
|
||||
obj.is_mtestok = request.data.get('is_mtestok')
|
||||
obj.save()
|
||||
return Response()
|
||||
|
|
@ -210,7 +210,7 @@ class Ticket(CommonBModel):
|
|||
participant = models.JSONField('当前处理人', default=list, blank=True, help_text='可以为空(无处理人的情况,如结束状态)、userid、userid列表')
|
||||
act_state = models.IntegerField('进行状态', default=1, help_text='当前工单的进行状态', choices=act_state_choices)
|
||||
multi_all_person = models.JSONField('全部处理的结果', default=dict, blank=True, help_text='需要当前状态处理人全部处理时实际的处理结果,json格式')
|
||||
|
||||
|
||||
|
||||
# class TicketCustomField(BaseModel):
|
||||
# """
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.9 on 2021-12-08 06:08
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('wpm', '0029_auto_20211202_1630'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='wproduct',
|
||||
name='act_state',
|
||||
field=models.IntegerField(choices=[(6, '待复检'), (8, '操作准备中'), (10, '操作进行中'), (20, '待检验'), (26, '待夹层检验'), (30, '已合格'), (40, '库存中'), (50, '不合格'), (60, '待成品检验')], default=0, verbose_name='进行状态'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,55 @@
|
|||
# Generated by Django 3.2.9 on 2021-12-09 08:38
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('wf', '0017_auto_20211203_1501'),
|
||||
('pm', '0016_auto_20211209_1638'),
|
||||
('mtm', '0041_alter_material_type'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('wpm', '0030_alter_wproduct_act_state'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='operationmaterial',
|
||||
name='count',
|
||||
field=models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='消耗或产出数量'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='operationwproduct',
|
||||
name='subproduction_plan',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ow_subplan', to='pm.subproductionplan', verbose_name='当前子生产计划'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='wproduct',
|
||||
name='act_state',
|
||||
field=models.IntegerField(choices=[(6, '待复检'), (8, '操作准备中'), (10, '操作进行中'), (20, '待检验'), (26, '待夹层检验'), (30, '已合格'), (40, '已入库'), (50, '不合格'), (60, '待成品检验')], default=0, verbose_name='进行状态'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='WprouctTicket',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
|
||||
('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
|
||||
('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
|
||||
('number', models.CharField(blank=True, max_length=50, null=True, verbose_name='物品编号')),
|
||||
('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='wprouctticket_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
|
||||
('material', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mtm.material', verbose_name='所在物料状态')),
|
||||
('step', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mtm.step', verbose_name='所在步骤')),
|
||||
('subproduction_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pm.subproductionplan', verbose_name='所在子生产计划')),
|
||||
('ticket', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wf.ticket', verbose_name='关联工单')),
|
||||
('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='wprouctticket_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
|
||||
('wproduct', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wpm.wproduct', verbose_name='关联产品')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
|
@ -9,7 +9,6 @@ from apps.system.models import CommonADModel, CommonAModel, CommonBModel, Organi
|
|||
from utils.model import SoftModel, BaseModel
|
||||
from simple_history.models import HistoricalRecords
|
||||
from apps.mtm.models import Material, Process, RecordFormField, Step, RecordForm, SubprodctionMaterial
|
||||
from django.core.validators import MinValueValidator
|
||||
from apps.em.models import Equipment
|
||||
class WMaterial(BaseModel):
|
||||
"""
|
||||
|
@ -28,6 +27,7 @@ class WProduct(CommonAModel):
|
|||
WPR_ACT_STATE_DOWAIT = 8
|
||||
WPR_ACT_STATE_DOING = 10
|
||||
WPR_ACT_STATE_TOTEST = 20
|
||||
WPR_ACT_STATE_TOCOMBTEST = 26
|
||||
WPR_ACT_STATE_OK = 30
|
||||
WPR_ACT_STATE_INM = 40
|
||||
WPR_ACT_STATE_NOTOK = 50
|
||||
|
@ -37,8 +37,9 @@ class WProduct(CommonAModel):
|
|||
(WPR_ACT_STATE_DOWAIT, '操作准备中'),
|
||||
(WPR_ACT_STATE_DOING, '操作进行中'),
|
||||
(WPR_ACT_STATE_TOTEST, '待检验'),
|
||||
(WPR_ACT_STATE_TOCOMBTEST, '待夹层检验'),
|
||||
(WPR_ACT_STATE_OK, '已合格'),
|
||||
(WPR_ACT_STATE_INM, '库存中'),
|
||||
(WPR_ACT_STATE_INM, '已入库'),
|
||||
(WPR_ACT_STATE_NOTOK, '不合格'),
|
||||
(WPR_ACT_STATE_TOFINALTEST, '待成品检验')
|
||||
)
|
||||
|
@ -55,6 +56,16 @@ class WProduct(CommonAModel):
|
|||
operation = models.ForeignKey('wpm.operation', verbose_name='关联操作',
|
||||
on_delete=models.SET_NULL, null=True, blank=True, related_name='wp_operation')
|
||||
|
||||
class WprouctTicket(CommonAModel):
|
||||
"""
|
||||
玻璃审批工单
|
||||
"""
|
||||
number = models.CharField('物品编号', null=True, blank=True, max_length=50)
|
||||
wproduct = models.ForeignKey(WProduct, verbose_name='关联产品', on_delete=models.CASCADE)
|
||||
material = models.ForeignKey(Material, verbose_name='所在物料状态', on_delete=models.CASCADE)
|
||||
step = models.ForeignKey(Step, verbose_name='所在步骤', on_delete=models.CASCADE)
|
||||
subproduction_plan = models.ForeignKey(SubProductionPlan, verbose_name='所在子生产计划', on_delete=models.CASCADE)
|
||||
ticket = models.ForeignKey('wf.ticket', verbose_name='关联工单', on_delete=models.CASCADE)
|
||||
|
||||
class Pick(CommonADModel):
|
||||
"""
|
||||
|
@ -97,7 +108,7 @@ class OperationWproduct(BaseModel):
|
|||
wproduct = models.ForeignKey(WProduct, verbose_name='关联半成品', on_delete=models.CASCADE, related_name='ow_wproduct')
|
||||
number = models.CharField('物品编号', null=True, blank=True, max_length=50)
|
||||
material = models.ForeignKey(Material, verbose_name='操作时的物料状态', on_delete=models.CASCADE)
|
||||
subproduction_plan = models.ForeignKey(SubProductionPlan, verbose_name='当前子生产计划', on_delete=models.CASCADE)
|
||||
subproduction_plan = models.ForeignKey(SubProductionPlan, verbose_name='当前子生产计划', on_delete=models.CASCADE, related_name='ow_subplan')
|
||||
|
||||
|
||||
class OperationMaterial(BaseModel):
|
||||
|
@ -108,7 +119,7 @@ class OperationMaterial(BaseModel):
|
|||
operation = models.ForeignKey(Operation, verbose_name='关联的生产操作', on_delete=models.CASCADE)
|
||||
|
||||
material = models.ForeignKey(Material, verbose_name='可能产出的产品', on_delete=models.CASCADE, null=True, blank=True)
|
||||
count = models.IntegerField('消耗或产出数量', validators=[MinValueValidator(0)], null=True, blank=True)
|
||||
count = models.PositiveSmallIntegerField('消耗或产出数量', null=True, blank=True)
|
||||
|
||||
wmaterial = models.ForeignKey(WMaterial, verbose_name='关联的车间物料', on_delete=models.CASCADE, null=True, blank=True)
|
||||
subproduction_progress = models.ForeignKey(SubProductionProgress, verbose_name='关联的生产进度', on_delete=models.CASCADE, null=True, blank=True)
|
||||
|
|
|
@ -292,6 +292,11 @@ class WpmTestRecordCreateSerializer(serializers.ModelSerializer):
|
|||
model = TestRecord
|
||||
fields = ['form', 'record_data', 'is_testok', 'wproduct']
|
||||
|
||||
class WpmTestFormInitSerializer(serializers.Serializer):
|
||||
wproduct = serializers.PrimaryKeyRelatedField(queryset=WProduct.objects.all(), required=True)
|
||||
form = serializers.PrimaryKeyRelatedField(queryset=RecordForm.objects.all(), required=True)
|
||||
|
||||
|
||||
class WplanPutInSerializer(serializers.Serializer):
|
||||
warehouse = serializers.PrimaryKeyRelatedField(queryset=WareHouse.objects.all(), label="仓库ID")
|
||||
remark = serializers.CharField(label="入库备注", required =False)
|
||||
|
@ -335,6 +340,11 @@ class OperationMaterialCreate1Serailizer(serializers.ModelSerializer):
|
|||
class Meta:
|
||||
model = OperationMaterial
|
||||
fields = ['operation', 'wmaterial', 'count']
|
||||
|
||||
def validate(self, attrs):
|
||||
if attrs['count'] <=0:
|
||||
raise exceptions.APIException('消耗物料数量错误')
|
||||
return super().validate(attrs)
|
||||
|
||||
def create(self, validated_data):
|
||||
wmaterial = validated_data['wmaterial']
|
||||
|
@ -343,7 +353,10 @@ class OperationMaterialCreate1Serailizer(serializers.ModelSerializer):
|
|||
validated_data['batch'] = wmaterial.batch
|
||||
validated_data['type'] = SubprodctionMaterial.SUB_MA_TYPE_IN
|
||||
return super().create(validated_data)
|
||||
|
||||
|
||||
class OperationMaterialCreate1ListSerailizer(serializers.ListSerializer):
|
||||
child=OperationMaterialCreate1Serailizer()
|
||||
|
||||
class OperationMaterialCreate2Serailizer(serializers.ModelSerializer):
|
||||
subproduction_progress = serializers.PrimaryKeyRelatedField(required=True, queryset=SubProductionProgress.objects.all())
|
||||
class Meta:
|
||||
|
@ -357,6 +370,9 @@ class OperationMaterialCreate2Serailizer(serializers.ModelSerializer):
|
|||
validated_data['type'] = SubprodctionMaterial.SUB_MA_TYPE_OUT
|
||||
return super().create(validated_data)
|
||||
|
||||
|
||||
class OperationMaterialCreate2ListSerailizer(serializers.ListSerializer):
|
||||
child=OperationMaterialCreate2Serailizer()
|
||||
class OperationMaterialCreate3Serializer(serializers.ModelSerializer):
|
||||
material = serializers.PrimaryKeyRelatedField(required=True, queryset=Material.objects.all())
|
||||
class Meta:
|
||||
|
|
|
@ -12,13 +12,14 @@ from apps.mtm.serializers import RecordFormDetailSerializer, SubprodctionMateria
|
|||
from apps.pm.models import SubProductionPlan, SubProductionProgress
|
||||
from apps.pm.serializers import SubProductionPlanListSerializer, SubProductionPlanUpdateSerializer, SubProductionProgressSerializer
|
||||
from apps.qm.models import TestRecord, TestRecordItem
|
||||
from apps.qm.serializers import TestRecordDetailSerializer
|
||||
|
||||
from apps.system.mixins import CreateUpdateModelAMixin, OptimizationMixin
|
||||
from rest_framework.decorators import action
|
||||
from apps.wpm.filters import WMaterialFilterSet
|
||||
from apps.wpm.models import OperationEquip, OperationWproduct, Pick, PickWproduct, WMaterial, WProduct, Operation, OperationMaterial, OperationRecord, OperationRecordItem
|
||||
|
||||
from apps.wpm.serializers import OperationEquipListSerializer, OperationEquipUpdateSerializer, OperationMaterialCreate1Serailizer, OperationMaterialCreate2Serailizer, OperationMaterialCreate3Serializer, OperationMaterialListSerializer, OperationRecordListSerializer, OperationRecordSubmitSerializer, OperationUpdateSerializer, OperationWproductListSerializer, OperationCreateSerializer, OperationDetailSerializer, OperationListSerializer, PickHalfSerializer, PickHalfsSerializer, PickSerializer, OperationInitSerializer, OperationSubmitSerializer, WMaterialListSerializer, WProductListSerializer, WplanPutInSerializer, WpmTestRecordCreateSerializer, WproductPutInSerializer, WproductPutInsSerializer
|
||||
from apps.wpm.serializers import OperationEquipListSerializer, OperationEquipUpdateSerializer, OperationMaterialCreate1ListSerailizer, OperationMaterialCreate1Serailizer, OperationMaterialCreate2ListSerailizer, OperationMaterialCreate2Serailizer, OperationMaterialCreate3Serializer, OperationMaterialListSerializer, OperationRecordListSerializer, OperationRecordSubmitSerializer, OperationUpdateSerializer, OperationWproductListSerializer, OperationCreateSerializer, OperationDetailSerializer, OperationListSerializer, PickHalfSerializer, PickHalfsSerializer, PickSerializer, OperationInitSerializer, OperationSubmitSerializer, WMaterialListSerializer, WProductListSerializer, WplanPutInSerializer, WpmTestFormInitSerializer, WpmTestRecordCreateSerializer, WproductPutInSerializer, WproductPutInsSerializer
|
||||
from rest_framework.response import Response
|
||||
from django.db import transaction
|
||||
from rest_framework import exceptions, serializers
|
||||
|
@ -183,6 +184,39 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
|||
ordering_fields = ['id']
|
||||
ordering = ['id']
|
||||
|
||||
@action(methods=['post'], detail=False, perms_map={'post':'*'}, serializer_class=WpmTestFormInitSerializer)
|
||||
def test_init(self, request, pk=None):
|
||||
"""
|
||||
检验表单初始化
|
||||
"""
|
||||
serializer = WpmTestFormInitSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
vdata = serializer.validated_data
|
||||
wproduct = vdata['wproduct']
|
||||
form = vdata['form']
|
||||
|
||||
|
||||
# 如果是复检记录, 需要带入原数据
|
||||
if wproduct.act_state == WProduct.WPR_ACT_STATE_TORETEST:
|
||||
# 查找最近一条检验记录
|
||||
trs = TestRecord.objects.filter(wproduct=wproduct, type=TestRecord.TEST_PROCESS).order_by('-id').first()
|
||||
if trs:
|
||||
origin_data = TestRecordDetailSerializer(instance=trs).data
|
||||
data = RecordFormDetailSerializer(instance=form).data
|
||||
data['origin_data'] = origin_data
|
||||
o_dict = {}
|
||||
for i in origin_data['record_data_']:
|
||||
o_dict[i['field_key']] = i['field_value']
|
||||
for i in data['form_fields']:
|
||||
i['origin_value'] = o_dict[i['field_key']]
|
||||
else:
|
||||
raise exceptions.APIException('原工序检验记录不存在')
|
||||
else:
|
||||
data = RecordFormDetailSerializer(instance=form).data
|
||||
|
||||
# 后续加入系统自带数据
|
||||
return Response(data)
|
||||
|
||||
@action(methods=['post'], detail=False, perms_map={'post':'*'}, serializer_class=WpmTestRecordCreateSerializer)
|
||||
@transaction.atomic
|
||||
def test(self, request, pk=None):
|
||||
|
@ -195,7 +229,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
|||
record_data = vdata.pop('record_data')
|
||||
wproduct = vdata['wproduct']
|
||||
if wproduct.act_state not in [WProduct.WPR_ACT_STATE_TOTEST,
|
||||
WProduct.WPR_ACT_STATE_TORETEST, WProduct.WPR_ACT_STATE_TOFINALTEST]:
|
||||
WProduct.WPR_ACT_STATE_TORETEST, WProduct.WPR_ACT_STATE_TOFINALTEST, WProduct.WPR_ACT_STATE_TOCOMBTEST]:
|
||||
raise exceptions.APIException('该产品当前状态不可检验')
|
||||
if 'is_testok' not in vdata:
|
||||
raise exceptions.APIException('未填写检测结论')
|
||||
|
@ -206,6 +240,8 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
|||
savedict['type'] = TestRecord.TEST_PROCESS_RE
|
||||
elif wproduct.act_state == WProduct.WPR_ACT_STATE_TOFINALTEST:
|
||||
savedict['type'] = TestRecord.TEST_FINAL
|
||||
elif wproduct.act_state == WProduct.WPR_ACT_STATE_TOCOMBTEST:
|
||||
savedict['type'] = TestRecord.TEST_COMB
|
||||
obj = serializer.save(**savedict)
|
||||
tris = []
|
||||
for m in record_data: # 保存记录详情
|
||||
|
@ -224,15 +260,14 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
|||
# 如果检测合格, 变更动态产品进行状态
|
||||
|
||||
if obj.is_testok:
|
||||
if wproduct.act_state == WProduct.WPR_ACT_STATE_TORETEST:
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT # 复检
|
||||
elif wproduct.act_state == WProduct.WPR_ACT_STATE_TOTEST and wproduct.material.type == Material.MA_TYPE_GOOD:
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_TOFINALTEST # 成品检验
|
||||
if wproduct.act_state == WProduct.WPR_ACT_STATE_TORETEST: # 复检
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
||||
elif wproduct.act_state == WProduct.WPR_ACT_STATE_TOTEST and wproduct.material.type == Material.MA_TYPE_GOOD: # 成品检验
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_TOFINALTEST
|
||||
else:
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_OK
|
||||
if wproduct.number is None: # 产生半成品编号
|
||||
wproduct.number = 'WP'+ranstr(7)
|
||||
wproduct.save()
|
||||
# 更新子计划状态
|
||||
# 更新子计划主产品数
|
||||
instance = SubProductionProgress.objects.get(subproduction_plan=wproduct.subproduction_plan,
|
||||
|
@ -241,8 +276,9 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
|||
instance.save()
|
||||
else:# 如果不合格
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_NOTOK
|
||||
wproduct.save()
|
||||
|
||||
# 需要走不合格品审理单
|
||||
wproduct.update_by = request.user
|
||||
wproduct.save()
|
||||
return Response()
|
||||
|
||||
@action(methods=['post'], detail=False, perms_map={'post':'*'}, serializer_class=WproductPutInsSerializer)
|
||||
|
@ -267,12 +303,12 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
|||
is_audited=True, auditor=request.user, inout_date=timezone.now(), create_by=request.user, remark=remark)
|
||||
# 创建入库明细
|
||||
for i in wproducts_a:
|
||||
spi = i['subproduction_plan']
|
||||
spi = SubProductionPlan.objects.get(pk=i['subproduction_plan'])
|
||||
fifoitem = FIFOItem()
|
||||
fifoitem.is_tested = True
|
||||
fifoitem.is_testok = True
|
||||
fifoitem.warehouse = warehouse
|
||||
fifoitem.material = i['material']
|
||||
fifoitem.material = Material.objects.get(pk=i['material'])
|
||||
fifoitem.count = i['total']
|
||||
fifoitem.batch = spi.number
|
||||
fifoitem.fifo = fifo
|
||||
|
@ -292,7 +328,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
|||
FIFOItemProduct.objects.bulk_create(ips)
|
||||
# 更新库存并修改半成品进行状态
|
||||
update_inm(fifo)
|
||||
wproducts.update(act_state=WProduct.WPR_ACT_STATE_INM, warehouse=warehouse, update_by=request.user)
|
||||
wproducts.update(act_state=WProduct.WPR_ACT_STATE_INM, warehouse=warehouse, update_by=request.user, update_time=timezone.now())
|
||||
return Response()
|
||||
|
||||
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=WproductPutInSerializer)
|
||||
|
@ -486,6 +522,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
|||
instance.count_real = instance.count_real + 1 # 这个地方可能会有问题,不够严谨
|
||||
instance.save()
|
||||
wp.operation = None
|
||||
wp.update_by = request.user
|
||||
wp.save()
|
||||
elif step.type == Step.STEP_TYPE_DIV:
|
||||
# 更新物料产出情况
|
||||
|
@ -498,25 +535,31 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
|||
for x in range(i.count):
|
||||
WProduct.objects.create(**wpr)
|
||||
elif step.type == Step.STEP_TYPE_COMB:
|
||||
if i.subproduction_progress.is_main:
|
||||
newstep, hasNext = WpmServies.get_next_step(i.subproduction_plan, step)
|
||||
oms_w = OperationMaterial.objects.filter(operation=op, type=SubprodctionMaterial.SUB_MA_TYPE_OUT,
|
||||
subproduction_progress__ismain=True)
|
||||
if len(oms_w) == 1:
|
||||
oms_w = oms_w[0]
|
||||
# 校验单片数量是否正确, 暂时未写
|
||||
newstep, hasNext = WpmServies.get_next_step(oms_w.subproduction_plan, step)
|
||||
wproduct = WProduct()
|
||||
wproduct.material = i.material
|
||||
wproduct.material = oms_w.material
|
||||
wproduct.step = newstep
|
||||
wproduct.subproduction_plan = i.subproduction_plan
|
||||
wproduct.subproduction_plan = oms_w.subproduction_plan
|
||||
if hasNext:
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
||||
else:
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
||||
# 更新子计划进度
|
||||
instance = SubProductionProgress.objects.get(subproduction_plan=i.subproduction_plan,
|
||||
is_main=True, type=SubprodctionMaterial.SUB_MA_TYPE_OUT)
|
||||
instance = oms_w.subproduction_progress
|
||||
instance.count_real = instance.count_real + 1 # 这个地方可能会有问题,不够严谨
|
||||
instance.save()
|
||||
wproduct.create_by = request.user
|
||||
wproduct.save()
|
||||
# 隐藏原半成品
|
||||
wps = WProduct.objects.filter(ow_wproduct__operation = op)
|
||||
wps.update(is_hidden=True, child=wproduct)
|
||||
wps.update(is_hidden=True, child=wproduct, update_by=request.user, update_time=timezone.now())
|
||||
else:
|
||||
raise exceptions.APIException('产出物料错误')
|
||||
op.is_submited = True
|
||||
op.save()
|
||||
return Response()
|
||||
|
@ -594,6 +637,16 @@ class OperationRecordViewSet(ListModelMixin, DestroyModelMixin, GenericViewSet):
|
|||
instance.delete()
|
||||
return Response()
|
||||
|
||||
@action(methods=['get'], detail=True, perms_map={'get':'*'})
|
||||
def init(self, request, pk=None):
|
||||
'''
|
||||
表格初始化
|
||||
'''
|
||||
obj = self.get_object()
|
||||
data = RecordFormDetailSerializer(instance=obj.form).data
|
||||
# 后续加入系统带入数据
|
||||
return Response(data)
|
||||
|
||||
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=OperationRecordSubmitSerializer)
|
||||
def submit(self, request, pk=None):
|
||||
serializer = OperationRecordSubmitSerializer(data=request.data, context={'request':self.request})
|
||||
|
@ -632,7 +685,18 @@ class OperationMaterialInputViewSet(ListModelMixin, CreateModelMixin, DestroyMod
|
|||
if self.action == 'create':
|
||||
return OperationMaterialCreate1Serailizer
|
||||
return super().get_serializer_class()
|
||||
|
||||
|
||||
@action(methods=['post'], detail=False, perms_map={'post':'*'}, serializer_class=OperationMaterialCreate1ListSerailizer)
|
||||
def creates(self, request, pk=None):
|
||||
"""
|
||||
批量创建消耗物料
|
||||
"""
|
||||
serializer = OperationMaterialCreate1ListSerailizer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
serializer.save()
|
||||
return Response()
|
||||
|
||||
|
||||
@transaction.atomic()
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
instance = self.get_object()
|
||||
|
@ -656,7 +720,17 @@ class OperationMaterialOutputViewSet(ListModelMixin, CreateModelMixin, DestroyMo
|
|||
if self.action == 'create':
|
||||
return OperationMaterialCreate2Serailizer
|
||||
return super().get_serializer_class()
|
||||
|
||||
|
||||
@action(methods=['post'], detail=False, perms_map={'post':'*'}, serializer_class=OperationMaterialCreate2ListSerailizer)
|
||||
def creates(self, request, pk=None):
|
||||
"""
|
||||
批量创建产出物料
|
||||
"""
|
||||
serializer = OperationMaterialCreate2ListSerailizer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
serializer.save()
|
||||
return Response()
|
||||
|
||||
@transaction.atomic()
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
instance = self.get_object()
|
||||
|
|
|
@ -62,7 +62,7 @@ class UpdateDevelop(APIView):
|
|||
import os
|
||||
# 更新后端
|
||||
os.chdir('/home/hberp')
|
||||
ret = os.popen('git pull https://caoqianming%40ctc.ac.cn:9093qqww@e.coding.net/ctcdevteam/hberp/hberp.git develop')
|
||||
ret = os.popen('git pull https://caoqianming%40foxmail.com:9093qqww@e.coding.net/ctcdevteam/hberp/hberp.git develop')
|
||||
# 打包前端
|
||||
# os.chdir('/home/hberp/hb_client')
|
||||
# os.system('npm run build:prod')
|
||||
|
|
Loading…
Reference in New Issue