Forráskód Böngészése

修复门特结算时偶尔不获取报销费用的问题。

lighter 4 éve
szülő
commit
00bec313ac

+ 15 - 2
src/main/java/thyyxxk/webserver/dao/his/markmtfees/MarkMtFeesDao.java

@@ -26,8 +26,8 @@ public interface MarkMtFeesDao {
     void updateSocialNo(@Param("patientId") String patientId, @Param("socialNo") String socialNo);
 
     @Select("select count(1) from mt_part_info where patient_id=#{patientId} and times=#{times} and responce_type='02'")
-    int selectCountMtPartInfo(@Param("patientId") String patientId,
-                                  @Param("times") Integer times);
+    int selectCountMtPartInfoForHnsyb(@Param("patientId") String patientId,
+                                      @Param("times") Integer times);
 
     @Select("select count(1) from mt_part_info where patient_id=#{patientId} and times=#{times} and serial_apply=#{bizType}")
     int selectCountMtPartInfoForSyb(@Param("patientId") String patientId,
@@ -119,4 +119,17 @@ public interface MarkMtFeesDao {
 
     @Select("select rtrim(name) from yp_zd_unit where code=#{code}")
     String selectDrugUnit(@Param("code") String code);
+
+    @Select("select count(1) from mt_part_info where patient_id=#{patientId} and times=#{times} ")
+    int selectMtPartInfoCount(@Param("patientId") String patientId,
+                                      @Param("times") Integer times);
+
+    @Select("select top 1 * from mt_part_info where patient_id=#{patientId} order by times desc")
+    MtPartInfo selectLatestMtPartInfo(@Param("patientId") String patientId);
+
+    @Insert("insert into mt_part_info (patient_id, times, icd, balance, serial_apply, responce_type, " +
+            "hic_no, icd_code, icd_name, second_icd_code, third_icd_code, mz_serial_no, certificate_no) values "+
+            "(#{patientId},#{times},#{icd},#{balance},#{serialApply},#{responceType},#{hicNo},#{icdCode},#{icdName}," +
+            "#{secondIcdCode},#{thirdIcdCode},#{mzSerialNo},#{certificateNo})")
+    void insertNewPartInfo(MtPartInfo info);
 }

+ 23 - 0
src/main/java/thyyxxk/webserver/entity/markmtfees/MtPartInfo.java

@@ -0,0 +1,23 @@
+package thyyxxk.webserver.entity.markmtfees;
+
+import lombok.Data;
+
+/**
+ * @author dj
+ */
+@Data
+public class MtPartInfo {
+	private String patientId;
+	private Integer times;
+	private String icd;
+	private String balance;
+	private String serialApply;
+	private String responceType;
+	private String hicNo;
+	private String icdCode;
+	private String icdName;
+	private String secondIcdCode;
+	private String thirdIcdCode;
+	private String mzSerialNo;
+	private String certificateNo;
+}

+ 3 - 0
src/main/java/thyyxxk/webserver/entity/markmtfees/UploadMtFeeParam.java

@@ -5,6 +5,9 @@ import lombok.Data;
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 
+/**
+ * @author dj
+ */
 @Data
 public class UploadMtFeeParam {
     @NotBlank(message = "操作员id不能为空。")

+ 7 - 1
src/main/java/thyyxxk/webserver/service/markmtfees/MarkMtFeesService.java

@@ -67,7 +67,7 @@ public class MarkMtFeesService {
         data.put("times", times);
         int mtCount;
         if (ResponceType.HUNAN_PROVINCIAL_MEDICAL_INSURANCE.equals(param.getResponceType())) {
-            mtCount = dao.selectCountMtPartInfo(patientId, times);
+            mtCount = dao.selectCountMtPartInfoForHnsyb(patientId, times);
         } else {
             mtCount = dao.selectCountMtPartInfoForSyb(patientId, times, param.getBizType());
         }
@@ -145,6 +145,12 @@ public class MarkMtFeesService {
                 if (null == mzVisit) {
                     continue;
                 }
+                int mtCount = dao.selectMtPartInfoCount(patientId, times);
+                if (mtCount == 0) {
+                    MtPartInfo mtPartInfo = dao.selectLatestMtPartInfo(patientId);
+                    mtPartInfo.setTimes(times);
+                    dao.insertNewPartInfo(mtPartInfo);
+                }
                 Map<String, Object> childResult = new HashMap<>(Capacity.FIVE);
                 childResult.put("times", times);
                 childResult.put("mzPatient", mzPatients.get(0));