package com.fs.company.controller.store;

import com.fs.common.annotation.Log;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.core.page.TableDataInfo;
import com.fs.common.enums.BusinessType;
import com.fs.common.utils.poi.ExcelUtil;
import com.fs.his.domain.FsFollowTemp;
import com.fs.his.service.IFsFollowTempService;
import com.fs.his.vo.OptionsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 随访模板Controller
 *
 * @author fs
 * @date 2023-07-14
 */
@RestController
@RequestMapping("/store/followTemp")
public class FsFollowTempController extends BaseController
{
    @Autowired
    private IFsFollowTempService fsFollowTempService;

    /**
     * 查询随访模板列表
     */
    @GetMapping("/list")
    public TableDataInfo list(FsFollowTemp fsFollowTemp)
    {
        startPage();
        List<FsFollowTemp> list = fsFollowTempService.selectFsFollowTempList(fsFollowTemp);
        return getDataTable(list);
    }



    /**
     * 获取随访模板详细信息
     */
    @GetMapping(value = "/{tempId}")
    public AjaxResult getInfo(@PathVariable("tempId") Long tempId)
    {
        return AjaxResult.success(fsFollowTempService.selectFsFollowTempByTempId(tempId));
    }



    /**
     * 查询模板名称列表
     */
    @GetMapping("/allList")
    public TableDataInfo getAllList()
    {
        List<OptionsVO> list = fsFollowTempService.selectAllFsFollowTempList();
        return getDataTable(list);
    }
}
