Explorar o código

Merge branch 'dev-1.0.6' into dev-1.0.5

hurugang %!s(int64=5) %!d(string=hai) anos
pai
achega
3dfbc1bc58

+ 12 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/MzChargeDetailMapper.java

@@ -391,6 +391,18 @@ public interface MzChargeDetailMapper {
     @Update("update mz_charge_detail set receipt_no =#{receiptNo,jdbcType=INTEGER} where patient_id = #{patientId} and times=#{times} and pay_mark=5 ")
     int setTempDataReceiptNo(@Param(value = "patientId") String patientId,@Param(value = "times") Integer times,@Param(value = "receiptNo") Integer receiptNo);
 
+    /**
+     * 设置医技项目的新编码
+     * @param patientId
+     * @param times
+     * @param reqNo
+     * @param newReqNo
+     * @return
+     */
+    @Update("update mz_charge_detail set req_no =#{newReqNo,jdbcType=INTEGER} where patient_id = #{patientId} and times=#{times} and req_no=#{reqNo,jdbcType=INTEGER} ")
+    int updateReqNo(@Param(value = "patientId") String patientId,@Param(value = "times") Integer times,@Param(value = "reqNo") Integer reqNo,@Param(value = "newReqNo") Integer newReqNo);
+
+
     /**
      * 修改当前病人当前就诊次数下的所有记录的付款状态和打印标记以及确认标记
      *

+ 5 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/MzChargeDetailServiceImpl.java

@@ -783,6 +783,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         //包含退费的付款方式
         List<MzDepositFile> fullNewMzDepositFiles = new ArrayList<>();
         int times = 0;
+        int oriTimes = mzDepositFileVo.getTimes();
         if (allRefund) {
             getDeposFiles(opId, mzDepositFileVo, now, 0, 0, null, null, fullNewMzDepositFiles, allRefund, null);
             //新增收费方式记录
@@ -807,7 +808,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             List<MzYjReq> mzYjReqs = mzYjReqService.queryNotRefundYjReq(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), orderCodes);
             if (mzYjReqs != null && mzYjReqs.size() > 0) {
                 for (MzYjReq yj : mzYjReqs) {
-                    yj.setReqNo(mzYshConfigService.getReqNo());
+                    int newReqNo= mzYshConfigService.getReqNo();
+                    mzChargeDetailMapper.updateReqNo(yj.getPatientId(),times,yj.getReqNo(),newReqNo);
+                    yj.setReqNo(newReqNo);
                     yj.setTimes(times);
                     yj.setPayMark(PayMarkEnum.NO_CHARGE.code);
                     yj.setSerialNo(null);
@@ -846,7 +849,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             updateMzPatientMi.setLvDate(now);
             mzPatientMiMapper.updateMzPatientMi(updateMzPatientMi);
         }
-        MzYjReq updateMzYjReq = new MzYjReq(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes());
+        MzYjReq updateMzYjReq = new MzYjReq(mzDepositFileVo.getPatientId(), oriTimes);
         updateMzYjReq.setPayMark(PayMarkEnum.RETURN_PREMIUM.code);
         mzYjReqService.modifyMzYjReq(updateMzYjReq);
         return times;