Jelajahi Sumber

add
mqtt信息发送

lifang 1 Minggu lalu
induk
melakukan
c139bf21f4

+ 10 - 0
nb-service/web-service/src/main/java/com/nb/web/service/bus/listener/DeviceCustomizedService.java

@@ -1,5 +1,6 @@
 package com.nb.web.service.bus.listener;
 
+import cn.hutool.core.util.StrUtil;
 import com.aliyun.oss.ServiceException;
 import com.nb.core.exception.CustomException;
 import com.nb.web.api.entity.common.BusDeviceRunningEntity;
@@ -21,5 +22,14 @@ public class DeviceCustomizedService {
                 throw new CustomException("梅州市东山医院不接收开机包数据");
             }
         }
+        //暨南大学住院号调整
+        if ("1942480809905172482".equals(device.getTenantId())) {
+            //住院号小于4位的都显示成4位,5位的显示成6位 ,是吧
+            if (StrUtil.length(device.getPatientCode()) < 4) {
+                device.setPatientCode(StrUtil.padPre(device.getPatientCode(), 4, "0"));
+            }else if (StrUtil.length(device.getPatientCode()) < 6) {
+                device.setPatientCode(StrUtil.padPre(device.getPatientCode(), 6, "0"));
+            }
+        }
     }
 }