浏览代码

Merge branch 'master' of https://172.16.32.165/lighter/web-server

xiaochan 3 月之前
父节点
当前提交
d849053c76

+ 3 - 3
src/main/java/thyyxxk/webserver/constants/sidicts/PsnIdetType.java

@@ -82,9 +82,9 @@ public enum PsnIdetType {
         if (StringUtil.isBlank(code)) {
             return null;
         }
-        for (PsnIdetType patnCertType : PsnIdetType.values()) {
-            if (code.trim().equals(patnCertType.getCode())) {
-                return patnCertType.getName();
+        for (PsnIdetType psnIdetType : PsnIdetType.values()) {
+            if (code.trim().equals(psnIdetType.getCode())) {
+                return psnIdetType.getName();
             }
         }
         return null;

+ 12 - 0
src/main/java/thyyxxk/webserver/constants/sidicts/PsnType.java

@@ -60,4 +60,16 @@ public enum PsnType {
         }
         return null;
     }
+
+    public static String getName(String code) {
+        if (StringUtil.isBlank(code)) {
+            return null;
+        }
+        for (PsnType psnType : PsnType.values()) {
+            if (code.trim().equals(psnType.getCode())) {
+                return psnType.getName();
+            }
+        }
+        return null;
+    }
 }

+ 9 - 1
src/main/java/thyyxxk/webserver/controller/medicalinsurance/MarkMtFeesController.java

@@ -13,6 +13,7 @@ import thyyxxk.webserver.entity.medicalinsurance.onlinepayment.EcToken;
 import thyyxxk.webserver.entity.medicalinsurance.outpatient.MzPatientInfo;
 import thyyxxk.webserver.entity.medicalinsurance.outpatient.SpcChrDiseAcct;
 import thyyxxk.webserver.entity.medicalinsurance.query.BscQryPrm;
+import thyyxxk.webserver.entity.medicalinsurance.query.PsnBaseInfo;
 import thyyxxk.webserver.entity.medicalinsurance.setlinfo.FundDetail;
 import thyyxxk.webserver.service.medicalinsurance.SiMzService;
 import thyyxxk.webserver.service.medicalinsurance.SiQueryService;
@@ -108,10 +109,17 @@ public class MarkMtFeesController {
     @PassToken
     @PostMapping("/queryInsuinfo")
     public Map<String, Object> queryInsuinfo(@RequestBody SiMzBusinessParams param) {
-        log.info("门诊查询参保信息:{}", JSONObject.toJSON(param));
+        log.info("门诊查询有无参保信息:{}", JSONObject.toJSON(param));
         return mzService.queryInsuinfo(param);
     }
 
+    @PassToken
+    @PostMapping("/queryInsuinfoDetail")
+    public ResultVo<PsnBaseInfo> queryInsuinfoDetail(@RequestBody SiMzBusinessParams param) {
+        log.info("门诊查询参保信息详情:{}", JSONObject.toJSON(param));
+        return mzService.queryInsuinfoDetail(param);
+    }
+
     @PassToken
     @PostMapping("/directRegistration")
     public Map<String, Object> directRegistration(@RequestBody SiMzBusinessParams param) {

+ 6 - 0
src/main/java/thyyxxk/webserver/dao/his/inpatient/PatientDao.java

@@ -63,6 +63,8 @@ public interface PatientDao {
             "admissPhysician=rtrim(a.admiss_physician),b.psn_cert_type, " +
             "insutype=(select top 1 insutype from t_si_pat_info with(nolock) where pat_no=#{inpatientNo} and " +
             "times=a.admiss_times order by ledger_sn desc), " +
+            "psnType=(select max(psn_type) from t_si_pat_info with(nolock) where pat_no=#{inpatientNo} and times=a.admiss_times), " +
+            "psnIdetType=(select max(psn_idet_type) from t_si_pat_info with(nolock) where pat_no=#{inpatientNo} and times=a.admiss_times), " +
             "admissPhysicianName=rtrim((select name FROM a_employee_mi WHERE code = a.admiss_physician)), " +
             "referPhysician=rtrim(a.refer_physician), " +
             "referPhysicianName=rtrim((select name FROM a_employee_mi WHERE code = a.refer_physician)), " +
@@ -103,6 +105,10 @@ public interface PatientDao {
             "</script>")
     Patient getPatientInfo(@Param("inpatientNo") String inpatientNo, @Param("table") String table, @Param("times") Integer times);
 
+    @Select("select max(insuplc_admdvs) from t_si_pat_info where pat_no=#{patNo} " +
+            "and times=#{times} and ledger_sn=#{ledgerSn}")
+    Integer getPatAdmdvs(String patNo, int times, int ledgerSn);
+
     @Select("select parent_code from t_region where code=#{code}")
     Integer selectParentRegion(Integer code);
 

+ 0 - 12
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiQueryDao.java

@@ -560,16 +560,4 @@ public interface SiQueryDao {
             "#{yearPreSelfPayMz},#{yearBigAmtpaysZy},#{yearBigAmtpaysMz},#{yearBigdssFundPayAmtZy},#{yearBigdssFundPayAmtMz}," +
             "#{yearMafPayAmtZy},#{yearMafPayAmtMz},#{yearAcctPayZy},#{yearAcctPayMz})")
     void insertCumInfo(CuminfoInYear cuminfo);
-
-    @Select("select detail_sn from zy_detail_charge where inpatient_no=#{zyh} and admiss_times=#{times} " +
-            "and ledger_sn=#{ledger} and trans_flag_yb=1 and solid is null")
-    List<Integer> getUnsolidSn(String zyh, int times, int ledger);
-
-    @Select("select count(1) from zy_detail_charge where inpatient_no=#{zyh} and admiss_times=#{times} " +
-            "and ledger_sn=#{ledger} and solid=1")
-    Integer getDbSolidSize(String zyh, int times, int ledger);
-
-    @Select("select count(1) from zy_detail_charge where inpatient_no=#{zyh} and admiss_times=#{times} " +
-            "and ledger_sn=#{ledger} and trans_flag_yb=1")
-    Integer getDbUploadedSize(String zyh, int times, int ledger);
 }

+ 1 - 5
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiZyDao.java

@@ -86,7 +86,7 @@ public interface SiZyDao {
      * @param admissTimes 住院次数
      * @param ledgerSn    账页号
      */
-    @Update("update zy_detail_charge set trans_flag_yb=0,solid=null where inpatient_no=#{inpatientNo} and " +
+    @Update("update zy_detail_charge set trans_flag_yb=0 where inpatient_no=#{inpatientNo} and " +
             "admiss_times=#{admissTimes} and ledger_sn=#{ledgerSn} and isnull(trans_flag_yb,0)!=2")
     void revokeAllUploadFee(String inpatientNo, int admissTimes, int ledgerSn);
 
@@ -255,8 +255,4 @@ public interface SiZyDao {
     @Update("update t_si_sign_in set sign_no=#{signNo}, " +
             "sign_date=getdate() where id='medInsurSignIn'")
     void updateSignNo(String signNo);
-
-    @Update("update zy_detail_charge set solid=1 where inpatient_no=#{zyh} " +
-            "and admiss_times=#{times} and ledger_sn=#{ledger} and trans_flag_yb=1")
-    void solidifyPatFees(String zyh, int times, int ledger);
 }

+ 4 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/patient/Patient.java

@@ -76,6 +76,10 @@ public class Patient {
     private String medTypeName;
     private String insutype;
     private String insutypeName;
+    private String psnType;
+    private String psnTypeName;
+    private String psnIdetType;
+    private String psnIdetTypeName;
     private Integer admdvs;
     private Integer[] admdvsCascader;
     private String matnType; // 生育类别

+ 7 - 2
src/main/java/thyyxxk/webserver/service/inpatient/PatientService.java

@@ -12,8 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
 import thyyxxk.webserver.config.exception.BizException;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.constants.Capacity;
-import thyyxxk.webserver.constants.sidicts.MedType;
-import thyyxxk.webserver.constants.sidicts.PsnCertType;
+import thyyxxk.webserver.constants.sidicts.*;
 import thyyxxk.webserver.dao.his.inpatient.PatientDao;
 import thyyxxk.webserver.dao.his.inpatient.Routines;
 import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
@@ -73,6 +72,9 @@ public class PatientService {
         if (null == data) {
             return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有住院号【" + inpatientNo + "】的在院业务!");
         }
+        if (null == data.getAdmdvs()) {
+            data.setAdmdvs(dao.getPatAdmdvs(data.getInpatientNo(), data.getAdmissTimes(), data.getLedgerSn()));
+        }
         if (null != data.getAdmdvs()) {
             Integer parentRegion = dao.selectParentRegion(data.getAdmdvs());
             if (null != parentRegion) {
@@ -218,6 +220,9 @@ public class PatientService {
      */
     private void setExpenseInformation(@NotNull Patient data) {
         data.setMedTypeName(MedType.getName(data.getMedType()));
+        data.setInsutypeName(Insutype.getName(data.getInsutype()));
+        data.setPsnTypeName(PsnType.getName(data.getPsnType()));
+        data.setPsnIdetTypeName(PsnIdetType.getName(data.getPsnIdetType()));
         data.setDutyNurseName(userCache.getEmployeeName(data.getDutyNurse()));
 
         HuanZheFeiYong feiYongZhanBi = yiZhuLuRuDao.feiYongXinXi(data.getInpatientNo(), data.getAdmissTimes(), data.getLedgerSn());

+ 21 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiMzService.java

@@ -488,7 +488,7 @@ public class SiMzService {
         InsuInfo insuInfo = getResidantOrEmployeeInsuInfo(psninfo.getInsuinfo());
         if (null == insuInfo) {
             result.put("code", -1);
-            result.put("msg", "患者没有职工医保,如需报销请走医保科流程。");
+            result.put("msg", "患者没有职工医保或居民医保,无法报销。");
             return result;
         }
 
@@ -513,6 +513,26 @@ public class SiMzService {
         return result;
     }
 
+    public ResultVo<PsnBaseInfo> queryInsuinfoDetail(SiMzBusinessParams param) {
+        QryPsnBsInfo mzptnt = new QryPsnBsInfo();
+        mzptnt.setStaffId(param.getStaffId());
+        mzptnt.setPatNo(param.getPatientId());
+        mzptnt.setMedType(MedType.GENERAL_CLINIC.getCode());
+        mzptnt.setOnlyQry(1);
+        mzptnt.setTimes(-1);
+        if (StringUtil.notBlank(param.getAdmdvs())) {
+            mzptnt.setAdmdvs(param.getAdmdvs());
+        }
+        ResultVo<PsnBaseInfo> baseInfo = qryService.obtainBasicPersonInfo(mzptnt);
+        if (null == baseInfo) {
+            throw new BizException(ExceptionEnum.NETWORK_ERROR);
+        }
+        if (!Objects.equals(baseInfo.getCode(), ExceptionEnum.SUCCESS.getCode())) {
+            throw new BizException(ExceptionEnum.NETWORK_ERROR, baseInfo.getMessage());
+        }
+        return baseInfo;
+    }
+
     private InsuInfo getResidantOrEmployeeInsuInfo(List<InsuInfo> list) {
         for (InsuInfo info : list) {
             Insutype insutype = Insutype.get(info.getInsutype());

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

@@ -279,7 +279,6 @@ public class SiZyService {
                 balance = "0";
             }
             patientDao.updateZyActPatientBalance(p.getInpatientNo(), balance);
-            dao.solidifyPatFees(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
             return "患者【" + p.getName() + "】院内总费用与医保中心总费用一致,医保报销金额为:¥ " + fundPay + "。";
         }
         throw new BizException(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
@@ -292,17 +291,7 @@ public class SiZyService {
         }
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.REVOKE_HOSPITALIZATION_FEE_DETAILS, siPatInfo.getInsuplcAdmdvs());
         JSONArray data = new JSONArray();
-        Integer dbUploadedSize = queryDao.getDbUploadedSize(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (ListUtil.isBlank(p.getDetailSns())) {
-            List<Integer> unsolidSns = queryDao.getUnsolidSn(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
-            if (Objects.equals(dbUploadedSize, unsolidSns.size())) {
-                unsolidSns = null;
-            }
-            p.setDetailSns(unsolidSns);
-        }
-        Integer dbSolidSize = queryDao.getDbSolidSize(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
-        if (ListUtil.isBlank(p.getDetailSns()) || Objects.equals(dbSolidSize, dbUploadedSize)) {
-            p.setDetailSns(null);
             JSONObject item = new JSONObject();
             item.put("feedetl_sn", "0000");
             item.put("mdtrt_id", siPatInfo.getMdtrtId());

+ 0 - 3
update/2025-08-11.md

@@ -1,3 +0,0 @@
-```sql
-alter table zy_detail_charge add solid smallint
-```