Browse Source

优化明细对账,优化负费冲抵

lighter 1 year ago
parent
commit
d3134e796d

+ 7 - 0
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiZyDao.java

@@ -233,6 +233,13 @@ public interface SiZyDao {
                             @Param("times") int times,
                             @Param("sn") int sn);
 
+    @Update("update zy_detail_charge set trans_flag_yb='2' where inpatient_no=#{patNo} " +
+            "and admiss_times=#{times} and ledger_sn in (#{sn1}, #{sn2})")
+    void updateTransFlag(@Param("patNo") String patNo,
+                         @Param("times") int times,
+                         @Param("sn1") int sn1,
+                         @Param("sn2") int sn2);
+
     @Select("select code from zy_zd_responce_type where med_type=#{medtype} ")
     String selectResponceType(@Param("medtype") String medtype);
 

+ 6 - 9
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiManageService.java

@@ -76,12 +76,7 @@ import java.io.IOException;
 import java.math.BigDecimal;
 import java.nio.file.Files;
 import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Queue;
+import java.util.*;
 
 /**
  * @description: 医保管理服务,包涵项目对照等
@@ -378,15 +373,17 @@ public class SiManageService {
             JSONObject fileinfo = output.getJSONObject("fileinfo");
             String filePath = dldService.downloadFile(fileinfo.getString("file_qury_no"), fileinfo.getString("filename"));
             Queue<String> queue = SiUtil.readTxtFile(filePath);
-            if (null == queue || queue.size() == 0) {
+            if (null == queue || queue.isEmpty()) {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未能成功获取到对账结果。");
             }
             List<InsSetlDetlChkRslt> list = new ArrayList<>();
-            while (queue.size() > 0) {
+            while (!queue.isEmpty()) {
                 String item = queue.poll();
                 String[] arr = item.split("\t");
                 InsSetlDetlChkRslt rslt = new InsSetlDetlChkRslt(arr);
-                list.add(rslt);
+                if (!Objects.equals("对账成功", rslt.getMemo())) {
+                    list.add(rslt);
+                }
             }
             return ResultVoUtil.success(list);
         }

+ 1 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -376,6 +376,7 @@ public class SiZyService {
             wrapper.eq("times", fee.getTimes());
             wrapper.eq("ledger_sn", fee.getLedgerSn());
             wrapper.eq("feedetl_sn", fee.getOriDetailSn());
+            dao.updateTransFlag(fee.getPatNo(), fee.getTimes(), fee.getDetailSn(), fee.getOriDetailSn());
             chrgtmpdao.delete(wrapper);
         }
         return ResultVoUtil.success("退费处理成功。");