class FormsServiceImpl extends ServiceImpl<OaFormsMapper, OaForms> implements FormsService {

    @Lazy
    @Autowired
    private ProcessDefinitionService processDefinitionService;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateById(OaForms entity) {
        entity.setIsStop(entity.getGroupId()==-1);
        //需要同时修改对应的流程定义的锁定状态和分组
        OaProcessDefinition lastVersionByFromId = processDefinitionService.getLastVersionByFromId(entity.getFormId());
        lastVersionByFromId.setIsStop(entity.getIsStop());
        lastVersionByFromId.setGroupId(entity.getGroupId());
        processDefinitionService.updateById(lastVersionByFromId);
        return super.updateById(entity);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createForm(OaForms form) {
        Date now = new Date();
        form.setSort(0);
        form.setIsStop(false);
        form.setCreated(now);
        form.setUpdated(now);
        super.save(form);//保存表单
        processDefinitionService.deploy(form);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateFormDetail(OaForms forms) {
        processDefinitionService.deploy(forms);
        //不更新的字段设为null
        forms.setSort(null);
        forms.setIsStop(null);
        forms.setUpdated(new Date());
        super.updateById(forms);
    }

    @Override
    public List<OaForms> listByGroupId(Long groupId, String keywords) {
        QueryWrapper<OaForms> queryWrapper = new QueryWrapper<>(OaForms.builder()
                .groupId(groupId)
                .build()).orderByAsc("sort");
        if(StringUtils.isNotEmpty(keywords)) {
            queryWrapper.lambda().like(OaForms::getFormName, keywords);
        }
        return super.list(queryWrapper);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void formsSort(List<Long> formIds) {<FILL_FUNCTION_BODY>}

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean removeById(Serializable id) {
        //级联删除流程定义
        processDefinitionService.removeByFormId((Long) id);
        return super.removeById(id);
    }
}

        List<OaForms> updateList = new ArrayList<>();
        for (int i1 = 0; i1 < formIds.size(); i1++) {
            updateList.add(
                    OaForms.builder()
                            .formId(formIds.get(i1))
                            .sort(i1)
                            .build()
            );
        }
        super.updateBatchById(updateList);
    
<no_super_class>