| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.domain.BaseOrganization; |
| | | import com.ruoyi.project.service.IBaseOrganizationService; |
| | | import com.ruoyi.web.controller.common.OnlyValueCommon; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | /** |
| | | * 机构管理Controller |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-11-05 |
| | | */ |
| | | @Api("机构信息管理") |
| | | @RestController |
| | | @RequestMapping("/project/organization") |
| | | public class BaseOrganizationController extends BaseController |
| | | { |
| | | public class BaseOrganizationController extends BaseController { |
| | | @Autowired |
| | | private IBaseOrganizationService baseOrganizationService; |
| | | |
| | | @Autowired |
| | | private OnlyValueCommon onlyValueCommon; |
| | | |
| | | /** |
| | | * 查询机构管理列表 |
| | |
| | | @ApiOperation("获取机构列表") |
| | | //@PreAuthorize("@ss.hasPermi('project:organization:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(BaseOrganization baseOrganization) |
| | | { |
| | | public TableDataInfo list(BaseOrganization baseOrganization) { |
| | | startPage(); |
| | | List<BaseOrganization> list = baseOrganizationService.queryList(baseOrganization); |
| | | return getDataTable(list); |
| | |
| | | //@PreAuthorize("@ss.hasPermi('project:organization:export')") |
| | | @Log(title = "机构管理", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(BaseOrganization baseOrganization) |
| | | { |
| | | public AjaxResult export(BaseOrganization baseOrganization) { |
| | | List<BaseOrganization> list = baseOrganizationService.queryList(baseOrganization); |
| | | ExcelUtil<BaseOrganization> util = new ExcelUtil<BaseOrganization>(BaseOrganization.class); |
| | | return util.exportExcel(list, "机构管理数据"); |
| | |
| | | @ApiOperation("通过机构id获取机构信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:organization:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(baseOrganizationService.getById(id)); |
| | | } |
| | | |
| | |
| | | @Log(title = "机构管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody BaseOrganization baseOrganization) |
| | | { |
| | | public AjaxResult add(@RequestBody BaseOrganization baseOrganization) { |
| | | String organization = onlyValueCommon.addOnlyValue("organization"); |
| | | //"0"+地市编码+医院类型+序号 |
| | | baseOrganization.setOrganizationid("0" + baseOrganization.getRegionallevel() + baseOrganization.getHospitalnature() + organization); |
| | | return toAjax(baseOrganizationService.save(baseOrganization)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("修改机构信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:organization:edit')") |
| | | @Log(title = "机构管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody BaseOrganization baseOrganization) |
| | | { |
| | | @PostMapping("/edit") |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody BaseOrganization baseOrganization) { |
| | | return toAjax(baseOrganizationService.updateById(baseOrganization)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("删除机构信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:organization:remove')") |
| | | @Log(title = "机构管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return toAjax(baseOrganizationService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |