lihong 2 rokov pred
rodič
commit
4904bf9040

+ 14 - 2
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -1,6 +1,7 @@
 package thyyxxk.webserver.service.medicalinsurance;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.ReflectUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -266,9 +267,15 @@ public class SetlListUpldService {
      * @throws Exception 错误
      */
     public ResultVo<UpldCollection> getUploadInfo(String patNo, Integer times, Integer ledgerSn) throws Exception {
+        boolean shiFouQianShouBingAn = dao.shiFouQianShou(patNo, times) > 0;
         if (ledgerSn == 0) {
             return outpatInformation(patNo, times, ledgerSn);
         }
+        if (!patNo.startsWith("JT")) {
+            if (!shiFouQianShouBingAn) {
+                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该病案没有签收,请病案室签收后上传。");
+            }
+        }
         String medType = dao.getMedicalCategory(patNo, times, ledgerSn);
         boolean isFertilitySign = false;
         if (StringUtil.notBlank(medType)) {
@@ -339,7 +346,8 @@ public class SetlListUpldService {
             }
         }
         // 票据代码
-        setlinfoUpld.setBillNo(dao.billNo(patNo, times, ledgerSn));
+        String billNo = dao.billNo(patNo, times, ledgerSn);
+        setlinfoUpld.setBillNo(StringUtil.isBlank(billNo)?RandomUtil.randomNumbers(8):billNo);
         setlinfoUpld.setBillCode("143001913350");
         setlinfoUpld.setBizSn(SnowFlakeId.instance().nextId());
         // 甲类费用
@@ -464,7 +472,9 @@ public class SetlListUpldService {
         return ResultVoUtil.success(upldCollection);
     }
 
-   private String getDrgHaiPay(String insuplcAdmdvs,String defaultValue){
+
+
+    private String getDrgHaiPay(String insuplcAdmdvs,String defaultValue){
         if(StringUtil.isBlank(insuplcAdmdvs)){
             return defaultValue;
         }
@@ -484,6 +494,8 @@ public class SetlListUpldService {
        return defaultValue;
    }
 
+   
+
     /**
      * 特级护理天数如果是 0 就不传值
      *