浏览代码

门诊退发药撤销退药bug修复

hsh 2 年之前
父节点
当前提交
7971667473

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

@@ -269,7 +269,7 @@ public class MzPharmacyController {
     @UserLoginToken
     @RequestMapping(value = "/cancelRefundMedicineProcessing", method = {RequestMethod.GET})
     public Map<String, Object> cancelRefundMedicineProcessing(@RequestParam("realNo") Integer realNo, @RequestParam("groupNo") String groupNo
-            , @RequestParam("orderNo") Integer orderNo, HttpServletRequest httpServletRequest) throws MzException {
+            , @RequestParam("receiptNo") Integer receiptNo , @RequestParam("orderNo") Integer orderNo, HttpServletRequest httpServletRequest) throws MzException {
         User tokenUser = TokenUtil.getUser(httpServletRequest);
         Map<String, Object> resultMap = new HashMap<>();
         try {
@@ -278,12 +278,12 @@ public class MzPharmacyController {
                 resultMap.put("message", "撤销退药处理失败,参数为空");
                 return resultMap;
             }
-            if (mzPharmacyService.queryRefundMoneyCount(-realNo, -1, groupNo, orderNo) > 0) {
+            if (mzPharmacyService.queryRefundMoneyCount(-realNo, receiptNo, groupNo, orderNo) > 0) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "该处方已存在退费记录");
                 return resultMap;
             }
-            if(mzPharmacyService.cancelRefundMedicineProcessing(realNo, groupNo,orderNo) == 0){
+            if(mzPharmacyService.cancelRefundMedicineProcessing(realNo, groupNo, orderNo, receiptNo) == 0){
                 resultMap.put("code", -1);
                 resultMap.put("message", "退回申请退药记录状态异常");
             }else{

+ 4 - 4
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzPharmacyMapper.java

@@ -1030,8 +1030,8 @@ public interface MzPharmacyMapper {
      * @param orderNo
      * @return
      */
-    @Update("update yp_mz_fytj set confirm_flag=#{confirmFlag} where real_no=${realNo}  and receipt_no=-1 and order_no=#{orderNo} and group_no=#{groupNo}")
-    int updateReFytjConfirmFlag(@Param("confirmFlag") Integer confirmFlag, @Param("realNo") Integer realNo, @Param("groupNo") String groupNo, @Param("orderNo") Integer orderNo);
+    @Update("update yp_mz_fytj set confirm_flag=#{confirmFlag} where real_no=${realNo}  and receipt_no=#{receiptNo} and order_no=#{orderNo} and group_no=#{groupNo}")
+    int updateReFytjConfirmFlag(@Param("confirmFlag") Integer confirmFlag, @Param("realNo") Integer realNo, @Param("groupNo") String groupNo, @Param("orderNo") Integer orderNo, @Param("receiptNo") Integer receiptNo);
 
     /**
      * 查询已退药
@@ -1040,6 +1040,6 @@ public interface MzPharmacyMapper {
      * @param orderNo
      * @return
      */
-    @Select("select charge_item_code,serial,quantity,unit_price from yp_mz_fytj where real_no=${realNo} and receipt_no=-1 and order_no=#{orderNo} and group_no=#{groupNo} and quantity>0")
-    List<YpMzFytj> selectRefundDrug(@Param("realNo") Integer realNo, @Param("groupNo") String groupNo, @Param("orderNo") Integer orderNo);
+    @Select("select charge_item_code,serial,quantity,unit_price from yp_mz_fytj where real_no=${realNo} and receipt_no=#{receiptNo} and order_no=#{orderNo} and group_no=#{groupNo} and quantity>0")
+    List<YpMzFytj> selectRefundDrug(@Param("realNo") Integer realNo, @Param("groupNo") String groupNo, @Param("orderNo") Integer orderNo, @Param("receiptNo") Integer receiptNo);
 }

+ 2 - 1
src/main/java/cn/hnthyy/thmz/service/his/mz/MzPharmacyService.java

@@ -68,9 +68,10 @@ public interface MzPharmacyService {
      * @param realNo
      * @param groupNo
      * @param orderNo
+     * @param receiptNo
      * @return
      */
-    int cancelRefundMedicineProcessing(Integer realNo, String groupNo, Integer orderNo) throws MzException;
+    int cancelRefundMedicineProcessing(Integer realNo, String groupNo, Integer orderNo, Integer receiptNo) throws MzException;
 
     /**
      * 发药处理查询未发药处方

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

@@ -129,8 +129,8 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
-    public int cancelRefundMedicineProcessing(Integer realNo, String groupNo, Integer orderNo) throws MzException {
-        List<YpMzFytj> ypMzFytjs = mzPharmacyMapper.selectRefundDrug(realNo, groupNo, orderNo);
+    public int cancelRefundMedicineProcessing(Integer realNo, String groupNo, Integer orderNo, Integer receiptNo) throws MzException {
+        List<YpMzFytj> ypMzFytjs = mzPharmacyMapper.selectRefundDrug(realNo, groupNo, orderNo, receiptNo);
         if (ypMzFytjs.size() > 0) {
             for (int i = 0; i < ypMzFytjs.size(); i++) {
                 YpMzFytj ypMzFytj = ypMzFytjs.get(i);
@@ -144,7 +144,7 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
         } else {
             throw new MzException("未查询到已退药记录");
         }
-        return mzPharmacyMapper.updateReFytjConfirmFlag(2, realNo, groupNo, orderNo);
+        return mzPharmacyMapper.updateReFytjConfirmFlag(2, realNo, groupNo, orderNo, receiptNo);
     }
 
     @Override

+ 1 - 0
src/main/resources/static/js/mz/west_pharmacy_send.js

@@ -1558,6 +1558,7 @@ function saveCancelRefundMedicine() {
         data: {
             realNo: row[0].realNo,
             groupNo: groupNo,
+            receiptNo: row[0].receiptNo,
             orderNo: row[0].orderNo
         }
     }).then((res) => {