Merge branch 'master' of codeup.aliyun.com:61c0318acd8b75daa5a125f7/medical/openhis
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* 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.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.enums.AssignSeqEnum;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
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 lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 机构管理(科室)controller
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/basedatamanage/organization")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OrganizationController {
|
||||
|
||||
private final IOrganizationService organizationService;
|
||||
|
||||
@Autowired(required = false)
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 添加科室信息
|
||||
*
|
||||
* @param organization 科室信息
|
||||
*/
|
||||
@PostMapping("/organization")
|
||||
public R<?> addOrganization(@Validated @RequestBody Organization organization) {
|
||||
|
||||
// 新增organization信息
|
||||
// Organization organization = new Organization();
|
||||
// BeanUtils.copyProperties(organizationdto, organization);
|
||||
|
||||
// 基础采番
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.TEST.getPrefix());
|
||||
organization.setBus_no(code);
|
||||
|
||||
boolean saveOrganizationSuccess = organizationService.save(organization);
|
||||
|
||||
return saveOrganizationSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"科室信息"}))
|
||||
: R.fail(PromptMsgConstant.Common.M00007, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑科室信息
|
||||
*
|
||||
* @param organization 科室信息
|
||||
*/
|
||||
@PutMapping("/organization")
|
||||
public R<?> editOrganization(@Validated @RequestBody Organization organization) {
|
||||
// 更新organization信息
|
||||
// Organization organization = new Organization();
|
||||
// BeanUtils.copyProperties(organizationdto, organization);
|
||||
|
||||
boolean updateSuccess = organizationService.updateById(organization);
|
||||
return updateSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"科室信息"}))
|
||||
: R.fail(PromptMsgConstant.Common.M00007, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除科室信息
|
||||
*
|
||||
* @param orgId 主表id
|
||||
*/
|
||||
@DeleteMapping("/organization")
|
||||
public R<?> deleteSupplyRequest(@RequestParam Long orgId) {
|
||||
|
||||
boolean deleteSuccess = organizationService.removeById(orgId);
|
||||
|
||||
return deleteSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"科室信息"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00006, new Object[] {"科室信息删除失败"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 科室分页列表
|
||||
*
|
||||
* @param classEnum 机构分类枚举
|
||||
* @param activeFlag 活动标识
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 科室分页列表
|
||||
*/
|
||||
@GetMapping(value = "/organization")
|
||||
public R<?> getOrganizationPage(Integer classEnum, Integer activeFlag,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 查询【科室】分页列表
|
||||
Page<Organization> organizationPage =
|
||||
organizationService.getOrganizationPage(classEnum, activeFlag, pageNo, pageSize);
|
||||
return R.ok(organizationPage);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +1,19 @@
|
||||
package com.openhis.web.datadictionary.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.utils.MessageUtils;
|
||||
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.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.clinical.service.IConditionDefinitionService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.ConditionDefinitionSource;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -36,7 +38,9 @@ public class DiseaseManageController {
|
||||
*/
|
||||
@GetMapping("/information-category")
|
||||
public R<?> getDiseaseCategory() {
|
||||
return null;
|
||||
// 获取疾病目录种类
|
||||
List<ConditionDefinitionSource> statusList = Arrays.asList(ConditionDefinitionSource.values());
|
||||
return R.ok(statusList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,6 +48,7 @@ public class DiseaseManageController {
|
||||
*
|
||||
* @param searchKey 查询条件
|
||||
* @param status 查询条件-状态
|
||||
* @param status 查询条件-疾病种类
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return
|
||||
@@ -52,18 +57,36 @@ public class DiseaseManageController {
|
||||
public R<?> getDiseaseList(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "status", defaultValue = "-1") Integer status,
|
||||
@RequestParam(value = "sourceEnum", defaultValue = "-1") Integer sourceEnum,
|
||||
@RequestParam(value = "id", defaultValue = "-1") Long id,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 查询【病种目录】分页列表
|
||||
Page<ConditionDefinition> diseasePage =
|
||||
iConditionDefinitionService.getPage(searchKey, status, sourceEnum, id,pageNo, pageSize);
|
||||
iConditionDefinitionService.getPage(searchKey, status, sourceEnum, pageNo, pageSize);
|
||||
// 返回【病种目录列表DTO】分页
|
||||
return R.ok(diseasePage);
|
||||
}
|
||||
|
||||
// 病种目录编辑
|
||||
/**
|
||||
* 根据id查询疾病详情
|
||||
*
|
||||
* @param id 疾病ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getDiseaseOne(@RequestParam(value = "id", required = false, defaultValue = "0") Long id) {
|
||||
|
||||
// 根据ID查询【病种目录】
|
||||
ConditionDefinition byId = iConditionDefinitionService.getById(id);
|
||||
return R.ok(byId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 病种目录编辑
|
||||
*
|
||||
* @param conditionDefinitionList 病种目录实体列表
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/information")
|
||||
public R<?> editDisease(@RequestBody List<ConditionDefinition> conditionDefinitionList) {
|
||||
// 更新病种信息
|
||||
@@ -72,17 +95,27 @@ public class DiseaseManageController {
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
// 新增外来病种目录
|
||||
/**
|
||||
* 新增外来病种目录
|
||||
*
|
||||
* @param conditionDefinition 病种目录实体
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/information")
|
||||
public R<?> addDisease(@RequestBody ConditionDefinition conditionDefinition) {
|
||||
// 新增外来病种目录
|
||||
return iConditionDefinitionService.addDisease(conditionDefinition)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"病种目录"}))
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"疾病目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
|
||||
}
|
||||
|
||||
// 新增医保病种目录
|
||||
/**
|
||||
* 新增医保病种目录
|
||||
*
|
||||
* @param conditionDefinition 病种目录实体
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/information-yb")
|
||||
void AddYbDisease(@RequestBody ConditionDefinition conditionDefinition) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user