Sfoglia il codice sorgente

添加查询门诊患者是否正在进行门诊统筹流程的接口。

lighter 2 anni fa
parent
commit
39bed83505

+ 5 - 4
src/main/java/thyyxxk/simzfeeoprnsystm/controller/SiMzFeeController.java

@@ -1,15 +1,12 @@
 package thyyxxk.simzfeeoprnsystm.controller;
 
+import org.springframework.web.bind.annotation.*;
 import thyyxxk.simzfeeoprnsystm.pojo.FundDetail;
 import thyyxxk.simzfeeoprnsystm.pojo.MzPatientInfo;
 import thyyxxk.simzfeeoprnsystm.pojo.SpcChrDiseAcct;
 import thyyxxk.simzfeeoprnsystm.pojo.*;
 import thyyxxk.simzfeeoprnsystm.service.SiMzFeeService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 
 @RestController
 @RequestMapping("/mzFee")
@@ -61,4 +58,8 @@ public class SiMzFeeController {
         return service.directRegistration(params);
     }
 
+    @GetMapping("/isPatientDuringSiSettle")
+    public ResultVo<Integer> isPatientDuringSiSettle(@RequestParam("patientId") String patientId) {
+        return service.isPatientDuringSiSettle(patientId);
+    }
 }

+ 7 - 5
src/main/java/thyyxxk/simzfeeoprnsystm/dao/SiMzDao.java

@@ -69,11 +69,6 @@ public interface SiMzDao {
             "his_item_code as medinsListCodg, " +
             "charge_fee as detItemFeeSumamt, " +
             "quantity as cnt, price as pric, " +
-            "bilgDeptCodg=(select t.si_caty from zd_unit_code t where t.code=" +
-            "(select rtrim(m.dept_code) from a_employee_mi m where m.code=input_staff)), " +
-            "bilgDeptName=(select z.name from t_yb_dept z where z.code=" +
-            "(select t.si_caty from zd_unit_code t where t.code=" +
-            "(select rtrim(m.dept_code) from a_employee_mi m where m.code=input_staff))), " +
             "bilgDrCodg=(select rtrim(yb_code) from a_employee_mi where code=input_staff), " +
             "ordersDrCode=(select rtrim(yb_code) from a_employee_mi where code=input_staff), " +
             "input_man as bilgDrName,input_man as ordersDrName " +
@@ -158,6 +153,13 @@ public interface SiMzDao {
     void deleteAllReceipts(@Param("patNo") String patNo,
                            @Param("times") Integer times);
 
+    @Select("select b.si_caty as visitDeptCode,rtrim(c.name) as visitDeptName " +
+            "from mz_visit_table a, zd_unit_code b, t_yb_dept c where " +
+            "a.patient_id=#{patNo} and a.times=#{times} and a.visit_dept_code=b.code " +
+            "and b.si_caty=c.code")
+    MzVisit selectMzVisitInfo(@Param("patNo") String patNo,
+                              @Param("times") Integer times);
+
     @Select("select a.psn_no,a.insutype,chrgBchno=a.pat_no+'_'+cast(a.times as varchar)+'_1', " +
             "medOrgOrd=a.pat_no+'_'+cast(a.times as varchar)+'_'+a.mdtrt_id, " +
             "b.visit_date as begntime,a.mdtrt_id,a.med_type,acctUsedFlag='0', " +

+ 12 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzFeeService.java

@@ -214,6 +214,11 @@ public class SiMzFeeService {
         if (null == feeDetails || feeDetails.isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有需要上传的费用。");
         }
+        MzVisit mzVisit = mzDao.selectMzVisitInfo(patNo, p.getTimes());
+        if (null == mzVisit || StringUtil.isBlank(mzVisit.getVisitDeptCode())) {
+            log.info("【{},{}】就诊科室没有匹配医保码,无法使用门诊统筹。", patNo, p.getTimes());
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "就诊科室没有匹配医保码,无法使用门诊统筹。");
+        }
         String batchNo = patNo + "_" + p.getTimes();
         feeDetails.forEach(item -> {
             item.setMdtrtId(siPatInfo.getMdtrtId());
@@ -221,6 +226,8 @@ public class SiMzFeeService {
             item.setChrgBchno(batchNo);
             item.setRxCircFlag(YesOrNo.NO.getCodeStr());
             item.setHospApprFlag(YesOrNo.YES.getCodeStr());
+            item.setBilgDeptCodg(mzVisit.getVisitDeptCode());
+            item.setBilgDeptName(mzVisit.getVisitDeptName());
             if (siPatInfo.getMedType().equals("51")) {
                 item.setMatnFeeFlag("1");
             }
@@ -658,6 +665,11 @@ public class SiMzFeeService {
         return outpatientSettlement(mzptnt);
     }
 
+    public ResultVo<Integer> isPatientDuringSiSettle(String patientId) {
+        int result =  MzgjUtil.inProcessing(patientId) ? 1 : 0;
+        return ResultVoUtil.success(result);
+    }
+
 //    public ResultVo<String> payOnline(EcTokenParams params) {
 //
 //

+ 2 - 2
src/main/resources/application.yml

@@ -12,8 +12,8 @@ spring:
   thymeleaf:
     cache: false
   datasource:
-    url: jdbc:jtds:sqlserver://172.16.32.168:1433/thxyhisdb
-#    url: jdbc:jtds:sqlserver://172.16.32.179:1433/thxyhisdb
+#    url: jdbc:jtds:sqlserver://172.16.32.168:1433/thxyhisdb
+    url: jdbc:jtds:sqlserver://172.16.32.179:1433/thxyhisdb
     hikari:
       username: sa
       password: