Browse Source

新医保业务

lighter 4 years ago
parent
commit
72107ffec0

+ 53 - 1
src/main/java/thyyxxk/webserver/controller/markmtfees/MarkMtFeesController.java

@@ -1,13 +1,19 @@
 package thyyxxk.webserver.controller.markmtfees;
 
+import com.sun.xml.bind.v2.TODO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.config.auth.PassToken;
+import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.markmtfees.*;
+import thyyxxk.webserver.entity.medicalinsurance.outpatient.MzPatientInfo;
+import thyyxxk.webserver.entity.medicalinsurance.setlinfo.FundDetail;
 import thyyxxk.webserver.service.markmtfees.MarkMtFeesService;
+import thyyxxk.webserver.service.medicalinsurance.SiMzService;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -15,10 +21,12 @@ import java.util.Map;
 @RequestMapping("/markMtFees")
 public class MarkMtFeesController {
     private final MarkMtFeesService service;
+    private final SiMzService mzService;
 
     @Autowired
-    public MarkMtFeesController(MarkMtFeesService service) {
+    public MarkMtFeesController(MarkMtFeesService service, SiMzService mzService) {
         this.service = service;
+        this.mzService = mzService;
     }
 
     @PostMapping("/queryMtPersonInfo")
@@ -55,6 +63,28 @@ public class MarkMtFeesController {
     @PassToken
     @PostMapping("/uploadFees")
     public Map<String, Object> uploadMtFees(@RequestBody UploadMtFeeParam param) {
+//        TODO 新医保上线后启用下面注释的部分
+//        MzPatientInfo mz = new MzPatientInfo();
+//        mz.setPatNo(param.getPatientId());
+//        mz.setTimes(param.getTimes());
+//        mz.setStaffId(param.getStaffId());
+//        ResultVo<FundDetail> result = mzService.outpatientPreSettlement(mz);
+//        Map<String, Object> map = new HashMap<>();
+//        if (result.getCode() != ExceptionEnum.SUCCESS.getCode()) {
+//            map.put("code", -1);
+//            map.put("msg", result.getMessage());
+//            return map;
+//        }
+//        FundDetail fund = result.getData();
+//        map.put("code", 0);
+//        Map<String, Double> payInfo = new HashMap<>();
+//        payInfo.put("cashPay", fund.getCashPay());
+//        payInfo.put("selfPay", fund.getSelfPay());
+//        payInfo.put("acctPay", fund.getAcctPay());
+//        payInfo.put("fundPay", fund.getFundPay());
+//        payInfo.put("totalCost", fund.getTotalCost());
+//        map.put("payInfo", payInfo);
+//        return map;
         return service.uploadMtFees(param);
     }
 
@@ -67,6 +97,28 @@ public class MarkMtFeesController {
     @PassToken
     @PostMapping("/calculateCost")
     public Map<String, Object> calculateMtFees(@RequestBody UploadMtFeeParam param) {
+        //        TODO 新医保上线后启用下面注释的部分
+//        MzPatientInfo mz = new MzPatientInfo();
+//        mz.setPatNo(param.getPatientId());
+//        mz.setTimes(param.getTimes());
+//        mz.setStaffId(param.getStaffId());
+//        ResultVo<FundDetail> result = mzService.outpatientSettlement(mz);
+//        Map<String, Object> map = new HashMap<>();
+//        if (result.getCode() != ExceptionEnum.SUCCESS.getCode()) {
+//            map.put("code", -1);
+//            map.put("msg", result.getMessage());
+//            return map;
+//        }
+//        FundDetail fund = result.getData();
+//        map.put("code", 0);
+//        Map<String, Double> payInfo = new HashMap<>();
+//        payInfo.put("cashPay", fund.getCashPay());
+//        payInfo.put("selfPay", fund.getSelfPay());
+//        payInfo.put("acctPay", fund.getAcctPay());
+//        payInfo.put("fundPay", fund.getFundPay());
+//        payInfo.put("totalCost", fund.getTotalCost());
+//        map.put("payInfo", payInfo);
+//        return map;
         return service.calculateMtFees(param);
     }
 

+ 14 - 0
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiChargeTempDao.java

@@ -0,0 +1,14 @@
+package thyyxxk.webserver.dao.his.medicalinsurance;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import thyyxxk.webserver.entity.medicalinsurance.inpatient.SiChargeTemp;
+
+/**
+ * @description: 医保收费临时表
+ * @author: DingJie
+ * @create: 2021/8/2514:53
+ */
+@Mapper
+public interface SiChargeTempDao extends BaseMapper<SiChargeTemp> {
+}

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

@@ -136,8 +136,8 @@ public interface SiQueryDao {
             "from t_si_setlinfo where pat_no=#{patNo} and times=#{times} and isnull(revoked,0)!=1")
     List<SetlIndex> selectSetlIndex(QrySetlListPrm q);
 
-    @Select("select a.setl_id,a.psn_name,a.gend,a.brdy,c.social_no,a.pat_no, " +
-            "a.age,rtrim(c.home_street) as addr,rtrim(home_tel) as tel, " +
+    @Select("select a.mdtrt_id,a.setl_id,a.psn_name,a.gend,a.brdy,c.social_no,a.pat_no, " +
+            "a.age,rtrim(c.home_street) as addr,rtrim(home_tel) as tel,a.psn_no, " +
             "admDeptName=(select rtrim(name) from zd_unit_code where code=d.small_dept), " +
             "rtrim(d.bed_no) as bedNo,d.admiss_date as admDate,d.dis_date, " +
             "inHospDays=datediff(day,d.admiss_date,d.dis_date), " +
@@ -179,7 +179,7 @@ public interface SiQueryDao {
                                          @Param("ledgerSn") int ledgerSn);
 
     @Select("select a.mdtrt_id,a.psn_name,a.gend,a.age,a.cvlserv_flag,a.psn_type, " +
-            "b.emp_name,a.certno,a.med_type,b.dise_code,a.medfee_sumamt, " +
+            "b.emp_name,a.certno,a.med_type,b.dise_code,a.medfee_sumamt,a.psn_no, " +
             "a.hifp_pay,a.acct_pay,a.cvlserv_pay,a.psn_cash_pay, " +
             "a.hifmi_pay,a.maf_pay,a.hifob_pay,a.oth_pay,a.staff_id, " +
             "staffName=(select rtrim(name) from a_employee_mi where code=staff_id) " +

+ 90 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/inpatient/SiChargeTemp.java

@@ -0,0 +1,90 @@
+package thyyxxk.webserver.entity.medicalinsurance.inpatient;
+
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import java.util.Date;
+
+@Data
+@TableName(value = "t_si_charge_temp")
+public class SiChargeTemp implements Serializable {
+
+	private static final long serialVersionUID =  5807450942222977192L;
+
+	/**
+	 * 住院号
+	 */
+	private String patNo;
+
+	/**
+	 * 住院次数
+	 */
+	private Integer times;
+
+	/**
+	 * 账页号
+	 */
+	private Integer ledgerSn;
+
+	/**
+	 * 收费流水号
+	 */
+	private Integer detailSn;
+
+	/**
+	 * 收费时间
+	 */
+	private Date chargeDate;
+
+	/**
+	 * 收费编码
+	 */
+	private String chargeCode;
+
+	/**
+	 * 金额
+	 */
+	private String chargeFee;
+
+	/**
+	 * 数量
+	 */
+	private Double chargeAmt;
+
+	/**
+	 * 退费的原收费流水号
+	 */
+	private Integer oriDetailSn;
+
+	/**
+	 * 收费项目等级
+	 */
+	private String chrgitemLv;
+
+	/**
+	 * 收费项目类别
+	 */
+	private String medChrgitmType;
+
+	/**
+	 * 自付比例
+	 */
+	private String selfpayProp;
+
+	/**
+	 * 全自费金额
+	 */
+	private String fulamtOwnpayAmt;
+
+	/**
+	 * 先行自付金额
+	 */
+	private String preselfpayAmt;
+
+	/**
+	 * 符合政策范围金额
+	 */
+	private String inscpScpAmt;
+
+}

+ 46 - 1
src/main/java/thyyxxk/webserver/entity/medicalinsurance/query/FeeDetl.java

@@ -41,6 +41,41 @@ public class FeeDetl {
      * */
     private Double pric;
 
+    /**
+     * 明细项目费用总额
+     * */
+    private Double detItemFeeSumamt;
+
+    /**
+     * 自付比例
+     * */
+    private Double selfpayProp;
+
+    /**
+     * 全自费金额
+     * */
+    private Double fulamtOwnpayAmt;
+
+    /**
+     * 超限价金额
+     * */
+    private Double overlmtAmt;
+
+    /**
+     * 先行自付金额
+     * */
+    private Double preselfpayAmt;
+
+    /**
+     * 符合政策范围金额
+     * */
+    private Double inscpScpAmt;
+
+    /**
+     * 收费项目等级
+     * */
+    private String chrgitmLv;
+
     /**
      * 医保目录编码
      * */
@@ -51,6 +86,11 @@ public class FeeDetl {
      * */
     private String hilistName;
 
+    /**
+     * 目录类别
+     * */
+    private String listType;
+
     /**
      * 医疗目录编码
      * */
@@ -66,10 +106,15 @@ public class FeeDetl {
      * */
     private String medinsListName;
 
+    /**
+     * 医疗收费项目类别
+     * */
+    private String medChrgitmType;
+
     /**
      * 开单科室
      * */
-    private String bilg_dept_name;
+    private String bilgDeptName;
 
     /**
      * 开单医生

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/setllist/OtptntSetlmtLst.java

@@ -24,6 +24,8 @@ public class OtptntSetlmtLst {
      * */
     private String psnName;
 
+    private String psnNo;
+
     /**
      * 性别
      * */

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/setllist/YzsInptntSetlmtLst.java

@@ -13,7 +13,9 @@ import java.util.Date;
  */
 @Data
 public class YzsInptntSetlmtLst {
+    private String mdtrtId;
     private String setlId;
+    private String psnNo;
     private String psnName;
     private String gend;
     private String gendName;

+ 41 - 9
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -692,8 +692,13 @@ public class SiQueryService {
             lst.setFixmedinsName(SiUtil.INSTITUTION_NAME);
             lst.setGendName(index.getGendName());
             SiEnumReflectUtil.inptntSetlmtLstReflect(lst);
-            List<BrfChrgitm> chrgitms = dao.selectZyBrfChrgitms(index.getPatNo(), index.getTimes(), index.getLedgerSn());
-            analyzeZyChrgitm(lst, chrgitms);
+
+
+            ResultVo<List<FeeDetl>> chrgrsvo = getChrgitems(lst.getPsnNo(), lst.getSetlId(), lst.getMdtrtId());
+            if (chrgrsvo.getCode() != ExceptionEnum.SUCCESS.getCode()) {
+                return chrgrsvo;
+            }
+            analyzeZyChrgitm(lst, chrgrsvo.getData());
             lst.setYrAdmtimes(cuminfo.getYearAdmtimes());
             lst.setYrMedfeeSumamt(cuminfo.getYearMedfeesum());
             lst.setYrPayedBegnLine(cuminfo.getYearPayedBegnline());
@@ -862,27 +867,54 @@ public class SiQueryService {
         return cuminfo;
     }
 
-    private void analyzeZyChrgitm(InptntSetlmtLst lst, List<BrfChrgitm> chrgitms) {
+    private ResultVo<List<FeeDetl>> getChrgitems(String psnNo, String setlId, String mdtrtId) {
+        JSONObject input = exec.makeTradeHeader(SiFunction.QUERY_FEE_DETAILS);
+        JSONObject data = new JSONObject();
+        data.put("psn_no", psnNo);
+        data.put("setl_id", setlId);
+        data.put("mdtrt_id", mdtrtId);
+        input.getJSONObject("input").put("data", data);
+        JSONObject result = exec.executeTrade(input, SiFunction.QUERY_FEE_DETAILS);
+        if (null == result) {
+            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
+        }
+        if (result.getIntValue(RESULT_CODE) == 0) {
+            JSONArray output = result.getJSONArray(OUTPUT);
+            if (null == output || output.size() == 0) {
+                return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有查询到费用明细。");
+            }
+            List<FeeDetl> list = new ArrayList<>();
+            for (int i = 0; i < output.size(); i++) {
+                JSONObject obj = output.getJSONObject(i);
+                FeeDetl item = JSONObject.parseObject(obj.toJSONString(), FeeDetl.class);
+                list.add(item);
+            }
+            return ResultVoUtil.success(list);
+        }
+        return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, result.getString(ERROR_MESSAGE));
+    }
+
+    private void analyzeZyChrgitm(InptntSetlmtLst lst, List<FeeDetl> chrgitms) {
         Map<String, Double> map = new HashMap<>();
         map.put("totalFrst", 0d);
         map.put("totalScnd", 0d);
         chrgitms.forEach(itm -> {
             if (itm.getChrgitmLv().equals(ChrgitmLv.FIRST_CLASS.getCode())) {
-                map.replace("totalFrst", map.get("totalFrst") + itm.getChargeFee());
+                map.replace("totalFrst", map.get("totalFrst") + itm.getDetItemFeeSumamt());
             } else if (itm.getChrgitmLv().equals(ChrgitmLv.SECOND_CLASS.getCode())) {
-                map.replace("totalScnd", map.get("totalScnd") + itm.getChargeFee());
+                map.replace("totalScnd", map.get("totalScnd") + itm.getDetItemFeeSumamt());
             }
             String typeKey = itm.getMedChrgitmType();
             String lvKey = typeKey + "-" + itm.getChrgitmLv();
             if (map.containsKey(typeKey)) {
-                map.replace(typeKey, map.get(typeKey) + itm.getChargeFee());
+                map.replace(typeKey, map.get(typeKey) + itm.getDetItemFeeSumamt());
             } else {
-                map.put(typeKey, itm.getChargeFee());
+                map.put(typeKey, itm.getDetItemFeeSumamt());
             }
             if (map.containsKey(lvKey)) {
-                map.replace(lvKey, map.get(lvKey) + itm.getChargeFee());
+                map.replace(lvKey, map.get(lvKey) + itm.getDetItemFeeSumamt());
             } else {
-                map.put(lvKey, itm.getChargeFee());
+                map.put(lvKey, itm.getDetItemFeeSumamt());
             }
         });
         lst.setAllfeeSum(map.get("totalFrst") + map.get("totalScnd"));

+ 52 - 38
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -2,6 +2,7 @@ package thyyxxk.webserver.service.medicalinsurance;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
@@ -11,10 +12,7 @@ import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.constants.Capacity;
 import thyyxxk.webserver.constants.sidicts.*;
 import thyyxxk.webserver.constants.YesOrNo;
-import thyyxxk.webserver.dao.his.medicalinsurance.SiQueryDao;
-import thyyxxk.webserver.dao.his.medicalinsurance.SiSetldetailDao;
-import thyyxxk.webserver.dao.his.medicalinsurance.SiSetlinfoDao;
-import thyyxxk.webserver.dao.his.medicalinsurance.SiZyDao;
+import thyyxxk.webserver.dao.his.medicalinsurance.*;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.*;
 import thyyxxk.webserver.entity.medicalinsurance.query.SiPatInfo;
@@ -54,23 +52,25 @@ public class SiZyService {
     private static final String ERROR_MESSAGE = "err_msg";
     private static final String OUTPUT = "output";
     private final SiZyDao dao;
-    private final SiQueryDao queryDao;
-    private final SiSetlinfoDao setlinfoDao;
-    private final SiSetldetailDao setldetailDao;
+    private final SiQueryDao qrydao;
+    private final SiSetlinfoDao setlinfodao;
+    private final SiSetldetailDao setldetldao;
+    private final SiChargeTempDao chrgtmpdao;
     private final ExecService exec;
     private final SettleService settleService;
     private final DismissService dismissService;
     private final XiangMuLuRuService xmlrService;
 
     @Autowired
-    public SiZyService(SiZyDao dao, SiQueryDao queryDao, SiSetlinfoDao setlinfoDao,
-                       SiSetldetailDao setldetailDao, ExecService exec,
+    public SiZyService(SiZyDao dao, SiQueryDao qrydao, SiSetlinfoDao setlinfoDao,
+                       SiSetldetailDao setldetldao, SiChargeTempDao chrgtmpdao, ExecService exec,
                        SettleService settleService, DismissService dismissService,
                        XiangMuLuRuService xmlrService) {
         this.dao = dao;
-        this.queryDao = queryDao;
-        this.setlinfoDao = setlinfoDao;
-        this.setldetailDao = setldetailDao;
+        this.qrydao = qrydao;
+        this.setlinfodao = setlinfoDao;
+        this.setldetldao = setldetldao;
+        this.chrgtmpdao = chrgtmpdao;
         this.exec = exec;
         this.settleService = settleService;
         this.dismissService = dismissService;
@@ -148,7 +148,7 @@ public class SiZyService {
     }
 
     public ResultVo<String> revokeAdmission(ZyPatientInfo p) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        SiPatInfo siPatInfo = qrydao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (null == siPatInfo || StringUtil.isBlank(siPatInfo.getMdtrtId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的医保在院信息!");
         }
@@ -163,14 +163,14 @@ public class SiZyService {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
         if (result.getIntValue(RESULT_CODE) == 0) {
-            queryDao.clearMdtrtIdForZy(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(), null);
+            qrydao.clearMdtrtIdForZy(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(), null);
             return ResultVoUtil.success("取消入院登记成功。");
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
     }
 
     public ResultVo<String> uploadFeeDetail(Overview o) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(o.getInpatientNo(), o.getAdmissTimes(), o.getLedgerSn());
+        SiPatInfo siPatInfo = qrydao.selectSiPatInfoForZy(o.getInpatientNo(), o.getAdmissTimes(), o.getLedgerSn());
         if (null == siPatInfo || StringUtil.isBlank(siPatInfo.getMdtrtId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的医保在院信息!");
         }
@@ -237,26 +237,33 @@ public class SiZyService {
         log.info("【操作员:{}】,医保费用上传:参数:{},结果:{}", TokenUtil.getTokenUserId(), input, result);
         if (null != result) {
             if (result.getIntValue(RESULT_CODE) == 0) {
+                dao.updateTransFlag(p.getInpatientNo(), p.getAdmissTimes(), fees);
                 JSONArray array = result.getJSONObject(OUTPUT).getJSONArray("result");
                 for (int i = 0; i < array.size(); i++) {
+                    SiChargeTemp chrgtemp = new SiChargeTemp();
+                    chrgtemp.setPatNo(p.getInpatientNo());
+                    chrgtemp.setTimes(p.getAdmissTimes());
+                    chrgtemp.setLedgerSn(p.getLedgerSn());
                     JSONObject upldretrn = array.getJSONObject(i);
-                    String feedetlSn = upldretrn.getString("feedetl_sn");
-                    int detailSn = Integer.parseInt(feedetlSn);
-                    Double sum = upldretrn.getDouble("det_item_fee_sumamt");
-                    Double cnt = upldretrn.getDouble("cnt");
-                    Double pric = upldretrn.getDouble("pric");
-                    Double inscpScpAmt = upldretrn.getDouble("inscp_scp_amt");
-                    if (null == inscpScpAmt) {
-                        inscpScpAmt = 0d;
-                    }
-                    Double self = upldretrn.getDouble("selfpay_prop");
-                    if (null == self) {
-                        self = 0d;
-                    }
-                    String chrglv = upldretrn.getString("chrgitm_lv");
-                    String chrgtype = upldretrn.getString("med_chrgitm_type");
-                    dao.updtZydtelchrgAftrupld(sum, cnt, pric, self, chrglv, inscpScpAmt, chrgtype,
-                            p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), detailSn);
+                    int detailSn = Integer.parseInt(upldretrn.getString("feedetl_sn"));
+                    String chargeFee = upldretrn.getString("det_item_fee_sumamt");
+                    Double chargeAmt = upldretrn.getDouble("cnt");
+                    String chrgitmLv = upldretrn.getString("chrgitm_lv");
+                    String medChrgitemType = upldretrn.getString("med_chrgitm_type");
+                    String selfpayProp = upldretrn.getString("self_pay_prop");
+                    String fulamtOwnpayAmt = upldretrn.getString("fulamt_ownpay_amt;");
+                    String preselfpayAmt = upldretrn.getString("preselfpay_amt");
+                    String inscpScpAmt = upldretrn.getString("inscp_scp_amt");
+                    chrgtemp.setDetailSn(detailSn);
+                    chrgtemp.setChargeFee(chargeFee);
+                    chrgtemp.setChargeAmt(chargeAmt);
+                    chrgtemp.setChrgitemLv(chrgitmLv);
+                    chrgtemp.setMedChrgitmType(medChrgitemType);
+                    chrgtemp.setSelfpayProp(selfpayProp);
+                    chrgtemp.setFulamtOwnpayAmt(fulamtOwnpayAmt);
+                    chrgtemp.setPreselfpayAmt(preselfpayAmt);
+                    chrgtemp.setInscpScpAmt(inscpScpAmt);
+                    chrgtmpdao.insert(chrgtemp);
                 }
             } else {
                 String message = result.getString(ERROR_MESSAGE);
@@ -301,7 +308,7 @@ public class SiZyService {
     }
 
     public ResultVo<String> revokeUploadFees(ZyPatientInfo p) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        SiPatInfo siPatInfo = qrydao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (null == siPatInfo || StringUtil.isBlank(siPatInfo.getMdtrtId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的医保在院信息!");
         }
@@ -329,9 +336,16 @@ public class SiZyService {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
         if (result.getIntValue(RESULT_CODE) == 0) {
+            QueryWrapper<SiChargeTemp> wrapper = new QueryWrapper<>();
+            wrapper.eq("pat_no", p.getInpatientNo());
+            wrapper.eq("times", p.getAdmissTimes());
+            wrapper.eq("ledger_sn", p.getLedgerSn());
             if (null == p.getDetailSns() || p.getDetailSns().isEmpty()) {
                 dao.revokeAllUploadFee(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+                chrgtmpdao.delete(wrapper);
             } else {
+                wrapper.in("detail_sn", p.getDetailSns());
+                chrgtmpdao.delete(wrapper);
                 dao.revokePartUploadFee(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), p.getDetailSns());
             }
             return ResultVoUtil.success("撤销费用上传成功。");
@@ -375,7 +389,7 @@ public class SiZyService {
     }
 
     public ResultVo<String> revokeDischarge(ZyPatientInfo p) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        SiPatInfo siPatInfo = qrydao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (null == siPatInfo) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的医保出院信息,无法撤销出院!");
         }
@@ -423,8 +437,8 @@ public class SiZyService {
             setlEntity.setLedgerSn(p.getLedgerSn());
             setlEntity.setStaffId(TokenUtil.getTokenUserId());
             setlEntity.setRevoked(YesOrNo.NO.getCode());
-            setlinfoDao.insert(setlEntity);
-            setlinfoDao.updateSiZyInfoSetlId(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(),
+            setlinfodao.insert(setlEntity);
+            setlinfodao.updateSiZyInfoSetlId(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(),
                     setlEntity.getSetlId(), setlEntity.getMedinsSetlId(), input.getString("msgid"));
             JSONArray setldetail = result.getJSONObject(OUTPUT).getJSONArray("setldetail");
             for (int i = 0; i < setldetail.size(); i++) {
@@ -432,7 +446,7 @@ public class SiZyService {
                 setldetailEntity.setPatNo(p.getInpatientNo());
                 setldetailEntity.setTimes(p.getAdmissTimes());
                 setldetailEntity.setLedgerSn(p.getLedgerSn());
-                setldetailDao.insert(setldetailEntity);
+                setldetldao.insert(setldetailEntity);
             }
             // todo 结算,需要改造,慢慢删除responceType字段
             YbSettleFee settleFee = new YbSettleFee();
@@ -460,7 +474,7 @@ public class SiZyService {
     }
 
     public ResultVo<String> revokeSettlement(ZyPatientInfo p) {
-        SiPatInfo siPatInfo = queryDao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        SiPatInfo siPatInfo = qrydao.selectSiPatInfoForZy(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
         if (null == siPatInfo || StringUtil.isBlank(siPatInfo.getSetlId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的医保结算信息,无法撤销结算!");
         }

+ 4 - 1
src/main/java/thyyxxk/webserver/service/triage/TriageService.java

@@ -179,9 +179,12 @@ public class TriageService {
     }
 
     public ResultVo<String> notifyMessage(MessageForPush param) {
-        dao.updateStatus(param.getSerialNo());
         MessageForPush prm = dao.selectMessageForPush(param.getSerialNo());
+        if (null == prm) {
+            return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有找到此患者的分诊信息!");
+        }
         prm.setAction(param.getAction());
+        dao.updateStatus(param.getSerialNo());
         log.info("消息推送>>> {}", prm);
         RestTemplate template = new RestTemplate();
         String result = template.postForObject(triageNotifyUrl, prm, String.class);

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

@@ -53,26 +53,26 @@ mybatis-plus:
   configuration:
     map-underscore-to-camel-case: true
 
-#UPLOAD_BASE: http://172.16.30.26
-#CSSYB_UPLOAD_BASE: http://172.16.30.26
-#CSSYB_BASE: http://172.16.30.26:1000/cssyb/
-#HNSYB_BASE: http://172.16.30.26:2000/hnsyb/
-#XNHYB_BASE: http://172.16.30.26:3000/xnhyb/
-#HNSYB_MT_INFO: http://172.16.30.26:2000/shengyb/mt/getPersonInfo
-#CSSYB_READ_MZ_PATIENT: http://172.16.30.26:1000/mzsyb/readPatient
-#CSSYB_MT_INFO: http://172.16.30.26:1000/mzsyb/queryApplyInfo
-#CSSYB_MT_PRE_CAL: http://172.16.30.26:1000/mzsyb/mzPreCalculate
-#PROOFREAD: http://172.16.30.26:1111/proofread/start
-UPLOAD_BASE: http://172.16.32.163
-CSSYB_UPLOAD_BASE: http://172.16.32.159
-CSSYB_BASE: http://172.16.32.159:1000/cssyb/
-HNSYB_BASE: http://172.16.32.163:2000/hnsyb/
-XNHYB_BASE: http://172.16.32.163:3000/xnhyb/
-HNSYB_MT_INFO: http://172.16.32.163:2000/shengyb/mt/getPersonInfo
-CSSYB_READ_MZ_PATIENT: http://172.16.32.159:1000/mzsyb/readPatient
-CSSYB_MT_INFO: http://172.16.32.159:1000/mzsyb/queryApplyInfo
-CSSYB_MT_PRE_CAL: http://172.16.32.159:1000/mzsyb/mzPreCalculate
-PROOFREAD: http://172.16.32.163:1111/proofread/start
+UPLOAD_BASE: http://172.16.30.26
+CSSYB_UPLOAD_BASE: http://172.16.30.26
+CSSYB_BASE: http://172.16.30.26:1000/cssyb/
+HNSYB_BASE: http://172.16.30.26:2000/hnsyb/
+XNHYB_BASE: http://172.16.30.26:3000/xnhyb/
+HNSYB_MT_INFO: http://172.16.30.26:2000/shengyb/mt/getPersonInfo
+CSSYB_READ_MZ_PATIENT: http://172.16.30.26:1000/mzsyb/readPatient
+CSSYB_MT_INFO: http://172.16.30.26:1000/mzsyb/queryApplyInfo
+CSSYB_MT_PRE_CAL: http://172.16.30.26:1000/mzsyb/mzPreCalculate
+PROOFREAD: http://172.16.30.26:1111/proofread/start
+#UPLOAD_BASE: http://172.16.32.163
+#CSSYB_UPLOAD_BASE: http://172.16.32.159
+#CSSYB_BASE: http://172.16.32.159:1000/cssyb/
+#HNSYB_BASE: http://172.16.32.163:2000/hnsyb/
+#XNHYB_BASE: http://172.16.32.163:3000/xnhyb/
+#HNSYB_MT_INFO: http://172.16.32.163:2000/shengyb/mt/getPersonInfo
+#CSSYB_READ_MZ_PATIENT: http://172.16.32.159:1000/mzsyb/readPatient
+#CSSYB_MT_INFO: http://172.16.32.159:1000/mzsyb/queryApplyInfo
+#CSSYB_MT_PRE_CAL: http://172.16.32.159:1000/mzsyb/mzPreCalculate
+#PROOFREAD: http://172.16.32.163:1111/proofread/start
 
 #si-api-url: http://10.90.0.11:8081/isp/powercsb/1101
 #si-readcard-url: http://10.90.0.23:8085/hsa-hgs-adapt/api/card/ initDll