practitioner相关
This commit is contained in:
@@ -5,6 +5,9 @@ import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.openhis.common.enums.LocationBedStatus;
|
||||
import com.openhis.common.enums.LocationMode;
|
||||
import com.openhis.common.enums.LocationStatus;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -42,6 +45,12 @@ public class ILocationAppServiceImpl implements ILocationAppService {
|
||||
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 locationQueryDtoPage;
|
||||
|
||||
@@ -72,10 +72,10 @@ public class CabinetLocationController {
|
||||
// locationQueryDto.setFormEnum(LocationForm.CABINET);
|
||||
// BeanUtils.copyProperties(locationQueryDto, location);
|
||||
Location location = new Location(locationQueryDto.getId(), locationQueryDto.getBusNo(),
|
||||
locationQueryDto.getName(), LocationStatus.ACTIVE, LocationBedStatus.U, LocationMode.INSTANCE,
|
||||
locationQueryDto.getTypeCode(), locationQueryDto.getTypeJson(), locationQueryDto.getPyStr(),
|
||||
locationQueryDto.getWbStr(), LocationForm.CABINET.getValue(), locationQueryDto.getOrganizationId(),
|
||||
locationQueryDto.getDisplayOrder());
|
||||
locationQueryDto.getName(), LocationStatus.ACTIVE.getValue(), LocationBedStatus.U.getValue(),
|
||||
LocationMode.INSTANCE.getValue(), locationQueryDto.getTypeCode(), locationQueryDto.getTypeJson(),
|
||||
locationQueryDto.getPyStr(), locationQueryDto.getWbStr(), LocationForm.CABINET.getValue(),
|
||||
locationQueryDto.getOrganizationId(), locationQueryDto.getDisplayOrder());
|
||||
|
||||
boolean saveLocationSuccess = locationService.save(location);
|
||||
return saveLocationSuccess
|
||||
@@ -104,10 +104,10 @@ public class CabinetLocationController {
|
||||
public R<?> editLocation(@Validated @RequestBody LocationQueryDto locationQueryDto) {
|
||||
|
||||
Location location = new Location(locationQueryDto.getId(), locationQueryDto.getBusNo(),
|
||||
locationQueryDto.getName(), LocationStatus.ACTIVE, LocationBedStatus.U, LocationMode.INSTANCE,
|
||||
locationQueryDto.getTypeCode(), locationQueryDto.getTypeJson(), locationQueryDto.getPyStr(),
|
||||
locationQueryDto.getWbStr(), LocationForm.CABINET.getValue(), locationQueryDto.getOrganizationId(),
|
||||
locationQueryDto.getDisplayOrder());
|
||||
locationQueryDto.getName(), LocationStatus.ACTIVE.getValue(), LocationBedStatus.U.getValue(),
|
||||
LocationMode.INSTANCE.getValue(), locationQueryDto.getTypeCode(), locationQueryDto.getTypeJson(),
|
||||
locationQueryDto.getPyStr(), locationQueryDto.getWbStr(), LocationForm.CABINET.getValue(),
|
||||
locationQueryDto.getOrganizationId(), locationQueryDto.getDisplayOrder());
|
||||
|
||||
boolean updateLocationSuccess = locationService.updateById(location);
|
||||
return updateLocationSuccess
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.controller;
|
||||
|
||||
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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
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.Practitioner;
|
||||
import com.openhis.administration.domain.PractitionerRole;
|
||||
import com.openhis.administration.mapper.PractitionerMapper;
|
||||
import com.openhis.administration.mapper.PractitionerRoleMapper;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.dto.PractSearchParam;
|
||||
import com.openhis.web.basedatamanage.dto.PractitionerDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 员工管理Controller业务层处理
|
||||
*
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/basedatamanage/practitioner")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class PractitionerController {
|
||||
|
||||
private final IPractitionerService practitionerService;
|
||||
|
||||
@Autowired
|
||||
private PractitionerMapper practitionerMapper;
|
||||
|
||||
@Autowired
|
||||
private PractitionerRoleMapper practitionerRoleMapper;
|
||||
|
||||
/**
|
||||
* 员工分页列表
|
||||
*
|
||||
* @param practSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 员工分页列表
|
||||
*/
|
||||
@GetMapping(value = "/practitioner")
|
||||
public R<?> getPractitionerPage(PractSearchParam practSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<Practitioner> queryWrapper = HisQueryUtils.buildQueryWrapper(practSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), request);
|
||||
|
||||
// 设置排序
|
||||
queryWrapper.orderByDesc("name");
|
||||
|
||||
// 执行分页查询并转换为 practitionerDtoPage
|
||||
Page<PractitionerDto> practitionerDtoPage =
|
||||
HisPageUtils.selectPage(practitionerMapper, queryWrapper, pageNo, pageSize, PractitionerDto.class);
|
||||
|
||||
practitionerDtoPage.getRecords().forEach(e -> {
|
||||
// 性别回显赋值
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
});
|
||||
|
||||
return R.ok(practitionerDtoPage,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"员工信息"}));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加员工信息
|
||||
*
|
||||
* @param practitionerDto 员工信息
|
||||
*/
|
||||
@PostMapping("/practitioner")
|
||||
public R<?> addPractitioner(@Validated @RequestBody PractitionerDto practitionerDto) {
|
||||
|
||||
// 新增practitioner信息
|
||||
Practitioner practitioner = new Practitioner();
|
||||
BeanUtils.copyProperties(practitionerDto, practitioner);
|
||||
practitioner.setActiveFlag(AccountStatus.ACTIVE.getValue());
|
||||
|
||||
boolean savePractitionerSuccess = practitionerService.save(practitioner);
|
||||
|
||||
PractitionerRole practitionerRole = new PractitionerRole();
|
||||
practitionerRole.setPractitionerId(practitioner.getId());
|
||||
practitionerRole.setName(practitioner.getName());
|
||||
Integer saveProleSuccess = practitionerRoleMapper.insert(practitionerRole);
|
||||
|
||||
boolean saveFlag;
|
||||
if (savePractitionerSuccess && saveProleSuccess == 1) {
|
||||
saveFlag = true;
|
||||
} else {
|
||||
saveFlag = false;
|
||||
}
|
||||
|
||||
return saveFlag ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"员工信息"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"员工信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工需要编辑的信息
|
||||
*
|
||||
* @param practitionerId 员工信息
|
||||
*/
|
||||
@GetMapping("/practitioner-getById")
|
||||
public R<?> getPractitionerById(@Validated @RequestParam Long practitionerId) {
|
||||
|
||||
Practitioner practitioner = practitionerService.getById(practitionerId);
|
||||
if (practitioner != null) {
|
||||
return R.ok(practitioner,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"员工信息"}));
|
||||
} else {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"员工信息查新失败"}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑员工信息
|
||||
*
|
||||
* @param practitionerDto 员工信息
|
||||
*/
|
||||
@PutMapping("/practitioner")
|
||||
public R<?> editPractitioner(@Validated @RequestBody PractitionerDto practitionerDto) {
|
||||
|
||||
// 编辑practitioner信息
|
||||
Practitioner practitioner = new Practitioner();
|
||||
BeanUtils.copyProperties(practitionerDto, practitioner);
|
||||
|
||||
boolean editPractitionerSuccess = practitionerService.updateById(practitioner);
|
||||
|
||||
return editPractitionerSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"员工信息"}))
|
||||
: R.fail(PromptMsgConstant.Common.M00007, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工信息
|
||||
*
|
||||
* @param practitionerId 主表id
|
||||
*/
|
||||
@DeleteMapping("/practitioner")
|
||||
public R<?> deletePractitioner(@RequestParam Long practitionerId) {
|
||||
|
||||
boolean delPractitionerSuccess = practitionerService.removeById(practitionerId);
|
||||
|
||||
return delPractitionerSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"员工信息"}))
|
||||
: R.fail(PromptMsgConstant.Common.M00006, null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import java.util.HashSet;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -78,24 +77,24 @@ public class PractitionerRoleController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加岗位信息
|
||||
*
|
||||
* @param practitionerRoleDto 岗位信息
|
||||
*/
|
||||
@PostMapping("/practitioner-role")
|
||||
public R<?> addPractitionerRole(@Validated @RequestBody PractitionerRoleDto practitionerRoleDto) {
|
||||
|
||||
// 新增practitionerRole信息
|
||||
PractitionerRole practitionerRole = new PractitionerRole();
|
||||
BeanUtils.copyProperties(practitionerRoleDto, practitionerRole);
|
||||
|
||||
boolean savePractitionerRoleSuccess = practitionerRoleService.save(practitionerRole);
|
||||
|
||||
return savePractitionerRoleSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"岗位信息"}))
|
||||
: R.fail(PromptMsgConstant.Common.M00007, null);
|
||||
}
|
||||
// /**
|
||||
// * 添加岗位信息
|
||||
// *
|
||||
// * @param practitionerRoleDto 岗位信息
|
||||
// */
|
||||
// @PostMapping("/practitioner-role")
|
||||
// public R<?> addPractitionerRole(@Validated @RequestBody CreatePractitionerRoleDto practitionerRoleDto) {
|
||||
//
|
||||
// // 新增practitionerRole信息
|
||||
// PractitionerRole practitionerRole = new PractitionerRole();
|
||||
// BeanUtils.copyProperties(practitionerRoleDto, practitionerRole);
|
||||
//
|
||||
// boolean savePractitionerRoleSuccess = practitionerRoleService.save(practitionerRole);
|
||||
//
|
||||
// return savePractitionerRoleSuccess
|
||||
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"岗位信息"}))
|
||||
// : R.fail(PromptMsgConstant.Common.M00007, null);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取岗位需要编辑的信息
|
||||
@@ -106,7 +105,8 @@ public class PractitionerRoleController {
|
||||
public R<?> getPractitionerRoleById(@Validated @RequestParam Long proleId) {
|
||||
|
||||
PractitionerRole practitionerRole = practitionerRoleService.getById(proleId);
|
||||
return R.ok(practitionerRole, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"岗位信息"}));
|
||||
return R.ok(practitionerRole,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"岗位信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,6 +120,15 @@ public class PractitionerRoleController {
|
||||
// 编辑practitionerRole信息
|
||||
PractitionerRole practitionerRole = new PractitionerRole();
|
||||
BeanUtils.copyProperties(practitionerRoleDto, practitionerRole);
|
||||
if (practitionerRole.getRole_code() == 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, "位置不能为空");
|
||||
}
|
||||
|
||||
boolean editPractitionerRoleSuccess = practitionerRoleService.updateById(practitionerRole);
|
||||
|
||||
|
||||
@@ -39,15 +39,21 @@ public class LocationQueryDto {
|
||||
|
||||
/** 状态编码 */
|
||||
@NotNull(message = "状态编码不能为空")
|
||||
private LocationStatus statusEnum;
|
||||
// private LocationStatus statusEnum;
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 操作状态 */
|
||||
@NotNull(message = "操作状态不能为空")
|
||||
private LocationBedStatus operationalEnum;
|
||||
// private LocationBedStatus operationalEnum;
|
||||
private Integer operationalEnum;
|
||||
private String operationalEnum_enumText;
|
||||
|
||||
/** 模式编码 */
|
||||
@NotNull(message = "模式编码不能为空")
|
||||
private LocationMode modeEnum;
|
||||
// private LocationMode modeEnum;
|
||||
private Integer modeEnum;
|
||||
private String modeEnum_enumText;
|
||||
|
||||
/** 模式编码 */
|
||||
private String typeCode;
|
||||
|
||||
@@ -18,9 +18,6 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class PractRoleSearchParam implements Serializable {
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 专业编码枚举 */
|
||||
private Integer specialtyEnum;
|
||||
|
||||
|
||||
@@ -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,79 @@
|
||||
/*
|
||||
* 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 {
|
||||
|
||||
/** 姓名 */
|
||||
@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;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PractitionerRoleDto {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 角色编码 */
|
||||
private String role_code;
|
||||
|
||||
/** 活动标识 */
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 参与者Id */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 机构 */
|
||||
private Long orgId;
|
||||
|
||||
/** 位置ID */
|
||||
private Long locationId;
|
||||
|
||||
/** 服务id */
|
||||
private Long healthcareServiceId;
|
||||
|
||||
/** 专业编码枚举 */
|
||||
private Integer specialtyEnum;
|
||||
|
||||
/** 岗位类型 */
|
||||
private String typeCode;
|
||||
|
||||
/** 有效时间 */
|
||||
private String availabilityJson;
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import javax.validation.constraints.NotBlank;
|
||||
* @author lpt
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DiseaseManageUpDto {
|
||||
|
||||
Reference in New Issue
Block a user