Merge branch 'youxilong_2.26_院后第一增量' of http://192.168.16.64:3000/jihan/PostDischargePatientManage into youxilong_2.26_院后第一增量

This commit is contained in:
youxilong 2024-03-05 18:04:25 +08:00
commit 32911dfa2d
7 changed files with 193 additions and 8 deletions

View File

@ -224,4 +224,22 @@ public class SysUserController extends BaseController {
List<AgencyNameVO> list = userService.selectUserBelongAgency(userName);
return getDataTable(list);
}
/**
* 剩余科室查询
*/
@GetMapping("/selectUserDepartment")
public TableDataInfo selectUserDepartment(String userName, String departmentName) {
return userService.selectUserDepartment(userName, departmentName);
}
/**
* 所属科室查询
*/
@GetMapping("/getBelongDepartment")
public TableDataInfo getBelongDepartment(String userName) {
startPage();
List<AgencyNameVO> list = userService.getBelongDepartment(userName);
return getDataTable(list);
}
}

View File

@ -144,6 +144,11 @@ public class SysUser extends BaseEntity {
*/
private Long agencyId;
/**
* 机构id
*/
private Long departmentId;
public SysUser() {
}
@ -168,6 +173,14 @@ public class SysUser extends BaseEntity {
this.agencyId = agencyId;
}
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public boolean isAdmin() {
return isAdmin(this.userId);
}

View File

@ -30,4 +30,24 @@ public class AgencyNameVO {
* 机构数量
*/
private Integer agencyNum;
/**
* 主键id
*/
private Long departmentId;
/**
* 机构名称
*/
private String departmentName;
/**
* 机构代码
*/
private String departmentCode;
/**
* 机构数量
*/
private Integer departmentNum;
}

View File

@ -126,7 +126,38 @@ public interface SysUserMapper {
*/
public SysUser checkEmailUnique(String email);
/**
* 剩余机构信息
*
* @param agencyName 机构搜索信息
* @param agencyId 机构id
* @return AgencyNameVO
*/
List<AgencyNameVO> selectAgencyList(@Param("agencyName") String agencyName, @Param("agencyId") Long agencyId);
/**
* 机构查询
*
* @param agencyId 机构id
* @return
*/
List<AgencyNameVO> selectBelongAgencyList(Long agencyId);
/**
* 剩余科室信息
*
* @param departmentName 科室搜索条件
* @param departmentId 科室id
* @param agencyId 机构id
* @return AgencyNameVO
*/
List<AgencyNameVO> selectDepartmentList(@Param("departmentName") String departmentName, @Param("departmentId") Long departmentId, @Param("agencyId") Long agencyId);
/**
* 科室信息
*
* @param departmentId 科室id
* @return AgencyNameVO
*/
List<AgencyNameVO> selectBelongDepartmentList(Long departmentId);
}

View File

@ -1,6 +1,5 @@
package com.xinelu.system.service;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.entity.SysUser;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.system.domain.vo.AgencyNameVO;
@ -208,7 +207,7 @@ public interface ISysUserService {
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
/**
* 所属机构查询
* 剩余机构查询
*
* @param userName 用户账号
* @return AjaxResult
@ -222,4 +221,21 @@ public interface ISysUserService {
* @return AjaxResult
*/
List<AgencyNameVO> selectUserBelongAgency(String userName);
/**
* 剩余科室查询
*
* @param userName 用户账号
* @return AjaxResult
*/
TableDataInfo selectUserDepartment(String userName, String departmentName);
/**
* 所属科室查询
*
* @param userName 用户账号
* @return AjaxResult
*/
List<AgencyNameVO> getBelongDepartment(String userName);
}

View File

@ -499,7 +499,7 @@ public class SysUserServiceImpl implements ISysUserService {
SysUser sysUser = userMapper.selectUserByUserName(userName);
pageServiceUtil.startPage();
List<AgencyNameVO> agencyList = userMapper.selectAgencyList(agencyName, sysUser.getAgencyId());
if (CollectionUtils.isNotEmpty(agencyList)){
if (CollectionUtils.isNotEmpty(agencyList)) {
return pageServiceUtil.getDataTable(agencyList);
}
return pageServiceUtil.getDataTable(new ArrayList<>());
@ -519,4 +519,39 @@ public class SysUserServiceImpl implements ISysUserService {
}
return new ArrayList<AgencyNameVO>();
}
/**
* 剩余科室查询
*
* @param userName 用户账号
* @return AjaxResult
*/
@Override
public TableDataInfo selectUserDepartment(String userName, String departmentName) {
SysUser sysUser = userMapper.selectUserByUserName(userName);
if (Objects.isNull(sysUser) || Objects.isNull(sysUser.getAgencyId())) {
return pageServiceUtil.getDataTable(new ArrayList<>());
}
pageServiceUtil.startPage();
List<AgencyNameVO> agencyList = userMapper.selectDepartmentList(departmentName, sysUser.getDepartmentId(), sysUser.getAgencyId());
if (CollectionUtils.isNotEmpty(agencyList)) {
return pageServiceUtil.getDataTable(agencyList);
}
return pageServiceUtil.getDataTable(new ArrayList<>());
}
/**
* 所属科室查询
*
* @param userName 用户账号
* @return AjaxResult
*/
@Override
public List<AgencyNameVO> getBelongDepartment(String userName) {
SysUser sysUser = userMapper.selectUserByUserName(userName);
if (Objects.nonNull(sysUser) && Objects.nonNull(sysUser.getDepartmentId())) {
return userMapper.selectBelongDepartmentList(sysUser.getDepartmentId());
}
return new ArrayList<AgencyNameVO>();
}
}

View File

@ -26,6 +26,7 @@
<result property="userCardNo" column="user_card_no"/>
<result property="userBirthDate" column="user_birth_date"/>
<result property="agencyId" column="agency_id"/>
<result property="departmentId" column="department_id"/>
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult"/>
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
</resultMap>
@ -69,6 +70,7 @@
u.user_card_no,
u.user_birth_date,
u.agency_id,
u.department_id,
d.dept_id,
d.parent_id,
d.ancestors,
@ -91,7 +93,7 @@
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status,
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.user_card_no,u.user_birth_date,
u.agency_id,d.dept_name, d.leader from sys_user u
u.agency_id,u.department_id,d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0'
<if test="userId != null and userId != 0">
@ -212,6 +214,7 @@
<if test="userCardNo != null and userCardNo != ''">user_card_no,</if>
<if test="userBirthDate != null">user_birth_date,</if>
<if test="agencyId != null">agency_id,</if>
<if test="departmentId != null">department_id,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
@ -229,6 +232,7 @@
<if test="userCardNo != null and userCardNo != ''">#{userCardNo},</if>
<if test="userBirthDate != null">#{userBirthDate},</if>
<if test="agencyId != null">#{agencyId},</if>
<if test="departmentId != null">#{departmentId},</if>
sysdate()
)
</insert>
@ -252,6 +256,7 @@
<if test="userCardNo != null and userCardNo != ''">user_card_no = #{userCardNo},</if>
<if test="userBirthDate != null">user_birth_date = #{userBirthDate},</if>
agency_id =#{agencyId},
department_id = #{departmentId},
update_time = sysdate()
</set>
where user_id = #{userId}
@ -294,7 +299,7 @@
agency_code,
(select COUNT(1)
from agency
where agency_status = 'ON'
where agency_status = 'ON' and node_type = 'HOSPITAL'
<if test="agencyName != null and agencyName != ''">
and agency_name = #{agencyName}
or agency_code = #{agencyName}
@ -304,7 +309,7 @@
</if>
) as agencyNum
from agency
where agency_status = 'ON'
where agency_status = 'ON' and node_type = 'HOSPITAL'
<if test="agencyName != null and agencyName != ''">
and agency_name = #{agencyName}
or agency_code = #{agencyName}
@ -315,15 +320,62 @@
</select>
<select id="selectBelongAgencyList" resultType="com.xinelu.system.domain.vo.AgencyNameVO">
select id agencyId,
select id agencyId,
agency_name,
agency_code,
(select COUNT(1)
from agency
where id = #{agencyId}
and agency_status = 'ON') as agencyNum
and agency_status = 'ON'
and node_type = 'HOSPITAL') as agencyNum
from agency
where id = #{agencyId}
and agency_status = 'ON'
and node_type = 'HOSPITAL'
</select>
<select id="selectDepartmentList" resultType="com.xinelu.system.domain.vo.AgencyNameVO">
select id departmentId,
department_name departmentName,
department_code departmentCode,
(select COUNT(1)
from department
where node_type = 'DEPARTMENT'
<if test="departmentName != null and departmentName != ''">
and department_name = #{departmentName}
or department_code = #{departmentName}
</if>
<if test="departmentId != null ">
and id &lt;&gt; #{departmentId}
</if>
<if test="agencyId != null ">
and id = #{agencyId}
</if>
) as departmentNum
from department
where agency_status = 'ON' and node_type = 'HOSPITAL'
<if test="departmentName != null and departmentName != ''">
and department_name = #{departmentName}
or department_code = #{departmentName}
</if>
<if test="departmentId != null ">
and id &lt;&gt; #{departmentId}
</if>
<if test="agencyId != null ">
and id = #{agencyId}
</if>
</select>
<select id="selectBelongDepartmentList" resultType="com.xinelu.system.domain.vo.AgencyNameVO">
select id departmentId,
department_name departmentName,
department_code departmentCode,
(select COUNT(1)
from department
where id = #{departmentId}
and node_type = 'DEPARTMENT') as departmentNum
from department
where id = #{departmentId}
and node_type = 'DEPARTMENT'
</select>
</mapper>