| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询院区信息列表 |
| | |
| | | @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)); |
| | | } |
| | | |