Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75c4319960 | ||
|
|
510d60bc95 | ||
|
|
42b7d06636 | ||
|
|
5c453a51bb | ||
|
|
d0dd9195ad | ||
|
|
764befbf28 | ||
|
|
e4315cc54a | ||
|
|
32580b1a34 | ||
| 07c92e63a2 |
@@ -83,14 +83,9 @@ public class AdviceUtils {
|
|||||||
* @return 提示信息
|
* @return 提示信息
|
||||||
*/
|
*/
|
||||||
public String checkInventory(List<AdviceSaveDto> adviceSaveList) {
|
public String checkInventory(List<AdviceSaveDto> adviceSaveList) {
|
||||||
// 医嘱定义ID集合(过滤null值,避免SQL查询异常)
|
// 医嘱定义ID集合
|
||||||
List<Long> adviceDefinitionIdList
|
List<Long> adviceDefinitionIdList
|
||||||
= adviceSaveList.stream().map(AdviceSaveDto::getAdviceDefinitionId)
|
= adviceSaveList.stream().map(AdviceSaveDto::getAdviceDefinitionId).collect(Collectors.toList());
|
||||||
.filter(id -> id != null).collect(Collectors.toList());
|
|
||||||
// 🔧 Bug #504 修复:如果所有adviceDefinitionId都为null,跳过库存校验
|
|
||||||
if (adviceDefinitionIdList.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// 医嘱库存集合
|
// 医嘱库存集合
|
||||||
List<AdviceInventoryDto> adviceInventoryList
|
List<AdviceInventoryDto> adviceInventoryList
|
||||||
= doctorStationAdviceAppMapper.getAdviceInventory(null, adviceDefinitionIdList,
|
= doctorStationAdviceAppMapper.getAdviceInventory(null, adviceDefinitionIdList,
|
||||||
@@ -104,10 +99,6 @@ public class AdviceUtils {
|
|||||||
= this.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
|
= this.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
|
||||||
// 检查库存
|
// 检查库存
|
||||||
for (AdviceSaveDto saveDto : adviceSaveList) {
|
for (AdviceSaveDto saveDto : adviceSaveList) {
|
||||||
// 🔧 Bug #504 修复:退回医嘱可能adviceDefinitionId为空,跳过校验
|
|
||||||
if (saveDto.getAdviceDefinitionId() == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
boolean matched = false;
|
boolean matched = false;
|
||||||
for (AdviceInventoryDto inventoryDto : adviceInventory) {
|
for (AdviceInventoryDto inventoryDto : adviceInventory) {
|
||||||
// 匹配条件:adviceDefinitionId, adviceTableName, locationId, lotNumber 同时相等
|
// 匹配条件:adviceDefinitionId, adviceTableName, locationId, lotNumber 同时相等
|
||||||
@@ -117,12 +108,10 @@ public class AdviceUtils {
|
|||||||
|| saveDto.getLotNumber().equals(inventoryDto.getLotNumber());
|
|| saveDto.getLotNumber().equals(inventoryDto.getLotNumber());
|
||||||
boolean tableNameMatch = StringUtils.isEmpty(saveDto.getAdviceTableName())
|
boolean tableNameMatch = StringUtils.isEmpty(saveDto.getAdviceTableName())
|
||||||
|| inventoryDto.getItemTable().equals(saveDto.getAdviceTableName());
|
|| inventoryDto.getItemTable().equals(saveDto.getAdviceTableName());
|
||||||
// 🔧 Bug #504 修复:退回医嘱可能locationId为空,跳过location匹配
|
// if (saveDto.)
|
||||||
boolean locationMatch = saveDto.getLocationId() == null
|
|
||||||
|| inventoryDto.getLocationId().equals(saveDto.getLocationId());
|
|
||||||
if (inventoryDto.getItemId().equals(saveDto.getAdviceDefinitionId())
|
if (inventoryDto.getItemId().equals(saveDto.getAdviceDefinitionId())
|
||||||
&& tableNameMatch
|
&& tableNameMatch
|
||||||
&& locationMatch && lotNumberMatch) {
|
&& inventoryDto.getLocationId().equals(saveDto.getLocationId()) && lotNumberMatch) {
|
||||||
matched = true;
|
matched = true;
|
||||||
// 检查库存是否充足
|
// 检查库存是否充足
|
||||||
BigDecimal minUnitQuantity = saveDto.getMinUnitQuantity();
|
BigDecimal minUnitQuantity = saveDto.getMinUnitQuantity();
|
||||||
|
|||||||
@@ -216,8 +216,7 @@
|
|||||||
ccd.name AS condition_definition_name,
|
ccd.name AS condition_definition_name,
|
||||||
T1.therapy_enum AS therapyEnum,
|
T1.therapy_enum AS therapyEnum,
|
||||||
T1.sort_number AS sort_number,
|
T1.sort_number AS sort_number,
|
||||||
T1.based_on_id AS based_on_id,
|
T1.based_on_id AS based_on_id
|
||||||
T1.medication_id AS advice_definition_id
|
|
||||||
FROM med_medication_request AS T1
|
FROM med_medication_request AS T1
|
||||||
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
|
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
|
||||||
AND T2.delete_flag = '0'
|
AND T2.delete_flag = '0'
|
||||||
@@ -269,8 +268,7 @@
|
|||||||
'' AS condition_definition_name,
|
'' AS condition_definition_name,
|
||||||
2 AS therapyEnum,
|
2 AS therapyEnum,
|
||||||
99 AS sort_number,
|
99 AS sort_number,
|
||||||
T1.based_on_id AS based_on_id,
|
T1.based_on_id AS based_on_id
|
||||||
T1.device_def_id AS advice_definition_id
|
|
||||||
FROM wor_device_request AS T1
|
FROM wor_device_request AS T1
|
||||||
LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id
|
LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id
|
||||||
AND T2.delete_flag = '0'
|
AND T2.delete_flag = '0'
|
||||||
@@ -319,8 +317,7 @@
|
|||||||
'' AS condition_definition_name,
|
'' AS condition_definition_name,
|
||||||
COALESCE(T1.therapy_enum, 2) AS therapyEnum,
|
COALESCE(T1.therapy_enum, 2) AS therapyEnum,
|
||||||
99 AS sort_number,
|
99 AS sort_number,
|
||||||
T1.based_on_id AS based_on_id,
|
T1.based_on_id AS based_on_id
|
||||||
T1.activity_id AS advice_definition_id
|
|
||||||
FROM wor_service_request AS T1
|
FROM wor_service_request AS T1
|
||||||
LEFT JOIN wor_activity_definition AS T2
|
LEFT JOIN wor_activity_definition AS T2
|
||||||
ON T2.ID = T1.activity_id
|
ON T2.ID = T1.activity_id
|
||||||
|
|||||||
@@ -195,8 +195,9 @@ const recursionFun = (targetDepartment) => {
|
|||||||
name = obj.name;
|
name = obj.name;
|
||||||
}
|
}
|
||||||
const subObjArray = obj['children'];
|
const subObjArray = obj['children'];
|
||||||
for (let index = 0; index < subObjArray.length; index++) {
|
if (!subObjArray) continue;
|
||||||
const item = subObjArray[index];
|
for (let i = 0; i < subObjArray.length; i++) {
|
||||||
|
const item = subObjArray[i];
|
||||||
if (item.id == targetDepartment) {
|
if (item.id == targetDepartment) {
|
||||||
name = item.name;
|
name = item.name;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user