xiaochan hace 1 año
padre
commit
4df09d283b

+ 19 - 2
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/CaoYaoYiZhuDao.java

@@ -213,9 +213,26 @@ public interface CaoYaoYiZhuDao {
                              @Param("times") Integer times,
                              @Param("orderNo") BigDecimal orderNo);
 
-    @Update("update yz_act_order_cy set status_flag = 'T' " +
-            "where inpatient_no = #{patNo} and admiss_times = #{times} and order_no = #{orderNo} AND status_flag != 'T' ")
+    @Update("update yz_act_order_cy set status_flag = 'd' " +
+            "where inpatient_no = #{patNo} and admiss_times = #{times} and order_no = #{orderNo}  ")
     void genXingCaoYaoShanChuBiaoZhi(@Param("patNo") String patNo,
                                      @Param("times") Integer times,
                                      @Param("orderNo") BigDecimal orderNo);
+
+
+    @Update("update yz_act_order " +
+            "set status_flag = '-1', " +
+            "    instruction = N'作废'," +
+            "    order_name = N'作废' + order_name " +
+            "where act_order_no = #{orderNo}")
+    void shanChuYiZhu(@Param("orderNo") BigDecimal orderNo);
+
+
+    @Select("select * from zy_detail_charge where inpatient_no = #{cy.inpatientNo} and admiss_times = #{cy.admissTimes} and order_no = #{cy.orderNo} and charge_fee > 0")
+    List<ZyDetailCharge> caoYaoFeiYong(@Param("cy") YzActOrderCy cy);
+
+
+    @Update("update zy_detail_charge " +
+            "set ori_detail_sn = -1 where inpatient_no = #{cy.inpatientNo} and admiss_times = #{cy.admissTimes} and order_no = #{cy.orderNo} and ori_detail_sn is null ")
+    void modifyTheExpenseFlag(@Param("cy") YzActOrderCy cy);
 }

+ 2 - 2
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/CaoYaoYiZhuService.java

@@ -274,9 +274,9 @@ public class CaoYaoYiZhuService {
         }
         log.info("删除草药==》操作人:{},数据:{}", TokenUtil.getInstance().getTokenUserId(), JSON.toJSONStringWithDateFormat(cy, GetDateFormat.DATE_TIME));
         dao.genXingCaoYaoShanChuBiaoZhi(patNo, times, orderNo);
-//        dao.shanChuYiZhu(orderNo);
+        dao.shanChuYiZhu(orderNo);
         // 根据医嘱号退费
-//        hospitalizationCostsService.refundsByPatientOrder(cy.getInpatientNo(), cy.getAdmissTimes(), cy.getOrderNo());
+        hospitalizationCostsService.refundsByPatientOrder(cy.getInpatientNo(), cy.getAdmissTimes(), cy.getOrderNo());
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
     }