LIJU 3 周之前
父節點
當前提交
fd0ad41e5f

+ 3 - 1
src/main/java/cn/hnthyy/thmz/controller/mz/MzPharmacyController.java

@@ -2039,7 +2039,9 @@ public class MzPharmacyController {
                     Object itemNoObj = item.get("item_no");
                     
                     tracCodgQuery.setTimes(timesObj instanceof Short ? ((Short) timesObj).intValue() : (Integer) timesObj);
-                    tracCodgQuery.setReceiptNo(itemReceiptNoObj instanceof Short ? ((Short) itemReceiptNoObj).intValue() : (Integer) itemReceiptNoObj);
+                    // 修复:追溯码表中 receipt_no 是正数,需要转换
+                    Integer itemReceiptNo = itemReceiptNoObj instanceof Short ? ((Short) itemReceiptNoObj).intValue() : (Integer) itemReceiptNoObj;
+                    tracCodgQuery.setReceiptNo(Math.abs(itemReceiptNo)); // 转换为正数
                     tracCodgQuery.setOrderNo(itemOrderNoObj instanceof Short ? ((Short) itemOrderNoObj).intValue() : (Integer) itemOrderNoObj);
                     tracCodgQuery.setChargeItemCode((String) item.get("charge_item_code"));
                     tracCodgQuery.setSerial((String) item.get("serial"));

+ 5 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzPharmacyServiceImpl.java

@@ -165,8 +165,12 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
             if (patientId != null && times != null && receiptNo != null && 
                 orderNo != null && chargeItemCode != null && serial != null && itemNo != null) {
                 
+                // 修复:yp_mz_fytj 表中的 receipt_no 是负数,但 mz_charge_detail 表中是正数
+                // 需要将 receiptNo 转换为正数来查询 mz_charge_detail 表
+                Integer actualReceiptNo = Math.abs(receiptNo);
+                
                 Map<String, Object> chargeDetailInfo = mzPharmacyMapper.selectChargeDetailInfo(
-                    patientId, times, receiptNo, orderNo, chargeItemCode, serial, itemNo);
+                    patientId, times, actualReceiptNo, orderNo, chargeItemCode, serial, itemNo);
                 
                 if (chargeDetailInfo != null) {
                     item.put("realNo", chargeDetailInfo.get("realNo"));