版本更新
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.BodyStructureDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
|
||||
/**
|
||||
* BodyStructure 应该服务类
|
||||
*/
|
||||
public interface IBodyStructureAppService {
|
||||
/**
|
||||
* 查询身体部位树
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 身体部位树分页列表
|
||||
*/
|
||||
Page<BodyStructureDto> getBodyStructureTree(Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 身体部位信息详情
|
||||
*
|
||||
* @param id 身体部位信息id
|
||||
* @return 身体部位详情
|
||||
*/
|
||||
R<?> getBodyStructureInfo(Long id);
|
||||
|
||||
/**
|
||||
* 添加/编辑体身体部位信息
|
||||
*
|
||||
* @param bodyStructureDto 身体部位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditBodyStructure(BodyStructureDto bodyStructureDto);
|
||||
|
||||
/**
|
||||
* 身体部位信息
|
||||
*
|
||||
* @param ids 身体部位信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteBodyStructure(String ids);
|
||||
|
||||
/**
|
||||
* 身体部位启用
|
||||
*
|
||||
* @param id 身体部位信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> activeBodyStructure(Long id);
|
||||
|
||||
/**
|
||||
* 身体部位停用
|
||||
*
|
||||
* @param id 身体部位信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> inactiveBodyStructure(Long id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.LocationAddOrEditDto;
|
||||
import com.openhis.web.basedatamanage.dto.LocationPageParam;
|
||||
import com.openhis.web.common.dto.LocationDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Location 应该服务类
|
||||
*/
|
||||
public interface ILocationAppService {
|
||||
/**
|
||||
* 位置信息
|
||||
*
|
||||
* @param formList 类型
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param isInHospital 是否为住院
|
||||
* @return 位置信息分页列表
|
||||
*/
|
||||
R<?> getLocationTree(List<Integer> formList, Integer pageNo, Integer pageSize, String isInHospital);
|
||||
|
||||
/**
|
||||
* 位置信息详情
|
||||
*
|
||||
* @param locationId 位置信息id
|
||||
* @return 位置信息详情
|
||||
*/
|
||||
R<?> getLocationById(Long locationId);
|
||||
|
||||
/**
|
||||
* 删除位置信息
|
||||
*
|
||||
* @param busNo 位置信息编码
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteLocation(String busNo);
|
||||
|
||||
/**
|
||||
* 位置分页列表
|
||||
*
|
||||
* @param locationPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param request 请求
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
R<?> getLocationPage(LocationPageParam locationPageParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 新增位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addLocation(LocationAddOrEditDto locationAddOrEditDto);
|
||||
|
||||
/**
|
||||
* 编辑位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> editLocation(LocationAddOrEditDto locationAddOrEditDto);
|
||||
|
||||
/**
|
||||
* 位置初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> locationInit();
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> enableLocation(List<Long> locationIdList);
|
||||
|
||||
/**
|
||||
* 停用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deactivateLocation(List<Long> locationIdList);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
|
||||
/**
|
||||
* Organization 应该服务类
|
||||
*/
|
||||
public interface IOrganizationAppService {
|
||||
/**
|
||||
* 查询机构树
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 机构树分页列表
|
||||
*/
|
||||
Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 机构信息详情
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 机构信息详情
|
||||
*/
|
||||
R<?> getOrgInfo(Long orgId);
|
||||
|
||||
/**
|
||||
* 添加/编辑机构信息
|
||||
*
|
||||
* @param organizationDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditOrganization(OrganizationDto organizationDto);
|
||||
|
||||
/**
|
||||
* 机构信息
|
||||
*
|
||||
* @param orgIds 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteOrganization(String orgIds);
|
||||
|
||||
/**
|
||||
* 机构启用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> activeOrg(Long orgId);
|
||||
|
||||
/**
|
||||
* 机构停用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> inactiveOrg(Long orgId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryParam;
|
||||
|
||||
/**
|
||||
* Organization 应该服务类
|
||||
*/
|
||||
public interface IOrganizationLocationAppService {
|
||||
|
||||
/**
|
||||
* 查询机构位置
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 机构位置分页列表
|
||||
*/
|
||||
R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam, Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 添加/编辑机构位置信息
|
||||
*
|
||||
* @param orgLocQueryDto 机构位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditOrgLoc(OrgLocQueryDto orgLocQueryDto);
|
||||
|
||||
/**
|
||||
* 机构位置信息
|
||||
*
|
||||
* @param orgLocId 机构位置信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteOrgLoc(Long orgLocId);
|
||||
|
||||
/**
|
||||
* 机构位置关系初始化
|
||||
*
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> organizationLocationInit();
|
||||
|
||||
/**
|
||||
* 根据类型查询药房/药库
|
||||
*
|
||||
* @param locationForm 查询字段
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
R<?> getLocationListByForm(Integer locationForm);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.SelectableOrgDto;
|
||||
import com.openhis.web.basedatamanage.dto.UserAndPractitionerDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参与者 应该服务类
|
||||
*/
|
||||
public interface IPractitionerAppService {
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> saveUserPractitioner(UserAndPractitionerDto userAndPractitionerDto);
|
||||
|
||||
/**
|
||||
* 查询用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 用户及参与者
|
||||
*/
|
||||
IPage<UserAndPractitionerDto> getUserPractitionerPage(UserAndPractitionerDto userAndPractitionerDto,
|
||||
String searchKey, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 修改用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> editUserPractitioner(UserAndPractitionerDto userAndPractitionerDto);
|
||||
|
||||
/**
|
||||
* 删除用户及参与者 ; admin不允许删除
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> delUserPractitioner(Long userId);
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
List<SelectableOrgDto> getSelectableOrgList();
|
||||
|
||||
/**
|
||||
* 切换科室
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> switchOrg(Long orgId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.openhis.web.basedatamanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.PractRoleSearchParam;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRoleDto;
|
||||
|
||||
/**
|
||||
* PractitionerRole 应该服务类
|
||||
*/
|
||||
public interface IPractitionerRoleAppService {
|
||||
/**
|
||||
* 查询岗位
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 岗位分页列表
|
||||
*/
|
||||
R<?> getPractitionerPage(PractRoleSearchParam practRoleSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 岗位信息详情
|
||||
*
|
||||
* @param practitionerRoleId 岗位信息id
|
||||
* @return 岗位信息详情
|
||||
*/
|
||||
R<?> getPractitionerRoleById(Long practitionerRoleId);
|
||||
|
||||
/**
|
||||
* 添加/编辑岗位信息
|
||||
*
|
||||
* @param practitionerRoleDto 岗位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditPractitionerRole(PractitionerRoleDto practitionerRoleDto);
|
||||
|
||||
/**
|
||||
* 岗位信息
|
||||
*
|
||||
* @param practitionerRoleId 岗位信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deletePractitionerRole(Long practitionerRoleId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.administration.domain.BodyStructure;
|
||||
import com.openhis.administration.service.IBodyStructureService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IBodyStructureAppService;
|
||||
import com.openhis.web.basedatamanage.dto.BodyStructureDto;
|
||||
|
||||
@Service
|
||||
public class BodyStructureAppServiceImpl implements IBodyStructureAppService {
|
||||
|
||||
@Resource
|
||||
private IBodyStructureService bodyStructureService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Override
|
||||
public Page<BodyStructureDto> getBodyStructureTree(Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 查询身体部位列表
|
||||
Page<BodyStructure> page = bodyStructureService.page(new Page<>(pageNo, pageSize));
|
||||
List<BodyStructure> bodyStructureList = page.getRecords();
|
||||
// 将身体部位列表转为树结构
|
||||
List<BodyStructureDto> orgTree = buildTree(bodyStructureList);
|
||||
Page<BodyStructureDto> orgQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
orgQueryDtoPage.setRecords(orgTree);
|
||||
return orgQueryDtoPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将身体部位列表转换为树结构
|
||||
*
|
||||
* @param records 机构列表
|
||||
* @return tree
|
||||
*/
|
||||
private List<BodyStructureDto> buildTree(List<BodyStructure> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<BodyStructure> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, BodyStructureDto> nodeMap = new HashMap<>();
|
||||
List<BodyStructureDto> tree = new ArrayList<>();
|
||||
|
||||
for (BodyStructure record : sortedRecords) {
|
||||
String bNo = record.getBusNo();
|
||||
String[] parts = bNo.split("\\.");
|
||||
BodyStructureDto node = new BodyStructureDto();
|
||||
BeanUtils.copyProperties(record, node);
|
||||
node.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, node.getStatusEnum()));
|
||||
|
||||
// 将当前节点加入映射
|
||||
nodeMap.put(bNo, node);
|
||||
|
||||
if (parts.length == 1) {
|
||||
// 根节点
|
||||
tree.add(node);
|
||||
} else {
|
||||
// 获取父节点的b_no(去掉最后一部分)
|
||||
String parentBNo = String.join(".", Arrays.copyOf(parts, parts.length - 1));
|
||||
BodyStructureDto parent = nodeMap.get(parentBNo);
|
||||
|
||||
if (parent != null) {
|
||||
parent.getChildren().add(node);
|
||||
} else {
|
||||
// 处理父节点不存在的情况(例如数据缺失)
|
||||
// 可根据需求调整为将节点加入根或抛出异常
|
||||
}
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* 身体部位信息详情
|
||||
*
|
||||
* @param id 身体部位id
|
||||
* @return 机构信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getBodyStructureInfo(Long id) {
|
||||
BodyStructure bodyStructure = bodyStructureService.getById(id);
|
||||
return R.ok(bodyStructure,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑部位
|
||||
*
|
||||
* @param bodyStructureDto 身体部位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditBodyStructure(BodyStructureDto bodyStructureDto) {
|
||||
|
||||
// 新增身体部位信息
|
||||
BodyStructure bodyStructure = new BodyStructure();
|
||||
BeanUtils.copyProperties(bodyStructureDto, bodyStructure);
|
||||
|
||||
// 拼音码
|
||||
bodyStructure.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(bodyStructureDto.getName()));
|
||||
// 五笔码
|
||||
bodyStructure.setWbStr(ChineseConvertUtils.toWBFirstLetter(bodyStructureDto.getName()));
|
||||
|
||||
if (bodyStructureDto.getId() != null) {
|
||||
// 更新身体部位信息
|
||||
bodyStructureService.updateById(bodyStructure);
|
||||
} else {
|
||||
bodyStructure.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
||||
// 采番bus_no三位
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.BODY_STRUCTURE_NO.getPrefix(), 3);
|
||||
// 如果传了上级部位 把当前的code拼到后边
|
||||
if (StringUtils.isNotEmpty(bodyStructure.getBusNo())) {
|
||||
bodyStructure.setBusNo(String.format(CommonConstants.Common.MONTAGE_FORMAT, bodyStructure.getBusNo(),
|
||||
CommonConstants.Common.POINT, code));
|
||||
} else {
|
||||
bodyStructure.setBusNo(code);
|
||||
}
|
||||
// 生成待发送的机构信息
|
||||
bodyStructureService.save(bodyStructure);
|
||||
}
|
||||
// 返回身体部位id
|
||||
return R.ok(bodyStructure.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息更新添加"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除身体部位
|
||||
*
|
||||
* @param id 身体部位id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteBodyStructure(String id) {
|
||||
|
||||
List<Long> orgIdList = new ArrayList<>();
|
||||
if (id != null) {
|
||||
orgIdList = Arrays.stream(id.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 删除身体部位信息
|
||||
boolean deleteOrgSuccess = bodyStructureService.removeByIds(orgIdList);
|
||||
return deleteOrgSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"身体部位信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"身体部位信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 身体部位列表启用
|
||||
*
|
||||
* @param id 身体部位列表信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> activeBodyStructure(Long id) {
|
||||
// 机构启用
|
||||
boolean result = bodyStructureService.activeBodyStructure(id);
|
||||
return result
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息启用"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"身体部位信息启用"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 身体部位列表停用
|
||||
*
|
||||
* @param id 身体部位列表信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> inactiveBodyStructure(Long id) {
|
||||
// 机构停用
|
||||
boolean result = bodyStructureService.inactiveBodyStructure(id);
|
||||
return result
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息停用"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"身体部位信息停用"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,380 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.*;
|
||||
import com.openhis.administration.domain.EncounterLocation;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.mapper.LocationMapper;
|
||||
import com.openhis.administration.service.IEncounterLocationService;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.ILocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.*;
|
||||
import com.openhis.web.common.appservice.ICommonService;
|
||||
|
||||
@Service
|
||||
public class LocationAppServiceImpl implements ILocationAppService {
|
||||
|
||||
@Resource
|
||||
private ILocationService locationService;
|
||||
|
||||
@Resource
|
||||
private ICommonService commonService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Resource
|
||||
private LocationMapper locationMapper;
|
||||
|
||||
@Resource
|
||||
private IPractitionerRoleService practitionerRoleService;
|
||||
|
||||
@Resource
|
||||
private IEncounterLocationService encounterLocationService;
|
||||
|
||||
/**
|
||||
* 位置初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> locationInit() {
|
||||
LocationInitDto initDto = new LocationInitDto();
|
||||
// 位置状态
|
||||
List<LocationInitDto.locationStatusOption> locationStatusOptions = new ArrayList<>();
|
||||
locationStatusOptions.add(new LocationInitDto.locationStatusOption(LocationStatus.ACTIVE.getValue(),
|
||||
LocationStatus.ACTIVE.getInfo()));
|
||||
locationStatusOptions.add(new LocationInitDto.locationStatusOption(LocationStatus.INACTIVE.getValue(),
|
||||
LocationStatus.INACTIVE.getInfo()));
|
||||
initDto.setLocationStatusOptions(locationStatusOptions);
|
||||
return R.ok(initDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> enableLocation(List<Long> locationIdList) {
|
||||
List<Location> locationList = locationService.getLocationList(locationIdList);
|
||||
if (locationIdList != null && !locationIdList.isEmpty()) {
|
||||
for (Location location : locationList) {
|
||||
if (LocationForm.HOUSE.getValue().equals(location.getFormEnum())
|
||||
|| LocationForm.BED.getValue().equals(location.getFormEnum())) {
|
||||
// 获取父节点的busNo(病区)
|
||||
String parentBusNo =
|
||||
location.getBusNo().substring(0, location.getBusNo().indexOf(CommonConstants.Common.POINT));
|
||||
// 查询所有父集位置
|
||||
List<Location> fatherLocations =
|
||||
locationService.list(new LambdaQueryWrapper<Location>().like(Location::getBusNo, parentBusNo)
|
||||
.in(Location::getFormEnum, LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue()));
|
||||
// 启用所有对应的父节点
|
||||
for (Location fatherLocation : fatherLocations) {
|
||||
fatherLocation.setStatusEnum(LocationStatus.ACTIVE.getValue());
|
||||
locationService.updateLocation(fatherLocation);
|
||||
}
|
||||
// 病床单独设置状态为空闲
|
||||
if (LocationForm.BED.getValue().equals(location.getFormEnum())) {
|
||||
location.setStatusEnum(LocationStatus.IDLE.getValue());
|
||||
locationService.updateLocation(location);
|
||||
}
|
||||
} else {
|
||||
location.setStatusEnum(LocationStatus.ACTIVE.getValue());
|
||||
locationService.updateLocation(location);
|
||||
}
|
||||
}
|
||||
return R.ok("启用成功");
|
||||
}
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deactivateLocation(List<Long> locationIdList) {
|
||||
List<Location> locationList = locationService.getLocationList(locationIdList);
|
||||
if (locationIdList != null && !locationIdList.isEmpty()) {
|
||||
for (Location location : locationList) {
|
||||
if (LocationForm.BED.getValue().equals(location.getFormEnum())) {
|
||||
List<EncounterLocation> encounterLocationList =
|
||||
encounterLocationService.getEncounterLocationInfo(null, location.getId());
|
||||
if (encounterLocationList != null && !encounterLocationList.isEmpty()) {
|
||||
return R.fail("有被占用的床位,不可停用");
|
||||
}
|
||||
} else if (LocationForm.HOUSE.getValue().equals(location.getFormEnum())) {
|
||||
// 检查病房下是否有启用的病床
|
||||
List<com.openhis.web.common.dto.LocationDto> activeBeds =
|
||||
commonService.getChildLocation(location.getId(), LocationForm.BED.getValue());
|
||||
if ((activeBeds != null && !activeBeds.isEmpty())) {
|
||||
return R.fail("病房下有启用或被占用的床位,不可停用");
|
||||
}
|
||||
} else if (LocationForm.WARD.getValue().equals(location.getFormEnum())) {
|
||||
// 检查病区下是否有启用的病房
|
||||
List<com.openhis.web.common.dto.LocationDto> activeHouses =
|
||||
commonService.getChildLocation(location.getId(), LocationForm.HOUSE.getValue());
|
||||
if ((activeHouses != null && !activeHouses.isEmpty())) {
|
||||
return R.fail("病区下有启用或被占用的病房,不可停用");
|
||||
}
|
||||
}
|
||||
location.setStatusEnum(LocationStatus.INACTIVE.getValue());
|
||||
locationService.updateLocation(location);
|
||||
}
|
||||
return R.ok("停用成功");
|
||||
}
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置信息详情
|
||||
*
|
||||
* @param locationId 位置信息id
|
||||
* @return 位置信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationById(Long locationId) {
|
||||
LocationInfoDto locationInfoDto = new LocationInfoDto();
|
||||
BeanUtils.copyProperties(locationService.getById(locationId), locationInfoDto);
|
||||
// 位置类型
|
||||
locationInfoDto
|
||||
.setFormEnum_enumText(EnumUtils.getInfoByValue(LocationForm.class, locationInfoDto.getFormEnum()));
|
||||
// 使用状态
|
||||
locationInfoDto.setOperationalEnum_enumText(
|
||||
EnumUtils.getInfoByValue(LocationOperational.class, locationInfoDto.getOperationalEnum()));
|
||||
// 启用停用
|
||||
locationInfoDto
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, locationInfoDto.getStatusEnum()));
|
||||
return R.ok(locationInfoDto,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"位置信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除位置信息
|
||||
*
|
||||
* @param busNo 位置信息编码
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteLocation(String busNo) {
|
||||
// 删除位置信息(连同子集)
|
||||
boolean result =
|
||||
locationService.remove(new LambdaQueryWrapper<Location>().likeRight(Location::getBusNo, busNo));
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"位置信息删除"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, new Object[] {"位置信息删除"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置分页列表
|
||||
*
|
||||
* @param locationPageParam 查询条件
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationPage(LocationPageParam locationPageParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
// 数据初始化,不使用eq条件拼接
|
||||
List<Integer> formList = locationPageParam.getLocationFormList();
|
||||
locationPageParam.setLocationFormList(null);
|
||||
String busNo = locationPageParam.getBusNo();
|
||||
locationPageParam.setBusNo(null);
|
||||
// 构建查询条件
|
||||
QueryWrapper<Location> queryWrapper = HisQueryUtils.buildQueryWrapper(locationPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.PyStr,
|
||||
CommonConstants.FieldName.WbStr)),
|
||||
request);
|
||||
// 根据不同的位置类型查询不同的位置分页信息(前端必传默认值)
|
||||
if (formList != null && !formList.isEmpty()) {
|
||||
queryWrapper.lambda().in(Location::getFormEnum, formList);
|
||||
}
|
||||
// 根据父节点编码查询子项
|
||||
queryWrapper.lambda().likeRight(StringUtils.isNotNull(busNo), Location::getBusNo, busNo);
|
||||
if (locationPageParam.getFormEnum() != null) {
|
||||
queryWrapper.lambda().eq(Location::getFormEnum, locationPageParam.getFormEnum());
|
||||
}
|
||||
|
||||
// 查询位置分页列表
|
||||
Page<LocationInfoDto> locationPage =
|
||||
HisPageUtils.selectPage(locationMapper, queryWrapper, pageNo, pageSize, LocationInfoDto.class);
|
||||
locationPage.getRecords().forEach(e -> {
|
||||
// 位置类型
|
||||
e.setFormEnum_enumText(EnumUtils.getInfoByValue(LocationForm.class, e.getFormEnum()));
|
||||
// 使用状态
|
||||
e.setOperationalEnum_enumText(EnumUtils.getInfoByValue(LocationOperational.class, e.getOperationalEnum()));
|
||||
// 启用停用
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, e.getStatusEnum()));
|
||||
});
|
||||
return R.ok(locationPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
||||
|
||||
Location location = new Location();
|
||||
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
||||
location.setFormEnum(Integer.valueOf(locationAddOrEditDto.getFormEnum()));
|
||||
// 新增病床设置状态为空闲
|
||||
if (LocationForm.BED.getValue().equals(Integer.valueOf(locationAddOrEditDto.getFormEnum()))) {
|
||||
location.setStatusEnum(LocationStatus.IDLE.getValue());
|
||||
}
|
||||
// 拼音码
|
||||
location.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(locationAddOrEditDto.getName()));
|
||||
// 五笔码
|
||||
location.setWbStr(ChineseConvertUtils.toWBFirstLetter(locationAddOrEditDto.getName()));
|
||||
// 采番bus_no三位
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.LOCATION_BUS_NO.getPrefix(), 3);
|
||||
// 如果传了上级 把当前的code拼到后边
|
||||
if (StringUtils.isNotEmpty(location.getBusNo())) {
|
||||
location.setBusNo(String.format(CommonConstants.Common.MONTAGE_FORMAT, location.getBusNo(),
|
||||
CommonConstants.Common.POINT, code));
|
||||
} else {
|
||||
location.setBusNo(code);
|
||||
}
|
||||
boolean result = locationService.addLocation(location);
|
||||
if (result) {
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"库房"}));
|
||||
}
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> editLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
||||
Location location = new Location();
|
||||
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
||||
// 拼音码
|
||||
location.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(locationAddOrEditDto.getName()));
|
||||
// 五笔码
|
||||
location.setWbStr(ChineseConvertUtils.toWBFirstLetter(locationAddOrEditDto.getName()));
|
||||
boolean result = locationService.updateLocation(location);
|
||||
if (result) {
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"库房"}));
|
||||
}
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置分页列表-树型
|
||||
*
|
||||
* @param formList 类型
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param isInHospital 是否住院
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationTree(List<Integer> formList, Integer pageNo, Integer pageSize, String isInHospital) {
|
||||
|
||||
LambdaQueryWrapper<Location> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (formList != null && !formList.isEmpty()) {
|
||||
queryWrapper.in(Location::getFormEnum, formList);
|
||||
}
|
||||
if (Whether.YES.getCode().equals(isInHospital)) {
|
||||
// 当前登录者的id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
List<Long> locationIds = practitionerRoleService.getLocationIdsByPractitionerId(practitionerId);
|
||||
queryWrapper.in(Location::getId, locationIds);
|
||||
}
|
||||
// 查询位置列表
|
||||
Page<Location> page = locationService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
List<Location> locationList = page.getRecords();
|
||||
// 将位置列表转为树结构
|
||||
List<LocationDto> locationTree = buildTree(locationList);
|
||||
Page<LocationDto> locationQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
locationQueryDtoPage.setRecords(locationTree);
|
||||
|
||||
locationQueryDtoPage.getRecords().forEach(e -> {
|
||||
// 物理形式枚举回显赋值
|
||||
e.setFormEnum_enumText(EnumUtils.getInfoByValue(LocationForm.class, e.getFormEnum()));
|
||||
// 状态编码回显赋值
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, e.getStatusEnum()));
|
||||
// 操作状态回显赋值
|
||||
e.setOperationalEnum_enumText(EnumUtils.getInfoByValue(LocationBedStatus.class, e.getOperationalEnum()));
|
||||
// 模式编码回显赋值
|
||||
e.setModeEnum_enumText(EnumUtils.getInfoByValue(LocationMode.class, e.getModeEnum()));
|
||||
});
|
||||
|
||||
return R.ok(locationQueryDtoPage,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"位置信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将位置列表转换为树结构
|
||||
*
|
||||
* @param records 位置列表
|
||||
* @return tree
|
||||
*/
|
||||
private List<LocationDto> buildTree(List<Location> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<Location> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, LocationDto> nodeMap = new HashMap<>();
|
||||
List<LocationDto> tree = new ArrayList<>();
|
||||
|
||||
for (Location record : sortedRecords) {
|
||||
String bNo = record.getBusNo();
|
||||
String[] parts = bNo.split("\\.");
|
||||
LocationDto node = new LocationDto();
|
||||
BeanUtils.copyProperties(record, node);
|
||||
// 将当前节点加入映射
|
||||
nodeMap.put(bNo, node);
|
||||
|
||||
if (parts.length == 1) {
|
||||
// 根节点
|
||||
tree.add(node);
|
||||
} else {
|
||||
// 获取父节点的b_no(去掉最后一部分)
|
||||
String parentBNo = String.join(".", Arrays.copyOf(parts, parts.length - 1));
|
||||
LocationDto parent = nodeMap.get(parentBNo);
|
||||
|
||||
if (parent != null) {
|
||||
parent.getChildren().add(node);
|
||||
} else {
|
||||
// 处理父节点不存在的情况(例如数据缺失)
|
||||
// 可根据需求调整为将节点加入根或抛出异常
|
||||
tree.add(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
|
||||
@Service
|
||||
public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
|
||||
@Resource
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Override
|
||||
public Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 查询机构列表
|
||||
Page<Organization> page = organizationService.page(new Page<>(pageNo, pageSize));
|
||||
List<Organization> organizationList = page.getRecords();
|
||||
// 将机构列表转为树结构
|
||||
List<OrganizationDto> orgTree = buildTree(organizationList);
|
||||
Page<OrganizationDto> orgQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
orgQueryDtoPage.setRecords(orgTree);
|
||||
return orgQueryDtoPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将机构列表转换为树结构
|
||||
*
|
||||
* @param records 机构列表
|
||||
* @return tree
|
||||
*/
|
||||
private List<OrganizationDto> buildTree(List<Organization> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<Organization> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, OrganizationDto> nodeMap = new HashMap<>();
|
||||
List<OrganizationDto> tree = new ArrayList<>();
|
||||
|
||||
for (Organization record : sortedRecords) {
|
||||
String bNo = record.getBusNo();
|
||||
String[] parts = bNo.split("\\.");
|
||||
OrganizationDto node = new OrganizationDto();
|
||||
BeanUtils.copyProperties(record, node);
|
||||
node.setTypeEnum_dictText(EnumUtils.getInfoByValue(OrganizationType.class, node.getTypeEnum()));
|
||||
node.setClassEnum_dictText(EnumUtils.getInfoByValue(OrganizationClass.class, node.getClassEnum()));
|
||||
node.setActiveFlag_dictText(EnumUtils.getInfoByValue(AccountStatus.class, node.getActiveFlag()));
|
||||
// 将当前节点加入映射
|
||||
nodeMap.put(bNo, node);
|
||||
|
||||
if (parts.length == 1) {
|
||||
// 根节点
|
||||
tree.add(node);
|
||||
} else {
|
||||
// 获取父节点的b_no(去掉最后一部分)
|
||||
String parentBNo = String.join(".", Arrays.copyOf(parts, parts.length - 1));
|
||||
OrganizationDto parent = nodeMap.get(parentBNo);
|
||||
|
||||
if (parent != null) {
|
||||
parent.getChildren().add(node);
|
||||
} else {
|
||||
// 处理父节点不存在的情况(例如数据缺失)
|
||||
// 可根据需求调整为将节点加入根或抛出异常
|
||||
}
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构信息详情
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 机构信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getOrgInfo(Long orgId) {
|
||||
Organization organization = organizationService.getById(orgId);
|
||||
return R.ok(organization, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑机构
|
||||
*
|
||||
* @param organizationDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditOrganization(OrganizationDto organizationDto) {
|
||||
|
||||
// 新增organization信息
|
||||
Organization organization = new Organization();
|
||||
BeanUtils.copyProperties(organizationDto, organization);
|
||||
|
||||
if (organizationDto.getId() != null) {
|
||||
// 更新机构信息
|
||||
organizationService.updateById(organization);
|
||||
} else {
|
||||
// 活动标识:有效
|
||||
organization.setActiveFlag(AccountStatus.ACTIVE.getValue());
|
||||
// 采番bus_no三位
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.ORGANIZATION_BUS_NO.getPrefix(), 3);
|
||||
// 如果传了上级科室 把当前的code拼到后边
|
||||
if (StringUtils.isNotEmpty(organization.getBusNo())) {
|
||||
organization.setBusNo(String.format(CommonConstants.Common.MONTAGE_FORMAT, organization.getBusNo(),
|
||||
CommonConstants.Common.POINT, code));
|
||||
} else {
|
||||
organization.setBusNo(code);
|
||||
}
|
||||
// 生成待发送的机构信息
|
||||
organizationService.save(organization);
|
||||
}
|
||||
// 返回机构id
|
||||
return R.ok(organization.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息更新添加"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机构
|
||||
*
|
||||
* @param orgIds 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteOrganization(String orgIds) {
|
||||
|
||||
List<Long> orgIdList = new ArrayList<>();
|
||||
if (orgIds != null) {
|
||||
orgIdList = Arrays.stream(orgIds.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 删除机构信息
|
||||
boolean deleteOrgSuccess = organizationService.removeByIds(orgIdList);
|
||||
return deleteOrgSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"机构信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构启用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> activeOrg(Long orgId) {
|
||||
// 机构启用
|
||||
boolean result = organizationService.activeOrg(orgId);
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息启用"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息启用"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构停用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> inactiveOrg(Long orgId) {
|
||||
// 机构停用
|
||||
boolean result = organizationService.inactiveOrg(orgId);
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息停用"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息停用"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.domain.OrganizationLocation;
|
||||
import com.openhis.administration.mapper.OrganizationLocationMapper;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IOrganizationLocationService;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.LocationForm;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationLocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocInitDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryParam;
|
||||
|
||||
@Service
|
||||
public class OrganizationLocationAppServiceImpl implements IOrganizationLocationAppService {
|
||||
|
||||
@Autowired
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
@Autowired
|
||||
private ILocationService locationService;
|
||||
|
||||
@Autowired
|
||||
private OrganizationLocationMapper organizationLocationMapper;
|
||||
|
||||
@Autowired
|
||||
private IOrganizationLocationService organizationLocationService;
|
||||
|
||||
/**
|
||||
* 机构位置关系初始化
|
||||
*
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> organizationLocationInit() {
|
||||
OrgLocInitDto initDto = new OrgLocInitDto();
|
||||
// 位置类型
|
||||
List<OrgLocInitDto.locationFormOption> chargeItemStatusOptions = new ArrayList<>();
|
||||
chargeItemStatusOptions
|
||||
.add(new OrgLocInitDto.locationFormOption(LocationForm.CABINET.getValue(), LocationForm.CABINET.getInfo()));
|
||||
chargeItemStatusOptions.add(
|
||||
new OrgLocInitDto.locationFormOption(LocationForm.PHARMACY.getValue(), LocationForm.PHARMACY.getInfo()));
|
||||
|
||||
// 获取科室下拉选列表
|
||||
List<Organization> organizationList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null);
|
||||
List<OrgLocInitDto.departmentOption> organizationOptions = organizationList.stream()
|
||||
.map(organization -> new OrgLocInitDto.departmentOption(organization.getId(), organization.getName()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setLocationFormOptions(chargeItemStatusOptions).setDepartmentOptions(organizationOptions);
|
||||
return R.ok(initDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型查询药房/药库
|
||||
*
|
||||
* @param locationForm 查询字段
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getLocationListByForm(Integer locationForm) {
|
||||
|
||||
OrgLocInitDto orgLocInitDto = new OrgLocInitDto();
|
||||
List<Location> locationList = new ArrayList<>();
|
||||
if (LocationForm.CABINET.getValue().equals(locationForm)) {
|
||||
locationList = locationService.getCabinetList();
|
||||
} else if (LocationForm.PHARMACY.getValue().equals(locationForm)) {
|
||||
locationList = locationService.getPharmacyList();
|
||||
}
|
||||
List<OrgLocInitDto.locationOption> locationOptions = locationList.stream()
|
||||
.map(location -> new OrgLocInitDto.locationOption(location.getId(), location.getName()))
|
||||
.collect(Collectors.toList());
|
||||
orgLocInitDto.setLocationOptions(locationOptions);
|
||||
return R.ok(orgLocInitDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构位置关系分页列表
|
||||
*
|
||||
* @param orgLocQueryParam 查询字段
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<OrganizationLocation> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(orgLocQueryParam, null, null, request);
|
||||
// 查询机构位置分页列表
|
||||
Page<OrgLocQueryDto> orgLocQueryDtoPage =
|
||||
HisPageUtils.selectPage(organizationLocationMapper, queryWrapper, pageNo, pageSize, OrgLocQueryDto.class);
|
||||
return R.ok(orgLocQueryDtoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑机构位置信息
|
||||
*
|
||||
* @param orgLocQueryDto 机构位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditOrgLoc(OrgLocQueryDto orgLocQueryDto) {
|
||||
|
||||
OrganizationLocation orgLoc = new OrganizationLocation();
|
||||
BeanUtils.copyProperties(orgLocQueryDto, orgLoc);
|
||||
|
||||
if (orgLocQueryDto.getId() != null) {
|
||||
// 更新机构位置信息
|
||||
organizationLocationService.updateById(orgLoc);
|
||||
} else {
|
||||
// 新增机构位置信息
|
||||
organizationLocationService.save(orgLoc);
|
||||
}
|
||||
// 返回机构位置id
|
||||
return R.ok(orgLoc.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构位置信息更新添加"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机构位置
|
||||
*
|
||||
* @param orgLocId 机构位置信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteOrgLoc(Long orgLocId) {
|
||||
// 删除机构位置信息
|
||||
boolean deleteOrgLocSuccess = organizationLocationService.removeById(orgLocId);
|
||||
return deleteOrgLocSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"机构位置信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构位置信息"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,435 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.system.service.ISysTenantService;
|
||||
import com.openhis.administration.domain.BizUser;
|
||||
import com.openhis.administration.domain.BizUserRole;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.administration.domain.PractitionerRole;
|
||||
import com.openhis.administration.service.IBizUserRoleService;
|
||||
import com.openhis.administration.service.IBizUserService;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.PractitionerRoles;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerAppService;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerOrgAndLocationDto;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRolesDto;
|
||||
import com.openhis.web.basedatamanage.dto.SelectableOrgDto;
|
||||
import com.openhis.web.basedatamanage.dto.UserAndPractitionerDto;
|
||||
import com.openhis.web.basedatamanage.mapper.PractitionerAppAppMapper;
|
||||
|
||||
@Service
|
||||
public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
|
||||
@Resource
|
||||
PractitionerAppAppMapper practitionerAppAppMapper;
|
||||
|
||||
@Resource
|
||||
IBizUserService iBizUserService;
|
||||
|
||||
@Resource
|
||||
IBizUserRoleService iBizUserRoleService;
|
||||
|
||||
@Resource
|
||||
IPractitionerService iPractitionerService;
|
||||
|
||||
@Resource
|
||||
IPractitionerRoleService iPractitionerRoleService;
|
||||
|
||||
@Resource
|
||||
ISysTenantService sysTenantService;
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> saveUserPractitioner(UserAndPractitionerDto userAndPractitionerDto) {
|
||||
String userName = userAndPractitionerDto.getUserName();
|
||||
String nickName = userAndPractitionerDto.getNickName();
|
||||
String phonenumber = userAndPractitionerDto.getPhonenumber();
|
||||
String pharPracCertNo = userAndPractitionerDto.getPharPracCertNo(); // 职业证件编号
|
||||
String sex = userAndPractitionerDto.getSex();
|
||||
// 账号唯一性
|
||||
long count = iBizUserService.count(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserName, userName));
|
||||
if (count > 0L) {
|
||||
return R.fail(null, "账号已存在");
|
||||
}
|
||||
// 新增 sys_user
|
||||
BizUser bizUser = new BizUser();
|
||||
bizUser.setUserName(userName); // 账号
|
||||
bizUser.setNickName(nickName); // 昵称
|
||||
bizUser.setEmail(userAndPractitionerDto.getEmail());// 邮箱
|
||||
bizUser.setPhonenumber(phonenumber); // 电话
|
||||
bizUser.setSex(sex); // 性别
|
||||
bizUser.setPassword(SecurityUtils.encryptPassword(userAndPractitionerDto.getPassword())); // 密码
|
||||
bizUser.setStatus(userAndPractitionerDto.getStatus()); // 状态
|
||||
bizUser.setRemark(userAndPractitionerDto.getRemark()); // 备注
|
||||
iBizUserService.save(bizUser);
|
||||
Long userId =
|
||||
iBizUserService.getOne(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserName, userName)).getUserId(); // 用户id
|
||||
|
||||
// 初始化租户绑定
|
||||
sysTenantService.initTenantBind(userId);
|
||||
|
||||
// 新增 sys_user_role
|
||||
List<PractitionerRolesDto> practitionerRoleDtoList = userAndPractitionerDto.getPractitionerRolesDtoList();
|
||||
BizUserRole bizUserRole;
|
||||
for (PractitionerRolesDto practitionerRolesDto : practitionerRoleDtoList) {
|
||||
bizUserRole = new BizUserRole();
|
||||
bizUserRole.setUserId(userId);
|
||||
bizUserRole.setRoleId(practitionerRolesDto.getRoleId());
|
||||
iBizUserRoleService.save(bizUserRole);
|
||||
}
|
||||
// 新增 adm_practitioner
|
||||
Practitioner practitioner = new Practitioner();
|
||||
practitioner.setActiveFlag(AccountStatus.ACTIVE.getValue()); // 活动标记
|
||||
practitioner.setName(nickName); // 姓名
|
||||
practitioner.setGenderEnum(Integer.parseInt(sex)); // 性别
|
||||
practitioner.setBirthDate(userAndPractitionerDto.getBirthDate()); // 出生日期
|
||||
practitioner.setPhone(phonenumber); // 电话
|
||||
practitioner.setAddress(userAndPractitionerDto.getAddress()); // 地址
|
||||
practitioner.setYbNo(userAndPractitionerDto.getYbNo()); // 医保码
|
||||
practitioner.setUserId(userId); // 系统用户id
|
||||
// 责任科室
|
||||
List<PractitionerOrgAndLocationDto> responsibilityOrgDtoList =
|
||||
userAndPractitionerDto.getResponsibilityOrgDtoList();
|
||||
practitioner.setOrgId(responsibilityOrgDtoList.get(0).getOrgId()); // 机构id
|
||||
practitioner.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(nickName)); // 拼音码
|
||||
practitioner.setWbStr(ChineseConvertUtils.toWBFirstLetter(nickName)); // 五笔码
|
||||
practitioner.setPharPracCertNo(pharPracCertNo); // 职业证件编号
|
||||
iPractitionerService.save(practitioner);
|
||||
Long practitionerId = practitioner.getId();// 参与者id
|
||||
// 新增 adm_practitioner_role
|
||||
PractitionerRole practitionerRole;
|
||||
// 1.责任科室
|
||||
for (PractitionerOrgAndLocationDto responsibilityOrgDto : responsibilityOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setOrgId(responsibilityOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 2.医生出诊科室
|
||||
List<PractitionerOrgAndLocationDto> doctorVisitOrgDtoList = userAndPractitionerDto.getDoctorVisitOrgDtoList();
|
||||
for (PractitionerOrgAndLocationDto doctorVisitOrgDto : doctorVisitOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.DOCTOR.getCode());// 角色code
|
||||
practitionerRole.setOrgId(doctorVisitOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 3.管理库房
|
||||
List<PractitionerOrgAndLocationDto> manageLocationDtoList = userAndPractitionerDto.getManageLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageLocationDto : manageLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.LOCATION_ADMIN.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 4.管理药房
|
||||
List<PractitionerOrgAndLocationDto> manageMedicationLocationDtoList =
|
||||
userAndPractitionerDto.getManageMedicationLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto practitionerOrgAndLocationDto : manageMedicationLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.PHARMACIST.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(practitionerOrgAndLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理科室集合
|
||||
List<PractitionerOrgAndLocationDto> manageOrgDtoList = userAndPractitionerDto.getManageOrgDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageOrgDto : manageOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode());// 角色code
|
||||
practitionerRole.setOrgId(manageOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理病区集合
|
||||
List<PractitionerOrgAndLocationDto> manageWardLocationDtoList =
|
||||
userAndPractitionerDto.getManageWardLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageWardLocationDto : manageWardLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageWardLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"人员信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 用户及参与者
|
||||
*/
|
||||
@Override
|
||||
public IPage<UserAndPractitionerDto> getUserPractitionerPage(UserAndPractitionerDto userAndPractitionerDto,
|
||||
String searchKey, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<UserAndPractitionerDto> queryWrapper = HisQueryUtils.buildQueryWrapper(userAndPractitionerDto,
|
||||
searchKey, new HashSet<>(Arrays.asList("user_name", "nick_name", "py_str", "wb_str")), null);
|
||||
queryWrapper.orderByDesc("user_id");
|
||||
IPage<UserAndPractitionerDto> userPractitionerPage =
|
||||
practitionerAppAppMapper.getUserPractitionerPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
List<UserAndPractitionerDto> records = userPractitionerPage.getRecords();
|
||||
// 参与者id集合
|
||||
List<Long> practitionerIdList =
|
||||
records.stream().map(UserAndPractitionerDto::getPractitionerId).collect(Collectors.toList());
|
||||
// 角色集合
|
||||
List<PractitionerRolesDto> practitionerRolesDtoList =
|
||||
practitionerAppAppMapper.getPractitionerRolesDtoList(practitionerIdList);
|
||||
// 科室和位置
|
||||
List<PractitionerOrgAndLocationDto> orgAndLocationDtoList =
|
||||
practitionerAppAppMapper.getOrgAndLocationDtoList(practitionerIdList);
|
||||
for (UserAndPractitionerDto record : records) {
|
||||
// 匹配角色
|
||||
List<PractitionerRolesDto> list1 = practitionerRolesDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())).collect(Collectors.toList());
|
||||
record.setPractitionerRolesDtoList(list1);
|
||||
// 匹配责任科室
|
||||
List<PractitionerOrgAndLocationDto> list2 = orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId()) && "".equals(e.getRoleCode()))
|
||||
.collect(Collectors.toList());
|
||||
record.setResponsibilityOrgDtoList(list2);
|
||||
// 匹配医生出诊科室
|
||||
List<PractitionerOrgAndLocationDto> list3 =
|
||||
orgAndLocationDtoList.stream().filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.DOCTOR.getCode().equals(e.getRoleCode())).collect(Collectors.toList());
|
||||
record.setDoctorVisitOrgDtoList(list3);
|
||||
// 匹配管理库房
|
||||
List<PractitionerOrgAndLocationDto> list4 =
|
||||
orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.LOCATION_ADMIN.getCode().equals(e.getRoleCode()))
|
||||
.collect(Collectors.toList());
|
||||
record.setManageLocationDtoList(list4);
|
||||
// 匹配管理药房
|
||||
List<
|
||||
PractitionerOrgAndLocationDto> list5 =
|
||||
orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.PHARMACIST.getCode().equals(e.getRoleCode()))
|
||||
.collect(Collectors.toList());
|
||||
record.setManageMedicationLocationDtoList(list5);
|
||||
// 匹配护士-管理科室
|
||||
List<PractitionerOrgAndLocationDto> list6 = orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.NURSE.getCode().equals(e.getRoleCode()) && e.getOrgId() != null)
|
||||
.collect(Collectors.toList());
|
||||
record.setManageOrgDtoList(list6);
|
||||
// 匹配护士-管理病区
|
||||
List<PractitionerOrgAndLocationDto> list7 = orgAndLocationDtoList.stream()
|
||||
.filter(e -> e.getPractitionerId().equals(record.getPractitionerId())
|
||||
&& PractitionerRoles.NURSE.getCode().equals(e.getRoleCode()) && e.getLocationId() != null)
|
||||
.collect(Collectors.toList());
|
||||
record.setManageWardLocationDtoList(list7);
|
||||
}
|
||||
return userPractitionerPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户及参与者 : 登录账号和密码不允许编辑
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> editUserPractitioner(UserAndPractitionerDto userAndPractitionerDto) {
|
||||
Long userId = userAndPractitionerDto.getUserId(); // 系统用户id
|
||||
Long practitionerId = userAndPractitionerDto.getPractitionerId(); // 参与者id
|
||||
|
||||
String nickName = userAndPractitionerDto.getNickName();
|
||||
String phonenumber = userAndPractitionerDto.getPhonenumber();
|
||||
String sex = userAndPractitionerDto.getSex();
|
||||
String pharPracCertNo = userAndPractitionerDto.getPharPracCertNo(); // 职业证件编号
|
||||
// 编辑 sys_user
|
||||
BizUser bizUser = new BizUser();
|
||||
bizUser.setNickName(nickName); // 昵称
|
||||
bizUser.setEmail(userAndPractitionerDto.getEmail());// 邮箱
|
||||
bizUser.setPhonenumber(phonenumber); // 电话
|
||||
bizUser.setSex(sex); // 性别
|
||||
bizUser.setStatus(userAndPractitionerDto.getStatus()); // 状态
|
||||
bizUser.setRemark(userAndPractitionerDto.getRemark()); // 备注
|
||||
iBizUserService.update(bizUser, new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserId, userId));
|
||||
// 先删除,再新增 sys_user_role
|
||||
practitionerAppAppMapper.delUserRole(userId);
|
||||
List<PractitionerRolesDto> practitionerRoleDtoList = userAndPractitionerDto.getPractitionerRolesDtoList();
|
||||
BizUserRole bizUserRole;
|
||||
for (PractitionerRolesDto practitionerRolesDto : practitionerRoleDtoList) {
|
||||
bizUserRole = new BizUserRole();
|
||||
bizUserRole.setUserId(userId);
|
||||
bizUserRole.setRoleId(practitionerRolesDto.getRoleId());
|
||||
iBizUserRoleService.save(bizUserRole);
|
||||
}
|
||||
// 编辑 adm_practitioner
|
||||
Practitioner practitioner = new Practitioner();
|
||||
practitioner.setId(practitionerId);
|
||||
practitioner.setName(nickName); // 姓名
|
||||
practitioner.setGenderEnum(Integer.parseInt(sex)); // 性别
|
||||
practitioner.setBirthDate(userAndPractitionerDto.getBirthDate()); // 出生日期
|
||||
practitioner.setPhone(phonenumber); // 电话
|
||||
practitioner.setAddress(userAndPractitionerDto.getAddress()); // 地址
|
||||
practitioner.setYbNo(userAndPractitionerDto.getYbNo()); // 医保码
|
||||
practitioner.setUserId(userId); // 系统用户id
|
||||
// 责任科室
|
||||
List<PractitionerOrgAndLocationDto> responsibilityOrgDtoList =
|
||||
userAndPractitionerDto.getResponsibilityOrgDtoList();
|
||||
practitioner.setOrgId(responsibilityOrgDtoList.get(0).getOrgId()); // 机构id
|
||||
practitioner.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(nickName)); // 拼音码
|
||||
practitioner.setWbStr(ChineseConvertUtils.toWBFirstLetter(nickName)); // 五笔码
|
||||
practitioner.setPharPracCertNo(pharPracCertNo);// 职业证件编号
|
||||
iPractitionerService.updateById(practitioner);
|
||||
// 先删除,再新增 adm_practitioner_role
|
||||
practitionerAppAppMapper.delPractitionerRole(practitionerId);
|
||||
PractitionerRole practitionerRole;
|
||||
// 1.责任科室
|
||||
for (PractitionerOrgAndLocationDto responsibilityOrgDto : responsibilityOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setOrgId(responsibilityOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 2.医生出诊科室
|
||||
List<PractitionerOrgAndLocationDto> doctorVisitOrgDtoList = userAndPractitionerDto.getDoctorVisitOrgDtoList();
|
||||
for (PractitionerOrgAndLocationDto doctorVisitOrgDto : doctorVisitOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.DOCTOR.getCode());// 角色code
|
||||
practitionerRole.setOrgId(doctorVisitOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 3.管理库房
|
||||
List<PractitionerOrgAndLocationDto> manageLocationDtoList = userAndPractitionerDto.getManageLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageLocationDto : manageLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.LOCATION_ADMIN.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 4.管理药房
|
||||
List<PractitionerOrgAndLocationDto> manageMedicationLocationDtoList =
|
||||
userAndPractitionerDto.getManageMedicationLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto practitionerOrgAndLocationDto : manageMedicationLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.PHARMACIST.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(practitionerOrgAndLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理科室集合
|
||||
List<PractitionerOrgAndLocationDto> manageOrgDtoList = userAndPractitionerDto.getManageOrgDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageOrgDto : manageOrgDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode());// 角色code
|
||||
practitionerRole.setOrgId(manageOrgDto.getOrgId()); // 机构id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
// 5.护士-管理病区集合
|
||||
List<PractitionerOrgAndLocationDto> manageWardLocationDtoList =
|
||||
userAndPractitionerDto.getManageWardLocationDtoList();
|
||||
for (PractitionerOrgAndLocationDto manageWardLocationDto : manageWardLocationDtoList) {
|
||||
practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setName(nickName); // 姓名
|
||||
practitionerRole.setPractitionerId(practitionerId); // 参与者id
|
||||
practitionerRole.setRoleCode(PractitionerRoles.NURSE.getCode()); // 角色code
|
||||
practitionerRole.setLocationId(manageWardLocationDto.getLocationId()); // 位置id
|
||||
iPractitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"人员信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户及参与者 ; admin不允许删除
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> delUserPractitioner(Long userId) {
|
||||
if (1L == userId) {
|
||||
return R.fail(null, "admin不允许删除");
|
||||
}
|
||||
iBizUserService.remove(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserId, userId));
|
||||
practitionerAppAppMapper.delUserRole(userId);
|
||||
Practitioner one =
|
||||
iPractitionerService.getOne(new LambdaQueryWrapper<Practitioner>().eq(Practitioner::getUserId, userId));
|
||||
Long practitionerId = one.getId();// 参与者id
|
||||
iPractitionerService.removeById(practitionerId);
|
||||
iPractitionerRoleService
|
||||
.remove(new LambdaQueryWrapper<PractitionerRole>().eq(PractitionerRole::getPractitionerId, practitionerId));
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"人员信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
@Override
|
||||
public List<SelectableOrgDto> getSelectableOrgList() {
|
||||
// 参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
return practitionerAppAppMapper.getSelectableOrgList(practitionerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换科室
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> switchOrg(Long orgId) {
|
||||
// 参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
Practitioner practitioner = new Practitioner();
|
||||
practitioner.setId(practitionerId);
|
||||
practitioner.setOrgId(orgId);
|
||||
iPractitionerService.updateById(practitioner);
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"切换科室"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.domain.PractitionerRole;
|
||||
import com.openhis.administration.mapper.PractitionerRoleMapper;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerRoleAppService;
|
||||
import com.openhis.web.basedatamanage.dto.PractRoleSearchParam;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRoleDto;
|
||||
|
||||
@Service
|
||||
public class PractitionerRoleAppServiceImpl implements IPractitionerRoleAppService {
|
||||
|
||||
@Autowired
|
||||
private IPractitionerRoleService practitionerRoleService;
|
||||
@Autowired
|
||||
private PractitionerRoleMapper practitionerRoleMapper;
|
||||
|
||||
@Override
|
||||
public R<?> getPractitionerPage(PractRoleSearchParam practRoleSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<PractitionerRole> queryWrapper = HisQueryUtils.buildQueryWrapper(practRoleSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("name")), request);
|
||||
|
||||
// 查询岗位分页列表
|
||||
Page<PractitionerRoleDto> practitionerRoleDtoPage =
|
||||
HisPageUtils.selectPage(practitionerRoleMapper, queryWrapper, pageNo, pageSize, PractitionerRoleDto.class);
|
||||
|
||||
return R.ok(practitionerRoleDtoPage,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"岗位信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位信息详情
|
||||
*
|
||||
* @param practitionerRoleId 岗位信息id
|
||||
* @return 岗位信息详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPractitionerRoleById(Long practitionerRoleId) {
|
||||
PractitionerRole practitionerRole = practitionerRoleService.getById(practitionerRoleId);
|
||||
if (practitionerRole != null) {
|
||||
return R.ok(practitionerRole,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"岗位信息"}));
|
||||
} else {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"岗位信息查询失败"}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑岗位信息
|
||||
*
|
||||
* @param practitionerRoleDto 岗位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditPractitionerRole(PractitionerRoleDto practitionerRoleDto) {
|
||||
|
||||
PractitionerRole practitionerRole = new PractitionerRole();
|
||||
BeanUtils.copyProperties(practitionerRoleDto, practitionerRole);
|
||||
// if (practitionerRole.getRoleCode() == null) {
|
||||
// return R.fail(PromptMsgConstant.Common.M00007, "角色编码不能为空");
|
||||
// }
|
||||
// if (practitionerRole.getOrgId() == null) {
|
||||
// return R.fail(PromptMsgConstant.Common.M00007, "科室不能为空");
|
||||
// }
|
||||
// if (practitionerRole.getLocationId() == null) {
|
||||
// return R.fail(PromptMsgConstant.Common.M00007, "位置不能为空");
|
||||
// }
|
||||
|
||||
if (practitionerRoleDto.getId() != null) {
|
||||
// 更新岗位信息
|
||||
practitionerRoleService.updateById(practitionerRole);
|
||||
} else {
|
||||
// 新增岗位信息
|
||||
// practitionerRoleService.save(practitionerRole);
|
||||
}
|
||||
|
||||
// 返回岗位id
|
||||
return R.ok(practitionerRole.getId(),
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"岗位信息更新添加"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
*
|
||||
* @param practitionerRoleId 岗位信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deletePractitionerRole(Long practitionerRoleId) {
|
||||
// 删除岗位信息
|
||||
boolean deletePractitionerRole = practitionerRoleService.removeById(practitionerRoleId);
|
||||
return deletePractitionerRole
|
||||
? R.ok(practitionerRoleId,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"岗位信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"岗位信息"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.web.basedatamanage.appservice.IBodyStructureAppService;
|
||||
import com.openhis.web.basedatamanage.dto.BodyStructureDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 身体部位管理controller
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/body-structure")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class BodyStructureController {
|
||||
|
||||
private final IBodyStructureAppService bodyStructureService;
|
||||
|
||||
/**
|
||||
* 身体部位分页列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 身体部位分页列表
|
||||
*/
|
||||
@GetMapping(value = "/body")
|
||||
public R<?> getBodyStructurePage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, HttpServletRequest request) {
|
||||
Page<BodyStructureDto> bodyStructureTree = bodyStructureService.getBodyStructureTree(pageNo, pageSize, request);
|
||||
return R.ok(bodyStructureTree,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"身体部位信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取身体部位需要编辑的信息
|
||||
*
|
||||
* @param id 身体部位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@GetMapping("/body-getById")
|
||||
public R<?> getOrgInfo(@Validated @RequestParam Long id) {
|
||||
return bodyStructureService.getBodyStructureInfo(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑身体部位
|
||||
*
|
||||
* @param bodyStructureDto 身体部位信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/body")
|
||||
public R<?> addOrEditInventoryReceipt(@Validated @RequestBody BodyStructureDto bodyStructureDto) {
|
||||
return bodyStructureService.addOrEditBodyStructure(bodyStructureDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除身体部位
|
||||
*
|
||||
* @param ids 需要删除的Id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/body")
|
||||
public R<?> deleteBodyStructure(@RequestParam String ids) {
|
||||
return bodyStructureService.deleteBodyStructure(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 身体部位启用
|
||||
*
|
||||
* @param id 启用数据的Id
|
||||
* @return 操作结果
|
||||
*
|
||||
*/
|
||||
@PutMapping("/body-active")
|
||||
public R<?> activeBodyStructure(@RequestParam Long id) {
|
||||
return bodyStructureService.activeBodyStructure(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 身体部位停用
|
||||
*
|
||||
* @param id 停用数据的Id
|
||||
* @return 操作结果
|
||||
*
|
||||
*/
|
||||
@PutMapping("/body-inactive")
|
||||
public R<?> inactiveBodyStructure(@RequestParam Long id) {
|
||||
return bodyStructureService.inactiveBodyStructure(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.domain.Frequency;
|
||||
import com.openhis.administration.service.IFrequencyService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.FrequencyDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationInitDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 频次信息管理controller
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/personalization/frequency")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class FrequencyController {
|
||||
|
||||
private final IFrequencyService frequencyService;
|
||||
|
||||
/**
|
||||
* 频次详情分页列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 机构分页列表
|
||||
*/
|
||||
@GetMapping(value = "/getPageList")
|
||||
public R<?> getOrganizationPage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, String code,HttpServletRequest request) {
|
||||
Page<Frequency> pageList= frequencyService.getPageList(pageNo, pageSize, code,request) ;
|
||||
return R.ok(pageList,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"频次详情信息"}));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/save")
|
||||
public R<?> addOrEditFrequency(@Validated @RequestBody FrequencyDto frequencyDto) {
|
||||
// 创建 Frequency 对象
|
||||
Frequency frequency = new Frequency();
|
||||
// 使用 BeanUtils 拷贝属性
|
||||
BeanUtils.copyProperties(frequencyDto, frequency);
|
||||
// 获取并转换 dayTimes 字段
|
||||
List<String> dayTimesList = frequencyDto.getDayTimes();
|
||||
if (dayTimesList != null && !dayTimesList.isEmpty()) {
|
||||
Collections.sort(dayTimesList);
|
||||
String dayTimesStr = String.join(",", dayTimesList); // 转换为逗号分隔的字符串
|
||||
frequency.setDayTimes(dayTimesStr); // 将转换后的字符串设置到 Frequency 对象
|
||||
}
|
||||
|
||||
return R.ok(frequencyService.saveOrUpdate(frequency, new LambdaQueryWrapper<Frequency>().eq(Frequency::getRateCode, frequency.getRateCode())),MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"保存频次详情"}));
|
||||
}
|
||||
|
||||
@DeleteMapping("{id}")
|
||||
public R<?> deleteFrequency(@PathVariable Long id) {
|
||||
return R.ok(frequencyService.removeById(id),MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"删除频次详情"}));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.web.common.dto.LocationDto;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.appservice.ILocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.LocationAddOrEditDto;
|
||||
import com.openhis.web.basedatamanage.dto.LocationPageParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 位置管理Controller业务层处理
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/location")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class LocationController {
|
||||
|
||||
@Resource
|
||||
private ILocationAppService locationAppService;
|
||||
|
||||
/**
|
||||
* 位置初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
return locationAppService.locationInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置分页列表-树型
|
||||
*
|
||||
* @param formList 类型
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param isInHospital 是否住院
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@GetMapping(value = "/location-page-tree")
|
||||
public R<?> getLocationPage(@RequestParam List<Integer> formList,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "1000") Integer pageSize,
|
||||
@RequestParam(value = "isInHospital", defaultValue = "0") String isInHospital) {
|
||||
return locationAppService.getLocationTree(formList, pageNo, pageSize, isInHospital);
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置分页列表
|
||||
*
|
||||
* @param locationPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param request 请求
|
||||
* @return 位置分页列表
|
||||
*/
|
||||
@GetMapping(value = "/location-page")
|
||||
public R<?> getLocationPage(LocationPageParam locationPageParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
return locationAppService.getLocationPage(locationPageParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取位置信息详情
|
||||
*
|
||||
* @param locationId 位置Id
|
||||
* @return 位置信息
|
||||
*/
|
||||
@GetMapping("/location")
|
||||
public R<?> getLocationById(@RequestParam Long locationId) {
|
||||
return locationAppService.getLocationById(locationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/location")
|
||||
public R<?> addLocation(@Validated @RequestBody LocationAddOrEditDto locationAddOrEditDto) {
|
||||
return locationAppService.addLocation(locationAddOrEditDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑位置信息
|
||||
*
|
||||
* @param locationAddOrEditDto 库房位置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/location")
|
||||
public R<?> editLocation(@Validated @RequestBody LocationAddOrEditDto locationAddOrEditDto) {
|
||||
return locationAppService.editLocation(locationAddOrEditDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除位置信息
|
||||
*
|
||||
* @param busNo 位置信息编码
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/location")
|
||||
public R<?> deleteLocation(@RequestParam String busNo) {
|
||||
return locationAppService.deleteLocation(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/enable")
|
||||
public R<?> enableLocation(@RequestBody List<Long> locationIdList) {
|
||||
return locationAppService.enableLocation(locationIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用
|
||||
*
|
||||
* @param locationIdList 位置id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/deactivate")
|
||||
public R<?> deactivateLocation(@RequestBody List<Long> locationIdList) {
|
||||
return locationAppService.deactivateLocation(locationIdList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationInitDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 机构管理controller
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/organization")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OrganizationController {
|
||||
|
||||
private final IOrganizationAppService iOrganizationAppService;
|
||||
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
return R.ok(new OrganizationInitDto());
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构分页列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 机构分页列表
|
||||
*/
|
||||
@GetMapping(value = "/organization")
|
||||
public R<?> getOrganizationPage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, HttpServletRequest request) {
|
||||
Page<OrganizationDto> organizationTree = iOrganizationAppService.getOrganizationTree(pageNo, pageSize, request);
|
||||
return R.ok(organizationTree,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"机构信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构需要编辑的信息
|
||||
*
|
||||
* @param orgId 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@GetMapping("/organization-getById")
|
||||
public R<?> getOrgInfo(@Validated @RequestParam Long orgId) {
|
||||
return iOrganizationAppService.getOrgInfo(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑机构信息
|
||||
*
|
||||
* @param organizationDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/organization")
|
||||
public R<?> addOrEditInventoryReceipt(@Validated @RequestBody OrganizationDto organizationDto) {
|
||||
return iOrganizationAppService.addOrEditOrganization(organizationDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机构信息
|
||||
*
|
||||
* @param orgIds 需要删除的Id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/organization")
|
||||
public R<?> deleteOrganization(@RequestParam String orgIds) {
|
||||
return iOrganizationAppService.deleteOrganization(orgIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构启用
|
||||
*
|
||||
* @param orgId 启用数据的Id
|
||||
* @return 操作结果
|
||||
*
|
||||
*/
|
||||
@PutMapping("/organization-active")
|
||||
public R<?> activeOrganization(@RequestParam Long orgId) {
|
||||
return iOrganizationAppService.activeOrg(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构停用
|
||||
*
|
||||
* @param orgId 停用数据的Id
|
||||
* @return 操作结果
|
||||
*
|
||||
*/
|
||||
@PutMapping("/organization-inactive")
|
||||
public R<?> inactiveOrganization(@RequestParam Long orgId) {
|
||||
return iOrganizationAppService.inactiveOrg(orgId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationLocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrgLocQueryParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 机构位置关系controller
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/org-loc")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OrganizationLocationController {
|
||||
|
||||
@Autowired
|
||||
private IOrganizationLocationAppService organizationLocationAppService;
|
||||
|
||||
/**
|
||||
* 机构位置关系初始化
|
||||
*
|
||||
* @return 操作结果
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
return organizationLocationAppService.organizationLocationInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构位置关系分页列表
|
||||
*
|
||||
* @param orgLocQueryParam 查询字段
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@GetMapping(value = "/org-loc")
|
||||
public R<?> getOrgLocPage(OrgLocQueryParam orgLocQueryParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return organizationLocationAppService.getOrgLocPage(orgLocQueryParam, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型查询药房/药库
|
||||
*
|
||||
* @param locationForm 查询字段
|
||||
* @return 机构位置关系分页列表
|
||||
*/
|
||||
@GetMapping(value = "/loc-list")
|
||||
public R<?> getLocationListByForm(@RequestParam Integer locationForm) {
|
||||
return organizationLocationAppService.getLocationListByForm(locationForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/编辑机构位置关系信息
|
||||
*
|
||||
* @param orgLocQueryDto 机构位置关系信息
|
||||
*/
|
||||
@PostMapping("/org-loc")
|
||||
public R<?> addOrEditOrgLoc(@Validated @RequestBody OrgLocQueryDto orgLocQueryDto) {
|
||||
return organizationLocationAppService.addOrEditOrgLoc(orgLocQueryDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机构位置关系信息
|
||||
*
|
||||
* @param orgLocId 主表id
|
||||
*/
|
||||
@DeleteMapping("/org-loc")
|
||||
public R<?> delOrgLoc(@RequestParam Long orgLocId) {
|
||||
return organizationLocationAppService.deleteOrgLoc(orgLocId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerAppService;
|
||||
import com.openhis.web.basedatamanage.dto.UserAndPractitionerDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 参与者 Controller业务层处理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/practitioner")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class PractitionerController {
|
||||
|
||||
private final IPractitionerAppService practitionerAppService;
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/user-practitioner")
|
||||
public R<?> saveUserPractitioner(@RequestBody UserAndPractitionerDto userAndPractitionerDto) {
|
||||
return practitionerAppService.saveUserPractitioner(userAndPractitionerDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 用户及参与者
|
||||
*/
|
||||
@GetMapping(value = "/user-practitioner-page")
|
||||
public R<?> getUserPractitionerPage(UserAndPractitionerDto userAndPractitionerDto,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return R
|
||||
.ok(practitionerAppService.getUserPractitionerPage(userAndPractitionerDto, searchKey, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户及参与者详情
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
* @return 用户及参与者详情
|
||||
*/
|
||||
@GetMapping(value = "/user-practitioner-detail")
|
||||
public R<?> getUserPractitionerPage(@RequestParam Long userId) {
|
||||
UserAndPractitionerDto userAndPractitionerDto = new UserAndPractitionerDto();
|
||||
userAndPractitionerDto.setUserId(userId);
|
||||
IPage<UserAndPractitionerDto> userPractitionerPage =
|
||||
practitionerAppService.getUserPractitionerPage(userAndPractitionerDto, "", 1, 1);
|
||||
return R.ok(userPractitionerPage.getRecords().get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户及参与者
|
||||
*
|
||||
* @param userAndPractitionerDto 用户及参与者dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "/user-practitioner")
|
||||
public R<?> editUserPractitioner(@RequestBody UserAndPractitionerDto userAndPractitionerDto) {
|
||||
return practitionerAppService.editUserPractitioner(userAndPractitionerDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户及参与者 ; admin不允许删除
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
* @return 结果
|
||||
*/
|
||||
@DeleteMapping(value = "/user-practitioner")
|
||||
public R<?> delUserPractitioner(@RequestParam Long userId) {
|
||||
return practitionerAppService.delUserPractitioner(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
@GetMapping(value = "/get-selectable-org-list")
|
||||
public R<?> getSelectableOrgList() {
|
||||
return R.ok(practitionerAppService.getSelectableOrgList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换科室
|
||||
*
|
||||
* @param orgId 科室id
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "/switch-org")
|
||||
public R<?> switchOrg(@RequestParam Long orgId) {
|
||||
return practitionerAppService.switchOrg(orgId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerRoleAppService;
|
||||
import com.openhis.web.basedatamanage.dto.PractRoleSearchParam;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRoleDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 岗位管理Controller业务层处理
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-data-manage/practitioner-role")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class PractitionerRoleController {
|
||||
|
||||
@Autowired
|
||||
private IPractitionerRoleAppService practitionerRoleAppService;
|
||||
|
||||
/**
|
||||
* 岗位分页列表
|
||||
*
|
||||
* @param practRoleSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 岗位分页列表
|
||||
*/
|
||||
@GetMapping(value = "/practitioner-role")
|
||||
public R<?> getPractitionerRolePage(PractRoleSearchParam practRoleSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return practitionerRoleAppService.getPractitionerPage(practRoleSearchParam, searchKey, pageNo, pageSize,
|
||||
request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位需要编辑的信息
|
||||
*
|
||||
* @param practitionerRoleId 岗位信息
|
||||
*/
|
||||
@GetMapping("/practitioner-role-getById")
|
||||
public R<?> getPractitionerRoleById(@Validated @RequestParam Long practitionerRoleId) {
|
||||
return practitionerRoleAppService.getPractitionerRoleById(practitionerRoleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑岗位信息
|
||||
*
|
||||
* @param practitionerRoleDto 岗位信息
|
||||
*/
|
||||
@PutMapping("/practitioner-role")
|
||||
public R<?> editPractitionerRole(@Validated @RequestBody PractitionerRoleDto practitionerRoleDto) {
|
||||
return practitionerRoleAppService.addOrEditPractitionerRole(practitionerRoleDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位信息
|
||||
*
|
||||
* @param practitionerRoleId 主表id
|
||||
*/
|
||||
@DeleteMapping("/practitioner-role")
|
||||
public R<?> deletePractitionerRole(@RequestParam Long practitionerRoleId) {
|
||||
return practitionerRoleAppService.deletePractitionerRole(practitionerRoleId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author liuhr
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BodyStructureDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 状态枚举 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 子集合 */
|
||||
private List<BodyStructureDto> children = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/8/25
|
||||
*/
|
||||
@Data
|
||||
public class FrequencyDto {
|
||||
/**
|
||||
* 频次代码,唯一标识与字典表对应
|
||||
*/
|
||||
private String rateCode;
|
||||
|
||||
/**
|
||||
* 频次名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 每天执行的次数
|
||||
*/
|
||||
private Integer dayCount;
|
||||
|
||||
/**
|
||||
* 每次执行之间的间隔(天数)
|
||||
*/
|
||||
private Integer dayInterval;
|
||||
|
||||
/**
|
||||
* 每天的具体执行时间点,逗号分隔
|
||||
*/
|
||||
private List<String> dayTimes;
|
||||
|
||||
/**
|
||||
* 是否周期性每周执行,0 为否,1 为是
|
||||
*/
|
||||
private Integer weekCycleFlag;
|
||||
|
||||
/**
|
||||
* 每周执行的间隔,单位为周
|
||||
*/
|
||||
private Integer weekInterval;
|
||||
|
||||
/**
|
||||
* 每周执行的次数
|
||||
*/
|
||||
private Integer weekTimes;
|
||||
|
||||
/**
|
||||
* 是否为连续执行,0 为否,1 为是
|
||||
*/
|
||||
private Integer continueFlag;
|
||||
|
||||
/**
|
||||
* 执行总次数,记录任务累计执行次数
|
||||
*/
|
||||
private Integer totalExecutionCount;
|
||||
|
||||
/**
|
||||
* 任务执行周期长度
|
||||
*/
|
||||
private Integer executionPeriod;
|
||||
|
||||
/**
|
||||
* 任务执行周期的单位,如 day、week、month
|
||||
*/
|
||||
private String executionPeriodUnit;
|
||||
|
||||
/**
|
||||
* 第三方代码,外部系统使用
|
||||
*/
|
||||
private String thirdCode;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
/**
|
||||
* 并发戳,用于版本控制和并发冲突检测
|
||||
*/
|
||||
private Integer concurrencyStamp;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 位置信息新增编辑dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationAddOrEditDto {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
@NotNull
|
||||
private String name;
|
||||
|
||||
/** 物理形式枚举 */
|
||||
@NotNull
|
||||
private String formEnum;
|
||||
|
||||
/** 机构编码 */
|
||||
private Long organizationId;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationDto {
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
@NotBlank(message = "位置编码不能为空")
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
@NotBlank(message = "位置名称不能为空")
|
||||
private String name;
|
||||
|
||||
/** 状态编码 */
|
||||
@NotNull(message = "状态编码不能为空")
|
||||
// private LocationStatus statusEnum;
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 操作状态 */
|
||||
@NotNull(message = "操作状态不能为空")
|
||||
// private LocationBedStatus operationalEnum;
|
||||
private Integer operationalEnum;
|
||||
private String operationalEnum_enumText;
|
||||
|
||||
/** 模式编码 */
|
||||
@NotNull(message = "模式编码不能为空")
|
||||
// private LocationMode modeEnum;
|
||||
private Integer modeEnum;
|
||||
private String modeEnum_enumText;
|
||||
|
||||
/** 模式编码 */
|
||||
private String typeCode;
|
||||
|
||||
/** 功能编码 */
|
||||
@NotBlank(message = "功能编码不能为空")
|
||||
private String typeJson;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 物理形式枚举 */
|
||||
@NotNull(message = "物理形式枚举不能为空")
|
||||
// private LocationForm formEnum;
|
||||
private Integer formEnum;
|
||||
private String formEnum_enumText;
|
||||
|
||||
/** 机构编码 */
|
||||
@NotNull(message = "机构编码不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
/** 子集合 */
|
||||
private List<LocationDto> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 位置信息
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationInfoDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 状态编码 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 操作状态 */
|
||||
private Integer operationalEnum;
|
||||
private String operationalEnum_enumText;
|
||||
|
||||
/** 物理形式枚举 */
|
||||
private Integer formEnum;
|
||||
private String formEnum_enumText;
|
||||
|
||||
/** 机构编码 */
|
||||
@Dict(dictCode = "id",dictText = "name",dictTable = "adm_organization")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 位置信息初始化dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationInitDto {
|
||||
|
||||
private List<LocationInitDto.locationStatusOption> locationStatusOptions;
|
||||
|
||||
/**
|
||||
* 位置状态
|
||||
*/
|
||||
@Data
|
||||
public static class locationStatusOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public locationStatusOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 位置信息分页查询条件
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LocationPageParam {
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 状态编码 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 位置类型 */
|
||||
private Integer formEnum;
|
||||
|
||||
/**
|
||||
* 位置分页默认初始类型(前端传)
|
||||
*/
|
||||
@NotEmpty
|
||||
private List<Integer> locationFormList;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 科室位置关系初始化 dto
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgLocInitDto {
|
||||
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
private List<OrgLocInitDto.locationFormOption> locationFormOptions;
|
||||
|
||||
/** 科室列表 */
|
||||
private List<OrgLocInitDto.departmentOption> departmentOptions;
|
||||
|
||||
/** 科室列表 */
|
||||
private List<OrgLocInitDto.locationOption> locationOptions;
|
||||
|
||||
/** 位置列表 */
|
||||
@Data
|
||||
public static class locationOption {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long value;
|
||||
private String label;
|
||||
|
||||
public locationOption(Long value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/** 科室列表 */
|
||||
@Data
|
||||
public static class departmentOption {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long value;
|
||||
private String label;
|
||||
|
||||
public departmentOption(Long value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
@Data
|
||||
public static class locationFormOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public locationFormOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.sql.Time;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgLocQueryDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 机构编码 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
private Long organizationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
/** 默认药房 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long defLocationId;
|
||||
|
||||
/** 发放类别 */
|
||||
private String distributionCategoryCode;
|
||||
|
||||
/**
|
||||
* 诊疗定义id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictCode = "id", dictText = "name", dictTable = "wor_activity_definition")
|
||||
private Long activityDefinitionId;
|
||||
private String activityDefinitionId_dictText;
|
||||
|
||||
/**
|
||||
* 诊疗类型
|
||||
*/
|
||||
@Dict(dictCode = "activity_category_code")
|
||||
private String activityCategoryCode;
|
||||
private String activityCategoryCode_dictText;
|
||||
|
||||
/** 开始时间 */
|
||||
// @JsonFormat(pattern = "HH:mm:ss")
|
||||
private Time startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
// @JsonFormat(pattern = "HH:mm:ss")
|
||||
private Time endTime;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 科室分页查询条件
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgLocQueryParam implements Serializable {
|
||||
|
||||
/**
|
||||
* 科室id
|
||||
*/
|
||||
private Long organizationId;
|
||||
|
||||
/**
|
||||
* 药房id
|
||||
*/
|
||||
private Long defLocationId;
|
||||
|
||||
/** 发放类别 */
|
||||
private String distributionCategoryCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrganizationDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 活动标识 */
|
||||
private Integer activeFlag;
|
||||
private String activeFlag_dictText;
|
||||
|
||||
/** 机构类型枚举 */
|
||||
private Integer typeEnum;
|
||||
private String typeEnum_dictText;
|
||||
|
||||
/** 机构分类枚举 */
|
||||
private Integer classEnum;
|
||||
private String classEnum_dictText;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 医保码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 医保名称 */
|
||||
private String ybName;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
/** 子集合 */
|
||||
private List<OrganizationDto> children = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 科室初始化 dto
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrganizationInitDto {
|
||||
|
||||
private List<OrganizationTypeOption> organizationTypeOptions;
|
||||
|
||||
private List<OrganizationClassOption> organizationClassOptions;
|
||||
|
||||
@Data
|
||||
public static class OrganizationTypeOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public OrganizationTypeOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class OrganizationClassOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public OrganizationClassOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
public OrganizationInitDto() {
|
||||
List<OrganizationTypeOption> organizationTypeOptionList = List.of(
|
||||
new OrganizationTypeOption(OrganizationType.HOSPITAL.getValue(), OrganizationType.HOSPITAL.getInfo()),
|
||||
new OrganizationTypeOption(OrganizationType.DEPARTMENT.getValue(), OrganizationType.DEPARTMENT.getInfo()));
|
||||
|
||||
List<OrganizationClassOption> organizationClassOptionList = List.of(
|
||||
new OrganizationClassOption(OrganizationClass.CLINIC.getValue(), OrganizationClass.CLINIC.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.INPATIENT.getValue(), OrganizationClass.INPATIENT.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.PHARMACY.getValue(), OrganizationClass.PHARMACY.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.STORAGE.getValue(), OrganizationClass.STORAGE.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.FIN.getValue(), OrganizationClass.FIN.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.NS.getValue(), OrganizationClass.NS.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.MANAGER.getValue(), OrganizationClass.MANAGER.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.SUPPORT.getValue(), OrganizationClass.SUPPORT.getInfo()),
|
||||
new OrganizationClassOption(OrganizationClass.OTHER.getValue(), OrganizationClass.OTHER.getInfo()));
|
||||
|
||||
this.organizationTypeOptions = organizationTypeOptionList;
|
||||
this.organizationClassOptions = organizationClassOptionList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 岗位分页查询条件
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractRoleSearchParam implements Serializable {
|
||||
|
||||
/** 专业编码枚举 */
|
||||
private Integer specialtyEnum;
|
||||
|
||||
/** 机构 */
|
||||
private Long orgId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 员工分页查询条件
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractSearchParam implements Serializable {
|
||||
|
||||
/** 活动标记 */
|
||||
private Integer activeFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractitionerDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 姓名 */
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
private String name;
|
||||
|
||||
/** 其他名称 */
|
||||
private String nameJson;
|
||||
|
||||
/** 性别编码 */
|
||||
// @NotBlank(message = "性别不能为空")
|
||||
// private AdministrativeGender genderEnum;
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
private Date birthDate;
|
||||
|
||||
/** 死亡时间 */
|
||||
private Date deceasedDate;
|
||||
|
||||
/** 电话 */
|
||||
private String phone;
|
||||
|
||||
/** 地址 */
|
||||
private String address;
|
||||
|
||||
/** 地址省 */
|
||||
private String addressProvince;
|
||||
|
||||
/** 地址市 */
|
||||
private String addressCity;
|
||||
|
||||
/** 地址区 */
|
||||
private String addressDistrict;
|
||||
|
||||
/** 地址街道 */
|
||||
private String addressStreet;
|
||||
|
||||
/** 患者其他地址 */
|
||||
private String addressJson;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 患者院内编码/病历号 */
|
||||
private String busNo;
|
||||
|
||||
/** 医保码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 系统用户id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 参与者机构和位置 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractitionerOrgAndLocationDto {
|
||||
|
||||
/**
|
||||
* 位置id
|
||||
*/
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
/**
|
||||
* 角色code
|
||||
*/
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 机构id
|
||||
*/
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
private String orgId_dictText;
|
||||
|
||||
/**
|
||||
* 参与者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractitionerRoleDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 名称 */
|
||||
@NotBlank(message = "角色名称不能为空")
|
||||
private String name;
|
||||
|
||||
/** 角色编码 */
|
||||
@NotBlank(message = "角色编码不能为空")
|
||||
private String role_code;
|
||||
|
||||
/** 活动标识 */
|
||||
@NotNull(message = "活动标识不能为空")
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 参与者Id */
|
||||
@NotNull(message = "参与者Id不能为空")
|
||||
private Long practitionerId;
|
||||
|
||||
/** 机构 */
|
||||
@NotNull(message = "机构不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 位置ID */
|
||||
@NotNull(message = "位置ID不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 服务id */
|
||||
@NotNull(message = "服务id不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long healthcareServiceId;
|
||||
|
||||
/** 专业编码枚举 */
|
||||
@NotNull(message = "专业编码不能为空")
|
||||
private Integer specialtyEnum;
|
||||
|
||||
/** 岗位类型 */
|
||||
@NotBlank(message = "岗位类型不能为空")
|
||||
private String typeCode;
|
||||
|
||||
/** 有效时间 */
|
||||
@NotBlank(message = "有效时间不能为空")
|
||||
private String availabilityJson;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 参与者角色 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractitionerRolesDto {
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 角色code
|
||||
*/
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 参与者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 可选择切换科室 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SelectableOrgDto {
|
||||
|
||||
/** 科室ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String orgName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 用户 及 参与者 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UserAndPractitionerDto {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 参与者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@Dict(dictCode = "sys_user_sex")
|
||||
private String sex;
|
||||
private String sex_dictText;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@Dict(dictCode = "sys_normal_disable")
|
||||
private String status;
|
||||
private String status_dictText;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 医保码
|
||||
*/
|
||||
private String ybNo;
|
||||
|
||||
/**
|
||||
* 职业证件编号
|
||||
*/
|
||||
private String pharPracCertNo;
|
||||
|
||||
/**
|
||||
* 机构id
|
||||
*/
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
private String orgId_dictText;
|
||||
|
||||
/**
|
||||
* 责任科室
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> responsibilityOrgDtoList;
|
||||
|
||||
/**
|
||||
* 参与者角色集合
|
||||
*/
|
||||
private List<PractitionerRolesDto> practitionerRolesDtoList;
|
||||
|
||||
/**
|
||||
* 医生出诊科室集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> doctorVisitOrgDtoList;
|
||||
|
||||
/**
|
||||
* 管理库房集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageLocationDtoList;
|
||||
|
||||
/**
|
||||
* 管理药房集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageMedicationLocationDtoList;
|
||||
|
||||
/**
|
||||
* 护士-管理科室集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageOrgDtoList;
|
||||
|
||||
/**
|
||||
* 护士-管理病区集合
|
||||
*/
|
||||
private List<PractitionerOrgAndLocationDto> manageWardLocationDtoList;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.openhis.web.basedatamanage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.web.basedatamanage.dto.SelectableOrgDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerOrgAndLocationDto;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerRolesDto;
|
||||
import com.openhis.web.basedatamanage.dto.UserAndPractitionerDto;
|
||||
|
||||
/**
|
||||
* 参与者 应用Mapper
|
||||
*/
|
||||
@Repository
|
||||
public interface PractitionerAppAppMapper {
|
||||
|
||||
/**
|
||||
* 查询用户及参与者
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 用户及参与者
|
||||
*/
|
||||
IPage<UserAndPractitionerDto> getUserPractitionerPage(@Param("page") Page<UserAndPractitionerDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<UserAndPractitionerDto> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询参与者的角色信息
|
||||
*
|
||||
* @param practitionerIdList 参与者id集合
|
||||
* @return 参与者的角色信息
|
||||
*/
|
||||
List<PractitionerRolesDto> getPractitionerRolesDtoList(@Param("practitionerIdList") List<Long> practitionerIdList);
|
||||
|
||||
/**
|
||||
* 查询科室和位置集合
|
||||
*
|
||||
* @param practitionerIdList 参与者id集合
|
||||
* @return 科室和位置集合
|
||||
*/
|
||||
List<PractitionerOrgAndLocationDto>
|
||||
getOrgAndLocationDtoList(@Param("practitionerIdList") List<Long> practitionerIdList);
|
||||
|
||||
/**
|
||||
* 物理删除系统用户与角色的关系
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
*/
|
||||
void delUserRole(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 物理删除参与者与业务角色的关系
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
*/
|
||||
void delPractitionerRole(@Param("practitionerId") Long practitionerId);
|
||||
|
||||
/**
|
||||
* 查询可选择切换科室集合
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
* @return 可选择切换科室集合
|
||||
*/
|
||||
List<SelectableOrgDto> getSelectableOrgList(@Param("practitionerId") Long practitionerId);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user