class FormGroupServiceImpl extends ServiceImpl<OaFormGroupsMapper, OaFormGroups> implements FormGroupService {

    @Autowired
    private FormsService formsService;

    @Override
    public List<OaFormGroups> getFormGroups(OaFormGroups formGroupVo) {
        List<OaFormGroups> voList = this.getFormGroupList();
        //循环添加组内的表单
        voList.forEach(vo -> {
            //添加组内的流程列表
            List<OaForms> oaForms = formsService.listByGroupId(vo.getGroupId(), formGroupVo.getKeywords());
            vo.setItems(oaForms);
        });
        return voList;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void formGroupsSort(List<Long> groups) {
        List<OaFormGroups> updateList = new ArrayList<>();
        for (int i1 = 0; i1 < groups.size(); i1++) {
            updateList.add(
                OaFormGroups.builder()
                    .groupId(groups.get(i1))
                    .sort(i1)
                    .build()
            );
        }
        super.updateBatchById(updateList);
        return;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateFormGroupName(Long id, String name) {
        super.updateById(OaFormGroups.builder().groupId(id).groupName(name).build());
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createFormGroup(String name) {
        super.save(OaFormGroups.builder().sort(1).groupName(name).updated(new Date()).build());
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteFormGroup(Long id) {
        super.removeById(id);
    }

    @Override
    public List<OaFormGroups> getFormGroupList() {<FILL_FUNCTION_BODY>}
}

        QueryWrapper<OaFormGroups> query = new QueryWrapper<OaFormGroups>()
                .orderByAsc("sort");
        List<OaFormGroups> list = super.list(query);
        //结尾添加两个固定分组
        list.add(OaFormGroups.builder()
                .groupId(0L)
                .groupName("其他")
                .sort(999)
                .updated(new Date())
                .build());
        list.add(OaFormGroups.builder()
                .groupId(-1L)
                .groupName("已停用")
                .sort(9999)
                .updated(new Date())
                .build());
        return list;
    
<no_super_class>