feat: 修改光芯OA审批的BUG与新增导出功能
This commit is contained in:
parent
c5e545f5e5
commit
6d43b412b7
|
|
@ -388,6 +388,8 @@ class TransferSerializer(CustomModelSerializer):
|
||||||
belong_dept_name = serializers.CharField(source='employee.belong_dept.name', read_only=True)
|
belong_dept_name = serializers.CharField(source='employee.belong_dept.name', read_only=True)
|
||||||
new_post_name = serializers.CharField(source="new_post.name", read_only=True)
|
new_post_name = serializers.CharField(source="new_post.name", read_only=True)
|
||||||
original_post_name = serializers.CharField(source="original_post.name", read_only=True)
|
original_post_name = serializers.CharField(source="original_post.name", read_only=True)
|
||||||
|
new_dept_name = serializers.CharField(source="new_dept.name", read_only=True)
|
||||||
|
original_dept_name = serializers.CharField(source="original_dept.name", read_only=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
model = EmployeeTransfer
|
model = EmployeeTransfer
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('ofm', '0005_alter_vehicleuse_end_km'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='publicity',
|
||||||
|
name='final_file',
|
||||||
|
field=models.CharField(blank=True, max_length=200, null=True, verbose_name='终版文件路径'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('ofm', '0006_publicity_final_file'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='lendingseal',
|
||||||
|
name='final_file',
|
||||||
|
field=models.CharField(blank=True, max_length=200, null=True, verbose_name='终版文件路径'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -101,6 +101,7 @@ class LendingSeal(CommonBDModel):
|
||||||
return_date = models.DateField('拟归还日期', blank=True, null=True)
|
return_date = models.DateField('拟归还日期', blank=True, null=True)
|
||||||
actual_return_date = models.DateField('实际归还日期', blank=True, null=True)
|
actual_return_date = models.DateField('实际归还日期', blank=True, null=True)
|
||||||
reason = models.CharField('借用理由', max_length=100, blank=True, null=True)
|
reason = models.CharField('借用理由', max_length=100, blank=True, null=True)
|
||||||
|
final_file = models.CharField('终版文件路径', max_length=200, null=True, blank=True)
|
||||||
ticket = models.ForeignKey('wf.ticket', verbose_name='关联工单',
|
ticket = models.ForeignKey('wf.ticket', verbose_name='关联工单',
|
||||||
on_delete=models.SET_NULL, related_name='seal_ticket', null=True, blank=True, db_constraint=False)
|
on_delete=models.SET_NULL, related_name='seal_ticket', null=True, blank=True, db_constraint=False)
|
||||||
note = models.TextField('备注', null=True, blank=True)
|
note = models.TextField('备注', null=True, blank=True)
|
||||||
|
|
@ -151,6 +152,7 @@ class Publicity(CommonBDModel):
|
||||||
secret_period = models.CharField('秘密期限', max_length=50, blank=True, null=True)
|
secret_period = models.CharField('秘密期限', max_length=50, blank=True, null=True)
|
||||||
dept_opinion_review = models.CharField('部门审查意见', max_length=100, blank=True, null=True)
|
dept_opinion_review = models.CharField('部门审查意见', max_length=100, blank=True, null=True)
|
||||||
publicity_opinion = models.CharField('宣传报道意见', max_length=100, blank=True, null=True)
|
publicity_opinion = models.CharField('宣传报道意见', max_length=100, blank=True, null=True)
|
||||||
|
final_file = models.CharField('终版文件路径', max_length=200, null=True, blank=True)
|
||||||
ticket = models.ForeignKey('wf.ticket', verbose_name='关联工单',
|
ticket = models.ForeignKey('wf.ticket', verbose_name='关联工单',
|
||||||
on_delete=models.SET_NULL, related_name='publicity_ticket', null=True, blank=True, db_constraint=False)
|
on_delete=models.SET_NULL, related_name='publicity_ticket', null=True, blank=True, db_constraint=False)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -464,6 +464,30 @@ class WfService(object):
|
||||||
|
|
||||||
cls.task_ticket(ticket=ticket)
|
cls.task_ticket(ticket=ticket)
|
||||||
|
|
||||||
|
# 自动跳过连续相同审批人:如果下一个节点的处理人与当前处理人相同,自动执行同意操作
|
||||||
|
if (handler is not None
|
||||||
|
and destination_state.type not in (State.STATE_TYPE_START, State.STATE_TYPE_END)
|
||||||
|
and transition.attribute_type == Transition.TRANSITION_ATTRIBUTE_TYPE_ACCEPT
|
||||||
|
and destination_participant_type == State.PARTICIPANT_TYPE_PERSONAL
|
||||||
|
and str(destination_participant) == str(handler.id)):
|
||||||
|
# 查找下一个状态的"同意"流转
|
||||||
|
next_transition = Transition.objects.filter(
|
||||||
|
is_deleted=False,
|
||||||
|
source_state=destination_state,
|
||||||
|
attribute_type=Transition.TRANSITION_ATTRIBUTE_TYPE_ACCEPT
|
||||||
|
).first()
|
||||||
|
if next_transition:
|
||||||
|
import logging
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
logger.info(f'工单{ticket.sn}: 连续节点审批人相同({handler.username}),自动跳过节点[{destination_state.name}]')
|
||||||
|
ticket = cls.handle_ticket(
|
||||||
|
ticket=ticket,
|
||||||
|
transition=next_transition,
|
||||||
|
new_ticket_data=ticket.ticket_data,
|
||||||
|
handler=handler,
|
||||||
|
suggestion='(系统自动审批:与上一节点审批人相同)',
|
||||||
|
)
|
||||||
|
|
||||||
return ticket
|
return ticket
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue