Jelajahi Sumber

结算单 添加查询支付方式的条件,以及定时任务。

xiaochan 3 tahun lalu
induk
melakukan
f2c948c36b

+ 20 - 6
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/UpIdCollectionDao.java

@@ -166,7 +166,6 @@ public interface UpIdCollectionDao {
                                      @Param("times") Integer times,
                                      @Param("tableName") String tableName);
 
-
     @Select("select insuplc_admdvs,insutype,med_type from t_si_pat_info " +
             "where pat_no = #{patNo} and times = #{times} and ledger_sn = #{ledgerSn}")
     SiPatInfo huoQuZhiFuFangShi(@Param("patNo") String patNo,
@@ -306,6 +305,9 @@ public interface UpIdCollectionDao {
             "<if test=\"auditFlag != 4 \">" +
             " and c.audit_flag = #{auditFlag} " +
             "</if>" +
+            "<if test=\"hiPaymtd != null \">" +
+            " and a.hi_paymtd = #{hiPaymtd} " +
+            "</if>" +
             "<if test=\"referPhysician != null and  referPhysician != '' \">" +
             " and b.refer_physician = #{referPhysician} " +
             "</if>" +
@@ -324,6 +326,7 @@ public interface UpIdCollectionDao {
                                              @Param("flag") Integer flag,
                                              @Param("referPhysician") String referPhysician,
                                              @Param("auditFlag") Integer auditFlag,
+                                             @Param("hiPaymtd") Integer hiPaymtd,
                                              @Param("currentPage") long currentPage,
                                              @Param("pageSize") long pageSize);
 
@@ -390,6 +393,9 @@ public interface UpIdCollectionDao {
             "<if test=\"referPhysician != null and referPhysician != '' \">" +
             " and b.refer_physician = #{referPhysician} " +
             "</if>" +
+            "<if test=\"hiPaymtd != null \">" +
+            " and a.hi_paymtd = #{hiPaymtd} " +
+            "</if>" +
             "</script>")
     long huoQuJieSuanRenYuanTotal(@Param("startTime") String startTime,
                                   @Param("endTime") String endTime,
@@ -403,7 +409,8 @@ public interface UpIdCollectionDao {
                                   @Param("decTypes") List<Integer> decTypes,
                                   @Param("flag") Integer flag,
                                   @Param("referPhysician") String referPhysician,
-                                  @Param("auditFlag") Integer auditFlag);
+                                  @Param("auditFlag") Integer auditFlag,
+                                  @Param("hiPaymtd") Integer hiPaymtd);
 
 
     @Select("select opName = (select top(1) rtrim(name) from a_employee_mi where code = op_id_code)," +
@@ -421,10 +428,12 @@ public interface UpIdCollectionDao {
             "       sszsName2 = (select top(1) rtrim(name) from a_employee_mi where code = sszs2), " +
             "       mzys_name = (select top(1) rtrim(name) from a_employee_mi where code = mzys)," +
             "       bah, zyh, zycs, ssxh, ssrq, sstj, " +
-            "       ssys = (select top(1) yb_code from a_employee_mi where code = ssys)" +
-            ", sszs1, sszs2, mzys = (select top(1) yb_code from a_employee_mi where code = mzys), ssbm, ssmc, rtrim(mzff) mzff, rtrim(qkjb) qkjb," +
-            "rtrim(yhqk) yhqk, ssbfz, fhqk, ssjb, cut_heal" +
-            " from ${tableName} where zyh = #{patNo} and zycs = #{times} and isnull(ssbm,'-') <> '-'")
+            "       ssys , sszs1, sszs2, mzys ," +
+            " ssbm, ssmc, rtrim(mzff) mzff, rtrim(qkjb) qkjb," +
+            "rtrim(yhqk) yhqk, ssbfz, fhqk, ssjb, cut_heal," +
+            "(select top(1) yb_code from a_employee_mi where code = ssys) as oper_dr_code, " +
+            "(select top(1) yb_code from a_employee_mi where code = mzys) as anst_dr_code " +
+            "from ${tableName} where zyh = #{patNo} and zycs = #{times} and isnull(ssbm,'-') <> '-'")
     List<BatjBa4> shouShuXinXi(@Param("patNo") String patNo,
                                @Param("times") Integer times,
                                @Param("tableName") String tableName);
@@ -618,4 +627,9 @@ public interface UpIdCollectionDao {
             "where job_nurse = b.code and  zyh = #{patNo} and zycs = #{times} ")
     GetDropdownBox zeRenHuShi(@Param("patNo") String patNo,
                               @Param("times") Integer times);
+
+
+    @Select("select pat_no,times,ledger_sn from t_si_setlinfo")
+    List<Map<String, Object>> huoQuQuanBuJieSuanRenYuan();
+
 }

+ 4 - 0
src/main/java/thyyxxk/webserver/dao/his/scheduled/JieShouFeiYongDao.java

@@ -20,4 +20,8 @@ public interface JieShouFeiYongDao {
             "       where a.inpatient_no = b.inpatient_no and a.admiss_times = b.admiss_times) " +
             "from zy_actpatient a ")
     List<Patient> xuYaoJieShouFeiYong();
+
+
+    @Select("exec [dbo].[zy_receive_auto]")
+    String jieShouYaoPing();
 }

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/inpatient/BatjBa4.java

@@ -110,6 +110,8 @@ public class BatjBa4 implements Serializable {
     private String sszsName1;
     private String sszsName2;
     private String mzysName;
+    private String operDrCode;
+    private String anstDrCode;
 
     private Boolean newData = false;
 

+ 5 - 0
src/main/java/thyyxxk/webserver/entity/querydata/JieSuanDanChaXun.java

@@ -64,6 +64,11 @@ public class JieSuanDanChaXun {
      */
     private Integer auditFlag;
 
+    /**
+     * 支付方式
+     */
+    private Integer hiPaymtd;
+
 
     private long currentPage;
     private long pageSize;

+ 3 - 1
src/main/java/thyyxxk/webserver/scheduled/FeiYongJieShouChongSuan.java

@@ -33,7 +33,7 @@ public class FeiYongJieShouChongSuan {
         this.patientService = patientService;
     }
 
-    @Scheduled(cron = "0 0 1 * * ?")
+    @Scheduled(cron = "0 30 11 * * ?")
     public void jieShouFeiYong() {
         // 每天凌晨 1 点 执行
         if (feiYongJieShou) {
@@ -46,6 +46,8 @@ public class FeiYongJieShouChongSuan {
                     e.printStackTrace();
                 }
             }
+            String message = dao.jieShouYaoPing();
+            log.info("药品接收:{}", message);
         }
     }
 }

+ 6 - 8
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -96,7 +96,7 @@ public class SetlListUpldService {
         // 这里是上传
         JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
         log.info("医保结算信息上传 \n操作人:{}\n参数:{} \n结果:{}", TokenUtil.getTokenUserId(), jsonObject, result);
-        logDao.insert(new SiLog(input, result, patNo, times, ledgerSn));
+        logDao.insert(new SiLog(jsonObject, result, patNo, times, ledgerSn));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
@@ -120,9 +120,6 @@ public class SetlListUpldService {
      * @throws Exception 错误
      */
     public ResultVo<UpldCollection> getUploadInfo(String patNo, Integer times, Integer ledgerSn) throws Exception {
-        // 医保支付方式
-
-
         Integer flag = dao.setlModifyReqAuditFlag(patNo, times);
         flag = flag == null ? 0 : flag;
         SetlinfoUpld setlinfoUpld = dao.setlinfo1(patNo, times, ledgerSn);
@@ -250,9 +247,9 @@ public class SetlListUpldService {
         if (ListUtil.notBlank(amtAndOthAmt)) {
             amtAndOthAmt.sort(Comparator.comparing(IteminfoUpld::getMedChrgitm));
         }
-
+        // 计算医保的支付方式
         setlinfoUpld.setHiPaymtd(YiBaoZhiFuFangShi(patNo, times, ledgerSn));
-
+        //  基金支付信息
         upldCollection.setPayinfo(payinfo);
         // 门特慢特病诊断信息 目前还没有
         upldCollection.setOpspdiseinfo(new ArrayList<>());
@@ -520,7 +517,7 @@ public class SetlListUpldService {
         IPage<SiSetlinfoTemp> page = new Page<>();
         page.setRecords(dao.huoQuJieSuanRenYuan(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
                 param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getDecTypes(),
-                param.getFlag(), param.getReferPhysician(), param.getAuditFlag(), param.getCurrentPage(),
+                param.getFlag(), param.getReferPhysician(), param.getAuditFlag(), param.getHiPaymtd(), param.getCurrentPage(),
                 param.getPageSize()));
         if (ListUtil.isBlank(page.getRecords())) {
             return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
@@ -594,7 +591,7 @@ public class SetlListUpldService {
         if (param.getTotal() == 0) {
             page.setTotal(dao.huoQuJieSuanRenYuanTotal(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
                     param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getDecTypes(), param.getFlag(),
-                    param.getReferPhysician(), param.getAuditFlag()));
+                    param.getReferPhysician(), param.getAuditFlag(), param.getHiPaymtd()));
         }
         return ResultVoUtil.success(page);
     }
@@ -792,6 +789,7 @@ public class SetlListUpldService {
                 if (item.getSsrq() == null) {
                     return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "手术日期不能为空。");
                 }
+                log.info("item:{}", item);
                 if (StringUtil.isBlank(item.getSsys())) {
                     return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "手术医生不能为空");
                 }