Merge branch 'master' of https://codeup.aliyun.com/61c0318acd8b75daa5a125f7/medical/openhis
This commit is contained in:
@@ -1,13 +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.OrganizationQueryDto;
|
||||
|
||||
/**
|
||||
* Organization 应该服务类
|
||||
*/
|
||||
public interface IOrganizationAppService {
|
||||
// 查询机构树
|
||||
Page<OrganizationQueryDto> getOrganizationTree(Integer pageNo, Integer pageSize);
|
||||
/**
|
||||
* 查询机构树
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 机构树分页列表
|
||||
*/
|
||||
Page<OrganizationQueryDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 机构信息详情
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 机构信息详情
|
||||
*/
|
||||
R<?> getOrgInfo(Long orgId);
|
||||
|
||||
/**
|
||||
* 添加/编辑机构信息
|
||||
*
|
||||
* @param organizationQueryDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> addOrEditOrganization(OrganizationQueryDto organizationQueryDto);
|
||||
|
||||
/**
|
||||
* 机构信息
|
||||
*
|
||||
* @param orgIds 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteOrganization(String orgIds);
|
||||
|
||||
/**
|
||||
* 机构启用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> activeOrg(Long orgId);
|
||||
|
||||
/**
|
||||
* 机构停用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> inactiveOrg(Long orgId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationQueryDto;
|
||||
|
||||
@Service
|
||||
public class IOrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
|
||||
@Resource
|
||||
IOrganizationService organizationService;
|
||||
|
||||
@Override
|
||||
public Page<OrganizationQueryDto> getOrganizationTree(Integer pageNo, Integer pageSize) {
|
||||
// 查询机构列表
|
||||
Page<Organization> page = organizationService.page(new Page<>(pageNo, pageSize));
|
||||
List<Organization> organizationList = page.getRecords();
|
||||
// 将机构列表转为树结构
|
||||
List<OrganizationQueryDto> orgTree = buildTree(organizationList);
|
||||
Page<OrganizationQueryDto> orgQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
orgQueryDtoPage.setRecords(orgTree);
|
||||
return orgQueryDtoPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将机构列表转换为树结构
|
||||
*
|
||||
* @param records 机构列表
|
||||
* @return tree
|
||||
*/
|
||||
private List<OrganizationQueryDto> buildTree(List<Organization> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<Organization> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, OrganizationQueryDto> nodeMap = new HashMap<>();
|
||||
List<OrganizationQueryDto> tree = new ArrayList<>();
|
||||
|
||||
for (Organization record : sortedRecords) {
|
||||
String bNo = record.getBusNo();
|
||||
String[] parts = bNo.split("\\.");
|
||||
OrganizationQueryDto node = new OrganizationQueryDto();
|
||||
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));
|
||||
OrganizationQueryDto parent = nodeMap.get(parentBNo);
|
||||
|
||||
if (parent != null) {
|
||||
parent.getChildren().add(node);
|
||||
} else {
|
||||
// 处理父节点不存在的情况(例如数据缺失)
|
||||
// 可根据需求调整为将节点加入根或抛出异常
|
||||
}
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import com.openhis.web.basedatamanage.appservice.ILocationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.LocationQueryDto;
|
||||
|
||||
@Service
|
||||
public class ILocationAppServiceImpl implements ILocationAppService {
|
||||
public class LocationAppServiceImpl implements ILocationAppService {
|
||||
|
||||
@Resource
|
||||
ILocationService locationService;
|
||||
@@ -0,0 +1,165 @@
|
||||
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.MessageUtils;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationQueryDto;
|
||||
|
||||
@Service
|
||||
public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
|
||||
@Resource
|
||||
IOrganizationService organizationService;
|
||||
|
||||
@Override
|
||||
public Page<OrganizationQueryDto> getOrganizationTree(Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
// 查询机构列表
|
||||
Page<Organization> page = organizationService.page(new Page<>(pageNo, pageSize));
|
||||
List<Organization> organizationList = page.getRecords();
|
||||
// 将机构列表转为树结构
|
||||
List<OrganizationQueryDto> orgTree = buildTree(organizationList);
|
||||
Page<OrganizationQueryDto> orgQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal());
|
||||
orgQueryDtoPage.setRecords(orgTree);
|
||||
return orgQueryDtoPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将机构列表转换为树结构
|
||||
*
|
||||
* @param records 机构列表
|
||||
* @return tree
|
||||
*/
|
||||
private List<OrganizationQueryDto> buildTree(List<Organization> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<Organization> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, OrganizationQueryDto> nodeMap = new HashMap<>();
|
||||
List<OrganizationQueryDto> tree = new ArrayList<>();
|
||||
|
||||
for (Organization record : sortedRecords) {
|
||||
String bNo = record.getBusNo();
|
||||
String[] parts = bNo.split("\\.");
|
||||
OrganizationQueryDto node = new OrganizationQueryDto();
|
||||
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));
|
||||
OrganizationQueryDto 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 organizationQueryDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> addOrEditOrganization(OrganizationQueryDto organizationQueryDto) {
|
||||
|
||||
// 新增organization信息
|
||||
Organization organization = new Organization();
|
||||
BeanUtils.copyProperties(organizationQueryDto, organization);
|
||||
|
||||
if (organizationQueryDto.getId() != null) {
|
||||
// 更新机构信息
|
||||
organizationService.updateById(organization);
|
||||
} else {
|
||||
// 生成待发送的机构信息
|
||||
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[] {"机构信息停用"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,27 +3,25 @@
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.mapper.OrganizationMapper;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationInitDto;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationQueryDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 机构管理controller
|
||||
@@ -37,15 +35,8 @@ import java.util.stream.Collectors;
|
||||
@AllArgsConstructor
|
||||
public class OrganizationController {
|
||||
|
||||
private final IOrganizationService organizationService;
|
||||
private final IOrganizationAppService iOrganizationAppService;
|
||||
|
||||
@Autowired
|
||||
private OrganizationMapper organizationMapper;
|
||||
|
||||
@Autowired(required = false)
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
|
||||
@@ -65,116 +56,69 @@ public class OrganizationController {
|
||||
* @return 机构分页列表
|
||||
*/
|
||||
@GetMapping(value = "/organization")
|
||||
public R<?> getOrganizationPage(
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<OrganizationQueryDto> organizationTree = iOrganizationAppService.getOrganizationTree(pageNo, pageSize);
|
||||
public R<?> getOrganizationPage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
Page<OrganizationQueryDto> organizationTree =
|
||||
iOrganizationAppService.getOrganizationTree(pageNo, pageSize, request);
|
||||
return R.ok(organizationTree,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[]{"机构信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加机构信息
|
||||
*
|
||||
* @param organizationQueryDto 机构信息
|
||||
*/
|
||||
@PostMapping("/organization")
|
||||
public R<?> addOrganization(@Validated @RequestBody OrganizationQueryDto organizationQueryDto) {
|
||||
|
||||
// 新增organization信息
|
||||
Organization organization = new Organization();
|
||||
BeanUtils.copyProperties(organizationQueryDto, organization);
|
||||
|
||||
// 基础采番
|
||||
// String code = assignSeqUtil.getSeq(AssignSeqEnum.TEST.getPrefix());
|
||||
// organizationQueryDto.setBusNo(code);
|
||||
|
||||
boolean saveOrgSuccess = organizationService.save(organization);
|
||||
|
||||
return saveOrgSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[]{"机构信息"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[]{"机构信息"}));
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"机构信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构需要编辑的信息
|
||||
*
|
||||
* @param orgId 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@GetMapping("/organization-getById")
|
||||
public R<?> getOrganizationById(@Validated @RequestParam Long orgId) {
|
||||
|
||||
Organization organization = organizationService.getById(orgId);
|
||||
return R.ok(organization, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[]{"机构信息"}));
|
||||
public R<?> getOrgInfo(@Validated @RequestParam Long orgId) {
|
||||
return iOrganizationAppService.getOrgInfo(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑机构信息
|
||||
* 添加/编辑机构信息
|
||||
*
|
||||
* @param organizationQueryDto 机构信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/organization")
|
||||
public R<?> editOrganization(@Validated @RequestBody OrganizationQueryDto organizationQueryDto) {
|
||||
// 更新organization信息
|
||||
Organization organization = new Organization();
|
||||
BeanUtils.copyProperties(organizationQueryDto, organization);
|
||||
|
||||
boolean updateOrgSuccess = organizationService.updateById(organization);
|
||||
return updateOrgSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"机构信息"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[]{"机构信息"}));
|
||||
public R<?> addOrEditInventoryReceipt(@Validated @RequestBody OrganizationQueryDto organizationQueryDto) {
|
||||
return iOrganizationAppService.addOrEditOrganization(organizationQueryDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机构信息
|
||||
*
|
||||
* @param orgIds 需要删除的Id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/organization")
|
||||
public R<?> deleteOrganization(@RequestParam String orgIds) {
|
||||
|
||||
List<Long> orgIdList = new ArrayList<>();
|
||||
if (orgIds != null) {
|
||||
orgIdList = Arrays.stream(orgIds.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 在service层做业务校验
|
||||
boolean deleteOrgSuccess = organizationService.removeByIds(orgIdList);
|
||||
|
||||
return deleteOrgSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[]{"机构信息"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00006, new Object[]{"机构信息"}));
|
||||
return iOrganizationAppService.deleteOrganization(orgIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用
|
||||
* 机构启用
|
||||
*
|
||||
* @param orgId 启用数据的Id
|
||||
* @return 操作结果
|
||||
*
|
||||
*/
|
||||
@PutMapping("/organization-active")
|
||||
public R<?> changeActive(@RequestParam Long orgId) {
|
||||
|
||||
boolean activeSuccess = organizationService.activeChange(orgId);
|
||||
|
||||
return activeSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"启用"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[]{"启用"}));
|
||||
public R<?> activeOrganization(@RequestParam Long orgId) {
|
||||
return iOrganizationAppService.activeOrg(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用
|
||||
* 机构停用
|
||||
*
|
||||
* @param orgId 停用数据的Id
|
||||
* @return 操作结果
|
||||
*
|
||||
*/
|
||||
@PutMapping("/organization-inactive")
|
||||
public R<?> changeInactive(@RequestParam Long orgId) {
|
||||
|
||||
boolean inActiveSuccess = organizationService.activeChange(orgId);
|
||||
|
||||
return inActiveSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"停用"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[]{"停用"}));
|
||||
public R<?> inactiveOrganization(@RequestParam Long orgId) {
|
||||
return iOrganizationAppService.inactiveOrg(orgId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -81,13 +81,13 @@ public class DictAspect {
|
||||
String dictLabel = queryDictLabel(dictTable, dictCode, dictText, fieldValue.toString());
|
||||
if (dictLabel != null) {
|
||||
try {
|
||||
// 动态生成 _TEXT 字段名
|
||||
// 动态生成 _dictText 字段名
|
||||
String textFieldName = field.getName() + "_dictText";
|
||||
Field textField = dto.getClass().getDeclaredField(textFieldName);
|
||||
textField.setAccessible(true);
|
||||
textField.set(dto, dictLabel); // 设置 _TEXT 字段的值
|
||||
textField.set(dto, dictLabel); // 设置 _dictText 字段的值
|
||||
} catch (NoSuchFieldException e) {
|
||||
// 如果 _TEXT 字段不存在,忽略错误
|
||||
// 如果 _dictText 字段不存在,忽略错误
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,5 +10,21 @@ import com.openhis.administration.domain.Organization;
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
public interface IOrganizationService extends IService<Organization> {
|
||||
boolean activeChange(Long orgId);
|
||||
|
||||
/**
|
||||
* 机构启用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean activeOrg(Long orgId);
|
||||
|
||||
/**
|
||||
* 机构停用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean inactiveOrg(Long orgId);
|
||||
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.mapper.OrganizationMapper;
|
||||
@@ -19,29 +19,30 @@ import com.openhis.common.enums.AccountStatus;
|
||||
public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Organization>
|
||||
implements IOrganizationService {
|
||||
|
||||
@Autowired
|
||||
private OrganizationMapper organizationMapper;
|
||||
|
||||
/**
|
||||
* 机构启用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public boolean activeChange(Long orgId) {
|
||||
if (orgId != null) {
|
||||
Organization organization = organizationMapper.selectById(orgId);
|
||||
if (organization != null) {
|
||||
Integer activeFlag = organization.getActiveFlag();
|
||||
switch (activeFlag ) {
|
||||
case 1:
|
||||
organization.setActiveFlag(AccountStatus.INACTIVE.getValue());
|
||||
break;
|
||||
case 2:
|
||||
organization.setActiveFlag(AccountStatus.ACTIVE.getValue());
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
public boolean activeOrg(Long orgId) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<Organization>().eq(Organization::getId, orgId)
|
||||
.set(Organization::getActiveFlag, AccountStatus.ACTIVE.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
organizationMapper.updateById(organization);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
/**
|
||||
* 机构停用
|
||||
*
|
||||
* @param orgId 机构信息id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public boolean inactiveOrg(Long orgId) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<Organization>().eq(Organization::getId, orgId)
|
||||
.set(Organization::getActiveFlag, AccountStatus.INACTIVE.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -151,9 +151,6 @@ public class MedicationRequest extends HisBaseEntity {
|
||||
/** 单次最大剂量 */
|
||||
private BigDecimal maxDose;
|
||||
|
||||
/** 发药id */
|
||||
private Long dispenseId;
|
||||
|
||||
/** 首次用量 */
|
||||
private BigDecimal firstDose;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ServiceRequest extends HisBaseEntity {
|
||||
/** 是否执行 */
|
||||
private Integer performFlag;
|
||||
|
||||
/** 请求code */
|
||||
/** 诊疗定义id */
|
||||
private Long activityId;
|
||||
|
||||
/** 数量 */
|
||||
|
||||
@@ -31,6 +31,9 @@ public class ServiceRequestDetail extends HisBaseEntity {
|
||||
/** 申请主表id */
|
||||
private Long serviceReqId;
|
||||
|
||||
/** 类型编码 */
|
||||
private String typeCode;
|
||||
|
||||
/** 订单相关表 */
|
||||
private String orderDetailTable;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user