增加获取科室列表的接口
parent
d68ef270d4
commit
b2abcfe463
|
@ -0,0 +1,42 @@
|
|||
package com.health.system.server.controller;
|
||||
|
||||
import com.dtflys.forest.annotation.Get;
|
||||
import com.health.common.core.domain.Result;
|
||||
import com.health.system.common.domain.Department;
|
||||
import com.health.system.server.service.DepartmentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 冯凯
|
||||
* @version 1.0
|
||||
* @description: 科室控制层
|
||||
* @date 2023/11/3 14:08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dept")
|
||||
public class DepartmentController {
|
||||
|
||||
/*
|
||||
注入科室service
|
||||
*/
|
||||
@Autowired
|
||||
private DepartmentService departmentService;
|
||||
|
||||
/**
|
||||
* @description: 获取科室列表
|
||||
* @param: @param
|
||||
* @return: Result<List<Department>>
|
||||
* @author 冯凯
|
||||
* @date: 2023/11/3 14:12
|
||||
*/
|
||||
@GetMapping("/search/deptList")
|
||||
public Result<List<Department>> searchDeptList(){
|
||||
List<Department> departmentList= departmentService.searchDeptList();
|
||||
return Result.success(departmentList);
|
||||
}
|
||||
}
|
|
@ -433,7 +433,6 @@ public class SysUserController extends BaseController
|
|||
* @author 冯凯
|
||||
* @date: 2023/10/29 9:33
|
||||
*/
|
||||
|
||||
@PostMapping("/updSelfInformation")
|
||||
public Result updSelfInformation(@RequestBody SefInformationReq sefInformationReq){
|
||||
Boolean flag=userService.updSelfInformation(sefInformationReq);
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package com.health.system.server.mapper;
|
||||
|
||||
import com.health.system.common.domain.Department;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 冯凯
|
||||
* @version 1.0
|
||||
* @description:科室持久层
|
||||
* @date 2023/11/3 14:10
|
||||
*/
|
||||
@Mapper
|
||||
public interface DepartmentMapper {
|
||||
|
||||
/**
|
||||
* @description: 获取科室列表
|
||||
* @param: @param
|
||||
* @return: Result<List<Department>>
|
||||
* @author 冯凯
|
||||
* @date: 2023/11/3 14:12
|
||||
*/
|
||||
List<Department> searchDeptList();
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.health.system.server.service;
|
||||
|
||||
import com.health.system.common.domain.Department;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 冯凯
|
||||
* @version 1.0
|
||||
* @description:科室业务逻辑层接口
|
||||
* @date 2023/11/3 14:08
|
||||
*/
|
||||
public interface DepartmentService {
|
||||
|
||||
/**
|
||||
* @description: 获取科室列表
|
||||
* @param: @param
|
||||
* @return: Result<List<Department>>
|
||||
* @author 冯凯
|
||||
* @date: 2023/11/3 14:12
|
||||
*/
|
||||
List<Department> searchDeptList();
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.health.system.server.service.impl;
|
||||
|
||||
import com.health.common.redis.service.RedisService;
|
||||
import com.health.system.common.domain.Department;
|
||||
import com.health.system.server.mapper.DepartmentMapper;
|
||||
import com.health.system.server.service.DepartmentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 冯凯
|
||||
* @version 1.0
|
||||
* @description:科室业务逻辑层接口实现类
|
||||
* @date 2023/11/3 14:09
|
||||
*/
|
||||
@Service
|
||||
public class DepartmentServiceImpl implements DepartmentService {
|
||||
|
||||
/*
|
||||
注入科室持久层
|
||||
*/
|
||||
@Autowired
|
||||
private DepartmentMapper departmentMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* @description: 获取科室列表
|
||||
* @param: @param
|
||||
* @return: Result<List<Department>>
|
||||
* @author 冯凯
|
||||
* @date: 2023/11/3 14:12
|
||||
*/
|
||||
@Override
|
||||
public List<Department> searchDeptList() {
|
||||
|
||||
if (redisService.hasKey("deptList")){
|
||||
List<Department> departmentList= redisService.getCacheList("deptList");
|
||||
return departmentList;
|
||||
}
|
||||
List<Department> departmentList=departmentMapper.searchDeptList();
|
||||
return departmentList;
|
||||
}
|
||||
}
|
|
@ -3,9 +3,7 @@ package com.health.system.server.service.impl;
|
|||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.health.common.core.constant.UserConstants;
|
||||
import com.health.common.core.domain.Result;
|
||||
import com.health.common.core.exception.ServiceException;
|
||||
import com.health.common.core.user.CommonBody;
|
||||
import com.health.common.core.utils.SpringUtils;
|
||||
import com.health.common.core.utils.StringUtils;
|
||||
import com.health.common.core.utils.bean.BeanValidators;
|
||||
|
@ -16,20 +14,14 @@ import com.health.system.common.domain.request.SefInformationReq;
|
|||
import com.health.system.server.mapper.*;
|
||||
import com.health.system.server.service.ISysConfigService;
|
||||
import com.health.system.server.service.ISysUserService;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.commons.lang3.RandomUtils;
|
||||
import org.bouncycastle.pqc.math.linearalgebra.RandUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.print.Doc;
|
||||
import javax.validation.Validator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.DepartmentMapper">
|
||||
|
||||
<resultMap id="deptList" type="com.health.system.common.domain.Department">
|
||||
<id column="id" property="departmentId"></id>
|
||||
<result column="name" property="departmentName"></result>
|
||||
</resultMap>
|
||||
<sql id="deptSql">
|
||||
select id,name from tb_moreover
|
||||
</sql>
|
||||
<select id="searchDeptList" resultType="com.health.system.common.domain.Department">
|
||||
<include refid="deptSql"/>
|
||||
where class_id=0
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue