瀏覽代碼

添加诊间是否使用医保查询

lighter 2 年之前
父節點
當前提交
4c4987915e

+ 24 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/controller/SiMzApiController.java

@@ -0,0 +1,24 @@
+package thyyxxk.simzfeeoprnsystm.controller;
+
+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;
+import thyyxxk.simzfeeoprnsystm.pojo.MzVisit;
+import thyyxxk.simzfeeoprnsystm.pojo.ResultVo;
+import thyyxxk.simzfeeoprnsystm.service.SiMzApiMariadbService;
+
+@RestController
+@RequestMapping("/siMzApi")
+public class SiMzApiController {
+    private final SiMzApiMariadbService mzApiMariadbService;
+
+    public SiMzApiController(SiMzApiMariadbService mzApiMariadbService) {
+        this.mzApiMariadbService = mzApiMariadbService;
+    }
+
+    @PostMapping("/getZgmztczf")
+    public ResultVo<Integer> getZgmztczf(@RequestBody MzVisit mzVisit) {
+        return mzApiMariadbService.getZgmztczf(mzVisit);
+    }
+}

+ 1 - 1
src/main/java/thyyxxk/simzfeeoprnsystm/dao/ScheduledDao.java

@@ -10,7 +10,7 @@ import java.util.List;
 @Mapper
 public interface ScheduledDao {
     @Select("select pat_no,times,ledger_sn,setl_id,mdtrt_id,psn_no from t_si_setlinfo where setl_type=11 " +
-            "and revoked=0 and datediff(hour, endtime, getdate()) between 12 and 72 ")
+            "and revoked=0 and mz_saved=0 and datediff(hour, endtime, getdate()) between 12 and 72 ")
     List<SiSetlinfo> selectSetlinfos();
 
     @Select("select count(1) from mz_deposit_file WITH(NOLOCK) where patient_id=#{patNo} and times=#{times} and pay_mark=0")

+ 5 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/dao/mariadb/MariadbDao.java

@@ -2,10 +2,15 @@ package thyyxxk.simzfeeoprnsystm.dao.mariadb;
 
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import thyyxxk.simzfeeoprnsystm.pojo.MzVisit;
 
 @Mapper
 public interface MariadbDao {
 
     @Insert("insert into t_si_failed_sql (sql_content) value (#{sql}) ")
     void insertNewRecord(String sql);
+
+    @Select("select zgmztczf from t_clinic where patient_id=#{patientId} and times=#{times} and receipt_no=#{receiptNo}")
+    Integer selectZgmztczf(MzVisit mzVisit);
 }

+ 4 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/MzVisit.java

@@ -21,4 +21,8 @@ public class MzVisit {
     private Integer receiveFlag;
     private String icdText;
     private String responceType;
+
+    public String getPatientId() {
+        return null == patientId ? "" : patientId.trim();
+    }
 }

+ 29 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzApiMariadbService.java

@@ -0,0 +1,29 @@
+package thyyxxk.simzfeeoprnsystm.service;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.springframework.stereotype.Service;
+import thyyxxk.simzfeeoprnsystm.dao.mariadb.MariadbDao;
+import thyyxxk.simzfeeoprnsystm.pojo.MzVisit;
+import thyyxxk.simzfeeoprnsystm.pojo.ResultVo;
+import thyyxxk.simzfeeoprnsystm.utils.ResultVoUtil;
+
+@DS("thmz")
+@Service
+public class SiMzApiMariadbService {
+    private final MariadbDao dao;
+
+    public SiMzApiMariadbService(MariadbDao dao) {
+        this.dao = dao;
+    }
+
+    public ResultVo<Integer> getZgmztczf(MzVisit mzVisit) {
+        if (null == mzVisit.getReceiptNo()) {
+            mzVisit.setReceiptNo(1);
+        }
+        Integer zgmztczf = dao.selectZgmztczf(mzVisit);
+        if (null == zgmztczf) {
+            zgmztczf = 0;
+        }
+        return ResultVoUtil.success(zgmztczf);
+    }
+}

+ 4 - 3
src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzFeeService.java

@@ -54,9 +54,9 @@ public class SiMzFeeService {
     }
 
     public ResultVo<String> outpatientRegistration(MzPatientInfo p) {
-        if (p.getInsuplcAdmdvs().equals("430182") && !Objects.equals("11", p.getMedType())) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "宁乡参保地区的患者我院只能办理普门医保业务,其他类别的业务暂不支持。");
-        }
+//        if (p.getInsuplcAdmdvs().equals("430182") && !Objects.equals("11", p.getMedType())) {
+//            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "宁乡参保地区的患者我院只能办理普门医保业务,其他类别的业务暂不支持。");
+//        }
         Regstrtn regstrtn = mzDao.selectRegstrtn(p.getPatNo(), p.getTimes());
         if (null == regstrtn) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "mz_visit_table患者信息为空,请联系医生重开处方。");
@@ -700,6 +700,7 @@ public class SiMzFeeService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, upldFeeRes.getMessage());
         }
         // 上传完成之后结算并返回结算结果
+        mzptnt.setReadCardBizType(ReadCardBizType.SETTLEMENT.getCode());
         return outpatientSettlement(mzptnt);
     }