Bläddra i källkod

修复二次退费的问题

hurugang 3 år sedan
förälder
incheckning
aa941a536a

+ 2 - 4
src/main/java/cn/hnthyy/thmz/mapper/his/YpMzFytjMapper.java

@@ -51,9 +51,7 @@ public interface YpMzFytjMapper {
             " where patient_id = #{patientId} and times = #{times} and confirm_flag =3 and bill_item_code in('010','011') ")
     List<YpMzFytj> selectXyTyYpMzFytj(@Param(value = "patientId") String patientId, @Param("times") Integer times);
 
-
-
-
+    
 
 
     /**
@@ -320,7 +318,7 @@ public interface YpMzFytjMapper {
      * @param ypMzFytj
      * @return
      */
-    @Delete("delete from yp_mz_fytj where patient_id =#{patientId} and  times = #{times} and receipt_no =#{receiptNo}")
+    @Delete("delete from yp_mz_fytj where patient_id =#{patientId} and  times = #{times} and receipt_no =#{receiptNo} and confirm_flag=2 ")
     int deleteYpMzFytj(YpMzFytj ypMzFytj);
 
 

+ 3 - 3
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -1557,7 +1557,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     //创建新的收款记录对应的发药统计记录
                     ypMzFytj.setTimes(times);
                     ypMzFytj.setReceiptNo(-ypMzFytj.getReceiptNo());
-                    ypMzFytj.setReceiptNo(ypMzFytj.getReceiptNo() + 1);
+                    ypMzFytj.setReceiptNo(1);
                     ypMzFytj.setSerialNo(serialNo);
                     ypMzFytj.setRealNo(serialNo);
                     ypMzFytj.setItemNo(itemNoMap.get(ypMzFytj.getChargeItemCode().trim()));
@@ -1592,7 +1592,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                             continue;
                         }
                         ypMzFytj.setTimes(times);
-                        ypMzFytj.setReceiptNo(ypMzFytj.getReceiptNo() + 1);
+                        ypMzFytj.setReceiptNo(1);
                         ypMzFytj.setQuantity(Double.valueOf(syCount));
                         ypMzFytj.setSerialNo(serialNo);
                         ypMzFytj.setConfirmFlag(ConfirmFlagEnum.CONFIRM.code);
@@ -2057,7 +2057,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                                 if (surplus.compareTo(BigDecimal.ONE) == 0) {
                                     temp.setUnitPrice(BigDecimal.ZERO);
                                 } else {
-                                    temp.setUnitPrice(BigDecimal.valueOf(oriQuantity).multiply(md.getUnitPrice()).subtract(md.getDecAmount().multiply(md.getOrigPrice())).divide(surplus));
+                                    temp.setUnitPrice(BigDecimal.valueOf(oriQuantity).multiply(md.getUnitPrice()).subtract(md.getDecAmount().multiply(md.getOrigPrice())).divide(surplus,2,BigDecimal.ROUND_HALF_UP));
                                 }
                             }
                         }