| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.extra.pinyin.PinyinUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ltkj.common.core.domain.entity.SysDept; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.framework.web.domain.server.Sys; |
| | | import com.ltkj.hosp.service.IDictOrgService; |
| | | import com.ltkj.system.service.ISysDeptService; |
| | | import io.swagger.annotations.Api; |
| | | 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; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ltkj.common.annotation.Log; |
| | | import com.ltkj.common.core.controller.BaseController; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/hosp/hosp") |
| | | @Api(tags = "分院管理模块接口") |
| | | @Api(tags = "PC端 所属医院管理模块接口") |
| | | public class DictHospController extends BaseController { |
| | | @Resource |
| | | private IDictHospService dictHospService; |
| | | @Resource |
| | | private IDictOrgService orgService; |
| | | @Resource |
| | | private ISysDeptService deptService; |
| | | |
| | | @GetMapping("/getDeptListByDictHospId") |
| | | @ApiOperation(value = "跟医院查询对应的部门科室") |
| | | public AjaxResult getDeptListByDictHospId(@RequestParam String id ) { |
| | | List<SysDept> list = deptService.list(new LambdaQueryWrapper<SysDept>().eq(SysDept::getHospId,id)); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询院区信息列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:hosp:list')") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:hosp:list')") |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "查询院区信息列表") |
| | | public TableDataInfo list(DictHosp dictHosp) { |
| | |
| | | /** |
| | | * 导出院区信息列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:hosp:export')") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:hosp:export')") |
| | | @Log(title = "院区信息", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation(value = "导出院区信息列表") |
| | |
| | | /** |
| | | * 获取院区信息详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:hosp:query')") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:hosp:query')") |
| | | @GetMapping(value = "/{hospAreaId}") |
| | | @ApiOperation(value = "获取院区信息详细信息") |
| | | public AjaxResult getInfo(@PathVariable("hospAreaId") String hospAreaId) { |
| | |
| | | /** |
| | | * 新增院区信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:hosp:add')") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:hosp:add')") |
| | | @Log(title = "院区信息", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @ApiOperation(value = "新增院区信息") |
| | | public AjaxResult add(@RequestBody DictHosp dictHosp) { |
| | | dictHosp.setHospName(orgService.getById(dictHosp.getHospid()).getOrgCnName()); |
| | | if(null !=dictHosp.getHospid() ){ |
| | | dictHosp.setHospName(orgService.getById(dictHosp.getHospid()).getOrgCnName()); |
| | | } |
| | | dictHosp.setWbm(MatchUtils.toWubi(dictHosp.getHospAreaName())); |
| | | dictHosp.setSpell(PinyinUtil.getFirstLetter(dictHosp.getHospAreaName(),"")); |
| | | return toAjax(dictHospService.save(dictHosp)); |
| | | } |
| | | |
| | | /** |
| | | * 修改院区信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:hosp:edit')") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:hosp:edit')") |
| | | @Log(title = "院区信息", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @ApiOperation(value = "修改院区信息") |
| | |
| | | /** |
| | | * 删除院区信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:hosp:remove')") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:hosp:remove')") |
| | | @Log(title = "院区信息", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{hospAreaIds}") |
| | | @ApiOperation(value = "删除院区信息") |