Browse Source

优化代码以及结算单上传的东西

xiaochan 3 years ago
parent
commit
b7fb44c908

File diff suppressed because it is too large
+ 1 - 17
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/UpIdCollectionDao.java


+ 8 - 5
src/main/java/thyyxxk/webserver/dao/his/yibao/DismissDao.java

@@ -56,9 +56,12 @@ public interface DismissDao {
             "admiss_times=#{times} and ledger_sn>=1 AND charge_fee <> 0 and charge_status ='1'")
     int hasNotAccounted(@Param("patNo") String patNo, @Param("times") Integer times);
 
-    @Select("SELECT count(1) FROM yp_zy_patient WHERE inpatient_no=#{patNo} AND " +
+    @Select("SELECT message = N'药单号:' + CAST(page_no as VARCHAR) + " +
+            "                 N',药品名称:' + + (select top 1 name from yp_zd_dict where charge_code = code) + " +
+            "                 N',医嘱号:' + CAST(CAST(act_order_no AS DECIMAL) AS VARCHAR(20)) " +
+            " FROM yp_zy_patient WHERE inpatient_no=#{patNo} AND " +
             "admiss_times=#{times} AND amount <> 0 and acct_sign <> '2' ")
-    int hasUnreceivedDrugList(@Param("patNo") String patNo, @Param("times") Integer times);
+    List<String> hasUnreceivedDrugList(@Param("patNo") String patNo, @Param("times") Integer times);
 
     @Select("SELECT count(1) FROM yz_zy_patient_fee WHERE inpatient_no=#{patNo} " +
             "AND admiss_times=#{times} and charge_date<=#{actOrderDisDate} AND charge_fee <> 0 " +
@@ -125,9 +128,9 @@ public interface DismissDao {
             "and admiss_times=#{times} and ledger_sn=#{ledgerSn} and isnull(charge_status, '1') <> '1') - " +
             "(select isnull(total_charge,0) from zy_ledger_file " +
             "where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn})")
-    BigDecimal  getFeeOffset(@Param("patNo") String patNo,
-                     @Param("times") Integer times,
-                     @Param("ledgerSn") int ledgerSn);
+    BigDecimal getFeeOffset(@Param("patNo") String patNo,
+                            @Param("times") Integer times,
+                            @Param("ledgerSn") int ledgerSn);
 
     @Select("select isnull(sum(charge_fee),0) from zy_detail_charge where inpatient_no=#{patNo} and " +
             "admiss_times=#{times} and ledger_sn=#{ledgerSn} and isnull(charge_status, '1') <> '1' and " +

+ 3 - 3
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -354,11 +354,11 @@ public interface YiZhuLuRuDao {
             "                    when rtrim(code) &gt;= '30000' and rtrim(code) &lt; '50000' then 'z' " +
             "                    else 'd' end) end as drug_flag, " +
             "       mini_unit, " +
-            "       isnull(weight,0)                  drug_weight, " +
+            "       isnull(weight,1)                  drug_weight, " +
             "       weigh_unit                        drug_weight_unit, " +
-            "       isnull(volum,0)                   drug_volume, " +
+            "       isnull(volum,1)                   drug_volume, " +
             "       vol_unit                          drug_vol_unit," +
-            "       isnull(pack_size,0) pack_size,  " +
+            "       isnull(pack_size,1) pack_size,  " +
             "       pack_unit,  " +
             "       national_code," +
             "       cast(isnull(NULLIF(kjyw_flag, ''), 0) as int) as kjyw_flag," +

+ 4 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -87,9 +87,12 @@ public class SetlListUpldService {
         if (upldCollection.getCode() != 200) {
             throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, upldCollection.getMessage());
         }
+        if (patNo.startsWith("JT")) {
+            throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, "单病种患者,无法上传数据。");
+        }
         BigDecimal age = new BigDecimal(upldCollection.getData().getSetlinfo().getAge());
         // 年龄在大于 60 和 小于 16 之间联系人不能写 自己
-        if (StringUtil.isBlank(upldCollection.getData().getSetlinfo().getConerName().trim())) {
+        if (StringUtil.isBlank(upldCollection.getData().getSetlinfo().getConerName())) {
             throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, "患者联系人姓名不能为空。");
         }
         // 这个先占时放开

+ 13 - 5
src/main/java/thyyxxk/webserver/service/yibao/DismissService.java

@@ -1,5 +1,6 @@
 package thyyxxk.webserver.service.yibao;
 
+import com.alibaba.fastjson.JSON;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -144,11 +145,9 @@ public class DismissService {
             exception.setMessage("此患者有未上账金额。");
             throw new BizException(exception);
         }
-        int unreceivedDrugCount = dao.hasUnreceivedDrugList(patNo, times);
-        if (unreceivedDrugCount > 0) {
-            ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
-            exception.setMessage("此患者有未接收的药单。");
-            throw new BizException(exception);
+        List<String> unreceivedDrug = dao.hasUnreceivedDrugList(patNo, times);
+        if (ListUtil.notBlank(unreceivedDrug)) {
+            throw new BizException(ExceptionEnum.LOGICAL_HTML_ERROR, dischargeErrorMessage("此患者有未接收的药单", unreceivedDrug));
         }
         if (dao.hasUnreceivedFees(patNo, times, tmpendtime) > 0) {
             ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
@@ -247,6 +246,15 @@ public class DismissService {
         return ResultVoUtil.success();
     }
 
+
+    private String dischargeErrorMessage(String title, List<String> messages) {
+        StringBuilder str = new StringBuilder(title + "<br />");
+        for (String message : messages) {
+            str.append(message).append("<br>");
+        }
+        return str.toString();
+    }
+
     @Transactional(rollbackFor = Exception.class)
     public ResultVo<String> doDismiss(YbSettleFee settleFee) throws BizException {
         updateHicNo(settleFee.getInpatientNo());

Some files were not shown because too many files changed in this diff