fix(ui): 修复多个功能模块的验证和数据处理问题
- 在医生工作站退费功能中添加患者选择验证 - 统一药品管理中的仓库类型选择逻辑,移除重复代码 - 修复统计管理页面清空按钮的数据重置问题 - 修正西药管理页面处方打印按钮的功能绑定 - 完善库存报表查询的SQL过滤条件实现 - 更新多个控制器接口参数类型以支持业务流程 - 优化退费列表对话框的数据加载和错误处理
This commit is contained in:
@@ -108,9 +108,9 @@ public class ProductDetailAppServiceImpl extends ServiceImpl<InventoryItemMapper
|
||||
if (devCategoryCodes != null && !devCategoryCodes.isEmpty()) {
|
||||
queryWrapper.in(CommonConstants.FieldName.DevCategoryCode, devCategoryCodes);
|
||||
}
|
||||
// 库存是否为零
|
||||
// 库存是否为零 (zeroFlag: 1=库存为零, 0=库存大于零)
|
||||
if (zeroFlag != null) {
|
||||
if (Whether.YES.getValue().equals(zeroFlag)) {
|
||||
if (Integer.valueOf(1).equals(zeroFlag)) {
|
||||
queryWrapper.eq(CommonConstants.FieldName.Quantity, BigDecimal.ZERO);
|
||||
} else {
|
||||
queryWrapper.gt(CommonConstants.FieldName.Quantity, BigDecimal.ZERO);
|
||||
@@ -259,9 +259,9 @@ public class ProductDetailAppServiceImpl extends ServiceImpl<InventoryItemMapper
|
||||
if (devCategoryCodes != null && !devCategoryCodes.isEmpty()) {
|
||||
queryWrapper.in(CommonConstants.FieldName.DevCategoryCode, devCategoryCodes);
|
||||
}
|
||||
// 库存是否为零
|
||||
// 库存是否为零 (zeroFlag: 1=库存为零, 0=库存大于零)
|
||||
if (zeroFlag != null) {
|
||||
if (Whether.YES.getValue().equals(zeroFlag)) {
|
||||
if (Integer.valueOf(1).equals(zeroFlag)) {
|
||||
queryWrapper.eq(CommonConstants.FieldName.Quantity, BigDecimal.ZERO);
|
||||
} else {
|
||||
queryWrapper.gt(CommonConstants.FieldName.Quantity, BigDecimal.ZERO);
|
||||
@@ -507,9 +507,9 @@ public class ProductDetailAppServiceImpl extends ServiceImpl<InventoryItemMapper
|
||||
if (devCategoryCodes != null && !devCategoryCodes.isEmpty()) {
|
||||
queryWrapper.in(CommonConstants.FieldName.DevCategoryCode, devCategoryCodes);
|
||||
}
|
||||
// 库存是否为零
|
||||
// 库存是否为零 (zeroFlag: 1=库存为零, 0=库存大于零)
|
||||
if (zeroFlag != null) {
|
||||
if (Whether.YES.getValue().equals(zeroFlag)) {
|
||||
if (Integer.valueOf(1).equals(zeroFlag)) {
|
||||
queryWrapper.eq(CommonConstants.FieldName.Quantity, BigDecimal.ZERO);
|
||||
} else {
|
||||
queryWrapper.gt(CommonConstants.FieldName.Quantity, BigDecimal.ZERO);
|
||||
|
||||
@@ -213,10 +213,24 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
|
||||
return R.fail("收费项的就诊类型未统一");
|
||||
}
|
||||
|
||||
// 获取所有的账户id
|
||||
List<Long> accountIdList = chargeItemList.stream().map(ChargeItem::getAccountId).collect(Collectors.toList());
|
||||
// 获取所有的账户id(过滤掉null值,防止groupingBy时空指针异常)
|
||||
List<Long> accountIdList = chargeItemList.stream()
|
||||
.map(ChargeItem::getAccountId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
// account去重
|
||||
List<Long> distinctAccountIdList = accountIdList.stream().distinct().collect(Collectors.toList());
|
||||
// 检查是否存在accountId为null的收费项
|
||||
long nullAccountIdCount = chargeItemList.stream()
|
||||
.map(ChargeItem::getAccountId)
|
||||
.filter(Objects::isNull)
|
||||
.count();
|
||||
if (nullAccountIdCount > 0) {
|
||||
throw new ServiceException("部分收费项缺少账户信息,请检查收费项数据");
|
||||
}
|
||||
if (distinctAccountIdList.isEmpty()) {
|
||||
throw new ServiceException("未找到有效的账户信息");
|
||||
}
|
||||
List<Account> accountList = iAccountService.list(new LambdaQueryWrapper<Account>()
|
||||
.in(Account::getId, distinctAccountIdList).eq(Account::getEncounterId, prePaymentDto.getEncounterId()));
|
||||
if (accountList.size() != distinctAccountIdList.size()) {
|
||||
@@ -503,9 +517,15 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
|
||||
// }
|
||||
// }
|
||||
|
||||
// 收费详情按照收费批次进行分组
|
||||
// 收费详情按照收费批次进行分组(过滤掉payTransNo为null的记录)
|
||||
Map<String, List<PaymentRecDetail>> payTransNoMap
|
||||
= paymentRecDetails.stream().collect(Collectors.groupingBy(PaymentRecDetail::getPayTransNo));
|
||||
= paymentRecDetails.stream()
|
||||
.filter(detail -> detail.getPayTransNo() != null)
|
||||
.collect(Collectors.groupingBy(PaymentRecDetail::getPayTransNo));
|
||||
|
||||
if (payTransNoMap.isEmpty()) {
|
||||
throw new ServiceException("收费详情缺少批次号信息");
|
||||
}
|
||||
|
||||
com.openhis.financial.model.PaymentResult paymentResult;
|
||||
List<com.openhis.financial.model.PaymentResult> paymentResultList = new ArrayList<>();
|
||||
|
||||
@@ -48,10 +48,11 @@ public class PendingMedicationDetailsAppServiceImpl implements IPendingMedicatio
|
||||
QueryWrapper<PendingMedicationSearchParam> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
pendingMedicationSearchParam, searchKey, new HashSet<>(Arrays.asList("medicine_name", "medicine_no", "py_str")), request);
|
||||
|
||||
// 查询待发药明细列表
|
||||
// 查询待发药明细列表(包含待配药、待发药、已配药三种状态,与门诊发药界面一致)
|
||||
Page<PendingMedicationPageDto> pendingMedicationPage = pendingMedicationDetailsMapper
|
||||
.selectPendingMedicationDetailsPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
DispenseStatus.IN_PROGRESS.getValue(), EncounterClass.AMB.getValue(), EncounterClass.IMP.getValue());
|
||||
DispenseStatus.IN_PROGRESS.getValue(), DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.PREPARED.getValue(), EncounterClass.AMB.getValue(), EncounterClass.IMP.getValue());
|
||||
|
||||
pendingMedicationPage.getRecords().forEach(e -> {
|
||||
// 发药类型
|
||||
|
||||
@@ -20,11 +20,19 @@ public interface PendingMedicationDetailsMapper {
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @param inProgress 发药类型:待发药
|
||||
* @param preparation 发药类型:待配药
|
||||
* @param prepared 发药类型:已配药
|
||||
* @param amb 门诊类型
|
||||
* @param imp 住院类型
|
||||
* @return 待发药明细
|
||||
*/
|
||||
Page<PendingMedicationPageDto> selectPendingMedicationDetailsPage(
|
||||
@Param("page") Page<PendingMedicationPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<PendingMedicationSearchParam> queryWrapper,
|
||||
@Param("inProgress") Integer inProgress, @Param("amb") Integer amb, @Param("imp") Integer imp);
|
||||
@Param("inProgress") Integer inProgress,
|
||||
@Param("preparation") Integer preparation,
|
||||
@Param("prepared") Integer prepared,
|
||||
@Param("amb") Integer amb,
|
||||
@Param("imp") Integer imp);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.web.pharmacymanage.mapper.PendingMedicationDetailsMapper">
|
||||
<select id="selectPendingMedicationDetailsPage"
|
||||
<select id="selectPendingMedicationDetailsPage"
|
||||
resultType="com.openhis.web.pharmacymanage.dto.PendingMedicationPageDto">
|
||||
SELECT T7.medicine_no, --药品编码
|
||||
T7.medicine_name, --药品名称
|
||||
@@ -16,44 +16,44 @@
|
||||
T7.create_time, --开单时间
|
||||
T7.tenant_id --租户ID
|
||||
FROM (
|
||||
SELECT T1.bus_no AS medicine_no, --药品编码
|
||||
T6."name" AS medicine_name, --药品名称
|
||||
T6.py_str, --药品拼音
|
||||
T1.quantity AS dispense_quantity, --待发药数量
|
||||
T1.unit_code, --请求单位
|
||||
T1.dispense_enum, --发药类型
|
||||
T3."name" AS patient_name, --患者姓名
|
||||
T4.prescription_no, --处方号
|
||||
CASE
|
||||
WHEN T2.class_enum = #{amb}
|
||||
THEN T2.bus_no
|
||||
ELSE '' END AS outpatient_no, --门诊号
|
||||
CASE
|
||||
WHEN T2.class_enum = #{imp}
|
||||
THEN T2.bus_no
|
||||
ELSE '' END AS admission_no, --住院号
|
||||
T1.create_time, --开单时间
|
||||
T1.tenant_id --租户ID
|
||||
FROM med_medication_dispense AS T1
|
||||
LEFT JOIN adm_encounter AS T2
|
||||
ON T1.encounter_id = T2.id
|
||||
AND T2.delete_flag = '0'
|
||||
LEFT JOIN adm_patient AS T3
|
||||
ON T1.patient_id = T3.id
|
||||
AND T3.delete_flag = '0'
|
||||
INNER JOIN med_medication_request AS T4
|
||||
ON T1.med_req_id = T4.id
|
||||
AND T4.delete_flag = '0'
|
||||
LEFT JOIN med_medication_definition AS T6
|
||||
ON T1.medication_id = T6.id
|
||||
AND T6.delete_flag = '0'
|
||||
LEFT JOIN med_medication AS T5
|
||||
ON T5.medication_def_id = T6.id
|
||||
AND T5.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0'
|
||||
AND T1.status_enum = #{inProgress}
|
||||
ORDER BY T1.create_time DESC
|
||||
) AS T7
|
||||
SELECT T1.bus_no AS medicine_no, --药品编码
|
||||
T6."name" AS medicine_name, --药品名称
|
||||
T6.py_str, --药品拼音
|
||||
T1.quantity AS dispense_quantity, --待发药数量
|
||||
T1.unit_code, --请求单位
|
||||
T1.dispense_enum, --发药类型
|
||||
T3."name" AS patient_name, --患者姓名
|
||||
T4.prescription_no, --处方号
|
||||
CASE
|
||||
WHEN T2.class_enum = #{amb}
|
||||
THEN T2.bus_no
|
||||
ELSE '' END AS outpatient_no, --门诊号
|
||||
CASE
|
||||
WHEN T2.class_enum = #{imp}
|
||||
THEN T2.bus_no
|
||||
ELSE '' END AS admission_no, --住院号
|
||||
T1.create_time, --开单时间
|
||||
T1.tenant_id --租户ID
|
||||
FROM med_medication_dispense AS T1
|
||||
LEFT JOIN adm_encounter AS T2
|
||||
ON T1.encounter_id = T2.id
|
||||
AND T2.delete_flag = '0'
|
||||
LEFT JOIN adm_patient AS T3
|
||||
ON T1.patient_id = T3.id
|
||||
AND T3.delete_flag = '0'
|
||||
INNER JOIN med_medication_request AS T4
|
||||
ON T1.med_req_id = T4.id
|
||||
AND T4.delete_flag = '0'
|
||||
LEFT JOIN med_medication_definition AS T6
|
||||
ON T1.medication_id = T6.id
|
||||
AND T6.delete_flag = '0'
|
||||
LEFT JOIN med_medication AS T5
|
||||
ON T5.medication_def_id = T6.id
|
||||
AND T5.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0'
|
||||
AND T1.status_enum IN (#{inProgress}, #{preparation}, #{prepared})
|
||||
ORDER BY T1.create_time DESC
|
||||
) AS T7
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user