Selaa lähdekoodia

fix:
修改了一些bug

18339543638 1 vuosi sitten
vanhempi
commit
b64aa05799

+ 3 - 2
nb-admin/src/main/resources/application.yml

@@ -45,7 +45,7 @@ sa-token:
   # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
   is-concurrent: true
   # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
-  is-share: true
+  is-share: false
   # token风格
   token-style: simple-uuid
   # 是否输出操作日志
@@ -80,8 +80,9 @@ mybatis-plus:
       logic-not-delete-value: 0
       logic-delete-value: 1
   configuration:
-    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
     default-enum-type-handler: com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler
+    cache-enabled: false
   type-aliases-package: com.nb.bus.entity
 
 captcha:

+ 35 - 0
nb-admin/src/test/java/com/nb/admin/IotTest.java

@@ -0,0 +1,35 @@
+package com.nb.admin;
+
+import cn.hutool.json.JSONUtil;
+import com.nb.aliyun.controller.IotController;
+import com.nb.core.result.R;
+import com.nb.web.api.entity.common.BusDeviceRunningEntity;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * @ClassName : IotTest
+ * @Description :
+ * @Author : LF
+ * @Date: 2024年05月06日
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = AdminApplication.class)
+public class IotTest {
+    @Autowired
+    private IotController iotController;
+
+
+    @Test
+    public void test001(){
+        String str="{\"firstDose\":0,\"type\":\"intelligent\",\"deviceId\":\"4310704330480294\",\"newInfusion\":false,\"flowRestricted\":false,\"totalDose\":100,\"pcaInvalidCount\":0,\"selfControlLockTime\":5,\"alarm\":\"None\",\"pcaValidCount\":0,\"patientCode\":\"333000000\",\"infusionModify\":false,\"maybeLowInfusion\":false,\"appendDose\":0,\"test\":false,\"resetClinic\":false,\"maxDose\":90,\"continueDose\":45,\"classification\":\"1\",\"inputDose\":3.6,\"electricQuantity\":100,\"resetUndo\":false,\"dataNumber\":20,\"runState\":\"Running\",\"pcaTotalCount\":0}";
+        BusDeviceRunningEntity obj = JSONUtil.toBean(str, BusDeviceRunningEntity.class);
+        R r = iotController.dataSave(obj);
+        while (true){
+
+        }
+    }
+}

+ 1 - 1
nb-service/iot-service/src/main/java/com/nb/aliyun/controller/IotController.java

@@ -49,7 +49,7 @@ public class IotController {
      */
     @PostMapping("/data/save")
     @SaIgnore
-    public R assignMenu(@RequestBody BusDeviceRunningEntity source) {
+    public R dataSave(@RequestBody BusDeviceRunningEntity source) {
         if(StrUtil.isBlank(source.getDeviceId())){
             throw new CustomException("[deviceId]设备id不能为空");
         }

+ 2 - 2
nb-service/web-service/src/main/java/com/nb/web/service/bus/mapper/BusPatientMapper.java

@@ -26,7 +26,7 @@ public interface BusPatientMapper extends BaseMapper<BusPatientEntity> {
      * @param
      * @return
      */
-    default List<PatientDeviceRepeatDomain> selectRepeatDevice(){
+    default List<PatientDeviceRepeatDomain> selectAllRepeatDevice(){
         return selectRepeatDevice(null);
     };
     /**
@@ -41,7 +41,7 @@ public interface BusPatientMapper extends BaseMapper<BusPatientEntity> {
      * @param
      * @return
      */
-    default List<PatientDeviceNoneResult> selectNoneDevice(){
+    default List<PatientDeviceNoneResult> selectNoneAllDevice(){
         return selectNoneDevice(null);
     };
 

+ 2 - 2
nb-service/web-service/src/main/java/com/nb/web/service/bus/service/LocalBusPatientService.java

@@ -187,7 +187,7 @@ public class LocalBusPatientService extends BaseService<BusPatientMapper, BusPat
      * 获取给定医院下所有的挂载多个设备的病人信息
      */
     public List<PatientDeviceRepeatResult> repeatDevice() {
-        List<PatientDeviceRepeatDomain> patientDeviceRepeats = this.baseMapper.selectRepeatDevice();
+        List<PatientDeviceRepeatDomain> patientDeviceRepeats = this.baseMapper.selectAllRepeatDevice();
         Map<String, PatientDeviceRepeatResult> resultMap = new HashMap<>();
         patientDeviceRepeats.forEach(deviceRepeat -> {
             PatientDeviceRepeatResult repeatResult = resultMap.computeIfAbsent(deviceRepeat.getCode() + deviceRepeat.getClinicId(), k ->
@@ -223,7 +223,7 @@ public class LocalBusPatientService extends BaseService<BusPatientMapper, BusPat
      * @return
      */
     public List<PatientDeviceNoneResult> noneDevice() {
-        return this.baseMapper.selectNoneDevice();
+        return this.baseMapper.selectNoneAllDevice();
     }
 
     @Override

+ 5 - 5
nb-service/web-service/src/main/resources/mapper/bus/BusDeviceMapper.xml

@@ -65,19 +65,19 @@
         from (select * from bus_device
         <where>
             is_delete=0
-            <if test="query.productNo!=null">
+            <if test="query.productNo!=null and query.productNo != ''">
                 and product_no like concat('%',#{query.productNo},'%')
             </if>
-            <if test="query.deviceId!=null">
+            <if test="query.deviceId!=null and query.deviceId != ''">
                 and device_id like concat('%',#{query.deviceId},'%')
             </if>
-            <if test="query.alias!=null">
+            <if test="query.alias!=null and query.alias != ''">
                 and alias like concat('%',#{query.alias},'%')
             </if>
-            <if test="query.status!=null">
+            <if test="query.status!=null and query.status != ''">
                 and status = #{query.status}
             </if>
-            <if test="query.iccId!=null">
+            <if test="query.iccId!=null and query.iccId !=''">
                 and sim_iccid like concat('%',#{query.iccId},'%')
             </if>
         </where>

+ 8 - 5
nb-service/web-service/src/main/resources/mapper/bus/BusPatientMapper.xml

@@ -132,15 +132,18 @@
         i.run_state as device_run_state,
         i.alarm as device_alarm,
         i.start_time as infusion_start_time
-        FROM (SELECT `name`,gender,infusion_id,CODE,id FROM bus_patient WHERE bus_patient.`alarm`=1) AS p
-        join  (select * from bus_infusion_history where is_undo=0 and finished=0) as i on i.patient_id=p.id
-        join (select device_id,alias from bus_device) as d on d.device_id=i.device_id
-        join  (SELECT * FROM bus_clinic WHERE finished=0 and monitor_type=1) AS c ON  c.`patient_id`=p.id;
+        FROM (SELECT `name`,gender,infusion_id,CODE,id FROM bus_patient
         <where>
+            bus_patient.`alarm`=1
             <if test="tenantId != null and tenantId != ''">
-                and p.tenant_id=#{tenantId}
+                and tenant_id=#{tenantId}
             </if>
         </where>
+             ) AS p
+        join  (select * from bus_infusion_history where is_undo=0 and finished=0) as i on i.patient_id=p.id
+        join (select device_id,alias from bus_device) as d on d.device_id=i.device_id
+        join  (SELECT * FROM bus_clinic WHERE finished=0 and monitor_type=1) AS c ON  c.`patient_id`=p.id
+
     </select>
 
     <select id="selectNoneDevice" resultMap="deviceNone">