Whether相关,药品设备格式
This commit is contained in:
@@ -29,7 +29,7 @@ import com.openhis.administration.service.IHealthcareServiceService;
|
|||||||
import com.openhis.common.constant.CommonConstants;
|
import com.openhis.common.constant.CommonConstants;
|
||||||
import com.openhis.common.constant.PromptMsgConstant;
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
import com.openhis.common.enums.AccountStatus;
|
import com.openhis.common.enums.AccountStatus;
|
||||||
import com.openhis.common.enums.WhetherContainUnknown;
|
import com.openhis.common.enums.Whether;
|
||||||
import com.openhis.common.utils.EnumUtils;
|
import com.openhis.common.utils.EnumUtils;
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
import com.openhis.web.basicservice.dto.*;
|
import com.openhis.web.basicservice.dto.*;
|
||||||
@@ -65,7 +65,7 @@ public class HealthcareServiceController {
|
|||||||
healthcareServiceInitDto.setActiveFlagOptions(activeFlagOptions);
|
healthcareServiceInitDto.setActiveFlagOptions(activeFlagOptions);
|
||||||
// 是否需要预约
|
// 是否需要预约
|
||||||
List<HealthcareServiceInitDto.appointmentRequiredFlagOption> appointmentRequiredFlagOptions =
|
List<HealthcareServiceInitDto.appointmentRequiredFlagOption> appointmentRequiredFlagOptions =
|
||||||
Stream.of(WhetherContainUnknown.values())
|
Stream.of(Whether.values())
|
||||||
.map(wh -> new HealthcareServiceInitDto.appointmentRequiredFlagOption(wh.getValue(), wh.getInfo()))
|
.map(wh -> new HealthcareServiceInitDto.appointmentRequiredFlagOption(wh.getValue(), wh.getInfo()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
healthcareServiceInitDto.setAppointmentRequiredFlagOptions(appointmentRequiredFlagOptions);
|
healthcareServiceInitDto.setAppointmentRequiredFlagOptions(appointmentRequiredFlagOptions);
|
||||||
@@ -121,7 +121,7 @@ public class HealthcareServiceController {
|
|||||||
e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
||||||
// 预约要求-枚举类回显赋值
|
// 预约要求-枚举类回显赋值
|
||||||
e.setAppointmentRequiredFlag_enumText(
|
e.setAppointmentRequiredFlag_enumText(
|
||||||
EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getAppointmentRequiredFlag()));
|
EnumUtils.getInfoByValue(Whether.class, e.getAppointmentRequiredFlag()));
|
||||||
});
|
});
|
||||||
return R.ok(healthcareServicePage, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
return R.ok(healthcareServicePage, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||||
}
|
}
|
||||||
@@ -146,8 +146,8 @@ public class HealthcareServiceController {
|
|||||||
healthcareServiceDtoDetail
|
healthcareServiceDtoDetail
|
||||||
.setActiveFlag_enumText(
|
.setActiveFlag_enumText(
|
||||||
EnumUtils.getInfoByValue(AccountStatus.class, healthcareServiceDtoDetail.getActiveFlag()))
|
EnumUtils.getInfoByValue(AccountStatus.class, healthcareServiceDtoDetail.getActiveFlag()))
|
||||||
.setAppointmentRequiredFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class,
|
.setAppointmentRequiredFlag_enumText(
|
||||||
healthcareServiceDtoDetail.getAppointmentRequiredFlag()));
|
EnumUtils.getInfoByValue(Whether.class, healthcareServiceDtoDetail.getAppointmentRequiredFlag()));
|
||||||
return R.ok(healthcareServiceDtoDetail);
|
return R.ok(healthcareServiceDtoDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.datadictionary.appservice;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.datadictionary.dto.DeviceManageSelParam;
|
||||||
|
import com.openhis.web.datadictionary.dto.DeviceManageUpDto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录 service
|
||||||
|
*
|
||||||
|
* @author dh
|
||||||
|
* @date 2025-03-10
|
||||||
|
*/
|
||||||
|
public interface IDeviceManageAppService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录初始化
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/information-init")
|
||||||
|
R<?> getDeviceManageInit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录查询
|
||||||
|
*
|
||||||
|
* @param deviceManageSelParam 查询条件
|
||||||
|
* @param searchKey 查询条件-模糊查询
|
||||||
|
* @param pageNo 查询条件
|
||||||
|
* @param pageSize 查询条件
|
||||||
|
* @return 器材目录查询结果
|
||||||
|
*/
|
||||||
|
R<?> getDevicePage(DeviceManageSelParam deviceManageSelParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||||
|
HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加器材目录信息
|
||||||
|
*
|
||||||
|
* @param deviceManageUpDto 器材目录信息
|
||||||
|
*/
|
||||||
|
R<?> addDevice(DeviceManageUpDto deviceManageUpDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑供应商信息
|
||||||
|
*
|
||||||
|
* @param deviceManageDto 器材目录信息
|
||||||
|
*/
|
||||||
|
R<?> editDevice(DeviceManageUpDto deviceManageDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录详细查询
|
||||||
|
*
|
||||||
|
* @param id 查询条件
|
||||||
|
* @return 器材目录查询结果
|
||||||
|
*/
|
||||||
|
R<?> getDeviceOne(@PathVariable("id") Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录停用
|
||||||
|
*
|
||||||
|
* @param ids 器材目录ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<?> editDeviceStop(@RequestBody List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录启用
|
||||||
|
*
|
||||||
|
* @param ids 器材目录ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<?> editDeviceStart(@RequestBody List<Long> ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.datadictionary.appservice;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.datadictionary.dto.MedicationManageUpDto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录 service
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @date 2025-03-17
|
||||||
|
*/
|
||||||
|
public interface IMedicationManageAppService {
|
||||||
|
/**
|
||||||
|
* 初始化药品目录信息
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
R<?> getMedicationInit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录查询
|
||||||
|
*
|
||||||
|
* @param searchKey 查询条件
|
||||||
|
* @param ybMatchFlag 查询条件-是否对码
|
||||||
|
* @param statusEnum 查询条件-状态
|
||||||
|
* @param categoryCode 查询条件-药品分类
|
||||||
|
* @param pageNo 当前页码
|
||||||
|
* @param pageSize 查询条数
|
||||||
|
* @return 药品目录查询结果
|
||||||
|
*/
|
||||||
|
R<?> getMedicationList(String searchKey, Integer ybMatchFlag, Integer statusEnum, String categoryCode,
|
||||||
|
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录详细查询
|
||||||
|
*
|
||||||
|
* @param id 查询条件
|
||||||
|
* @return 药品目录查询结果
|
||||||
|
*/
|
||||||
|
R<?> getMedicationOne(@PathVariable("id") Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑药品目录信息
|
||||||
|
*
|
||||||
|
* @param medicationManageUpDto 药品目录信息
|
||||||
|
*/
|
||||||
|
R<?> editMedication(MedicationManageUpDto medicationManageUpDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录停用
|
||||||
|
*
|
||||||
|
* @param ids 药品目录ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<?> editMedicationStop(@RequestBody List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录启用
|
||||||
|
*
|
||||||
|
* @param ids 药品目录ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<?> editMedicationStart(@RequestBody List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加药品目录信息
|
||||||
|
*
|
||||||
|
* @param medicationManageUpDto 药品目录信息
|
||||||
|
*/
|
||||||
|
R<?> addMedication(MedicationManageUpDto medicationManageUpDto);
|
||||||
|
|
||||||
|
R<?> exportMedication(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
|
@RequestParam(value = "ybMatchFlag", defaultValue = "-1") Integer ybMatchFlag,
|
||||||
|
@RequestParam(value = "statusEnum", defaultValue = "-1") Integer statusEnum,
|
||||||
|
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode, HttpServletResponse response);
|
||||||
|
}
|
||||||
@@ -0,0 +1,231 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.datadictionary.appservice.impl;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
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.core.common.utils.bean.BeanUtils;
|
||||||
|
import com.openhis.administration.domain.DeviceDefinition;
|
||||||
|
import com.openhis.administration.domain.Organization;
|
||||||
|
import com.openhis.administration.mapper.DeviceDefinitionMapper;
|
||||||
|
import com.openhis.administration.service.IDeviceDefinitionService;
|
||||||
|
import com.openhis.administration.service.IOrganizationService;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.common.enums.DeviceCategory;
|
||||||
|
import com.openhis.common.enums.OrganizationType;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
import com.openhis.common.enums.Whether;
|
||||||
|
import com.openhis.common.utils.EnumUtils;
|
||||||
|
import com.openhis.common.utils.HisPageUtils;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.web.datadictionary.appservice.IDeviceManageAppService;
|
||||||
|
import com.openhis.web.datadictionary.dto.DeviceManageDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.DeviceManageInitDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.DeviceManageSelParam;
|
||||||
|
import com.openhis.web.datadictionary.dto.DeviceManageUpDto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录 impl
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @date 2025-03-17
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DeviceDefinitionMapper deviceDefinitionMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceDefinitionService deviceDefinitionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOrganizationService organizationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录初始化
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getDeviceManageInit() {
|
||||||
|
DeviceManageInitDto deviceManageInitDto = new DeviceManageInitDto();
|
||||||
|
// 获取状态
|
||||||
|
List<DeviceManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||||
|
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
deviceManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||||
|
// 获取执行科室
|
||||||
|
LambdaQueryWrapper<Organization> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(Organization::getTypeEnum, OrganizationType.HOSPITAL_DEPARTMENT);
|
||||||
|
List<Organization> organizations = organizationService.list(queryWrapper);
|
||||||
|
List<DeviceManageInitDto.exeOrganization> exeOrganizations = organizations.stream()
|
||||||
|
.map(exeOrg -> new DeviceManageInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
deviceManageInitDto.setExeOrganizations(exeOrganizations);
|
||||||
|
// 获取分类
|
||||||
|
List<DeviceManageInitDto.deviceCategory> deviceCategories = Stream.of(DeviceCategory.values())
|
||||||
|
.map(category -> new DeviceManageInitDto.deviceCategory(category.getValue(), category.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
deviceManageInitDto.setDeviceCategories(deviceCategories);
|
||||||
|
return R.ok(deviceManageInitDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录查询
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @param searchKey 查询条件-模糊查询
|
||||||
|
* @param pageNo 查询条件
|
||||||
|
* @param pageSize 查询条件
|
||||||
|
* @return 器材目录查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getDevicePage(DeviceManageSelParam deviceManageSelParam,
|
||||||
|
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||||
|
|
||||||
|
// 构建查询条件
|
||||||
|
QueryWrapper<DeviceDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(deviceManageSelParam, searchKey,
|
||||||
|
new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||||
|
// 设置排序
|
||||||
|
queryWrapper.orderByAsc("bus_no");
|
||||||
|
|
||||||
|
// 分页查询
|
||||||
|
Page<DeviceManageDto> deviceManagePage =
|
||||||
|
HisPageUtils.selectPage(deviceDefinitionMapper, queryWrapper, pageNo, pageSize, DeviceManageDto.class);
|
||||||
|
|
||||||
|
deviceManagePage.getRecords().forEach(e -> {
|
||||||
|
// 高值器材标志枚举类回显赋值
|
||||||
|
e.setHvcmFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getHvcmFlag()));
|
||||||
|
// 医保标记枚举类回显赋值
|
||||||
|
e.setYbFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbFlag()));
|
||||||
|
// 医保对码标记枚举类回显赋值
|
||||||
|
e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbMatchFlag()));
|
||||||
|
// 过敏标记枚举类回显赋值
|
||||||
|
e.setAllergenFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getAllergenFlag()));
|
||||||
|
});
|
||||||
|
|
||||||
|
// 返回【器材目录列表DTO】分页
|
||||||
|
return R.ok(deviceManagePage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑器材信息
|
||||||
|
*
|
||||||
|
* @param deviceManageDto 器材信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> editDevice(DeviceManageUpDto deviceManageDto) {
|
||||||
|
|
||||||
|
DeviceDefinition deviceDefinition = new DeviceDefinition();
|
||||||
|
BeanUtils.copyProperties(deviceManageDto, deviceDefinition);
|
||||||
|
|
||||||
|
// 更新器材信息
|
||||||
|
return deviceDefinitionService.updateById(deviceDefinition)
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录详细查询
|
||||||
|
*
|
||||||
|
* @param id 查询条件
|
||||||
|
* @return 器材目录查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getDeviceOne(@PathVariable("id") Long id) {
|
||||||
|
// 根据ID查询【器材目录】
|
||||||
|
DeviceDefinition byId = deviceDefinitionService.getById(id);
|
||||||
|
return R.ok(byId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录停用
|
||||||
|
*
|
||||||
|
* @param ids 器材目录ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> editDeviceStop(List<Long> ids) {
|
||||||
|
|
||||||
|
List<DeviceDefinition> DeviceDefinitionList = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
|
// 取得更新值
|
||||||
|
for (Long detail : ids) {
|
||||||
|
DeviceDefinition deviceDefinition = new DeviceDefinition();
|
||||||
|
deviceDefinition.setId(detail);
|
||||||
|
deviceDefinition.setStatusEnum(PublicationStatus.RETIRED);
|
||||||
|
DeviceDefinitionList.add(deviceDefinition);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新器材信息
|
||||||
|
return deviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材目录启用
|
||||||
|
*
|
||||||
|
* @param ids 器材目录ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> editDeviceStart(List<Long> ids) {
|
||||||
|
|
||||||
|
List<DeviceDefinition> DeviceDefinitionList = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
|
// 取得更新值
|
||||||
|
for (Long detail : ids) {
|
||||||
|
DeviceDefinition DeviceDefinition = new DeviceDefinition();
|
||||||
|
DeviceDefinition.setId(detail);
|
||||||
|
DeviceDefinition.setStatusEnum(PublicationStatus.ACTIVE);
|
||||||
|
DeviceDefinitionList.add(DeviceDefinition);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新器材信息
|
||||||
|
return deviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加供应商信息
|
||||||
|
*
|
||||||
|
* @param deviceManageUpDto 供应商信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> addDevice(@Validated @RequestBody DeviceManageUpDto deviceManageUpDto) {
|
||||||
|
|
||||||
|
DeviceDefinition DeviceDefinition = new DeviceDefinition();
|
||||||
|
BeanUtils.copyProperties(deviceManageUpDto, DeviceDefinition);
|
||||||
|
|
||||||
|
// 新增外来器材目录
|
||||||
|
DeviceDefinition.setStatusEnum(PublicationStatus.DRAFT);
|
||||||
|
return deviceDefinitionService.addDevice(DeviceDefinition)
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,256 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.datadictionary.appservice.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.utils.MessageUtils;
|
||||||
|
import com.core.common.utils.SecurityUtils;
|
||||||
|
import com.core.common.utils.bean.BeanUtils;
|
||||||
|
import com.core.common.utils.poi.ExcelUtil;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.common.enums.*;
|
||||||
|
import com.openhis.common.utils.EnumUtils;
|
||||||
|
import com.openhis.medication.domain.Medication;
|
||||||
|
import com.openhis.medication.domain.MedicationDefinition;
|
||||||
|
import com.openhis.medication.domain.MedicationDetail;
|
||||||
|
import com.openhis.medication.service.IMedicationDefinitionService;
|
||||||
|
import com.openhis.medication.service.IMedicationService;
|
||||||
|
import com.openhis.web.datadictionary.appservice.IMedicationManageAppService;
|
||||||
|
import com.openhis.web.datadictionary.dto.MedicationManageDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.MedicationManageInitDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.MedicationManageUpDto;
|
||||||
|
import com.openhis.web.datadictionary.mapper.MedicationManageSearchMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录 impl
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @date 2025-03-17
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MedicationManageAppServiceImpl implements IMedicationManageAppService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMedicationService medicationService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMedicationDefinitionService medicationDefinitionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MedicationManageSearchMapper medicationManageSearchMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录初始化
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getMedicationInit() {
|
||||||
|
|
||||||
|
MedicationManageInitDto medicationManageInitDto = new MedicationManageInitDto();
|
||||||
|
// 获取状态
|
||||||
|
List<MedicationManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||||
|
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
// 获取适用范围
|
||||||
|
List<MedicationManageInitDto.domainEnumOption> domainEnumOptions = Stream.of(ApplicableScope.values())
|
||||||
|
.map(domain -> new MedicationManageInitDto.domainEnumOption(domain.getValue(), domain.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
medicationManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||||
|
medicationManageInitDto.setDomainFlagOptions(domainEnumOptions);
|
||||||
|
return R.ok(medicationManageInitDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录查询
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @param searchKey 查询条件-模糊查询
|
||||||
|
* @param pageNo 查询条件
|
||||||
|
* @param pageSize 查询条件
|
||||||
|
* @return 药品目录查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getMedicationList(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
|
@RequestParam(value = "ybMatchFlag", defaultValue = "-1") Integer ybMatchFlag,
|
||||||
|
@RequestParam(value = "statusEnum", defaultValue = "-1") Integer statusEnum,
|
||||||
|
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||||
|
|
||||||
|
// 分页设置
|
||||||
|
Integer offset = (pageNo - 1) * pageSize;
|
||||||
|
// 获取租户ID
|
||||||
|
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
|
// 查询药品目录列表
|
||||||
|
List<MedicationManageDto> medicationDetailList = medicationManageSearchMapper.getPage(searchKey, ybMatchFlag,
|
||||||
|
statusEnum, categoryCode, tenantId, pageSize, offset);
|
||||||
|
// 查询总记录数
|
||||||
|
long total =
|
||||||
|
medicationManageSearchMapper.getPageCount(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||||
|
// 创建Page对象并设置属性
|
||||||
|
Page<MedicationManageDto> medicationManageDtoPage = new Page<>(pageNo, pageSize, total);
|
||||||
|
medicationManageDtoPage.setRecords(medicationDetailList);
|
||||||
|
|
||||||
|
// 枚举类回显赋值
|
||||||
|
medicationManageDtoPage.getRecords().forEach(e -> {
|
||||||
|
// 药品状态
|
||||||
|
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, e.getStatusEnum()));
|
||||||
|
// 活动标记
|
||||||
|
e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
||||||
|
// 适用范围
|
||||||
|
e.setDomainEnum_enumText(EnumUtils.getInfoByValue(ApplicableScope.class, e.getDomainEnum()));
|
||||||
|
// 药品分类
|
||||||
|
e.setCategoryCode_enumText(EnumUtils.getInfoByValue(ItemCategory.class, e.getCategoryCode()));
|
||||||
|
// 是否皮试
|
||||||
|
e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag()));
|
||||||
|
// 是否为注射药物
|
||||||
|
e.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getInjectFlag()));
|
||||||
|
// 是否限制使用
|
||||||
|
e.setRestrictedFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getRestrictedFlag()));
|
||||||
|
// 儿童用药标志
|
||||||
|
e.setChildrenFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getChildrenFlag()));
|
||||||
|
});
|
||||||
|
|
||||||
|
// 返回【药品录列表DTO】分页
|
||||||
|
return R.ok(medicationManageDtoPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑供应商信息
|
||||||
|
*
|
||||||
|
* @param medicationManageUpDto 供应商信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> editMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||||
|
|
||||||
|
MedicationDefinition medicationDefinition = new MedicationDefinition();
|
||||||
|
Medication medication = new Medication();
|
||||||
|
BeanUtils.copyProperties(medicationManageUpDto, medication); // 子表信息
|
||||||
|
BeanUtils.copyProperties(medicationManageUpDto, medicationDefinition);// 主表信息
|
||||||
|
|
||||||
|
// 更新子表药品信息
|
||||||
|
if (medicationService.updateById(medication)) {
|
||||||
|
// 更新主表药品信息
|
||||||
|
return medicationDefinitionService.updateById(medicationDefinition)
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
} else {
|
||||||
|
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录详细查询
|
||||||
|
*
|
||||||
|
* @param id 查询条件
|
||||||
|
* @return 药品目录查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getMedicationOne(@PathVariable("id") Long id) {
|
||||||
|
|
||||||
|
// 获取租户ID
|
||||||
|
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
|
// 查询药品目录列表
|
||||||
|
MedicationManageDto medicationManageDto = medicationManageSearchMapper.getOne(id, tenantId);
|
||||||
|
// 返回【药品录列表DTO】列表
|
||||||
|
return R.ok(medicationManageDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录停用
|
||||||
|
*
|
||||||
|
* @param ids 药品目录ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> editMedicationStop(List<Long> ids) {
|
||||||
|
|
||||||
|
List<Medication> medicationList = new ArrayList<>();
|
||||||
|
// 取得更新值
|
||||||
|
for (Long detail : ids) {
|
||||||
|
Medication medication = new Medication();
|
||||||
|
medication.setId(detail);
|
||||||
|
medication.setStatusEnum(PublicationStatus.RETIRED);
|
||||||
|
medicationList.add(medication);
|
||||||
|
}
|
||||||
|
// 更新药品信息
|
||||||
|
return medicationService.updateBatchById(medicationList)
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录启用
|
||||||
|
*
|
||||||
|
* @param ids 药品目录ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> editMedicationStart(List<Long> ids) {
|
||||||
|
|
||||||
|
List<Medication> medicationList = new ArrayList<>();
|
||||||
|
// 取得更新值
|
||||||
|
for (Long detail : ids) {
|
||||||
|
Medication medication = new Medication();
|
||||||
|
medication.setId(detail);
|
||||||
|
medication.setStatusEnum(PublicationStatus.ACTIVE);
|
||||||
|
medicationList.add(medication);
|
||||||
|
}
|
||||||
|
// 更新药品信息
|
||||||
|
return medicationService.updateBatchById(medicationList)
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加供应商信息
|
||||||
|
*
|
||||||
|
* @param medicationManageUpDto 供应商信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> addMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||||
|
|
||||||
|
MedicationDetail medicationDetail = new MedicationDetail();
|
||||||
|
BeanUtils.copyProperties(medicationManageUpDto, medicationDetail);
|
||||||
|
// 新增主表外来药品目录
|
||||||
|
if (medicationDefinitionService.addMedication(medicationDetail)) {
|
||||||
|
// 新增子表外来药品目录
|
||||||
|
return medicationService.addMedication(medicationDetail)
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||||
|
} else {
|
||||||
|
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> exportMedication(String searchKey, Integer ybMatchFlag, Integer statusEnum, String categoryCode,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
// 获取租户ID
|
||||||
|
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
|
List<MedicationManageDto> list =
|
||||||
|
medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||||
|
ExcelUtil<MedicationManageDto> util = new ExcelUtil<>(MedicationManageDto.class);
|
||||||
|
util.exportExcel(response, list, "药品目录");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,38 +1,17 @@
|
|||||||
package com.openhis.web.datadictionary.controller;
|
package com.openhis.web.datadictionary.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
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.core.domain.R;
|
||||||
import com.core.common.utils.MessageUtils;
|
|
||||||
import com.core.common.utils.bean.BeanUtils;
|
|
||||||
import com.openhis.administration.domain.DeviceDefinition;
|
|
||||||
import com.openhis.administration.domain.Organization;
|
|
||||||
import com.openhis.administration.mapper.DeviceDefinitionMapper;
|
|
||||||
import com.openhis.administration.service.IDeviceDefinitionService;
|
import com.openhis.administration.service.IDeviceDefinitionService;
|
||||||
import com.openhis.administration.service.IOrganizationService;
|
import com.openhis.web.datadictionary.appservice.IDeviceManageAppService;
|
||||||
import com.openhis.common.constant.PromptMsgConstant;
|
|
||||||
import com.openhis.common.enums.DeviceCategory;
|
|
||||||
import com.openhis.common.enums.OrganizationType;
|
|
||||||
import com.openhis.common.enums.PublicationStatus;
|
|
||||||
import com.openhis.common.enums.WhetherContainUnknown;
|
|
||||||
import com.openhis.common.utils.EnumUtils;
|
|
||||||
import com.openhis.common.utils.HisPageUtils;
|
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
|
||||||
import com.openhis.web.datadictionary.dto.DeviceManageDto;
|
import com.openhis.web.datadictionary.dto.DeviceManageDto;
|
||||||
import com.openhis.web.datadictionary.dto.DeviceManageInitDto;
|
|
||||||
import com.openhis.web.datadictionary.dto.DeviceManageSelParam;
|
import com.openhis.web.datadictionary.dto.DeviceManageSelParam;
|
||||||
import com.openhis.web.datadictionary.dto.DeviceManageUpDto;
|
import com.openhis.web.datadictionary.dto.DeviceManageUpDto;
|
||||||
|
|
||||||
@@ -51,8 +30,11 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DeviceManageController {
|
public class DeviceManageController {
|
||||||
private final IDeviceDefinitionService iDeviceDefinitionService;
|
private final IDeviceDefinitionService iDeviceDefinitionService;
|
||||||
private final DeviceDefinitionMapper DeviceDefinitionMapper;
|
// private final DeviceDefinitionMapper DeviceDefinitionMapper;
|
||||||
private final IOrganizationService iOrganizationService;
|
// private final IOrganizationService iOrganizationService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceManageAppService deviceManageAppService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: 器材目录初期查询
|
* TODO: 器材目录初期查询
|
||||||
@@ -61,66 +43,72 @@ public class DeviceManageController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/init")
|
@GetMapping("/init")
|
||||||
public R<?> getDeviceManageInit() {
|
public R<?> getDeviceManageInit() {
|
||||||
DeviceManageInitDto deviceManageInitDto = new DeviceManageInitDto();
|
|
||||||
// 获取状态
|
return deviceManageAppService.getDeviceManageInit();
|
||||||
List<DeviceManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
|
||||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
// DeviceManageInitDto deviceManageInitDto = new DeviceManageInitDto();
|
||||||
.collect(Collectors.toList());
|
// // 获取状态
|
||||||
deviceManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
// List<DeviceManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||||
// 获取执行科室
|
// .map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||||
LambdaQueryWrapper<Organization> queryWrapper = new LambdaQueryWrapper<>();
|
// .collect(Collectors.toList());
|
||||||
queryWrapper.eq(Organization::getTypeEnum, OrganizationType.HOSPITAL_DEPARTMENT);
|
// deviceManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||||
List<Organization> organizations = iOrganizationService.list(queryWrapper);
|
// // 获取执行科室
|
||||||
List<DeviceManageInitDto.exeOrganization> exeOrganizations = organizations.stream()
|
// LambdaQueryWrapper<Organization> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
.map(exeOrg -> new DeviceManageInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName()))
|
// queryWrapper.eq(Organization::getTypeEnum, OrganizationType.HOSPITAL_DEPARTMENT);
|
||||||
.collect(Collectors.toList());
|
// List<Organization> organizations = iOrganizationService.list(queryWrapper);
|
||||||
deviceManageInitDto.setExeOrganizations(exeOrganizations);
|
// List<DeviceManageInitDto.exeOrganization> exeOrganizations = organizations.stream()
|
||||||
// 获取分类
|
// .map(exeOrg -> new DeviceManageInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName()))
|
||||||
List<DeviceManageInitDto.deviceCategory> deviceCategories = Stream.of(DeviceCategory.values())
|
// .collect(Collectors.toList());
|
||||||
.map(category -> new DeviceManageInitDto.deviceCategory(category.getValue(), category.getInfo()))
|
// deviceManageInitDto.setExeOrganizations(exeOrganizations);
|
||||||
.collect(Collectors.toList());
|
// // 获取分类
|
||||||
deviceManageInitDto.setDeviceCategories(deviceCategories);
|
// List<DeviceManageInitDto.deviceCategory> deviceCategories = Stream.of(DeviceCategory.values())
|
||||||
return R.ok(deviceManageInitDto);
|
// .map(category -> new DeviceManageInitDto.deviceCategory(category.getValue(), category.getInfo()))
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
// deviceManageInitDto.setDeviceCategories(deviceCategories);
|
||||||
|
// return R.ok(deviceManageInitDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询器材目录分页列表
|
* 查询器材目录分页列表
|
||||||
*
|
*
|
||||||
* @param DeviceManageSelParam 查询条件
|
* @param deviceManageSelParam 查询条件
|
||||||
* @param searchKey 查询条件-模糊查询
|
* @param searchKey 查询条件-模糊查询
|
||||||
* @param pageNo 当前页码
|
* @param pageNo 当前页码
|
||||||
* @param pageSize 查询条数
|
* @param pageSize 查询条数
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/information-page")
|
@GetMapping("/information-page")
|
||||||
public R<?> getDevicePage(DeviceManageSelParam DeviceManageSelParam,
|
public R<?> getDevicePage(DeviceManageSelParam deviceManageSelParam,
|
||||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||||
|
|
||||||
// 构建查询条件
|
return deviceManageAppService.getDevicePage(deviceManageSelParam, searchKey, pageNo, pageSize, request);
|
||||||
QueryWrapper<DeviceDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(DeviceManageSelParam, searchKey,
|
|
||||||
new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
|
||||||
// 设置排序
|
|
||||||
queryWrapper.orderByAsc("bus_no");
|
|
||||||
|
|
||||||
// 分页查询
|
// // 构建查询条件
|
||||||
Page<DeviceManageDto> deviceManagePage =
|
// QueryWrapper<DeviceDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(deviceManageSelParam,
|
||||||
HisPageUtils.selectPage(DeviceDefinitionMapper, queryWrapper, pageNo, pageSize, DeviceManageDto.class);
|
// searchKey,
|
||||||
|
// new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||||
deviceManagePage.getRecords().forEach(e -> {
|
// // 设置排序
|
||||||
// 高值器材标志枚举类回显赋值
|
// queryWrapper.orderByAsc("bus_no");
|
||||||
e.setHvcmFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getHvcmFlag()));
|
//
|
||||||
// 医保标记枚举类回显赋值
|
// // 分页查询
|
||||||
e.setYbFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getYbFlag()));
|
// Page<DeviceManageDto> deviceManagePage =
|
||||||
// 医保对码标记枚举类回显赋值
|
// HisPageUtils.selectPage(DeviceDefinitionMapper, queryWrapper, pageNo, pageSize, DeviceManageDto.class);
|
||||||
e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getYbMatchFlag()));
|
//
|
||||||
// 过敏标记枚举类回显赋值
|
// deviceManagePage.getRecords().forEach(e -> {
|
||||||
e.setAllergenFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getAllergenFlag()));
|
// // 高值器材标志枚举类回显赋值
|
||||||
});
|
// e.setHvcmFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getHvcmFlag()));
|
||||||
|
// // 医保标记枚举类回显赋值
|
||||||
// 返回【器材目录列表DTO】分页
|
// e.setYbFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getYbFlag()));
|
||||||
return R.ok(deviceManagePage);
|
// // 医保对码标记枚举类回显赋值
|
||||||
|
// e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getYbMatchFlag()));
|
||||||
|
// // 过敏标记枚举类回显赋值
|
||||||
|
// e.setAllergenFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getAllergenFlag()));
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// // 返回【器材目录列表DTO】分页
|
||||||
|
// return R.ok(deviceManagePage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -132,27 +120,30 @@ public class DeviceManageController {
|
|||||||
@GetMapping("/information-one/{id}")
|
@GetMapping("/information-one/{id}")
|
||||||
public R<?> getDeviceOne(@PathVariable("id") Long id) {
|
public R<?> getDeviceOne(@PathVariable("id") Long id) {
|
||||||
|
|
||||||
// 根据ID查询【器材目录】
|
return deviceManageAppService.getDeviceOne(id);
|
||||||
DeviceDefinition byId = iDeviceDefinitionService.getById(id);
|
// // 根据ID查询【器材目录】
|
||||||
return R.ok(byId);
|
// DeviceDefinition byId = iDeviceDefinitionService.getById(id);
|
||||||
|
// return R.ok(byId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 器材目录编辑
|
* 器材目录编辑
|
||||||
*
|
*
|
||||||
* @param DeviceManageDto 器材目录列表
|
* @param deviceManageDto 器材目录列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PutMapping("/information")
|
@PutMapping("/information")
|
||||||
public R<?> editDevice(@RequestBody DeviceManageUpDto DeviceManageDto) {
|
public R<?> editDevice(@RequestBody DeviceManageUpDto deviceManageDto) {
|
||||||
|
|
||||||
DeviceDefinition DeviceDefinition = new DeviceDefinition();
|
return deviceManageAppService.editDevice(deviceManageDto);
|
||||||
BeanUtils.copyProperties(DeviceManageDto, DeviceDefinition);
|
|
||||||
|
|
||||||
// 更新器材信息
|
// DeviceDefinition DeviceDefinition = new DeviceDefinition();
|
||||||
return iDeviceDefinitionService.updateById(DeviceDefinition)
|
// BeanUtils.copyProperties(deviceManageDto, DeviceDefinition);
|
||||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
//
|
||||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
// // 更新器材信息
|
||||||
|
// return iDeviceDefinitionService.updateById(DeviceDefinition)
|
||||||
|
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||||
|
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -163,19 +154,22 @@ public class DeviceManageController {
|
|||||||
*/
|
*/
|
||||||
@PutMapping("/information-stop")
|
@PutMapping("/information-stop")
|
||||||
public R<?> editDeviceStop(@RequestBody List<Long> ids) {
|
public R<?> editDeviceStop(@RequestBody List<Long> ids) {
|
||||||
List<DeviceDefinition> DeviceDefinitionList = new CopyOnWriteArrayList<>();
|
|
||||||
|
|
||||||
// 取得更新值
|
return deviceManageAppService.editDeviceStop(ids);
|
||||||
for (Long detail : ids) {
|
|
||||||
DeviceDefinition DeviceDefinition = new DeviceDefinition();
|
// List<DeviceDefinition> DeviceDefinitionList = new CopyOnWriteArrayList<>();
|
||||||
DeviceDefinition.setId(detail);
|
//
|
||||||
DeviceDefinition.setStatusEnum(PublicationStatus.RETIRED);
|
// // 取得更新值
|
||||||
DeviceDefinitionList.add(DeviceDefinition);
|
// for (Long detail : ids) {
|
||||||
}
|
// DeviceDefinition DeviceDefinition = new DeviceDefinition();
|
||||||
// 更新器材信息
|
// DeviceDefinition.setId(detail);
|
||||||
return iDeviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
// DeviceDefinition.setStatusEnum(PublicationStatus.RETIRED);
|
||||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
// DeviceDefinitionList.add(DeviceDefinition);
|
||||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
// }
|
||||||
|
// // 更新器材信息
|
||||||
|
// return iDeviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
||||||
|
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||||
|
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -186,36 +180,42 @@ public class DeviceManageController {
|
|||||||
*/
|
*/
|
||||||
@PutMapping("/information-start")
|
@PutMapping("/information-start")
|
||||||
public R<?> editDeviceStart(@RequestBody List<Long> ids) {
|
public R<?> editDeviceStart(@RequestBody List<Long> ids) {
|
||||||
List<DeviceDefinition> DeviceDefinitionList = new CopyOnWriteArrayList<>();
|
|
||||||
|
|
||||||
// 取得更新值
|
return deviceManageAppService.editDeviceStart(ids);
|
||||||
for (Long detail : ids) {
|
|
||||||
DeviceDefinition DeviceDefinition = new DeviceDefinition();
|
// List<DeviceDefinition> DeviceDefinitionList = new CopyOnWriteArrayList<>();
|
||||||
DeviceDefinition.setId(detail);
|
//
|
||||||
DeviceDefinition.setStatusEnum(PublicationStatus.ACTIVE);
|
// // 取得更新值
|
||||||
DeviceDefinitionList.add(DeviceDefinition);
|
// for (Long detail : ids) {
|
||||||
}
|
// DeviceDefinition DeviceDefinition = new DeviceDefinition();
|
||||||
// 更新器材信息
|
// DeviceDefinition.setId(detail);
|
||||||
return iDeviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
// DeviceDefinition.setStatusEnum(PublicationStatus.ACTIVE);
|
||||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
// DeviceDefinitionList.add(DeviceDefinition);
|
||||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
// }
|
||||||
|
// // 更新器材信息
|
||||||
|
// return iDeviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
||||||
|
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||||
|
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增外来器材目录
|
* 新增外来器材目录
|
||||||
*
|
*
|
||||||
* @param DeviceManageUpDto 器材目录
|
* @param deviceManageUpDto 器材目录
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/information")
|
@PostMapping("/information")
|
||||||
public R<?> addDevice(@Validated @RequestBody DeviceManageUpDto DeviceManageUpDto) {
|
public R<?> addDevice(@Validated @RequestBody DeviceManageUpDto deviceManageUpDto) {
|
||||||
DeviceDefinition DeviceDefinition = new DeviceDefinition();
|
|
||||||
BeanUtils.copyProperties(DeviceManageUpDto, DeviceDefinition);
|
return deviceManageAppService.addDevice(deviceManageUpDto);
|
||||||
// 新增外来器材目录
|
|
||||||
DeviceDefinition.setStatusEnum(PublicationStatus.DRAFT);
|
// DeviceDefinition DeviceDefinition = new DeviceDefinition();
|
||||||
return iDeviceDefinitionService.addDevice(DeviceDefinition)
|
// BeanUtils.copyProperties(deviceManageUpDto, DeviceDefinition);
|
||||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
// // 新增外来器材目录
|
||||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
// DeviceDefinition.setStatusEnum(PublicationStatus.DRAFT);
|
||||||
|
// return iDeviceDefinitionService.addDevice(DeviceDefinition)
|
||||||
|
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||||
|
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import com.openhis.common.constant.PromptMsgConstant;
|
|||||||
import com.openhis.common.enums.ActivityDefCategory;
|
import com.openhis.common.enums.ActivityDefCategory;
|
||||||
import com.openhis.common.enums.OrganizationType;
|
import com.openhis.common.enums.OrganizationType;
|
||||||
import com.openhis.common.enums.PublicationStatus;
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
import com.openhis.common.enums.WhetherContainUnknown;
|
import com.openhis.common.enums.Whether;
|
||||||
import com.openhis.common.utils.EnumUtils;
|
import com.openhis.common.utils.EnumUtils;
|
||||||
import com.openhis.common.utils.HisPageUtils;
|
import com.openhis.common.utils.HisPageUtils;
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
@@ -142,9 +142,9 @@ public class DiagnosisTreatmentController {
|
|||||||
|
|
||||||
diseaseTreatmentPage.getRecords().forEach(e -> {
|
diseaseTreatmentPage.getRecords().forEach(e -> {
|
||||||
// 医保标记枚举类回显赋值
|
// 医保标记枚举类回显赋值
|
||||||
e.setYbFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getYbFlag()));
|
e.setYbFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbFlag()));
|
||||||
// 医保对码标记枚举类回显赋值
|
// 医保对码标记枚举类回显赋值
|
||||||
e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getYbMatchFlag()));
|
e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbMatchFlag()));
|
||||||
});
|
});
|
||||||
|
|
||||||
// 返回【诊疗目录列表DTO】分页
|
// 返回【诊疗目录列表DTO】分页
|
||||||
|
|||||||
@@ -1,34 +1,17 @@
|
|||||||
package com.openhis.web.datadictionary.controller;
|
package com.openhis.web.datadictionary.controller;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.core.common.utils.poi.ExcelUtil;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.core.system.domain.SysOperLog;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
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.core.domain.R;
|
||||||
import com.core.common.utils.MessageUtils;
|
import com.openhis.web.datadictionary.appservice.IMedicationManageAppService;
|
||||||
import com.core.common.utils.SecurityUtils;
|
|
||||||
import com.core.common.utils.bean.BeanUtils;
|
|
||||||
import com.openhis.common.constant.PromptMsgConstant;
|
|
||||||
import com.openhis.common.enums.PublicationStatus;
|
|
||||||
import com.openhis.medication.domain.Medication;
|
|
||||||
import com.openhis.medication.domain.MedicationDefinition;
|
|
||||||
import com.openhis.medication.domain.MedicationDetail;
|
|
||||||
import com.openhis.medication.service.IMedicationDefinitionService;
|
|
||||||
import com.openhis.medication.service.IMedicationService;
|
|
||||||
import com.openhis.web.datadictionary.dto.MedicationManageDto;
|
|
||||||
import com.openhis.web.datadictionary.dto.MedicationManageInitDto;
|
|
||||||
import com.openhis.web.datadictionary.dto.MedicationManageUpDto;
|
import com.openhis.web.datadictionary.dto.MedicationManageUpDto;
|
||||||
import com.openhis.web.datadictionary.mapper.MedicationManageSearchMapper;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -40,14 +23,17 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
* @date 2025-02-21
|
* @date 2025-02-21
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/datadictionary/medication")
|
@RequestMapping("/data-dictionary/medication")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MedicationManageController {
|
public class MedicationManageController {
|
||||||
|
|
||||||
private final IMedicationDefinitionService iMedicationDefinitionService;
|
// private final IMedicationDefinitionService iMedicationDefinitionService;
|
||||||
private final IMedicationService iMedicationService;
|
// private final IMedicationService iMedicationService;
|
||||||
private final MedicationManageSearchMapper medicationManageSearchMapper;
|
// private final MedicationManageSearchMapper medicationManageSearchMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMedicationManageAppService medicationManageAppService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品目录初始化
|
* 药品目录初始化
|
||||||
@@ -56,13 +42,16 @@ public class MedicationManageController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/information-init")
|
@GetMapping("/information-init")
|
||||||
public R<?> getMedicationInit() {
|
public R<?> getMedicationInit() {
|
||||||
MedicationManageInitDto medicationManageInitDto = new MedicationManageInitDto();
|
|
||||||
// 获取状态
|
return medicationManageAppService.getMedicationInit();
|
||||||
List<MedicationManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
|
||||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
// MedicationManageInitDto medicationManageInitDto = new MedicationManageInitDto();
|
||||||
.collect(Collectors.toList());
|
// // 获取状态
|
||||||
medicationManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
// List<MedicationManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||||
return R.ok(medicationManageInitDto);
|
// .map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
// medicationManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||||
|
// return R.ok(medicationManageInitDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,21 +72,25 @@ public class MedicationManageController {
|
|||||||
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode,
|
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode,
|
||||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||||
// 分页设置
|
|
||||||
Integer offset = (pageNo - 1) * pageSize;
|
return medicationManageAppService.getMedicationList(searchKey, ybMatchFlag, statusEnum, categoryCode, pageNo,
|
||||||
// 获取租户ID
|
pageSize, request);
|
||||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
|
||||||
// 查询药品目录列表
|
// // 分页设置
|
||||||
List<MedicationManageDto> medicationDetailList = medicationManageSearchMapper.getPage(searchKey, ybMatchFlag,
|
// Integer offset = (pageNo - 1) * pageSize;
|
||||||
statusEnum, categoryCode, tenantId, pageSize, offset);
|
// // 获取租户ID
|
||||||
// 查询总记录数
|
// Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
long total =
|
// // 查询药品目录列表
|
||||||
medicationManageSearchMapper.getPageCount(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
// List<MedicationManageDto> medicationDetailList = medicationManageSearchMapper.getPage(searchKey, ybMatchFlag,
|
||||||
// 创建Page对象并设置属性
|
// statusEnum, categoryCode, tenantId, pageSize, offset);
|
||||||
Page<MedicationManageDto> medicationManageDtoPage = new Page<>(pageNo, pageSize, total);
|
// // 查询总记录数
|
||||||
medicationManageDtoPage.setRecords(medicationDetailList);
|
// long total =
|
||||||
// 返回【药品录列表DTO】分页
|
// medicationManageSearchMapper.getPageCount(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||||
return R.ok(medicationManageDtoPage);
|
// // 创建Page对象并设置属性
|
||||||
|
// Page<MedicationManageDto> medicationManageDtoPage = new Page<>(pageNo, pageSize, total);
|
||||||
|
// medicationManageDtoPage.setRecords(medicationDetailList);
|
||||||
|
// // 返回【药品录列表DTO】分页
|
||||||
|
// return R.ok(medicationManageDtoPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,54 +100,62 @@ public class MedicationManageController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/information-one/{id}")
|
@GetMapping("/information-one/{id}")
|
||||||
public R<?> getDiseaseOne(@PathVariable("id") Long id) {
|
public R<?> getMedicationOne(@PathVariable("id") Long id) {
|
||||||
// 获取租户ID
|
|
||||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
return medicationManageAppService.getMedicationOne(id);
|
||||||
// 查询药品目录列表
|
|
||||||
MedicationManageDto medicationManageDto = medicationManageSearchMapper.getOne(id, tenantId);
|
// // 获取租户ID
|
||||||
// 返回【药品录列表DTO】列表
|
// Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
return R.ok(medicationManageDto);
|
// // 查询药品目录列表
|
||||||
|
// MedicationManageDto medicationManageDto = medicationManageSearchMapper.getOne(id, tenantId);
|
||||||
|
// // 返回【药品录列表DTO】列表
|
||||||
|
// return R.ok(medicationManageDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 药品目录编辑
|
// 药品目录编辑
|
||||||
@PutMapping("/information")
|
@PutMapping("/information")
|
||||||
public R<?> editMedication(@RequestBody MedicationManageUpDto medicationManageUpDto) {
|
public R<?> editMedication(@RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||||
MedicationDefinition medicationDefinition = new MedicationDefinition();
|
|
||||||
Medication medication = new Medication();
|
|
||||||
BeanUtils.copyProperties(medicationManageUpDto, medication); // 子表信息
|
|
||||||
BeanUtils.copyProperties(medicationManageUpDto, medicationDefinition);// 主表信息
|
|
||||||
|
|
||||||
// 更新子表药品信息
|
return medicationManageAppService.editMedication(medicationManageUpDto);
|
||||||
if (iMedicationService.updateById(medication)) {
|
|
||||||
// 更新主表药品信息
|
// MedicationDefinition medicationDefinition = new MedicationDefinition();
|
||||||
return iMedicationDefinitionService.updateById(medicationDefinition)
|
// Medication medication = new Medication();
|
||||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
// BeanUtils.copyProperties(medicationManageUpDto, medication); // 子表信息
|
||||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
// BeanUtils.copyProperties(medicationManageUpDto, medicationDefinition);// 主表信息
|
||||||
} else {
|
//
|
||||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
// // 更新子表药品信息
|
||||||
}
|
// if (iMedicationService.updateById(medication)) {
|
||||||
|
// // 更新主表药品信息
|
||||||
|
// return iMedicationDefinitionService.updateById(medicationDefinition)
|
||||||
|
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||||
|
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
// } else {
|
||||||
|
// return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品目录停用
|
* 药品目录停用
|
||||||
*
|
*
|
||||||
* @param ids 药品ID列表
|
* @param ids 药品ID列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PutMapping("/information-stop")
|
@PutMapping("/information-stop")
|
||||||
public R<?> editMedicationStop(@RequestBody List<Long> ids) {
|
public R<?> editMedicationStop(@RequestBody List<Long> ids) {
|
||||||
List<Medication> medicationList = new ArrayList<>();
|
// List<Medication> medicationList = new ArrayList<>();
|
||||||
// 取得更新值
|
// // 取得更新值
|
||||||
for (Long detail : ids) {
|
// for (Long detail : ids) {
|
||||||
Medication medication = new Medication();
|
// Medication medication = new Medication();
|
||||||
medication.setId(detail);
|
// medication.setId(detail);
|
||||||
medication.setStatusEnum(PublicationStatus.RETIRED);
|
// medication.setStatusEnum(PublicationStatus.RETIRED);
|
||||||
medicationList.add(medication);
|
// medicationList.add(medication);
|
||||||
}
|
// }
|
||||||
// 更新药品信息
|
// // 更新药品信息
|
||||||
return iMedicationService.updateBatchById(medicationList)
|
// return iMedicationService.updateBatchById(medicationList)
|
||||||
? 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.M00007, null));
|
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
|
||||||
|
return medicationManageAppService.editMedicationStop(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -165,44 +166,49 @@ public class MedicationManageController {
|
|||||||
*/
|
*/
|
||||||
@PutMapping("/information-start")
|
@PutMapping("/information-start")
|
||||||
public R<?> editMedicationStart(@RequestBody List<Long> ids) {
|
public R<?> editMedicationStart(@RequestBody List<Long> ids) {
|
||||||
List<Medication> medicationList = new ArrayList<>();
|
|
||||||
// 取得更新值
|
return medicationManageAppService.editMedicationStart(ids);
|
||||||
for (Long detail : ids) {
|
// List<Medication> medicationList = new ArrayList<>();
|
||||||
Medication medication = new Medication();
|
// // 取得更新值
|
||||||
medication.setId(detail);
|
// for (Long detail : ids) {
|
||||||
medication.setStatusEnum(PublicationStatus.ACTIVE);
|
// Medication medication = new Medication();
|
||||||
medicationList.add(medication);
|
// medication.setId(detail);
|
||||||
}
|
// medication.setStatusEnum(PublicationStatus.ACTIVE);
|
||||||
// 更新药品信息
|
// medicationList.add(medication);
|
||||||
return iMedicationService.updateBatchById(medicationList)
|
// }
|
||||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
// // 更新药品信息
|
||||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
// return iMedicationService.updateBatchById(medicationList)
|
||||||
|
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||||
|
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增外来药品目录
|
* 新增外来药品目录
|
||||||
*
|
*
|
||||||
* @param medicationManageUpDto 药品目录信息
|
* @param medicationManageUpDto 药品目录信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/information")
|
@PostMapping("/information")
|
||||||
public R<?> addMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
public R<?> addMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||||
MedicationDetail medicationDetail = new MedicationDetail();
|
|
||||||
BeanUtils.copyProperties(medicationManageUpDto, medicationDetail);
|
return medicationManageAppService.addMedication(medicationManageUpDto);
|
||||||
// 新增主表外来药品目录
|
|
||||||
if (iMedicationDefinitionService.addMedication(medicationDetail)) {
|
// MedicationDetail medicationDetail = new MedicationDetail();
|
||||||
// 新增子表外来药品目录
|
// BeanUtils.copyProperties(medicationManageUpDto, medicationDetail);
|
||||||
return iMedicationService.addMedication(medicationDetail)
|
// // 新增主表外来药品目录
|
||||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
// if (iMedicationDefinitionService.addMedication(medicationDetail)) {
|
||||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
// // 新增子表外来药品目录
|
||||||
} else {
|
// return iMedicationService.addMedication(medicationDetail)
|
||||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||||
}
|
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||||
|
// } else {
|
||||||
|
// return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增医保药品目录
|
* 新增医保药品目录
|
||||||
*
|
*
|
||||||
* @param medicationManageUpDto 药品目录信息
|
* @param medicationManageUpDto 药品目录信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -211,9 +217,9 @@ public class MedicationManageController {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品目录导出
|
* 药品目录导出
|
||||||
|
*
|
||||||
* @param searchKey 查询条件
|
* @param searchKey 查询条件
|
||||||
* @param statusEnum 查询条件-状态
|
* @param statusEnum 查询条件-状态
|
||||||
* @param ybMatchFlag 查询条件-是否对码
|
* @param ybMatchFlag 查询条件-是否对码
|
||||||
@@ -223,14 +229,18 @@ public class MedicationManageController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/information-export")
|
@GetMapping("/information-export")
|
||||||
public R<?> exportMedication(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
public R<?> exportMedication(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
@RequestParam(value = "ybMatchFlag", defaultValue = "-1") Integer ybMatchFlag,
|
@RequestParam(value = "ybMatchFlag", defaultValue = "-1") Integer ybMatchFlag,
|
||||||
@RequestParam(value = "statusEnum", defaultValue = "-1") Integer statusEnum,
|
@RequestParam(value = "statusEnum", defaultValue = "-1") Integer statusEnum,
|
||||||
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode, HttpServletResponse response) {
|
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode, HttpServletResponse response) {
|
||||||
// 获取租户ID
|
|
||||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
return medicationManageAppService.exportMedication(searchKey, ybMatchFlag, statusEnum, categoryCode, response);
|
||||||
List<MedicationManageDto> list = medicationManageSearchMapper.getList(searchKey,ybMatchFlag,statusEnum,categoryCode,tenantId);
|
|
||||||
ExcelUtil<MedicationManageDto> util = new ExcelUtil<>(MedicationManageDto.class);
|
// // 获取租户ID
|
||||||
util.exportExcel(response, list, "药品目录");
|
// Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
return null;
|
// List<MedicationManageDto> list =
|
||||||
|
// medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||||
|
// ExcelUtil<MedicationManageDto> util = new ExcelUtil<>(MedicationManageDto.class);
|
||||||
|
// util.exportExcel(response, list, "药品目录");
|
||||||
|
// return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ public class MedicationManageDto {
|
|||||||
private Long medicationDefId;
|
private Long medicationDefId;
|
||||||
|
|
||||||
/** 药品状态 */
|
/** 药品状态 */
|
||||||
private PublicationStatus statusEnum;
|
// private PublicationStatus statusEnum;
|
||||||
|
private Integer statusEnum;
|
||||||
|
private String statusEnum_enumText;
|
||||||
|
|
||||||
/** 所属科室 */
|
/** 所属科室 */
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
@@ -45,6 +47,7 @@ public class MedicationManageDto {
|
|||||||
|
|
||||||
/** 是否为活性 */
|
/** 是否为活性 */
|
||||||
private Integer activeFlag;
|
private Integer activeFlag;
|
||||||
|
private String activeFlag_enumText;
|
||||||
|
|
||||||
/** 批次号 */
|
/** 批次号 */
|
||||||
private String lotNumber;
|
private String lotNumber;
|
||||||
@@ -81,6 +84,7 @@ public class MedicationManageDto {
|
|||||||
|
|
||||||
/** 适用范围 */
|
/** 适用范围 */
|
||||||
private Integer domainEnum;
|
private Integer domainEnum;
|
||||||
|
private String domainEnum_enumText;
|
||||||
|
|
||||||
/** 药品版本 */
|
/** 药品版本 */
|
||||||
private String version;
|
private String version;
|
||||||
@@ -96,6 +100,7 @@ public class MedicationManageDto {
|
|||||||
|
|
||||||
/** 药品分类 */
|
/** 药品分类 */
|
||||||
private Integer categoryCode;
|
private Integer categoryCode;
|
||||||
|
private String categoryCode_enumText;
|
||||||
|
|
||||||
/** 商品名称 */
|
/** 商品名称 */
|
||||||
private String merchandiseName;
|
private String merchandiseName;
|
||||||
@@ -138,9 +143,11 @@ public class MedicationManageDto {
|
|||||||
|
|
||||||
/** 是否皮试 */
|
/** 是否皮试 */
|
||||||
private Integer skinTestFlag;
|
private Integer skinTestFlag;
|
||||||
|
private String skinTestFlag_enumText;
|
||||||
|
|
||||||
/** 是否为注射药物 */
|
/** 是否为注射药物 */
|
||||||
private Integer injectFlag;
|
private Integer injectFlag;
|
||||||
|
private String injectFlag_enumText;
|
||||||
|
|
||||||
/** 生产厂家 */
|
/** 生产厂家 */
|
||||||
private Long manufacturerId;
|
private Long manufacturerId;
|
||||||
@@ -150,12 +157,14 @@ public class MedicationManageDto {
|
|||||||
|
|
||||||
/** 是否限制使用 */
|
/** 是否限制使用 */
|
||||||
private Integer restrictedFlag;
|
private Integer restrictedFlag;
|
||||||
|
private String restrictedFlag_enumText;
|
||||||
|
|
||||||
/** 限制使用范围 */
|
/** 限制使用范围 */
|
||||||
private String restrictedScope;
|
private String restrictedScope;
|
||||||
|
|
||||||
/** 儿童用药标志 */
|
/** 儿童用药标志 */
|
||||||
private Integer childrenFlag;
|
private Integer childrenFlag;
|
||||||
|
private String childrenFlag_enumText;
|
||||||
|
|
||||||
/** 产品特性 */
|
/** 产品特性 */
|
||||||
private Integer characteristic;
|
private Integer characteristic;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import lombok.experimental.Accessors;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class MedicationManageInitDto {
|
public class MedicationManageInitDto {
|
||||||
private List<statusEnumOption> statusFlagOptions;
|
private List<statusEnumOption> statusFlagOptions;
|
||||||
|
private List<domainEnumOption> domainFlagOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态
|
* 状态
|
||||||
@@ -29,4 +30,18 @@ public class MedicationManageInitDto {
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 适用范围
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class domainEnumOption {
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
public domainEnumOption(Integer value, String info) {
|
||||||
|
this.value = value;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import com.openhis.common.constant.PromptMsgConstant;
|
|||||||
import com.openhis.common.enums.BindingType;
|
import com.openhis.common.enums.BindingType;
|
||||||
import com.openhis.common.enums.ConditionDefinitionSource;
|
import com.openhis.common.enums.ConditionDefinitionSource;
|
||||||
import com.openhis.common.enums.PublicationStatus;
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
import com.openhis.common.enums.WhetherContainUnknown;
|
import com.openhis.common.enums.Whether;
|
||||||
import com.openhis.common.utils.EnumUtils;
|
import com.openhis.common.utils.EnumUtils;
|
||||||
import com.openhis.common.utils.HisPageUtils;
|
import com.openhis.common.utils.HisPageUtils;
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
@@ -258,9 +258,9 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
|||||||
e.setTypeName(CommonConstants.BusinessName.WESTERN_MEDICINE_DIAGNOSIS);
|
e.setTypeName(CommonConstants.BusinessName.WESTERN_MEDICINE_DIAGNOSIS);
|
||||||
}
|
}
|
||||||
// 医保标记
|
// 医保标记
|
||||||
e.setYbFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getYbFlag()));
|
e.setYbFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbFlag()));
|
||||||
// 医保对码标记
|
// 医保对码标记
|
||||||
e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(WhetherContainUnknown.class, e.getYbMatchFlag()));
|
e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbMatchFlag()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ApplicableScope implements HisEnumInterface {
|
||||||
|
|
||||||
|
HUMAN(1, "human", "人"),
|
||||||
|
|
||||||
|
ANIMAL(2, "animal", "动物"),
|
||||||
|
|
||||||
|
ALL(9, "all", "全部");
|
||||||
|
|
||||||
|
ApplicableScope(int value, String code, String info) {
|
||||||
|
this.value = value;
|
||||||
|
this.code = code;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EnumValue
|
||||||
|
@JsonValue // 标记响应json值
|
||||||
|
private final Integer value;
|
||||||
|
private final String code;
|
||||||
|
private final String info;
|
||||||
|
}
|
||||||
@@ -14,29 +14,30 @@ import lombok.Getter;
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum ItemCategory {
|
public enum ItemCategory implements HisEnumInterface {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中药
|
* 中药
|
||||||
*/
|
*/
|
||||||
CHINESE_MEDICINE(1, "中药"),
|
CHINESE_MEDICINE(1, "1","中药"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 西药
|
* 西药
|
||||||
*/
|
*/
|
||||||
WESTERN_MEDICINE(2, "西药"),
|
WESTERN_MEDICINE(2, "2","西药"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中成药
|
* 中成药
|
||||||
*/
|
*/
|
||||||
CHINESE_PATENT_MEDICINE(3, "中成药"),
|
CHINESE_PATENT_MEDICINE(3, "3","中成药"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 医疗耗材
|
* 医疗耗材
|
||||||
*/
|
*/
|
||||||
MEDICAL_CONSUMABLES(4, "医疗耗材");
|
MEDICAL_CONSUMABLES(4, "4","医疗耗材");
|
||||||
|
|
||||||
private Integer value;
|
private Integer value;
|
||||||
|
private String code;
|
||||||
private String info;
|
private String info;
|
||||||
|
|
||||||
public static ItemCategory getByValue(Integer value) {
|
public static ItemCategory getByValue(Integer value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user