后端最新版本同步
This commit is contained in:
@@ -6,15 +6,15 @@ 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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.datadictionary.dto.DeviceManageSelParam;
|
||||
import com.openhis.web.datadictionary.dto.DeviceManageUpDto;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 器材目录 service
|
||||
@@ -80,4 +80,19 @@ public interface IDeviceManageAppService {
|
||||
* @return
|
||||
*/
|
||||
R<?> editDeviceStart(@RequestBody List<Long> ids);
|
||||
|
||||
/**
|
||||
* 导入器材目录
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> importData(MultipartFile file);
|
||||
|
||||
/**
|
||||
* 获取导入模板
|
||||
*
|
||||
* @param response 响应
|
||||
*/
|
||||
void importTemplate(HttpServletResponse response);
|
||||
}
|
||||
|
||||
@@ -3,35 +3,39 @@
|
||||
*/
|
||||
package com.openhis.web.datadictionary.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
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.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.entity.SysDictData;
|
||||
import com.core.common.enums.DeleteFlag;
|
||||
import com.core.common.utils.*;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
import com.core.system.service.ISysDictTypeService;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.DeviceDefinition;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.administration.service.IDeviceDefinitionService;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import com.openhis.administration.service.*;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
@@ -60,6 +64,15 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
@Autowired
|
||||
private IDeviceDefinitionService deviceDefinitionService;
|
||||
|
||||
@Autowired
|
||||
IChargeItemDefinitionService chargeItemDefinitionService;
|
||||
|
||||
@Autowired
|
||||
IChargeItemDefDetailService chargeItemDefDetailService;
|
||||
|
||||
@Autowired
|
||||
private ILocationService locationService;
|
||||
|
||||
@Resource
|
||||
private DeviceManageMapper deviceManageMapper;
|
||||
|
||||
@@ -185,11 +198,11 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> editDevice(DeviceManageUpDto deviceManageDto) {
|
||||
// // 校验是否可以编辑
|
||||
// boolean result = supplyRequestService.verifyAbleEdit(deviceManageDto.getId());
|
||||
// if (result) {
|
||||
// return R.fail("该耗材已经发生过业务,不可编辑");
|
||||
// }
|
||||
// 校验是否可以编辑
|
||||
boolean result = supplyRequestService.verifyAbleEdit(deviceManageDto.getId());
|
||||
if (result) {
|
||||
return R.fail("该耗材已经发生过业务,不可编辑");
|
||||
}
|
||||
DeviceDefinition deviceDefinition = new DeviceDefinition();
|
||||
BeanUtils.copyProperties(deviceManageDto, deviceDefinition);
|
||||
// 拼音码
|
||||
@@ -363,4 +376,96 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入器材目录
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> importData(MultipartFile file) {
|
||||
// 读取文件
|
||||
R<List<DeviceImportDto>> readResult = readExcelFile(file);
|
||||
if (R.SUCCESS != readResult.getCode()) {
|
||||
return readResult;
|
||||
}
|
||||
List<DeviceImportDto> importDtoList = readResult.getData();
|
||||
// 导入信息校验
|
||||
R<?> validateResult = validateImportDtoList(importDtoList);
|
||||
if (R.SUCCESS != validateResult.getCode()) {
|
||||
return validateResult;
|
||||
}
|
||||
// 查询机构ID、当前时间、位置信息供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
Date now = DateUtils.getNowDate();
|
||||
List<Location> locationList = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByAsc(Location::getId));
|
||||
Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId();
|
||||
Map<String, List<Location>> locationNameMap =
|
||||
locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
// 创建表数据
|
||||
for (DeviceImportDto importDto : importDtoList) {
|
||||
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导入模板
|
||||
*
|
||||
* @param response 响应
|
||||
*/
|
||||
@Override
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<DeviceImportDto> util = new ExcelUtil<>(DeviceImportDto.class);
|
||||
util.importTemplateExcel(response, "器材目录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取Excel文件
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 读取结果
|
||||
*/
|
||||
private R<List<DeviceImportDto>> readExcelFile(MultipartFile file) {
|
||||
ExcelUtil<DeviceImportDto> util = new ExcelUtil<>(DeviceImportDto.class);
|
||||
List<DeviceImportDto> importDtoList;
|
||||
try {
|
||||
importDtoList = util.importExcel(file.getInputStream());
|
||||
} catch (IOException e) {
|
||||
return R.fail("导入失败!文件读取异常");
|
||||
}
|
||||
if (importDtoList.isEmpty()) {
|
||||
return R.fail("导入失败!文件不能为空");
|
||||
}
|
||||
return R.ok(importDtoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入信息校验
|
||||
*
|
||||
* @param importDtoList 器材目录导入数据列表
|
||||
*/
|
||||
private R<?> validateImportDtoList(List<DeviceImportDto> importDtoList) {
|
||||
// 字段校验(必填及数值类型)
|
||||
|
||||
// 重复校验(文件行重复)
|
||||
|
||||
// 重复校验(文件与数据库重复)
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建器材定义实体
|
||||
*
|
||||
* @param importDto 器材目录导入Dto
|
||||
* @return 器材定义实体
|
||||
*/
|
||||
private DeviceDefinition createDeviceDefinitionEntity(DeviceImportDto importDto) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -110,15 +110,15 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setDiagnosisCategoryOptions(diagnosisCategories);
|
||||
|
||||
// 查询医疗服务项类型
|
||||
List<SysDictData> medical_service_items =
|
||||
iSysDictTypeService.selectDictDataByType(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getCode());
|
||||
// 获取医疗服务项List
|
||||
List<DiagnosisTreatmentInitDto.diseaseTreatmentType> diseaseTreatmentCategoryList = medical_service_items
|
||||
.stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(),
|
||||
status.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
List<DiagnosisTreatmentInitDto.diseaseTreatmentCategory> diseaseTreatmentCategories = new ArrayList<>();
|
||||
// // 查询医疗服务项类型
|
||||
// List<SysDictData> medical_service_items =
|
||||
// iSysDictTypeService.selectDictDataByType(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getCode());
|
||||
// // 获取医疗服务项List
|
||||
// List<DiagnosisTreatmentInitDto.diseaseTreatmentType> diseaseTreatmentCategoryList = medical_service_items
|
||||
// .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(),
|
||||
// status.getDictLabel()))
|
||||
// .toList();
|
||||
// List<DiagnosisTreatmentInitDto.diseaseTreatmentCategory> diseaseTreatmentCategories = new ArrayList<>();
|
||||
//
|
||||
// //获取目录分类
|
||||
// DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory =
|
||||
|
||||
@@ -63,13 +63,13 @@ public class DiseaseManageAppServiceImpl implements IDiseaseManageAppService {
|
||||
DiseaseManageInitDto diseaseManageInitDto = new DiseaseManageInitDto();
|
||||
// 获取疾病目录种类
|
||||
List<DiseaseManageInitDto.diseaseCategory> diseaseCategoryList = Stream.of(ConditionDefinitionSource.values())
|
||||
.map(status -> new DiseaseManageInitDto.diseaseCategory(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiseaseManageInitDto.diseaseCategory(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diseaseManageInitDto.setDiseaseCategoryList(diseaseCategoryList);
|
||||
// 获取状态
|
||||
List<DiseaseManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new DiseaseManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiseaseManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diseaseManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
|
||||
return R.ok(diseaseManageInitDto);
|
||||
@@ -79,22 +79,22 @@ public class DiseaseManageAppServiceImpl implements IDiseaseManageAppService {
|
||||
* 查询病种目录分页列表
|
||||
*
|
||||
* @param diseaseManageSelParam 查询条件
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return
|
||||
*/
|
||||
public R<?> getDiseaseList(DiseaseManageSelParam diseaseManageSelParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<ConditionDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(diseaseManageSelParam,
|
||||
searchKey, new HashSet<>(Arrays.asList("condition_code", "name", "py_str", "wb_str")), request);
|
||||
searchKey, new HashSet<>(Arrays.asList("condition_code", "name", "py_str", "wb_str")), request);
|
||||
// 设置排序
|
||||
queryWrapper.orderByAsc("condition_code");
|
||||
// 分页查询
|
||||
Page<DiseaseManageDto> diseasePage =
|
||||
HisPageUtils.selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, DiseaseManageDto.class);
|
||||
HisPageUtils.selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, DiseaseManageDto.class);
|
||||
|
||||
diseasePage.getRecords().forEach(e -> {
|
||||
// 医保对码枚举类回显赋值
|
||||
@@ -142,8 +142,8 @@ public class DiseaseManageAppServiceImpl implements IDiseaseManageAppService {
|
||||
|
||||
// 更新病种信息
|
||||
return ConditionDefinitionService.updateById(conditionDefinition)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"疾病目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"疾病目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,13 +159,13 @@ public class DiseaseManageAppServiceImpl implements IDiseaseManageAppService {
|
||||
for (Long detail : ids) {
|
||||
ConditionDefinition conditionDefinition = new ConditionDefinition();
|
||||
conditionDefinition.setId(detail);
|
||||
conditionDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
||||
conditionDefinition.setStatusEnum(PublicationStatus.RETIRED.getValue());
|
||||
conditionDefinitionList.add(conditionDefinition);
|
||||
}
|
||||
// 更新病种信息
|
||||
return ConditionDefinitionService.updateBatchById(conditionDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"疾病目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"疾病目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -186,8 +186,8 @@ public class DiseaseManageAppServiceImpl implements IDiseaseManageAppService {
|
||||
}
|
||||
// 更新病种信息
|
||||
return ConditionDefinitionService.updateBatchById(conditionDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"疾病目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"疾病目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,8 +210,8 @@ public class DiseaseManageAppServiceImpl implements IDiseaseManageAppService {
|
||||
// 五笔码
|
||||
conditionDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(conditionDefinition.getName()));
|
||||
return ConditionDefinitionService.addDisease(conditionDefinition)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"疾病目录"}))
|
||||
: 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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,10 +4,8 @@
|
||||
package com.openhis.web.datadictionary.appservice.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -21,19 +19,24 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.entity.SysDictData;
|
||||
import com.core.common.enums.DeleteFlag;
|
||||
import com.core.common.utils.*;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
import com.core.system.service.ISysDictTypeService;
|
||||
import com.openhis.administration.domain.ChargeItemDefDetail;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.administration.service.IChargeItemDefDetailService;
|
||||
import com.openhis.administration.service.IChargeItemDefinitionService;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
@@ -75,6 +78,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
@Autowired
|
||||
IChargeItemDefDetailService chargeItemDefDetailService;
|
||||
|
||||
@Autowired
|
||||
private ILocationService locationService;
|
||||
|
||||
@Autowired
|
||||
private MedicationManageSearchMapper medicationManageSearchMapper;
|
||||
@Autowired
|
||||
@@ -246,16 +252,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> editMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||
// // 校验是否可以编辑
|
||||
// boolean result = supplyRequestService.verifyAbleEdit(medicationManageUpDto.getMedicationDefId());
|
||||
// if (result) {
|
||||
// return R.fail("该药品已经发生过业务,不可编辑");
|
||||
// }
|
||||
// boolean result = medicationDispenseService.verifyAbleEdit(medicationManageUpDto.getMedicationDefId());
|
||||
// if (result) {
|
||||
// return R.fail("该药品已经发生过业务,不可编辑");
|
||||
// }
|
||||
|
||||
// 校验是否可以编辑
|
||||
boolean result = supplyRequestService.verifyAbleEdit(medicationManageUpDto.getMedicationDefId());
|
||||
if (result) {
|
||||
return R.fail("该药品已经发生过业务,不可编辑");
|
||||
}
|
||||
// Todo:用Medication和medicationDefinition的domainservice来创造新的实例,根据业务需求,使用构造函数;
|
||||
// 如果小于5哥变量,就用基本类型传递,如果大于5哥,在domain层定义构造方法的入参
|
||||
|
||||
@@ -472,15 +473,44 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> importData(MultipartFile file) {
|
||||
ExcelUtil<MedicationImportDto> util = new ExcelUtil<>(MedicationImportDto.class);
|
||||
List<MedicationImportDto> dtoList;
|
||||
try {
|
||||
dtoList = util.importExcel(file.getInputStream());
|
||||
} catch (IOException e) {
|
||||
return R.fail("文件读取失败");
|
||||
// 读取文件
|
||||
R<List<MedicationImportDto>> readResult = readExcelFile(file);
|
||||
if (R.SUCCESS != readResult.getCode()) {
|
||||
return readResult;
|
||||
}
|
||||
|
||||
return null;
|
||||
List<MedicationImportDto> importDtoList = readResult.getData();
|
||||
// 导入信息校验
|
||||
R<?> validateResult = validateImportDtoList(importDtoList);
|
||||
if (R.SUCCESS != validateResult.getCode()) {
|
||||
return validateResult;
|
||||
}
|
||||
// 查询机构ID、当前时间、位置信息供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
Date now = DateUtils.getNowDate();
|
||||
List<Location> locationList = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByAsc(Location::getId));
|
||||
Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId();
|
||||
Map<String, List<Location>> locationNameMap =
|
||||
locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
// 创建表数据
|
||||
for (MedicationImportDto importDto : importDtoList) {
|
||||
// 药品定义表
|
||||
MedicationDefinition medicationDefinition = createMedicationDefinitionEntity(importDto);
|
||||
medicationDefinitionService.save(medicationDefinition);
|
||||
// 药品表
|
||||
Medication medication =
|
||||
createMedicationEntity(importDto, medicationDefinition.getId(), defaultLocationId, locationNameMap);
|
||||
medicationService.save(medication);
|
||||
// 费用定价表
|
||||
ChargeItemDefinition chargeItemDefinition =
|
||||
createChargeItemDefinition(importDto, orgId, medicationDefinition.getId(), now);
|
||||
chargeItemDefinitionService.save(chargeItemDefinition);
|
||||
// 费用定价子表
|
||||
List<ChargeItemDefDetail> chargeItemDefDetailList =
|
||||
createChargeItemDefDetailList(importDto, chargeItemDefinition.getId());
|
||||
chargeItemDefDetailService.saveBatch(chargeItemDefDetailList);
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -494,4 +524,373 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
util.importTemplateExcel(response, "药品目录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取Excel文件
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 读取结果
|
||||
*/
|
||||
private R<List<MedicationImportDto>> readExcelFile(MultipartFile file) {
|
||||
ExcelUtil<MedicationImportDto> util = new ExcelUtil<>(MedicationImportDto.class);
|
||||
List<MedicationImportDto> importDtoList;
|
||||
try {
|
||||
importDtoList = util.importExcel(file.getInputStream());
|
||||
} catch (IOException e) {
|
||||
return R.fail("导入失败!文件读取异常");
|
||||
}
|
||||
if (importDtoList.isEmpty()) {
|
||||
return R.fail("导入失败!文件不能为空");
|
||||
}
|
||||
return R.ok(importDtoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入信息校验
|
||||
*
|
||||
* @param importDtoList 药品目录导入数据列表
|
||||
*/
|
||||
private R<?> validateImportDtoList(List<MedicationImportDto> importDtoList) {
|
||||
// 字段校验(必填及数值类型)
|
||||
List<String> fieldValidateMsgList = new ArrayList<>();
|
||||
for (int i = 0; i < importDtoList.size(); i++) {
|
||||
MedicationImportDto importDto = importDtoList.get(i);
|
||||
importDto.setLineNumber(i + 2);
|
||||
List<String> lineValidateMsgList = new ArrayList<>();
|
||||
if (StringUtils.isEmpty(importDto.getName())) {
|
||||
lineValidateMsgList.add("药品名称必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getCategoryCode())) {
|
||||
lineValidateMsgList.add("药品分类必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getYbMatchFlag())
|
||||
&& !MedCategoryCode.TRADITIONAL_CHINESE_MEDICINE.getValue().equals(importDto.getCategoryCode())
|
||||
&& !MedCategoryCode.WESTERN_MEDICINE.getValue().equals(importDto.getCategoryCode())
|
||||
&& !MedCategoryCode.CHINESE_HERBAL_MEDICINE.getValue().equals(importDto.getCategoryCode())) {
|
||||
lineValidateMsgList.add("医保药的药品分类只能选择中成药、西药或中草药;");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getMerchandiseName())) {
|
||||
lineValidateMsgList.add("商品名称必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getUnitCode())) {
|
||||
lineValidateMsgList.add("药品单位必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getMinUnitCode())) {
|
||||
lineValidateMsgList.add("最小单位必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getPartPercentStr())) {
|
||||
lineValidateMsgList.add("拆零比必填");
|
||||
}
|
||||
BigDecimal partPercent;
|
||||
try {
|
||||
partPercent = new BigDecimal(importDto.getPartPercentStr());
|
||||
importDto.setPartPercent(partPercent);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("拆零比应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getDoseFrom())) {
|
||||
lineValidateMsgList.add("剂量形式必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getYbMatchFlag())) {
|
||||
lineValidateMsgList.add("医保是否对码必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getYbMatchFlag()) && StringUtils.isEmpty(importDto.getYbNo())) {
|
||||
lineValidateMsgList.add("医保对码时,医保编码必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getSkinTestFlag())) {
|
||||
lineValidateMsgList.add("是否皮试必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getInjectFlag())) {
|
||||
lineValidateMsgList.add("是否为注射药物必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getRestrictedFlag())) {
|
||||
lineValidateMsgList.add("是否限制使用必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getRestrictedFlag())
|
||||
&& StringUtils.isEmpty(importDto.getRestrictedScope())) {
|
||||
lineValidateMsgList.add("限制使用时,限制使用范围必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getChildrenFlag())) {
|
||||
lineValidateMsgList.add("儿童用药标志必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getPartAttributeEnum())) {
|
||||
lineValidateMsgList.add("拆分属性必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getAntibioticFlag())) {
|
||||
lineValidateMsgList.add("是否抗生素必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getAntibioticFlag())
|
||||
&& StringUtils.isEmpty(importDto.getAntibioticCode())) {
|
||||
lineValidateMsgList.add("为抗生素时,抗生素分类必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getSelfFlag())) {
|
||||
lineValidateMsgList.add("是否自制必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getBasicFlag())) {
|
||||
lineValidateMsgList.add("基药标识必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getManufacturerText())) {
|
||||
lineValidateMsgList.add("生产厂商文本必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getThoPartAttributeEnum())) {
|
||||
lineValidateMsgList.add("住院临时医嘱拆分属性必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getUnitConversionRatioStr())) {
|
||||
lineValidateMsgList.add("剂量单位换算比必填");
|
||||
}
|
||||
BigDecimal unitConversionRatio;
|
||||
try {
|
||||
unitConversionRatio = new BigDecimal(importDto.getUnitConversionRatioStr());
|
||||
importDto.setUnitConversionRatio(unitConversionRatio);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("剂量单位换算比应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getChrgitmLv())) {
|
||||
lineValidateMsgList.add("医保等级必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getRxFlag())) {
|
||||
lineValidateMsgList.add("处方标志必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getItemMinQuantityStr())) {
|
||||
lineValidateMsgList.add("最小库存警戒数量(常规单位)必填");
|
||||
}
|
||||
BigDecimal itemMinQuantity;
|
||||
try {
|
||||
itemMinQuantity = new BigDecimal(importDto.getItemMinQuantityStr());
|
||||
importDto.setItemMinQuantity(itemMinQuantity);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("最小库存警戒数量(常规单位)应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getItemMaxQuantityStr())) {
|
||||
lineValidateMsgList.add("最大库存警戒数量(常规单位)必填");
|
||||
}
|
||||
BigDecimal itemMaxQuantity;
|
||||
try {
|
||||
itemMaxQuantity = new BigDecimal(importDto.getItemMaxQuantityStr());
|
||||
importDto.setItemMaxQuantity(itemMaxQuantity);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("最大库存警戒数量(常规单位)应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getLocationName())) {
|
||||
lineValidateMsgList.add("所在位置名称必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getTotalVolume())) {
|
||||
lineValidateMsgList.add("规格必填");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(importDto.getDoseStr())) {
|
||||
BigDecimal dose;
|
||||
try {
|
||||
dose = new BigDecimal(importDto.getDoseStr());
|
||||
importDto.setDose(dose);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("单次剂量应为数值类型");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(importDto.getMaxUnitStr())) {
|
||||
BigDecimal maxUnit;
|
||||
try {
|
||||
maxUnit = new BigDecimal(importDto.getMaxUnitStr());
|
||||
importDto.setMaxUnit(maxUnit);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("单次最大剂量应为数值类型");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getTypeCode())) {
|
||||
lineValidateMsgList.add("财务类别必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getYbType())) {
|
||||
lineValidateMsgList.add("医保费用类别必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getPurchasePriceStr())) {
|
||||
lineValidateMsgList.add("购入价必填");
|
||||
}
|
||||
BigDecimal purchasePrice;
|
||||
try {
|
||||
purchasePrice = new BigDecimal(importDto.getPurchasePriceStr());
|
||||
importDto.setPurchasePrice(purchasePrice);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("购入价应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getRetailPriceStr())) {
|
||||
lineValidateMsgList.add("零售价必填");
|
||||
}
|
||||
BigDecimal retailPrice;
|
||||
try {
|
||||
retailPrice = new BigDecimal(importDto.getRetailPriceStr());
|
||||
importDto.setRetailPrice(retailPrice);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("零售价应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getMaximumRetailPriceStr())) {
|
||||
lineValidateMsgList.add("最高零售价必填");
|
||||
}
|
||||
BigDecimal maximumRetailPrice;
|
||||
try {
|
||||
maximumRetailPrice = new BigDecimal(importDto.getMaximumRetailPriceStr());
|
||||
importDto.setMaximumRetailPrice(maximumRetailPrice);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("最高零售价应为数值类型");
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
return R.fail("导入失败!药品信息填写有误:" + String.join(" ", fieldValidateMsgList));
|
||||
}
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<MedicationImportDto>> importDtoGroupList = new ArrayList<>(importDtoList.stream()
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getTotalVolume())).values());
|
||||
for (List<MedicationImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList
|
||||
.add(
|
||||
"■ 第"
|
||||
+ importDtoGroup.stream().map(MedicationImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
return R.fail("导入失败!文件中存在重复药品:" + String.join(" ", lineRepeatedValidateMsgList));
|
||||
}
|
||||
// 重复校验(文件与数据库重复)
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (MedicationImportDto importDto : importDtoList) {
|
||||
List<MedicationDefinition> medicationDefinitionList = medicationDefinitionService.list(
|
||||
new LambdaQueryWrapper<MedicationDefinition>().eq(MedicationDefinition::getName, importDto.getName())
|
||||
.eq(MedicationDefinition::getManufacturerText, importDto.getManufacturerText()));
|
||||
if (!medicationDefinitionList.isEmpty()) {
|
||||
List<Medication> medicationList =
|
||||
medicationService.list(new LambdaQueryWrapper<Medication>()
|
||||
.in(Medication::getMedicationDefId,
|
||||
medicationDefinitionList.stream().map(MedicationDefinition::getId)
|
||||
.collect(Collectors.toList()))
|
||||
.eq(Medication::getTotalVolume, importDto.getTotalVolume()));
|
||||
if (!medicationList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!dbRepeatedValidateMsgList.isEmpty()) {
|
||||
return R.fail("导入失败!系统中存在重复药品:" + String.join(" ", dbRepeatedValidateMsgList));
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建药品定义实体
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @return 药品定义实体
|
||||
*/
|
||||
private MedicationDefinition createMedicationDefinitionEntity(MedicationImportDto importDto) {
|
||||
MedicationDefinition medicationDefinition = new MedicationDefinition();
|
||||
medicationDefinition.setName(importDto.getName())
|
||||
.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_NUM.getPrefix(), 10)).setDomainEnum(1)
|
||||
.setVersion(importDto.getVersion()).setNameEn(importDto.getNameEn())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setMerchandiseName(importDto.getMerchandiseName())
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setUnitCode(importDto.getUnitCode()).setMinUnitCode(importDto.getMinUnitCode())
|
||||
.setPartPercent(importDto.getPartPercent()).setDoseFrom(tryParseInt(importDto.getDoseFrom()))
|
||||
.setApprovalNumber(importDto.getApprovalNumber()).setYbMatchFlag(tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setYbNo(importDto.getYbNo()).setPharmacologyCategoryCode("1")
|
||||
.setSkinTestFlag(tryParseInt(importDto.getSkinTestFlag()))
|
||||
.setInjectFlag(tryParseInt(importDto.getInjectFlag())).setManufacturerText(importDto.getManufacturerText())
|
||||
.setRestrictedFlag(tryParseInt(importDto.getRestrictedFlag()))
|
||||
.setRestrictedScope(importDto.getRestrictedScope()).setActiveFlag(Whether.YES.getValue())
|
||||
.setChildrenFlag(tryParseInt(importDto.getChildrenFlag()))
|
||||
.setNationalDrugCode(importDto.getNationalDrugCode())
|
||||
.setPartAttributeEnum(tryParseInt(importDto.getPartAttributeEnum()))
|
||||
.setAntibioticCode(importDto.getAntibioticCode()).setSelfFlag(tryParseInt(importDto.getSelfFlag()))
|
||||
.setAntibioticFlag(tryParseInt(importDto.getAntibioticFlag()))
|
||||
.setBasicFlag(tryParseInt(importDto.getBasicFlag()))
|
||||
.setThoPartAttributeEnum(tryParseInt(importDto.getThoPartAttributeEnum()))
|
||||
.setUnitConversionRatio(importDto.getUnitConversionRatio())
|
||||
.setChrgitmLv(tryParseInt(importDto.getChrgitmLv())).setRxFlag(tryParseInt(importDto.getRxFlag()))
|
||||
.setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity());
|
||||
return medicationDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建药品基本实体
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @param medicationDefId 药品定义ID
|
||||
* @param defaultLocationId 默认位置ID
|
||||
* @param locationNameMap 位置名称匹配分组Map
|
||||
* @return 药品基本实体
|
||||
*/
|
||||
private Medication createMedicationEntity(MedicationImportDto importDto, Long medicationDefId,
|
||||
Long defaultLocationId, Map<String, List<Location>> locationNameMap) {
|
||||
Medication medication = new Medication();
|
||||
// 根据输入的所在位置名称获取位置ID
|
||||
List<Location> mapLocationList = locationNameMap.get(importDto.getLocationName());
|
||||
if (mapLocationList == null || mapLocationList.isEmpty()) {
|
||||
medication.setLocationId(defaultLocationId);
|
||||
} else {
|
||||
medication.setLocationId(mapLocationList.get(0).getId());
|
||||
}
|
||||
medication.setMedicationDefId(medicationDefId).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setDoseFormCode(importDto.getDoseFrom()).setTotalVolume(importDto.getTotalVolume())
|
||||
.setActiveFlag(Whether.YES.getValue()).setMethodCode(importDto.getMethodCode())
|
||||
.setRateCode(importDto.getRateCode()).setDose(importDto.getDose())
|
||||
.setDoseUnitCode(importDto.getDoseUnitCode()).setMaxUnit(importDto.getMaxUnit());
|
||||
return medication;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建费用定价实体
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @return 药品基本实体
|
||||
*/
|
||||
private ChargeItemDefinition createChargeItemDefinition(MedicationImportDto importDto, Long orgId,
|
||||
Long medicationDefId, Date effectiveStart) {
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setChargeName(importDto.getName()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setOrgId(orgId).setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setInstanceId(medicationDefId).setEffectiveStart(effectiveStart).setTypeCode(importDto.getTypeCode())
|
||||
.setYbType(importDto.getYbType()).setConditionFlag(Whether.YES.getValue())
|
||||
.setPrice(importDto.getRetailPrice());
|
||||
return chargeItemDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建费用定价子实体列表
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @param chargeItemDefId 费用定价ID
|
||||
* @return 费用定价子实体列表
|
||||
*/
|
||||
private List<ChargeItemDefDetail> createChargeItemDefDetailList(MedicationImportDto importDto,
|
||||
Long chargeItemDefId) {
|
||||
ChargeItemDefDetail defDetailPurchase = new ChargeItemDefDetail().setDefinitionId(chargeItemDefId)
|
||||
.setConditionCode(ConditionCode.PURCHASE.getCode()).setAmount(importDto.getPurchasePrice());
|
||||
ChargeItemDefDetail defDetailRetail =
|
||||
new ChargeItemDefDetail().setDefinitionId(chargeItemDefId).setConditionCode(ConditionCode.UNIT.getCode())
|
||||
.setConditionValue(importDto.getUnitCode()).setAmount(importDto.getRetailPrice());
|
||||
ChargeItemDefDetail defDetailMaximumRetail = new ChargeItemDefDetail().setDefinitionId(chargeItemDefId)
|
||||
.setConditionCode(ConditionCode.LIMIT.getCode()).setAmount(importDto.getMaximumRetailPrice());
|
||||
return Arrays.asList(defDetailPurchase, defDetailRetail, defDetailMaximumRetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 尝试转化为int
|
||||
*
|
||||
* @param intStr int字符串
|
||||
* @return int值
|
||||
*/
|
||||
private Integer tryParseInt(String intStr) {
|
||||
try {
|
||||
return Integer.parseInt(intStr);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,12 @@ package com.openhis.web.datadictionary.controller;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.datadictionary.appservice.IDeviceManageAppService;
|
||||
@@ -138,4 +140,25 @@ public class DeviceManageController {
|
||||
public R<?> exportDevice(@RequestBody DeviceManageDto DeviceManageDto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入器材目录
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/import-data")
|
||||
public R<?> importData(MultipartFile file) {
|
||||
return deviceManageAppService.importData(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导入模板
|
||||
*
|
||||
* @param response 响应
|
||||
*/
|
||||
@PostMapping("/import-template")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
deviceManageAppService.importTemplate(response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 诊疗子项JSON
|
||||
*/
|
||||
@@ -20,6 +22,6 @@ public class ActivityChildJsonDto {
|
||||
/**
|
||||
* 子项请求数量
|
||||
*/
|
||||
private Integer childrenRequestNum;
|
||||
private BigDecimal childrenRequestNum;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.openhis.web.datadictionary.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.core.common.annotation.Excel;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 器材目录导入Dto
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-09-24
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DeviceImportDto {
|
||||
|
||||
/** 行号 */
|
||||
private Integer lineNumber;
|
||||
|
||||
// ---------------------- 器材定义 adm_device_definition -------------------------------------
|
||||
|
||||
/** 器材名称 */
|
||||
@Excel(name = "器材名称", prompt = "必填")
|
||||
private String name;
|
||||
|
||||
/** 器材分类 */
|
||||
@Excel(name = "器材分类", prompt = "必填", dictType = "device_category_code", comboReadDict = true)
|
||||
private String categoryCode;
|
||||
|
||||
/** 包装单位 */
|
||||
@Excel(name = "包装单位", prompt = "必填", dictType = "unit_code", comboReadDict = true)
|
||||
private String unitCode;
|
||||
|
||||
/** 包装规格 */
|
||||
@Excel(name = "包装规格", prompt = "必填")
|
||||
private String size;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
@Excel(name = "最小库存警戒数量(常规单位)", width = 25, prompt = "必填,数值类型")
|
||||
private String itemMinQuantityStr;
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
@Excel(name = "最大库存警戒数量(常规单位)", width = 25, prompt = "必填,数值类型")
|
||||
private String itemMaxQuantityStr;
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
/** 拆零比 */
|
||||
@Excel(name = "拆零比", prompt = "必填,数值类型")
|
||||
private String partPercentStr;
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 最小使用单位 */
|
||||
@Excel(name = "最小使用单位", prompt = "必填", dictType = "unit_code", comboReadDict = true)
|
||||
private String minUnitCode;
|
||||
|
||||
/** 所属科室名称(orgId) */
|
||||
@Excel(name = "所属科室名称", prompt = "必填")
|
||||
private String orgName;
|
||||
|
||||
/** 所在位置名称(locationId) */
|
||||
@Excel(name = "所在位置名称", prompt = "必填")
|
||||
private String locationName;
|
||||
|
||||
/** 高值器材标志 */
|
||||
@Excel(name = "高值器材标志", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String hvcmFlag;
|
||||
|
||||
/** 销售单位 */
|
||||
@Excel(name = "最小使用单位", prompt = "必填", dictType = "unit_code", comboReadDict = true)
|
||||
private String salesUnitCode;
|
||||
|
||||
/** 批准文号 */
|
||||
@Excel(name = "批准文号")
|
||||
private String approvalNumber;
|
||||
|
||||
/** 医保标记 */
|
||||
private String ybFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
@Excel(name = "医保编码", prompt = "医保对码时必填")
|
||||
private String ybNo;
|
||||
|
||||
/** 医药机构目录编码 */
|
||||
private String ybOrgNo;
|
||||
|
||||
/** 医保对码标记 */
|
||||
private Integer ybMatchFlag;
|
||||
|
||||
/** 医保等级 */
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 生产厂家 */
|
||||
private Long manufacturerId;
|
||||
|
||||
/** 生产厂家 */
|
||||
private String manufacturerText;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplyId;
|
||||
|
||||
/** 说明 */
|
||||
private String description;
|
||||
|
||||
/** 适用范围 */
|
||||
private String jurisdiction;
|
||||
|
||||
/** 器材版本 */
|
||||
private String version;
|
||||
|
||||
/** 主要成分 */
|
||||
private String substanceText;
|
||||
|
||||
/** 过敏标记 */
|
||||
private Integer allergenFlag;
|
||||
|
||||
/** 处方标志 */
|
||||
private Integer rxFlag;
|
||||
|
||||
}
|
||||
@@ -17,10 +17,13 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class MedicationImportDto {
|
||||
|
||||
/** 行号 */
|
||||
private Integer lineNumber;
|
||||
|
||||
// ---------------------- 药品定义 med_medication_definition -------------------------------------
|
||||
|
||||
/** 药品名称 */
|
||||
@Excel(name = "药品名称")
|
||||
@Excel(name = "药品名称", prompt = "必填")
|
||||
private String name;
|
||||
|
||||
/** 药品版本 */
|
||||
@@ -32,27 +35,28 @@ public class MedicationImportDto {
|
||||
private String nameEn;
|
||||
|
||||
/** 药品分类 */
|
||||
@Excel(name = "药品分类", dictType = "med_category_code", comboReadDict = true)
|
||||
@Excel(name = "药品分类", prompt = "必填", dictType = "med_category_code", comboReadDict = true)
|
||||
private String categoryCode;
|
||||
|
||||
/** 商品名称 */
|
||||
@Excel(name = "商品名称")
|
||||
@Excel(name = "商品名称", prompt = "必填")
|
||||
private String merchandiseName;
|
||||
|
||||
/** 药品单位 */
|
||||
@Excel(name = "药品单位", dictType = "unit_code", comboReadDict = true)
|
||||
@Excel(name = "药品单位", prompt = "必填", dictType = "unit_code", comboReadDict = true)
|
||||
private String unitCode;
|
||||
|
||||
/** 最小单位 */
|
||||
@Excel(name = "最小单位", dictType = "unit_code", comboReadDict = true)
|
||||
@Excel(name = "最小单位", prompt = "必填", dictType = "unit_code", comboReadDict = true)
|
||||
private String minUnitCode;
|
||||
|
||||
/** 拆零比 */
|
||||
@Excel(name = "拆零比")
|
||||
@Excel(name = "拆零比", prompt = "必填,数值类型")
|
||||
private String partPercentStr;
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 剂量形式 */
|
||||
@Excel(name = "剂量形式", dictType = "dose_from_code", comboReadDict = true)
|
||||
@Excel(name = "剂量形式", prompt = "必填", dictType = "dose_form_code", comboReadDict = true)
|
||||
private String doseFrom;
|
||||
|
||||
/** 批准文号 */
|
||||
@@ -60,35 +64,31 @@ public class MedicationImportDto {
|
||||
private String approvalNumber;
|
||||
|
||||
/** 医保是否对码 */
|
||||
@Excel(name = "医保是否对码", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
@Excel(name = "医保是否对码", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String ybMatchFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
@Excel(name = "医保编码")
|
||||
@Excel(name = "医保编码", prompt = "医保对码时必填")
|
||||
private String ybNo;
|
||||
|
||||
/** 是否皮试 */
|
||||
@Excel(name = "是否皮试", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
@Excel(name = "是否皮试", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String skinTestFlag;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
@Excel(name = "是否为注射药物", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
@Excel(name = "是否为注射药物", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String injectFlag;
|
||||
|
||||
/** 生产厂商文本 */
|
||||
@Excel(name = "生产厂商文本")
|
||||
private String manufacturerText;
|
||||
|
||||
/** 是否限制使用 */
|
||||
@Excel(name = "是否限制使用", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
@Excel(name = "是否限制使用", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String restrictedFlag;
|
||||
|
||||
/** 限制使用范围 */
|
||||
@Excel(name = "限制使用范围")
|
||||
@Excel(name = "限制使用范围", prompt = "限制使用时必填")
|
||||
private String restrictedScope;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
@Excel(name = "儿童用药标志", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
@Excel(name = "儿童用药标志", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String childrenFlag;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
@@ -96,56 +96,68 @@ public class MedicationImportDto {
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 拆分属性 */
|
||||
@Excel(name = "拆分属性", readConverterExp = "1=门诊按最小单位每次量向上取整,2=门诊按包装单位不可拆分,3=门诊按最小单位总量向上取整,4=门诊按包装单位每次量向上取整",
|
||||
@Excel(name = "拆分属性", prompt = "必填",
|
||||
readConverterExp = "1=门诊按最小单位每次量向上取整,2=门诊按包装单位不可拆分,3=门诊按最小单位总量向上取整,4=门诊按包装单位每次量向上取整",
|
||||
combo = "门诊按最小单位每次量向上取整,门诊按包装单位不可拆分,门诊按最小单位总量向上取整,门诊按包装单位每次量向上取整")
|
||||
private String partAttributeEnum;
|
||||
|
||||
/** 是否抗生素 */
|
||||
@Excel(name = "是否抗生素", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
@Excel(name = "是否抗生素", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String antibioticFlag;
|
||||
|
||||
/** 抗生素分类 */
|
||||
@Excel(name = "抗生素分类", dictType = "antibiotic_type_code", comboReadDict = true)
|
||||
@Excel(name = "抗生素分类", prompt = "抗生素时必填", dictType = "antibiotic_type_code", comboReadDict = true)
|
||||
private String antibioticCode;
|
||||
|
||||
/** 权限限制 */
|
||||
@Excel(name = "权限限制", readConverterExp = "1=非限制使用,2=限制使用,3=特殊使用", combo = "非限制使用,限制使用,特殊使用")
|
||||
private String restrictedEnum;
|
||||
|
||||
/** 是否自制 */
|
||||
@Excel(name = "是否自制", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
@Excel(name = "是否自制", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String selfFlag;
|
||||
|
||||
/** 基药标识 */
|
||||
@Excel(name = "基药标识", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
@Excel(name = "基药标识", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String basicFlag;
|
||||
|
||||
/** 生产厂商文本 */
|
||||
@Excel(name = "生产厂商文本", prompt = "必填")
|
||||
private String manufacturerText;
|
||||
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
@Excel(name = "住院临时医嘱拆分属性",
|
||||
@Excel(name = "住院临时医嘱拆分属性", prompt = "必填", width = 20,
|
||||
readConverterExp = "1=临时医嘱按最小单位每次量向上取整,2=临时医嘱按包装单位开立,3=临时医嘱按最小单位总量向上取整,4=临时医嘱按包装单位每次量向上取整",
|
||||
combo = "临时医嘱按最小单位每次量向上取整,临时医嘱按包装单位开立,临时医嘱按最小单位总量向上取整,临时医嘱按包装单位每次量向上取整")
|
||||
private String thoPartAttributeEnum;
|
||||
|
||||
/** 剂量单位换算比 */
|
||||
@Excel(name = "剂量单位换算比")
|
||||
@Excel(name = "剂量单位换算比", prompt = "必填,数值类型")
|
||||
private String unitConversionRatioStr;
|
||||
private BigDecimal unitConversionRatio;
|
||||
|
||||
/** 医保等级 */
|
||||
@Excel(name = "医保等级", dictType = "chrgitm_lv", comboReadDict = true)
|
||||
@Excel(name = "医保等级", prompt = "必填", dictType = "chrgitm_lv", comboReadDict = true)
|
||||
private String chrgitmLv;
|
||||
|
||||
/** 处方标志 */
|
||||
@Excel(name = "处方标志", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
@Excel(name = "处方标志", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String rxFlag;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
@Excel(name = "最小库存警戒数量(常规单位)", width = 25, prompt = "必填,数值类型")
|
||||
private String itemMinQuantityStr;
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
@Excel(name = "最大库存警戒数量(常规单位)", width = 25, prompt = "必填,数值类型")
|
||||
private String itemMaxQuantityStr;
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
// ---------------------- 药品基本信息 med_medication ----------------------------------------------
|
||||
|
||||
/** 所在位置名称(locationId) */
|
||||
@Excel(name = "所在位置名称")
|
||||
@Excel(name = "所在位置名称", prompt = "必填")
|
||||
private String locationName;
|
||||
|
||||
/** 规格 */
|
||||
@Excel(name = "规格")
|
||||
@Excel(name = "规格", prompt = "必填")
|
||||
private String totalVolume;
|
||||
|
||||
/** 用法 */
|
||||
@@ -157,7 +169,8 @@ public class MedicationImportDto {
|
||||
private String rateCode;
|
||||
|
||||
/** 单次剂量 */
|
||||
@Excel(name = "单次剂量")
|
||||
@Excel(name = "单次剂量", prompt = "数值类型")
|
||||
private String doseStr;
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
@@ -165,31 +178,35 @@ public class MedicationImportDto {
|
||||
private String doseUnitCode;
|
||||
|
||||
/** 单次最大剂量 */
|
||||
@Excel(name = "单次最大剂量")
|
||||
@Excel(name = "单次最大剂量", prompt = "数值类型")
|
||||
private String maxUnitStr;
|
||||
private BigDecimal maxUnit;
|
||||
|
||||
// ---------------------- 费用定价 adm_charge_item_definition ----------------------------------------------
|
||||
|
||||
/** 财务类别 */
|
||||
@Excel(name = "财务类别", dictType = "fin_type_code", comboReadDict = true)
|
||||
@Excel(name = "财务类别", prompt = "必填", dictType = "fin_type_code", comboReadDict = true)
|
||||
private String typeCode;
|
||||
|
||||
/** 医保费用类别 */
|
||||
@Excel(name = "医保费用类别", dictType = "med_chrgitm_type", comboReadDict = true)
|
||||
@Excel(name = "医保费用类别", prompt = "必填", dictType = "med_chrgitm_type", comboReadDict = true)
|
||||
private String ybType;
|
||||
|
||||
// ---------------------- 费用定价子表 adm_charge_item_def_detail ----------------------------------------------
|
||||
|
||||
/** 购入价 */
|
||||
@Excel(name = "购入价")
|
||||
@Excel(name = "购入价", prompt = "必填,数值类型")
|
||||
private String purchasePriceStr;
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 零售价 */
|
||||
@Excel(name = "零售价")
|
||||
@Excel(name = "零售价", prompt = "必填,数值类型")
|
||||
private String retailPriceStr;
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 最高零售价 */
|
||||
@Excel(name = "最高零售价")
|
||||
@Excel(name = "最高零售价", prompt = "必填,数值类型")
|
||||
private String maximumRetailPriceStr;
|
||||
private BigDecimal maximumRetailPrice;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user