瀏覽代碼

结算单上传

xiaochan 3 年之前
父節點
當前提交
5839aecb55

+ 5 - 0
src/main/java/thyyxxk/webserver/controller/PublicController.java

@@ -47,4 +47,9 @@ public class PublicController {
         return service.getDept();
     }
 
+    @GetMapping("/maZuiFangShi")
+    public ResultVo<List<GetDropdownBox>> maZuiFangShi() {
+        return service.maZuiFangShi();
+    }
+
 }

+ 7 - 0
src/main/java/thyyxxk/webserver/controller/medicalinsurance/SetlListUpldController.java

@@ -5,6 +5,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.config.auth.PassToken;
 import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyInactpatient;
 import thyyxxk.webserver.entity.medicalinsurance.setllistupld.UpldCollection;
 import thyyxxk.webserver.entity.querydata.JieSuanDanChaXun;
@@ -74,4 +75,10 @@ public class SetlListUpldController {
                                                             @RequestParam("ledgerSn") Integer ledgerSn) {
         return service.jieSuanDanKeXiuGaiXinXi(patNo, times, ledgerSn);
     }
+
+    @GetMapping("/shouShuBianMa")
+    public ResultVo<IPage<GetDropdownBox>> shouShuBianMa(@RequestParam("content") String content,
+                                                         @RequestParam("currentPage") long currentPage) {
+        return service.shouShuBianMa(content, currentPage);
+    }
 }

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

@@ -229,4 +229,8 @@ public interface PublicDao {
                          @Param("ledgerSn") Integer ledgerSn,
                          @Param("list") List<Integer> list);
 
+
+    @Select("select rtrim(code) code,rtrim(name) name from zd_anaesthesia")
+    List<GetDropdownBox> maZuiFangShi();
+
 }

+ 19 - 1
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/UpIdCollectionDao.java

@@ -366,7 +366,13 @@ public interface UpIdCollectionDao {
                                     @Param("times") Integer times);
 
 
-    @Select("select * from batj_ba4 where zyh = #{patNo} and zycs = #{times} ")
+    @Select("select ssys_name = (select top(1) rtrim(name) from a_employee_mi where code = ssys), " +
+            "       ssys_name1 = (select top(1) rtrim(name) from a_employee_mi where code = sszs1), " +
+            "       ssys_name2 = (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, sszs1, sszs2, mzys, ssbm, ssmc, rtrim(mzff) mzff, rtrim(qkjb) qkjb," +
+            "rtrim(yhqk) yhqk, ssbfz, fhqk, ssjb, cut_heal" +
+            " from batj_ba4 where zyh = #{patNo} and zycs = #{times} ")
     List<BatjBa4> shouShuXinXi(@Param("patNo") String patNo,
                                @Param("times") Integer times);
 
@@ -389,4 +395,16 @@ public interface UpIdCollectionDao {
             "</script>")
     List<ZyDisDiagYb> zhuZhenDuan(@Param("patNos") Set<String> patNos);
 
+
+    @Select("select top 10 rtrim(code) code, rtrim(name) name from " +
+            "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number',  * " +
+            "from zd_cm3 where (code like #{content} or name like #{content} or py_code like #{content})) a " +
+            "where a.[Number]>10*(#{page})")
+    List<GetDropdownBox> searchSurgeryByAlpha(@Param("content") String content, @Param("page") long page);
+
+
+    @Select("select count(1) from zd_cm3 where (code like #{content} or name like #{content} or py_code like #{content})")
+    long searchSurgeryTotal(@Param("content") String content);
+
+
 }

+ 104 - 97
src/main/java/thyyxxk/webserver/entity/medicalinsurance/inpatient/BatjBa4.java

@@ -1,107 +1,114 @@
 package thyyxxk.webserver.entity.medicalinsurance.inpatient;
 
-import java.io.Serializable;
 import lombok.Data;
+
+import java.io.Serializable;
 import java.util.Date;
 
 @Data
 public class BatjBa4 implements Serializable {
 
-	private static final long serialVersionUID =  2951195859758849520L;
-
-	/**
-	 * bah
-	 */
-	private String bah;
-
-	/**
-	 * zyh
-	 */
-	private String zyh;
-
-	/**
-	 * zycs
-	 */
-	private Integer zycs;
-
-	/**
-	 * ssxh
-	 */
-	private Integer ssxh;
-
-	/**
-	 * ssrq
-	 */
-	private Date ssrq;
-
-	/**
-	 * sstj
-	 */
-	private String sstj;
-
-	/**
-	 * ssys
-	 */
-	private String ssys;
-
-	/**
-	 * sszs1
-	 */
-	private String sszs1;
-
-	/**
-	 * sszs2
-	 */
-	private String sszs2;
-
-	/**
-	 * mzys
-	 */
-	private String mzys;
-
-	/**
-	 * ssbm
-	 */
-	private String ssbm;
-
-	/**
-	 * ssmc
-	 */
-	private String ssmc;
-
-	/**
-	 * mzff
-	 */
-	private String mzff;
-
-	/**
-	 * qkjb
-	 */
-	private String qkjb;
-
-	/**
-	 * yhqk
-	 */
-	private String yhqk;
-
-	/**
-	 * ssbfz
-	 */
-	private String ssbfz;
-
-	/**
-	 * fhqk
-	 */
-	private String fhqk;
-
-	/**
-	 * ssjb
-	 */
-	private String ssjb;
-
-	/**
-	 * cutHeal
-	 */
-	private String cutHeal;
+    private static final long serialVersionUID = 2951195859758849520L;
+
+    /**
+     * bah
+     */
+    private String bah;
+
+    /**
+     * zyh
+     */
+    private String zyh;
+
+    /**
+     * zycs
+     */
+    private Integer zycs;
+
+    /**
+     * ssxh
+     */
+    private Integer ssxh;
+
+    /**
+     * ssrq
+     */
+    private Date ssrq;
+
+    /**
+     * sstj
+     */
+    private String sstj;
+
+    /**
+     * ssys
+     */
+    private String ssys;
+
+    /**
+     * sszs1
+     */
+    private String sszs1;
+
+    /**
+     * sszs2
+     */
+    private String sszs2;
+
+    /**
+     * mzys
+     */
+    private String mzys;
+
+    /**
+     * ssbm
+     */
+    private String ssbm;
+
+    /**
+     * ssmc
+     */
+    private String ssmc;
+
+    /**
+     * mzff
+     */
+    private String mzff;
+
+    /**
+     * qkjb
+     */
+    private String qkjb;
+
+    /**
+     * yhqk
+     */
+    private String yhqk;
+
+    /**
+     * ssbfz
+     */
+    private String ssbfz;
+
+    /**
+     * fhqk
+     */
+    private String fhqk;
+
+    /**
+     * ssjb
+     */
+    private String ssjb;
+
+    /**
+     * cutHeal
+     */
+    private String cutHeal;
+
+
+    private String ssysName;
+    private String sszsName1;
+    private String sszsName2;
+    private String mzysName;
 
 }

+ 5 - 0
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -285,5 +285,10 @@ public class PublicServer {
         }
 
     }
+
+
+    public ResultVo<List<GetDropdownBox>> maZuiFangShi() {
+        return ResultVoUtil.success(dao.maZuiFangShi());
+    }
 }
 

+ 43 - 36
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -46,7 +46,7 @@ public class SetlListUpldService {
     private final ExecService exec;
     private final SiQueryDao queryDao;
 
-    private final UpIdCollectionDao upIdCollectionDao;
+    private final UpIdCollectionDao dao;
 
     private final DismissDao dismissDao;
 
@@ -55,7 +55,7 @@ public class SetlListUpldService {
     public SetlListUpldService(ExecService exec, SiQueryDao queryDao, UpIdCollectionDao upIdCollectionDao, DismissDao dismissDao, PublicServer publicServer) {
         this.exec = exec;
         this.queryDao = queryDao;
-        this.upIdCollectionDao = upIdCollectionDao;
+        this.dao = upIdCollectionDao;
         this.dismissDao = dismissDao;
         this.publicServer = publicServer;
     }
@@ -77,15 +77,15 @@ public class SetlListUpldService {
         JSONObject jsonObject = exec.makeTradeHeaderWithInsureArea(SiFunction.UPLOAD_SI_SETTLE_INFO, upldCollection.getData().getSetlinfo().getInsuplc());
         jsonObject.replace("input", input);
         // 这里是上传
-//        JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
+        JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
 
-        JSONObject result = new JSONObject();
-        if (times % 2 == 0) {
-            result.put("infcode", 0);
-        } else {
-            result.put("infcode", -1);
-            result.put("err_msg", "知道你为啥失败吗?");
-        }
+//        JSONObject result = new JSONObject();
+//        if (times % 2 == 0) {
+//            result.put("infcode", 0);
+//        } else {
+//            result.put("infcode", -1);
+//            result.put("err_msg", "知道你为啥失败吗?");
+//        }
         log.info("医保结算信息上传 \n操作人:{}\n参数:{} \n结果:{}", TokenUtil.getTokenUserId(), jsonObject, result);
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
@@ -94,7 +94,7 @@ public class SetlListUpldService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("医保中心报错:【%s】 ", result.getString("message")));
         }
         if (result.getIntValue(RESULT_CODE) == 0) {
-            upIdCollectionDao.fanHuiLiuShuiHao(result.getJSONObject(OUTPUT).getString("setl_list_id"), upldCollection.getData().getSetlinfo().getSetlId());
+            dao.fanHuiLiuShuiHao(result.getJSONObject(OUTPUT).getString("setl_list_id"), upldCollection.getData().getSetlinfo().getSetlId());
             return ResultVoUtil.success(ExceptionEnum.SUCCESS, "上传成功");
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("医保中心报错:【%s】 ", result.getString("err_msg")));
@@ -102,7 +102,7 @@ public class SetlListUpldService {
 
     public ResultVo<UpldCollection> getUploadInfo(String patNo, Integer times, Integer ledgerSn) throws Exception {
         log.info("住院号:{},次数:{},账页:{}", patNo, times, ledgerSn);
-        SetlinfoUpld setlinfoUpld = upIdCollectionDao.setlinfo1(patNo, times, ledgerSn);
+        SetlinfoUpld setlinfoUpld = dao.setlinfo1(patNo, times, ledgerSn);
         if (StringUtil.isBlank(setlinfoUpld.getSetlId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算id为空");
         }
@@ -111,26 +111,26 @@ public class SetlListUpldService {
         }
         setlinfoUpld.setFixmedinsName(SiUtil.INSTITUTION_NAME);
         // 特级护理
-        setlinfoUpld.setSpgaNurscareDays(String.valueOf(upIdCollectionDao.teJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn,
+        setlinfoUpld.setSpgaNurscareDays(String.valueOf(dao.teJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn,
                 publicServer.getInfantFlag(patNo))));
         // 一级护理
-        setlinfoUpld.setLv1NurscareDays(String.valueOf(upIdCollectionDao.yiJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
+        setlinfoUpld.setLv1NurscareDays(String.valueOf(dao.yiJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
         // 二级护理
-        setlinfoUpld.setScdNurscareDays(String.valueOf(upIdCollectionDao.erJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
+        setlinfoUpld.setScdNurscareDays(String.valueOf(dao.erJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
         // 三级护理
-        setlinfoUpld.setLv3NurscareDays(String.valueOf(upIdCollectionDao.sanJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
+        setlinfoUpld.setLv3NurscareDays(String.valueOf(dao.sanJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
         setlinfoUpld.setFixmedinsCode(SiUtil.INSTITUTION_ID);
 
         // TokenUtil.getTokenUserId()
-        GetDropdownBox getDropdownBox = upIdCollectionDao.userInfo(TokenUtil.getTokenUserId());
+        GetDropdownBox getDropdownBox = dao.userInfo(TokenUtil.getTokenUserId());
         // 医疗机构填报人
         setlinfoUpld.setMedinsFillPsn(getDropdownBox.getName());
         // 医疗机构填报部门
         setlinfoUpld.setMedinsFillDept(getDropdownBox.getDeptName());
         // 医保机构经办人
         setlinfoUpld.setHsorgOpter("未知");
-        setlinfoUpld.setBillNo(upIdCollectionDao.billNo(patNo, times, ledgerSn));
-        List<OprninfoUpld> oprninfoUpld = upIdCollectionDao.oprninfoUplds(patNo, times);
+        setlinfoUpld.setBillNo(dao.billNo(patNo, times, ledgerSn));
+        List<OprninfoUpld> oprninfoUpld = dao.oprninfoUplds(patNo, times);
 
         if (ListUtil.notBlank(oprninfoUpld)) {
             // 用来存放最大的手术级别
@@ -149,12 +149,12 @@ public class SetlListUpldService {
         // 手术计数
         setlinfoUpld.setOprnOprtCodeCnt(String.valueOf(oprninfoUpld.size()));
 
-        EntityCopy.Copy(upIdCollectionDao.setlinfo2(patNo), setlinfoUpld);
-        EntityCopy.Copy(upIdCollectionDao.setlinfo3(patNo, times), setlinfoUpld);
-        EntityCopy.Copy(upIdCollectionDao.setlinfo4(patNo, times), setlinfoUpld);
+        EntityCopy.Copy(dao.setlinfo2(patNo), setlinfoUpld);
+        EntityCopy.Copy(dao.setlinfo3(patNo, times), setlinfoUpld);
+        EntityCopy.Copy(dao.setlinfo4(patNo, times), setlinfoUpld);
 
         String setlId = setlinfoUpld.getSetlId();
-        List<IteminfoUpld> amtAndOthAmt = upIdCollectionDao.amtAndOthAmt(setlId);
+        List<IteminfoUpld> amtAndOthAmt = dao.amtAndOthAmt(setlId);
         if (null == amtAndOthAmt || amtAndOthAmt.isEmpty()) {
             ResultVo<String> chrgitems = getChrgitems(patNo, setlId, setlinfoUpld.getMdtrtId(), setlinfoUpld.getInsuplc());
             if (chrgitems.getCode() != 200) {
@@ -165,10 +165,10 @@ public class SetlListUpldService {
         setlinfoUpld.setBillCode(setlinfoUpld.getMedcasno() + "_" + ledgerSn);
         setlinfoUpld.setBizSn(SnowFlakeId.instance().nextId());
 
-        Map<String, IteminfoUpld> jiaLeiFeiYong = upIdCollectionDao.jiaLeiFeiYong(setlId).stream().collect(
+        Map<String, IteminfoUpld> jiaLeiFeiYong = dao.jiaLeiFeiYong(setlId).stream().collect(
                 Collectors.toMap(IteminfoUpld::getMedChrgitm, a -> a, (k1, k2) -> k1)
         );
-        Map<String, IteminfoUpld> yiLeiFeiYong = upIdCollectionDao.yiLeiFeiYong(setlId).stream().collect(
+        Map<String, IteminfoUpld> yiLeiFeiYong = dao.yiLeiFeiYong(setlId).stream().collect(
                 Collectors.toMap(IteminfoUpld::getMedChrgitm, a -> a, (k1, k2) -> k1)
         );
         if (ListUtil.notBlank(amtAndOthAmt)) {
@@ -188,7 +188,7 @@ public class SetlListUpldService {
         }
         // 重症监护时间
         List<IcuinfoUpld> zhongZhenJianHu = new ArrayList<>();
-        List<Date> zhuanKeShiJian = upIdCollectionDao.zhuanKeShiJian(patNo, times);
+        List<Date> zhuanKeShiJian = dao.zhuanKeShiJian(patNo, times);
         if (ListUtil.notBlank(zhuanKeShiJian)) {
             List<List<Date>> fenGeJianHuShiJian = ListUtils.partition(zhuanKeShiJian, 2);
             for (List<Date> dateList : fenGeJianHuShiJian) {
@@ -220,8 +220,8 @@ public class SetlListUpldService {
                 zhongZhenJianHu.add(icuinfoUpld);
             }
         }
-        List<PayinfoUpld> payinfo = upIdCollectionDao.payinfoUpld(patNo, times, ledgerSn);
-        List<DiseinfoUpld> diseinfos = upIdCollectionDao.diseinfo(patNo, times);
+        List<PayinfoUpld> payinfo = dao.payinfoUpld(patNo, times, ledgerSn);
+        List<DiseinfoUpld> diseinfos = dao.diseinfo(patNo, times);
 
         UpldCollection upldCollection = new UpldCollection();
         // 患者的基本信息
@@ -374,7 +374,7 @@ public class SetlListUpldService {
      */
     public ResultVo<IPage<SiSetlinfoTemp>> huoQuJieSuanRenYuan(JieSuanDanChaXun param) {
         IPage<SiSetlinfoTemp> page = new Page<>();
-        page.setRecords(upIdCollectionDao.huoQuJieSuanRenYuan(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
+        page.setRecords(dao.huoQuJieSuanRenYuan(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
                 param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getFlag(), param.getReferPhysician(), param.getCurrentPage(),
                 param.getPageSize()));
         if (ListUtil.isBlank(page.getRecords())) {
@@ -400,7 +400,7 @@ public class SetlListUpldService {
                 item.setMedTypeName(medType.getName());
             }
         }
-        Map<String, ZyDisDiagYb> zhuZhenDuan = upIdCollectionDao.zhuZhenDuan(inpatientNos).stream().collect(
+        Map<String, ZyDisDiagYb> zhuZhenDuan = dao.zhuZhenDuan(inpatientNos).stream().collect(
                 Collectors.toMap(item -> item.getInpatientNo() + item.getAdmissTimes(), a -> a, (k1, k2) -> k1)
         );
         for (SiSetlinfoTemp item : page.getRecords()) {
@@ -412,7 +412,7 @@ public class SetlListUpldService {
             }
         }
         if (param.getTotal() == 0) {
-            page.setTotal(upIdCollectionDao.huoQuJieSuanRenYuanTotal(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
+            page.setTotal(dao.huoQuJieSuanRenYuanTotal(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
                     param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getFlag(), param.getReferPhysician()));
         }
         return ResultVoUtil.success(page);
@@ -471,14 +471,14 @@ public class SetlListUpldService {
     }
 
     public ResultVo<ZyInactpatient> jieSuanDanKeXiuGaiXinXi(String patNo, Integer times, Integer ledgerSn) {
-        SetlinfoUpld setlinfoUpld = upIdCollectionDao.setlinfo1(patNo, times, ledgerSn);
+        SetlinfoUpld setlinfoUpld = dao.setlinfo1(patNo, times, ledgerSn);
         if (StringUtil.isBlank(setlinfoUpld.getSetlId())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算id为空");
         }
         if (!setlinfoUpld.getInsuplc().startsWith("4301") || setlinfoUpld.getInsuplc().equals("430182")) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该患者参保地不属于长沙市,无法上传结算清单。");
         }
-        ZyInactpatient zy = upIdCollectionDao.huanZheXinXi(patNo, times);
+        ZyInactpatient zy = dao.huanZheXinXi(patNo, times);
         String[] strNow1 = new SimpleDateFormat("yyyy-MM").format(setlinfoUpld.getSetlEndDate()).split("-");
         String[] strNow2 = new SimpleDateFormat("yyyy-MM").format(new Date()).split("-");
         List<Integer> code = publicServer.getRoleCode().getData();
@@ -489,7 +489,7 @@ public class SetlListUpldService {
             if (!strNow1[1].equals(strNow2[1])) {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "当前月份和患者的结算月份不一致。");
             }
-            TYbSetModifyTime modifyTime = upIdCollectionDao.keXiuGaiShiJian();
+            TYbSetModifyTime modifyTime = dao.keXiuGaiShiJian();
             if (!DateUtil.isEffectiveDate(new Date(), modifyTime.getStartTime(), modifyTime.getEndTime())) {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,
                         String.format("当前不在医保科设置的修改时间范围内<br>开始时间:【%s】<br>结束时间:【%s】<br>这段结算时间范围内的患者可修改。",
@@ -501,10 +501,17 @@ public class SetlListUpldService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未查询到患者信息。");
         }
         // 手术
-        zy.setBatjBa4(upIdCollectionDao.shouShuXinXi(patNo, times));
+        zy.setBatjBa4(dao.shouShuXinXi(patNo, times));
         // 诊断编码
-        zy.setYbZyDisDiag(upIdCollectionDao.zhenDuanXinXi(patNo, times));
+        zy.setYbZyDisDiag(dao.zhenDuanXinXi(patNo, times));
         return ResultVoUtil.success(zy);
     }
 
+    public ResultVo<IPage<GetDropdownBox>> shouShuBianMa(String content, long currentPage) {
+        IPage<GetDropdownBox> page = new Page<>();
+        page.setRecords(dao.searchSurgeryByAlpha(StringUtil.isContainChinese(content), currentPage));
+        page.setTotal(dao.searchSurgeryTotal(StringUtil.isContainChinese(content)));
+        return ResultVoUtil.success(page);
+    }
+
 }