# Conflicts:
#	openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/OrganizationController.java
This commit is contained in:
Zhang.WH
2025-02-25 11:35:10 +08:00
7 changed files with 712 additions and 29 deletions

View File

@@ -22,7 +22,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 机构管理(科室)controller
* 机构管理controller
*
* @author
* @date 2025-02-21
@@ -39,9 +39,9 @@ public class OrganizationController {
private AssignSeqUtil assignSeqUtil;
/**
* 添加科室信息
* 添加机构信息
*
* @param organization 科室信息
* @param organization 机构信息
*/
@PostMapping("/organization")
public R<?> addOrganization(@Validated @RequestBody Organization organization) {
@@ -54,17 +54,17 @@ public class OrganizationController {
String code = assignSeqUtil.getSeq(AssignSeqEnum.TEST.getPrefix());
organization.setBusNo(code);
boolean saveOrganizationSuccess = organizationService.save(organization);
boolean saveOrgSuccess = organizationService.save(organization);
return saveOrganizationSuccess
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"科室信息"}))
: R.fail(PromptMsgConstant.Common.M00007, null);
return saveOrgSuccess
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"机构信息"}))
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"机构信息"}));
}
/**
* 编辑科室信息
* 编辑机构信息
*
* @param organization 科室信息
* @param organization 机构信息
*/
@PutMapping("/organization")
public R<?> editOrganization(@Validated @RequestBody Organization organization) {
@@ -72,14 +72,14 @@ public class OrganizationController {
// 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);
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[] {"机构信息"}));
}
/**
* 删除科室信息
* 删除机构信息
*
* @param orgId 主表id
*/
@@ -87,32 +87,33 @@ public class OrganizationController {
public R<?> deleteSupplyRequest(@RequestParam Long orgId) {
// 在service层做业务校验
boolean deleteSuccess = organizationService.removeById(orgId);
boolean deleteOrgSuccess = 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[] {"科室信息删除失败"}));
return deleteOrgSuccess
? 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 科室分页列表
* @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);
return R.ok(organizationPage,
MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息"}));
}
}