增加获取科室列表的接口

master
冯凯 2023-11-03 14:45:16 +08:00
parent d68ef270d4
commit b2abcfe463
7 changed files with 155 additions and 9 deletions

View File

@ -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);
}
}

View File

@ -433,7 +433,6 @@ public class SysUserController extends BaseController
* @author * @author
* @date: 2023/10/29 9:33 * @date: 2023/10/29 9:33
*/ */
@PostMapping("/updSelfInformation") @PostMapping("/updSelfInformation")
public Result updSelfInformation(@RequestBody SefInformationReq sefInformationReq){ public Result updSelfInformation(@RequestBody SefInformationReq sefInformationReq){
Boolean flag=userService.updSelfInformation(sefInformationReq); Boolean flag=userService.updSelfInformation(sefInformationReq);

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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;
}
}

View File

@ -3,9 +3,7 @@ package com.health.system.server.service.impl;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import com.health.common.core.constant.UserConstants; 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.exception.ServiceException;
import com.health.common.core.user.CommonBody;
import com.health.common.core.utils.SpringUtils; import com.health.common.core.utils.SpringUtils;
import com.health.common.core.utils.StringUtils; import com.health.common.core.utils.StringUtils;
import com.health.common.core.utils.bean.BeanValidators; 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.mapper.*;
import com.health.system.server.service.ISysConfigService; import com.health.system.server.service.ISysConfigService;
import com.health.system.server.service.ISysUserService; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.print.Doc;
import javax.validation.Validator; import javax.validation.Validator;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -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>