liusheng
2024-09-18 907641e56c2085aaa81f267946dc3e3e9fca73e7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java
@@ -1,7 +1,14 @@
package com.smartor.controller;
package com.ruoyi.web.controller.smartor;
import java.lang.reflect.Array;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.smartor.domain.PatMedReq;
import com.smartor.domain.PatMedRes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -23,37 +30,53 @@
/**
 * 患者门诊记录Controller
 *
 *
 * @author smartor
 * @date 2023-03-04
 */
@RestController
@RequestMapping("/smartor/patouthosp")
public class PatMedOuthospController extends BaseController
{
@Api(description = "患者门诊记录")
public class PatMedOuthospController extends BaseController {
    @Autowired
    private IPatMedOuthospService patMedOuthospService;
    /**
     * 查询患者门诊记录列表
     */
    @PreAuthorize("@ss.hasPermi('smartor:patouthosp:list')")
    @GetMapping("/list")
    public TableDataInfo list(PatMedOuthosp patMedOuthosp)
    {
    //@PreAuthorize("@ss.hasPermi('smartor:patouthosp:list')")
    @PostMapping("/selectPatMedOuthospList")
    @ApiOperation("查询患者门诊记录列表")
    public TableDataInfo selectPatMedOuthosplist(@RequestBody PatMedOuthosp patMedOuthosp) {
        startPage();
        List<PatMedOuthosp> list = patMedOuthospService.selectPatMedOuthospList(patMedOuthosp);
        return getDataTable(list);
    }
    /**
     * 查询患者门诊记录列表
     */
    @PostMapping("/selectPatMedOuthospCount")
    @ApiOperation("查询门诊看病人次和人数")
    public AjaxResult selectPatMedOuthospCount(@RequestBody PatMedReq patMedReq) {
        PatMedRes patMedRes = patMedOuthospService.selectPatMedOuthospCount(patMedReq);
        return success(patMedRes);
    }
    @PostMapping("/getDeptCodeByPatId")
    @ApiOperation("查询部门编码通过userId")
    public AjaxResult getDeptCodeByPatId(@RequestBody PatMedOuthosp patMedOuthosp) {
        return success(patMedOuthospService.getDeptCodeByPatId(patMedOuthosp));
    }
    /**
     * 导出患者门诊记录列表
     */
    @PreAuthorize("@ss.hasPermi('smartor:patouthosp:export')")
    //@PreAuthorize("@ss.hasPermi('smartor:patouthosp:export')")
    @Log(title = "患者门诊记录", businessType = BusinessType.EXPORT)
    @ApiOperation("患者门诊记录")
    @PostMapping("/export")
    public void export(HttpServletResponse response, PatMedOuthosp patMedOuthosp)
    {
    public void export(HttpServletResponse response, PatMedOuthosp patMedOuthosp) {
        List<PatMedOuthosp> list = patMedOuthospService.selectPatMedOuthospList(patMedOuthosp);
        ExcelUtil<PatMedOuthosp> util = new ExcelUtil<PatMedOuthosp>(PatMedOuthosp.class);
        util.exportExcel(response, list, "患者门诊记录数据");
@@ -62,43 +85,45 @@
    /**
     * 获取患者门诊记录详细信息
     */
    @PreAuthorize("@ss.hasPermi('smartor:patouthosp:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
    @ApiOperation("获取患者门诊记录详细信息")
    @ApiImplicitParam(name = "getInfo", value = "主键ID", dataType = "long", dataTypeClass = Long.class)
    //@PreAuthorize("@ss.hasPermi('smartor:patouthosp:query')")
    @GetMapping(value = "getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(patMedOuthospService.selectPatMedOuthospById(id));
    }
    /**
     * 新增患者门诊记录
     */
    @PreAuthorize("@ss.hasPermi('smartor:patouthosp:add')")
    @ApiOperation("新增患者门诊记录")
    //@PreAuthorize("@ss.hasPermi('smartor:patouthosp:add')")
    @Log(title = "患者门诊记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody PatMedOuthosp patMedOuthosp)
    {
    @PostMapping("/add")
    public AjaxResult add(@RequestBody PatMedOuthosp patMedOuthosp) {
        return toAjax(patMedOuthospService.insertPatMedOuthosp(patMedOuthosp));
    }
    /**
     * 修改患者门诊记录
     */
    @PreAuthorize("@ss.hasPermi('smartor:patouthosp:edit')")
    @ApiOperation("修改患者门诊记录")
    //@PreAuthorize("@ss.hasPermi('smartor:patouthosp:edit')")
    @Log(title = "患者门诊记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody PatMedOuthosp patMedOuthosp)
    {
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody PatMedOuthosp patMedOuthosp) {
        return toAjax(patMedOuthospService.updatePatMedOuthosp(patMedOuthosp));
    }
    /**
     * 删除患者门诊记录
     */
    @PreAuthorize("@ss.hasPermi('smartor:patouthosp:remove')")
    @ApiOperation("删除患者门诊记录")
    //@PreAuthorize("@ss.hasPermi('smartor:patouthosp:remove')")
    @ApiImplicitParam(name = "remove", value = "主键ID", dataType = "long", dataTypeClass = Array.class)
    @Log(title = "患者门诊记录", businessType = BusinessType.DELETE)
   @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(patMedOuthospService.deletePatMedOuthospByIds(ids));
    }
}