提交merge1.3
This commit is contained in:
@@ -13,10 +13,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import com.core.common.enums.DelFlag;
|
||||
>>>>>>> v1.3
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -114,8 +111,8 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
|
||||
// 获取状态
|
||||
List<DeviceManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
|
||||
// // 获取执行科室
|
||||
@@ -131,28 +128,27 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// .map(category -> new DeviceManageInitDto.deviceCategory(category.getValue(), category.getInfo()))
|
||||
// .collect(Collectors.toList());
|
||||
// deviceManageInitDto.setDeviceCategories(deviceCategories);
|
||||
|
||||
// 获取器材
|
||||
List<SysDictData> deviceList =
|
||||
sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DEVICE_CATEGORY_CODE);
|
||||
List<SysDictData> deviceList
|
||||
= sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DEVICE_CATEGORY_CODE);
|
||||
// 从字典中获取器材分类
|
||||
List<DeviceManageInitDto.dictCategoryCode> deviceCategories = deviceList.stream()
|
||||
.map(category -> new DeviceManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
.map(category -> new DeviceManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setDeviceCategories(deviceCategories);
|
||||
|
||||
// 获取医保是否对码
|
||||
List<DeviceManageInitDto.statusEnumOption> statusYBWeatherOption = Stream.of(Whether.values())
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setStatusYBWeatherOptions(statusYBWeatherOption);
|
||||
|
||||
// 查询供应商列表
|
||||
List<Supplier> supplierList = supplierService.getList();
|
||||
// 供应商信息
|
||||
List<DeviceManageInitDto.supplierListOption> supplierListOptions = supplierList.stream()
|
||||
.map(supplier -> new DeviceManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
.map(supplier -> new DeviceManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setSupplierListOptions(supplierListOptions);
|
||||
|
||||
return R.ok(deviceManageInitDto);
|
||||
@@ -169,15 +165,15 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDevicePage(DeviceManageSelParam deviceManageSelParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DeviceManageDto> queryWrapper = HisQueryUtils.buildQueryWrapper(deviceManageSelParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
|
||||
// 分页查询
|
||||
IPage<DeviceManageDto> deviceManagePage =
|
||||
deviceManageMapper.getDevicePage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
IPage<DeviceManageDto> deviceManagePage
|
||||
= deviceManageMapper.getDevicePage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
deviceManagePage.getRecords().forEach(e -> {
|
||||
// 高值器材标志枚举类回显赋值
|
||||
@@ -219,8 +215,8 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(deviceDefinition.getYbNo())) {
|
||||
R<?> r =
|
||||
ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
R<?> r
|
||||
= ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
@@ -228,29 +224,29 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setYbType(deviceManageDto.getYbType()).setTypeCode(deviceManageDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageDto.getRetailPrice())
|
||||
.setChargeName(deviceManageDto.getName());;
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageDto.getRetailPrice())
|
||||
.setChargeName(deviceManageDto.getName());;
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
// 更新价格表
|
||||
boolean upItemDef = itemDefinitionServic.updateItem(chargeItemDefinition);
|
||||
|
||||
// 更新子表,修改购入价,条件:采购
|
||||
boolean upItemDetail1 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
deviceManageDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
deviceManageDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
// 更新子表,修改零售价,条件:单位
|
||||
boolean upItemDetail2 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
deviceManageDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
deviceManageDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制
|
||||
boolean upItemDetail3 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
deviceManageDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
deviceManageDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
|
||||
// 更新价格表
|
||||
return upItemDef && upItemDetail1 && upItemDetail2 && upItemDetail3
|
||||
? 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));
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
@@ -288,12 +284,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
|
||||
// 更新器材信息
|
||||
return deviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
||||
? 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));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,12 +310,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.START.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
|
||||
// 更新器材信息
|
||||
return deviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
||||
? 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));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,27 +340,27 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(deviceDefinition.getYbNo())) {
|
||||
R<?> r =
|
||||
ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
R<?> r
|
||||
= ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.INSERT.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
|
||||
ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto();
|
||||
BeanUtils.copyProperties(deviceManageUpDto, itemUpFromDirectoryDto);
|
||||
itemUpFromDirectoryDto.setTypeCode(deviceManageUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(deviceManageUpDto.getName())
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageUpDto.getRetailPrice());
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(deviceManageUpDto.getName())
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageUpDto.getRetailPrice());
|
||||
|
||||
return itemDefinitionServic.addItem(itemUpFromDirectoryDto)
|
||||
? 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));
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
@@ -391,21 +387,21 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 查询机构ID、位置信息供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
List<Location> locationList = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getDeleteFlag, DelFlag.NO.getCode()).orderByAsc(Location::getId));
|
||||
.eq(Location::getDeleteFlag, DelFlag.NO.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));
|
||||
Map<String, List<Location>> locationNameMap
|
||||
= locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
// 创建表数据
|
||||
for (DeviceImportDto importDto : importDtoList) {
|
||||
// 创建器材定义
|
||||
DeviceDefinition deviceDefinition =
|
||||
createDeviceDefinitionEntity(importDto, orgId, defaultLocationId, locationNameMap);
|
||||
DeviceDefinition deviceDefinition
|
||||
= createDeviceDefinitionEntity(importDto, orgId, defaultLocationId, locationNameMap);
|
||||
deviceDefinitionService.save(deviceDefinition);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -432,7 +428,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
List<DeviceRequest> deviceRequestList = deviceRequestService.getDevRequestByDeviceId(deviceId);
|
||||
if (!deviceRequestList.isEmpty()) {
|
||||
if (deviceRequestList.stream()
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
return R.ok(1, "医生开过该耗材,不可编辑");
|
||||
} else {
|
||||
// 校验是否可以编辑
|
||||
@@ -558,7 +554,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
@@ -567,12 +563,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<DeviceImportDto>> importDtoGroupList = new ArrayList<>(importDtoList.stream()
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getSize())).values());
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getSize())).values());
|
||||
for (List<DeviceImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList.add(
|
||||
"■ 第" + importDtoGroup.stream().map(DeviceImportDto::getLineNumber).sorted().map(Object::toString)
|
||||
.collect(Collectors.joining(",")) + "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
"■ 第" + importDtoGroup.stream().map(DeviceImportDto::getLineNumber).sorted().map(Object::toString)
|
||||
.collect(Collectors.joining(",")) + "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -582,12 +578,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (DeviceImportDto importDto : importDtoList) {
|
||||
List<DeviceDefinition> deviceDefinitionList = deviceDefinitionService
|
||||
.list(new LambdaQueryWrapper<DeviceDefinition>().eq(DeviceDefinition::getName, importDto.getName())
|
||||
.eq(DeviceDefinition::getManufacturerText, importDto.getManufacturerText())
|
||||
.eq(DeviceDefinition::getSize, importDto.getSize()));
|
||||
.list(new LambdaQueryWrapper<DeviceDefinition>().eq(DeviceDefinition::getName, importDto.getName())
|
||||
.eq(DeviceDefinition::getManufacturerText, importDto.getManufacturerText())
|
||||
.eq(DeviceDefinition::getSize, importDto.getSize()));
|
||||
if (!deviceDefinitionList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
if (!dbRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -606,7 +602,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
* @return 器材定义实体
|
||||
*/
|
||||
private DeviceDefinition createDeviceDefinitionEntity(DeviceImportDto importDto, Long orgId, Long defaultLocationId,
|
||||
Map<String, List<Location>> locationNameMap) {
|
||||
Map<String, List<Location>> locationNameMap) {
|
||||
DeviceDefinition deviceDefinition = new DeviceDefinition();
|
||||
// 根据输入的所在位置名称获取位置ID
|
||||
List<Location> mapLocationList = locationNameMap.get(importDto.getLocationName());
|
||||
@@ -616,20 +612,20 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
deviceDefinition.setLocationId(mapLocationList.get(0).getId());
|
||||
}
|
||||
deviceDefinition.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_NUM.getPrefix(), 10))
|
||||
.setName(importDto.getName()).setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setTypeCode(importDto.getTypeCode())
|
||||
.setUnitCode(importDto.getUnitCode()).setSize(importDto.getSize())
|
||||
.setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity())
|
||||
.setPartPercent(importDto.getPartPercent()).setMinUnitCode(importDto.getMinUnitCode()).setOrgId(orgId)
|
||||
.setHvcmFlag(CommonUtil.tryParseInt(importDto.getHvcmFlag())).setSalesUnitCode(importDto.getSalesUnitCode())
|
||||
.setApprovalNumber(importDto.getApprovalNumber()).setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag()))
|
||||
.setYbNo(importDto.getYbNo()).setYbOrgNo(importDto.getYbOrgNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue()).setManufacturerText(importDto.getManufacturerText())
|
||||
.setAllergenFlag(CommonUtil.tryParseInt(importDto.getAllergenFlag()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag()));
|
||||
.setName(importDto.getName()).setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setTypeCode(importDto.getTypeCode())
|
||||
.setUnitCode(importDto.getUnitCode()).setSize(importDto.getSize())
|
||||
.setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity())
|
||||
.setPartPercent(importDto.getPartPercent()).setMinUnitCode(importDto.getMinUnitCode()).setOrgId(orgId)
|
||||
.setHvcmFlag(CommonUtil.tryParseInt(importDto.getHvcmFlag())).setSalesUnitCode(importDto.getSalesUnitCode())
|
||||
.setApprovalNumber(importDto.getApprovalNumber()).setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag()))
|
||||
.setYbNo(importDto.getYbNo()).setYbOrgNo(importDto.getYbOrgNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue()).setManufacturerText(importDto.getManufacturerText())
|
||||
.setAllergenFlag(CommonUtil.tryParseInt(importDto.getAllergenFlag()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag()));
|
||||
return deviceDefinition;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,26 +87,26 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
DiagnosisTreatmentInitDto diagnosisTreatmentInitDto = new DiagnosisTreatmentInitDto();
|
||||
// 获取状态
|
||||
List<DiagnosisTreatmentInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
// 获取执行科室
|
||||
LambdaQueryWrapper<Organization> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Organization::getTypeEnum, OrganizationType.DEPARTMENT);
|
||||
List<Organization> organizations = organizationService.list(queryWrapper);
|
||||
List<DiagnosisTreatmentInitDto.exeOrganization> exeOrganizations = organizations.stream()
|
||||
.map(exeOrg -> new DiagnosisTreatmentInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName()))
|
||||
.collect(Collectors.toList());
|
||||
.map(exeOrg -> new DiagnosisTreatmentInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setExeOrganizations(exeOrganizations);
|
||||
|
||||
// 获取诊目录疗分类
|
||||
List<SysDictData> diagnosisList =
|
||||
sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DIAGNOSIS_CATEGORY_CODE);
|
||||
List<SysDictData> diagnosisList
|
||||
= sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DIAGNOSIS_CATEGORY_CODE);
|
||||
// 获取诊疗录疗分类
|
||||
List<DiagnosisTreatmentInitDto.dictCategoryCode> diagnosisCategories = diagnosisList.stream()
|
||||
.map(category -> new DiagnosisTreatmentInitDto.dictCategoryCode(category.getDictValue(),
|
||||
.map(category -> new DiagnosisTreatmentInitDto.dictCategoryCode(category.getDictValue(),
|
||||
category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setDiagnosisCategoryOptions(diagnosisCategories);
|
||||
|
||||
// // 查询医疗服务项类型
|
||||
@@ -143,18 +143,17 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
// diseaseTreatmentCategories.add(diseaseTreatmentCategory2);
|
||||
//
|
||||
// diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories);
|
||||
|
||||
// 获取类型
|
||||
List<DiagnosisTreatmentInitDto.statusEnumOption> typeEnumOptions = Stream.of(ActivityType.values())
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setTypeEnumOptions(typeEnumOptions);
|
||||
|
||||
// 获取是/否 列表
|
||||
// 获取状态
|
||||
List<DiagnosisTreatmentInitDto.statusEnumOption> statusWeatherOption = Stream.of(Whether.values())
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setStatusWeatherOption(statusWeatherOption);
|
||||
|
||||
return R.ok(diagnosisTreatmentInitDto);
|
||||
@@ -171,15 +170,15 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DiagnosisTreatmentDto> queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam,
|
||||
searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
|
||||
// 分页查询
|
||||
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage =
|
||||
activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<DiagnosisTreatmentDto>(pageNo, pageSize), queryWrapper);
|
||||
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage
|
||||
= activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<DiagnosisTreatmentDto>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
diseaseTreatmentPage.getRecords().forEach(e -> {
|
||||
// 医保标记枚举类回显赋值
|
||||
@@ -237,7 +236,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
activityDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
@@ -245,27 +244,27 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setYbType(diagnosisTreatmentUpDto.getYbType())
|
||||
.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setInstanceId(diagnosisTreatmentUpDto.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode()).setChargeName(diagnosisTreatmentUpDto.getName());
|
||||
.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setInstanceId(diagnosisTreatmentUpDto.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode()).setChargeName(diagnosisTreatmentUpDto.getName());
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
|
||||
// 更新价格表
|
||||
boolean upItemDef = itemDefinitionService.updateItem(chargeItemDefinition);
|
||||
// 更新子表,修改零售价,条件:单位
|
||||
boolean upItemDetail1 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||
diagnosisTreatmentUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
diagnosisTreatmentUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制
|
||||
boolean upItemDetail2 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||
diagnosisTreatmentUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
diagnosisTreatmentUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
|
||||
// 更新价格表
|
||||
return upItemDef && upItemDetail1 && upItemDetail2
|
||||
? 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));
|
||||
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
@@ -291,11 +290,11 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
// 更新诊疗信息
|
||||
return activityDefinitionService.updateBatchById(ActivityDefinitionList)
|
||||
? 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));
|
||||
|
||||
}
|
||||
|
||||
@@ -319,11 +318,11 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.START.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
// 更新诊疗信息
|
||||
return activityDefinitionService.updateBatchById(ActivityDefinitionList)
|
||||
? 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));
|
||||
|
||||
}
|
||||
|
||||
@@ -359,28 +358,28 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
activityDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.INSERT.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
|
||||
ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, itemUpFromDirectoryDto);
|
||||
itemUpFromDirectoryDto.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setUnitCode(diagnosisTreatmentUpDto.getPermittedUnitCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(diagnosisTreatmentUpDto.getName())
|
||||
.setInstanceId(activityDefinition.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode());
|
||||
.setUnitCode(diagnosisTreatmentUpDto.getPermittedUnitCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(diagnosisTreatmentUpDto.getName())
|
||||
.setInstanceId(activityDefinition.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode());
|
||||
|
||||
return itemDefinitionService.addItem(itemUpFromDirectoryDto)
|
||||
? 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));
|
||||
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
@@ -396,8 +395,8 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
@Override
|
||||
public R<?> importData(MultipartFile file) {
|
||||
// 读取文件
|
||||
R<List<DiagnosisTreatmentImportDto>> readResult =
|
||||
CommonUtil.readImportedExcelFile(file, DiagnosisTreatmentImportDto.class);
|
||||
R<List<DiagnosisTreatmentImportDto>> readResult
|
||||
= CommonUtil.readImportedExcelFile(file, DiagnosisTreatmentImportDto.class);
|
||||
if (R.SUCCESS != readResult.getCode()) {
|
||||
return readResult;
|
||||
}
|
||||
@@ -416,9 +415,9 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
activityDefinitionService.save(activityDefinition);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getPermittedUnitCode(), null, importDto.getRetailPrice(),
|
||||
importDto.getMaximumRetailPrice(), orgId, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
importDto.getYbType(), importDto.getPermittedUnitCode(), null, importDto.getRetailPrice(),
|
||||
importDto.getMaximumRetailPrice(), orgId, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -446,12 +445,8 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
List<ServiceRequest> serviceRequestList = serviceRequestService.getServiceRequestByActivityId(activityId);
|
||||
if (!serviceRequestList.isEmpty()) {
|
||||
if (serviceRequestList.stream().anyMatch(
|
||||
serviceRequest -> RequestStatus.COMPLETED.getValue().equals(serviceRequest.getStatusEnum()))) {
|
||||
<<<<<<< HEAD
|
||||
return R.ok(1,"医生开过该诊疗项目,不可编辑");
|
||||
=======
|
||||
serviceRequest -> RequestStatus.COMPLETED.getValue().equals(serviceRequest.getStatusEnum()))) {
|
||||
return R.ok(1, "医生开过该诊疗项目,不可编辑");
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
@@ -518,7 +513,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
@@ -527,13 +522,13 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<DiagnosisTreatmentImportDto>> importDtoGroupList = new ArrayList<>(
|
||||
importDtoList.stream().collect(Collectors.groupingBy(DiagnosisTreatmentImportDto::getName)).values());
|
||||
importDtoList.stream().collect(Collectors.groupingBy(DiagnosisTreatmentImportDto::getName)).values());
|
||||
for (List<DiagnosisTreatmentImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList.add("■ 第"
|
||||
+ importDtoGroup.stream().map(DiagnosisTreatmentImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
+ importDtoGroup.stream().map(DiagnosisTreatmentImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -543,10 +538,10 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (DiagnosisTreatmentImportDto importDto : importDtoList) {
|
||||
List<ActivityDefinition> deviceDefinitionList = activityDefinitionService.list(
|
||||
new LambdaQueryWrapper<ActivityDefinition>().eq(ActivityDefinition::getName, importDto.getName()));
|
||||
new LambdaQueryWrapper<ActivityDefinition>().eq(ActivityDefinition::getName, importDto.getName()));
|
||||
if (!deviceDefinitionList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
if (!dbRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -565,14 +560,14 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
private ActivityDefinition createActivityDefinitionEntity(DiagnosisTreatmentImportDto importDto, Long orgId) {
|
||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||
activityDefinition.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10))
|
||||
.setName(importDto.getName()).setCategoryCode(importDto.getCategoryCode())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setPermittedUnitCode(importDto.getPermittedUnitCode()).setOrgId(orgId)
|
||||
.setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag())).setYbNo(importDto.getYbNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()));
|
||||
.setName(importDto.getName()).setCategoryCode(importDto.getCategoryCode())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setPermittedUnitCode(importDto.getPermittedUnitCode()).setOrgId(orgId)
|
||||
.setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag())).setYbNo(importDto.getYbNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()));
|
||||
return activityDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import com.core.common.enums.DelFlag;
|
||||
>>>>>>> v1.3
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -118,53 +115,53 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
MedicationManageInitDto medicationManageInitDto = new MedicationManageInitDto();
|
||||
// 获取状态,从枚举里面取下拉值
|
||||
List<MedicationManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.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());
|
||||
.map(domain -> new MedicationManageInitDto.domainEnumOption(domain.getValue(), domain.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
// 查询供应商列表
|
||||
List<Supplier> supplierList = supplierService.getList();
|
||||
// 供应商信息
|
||||
List<MedicationManageInitDto.supplierListOption> supplierListOptions = supplierList.stream()
|
||||
.map(supplier -> new MedicationManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
.map(supplier -> new MedicationManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 获取药品分类
|
||||
List<SysDictData> medicalList =
|
||||
sysDictTypeService.selectDictDataByType(CommonConstants.DictName.MED_CATEGORY_CODE);
|
||||
List<SysDictData> medicalList
|
||||
= sysDictTypeService.selectDictDataByType(CommonConstants.DictName.MED_CATEGORY_CODE);
|
||||
// 获取药品分类
|
||||
List<MedicationManageInitDto.dictCategoryCode> medicationCategories = medicalList.stream().map(
|
||||
category -> new MedicationManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
category -> new MedicationManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 获取是/否 列表
|
||||
// 获取状态
|
||||
List<MedicationManageInitDto.statusEnumOption> statusWeatherOption = Stream.of(Whether.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 权限限制
|
||||
List<MedicationManageInitDto.statusEnumOption> statusRestrictedOptions = Stream.of(PermissionLimit.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 拆分属性
|
||||
List<MedicationManageInitDto.statusEnumOption> partAttributeEnumOptions = Stream.of(SplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 住院临时医嘱拆分属性的枚举
|
||||
List<MedicationManageInitDto.statusEnumOption> tempOrderSplitPropertyOptions =
|
||||
Stream.of(TempOrderSplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 权限限制
|
||||
List<MedicationManageInitDto.statusEnumOption> statusRestrictedOptions = Stream.of(PermissionLimit.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 拆分属性
|
||||
List<MedicationManageInitDto.statusEnumOption> partAttributeEnumOptions = Stream.of(SplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 住院临时医嘱拆分属性的枚举
|
||||
List<MedicationManageInitDto.statusEnumOption> tempOrderSplitPropertyOptions
|
||||
= Stream.of(TempOrderSplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 医保等级List
|
||||
List<MedicationManageInitDto.statusEnumOption> chrgitmLvOptions = Stream.of(InsuranceLevel.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
medicationManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
medicationManageInitDto.setDomainFlagOptions(domainEnumOptions);
|
||||
@@ -190,18 +187,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMedicationList(MedicationSearchParam medicationSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<MedicationManageDto> queryWrapper = HisQueryUtils.buildQueryWrapper(medicationSearchParam,
|
||||
searchKey, new HashSet<>(Arrays.asList("name", "name_en", "merchandise_name", "bus_no", "py_str", "wb_str",
|
||||
"merchandise_py_str", "merchandise_wb_str")),
|
||||
null);
|
||||
searchKey, new HashSet<>(Arrays.asList("name", "name_en", "merchandise_name", "bus_no", "py_str", "wb_str",
|
||||
"merchandise_py_str", "merchandise_wb_str")),
|
||||
null);
|
||||
|
||||
IPage<MedicationManageDto> medicationManageDtoPage =
|
||||
medicationManageSearchMapper.getPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
IPage<MedicationManageDto> medicationManageDtoPage
|
||||
= medicationManageSearchMapper.getPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
// 枚举类回显赋值
|
||||
medicationManageDtoPage.getRecords().forEach(e -> {
|
||||
@@ -232,10 +229,10 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
e.setBasicFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getBasicFlag()));
|
||||
// 拆分分属性
|
||||
e.setPartAttributeEnum_enumText(
|
||||
EnumUtils.getInfoByValue(SplitPropertyCode.class, e.getPartAttributeEnum()));
|
||||
EnumUtils.getInfoByValue(SplitPropertyCode.class, e.getPartAttributeEnum()));
|
||||
// 住院临时医嘱拆分属性
|
||||
e.setThoPartAttributeEnum_enumText(
|
||||
EnumUtils.getInfoByValue(TempOrderSplitPropertyCode.class, e.getThoPartAttributeEnum()));
|
||||
EnumUtils.getInfoByValue(TempOrderSplitPropertyCode.class, e.getThoPartAttributeEnum()));
|
||||
// // 活动标记
|
||||
// e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
||||
|
||||
@@ -263,18 +260,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 拼音码
|
||||
medicationDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDefinition.getName()));
|
||||
medicationDefinition
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
// 五笔码
|
||||
medicationDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDefinition.getName()));
|
||||
medicationDefinition
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setYbType(medicationManageUpDto.getYbType())
|
||||
.setTypeCode(medicationManageUpDto.getTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setInstanceId(medicationManageUpDto.getMedicationDefId()).setPrice(medicationManageUpDto.getRetailPrice())
|
||||
.setChargeName(medicationManageUpDto.getName());
|
||||
.setTypeCode(medicationManageUpDto.getTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setInstanceId(medicationManageUpDto.getMedicationDefId()).setPrice(medicationManageUpDto.getRetailPrice())
|
||||
.setChargeName(medicationManageUpDto.getName());
|
||||
|
||||
// 更新子表药品信息
|
||||
if (medicationService.updateById(medication)) {
|
||||
@@ -282,11 +279,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
boolean updateMedicationDefinition = medicationDefinitionService.updateById(medicationDefinition);
|
||||
if (updateMedicationDefinition) {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch =
|
||||
SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
String ybSwitch
|
||||
= SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(medicationDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
medicationDefinition.getId());
|
||||
medicationDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
@@ -295,24 +292,24 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medication);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medication);
|
||||
// Todo:封装一个价格初始话的方法给app层调用
|
||||
// 更新价格表
|
||||
boolean updateChargeItemDefinition = itemDefinitionServic.updateItem(chargeItemDefinition);
|
||||
// 更新子表,修改购入价,条件:采购
|
||||
boolean upItemDetail1 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
medicationManageUpDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
medicationManageUpDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
// 更新子表,修改零售价,条件:单位
|
||||
boolean upItemDetail2 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
medicationManageUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
medicationManageUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制
|
||||
boolean upItemDetail3 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
medicationManageUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
medicationManageUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
|
||||
return (updateMedicationDefinition && updateChargeItemDefinition && upItemDetail1 && upItemDetail2
|
||||
&& upItemDetail3)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
&& upItemDetail3)
|
||||
? 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));
|
||||
}
|
||||
@@ -356,11 +353,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// TODO:别用三元,日志在业务代码以后记录
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
// 更新药品信息
|
||||
return medicationService.updateBatchById(medicationList)
|
||||
? 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));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -382,11 +379,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.START.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
// 更新药品信息
|
||||
return medicationService.updateBatchById(medicationList)
|
||||
? 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));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -406,11 +403,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 拼音码
|
||||
medicationDetail.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDetail.getName()));
|
||||
medicationDetail
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
// 五笔码
|
||||
medicationDetail.setWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDetail.getName()));
|
||||
medicationDetail
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
|
||||
// 新增主表外来药品目录
|
||||
if (medicationDefinitionService.addMedication(medicationDetail)) {
|
||||
@@ -418,31 +415,31 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(medicationDetail.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
medicationDetail.getId());
|
||||
medicationDetail.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.INSERT.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDetail);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDetail);
|
||||
// 新增子表外来药品目录
|
||||
boolean insertMedicationSuccess = medicationService.addMedication(medicationDetail);
|
||||
ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto();
|
||||
BeanUtils.copyProperties(medicationManageUpDto, itemUpFromDirectoryDto);
|
||||
itemUpFromDirectoryDto.setInstanceId(medicationDetail.getMedicationDefId())
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setOrgId(SecurityUtils.getLoginUser().getOrgId())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(medicationDetail.getName())
|
||||
.setPrice(medicationManageUpDto.getRetailPrice());
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setOrgId(SecurityUtils.getLoginUser().getOrgId())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(medicationDetail.getName())
|
||||
.setPrice(medicationManageUpDto.getRetailPrice());
|
||||
|
||||
// 添加药品成功后,添加相应的条件价格表信息
|
||||
boolean insertItemDefinitionSuccess = itemDefinitionServic.addItem(itemUpFromDirectoryDto);
|
||||
|
||||
return (insertMedicationSuccess && insertItemDefinitionSuccess)
|
||||
? 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));
|
||||
} else {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
@@ -450,11 +447,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
@Override
|
||||
public R<?> exportMedication(String searchKey, Integer ybMatchFlag, Integer statusEnum, String categoryCode,
|
||||
HttpServletResponse response) {
|
||||
HttpServletResponse response) {
|
||||
// 获取租户ID
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
List<MedicationManageDto> list =
|
||||
medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
List<MedicationManageDto> list
|
||||
= medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
ExcelUtil<MedicationManageDto> util = new ExcelUtil<>(MedicationManageDto.class);
|
||||
util.exportExcel(response, list, "药品目录");
|
||||
return null;
|
||||
@@ -482,24 +479,24 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 查询机构ID、位置信息供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
List<Location> locationList = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getDeleteFlag, DelFlag.NO.getCode()).orderByAsc(Location::getId));
|
||||
.eq(Location::getDeleteFlag, DelFlag.NO.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));
|
||||
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);
|
||||
Medication medication
|
||||
= createMedicationEntity(importDto, medicationDefinition.getId(), defaultLocationId, locationNameMap);
|
||||
medicationService.save(medication);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDefinition.getId());
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -523,11 +520,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> validateMedicationEdit(Long medicationId) {
|
||||
List<MedicationRequest> medicationRequestList =
|
||||
medicationRequestService.getMedRequestByMedicationId(medicationId);
|
||||
List<MedicationRequest> medicationRequestList
|
||||
= medicationRequestService.getMedRequestByMedicationId(medicationId);
|
||||
if (!medicationRequestList.isEmpty()) {
|
||||
if (medicationRequestList.stream()
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
return R.ok(1, "医生开过该药品,不可编辑");
|
||||
} else {
|
||||
// 校验是否可以编辑
|
||||
@@ -542,7 +539,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
/**
|
||||
* 导入信息校验
|
||||
*
|
||||
*
|
||||
* @param importDtoList 药品目录导入数据列表
|
||||
*/
|
||||
private R<?> validateImportDtoList(List<MedicationImportDto> importDtoList) {
|
||||
@@ -559,9 +556,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
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())) {
|
||||
&& !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())) {
|
||||
@@ -605,7 +602,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
lineValidateMsgList.add("是否限制使用必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getRestrictedFlag())
|
||||
&& StringUtils.isEmpty(importDto.getRestrictedScope())) {
|
||||
&& StringUtils.isEmpty(importDto.getRestrictedScope())) {
|
||||
lineValidateMsgList.add("限制使用时,限制使用范围必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getChildrenFlag())) {
|
||||
@@ -618,7 +615,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
lineValidateMsgList.add("是否抗生素必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getAntibioticFlag())
|
||||
&& StringUtils.isEmpty(importDto.getAntibioticCode())) {
|
||||
&& StringUtils.isEmpty(importDto.getAntibioticCode())) {
|
||||
lineValidateMsgList.add("为抗生素时,抗生素分类必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getSelfFlag())) {
|
||||
@@ -731,7 +728,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
@@ -740,15 +737,15 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<MedicationImportDto>> importDtoGroupList = new ArrayList<>(importDtoList.stream()
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getTotalVolume())).values());
|
||||
.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() + "】重复;");
|
||||
.add(
|
||||
"■ 第"
|
||||
+ importDtoGroup.stream().map(MedicationImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -758,18 +755,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
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()));
|
||||
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()));
|
||||
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() + "】在系统中已存在;");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -781,48 +778,48 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
/**
|
||||
* 创建药品定义实体
|
||||
*
|
||||
*
|
||||
* @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(CommonUtil.tryParseInt(importDto.getDoseFrom()))
|
||||
.setApprovalNumber(importDto.getApprovalNumber())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())).setYbNo(importDto.getYbNo())
|
||||
.setPharmacologyCategoryCode(importDto.getPharmacologyCategoryCode())
|
||||
.setSkinTestFlag(CommonUtil.tryParseInt(importDto.getSkinTestFlag()))
|
||||
.setInjectFlag(CommonUtil.tryParseInt(importDto.getInjectFlag()))
|
||||
.setManufacturerText(importDto.getManufacturerText())
|
||||
.setRestrictedFlag(CommonUtil.tryParseInt(importDto.getRestrictedFlag()))
|
||||
.setRestrictedScope(importDto.getRestrictedScope()).setActiveFlag(Whether.YES.getValue())
|
||||
.setChildrenFlag(CommonUtil.tryParseInt(importDto.getChildrenFlag()))
|
||||
.setNationalDrugCode(importDto.getNationalDrugCode())
|
||||
.setPartAttributeEnum(CommonUtil.tryParseInt(importDto.getPartAttributeEnum()))
|
||||
.setAntibioticCode(importDto.getAntibioticCode())
|
||||
.setSelfFlag(CommonUtil.tryParseInt(importDto.getSelfFlag()))
|
||||
.setAntibioticFlag(CommonUtil.tryParseInt(importDto.getAntibioticFlag()))
|
||||
.setBasicFlag(CommonUtil.tryParseInt(importDto.getBasicFlag()))
|
||||
.setThoPartAttributeEnum(CommonUtil.tryParseInt(importDto.getThoPartAttributeEnum()))
|
||||
.setUnitConversionRatio(importDto.getUnitConversionRatio())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag())).setItemMinQuantity(importDto.getItemMinQuantity())
|
||||
.setItemMaxQuantity(importDto.getItemMaxQuantity());
|
||||
.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(CommonUtil.tryParseInt(importDto.getDoseFrom()))
|
||||
.setApprovalNumber(importDto.getApprovalNumber())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())).setYbNo(importDto.getYbNo())
|
||||
.setPharmacologyCategoryCode(importDto.getPharmacologyCategoryCode())
|
||||
.setSkinTestFlag(CommonUtil.tryParseInt(importDto.getSkinTestFlag()))
|
||||
.setInjectFlag(CommonUtil.tryParseInt(importDto.getInjectFlag()))
|
||||
.setManufacturerText(importDto.getManufacturerText())
|
||||
.setRestrictedFlag(CommonUtil.tryParseInt(importDto.getRestrictedFlag()))
|
||||
.setRestrictedScope(importDto.getRestrictedScope()).setActiveFlag(Whether.YES.getValue())
|
||||
.setChildrenFlag(CommonUtil.tryParseInt(importDto.getChildrenFlag()))
|
||||
.setNationalDrugCode(importDto.getNationalDrugCode())
|
||||
.setPartAttributeEnum(CommonUtil.tryParseInt(importDto.getPartAttributeEnum()))
|
||||
.setAntibioticCode(importDto.getAntibioticCode())
|
||||
.setSelfFlag(CommonUtil.tryParseInt(importDto.getSelfFlag()))
|
||||
.setAntibioticFlag(CommonUtil.tryParseInt(importDto.getAntibioticFlag()))
|
||||
.setBasicFlag(CommonUtil.tryParseInt(importDto.getBasicFlag()))
|
||||
.setThoPartAttributeEnum(CommonUtil.tryParseInt(importDto.getThoPartAttributeEnum()))
|
||||
.setUnitConversionRatio(importDto.getUnitConversionRatio())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag())).setItemMinQuantity(importDto.getItemMinQuantity())
|
||||
.setItemMaxQuantity(importDto.getItemMaxQuantity());
|
||||
return medicationDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建药品基本实体
|
||||
*
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @param medicationDefId 药品定义ID
|
||||
* @param defaultLocationId 默认位置ID
|
||||
@@ -830,7 +827,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
* @return 药品基本实体
|
||||
*/
|
||||
private Medication createMedicationEntity(MedicationImportDto importDto, Long medicationDefId,
|
||||
Long defaultLocationId, Map<String, List<Location>> locationNameMap) {
|
||||
Long defaultLocationId, Map<String, List<Location>> locationNameMap) {
|
||||
Medication medication = new Medication();
|
||||
// 根据输入的所在位置名称获取位置ID
|
||||
List<Location> mapLocationList = locationNameMap.get(importDto.getLocationName());
|
||||
@@ -840,10 +837,10 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
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());
|
||||
.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;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,271 +22,414 @@ import javax.validation.constraints.NotNull;
|
||||
@Accessors(chain = true)
|
||||
public class MedicationManageDto {
|
||||
|
||||
/** ID */
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 药品编码 */
|
||||
/**
|
||||
* 药品编码
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long medicationDefId;
|
||||
|
||||
/** 药品状态 */
|
||||
/**
|
||||
* 药品状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 所属科室 */
|
||||
/**
|
||||
* 所属科室
|
||||
*/
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
private String orgId_dictText;
|
||||
|
||||
/** 所在位置 */
|
||||
/**
|
||||
* 所在位置
|
||||
*/
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
/** 剂型 */
|
||||
/**
|
||||
* 剂型
|
||||
*/
|
||||
@Dict(dictCode = "dose_form_code")
|
||||
private String doseFormCode;
|
||||
private String doseFormCode_dictText;
|
||||
|
||||
/** 规格 */
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String totalVolume;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredientItem;
|
||||
|
||||
/** 是否为活性 */
|
||||
/**
|
||||
* 是否为活性
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
private String activeFlag_enumText;
|
||||
|
||||
/** 批次号 */
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String lotNumber;
|
||||
|
||||
/** 生效日期 */
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 到期日期 */
|
||||
/**
|
||||
* 到期日期
|
||||
*/
|
||||
private Date expirationDate;
|
||||
|
||||
/** 用法 */
|
||||
/**
|
||||
* 用法
|
||||
*/
|
||||
@Dict(dictCode = "method_code")
|
||||
private String methodCode;
|
||||
private String methodCode_dictText;
|
||||
|
||||
/** 用药频次 */
|
||||
/**
|
||||
* 用药频次
|
||||
*/
|
||||
@Dict(dictCode = "rate_code")
|
||||
private String rateCode;
|
||||
private String rateCode_dictText;
|
||||
|
||||
/** 单次剂量 */
|
||||
/**
|
||||
* 单次剂量
|
||||
*/
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
/**
|
||||
* 剂量单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
/** 单次最大剂量 */
|
||||
/**
|
||||
* 单次最大剂量
|
||||
*/
|
||||
private BigDecimal maxUnit;
|
||||
|
||||
/** 药品定义 */
|
||||
/**
|
||||
* 药品定义
|
||||
*/
|
||||
private String definition;
|
||||
|
||||
/** 用量限定 */
|
||||
/**
|
||||
* 用量限定
|
||||
*/
|
||||
private BigDecimal usageLimit;
|
||||
|
||||
/** DDD值 */
|
||||
/**
|
||||
* DDD值
|
||||
*/
|
||||
@Dict(dictCode = "ddd_code")
|
||||
private String dddCode;
|
||||
private String dddCode_dictText;
|
||||
|
||||
/** DDD单位 */
|
||||
/**
|
||||
* DDD单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String dddUnitCode;
|
||||
private String dddUnitCode_dictText;
|
||||
|
||||
/** 药品编号 */
|
||||
/**
|
||||
* 药品编号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/** 药品名称 */
|
||||
/**
|
||||
* 药品名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/** 适用范围 */
|
||||
/**
|
||||
* 适用范围
|
||||
*/
|
||||
private Integer domainEnum;
|
||||
private String domainEnum_enumText;
|
||||
|
||||
/** 药品版本 */
|
||||
/**
|
||||
* 药品版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/** 英文药名 */
|
||||
/**
|
||||
* 英文药名
|
||||
*/
|
||||
private String nameEn;
|
||||
|
||||
/** 药品名称拼音码 */
|
||||
/**
|
||||
* 药品名称拼音码
|
||||
*/
|
||||
private String pyStr;
|
||||
|
||||
/** 药品五笔码 */
|
||||
/**
|
||||
* 药品五笔码
|
||||
*/
|
||||
private String wbStr;
|
||||
|
||||
/** 药品分类 */
|
||||
/**
|
||||
* 药品分类
|
||||
*/
|
||||
@Dict(dictCode = "med_category_code")
|
||||
private String categoryCode;
|
||||
private String categoryCode_dictText;
|
||||
|
||||
/** 商品名称 */
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String merchandiseName;
|
||||
|
||||
/** 商品名称拼音码 */
|
||||
/**
|
||||
* 商品名称拼音码
|
||||
*/
|
||||
private String merchandisePyStr;
|
||||
|
||||
/** 商品五笔码 */
|
||||
/**
|
||||
* 商品五笔码
|
||||
*/
|
||||
private String merchandiseWbStr;
|
||||
|
||||
/** 药品单位 */
|
||||
/**
|
||||
* 药品单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
/**
|
||||
* 最小单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String minUnitCode;
|
||||
private String minUnitCode_dictText;
|
||||
|
||||
/** 所含耗材 */
|
||||
/**
|
||||
* 所含耗材
|
||||
*/
|
||||
private String comprisedText;
|
||||
|
||||
/** 拆零比 */
|
||||
/**
|
||||
* 拆零比
|
||||
*/
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 剂量形式 */
|
||||
/**
|
||||
* 剂量形式
|
||||
*/
|
||||
@Dict(dictCode = "dose_form_code")
|
||||
private Integer doseFrom;
|
||||
private String doseFrom_dictText;
|
||||
|
||||
/** 批准文号 */
|
||||
/**
|
||||
* 批准文号
|
||||
*/
|
||||
private String approvalNumber;
|
||||
|
||||
/** 医保是否对码 */
|
||||
/**
|
||||
* 医保是否对码
|
||||
*/
|
||||
private Integer ybMatchFlag;
|
||||
private String ybMatchFlag_enumText;;
|
||||
private String ybMatchFlag_enumText;
|
||||
;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 药理作用分类 */
|
||||
/**
|
||||
* 药理作用分类
|
||||
*/
|
||||
private String pharmacologyCategoryCode;
|
||||
|
||||
/** 是否皮试 */
|
||||
/**
|
||||
* 是否皮试
|
||||
*/
|
||||
private Integer skinTestFlag;
|
||||
private String skinTestFlag_enumText;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
/**
|
||||
* 是否为注射药物
|
||||
*/
|
||||
private Integer injectFlag;
|
||||
private String injectFlag_enumText;
|
||||
|
||||
/** 生产厂家 */
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long manufacturerId;
|
||||
|
||||
/** 供应商 */
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@Dict(dictTable = "adm_supplier", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long supplyId;
|
||||
private String supplyId_dictText;
|
||||
|
||||
/** 是否限制使用 */
|
||||
/**
|
||||
* 是否限制使用
|
||||
*/
|
||||
private Integer restrictedFlag;
|
||||
private String restrictedFlag_enumText;
|
||||
|
||||
/** 限制使用范围 */
|
||||
/**
|
||||
* 限制使用范围
|
||||
*/
|
||||
private String restrictedScope;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
/**
|
||||
* 儿童用药标志
|
||||
*/
|
||||
private Integer childrenFlag;
|
||||
private String childrenFlag_enumText;
|
||||
|
||||
/** 产品特性 */
|
||||
/**
|
||||
* 产品特性
|
||||
*/
|
||||
private Integer characteristic;
|
||||
private String characteristic_enumText;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
/**
|
||||
* 贯标国家编码
|
||||
*/
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 拆分属性 */
|
||||
/**
|
||||
* 拆分属性
|
||||
*/
|
||||
private Integer partAttributeEnum;
|
||||
private String partAttributeEnum_enumText;
|
||||
|
||||
/** 抗生素分类 */
|
||||
/**
|
||||
* 抗生素分类
|
||||
*/
|
||||
@Dict(dictCode = "antibiotic_type_code")
|
||||
private String antibioticCode;
|
||||
private String antibioticCode_dictText;
|
||||
|
||||
/** 权限限制 */
|
||||
/**
|
||||
* 权限限制
|
||||
*/
|
||||
private Integer restrictedEnum;
|
||||
private String restrictedEnum_enumText;
|
||||
|
||||
/** 是否自制 */
|
||||
/**
|
||||
* 是否自制
|
||||
*/
|
||||
private Integer selfFlag;
|
||||
private String selfFlag_enumText;
|
||||
|
||||
/** 是否抗生素 */
|
||||
/**
|
||||
* 是否抗生素
|
||||
*/
|
||||
private Integer antibioticFlag;
|
||||
private String antibioticFlag_enumText;
|
||||
|
||||
/** 基药标识 */
|
||||
/**
|
||||
* 基药标识
|
||||
*/
|
||||
private Integer basicFlag;
|
||||
private String basicFlag_enumText;
|
||||
|
||||
/** 生产厂商文本 */
|
||||
/**
|
||||
* 生产厂商文本
|
||||
*/
|
||||
private String manufacturerText;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最小库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最大库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
/** 售价 */
|
||||
/**
|
||||
* 售价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/** 单次最小用药频次 */
|
||||
/**
|
||||
* 单次最小用药频次
|
||||
*/
|
||||
private String minRateCode;
|
||||
|
||||
/** 单次最大用药频次 */
|
||||
/**
|
||||
* 单次最大用药频次
|
||||
*/
|
||||
private String maxRateCode;
|
||||
|
||||
/** 医保类别 */
|
||||
/**
|
||||
* 医保类别
|
||||
*/
|
||||
private String ybType;
|
||||
|
||||
/** 财务类别 */
|
||||
/**
|
||||
* 财务类别
|
||||
*/
|
||||
@Dict(dictCode = "fin_type_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredient;
|
||||
|
||||
/** 购入价 */
|
||||
/**
|
||||
* 购入价
|
||||
*/
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 零售价 */
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 最高零售价 */
|
||||
/**
|
||||
* 最高零售价
|
||||
*/
|
||||
private BigDecimal maximumRetailPrice;
|
||||
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
/**
|
||||
* 住院临时医嘱拆分属性
|
||||
*/
|
||||
private Integer thoPartAttributeEnum;
|
||||
private String thoPartAttributeEnum_enumText;
|
||||
|
||||
/** 剂量单位换算比 */
|
||||
/**
|
||||
* 剂量单位换算比
|
||||
*/
|
||||
private BigDecimal unitConversionRatio;
|
||||
|
||||
/** 医保等级 */
|
||||
/**
|
||||
* 医保等级
|
||||
*/
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 处方标志 */
|
||||
/**
|
||||
* 处方标志
|
||||
*/
|
||||
private Integer rxFlag;
|
||||
|
||||
/**
|
||||
@@ -294,12 +437,9 @@ public class MedicationManageDto {
|
||||
*/
|
||||
private String dosageInstruction;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
/**
|
||||
* 药品69码
|
||||
*/
|
||||
private String drug69Code;
|
||||
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
@@ -24,238 +24,380 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class MedicationManageUpDto {
|
||||
|
||||
/** ID */
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 药品编码 */
|
||||
/**
|
||||
* 药品编码
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long medicationDefId;
|
||||
|
||||
/** 所属科室 */
|
||||
/**
|
||||
* 所属科室
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
/**
|
||||
* 所在位置
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 剂型 */
|
||||
/**
|
||||
* 剂型
|
||||
*/
|
||||
private String doseFormCode;
|
||||
|
||||
/** 规格 */
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String totalVolume;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredientItem;
|
||||
|
||||
/** 是否为活性 */
|
||||
/**
|
||||
* 是否为活性
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 批次号 */
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String lotNumber;
|
||||
|
||||
/** 生效日期 */
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 到期日期 */
|
||||
/**
|
||||
* 到期日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date expirationDate;
|
||||
|
||||
/** 用法 */
|
||||
/**
|
||||
* 用法
|
||||
*/
|
||||
private String methodCode;
|
||||
|
||||
/** 用药频次 */
|
||||
/**
|
||||
* 用药频次
|
||||
*/
|
||||
private String rateCode;
|
||||
|
||||
/** 单次剂量 */
|
||||
/**
|
||||
* 单次剂量
|
||||
*/
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
/**
|
||||
* 剂量单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
@NotBlank(message = "剂量单位不能为空")
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
/** 单次最大剂量 */
|
||||
/**
|
||||
* 单次最大剂量
|
||||
*/
|
||||
private BigDecimal maxUnit;
|
||||
|
||||
/** 药品定义 */
|
||||
/**
|
||||
* 药品定义
|
||||
*/
|
||||
private String definition;
|
||||
|
||||
/** 药品编号 */
|
||||
/**
|
||||
* 药品编号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/** 药品名称 */
|
||||
/**
|
||||
* 药品名称
|
||||
*/
|
||||
@NotBlank(message = "药品名称不能为空")
|
||||
private String name;
|
||||
|
||||
/** 适用范围 */
|
||||
/**
|
||||
* 适用范围
|
||||
*/
|
||||
private Integer domainEnum;
|
||||
|
||||
/** 药品版本 */
|
||||
/**
|
||||
* 药品版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/** 英文药名 */
|
||||
/**
|
||||
* 英文药名
|
||||
*/
|
||||
private String nameEn;
|
||||
|
||||
/** 药品名称拼音码 */
|
||||
/**
|
||||
* 药品名称拼音码
|
||||
*/
|
||||
private String pyStr;
|
||||
|
||||
/** 药品五笔码 */
|
||||
/**
|
||||
* 药品五笔码
|
||||
*/
|
||||
private String wbStr;
|
||||
|
||||
/** 药品分类 */
|
||||
/**
|
||||
* 药品分类
|
||||
*/
|
||||
private String categoryCode;
|
||||
|
||||
/** 商品名称 */
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String merchandiseName;
|
||||
|
||||
/** 商品名称拼音码 */
|
||||
/**
|
||||
* 商品名称拼音码
|
||||
*/
|
||||
private String merchandisePyStr;
|
||||
|
||||
/** 商品五笔码 */
|
||||
/**
|
||||
* 商品五笔码
|
||||
*/
|
||||
private String merchandiseWbStr;
|
||||
|
||||
/** 药品单位 */
|
||||
/**
|
||||
* 药品单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
/**
|
||||
* 最小单位
|
||||
*/
|
||||
private String minUnitCode;
|
||||
|
||||
/** 所含耗材 */
|
||||
/**
|
||||
* 所含耗材
|
||||
*/
|
||||
private String comprisedText;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredient;
|
||||
|
||||
/** 拆零比 */
|
||||
/**
|
||||
* 拆零比
|
||||
*/
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 剂量形式 */
|
||||
/**
|
||||
* 剂量形式
|
||||
*/
|
||||
@Dict(dictCode = "dose_form_code")
|
||||
private Integer doseFrom;
|
||||
private String doseFrom_dictText;
|
||||
|
||||
/** 批准文号 */
|
||||
/**
|
||||
* 批准文号
|
||||
*/
|
||||
private String approvalNumber;
|
||||
|
||||
/** 医保是否对码 */
|
||||
/**
|
||||
* 医保是否对码
|
||||
*/
|
||||
private Integer ybMatchFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
/**
|
||||
* 医保编码
|
||||
*/
|
||||
private String ybNo;
|
||||
|
||||
/** 药理作用分类 */
|
||||
/**
|
||||
* 药理作用分类
|
||||
*/
|
||||
private String pharmacologyCategoryCode;
|
||||
|
||||
/** 是否皮试 */
|
||||
/**
|
||||
* 是否皮试
|
||||
*/
|
||||
private Integer skinTestFlag;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
/**
|
||||
* 是否为注射药物
|
||||
*/
|
||||
private Integer injectFlag;
|
||||
|
||||
/** 生产厂家 */
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long manufacturerId;
|
||||
|
||||
/** 生产厂商文本 */
|
||||
/**
|
||||
* 生产厂商文本
|
||||
*/
|
||||
private String manufacturerText;
|
||||
|
||||
/** 供应商 */
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long supplyId;
|
||||
|
||||
/** 是否限制使用 */
|
||||
/**
|
||||
* 是否限制使用
|
||||
*/
|
||||
private Integer restrictedFlag;
|
||||
|
||||
/** 限制使用范围 */
|
||||
/**
|
||||
* 限制使用范围
|
||||
*/
|
||||
private String restrictedScope;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
/**
|
||||
* 儿童用药标志
|
||||
*/
|
||||
private Integer childrenFlag;
|
||||
|
||||
/** 产品特性 */
|
||||
/**
|
||||
* 产品特性
|
||||
*/
|
||||
private Integer characteristic;
|
||||
|
||||
/** 购入价 */
|
||||
/**
|
||||
* 购入价
|
||||
*/
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 零售价 */
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 最高零售价 */
|
||||
/**
|
||||
* 最高零售价
|
||||
*/
|
||||
private BigDecimal maximumRetailPrice;
|
||||
|
||||
/** 医保类别 */
|
||||
/**
|
||||
* 医保类别
|
||||
*/
|
||||
private String ybType;
|
||||
|
||||
/** 财务类别 */
|
||||
/**
|
||||
* 财务类别
|
||||
*/
|
||||
@Dict(dictCode = "fin_type_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/** 单次最小用药频次 */
|
||||
/**
|
||||
* 单次最小用药频次
|
||||
*/
|
||||
private String minRateCode;
|
||||
|
||||
/** 单次最大用药频次 */
|
||||
/**
|
||||
* 单次最大用药频次
|
||||
*/
|
||||
private String maxRateCode;
|
||||
|
||||
/** 药品状态 */
|
||||
/**
|
||||
* 药品状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 拆分属性 */
|
||||
/**
|
||||
* 拆分属性
|
||||
*/
|
||||
private Integer partAttributeEnum;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
/**
|
||||
* 贯标国家编码
|
||||
*/
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 是否抗生素 */
|
||||
/**
|
||||
* 是否抗生素
|
||||
*/
|
||||
private Integer antibioticFlag;
|
||||
|
||||
/** 是否自制 */
|
||||
/**
|
||||
* 是否自制
|
||||
*/
|
||||
private Integer selfFlag;
|
||||
|
||||
/** DDD值 */
|
||||
/**
|
||||
* DDD值
|
||||
*/
|
||||
private String dddCode;
|
||||
|
||||
/** DDD单位 */
|
||||
/**
|
||||
* DDD单位
|
||||
*/
|
||||
private String dddUnitCode;
|
||||
|
||||
/** 用量限定 */
|
||||
/**
|
||||
* 用量限定
|
||||
*/
|
||||
private BigDecimal usageLimit;
|
||||
|
||||
/** 抗生素分类 */
|
||||
/**
|
||||
* 抗生素分类
|
||||
*/
|
||||
@Dict(dictCode = "antibiotic_type_code")
|
||||
private String antibioticCode;
|
||||
private String antibioticCode_dictText;
|
||||
|
||||
/** 权限限制 */
|
||||
/**
|
||||
* 权限限制
|
||||
*/
|
||||
private Integer restrictedEnum;
|
||||
|
||||
/** 基药标识 */
|
||||
/**
|
||||
* 基药标识
|
||||
*/
|
||||
private Integer basicFlag;
|
||||
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
/**
|
||||
* 住院临时医嘱拆分属性
|
||||
*/
|
||||
private Integer thoPartAttributeEnum;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最小库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最大库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
/** 剂量单位换算比 */
|
||||
/**
|
||||
* 剂量单位换算比
|
||||
*/
|
||||
private BigDecimal unitConversionRatio;
|
||||
|
||||
/** 医保等级 */
|
||||
/**
|
||||
* 医保等级
|
||||
*/
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 处方标志 */
|
||||
/**
|
||||
* 处方标志
|
||||
*/
|
||||
private Integer rxFlag;
|
||||
|
||||
/**
|
||||
@@ -263,12 +405,9 @@ public class MedicationManageUpDto {
|
||||
*/
|
||||
private String dosageInstruction;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
/**
|
||||
* 药品69码
|
||||
*/
|
||||
private String drug69Code;
|
||||
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user