Przeglądaj źródła

add
没有绑定临床的泵头筛选

lifang 3 miesięcy temu
rodzic
commit
b6bce9e3fc

+ 4 - 4
tr-modules/tr-module-mobile/src/main/java/cn/tr/module/mobile/service/impl/ImMsgReceivedServiceImpl.java

@@ -48,9 +48,9 @@ public class ImMsgReceivedServiceImpl implements IImMsgReceivedService {
             if(p!=null){
                 return;
             }
-            if(MsgContentType.DOCTOR_IN.equals(msgDTO.getType())||MsgContentType.DOCTOR_OUT.equals(msgDTO.getType())){
-
-            }else {
+//            if(MsgContentType.DOCTOR_IN.equals(msgDTO.getType())||MsgContentType.DOCTOR_OUT.equals(msgDTO.getType())){
+//
+//            }else {
                 ImMsgReceivedPO receivedPO = new ImMsgReceivedPO();
                 receivedPO.setMsgId(msgDTO.getMsgId());
                 receivedPO.setMsgFrom(msgDTO.getFromUserId());
@@ -62,7 +62,7 @@ public class ImMsgReceivedServiceImpl implements IImMsgReceivedService {
                 receivedPO.setMsgFromRole(msgDTO.getRole());
                 receivedPO.setDuration(msgDTO.getDuration());
                 baseRepository.insert(receivedPO);
-            }
+//            }
             //发送群组消息
             List<String> userIds = ServerEventCallbackHandler.onGetGroupUserIds.apply(msgDTO.getClinicId());
             CollectionUtil.removeAny(userIds,msgDTO.getFromUserId());

+ 3 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizDeviceQueryDTO.java

@@ -23,4 +23,7 @@ public class BizDeviceQueryDTO implements Serializable {
 
     @ApiModelProperty("泵设备类型")
     private String deviceType;
+
+    @ApiModelProperty("是否绑定临床")
+    private Boolean bindClinic;
 }

+ 8 - 1
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizDeptServiceImpl.java

@@ -1,6 +1,7 @@
 package cn.tr.module.smart.common.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.tr.core.exception.ServiceException;
 import cn.tr.core.exception.TRExcCode;
@@ -20,6 +21,7 @@ import cn.tr.module.smart.web.dto.BizDeptLinkQuestionDTO;
 import cn.tr.module.smart.wx.controller.vo.BizWxDeptVO;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import jodd.util.ArraysUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -125,7 +127,10 @@ public class BizDeptServiceImpl implements IBizDeptService {
         if (CollectionUtil.isEmpty(ids)) {
             throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "请选择要删除的数据");
         }
-        return baseRepository.deleteBatchIds(ids);
+        int i = baseRepository.deleteBatchIds(ids);
+        bizDocDeptService.remove(new LambdaQueryWrapper<BizDocDeptPO>().in(BizDocDeptPO::getDeptId,ids));
+        bizQuestionDeptService.remove(new LambdaQueryWrapper<BizQuestionDeptPO>().in(BizQuestionDeptPO::getDeptId,ids));
+        return i;
     }
 
     /**
@@ -159,10 +164,12 @@ public class BizDeptServiceImpl implements IBizDeptService {
                     return bizDocDeptPO;
                 }).collect(Collectors.toList());
         bizDocDeptService.saveOrUpdateBatch(bizDocDeptPOS);
+        Collections.shuffle(docIds);
         //修改 宣教文档关联个数
          return baseRepository.update(null,
                 new LambdaUpdateWrapper<BizDeptPO>()
                         .set(BizDeptPO::getMissionDocCount, bizDocDeptPOS.size())
+                        .set(BizDeptPO::getGroupId,CollectionUtil.getFirst(docIds))
                         .eq(BizDeptPO::getId, deptId)) != 0;
     }
 

+ 10 - 3
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizDeviceMapper.xml

@@ -106,12 +106,13 @@
         bih.warn_low_battery,
         bih.warn_flow,
         bih.input_dose,
-        bcr.id as clinic_id
+        bcr.id as clinic_id,
+        bih.create_time as create_time
         FROM
         biz_device bd
         left JOIN biz_infusion_history bih ON bd.infusion_id = bih.id
-        left JOIN biz_infusion_clinic bic ON bih.ID = bic.infusion_id
-        left JOIN biz_clinic_room bcr ON bic.clinic_id = bcr.ID
+        left JOIN biz_infusion_clinic bic ON bih.id = bic.infusion_id
+        left JOIN biz_clinic_room bcr ON bic.clinic_id = bcr.id
         <where>
             <if test="query.deviceType != null and query.deviceType != ''">
                 and bih.device_type = #{query.deviceType}
@@ -119,6 +120,12 @@
             <if test="query.patientName != null and query.patientName != ''">
                 and bcr.patient_name like concat('%',#{query.patientName},'%')
             </if>
+            <if test="query.bindClinic != null and query.bindClinic == true">
+                and bcr.id is not null
+            </if>
+            <if test="query.bindClinic != null and query.bindClinic == false">
+                and bcr.id is null
+            </if>
         </where>
     </select>