# 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[] {"机构信息"}));
}
}

View File

@@ -0,0 +1,56 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.common.constant;
/**
* APL消息ID常量类
*
* @author zwh
* @date 2025-02-25
*/
public class PromptMsgConstant {
/**
* 共用
*/
public interface Common {
/**
* {0}添加成功
*/
String M00001 = "apl.common.M00001";
/**
* {0}保存成功
*/
String M00002 = "apl.common.M00002";
/**
* {0}已经存在
*/
String M00003 = "apl.common.M00003";
/**
* {0}操作成功
*/
String M00004 = "apl.common.M00004";
/**
* {0}删除成功
*/
String M00005 = "apl.common.M00005";
/**
* 操作失败,该数据已被他人删除,请刷新后重试
*/
String M00006 = "apl.common.M00006";
/**
* 操作失败,该数据已被他人更改,请刷新后重试
*/
String M00007 = "apl.common.M00007";
/**
* 请勿重复提交
*/
String M00008 = "apl.common.M00008";
/**
* 查询成功
*/
String M00009 = "apl.common.M00009";
}
}

View File

@@ -28,7 +28,7 @@ public class Organization extends HisBaseEntity {
private Long id;
/** 编码 */
private String bus_no;
private String busNo;
/** 名称 */
private String name;

View File

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.openhis.administration.domain.Organization;
/**
* 机构管理(科室)Service接口
* 机构管理Service接口
*
* @author system
* @date 2025-02-21

View File

@@ -12,7 +12,7 @@ import com.openhis.administration.mapper.OrganizationMapper;
import com.openhis.administration.service.IOrganizationService;
/**
* 机构管理(科室)Service业务层处理
* 机构管理Service业务层处理
*
* @author system
* @date 2025-02-21
@@ -25,11 +25,11 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
private OrganizationMapper organizationMapper;
/**
* 查询科室列表
* 查询机构列表
*
* @param classEnum 机构分类枚举
* @param activeFlag 活动标识
* @return 科室列表
* @return 机构列表
*/
@Override
public Page<Organization> getOrganizationPage(Integer classEnum, Integer activeFlag, Integer pageNo,
@@ -42,12 +42,12 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
}
if (activeFlag != null) {
queryWrapper.eq(Organization::getTypeEnum, activeFlag);
queryWrapper.eq(Organization::getActiveFlag, activeFlag);
}
Page<Organization> organizationPage = organizationMapper.selectPage(new Page<>(pageNo, pageSize), queryWrapper);
// 返回科室信息列表
// 返回机构信息列表
return organizationPage;
}