瀏覽代碼

update 删除冗余代码,改掉坏味道

A17404李放 3 年之前
父節點
當前提交
b009bdc884
共有 60 個文件被更改,包括 250 次插入407 次删除
  1. 0 1
      coffee-admin/src/main/java/com/coffee/admin/AdminApplication.java
  2. 7 6
      coffee-admin/src/main/java/com/coffee/admin/controller/monitor/OnlineUserController.java
  3. 0 5
      coffee-common/src/main/java/com/coffee/common/cache/ClusterConfigStorage.java
  4. 0 1
      coffee-common/src/main/java/com/coffee/common/cache/manager/ClusterConfigStorageManager.java
  5. 3 5
      coffee-common/src/main/java/com/coffee/common/config/CacheHttpServletRequestWrapper.java
  6. 0 1
      coffee-common/src/main/java/com/coffee/common/config/CachingContentFilter.java
  7. 8 12
      coffee-common/src/main/java/com/coffee/common/crud/BaseService.java
  8. 2 2
      coffee-common/src/main/java/com/coffee/common/crud/controller/BaseCurdAuthController.java
  9. 4 4
      coffee-common/src/main/java/com/coffee/common/crud/controller/BaseDeleteController.java
  10. 2 2
      coffee-common/src/main/java/com/coffee/common/crud/controller/BaseQueryController.java
  11. 1 2
      coffee-common/src/main/java/com/coffee/common/crud/controller/BaseSaveController.java
  12. 1 1
      coffee-common/src/main/java/com/coffee/common/entity/AbstractMsgId.java
  13. 0 5
      coffee-common/src/main/java/com/coffee/common/entity/RecordCreationEntity.java
  14. 0 3
      coffee-common/src/main/java/com/coffee/common/entity/RecordModifierEntity.java
  15. 7 6
      coffee-common/src/main/java/com/coffee/common/util/AddressUtil.java
  16. 1 7
      coffee-common/src/main/java/com/coffee/common/util/RedissonUtil.java
  17. 0 17
      coffee-framework/src/main/java/com/coffee/framework/config/RedissonClientAutoConfiguration.java
  18. 3 1
      coffee-framework/src/main/java/com/coffee/framework/config/SaTokenConfig.java
  19. 2 13
      coffee-oss/src/main/java/com/coffee/oss/strategy/impl/AbstractFileStorage.java
  20. 1 7
      coffee-system/src/main/java/com/coffee/bus/controller/BusClinicController.java
  21. 1 5
      coffee-system/src/main/java/com/coffee/bus/controller/BusConstantController.java
  22. 1 1
      coffee-system/src/main/java/com/coffee/bus/controller/BusDeviceController.java
  23. 1 3
      coffee-system/src/main/java/com/coffee/bus/controller/BusFormulaController.java
  24. 9 13
      coffee-system/src/main/java/com/coffee/bus/controller/BusPatientController.java
  25. 1 1
      coffee-system/src/main/java/com/coffee/bus/controller/BusStatsAnalyseController.java
  26. 0 10
      coffee-system/src/main/java/com/coffee/bus/controller/vo/DeviceRunningMockVo.java
  27. 8 12
      coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceAlarmEntity.java
  28. 1 9
      coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceEntity.java
  29. 1 12
      coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceHistoryEntity.java
  30. 10 10
      coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceManualEntity.java
  31. 2 8
      coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceRunningEntity.java
  32. 33 47
      coffee-system/src/main/java/com/coffee/bus/entity/BusInfusionModifyEntity.java
  33. 12 13
      coffee-system/src/main/java/com/coffee/bus/entity/common/CommonDeviceParam.java
  34. 28 28
      coffee-system/src/main/java/com/coffee/bus/entity/common/DeviceProperties.java
  35. 1 1
      coffee-system/src/main/java/com/coffee/bus/enums/DeviceAlarmEnum.java
  36. 0 2
      coffee-system/src/main/java/com/coffee/bus/hospital/config/AbstractHospitalConfigHandler.java
  37. 11 15
      coffee-system/src/main/java/com/coffee/bus/hospital/his/strategy/part/DefaultHisPartStrategyHandler.java
  38. 1 2
      coffee-system/src/main/java/com/coffee/bus/mapper/BusDeviceAlarmMapper.java
  39. 1 1
      coffee-system/src/main/java/com/coffee/bus/mapper/BusDeviceRunningMapper.java
  40. 0 1
      coffee-system/src/main/java/com/coffee/bus/registry/CacheInfo.java
  41. 0 3
      coffee-system/src/main/java/com/coffee/bus/service/LocalBusDeviceManualService.java
  42. 7 5
      coffee-system/src/main/java/com/coffee/bus/service/LocalBusDeviceService.java
  43. 5 3
      coffee-system/src/main/java/com/coffee/bus/service/LocalBusHospitalConfigService.java
  44. 1 1
      coffee-system/src/main/java/com/coffee/bus/service/constant/AbstractConstantService.java
  45. 1 1
      coffee-system/src/main/java/com/coffee/bus/service/dto/AlarmQuery.java
  46. 0 3
      coffee-system/src/main/java/com/coffee/bus/service/dto/ClinicAnalClinicRecord.java
  47. 0 1
      coffee-system/src/main/java/com/coffee/bus/service/dto/ClinicAnalInfusionModify.java
  48. 2 4
      coffee-system/src/main/java/com/coffee/bus/service/dto/ClinicAnalInfusionRecord.java
  49. 0 1
      coffee-system/src/main/java/com/coffee/bus/service/dto/ClinicAnalRecordResult.java
  50. 6 6
      coffee-system/src/main/java/com/coffee/bus/service/dto/DeviceResult.java
  51. 6 8
      coffee-system/src/main/java/com/coffee/bus/service/dto/PatientMonitorResult.java
  52. 8 10
      coffee-system/src/main/java/com/coffee/bus/stats/analyse/AlarmStatsAnalyse.java
  53. 15 14
      coffee-system/src/main/java/com/coffee/bus/stats/entity/AlarmTotalPieResult.java
  54. 2 1
      coffee-system/src/main/java/com/coffee/bus/stats/entity/PieResult.java
  55. 3 3
      coffee-system/src/main/java/com/coffee/bus/stats/report/AgeAndGenderStatsReport.java
  56. 3 3
      coffee-system/src/main/java/com/coffee/bus/stats/report/AgeStatsReport.java
  57. 10 21
      coffee-system/src/main/java/com/coffee/bus/stats/report/WeightStatsReport.java
  58. 0 3
      coffee-system/src/main/java/com/coffee/bus/utils/WsPublishUtils.java
  59. 2 4
      coffee-system/src/main/java/com/coffee/bus/web/handler/CheckRequestHandler.java
  60. 15 17
      coffee-system/src/main/java/com/coffee/bus/websocket/DefaultWebSocketMsgHandler.java

+ 0 - 1
coffee-admin/src/main/java/com/coffee/admin/AdminApplication.java

@@ -10,7 +10,6 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
 import org.springframework.context.annotation.Import;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
 import org.tio.websocket.starter.EnableTioWebSocketServer;
 
 /**

+ 7 - 6
coffee-admin/src/main/java/com/coffee/admin/controller/monitor/OnlineUserController.java

@@ -2,6 +2,7 @@ package com.coffee.admin.controller.monitor;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -43,17 +44,17 @@ public class OnlineUserController {
         List<LoginUser> loginUserList = Lists.newArrayList();
         for (String key : keys) {
             // token sample, Authorization:login:token:8734da0866f4440daeea3d836d5ecf8c
-            String tokenValue = StrUtil.subAfter(key, StpUtil.getTokenName() + ":" + StpUtil.TYPE + ":token:", true);
+            String tokenValue = CharSequenceUtil.subAfter(key, StpUtil.getTokenName() + ":" + StpUtil.TYPE + ":token:", true);
             LoginUser item = (LoginUser) StpUtil.getTokenSessionByToken(tokenValue).get(Constants.LOGIN_USER_KEY);
-            if (StrUtil.isNotBlank(username) && StrUtil.isNotBlank(userPlatform)) {
-                if (StrUtil.contains(item.getUsername(), username) && item.getUserPlatform().equals(userPlatform)) {
+            if (CharSequenceUtil.isNotBlank(username) && CharSequenceUtil.isNotBlank(userPlatform)) {
+                if (CharSequenceUtil.contains(item.getUsername(), username) && item.getUserPlatform().equals(userPlatform)) {
                     loginUserList.add(item);
                 }
-            } else if (StrUtil.isNotBlank(username)) {
-                if (StrUtil.contains(item.getUsername(), username)) {
+            } else if (CharSequenceUtil.isNotBlank(username)) {
+                if (CharSequenceUtil.contains(item.getUsername(), username)) {
                     loginUserList.add(item);
                 }
-            } else if (StrUtil.isNotBlank(userPlatform)) {
+            } else if (CharSequenceUtil.isNotBlank(userPlatform)) {
                 if (item.getUserPlatform().equals(userPlatform)) {
                     loginUserList.add(item);
                 }

+ 0 - 5
coffee-common/src/main/java/com/coffee/common/cache/ClusterConfigStorage.java

@@ -1,20 +1,15 @@
 package com.coffee.common.cache;
 
 import cn.hutool.core.util.StrUtil;
-import cn.hutool.extra.spring.SpringUtil;
 import com.baomidou.mybatisplus.annotation.IEnum;
 import com.coffee.common.cache.value.Value;
-import org.springframework.cache.Cache;
-import org.springframework.cache.CacheManager;
 import org.springframework.data.redis.core.BoundHashOperations;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.util.CollectionUtils;
 
-import java.time.Duration;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.concurrent.TimeUnit;
 
 public class ClusterConfigStorage implements ConfigStorage {
     private  BoundHashOperations boundHashOperations;

+ 0 - 1
coffee-common/src/main/java/com/coffee/common/cache/manager/ClusterConfigStorageManager.java

@@ -3,7 +3,6 @@ package com.coffee.common.cache.manager;
 import com.coffee.common.cache.ClusterConfigStorage;
 import com.coffee.common.cache.ConfigStorage;
 import org.redisson.api.RedissonClient;
-import org.springframework.cache.CacheManager;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Component;
 

+ 3 - 5
coffee-common/src/main/java/com/coffee/common/config/CacheHttpServletRequestWrapper.java

@@ -11,15 +11,13 @@ import java.nio.charset.Charset;
 
 public class CacheHttpServletRequestWrapper extends HttpServletRequestWrapper {
 
-    private static final String CHARSET_UTF8 = "UTF-8";
-
     private final byte[] body;
     private String bodyString;
 
     public CacheHttpServletRequestWrapper(HttpServletRequest request) throws IOException {
         super(request);
-        this.bodyString = StreamUtils.copyToString(request.getInputStream(), Charset.forName(CHARSET_UTF8));
-        body = bodyString.getBytes(CHARSET_UTF8);
+        this.bodyString = StreamUtils.copyToString(request.getInputStream(), Charset.defaultCharset());
+        body = bodyString.getBytes(Charset.defaultCharset());
     }
 
     public String getBodyString() {
@@ -28,7 +26,7 @@ public class CacheHttpServletRequestWrapper extends HttpServletRequestWrapper {
 
     @Override
     public BufferedReader getReader() throws IOException {
-        return new BufferedReader(new InputStreamReader(getInputStream(),CHARSET_UTF8));
+        return new BufferedReader(new InputStreamReader(getInputStream(),Charset.defaultCharset()));
     }
 
     @Override

+ 0 - 1
coffee-common/src/main/java/com/coffee/common/config/CachingContentFilter.java

@@ -1,7 +1,6 @@
 package com.coffee.common.config;
 
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.util.ContentCachingRequestWrapper;
 
 import javax.servlet.*;
 import javax.servlet.annotation.WebFilter;

+ 8 - 12
coffee-common/src/main/java/com/coffee/common/crud/BaseService.java

@@ -1,10 +1,9 @@
 package com.coffee.common.crud;
 
-import cn.dev33.satoken.session.SaSession;
 import cn.dev33.satoken.stp.StpUtil;
-import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
 import cn.hutool.db.sql.Direction;
 import cn.hutool.db.sql.Order;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -25,12 +24,10 @@ import com.coffee.common.entity.QueryParamEntity;
 import com.coffee.common.entity.param.Term;
 import com.coffee.common.exception.CustomException;
 import org.apache.ibatis.binding.MapperMethod;
-import org.springframework.data.domain.PageRequest;
 import org.springframework.jdbc.BadSqlGrammarException;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.io.Serializable;
-import java.sql.SQLSyntaxErrorException;
 import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
@@ -228,12 +225,11 @@ public abstract class BaseService<M extends BaseMapper<E>, E,PK extends Serializ
         if(ObjectUtil.isNotNull(param.getPage())){
             QueryWrapper<E> wrapper = build(param);
             Page<E> page = param.getPage();
-//            page.setCurrent(page.getCurrent()>0?page.getCurrent()-1:0);
             return this.page(page,wrapper);
         }else {
             try {
                 List<E> list = list(build(param));
-                Page<E> page = Page.of(0,1,CollectionUtil.isEmpty(list)?0:list.size());
+                Page<E> page = Page.of(0,1, CollUtil.isEmpty(list)?0:list.size());
                 page.setRecords(list);
                 return page;
             }catch (Exception e){
@@ -256,16 +252,16 @@ public abstract class BaseService<M extends BaseMapper<E>, E,PK extends Serializ
         Set<String> includes = param.getIncludes();
         Set<Term> wheres = param.getWheres();
         Set<Order> orders = param.getOrders();
-        if(CollectionUtil.isNotEmpty(includes)){
+        if(CollUtil.isNotEmpty(includes)){
             queryWrapper.select(includes.toArray(new String[includes.size()+1]));
         }
-        if (CollectionUtil.isNotEmpty(wheres)) {
+        if (CollUtil.isNotEmpty(wheres)) {
             wheres.forEach(term -> term.getType().build(queryWrapper,term));
         }
-        if(CollectionUtil.isNotEmpty(orders)){
+        if(CollUtil.isNotEmpty(orders)){
             orders.forEach(order -> {
                 String field = order.getField();
-                String column = StrUtil.toUnderlineCase(field).toLowerCase();
+                String column = CharSequenceUtil.toUnderlineCase(field).toLowerCase();
                 Direction direction = order.getDirection();
                 if(Direction.ASC==direction){
                     queryWrapper.orderByAsc(column);
@@ -277,7 +273,7 @@ public abstract class BaseService<M extends BaseMapper<E>, E,PK extends Serializ
         else {
             queryWrapper.orderByDesc("create_time");
         }
-        if(StrUtil.isNotEmpty(param.getTenantId())&&!StrUtil.isNullOrUndefined(param.getTenantId())){
+        if(CharSequenceUtil.isNotEmpty(param.getTenantId())&&!CharSequenceUtil.isNullOrUndefined(param.getTenantId())){
             LoginUser loginUser = (LoginUser) StpUtil.getTokenSession().get(com.coffee.common.Constants.LOGIN_USER_KEY);
             //是否为系统用户
             if(loginUser!=null&&Boolean.TRUE.equals(loginUser.getIsSys())){

+ 2 - 2
coffee-common/src/main/java/com/coffee/common/crud/controller/BaseCurdAuthController.java

@@ -1,7 +1,7 @@
 package com.coffee.common.crud.controller;
 
 import cn.dev33.satoken.stp.StpLogic;
-import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import java.util.Arrays;
 import java.util.List;
 
@@ -52,6 +52,6 @@ public interface BaseCurdAuthController {
         }
     }
     default boolean isAuth(){
-        return StrUtil.isEmpty(getPermissionPrefix());
+        return CharSequenceUtil.isEmpty(getPermissionPrefix());
     }
 }

+ 4 - 4
coffee-common/src/main/java/com/coffee/common/crud/controller/BaseDeleteController.java

@@ -1,7 +1,7 @@
 package com.coffee.common.crud.controller;
 
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import com.baomidou.mybatisplus.core.mapper.Mapper;
 import com.coffee.common.crud.BaseService;
 import com.coffee.common.result.R;
@@ -31,7 +31,7 @@ public interface BaseDeleteController<E, K extends Serializable> extends BaseCur
     @ApiOperation(value = "根据ID删除")
     default R delete(@RequestParam("id") K id) {
         deleteAuth();
-        if(StrUtil.isNullOrUndefined(String.valueOf(id))){
+        if(CharSequenceUtil.isNullOrUndefined(String.valueOf(id))){
             return R.success();
         }
         String key=String.valueOf(id);
@@ -54,7 +54,7 @@ public interface BaseDeleteController<E, K extends Serializable> extends BaseCur
     @ApiOperation(value = "根据ID删除")
     default R delete(@RequestBody List<String> ids) {
         deleteAuth();
-        if(CollectionUtil.isEmpty(ids)){
+        if(CollUtil.isEmpty(ids)){
             return R.success();
         }
         return getService()

+ 2 - 2
coffee-common/src/main/java/com/coffee/common/crud/controller/BaseQueryController.java

@@ -1,7 +1,7 @@
 package com.coffee.common.crud.controller;
 
+import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.mapper.Mapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.coffee.common.crud.BaseService;
@@ -50,7 +50,7 @@ public interface BaseQueryController<E, K extends Serializable> extends
     default R<E> getById(@RequestParam("id") K id) {
         queryAuth();
         String key=String.valueOf(id);
-        if(StrUtil.isNullOrUndefined(key)){
+        if(CharSequenceUtil.isNullOrUndefined(key)){
             return R.fail("查询结果不存在");
         }
         return R.success(getService().getById(key));

+ 1 - 2
coffee-common/src/main/java/com/coffee/common/crud/controller/BaseSaveController.java

@@ -7,7 +7,6 @@ import com.coffee.common.entity.TenantGenericEntity;
 import com.coffee.common.result.R;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import org.simpleframework.xml.Attribute;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -18,7 +17,7 @@ import java.util.*;
  * @author lifang
  * @version 1.0.0
  * @ClassName ServiceSaveController.java
- * @Description TODO
+ * @Description
  * @createTime 2022年03月12日 11:25:00
  */
 public interface BaseSaveController<E,K extends Serializable> extends

+ 1 - 1
coffee-common/src/main/java/com/coffee/common/entity/AbstractMsgId.java

@@ -9,7 +9,7 @@ import java.io.Serializable;
  * @author lifang
  * @version 1.0.0
  * @ClassName AbstractMsgId.java
- * @Description TODO
+ * @Description
  * @createTime 2022年05月23日 23:10:00
  */
 @Data

+ 0 - 5
coffee-common/src/main/java/com/coffee/common/entity/RecordCreationEntity.java

@@ -1,10 +1,5 @@
 package com.coffee.common.entity;
 
-import cn.hutool.core.date.DateUtil;
-import com.alibaba.fastjson.annotation.JSONField;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
 import java.util.Date;
 
 /**

+ 0 - 3
coffee-common/src/main/java/com/coffee/common/entity/RecordModifierEntity.java

@@ -1,8 +1,5 @@
 package com.coffee.common.entity;
 
-import com.alibaba.fastjson.annotation.JSONField;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
 import java.util.Date;
 
 

+ 7 - 6
coffee-common/src/main/java/com/coffee/common/util/AddressUtil.java

@@ -1,10 +1,11 @@
 package com.coffee.common.util;
 
 import cn.hutool.core.net.NetUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.core.util.CharsetUtil;
-import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpUtil;
-import com.alibaba.fastjson.JSONObject;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.coffee.common.config.AppConfig;
 import lombok.extern.slf4j.Slf4j;
 
@@ -34,13 +35,13 @@ public class AddressUtil {
         if (AppConfig.isAddressEnabled()) {
             try {
                 String rspStr = HttpUtil.get(IP_URL + "?ip=" + ip + "&json=true", CharsetUtil.CHARSET_GBK);
-                if (StrUtil.isEmpty(rspStr)) {
+                if (CharSequenceUtil.isEmpty(rspStr)) {
                     log.error("获取地理位置异常 {}", ip);
                     return UNKNOWN;
                 }
-                JSONObject obj = JSONObject.parseObject(rspStr);
-                String region = obj.getString("pro");
-                String city = obj.getString("city");
+                JSONObject obj = JSONUtil.parseObj(rspStr);
+                String region = obj.getStr("pro");
+                String city = obj.getStr("city");
                 return String.format("%s %s", region, city);
             } catch (Exception e) {
                 log.error("获取地理位置异常 {}", ip);

+ 1 - 7
coffee-common/src/main/java/com/coffee/common/util/RedissonUtil.java

@@ -1,10 +1,7 @@
 package com.coffee.common.util;
 
 
-import cn.hutool.json.JSONUtil;
 import com.coffee.common.entity.AbstractMsgId;
-import io.netty.channel.DefaultEventLoop;
-import io.netty.channel.EventLoopGroup;
 import lombok.Getter;
 import lombok.extern.slf4j.Slf4j;
 import org.redisson.api.*;
@@ -15,14 +12,13 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
-import java.util.function.BiConsumer;
 import java.util.function.Consumer;
 
 /**
  * @author lifang
  * @version 1.0.0
  * @ClassName RedssionUtil.java
- * @Description TODO
+ * @Description
  * @createTime 2022年05月17日 16:16:00
  */
 @Component
@@ -39,8 +35,6 @@ public class RedissonUtil {
 
     private static Map<String,RLock> lockMap=new ConcurrentHashMap<>();
 
-    private EventLoopGroup eventLoopGroup=new DefaultEventLoop();
-
     public RPatternTopic getPatternTopic(String pattern){
         return redissonClient.getPatternTopic(pattern);
     }

+ 0 - 17
coffee-framework/src/main/java/com/coffee/framework/config/RedissonClientAutoConfiguration.java

@@ -16,38 +16,21 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
 import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
-import org.springframework.boot.autoconfigure.data.redis.RedisProperties.Sentinel;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.core.io.Resource;
 import org.springframework.data.redis.core.RedisOperations;
-import org.springframework.util.ReflectionUtils;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Method;
 import java.time.Duration;
 import java.util.*;
-import java.util.concurrent.TimeUnit;
 
 @Configuration
 @ConditionalOnClass({Redisson.class, RedisOperations.class})
 @AutoConfigureBefore({RedisAutoConfiguration.class})
 @EnableConfigurationProperties({RedissonProperties.class, RedisProperties.class})
 public class RedissonClientAutoConfiguration {
-    private static final String REDIS_PROTOCOL_PREFIX = "redis://";
-    private static final String REDISS_PROTOCOL_PREFIX = "rediss://";
-    @Autowired(
-        required = false
-    )
-    private List<RedissonAutoConfigurationCustomizer> redissonAutoConfigurationCustomizers;
 
     @Autowired
     private RedisProperties redisProperties;
-    @Autowired
-    private ApplicationContext ctx;
 
     public RedissonClientAutoConfiguration() {
     }

+ 3 - 1
coffee-framework/src/main/java/com/coffee/framework/config/SaTokenConfig.java

@@ -37,9 +37,11 @@ public class SaTokenConfig {
         IGNORE_URL.add("/logout");
         IGNORE_URL.add("/common/**");
         IGNORE_URL.add("/*.html");
-        IGNORE_URL.add("/**/.html");
+        IGNORE_URL.add("/**/*.html");
         IGNORE_URL.add("/error");
+        IGNORE_URL.add("/swagger-resources/**");
         IGNORE_URL.add("/swagger-ui/**");
+        IGNORE_URL.add("/webjars/**");
         IGNORE_URL.add("/v2/api-docs/*");
         IGNORE_URL.add("/v2/api-docs");
         IGNORE_URL.add("/authority/captcha/**");

+ 2 - 13
coffee-oss/src/main/java/com/coffee/oss/strategy/impl/AbstractFileStorage.java

@@ -3,8 +3,8 @@ package com.coffee.oss.strategy.impl;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.io.FileTypeUtil;
 import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.core.util.IdUtil;
-import cn.hutool.core.util.StrUtil;
 import com.coffee.common.exception.CustomException;
 import com.coffee.oss.strategy.FileStorageStrategy;
 import org.springframework.web.multipart.MultipartFile;
@@ -33,7 +33,7 @@ public abstract class AbstractFileStorage implements FileStorageStrategy {
     @Override
     public String getFilepath(MultipartFile file, String bizPath) throws IOException {
         String extName = FileUtil.extName(file.getOriginalFilename());
-        if (StrUtil.isBlank(extName)) {
+        if (CharSequenceUtil.isBlank(extName)) {
             extName = FileTypeUtil.getType(file.getInputStream());
         }
         String filename = IdUtil.fastSimpleUUID() + "." + extName;
@@ -41,15 +41,4 @@ public abstract class AbstractFileStorage implements FileStorageStrategy {
         return filepath;
     }
 
-    /**
-     * 上传文件
-     *
-     * @param file
-     * @param bizPath
-     * @return
-     * @throws IOException
-     */
-    @Override
-    public abstract String upload(MultipartFile file, String bizPath) throws IOException;
-
 }

+ 1 - 7
coffee-system/src/main/java/com/coffee/bus/controller/BusClinicController.java

@@ -1,10 +1,8 @@
 package com.coffee.bus.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
-import cn.dev33.satoken.stp.StpLogic;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.mapper.Mapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.coffee.bus.controller.vo.ClinicStatsVo;
 import com.coffee.bus.controller.vo.ClinicEditVo;
@@ -12,11 +10,7 @@ import com.coffee.bus.entity.*;
 import com.coffee.bus.registry.device.DeviceRegistry;
 import com.coffee.bus.service.*;
 import com.coffee.bus.service.dto.*;
-import com.coffee.common.crud.BaseService;
-import com.coffee.common.crud.controller.BaseCrudController;
-import com.coffee.common.crud.controller.BaseSaveController;
 import com.coffee.common.entity.GenericEntity;
-import com.coffee.common.entity.TenantGenericEntity;
 import com.coffee.common.exception.CustomException;
 import com.coffee.common.result.R;
 import io.swagger.annotations.*;
@@ -32,7 +26,7 @@ import java.util.stream.Collectors;
  * @author lifang
  * @version 1.0.0
  * @ClassName BusHospitalController.java
- * @Description TODO
+ * @Description
  * @createTime 2022年03月19日 09:28:00
  */
 @RestController

+ 1 - 5
coffee-system/src/main/java/com/coffee/bus/controller/BusConstantController.java

@@ -3,11 +3,7 @@ package com.coffee.bus.controller;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.coffee.bus.entity.BusConAlarmEntity;
-import com.coffee.bus.entity.BusConDoctor;
-import com.coffee.bus.entity.BusConMixEntity;
 import com.coffee.bus.enums.ConstantEnum;
 import com.coffee.bus.service.constant.AbstractConstantService;
 import com.coffee.common.entity.QueryParamEntity;
@@ -24,7 +20,7 @@ import java.util.stream.Collectors;
  * @author lifang
  * @version 1.0.0
  * @ClassName BusConstantController.java
- * @Description TODO
+ * @Description
  * @createTime 2022年04月08日 10:19:00
  */
 @RestController

+ 1 - 1
coffee-system/src/main/java/com/coffee/bus/controller/BusDeviceController.java

@@ -32,7 +32,7 @@ import java.util.List;
  * @author lifang
  * @version 1.0.0
  * @ClassName BusHospitalController.java
- * @Description TODO
+ * @Description
  * @createTime 2022年03月19日 09:28:00
  * @accendant 龙三郎
  */

+ 1 - 3
coffee-system/src/main/java/com/coffee/bus/controller/BusFormulaController.java

@@ -1,9 +1,7 @@
 package com.coffee.bus.controller;
 
 import com.baomidou.mybatisplus.core.mapper.Mapper;
-import com.coffee.bus.entity.BusEvaluationEntity;
 import com.coffee.bus.entity.BusFormulaEntity;
-import com.coffee.bus.service.LocalBusEvaluationService;
 import com.coffee.bus.service.LocalBusFormulaService;
 import com.coffee.common.crud.BaseService;
 import com.coffee.common.crud.controller.BaseCrudController;
@@ -16,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
  * @author zsl
  * @version 1.0.0
  * @ClassName BusFormulaController.java
- * @Description TODO
+ * @Description
  * @createTime 2022/4/20 8:25
  */
 @RestController

+ 9 - 13
coffee-system/src/main/java/com/coffee/bus/controller/BusPatientController.java

@@ -3,8 +3,7 @@ package com.coffee.bus.controller;
 import cn.dev33.satoken.SaManager;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.dev33.satoken.stp.StpLogic;
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.collection.CollUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.mapper.Mapper;
@@ -28,10 +27,7 @@ import lombok.AllArgsConstructor;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.context.request.async.DeferredResult;
-
-import javax.validation.constraints.NotNull;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * @author lifang
@@ -91,7 +87,7 @@ public class BusPatientController  implements BaseQueryController<BusPatientEnti
             @ApiResponse(code =200 ,message = "若存在不可以结束的临床信息,返回1",response = BusDeviceRunningEntity.class)
     })
     public R<Boolean> judgeFinished(@RequestBody List<String> patientCodes){
-        if(CollectionUtil.isEmpty(patientCodes)){
+        if(CollUtil.isEmpty(patientCodes)){
             throw new CustomException("请选择一个病患");
         }
         return R.success(infusionService.count(new QueryWrapper<BusInfusionHistoryEntity>()
@@ -106,7 +102,7 @@ public class BusPatientController  implements BaseQueryController<BusPatientEnti
     @SaCheckPermission("bus:patient:finished")
     @ApiResponse(code = 4001,message = "病号当前绑定了多个设备,不可结束管理")
     @ApiOperation(value = "结束管理",notes = "病患当前绑定主设备必须要在关机、不在服务器、待机中才能结束管理,权限【bus:patient:finished】")
-    public R finished(@PathVariable("monitorType")@ApiParam(value = "是否为无泵管理 false、无泵 true、有泵",defaultValue = "false" ) boolean haveDevice,
+    public R<Boolean> finished(@PathVariable("monitorType")@ApiParam(value = "是否为无泵管理 false、无泵 true、有泵",defaultValue = "false" ) boolean haveDevice,
                       @RequestBody MonitorFinishedVo monitorFinishedVo,
                       @RequestAttribute("tenantId")@ApiParam(hidden = true) String tenantId){
         if(haveDevice){
@@ -129,9 +125,9 @@ public class BusPatientController  implements BaseQueryController<BusPatientEnti
      */
     private R<Boolean> monitorFinished(MonitorFinishedVo monitorFinishedVo, String tenantId){
         List<String> patientCodes = monitorFinishedVo.getPatientCodes();
-        if(CollectionUtil.isEmpty(patientCodes)){
+        if(CollUtil.isEmpty(patientCodes)){
             List<String> clinicIds = monitorFinishedVo.getClinicIds();
-            if (CollectionUtil.isEmpty(clinicIds)) {
+            if (CollUtil.isEmpty(clinicIds)) {
                 throw new CustomException("未选择临床信息");
             }
         }
@@ -162,7 +158,7 @@ public class BusPatientController  implements BaseQueryController<BusPatientEnti
      */
     private R<Boolean> manualFinished(MonitorFinishedVo monitorFinishedVo){
         List<String> clinicIds = monitorFinishedVo.getClinicIds();
-        if (CollectionUtil.isEmpty(clinicIds)) {
+        if (CollUtil.isEmpty(clinicIds)) {
             throw new CustomException("未选择临床信息");
         }
         manualService.finishedMonitor(monitorFinishedVo);
@@ -173,7 +169,7 @@ public class BusPatientController  implements BaseQueryController<BusPatientEnti
     @PostMapping("/monitor/reset/{clinicId}")
     @SaCheckPermission("device:patient:edit")
     @ApiOperation(value = "病人当前监控时间重启",notes = "当结束临床后有新的输注信息产生,那么病人监控会重新显示,此时监控时间不会重新计算,需先调用该接口,权限标识为【device:patient:edit】")
-    public R reset(@ApiParam("临床id")@PathVariable("clinicId")String clinicId){
+    public R<Boolean> reset(@ApiParam("临床id")@PathVariable("clinicId")String clinicId){
         R<Boolean> result = R.success(clinicService.update(new UpdateWrapper<BusClinicEntity>().lambda().eq(BusClinicEntity::getId, clinicId)
                 .set(BusClinicEntity::getEndTime, null)));
         BusClinicEntity clinic = clinicService.getById(clinicId);
@@ -286,14 +282,14 @@ public class BusPatientController  implements BaseQueryController<BusPatientEnti
     @ApiOperation(value = "泵重复绑定数量",notes = "权限标识为【bus:patient:query】")
     @PostMapping("/_count/repeat")
     public R<Integer> repeatCount(){
-        return R.success(CollectionUtil.size(patientService.repeatDevice()));
+        return R.success(CollUtil.size(patientService.repeatDevice()));
     }
 
     @SaCheckPermission("device:patient:query")
     @ApiOperation(value = "无泵数量",notes = "权限标识为【bus:patient:query】")
     @PostMapping("/_count/none")
     public R<Integer> noneCount(){
-        return R.success(CollectionUtil.size(patientService.repeatDevice()));
+        return R.success(CollUtil.size(patientService.repeatDevice()));
     }
     /**
      * 描述:

+ 1 - 1
coffee-system/src/main/java/com/coffee/bus/controller/BusStatsAnalyseController.java

@@ -29,7 +29,7 @@ import java.util.*;
 @RequestMapping("/stats/analgesia")
 @Api(tags = "镇痛分析",description = "统一权限前缀(stats:analyse),例如新增stats:analyse:add")
 public class BusStatsAnalyseController {
-    private final Map<StatsAnalyseEnum,CommonStats> statsMap=new HashMap<>();
+    private final Map<StatsAnalyseEnum,CommonStats> statsMap=new EnumMap<>(StatsAnalyseEnum.class);
 
     private final LocalBusInfusionHistoryService infusionHistoryService;
 

+ 0 - 10
coffee-system/src/main/java/com/coffee/bus/controller/vo/DeviceRunningMockVo.java

@@ -2,21 +2,11 @@ package com.coffee.bus.controller.vo;
 
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
-import com.coffee.bus.enums.DeviceAlarmEnum;
-import com.coffee.bus.enums.DeviceStatusEnum;
 import com.coffee.bus.enums.DeviceTypeEnum;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import org.apache.ibatis.type.EnumTypeHandler;
-
-import javax.validation.constraints.DecimalMax;
-import javax.validation.constraints.DecimalMin;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import java.math.BigDecimal;
-import java.util.Date;
 
 /**
  * @author lifang

+ 8 - 12
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceAlarmEntity.java

@@ -1,6 +1,5 @@
 package com.coffee.bus.entity;
 
-import cn.hutool.crypto.asymmetric.Sign;
 import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
@@ -34,7 +33,7 @@ import java.util.Date;
 @ToString
 public class BusDeviceAlarmEntity extends TenantGenericEntity<String,String> {
 
-    @ApiModelProperty(value = "设备唯一编码",readOnly = true)
+    @ApiModelProperty(value = "设备唯一编码",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private String deviceId;
 
     @ApiModelProperty(value = "报警时间")
@@ -54,27 +53,27 @@ public class BusDeviceAlarmEntity extends TenantGenericEntity<String,String> {
     @ApiModelProperty(value = "输注记录")
     private String infusionId;
 
-    @ApiModelProperty(value = "泵运行状态",readOnly = true)
+    @ApiModelProperty(value = "泵运行状态",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private DeviceStatusEnum runState;
 
-    @ApiModelProperty(value = "报警信息",readOnly = true)
+    @ApiModelProperty(value = "报警信息",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private DeviceAlarmEnum alarmState;
 
-    @ApiModelProperty(value = "输注即将结束提醒",readOnly = true)
+    @ApiModelProperty(value = "输注即将结束提醒",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private Boolean warnWillFinished;
 
-    @ApiModelProperty(value = "镇痛不足提醒",readOnly = true)
+    @ApiModelProperty(value = "镇痛不足提醒",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private Boolean warnAnalgesicPoor;
 
-    @ApiModelProperty(value = "电量偏低提醒",readOnly = true)
+    @ApiModelProperty(value = "电量偏低提醒",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private Boolean warnLowBattery;
 
-    @ApiModelProperty(value = "加减档提示",readOnly = true)
+    @ApiModelProperty(value = "加减档提示",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private FlowStatusEnum warnFlow;
 
@@ -159,10 +158,7 @@ public class BusDeviceAlarmEntity extends TenantGenericEntity<String,String> {
         if (Boolean.TRUE.equals(history.getWarnWillFinished())) {
             return true;
         }
-        if (history.getWarnFlow()!=null) {
-            return true;
-        }
-        return false;
+        return history.getWarnFlow()!=null;
     }
 
 

+ 1 - 9
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceEntity.java

@@ -1,19 +1,13 @@
 package com.coffee.bus.entity;
 
-import com.alibaba.fastjson.annotation.JSONField;
-import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.aliyuncs.iot.model.v20180120.QueryDeviceDetailResponse;
 import com.aliyuncs.iot.model.v20180120.QueryDeviceResponse;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
 import com.coffee.aliyun.utils.EnumUtils;
 import com.coffee.bus.bean.AliIotConfig;
-import com.coffee.bus.enums.DeviceAlarmEnum;
 import com.coffee.bus.enums.DeviceStatusEnum2;
 import com.coffee.bus.enums.DeviceTypeEnum;
-import com.coffee.bus.enums.DeviceStatusEnum;
-import com.coffee.common.entity.RecordCreationEntity;
-import com.coffee.common.entity.RecordModifierEntity;
 import com.coffee.common.entity.TenantGenericEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -22,8 +16,6 @@ import lombok.EqualsAndHashCode;
 import lombok.ToString;
 import org.hibernate.validator.constraints.Length;
 
-import java.util.Date;
-
 /**
  * @author lifang
  * @version 1.0.0
@@ -75,7 +67,7 @@ public class BusDeviceEntity extends TenantGenericEntity<String,String> {
     @TableLogic(value = "0",delval = "1")
     private Integer isDelete;
 
-    @ApiModelProperty(value = "设备在线状态,0未激活,1在线,2离线",readOnly = true)
+    @ApiModelProperty(value = "设备在线状态,0未激活,1在线,2离线",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private DeviceStatusEnum2 status;
 
     /**

+ 1 - 12
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceHistoryEntity.java

@@ -1,25 +1,14 @@
 package com.coffee.bus.entity;
 
 import cn.hutool.core.bean.BeanUtil;
-import com.baomidou.mybatisplus.annotation.FieldStrategy;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.coffee.bus.entity.common.CommonDeviceParam;
-import com.coffee.bus.enums.DeviceAlarmEnum;
-import com.coffee.bus.enums.DeviceTypeEnum;
-import com.coffee.bus.enums.DeviceStatusEnum;
-import com.coffee.common.entity.TenantGenericEntity;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import javax.validation.constraints.DecimalMax;
-import javax.validation.constraints.DecimalMin;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -49,7 +38,7 @@ public class BusDeviceHistoryEntity extends CommonDeviceParam<String,String> {
     @JsonIgnoreProperties
     private Boolean master;
 
-    @ApiModelProperty(value = "数据上传时间",readOnly = true,hidden = true)
+    @ApiModelProperty(value = "数据上传时间",accessMode = ApiModelProperty.AccessMode.READ_ONLY,hidden = true)
     @JsonIgnoreProperties(allowSetters = true)
     private Date uploadTime;
 

+ 10 - 10
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceManualEntity.java

@@ -20,7 +20,7 @@ import java.util.Map;
  * @author lifang
  * @version 1.0.0
  * @ClassName BusDocEntity.java
- * @Description TODO
+ * @Description
  * @createTime 2022年04月09日 16:12:00
  */
 @EqualsAndHashCode(callSuper = true)
@@ -36,7 +36,7 @@ public class BusDeviceManualEntity extends GenericEntity<String> {
     @TableField(typeHandler = FastjsonTypeHandler.class)
     private Map<String,Object> config;
 
-    @ApiModelProperty(value = "公共参数-总量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-总量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 999,message = "总量最大值不得超过999")
     @Min(value = 0,message ="总量最小值不得超过0" )
     private Integer totalDose;
@@ -45,40 +45,40 @@ public class BusDeviceManualEntity extends GenericEntity<String> {
     @JsonIgnore
     private String clinicId;
 
-    @ApiModelProperty(value = "公共参数-自控锁时",readOnly = true)
+    @ApiModelProperty(value = "公共参数-自控锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer selfControlLockTime;
 
-    @ApiModelProperty(value = "公共参数-自控量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-自控量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private BigDecimal selfControlDose;
 
-    @ApiModelProperty(value = "机械泵、电子脉冲泵-持续量",readOnly = true)
+    @ApiModelProperty(value = "机械泵、电子脉冲泵-持续量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "50",message = "持续给液量最大值不得超过50")
     @DecimalMin(value = "0",message ="持续给液量最小值不得超过0" )
     private BigDecimal continueDose;
 
 
-    @ApiModelProperty(value = "电子泵、电子脉冲泵-首次量",readOnly = true)
+    @ApiModelProperty(value = "电子泵、电子脉冲泵-首次量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 50,message = "首次量最大值不得超过50")
     @Min(value = 0,message ="首次量最小值不得超过0" )
     private Integer firstDose;
 
 
-    @ApiModelProperty(value = "电子脉冲泵-脉冲首次锁时",readOnly = true)
+    @ApiModelProperty(value = "电子脉冲泵-脉冲首次锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 60,message = "脉冲首次锁时最大值不得超过60")
     @Min(value = 0,message ="脉冲首次锁时最小值不得超过0" )
     private Integer firstLockTime;
 
-    @ApiModelProperty(value = "电子脉冲泵-脉冲量",readOnly = true)
+    @ApiModelProperty(value = "电子脉冲泵-脉冲量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 20,message = "脉冲量最大值不得超过20")
     @Min(value = 0,message ="脉冲量最小值不得超过0" )
     private Integer pulseDose;
 
-    @ApiModelProperty(value = "电子脉冲泵-脉冲锁时",readOnly = true)
+    @ApiModelProperty(value = "电子脉冲泵-脉冲锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 90,message = "脉冲锁时最大值不得超过90")
     @Min(value = 30,message ="脉冲锁时最小值不得超过30" )
     private Integer pulseLockTime;
 
-    @ApiModelProperty(value = "电子脉冲泵、电子泵-极限量",readOnly = true)
+    @ApiModelProperty(value = "电子脉冲泵、电子泵-极限量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "90",message = "PCA追加量最大值不得超过90")
     @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
     private BigDecimal maxDose;

+ 2 - 8
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceRunningEntity.java

@@ -53,7 +53,7 @@ public class BusDeviceRunningEntity extends CommonDeviceParam<String,String> {
     @ApiModelProperty(value = "设备别名")
     private String alias;
 
-    @ApiModelProperty(value = "输注开始时间,即本次运行开机时间",readOnly = true)
+    @ApiModelProperty(value = "输注开始时间,即本次运行开机时间",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Date startTime;
 
     @ApiModelProperty(value = "是否已撤泵,0、未撤泵1、已撤泵")
@@ -72,7 +72,7 @@ public class BusDeviceRunningEntity extends CommonDeviceParam<String,String> {
     private Boolean master;
 
 
-    @ApiModelProperty(value = "数据上传时间",readOnly = true,hidden = true)
+    @ApiModelProperty(value = "数据上传时间",accessMode = ApiModelProperty.AccessMode.READ_ONLY,hidden = true)
     @JsonIgnoreProperties(allowSetters = true)
     private Date uploadTime;
 
@@ -179,12 +179,6 @@ public class BusDeviceRunningEntity extends CommonDeviceParam<String,String> {
         result.setMonitorType(this.getMonitorType());
         result.setUploadTime(this.getUploadTime());
 
-//        runningEntity.setInfusionModifyId(this.getInfusionModifyId());
-//        f
-//        runningEntity.setRemark(this.getRemark());
-//        runningEntity.setStartTime(this.getStartTime());
-//        runningEntity.setClinicId(this.getClinicId());
-
         return result;
     }
 

+ 33 - 47
coffee-system/src/main/java/com/coffee/bus/entity/BusInfusionModifyEntity.java

@@ -1,6 +1,5 @@
 package com.coffee.bus.entity;
 
-import cn.hutool.crypto.asymmetric.Sign;
 import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
@@ -44,119 +43,119 @@ public class BusInfusionModifyEntity extends TenantGenericEntity<String,String>
     @ApiModelProperty(value = "参数修改时间")
     private Date modifyTime;
 
-    @ApiModelProperty(value = "网络泵id",readOnly = true)
+    @ApiModelProperty(value = "网络泵id",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private String deviceId;
 
-    @ApiModelProperty(value = "数据分类号,标识某些数据属于同一个输注",readOnly = true)
+    @ApiModelProperty(value = "数据分类号,标识某些数据属于同一个输注",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @JsonIgnoreProperties(allowSetters = true)
     private String classification;
 
-    @ApiModelProperty(value = "数据编号",readOnly = true)
+    @ApiModelProperty(value = "数据编号",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @JsonIgnoreProperties(allowSetters = true)
     private Integer dataNumber;
 
-    @ApiModelProperty(value = "泵类型",readOnly = true)
+    @ApiModelProperty(value = "泵类型",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.NEVER)
     private DeviceTypeEnum type;
 
-    @ApiModelProperty(value = "总量",readOnly = true)
+    @ApiModelProperty(value = "总量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 999,message = "总量最大值不得超过999")
     @Min(value = 0,message ="总量最小值不得超过0" )
     private Integer totalDose;
 
-    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-首次量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 50,message = "首次量最大值不得超过50")
     @Min(value = 0,message ="首次量最小值不得超过0" )
     private Integer firstDose;
 
 
-    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-剩余量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private BigDecimal remainDose;
 
-    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-已输入量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private BigDecimal inputDose;
 
-    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-追加量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
     @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
     private BigDecimal appendDose;
 
-    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
+    @ApiModelProperty(value = "公共参数-追加锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
     @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
     private BigDecimal appendLockTime;
 
-    @ApiModelProperty(value = "公共参数-极限量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-极限量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "90",message = "PCA追加量最大值不得超过90")
     @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
     private BigDecimal maxDose;
 
-    @ApiModelProperty(value = "公共参数-自控锁时",readOnly = true)
+    @ApiModelProperty(value = "公共参数-自控锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer selfControlLockTime;
 
-    @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
+    @ApiModelProperty(value = "公共参数-自控次数",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer selfControlCount;
 
-    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
+    @ApiModelProperty(value = "公共参数-pca有效次数",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer pcaValidCount;
 
-    @ApiModelProperty(value = "公共参数-pca无效次数",readOnly = true)
+    @ApiModelProperty(value = "公共参数-pca无效次数",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer pcaInvalidCount;
 
-    @ApiModelProperty(value = "公共参数-pca总按次数",readOnly = true)
+    @ApiModelProperty(value = "公共参数-pca总按次数",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer pcaTotalCount;
 
-    @ApiModelProperty(value = "持续泵参数-持续量",readOnly = true)
+    @ApiModelProperty(value = "持续泵参数-持续量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "50",message = "持续给液量最大值不得超过50")
     @DecimalMin(value = "0",message ="持续给液量最小值不得超过0" )
     private BigDecimal continueDose;
 
-    @ApiModelProperty(value = "脉冲泵参数-脉冲量",readOnly = true)
+    @ApiModelProperty(value = "脉冲泵参数-脉冲量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 20,message = "脉冲量最大值不得超过20")
     @Min(value = 0,message ="脉冲量最小值不得超过0" )
     private Integer pulseDose;
 
-    @ApiModelProperty(value = "脉冲泵参数-脉冲锁时",readOnly = true)
+    @ApiModelProperty(value = "脉冲泵参数-脉冲锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 90,message = "脉冲锁时最大值不得超过90")
     @Min(value = 30,message ="脉冲锁时最小值不得超过30" )
     private Integer pulseLockTime;
 
-    @ApiModelProperty(value = "脉冲泵参数-脉冲首次锁时",readOnly = true)
+    @ApiModelProperty(value = "脉冲泵参数-脉冲首次锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 60,message = "脉冲首次锁时最大值不得超过60")
     @Min(value = 0,message ="脉冲首次锁时最小值不得超过0" )
     private Integer pulseFirstLockTime;
 
-    @ApiModelProperty(value = "智能泵参数-加档周期",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-加档周期",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "10",message = "加档周期最大值不得超过10")
     @DecimalMin(value = "0.5",message ="加档周期最小值不得超过0.5" )
     private BigDecimal flowUpCycle;
 
-    @ApiModelProperty(value = "智能泵参数-减档周期",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-减档周期",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "10",message = "减档周期最大值不得超过10")
     @DecimalMin(value = "0.5",message ="减档周期最小值不得超过0.5" )
     private BigDecimal flowDownCycle;
 
-    @ApiModelProperty(value = "智能泵参数-计次",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-计次",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
     @DecimalMin(value = "1",message ="PCA追加量最小值不得超过1" )
     private BigDecimal flowCount;
 
-    @ApiModelProperty(value = "智能泵参数-上限",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-上限",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "50",message = "智能泵上限值最大值不得超过90")
     @DecimalMin(value = "1",message ="智能泵上限值最小值不得超过0" )
     private BigDecimal flowUpLimit;
 
-    @ApiModelProperty(value = "智能泵参数-下限",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-下限",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "50",message = "智能泵下限值最大值不得超过50")
     @DecimalMin(value = "0.1",message ="智能泵下限值最小值不得超过0.1" )
     private BigDecimal flowDownLimit;
 
-    @ApiModelProperty(value = "智能泵参数-自调比例",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-自调比例",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "95",message = "自调比例不得超过95")
     @DecimalMin(value = "0",message ="自调比例最小值不得超过0" )
     private BigDecimal flowAdjustRate;
 
-    @ApiModelProperty(value = "公共参数-电量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-电量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer electricQuantity;
     public static BusInfusionModifyEntity parseRunningInfo(BusDeviceRunningEntity running){
         BusInfusionModifyEntity entity = new BusInfusionModifyEntity();
@@ -202,41 +201,28 @@ public class BusInfusionModifyEntity extends TenantGenericEntity<String,String>
     public String signParam(){
         //保证参数有序
         JSONObject param = new JSONObject(true);
-
+        param.putOpt("continueDose",this.getContinueDose());
+        param.putOpt("firstDose",this.getFirstDose());
+        param.putOpt("appendDose",this.getAppendDose());
+        param.putOpt("appendLockTime",this.getAppendLockTime());
+        param.putOpt("maxDose",this.getMaxDose());
+        param.putOpt("classification",this.getClassification());
         //加密过程中,加入分包标识,保证新的输注的输注参数必定发生改变
         switch (this.getType()){
             case continuous:
-                param.putOpt("continueDose",this.getContinueDose());
-                param.putOpt("firstDose",this.getFirstDose());
-                param.putOpt("appendDose",this.getAppendDose());
-                param.putOpt("appendLockTime",this.getAppendLockTime());
-                param.putOpt("maxDose",this.getMaxDose());
-                param.putOpt("classification",this.getClassification());
                 break;
             case pulse:
-                param.putOpt("firstDose",this.getFirstDose());
                 param.putOpt("firstLockTime",this.getPulseFirstLockTime());
-                param.putOpt("continueDose",this.getContinueDose());
                 param.putOpt("pulseDose",this.getPulseDose());
                 param.putOpt("lockTime",this.getPulseLockTime());
-                param.putOpt("appendDose",this.getAppendDose());
-                param.putOpt("appendLockTime",this.getAppendLockTime());
-                param.putOpt("maxDose",this.getMaxDose());
-                param.putOpt("classification",this.getClassification());
                 break;
             case intelligent:
-                param.putOpt("firstDose",this.getFirstDose());
-                param.putOpt("appendDose",this.getAppendDose());
-                param.putOpt("appendLockTime",this.getAppendLockTime());
                 param.putOpt("flowUpCycle",this.getFlowUpCycle());
                 param.putOpt("flowCount",this.getFlowCount());
                 param.putOpt("flowDownCycle",this.getFlowDownCycle());
                 param.putOpt("flowAdjustRate",this.getFlowAdjustRate());
                 param.putOpt("flowUpLimit",this.getFlowUpLimit());
                 param.putOpt("flowDownLimit",this.getFlowDownLimit());
-                param.putOpt("continueDose",this.getContinueDose());
-                param.putOpt("maxDose",this.getMaxDose());
-                param.putOpt("classification",this.getClassification());
                 break;
             default:break;
         }

+ 12 - 13
coffee-system/src/main/java/com/coffee/bus/entity/common/CommonDeviceParam.java

@@ -1,13 +1,12 @@
 package com.coffee.bus.entity.common;
 
-import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.coffee.bus.enums.DeviceAlarmEnum;
 import com.coffee.bus.enums.DeviceStatusEnum;
 import com.coffee.bus.enums.FlowStatusEnum;
 import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.experimental.Accessors;
@@ -21,32 +20,32 @@ import lombok.experimental.Accessors;
  */
 @Accessors(chain = true)
 @Data
-public class CommonDeviceParam<PK,TN>  extends DeviceProperties<PK,TN>  {
+public class CommonDeviceParam<K,T>  extends DeviceProperties<K,T>  {
 
-    @ApiModelProperty(value = "泵运行状态",readOnly = true)
+    @ApiModelProperty(value = "泵运行状态",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private DeviceStatusEnum runState;
 
-    @ApiModelProperty(value = "报警信息",readOnly = true)
+    @ApiModelProperty(value = "报警信息",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private DeviceAlarmEnum alarm;
 
-    @ApiModelProperty(value = "输注即将结束提醒",readOnly = true)
+    @ApiModelProperty(value = "输注即将结束提醒",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     @JsonIgnore
     private Boolean warnWillFinished;
 
-    @ApiModelProperty(value = "镇痛不足提醒",readOnly = true)
+    @ApiModelProperty(value = "镇痛不足提醒",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     @JsonIgnore
     private Boolean warnAnalgesicPoor;
 
-    @ApiModelProperty(value = "电量偏低提醒",readOnly = true)
+    @ApiModelProperty(value = "电量偏低提醒",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     @JsonIgnore
     private Boolean warnLowBattery;
 
-    @ApiModelProperty(value = "加减档提示",readOnly = true)
+    @ApiModelProperty(value = "加减档提示",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     @JsonIgnore
     private FlowStatusEnum warnFlow;
@@ -59,7 +58,7 @@ public class CommonDeviceParam<PK,TN>  extends DeviceProperties<PK,TN>  {
         if(!Boolean.TRUE.equals(this.warnWillFinished)){
             return;
         }
-        if (StrUtil.isEmpty(this.warns)) {
+        if (CharSequenceUtil.isEmpty(this.warns)) {
             this.warns="输注即将结束;";
         }else {
             this.warns=this.warns+"输注即将结束;";
@@ -70,7 +69,7 @@ public class CommonDeviceParam<PK,TN>  extends DeviceProperties<PK,TN>  {
         if(!Boolean.TRUE.equals(this.warnAnalgesicPoor)){
             return;
         }
-        if (StrUtil.isEmpty(this.warns)) {
+        if (CharSequenceUtil.isEmpty(this.warns)) {
             this.warns="镇痛不足;";
         }else {
             this.warns=this.warns+"镇痛不足;";
@@ -81,7 +80,7 @@ public class CommonDeviceParam<PK,TN>  extends DeviceProperties<PK,TN>  {
         if(!Boolean.TRUE.equals(this.warnLowBattery)){
             return;
         }
-        if (StrUtil.isEmpty(this.warns)) {
+        if (CharSequenceUtil.isEmpty(this.warns)) {
             this.warns="电量偏低;";
         }else {
             this.warns=this.warns+"电量偏低;";
@@ -92,7 +91,7 @@ public class CommonDeviceParam<PK,TN>  extends DeviceProperties<PK,TN>  {
         if(this.warnFlow==null){
             return;
         }
-        if (StrUtil.isEmpty(this.warns)) {
+        if (CharSequenceUtil.isEmpty(this.warns)) {
             this.warns=warnFlow.getText()+";";
         }else {
             this.warns=this.warns+warnFlow.getText()+";";

+ 28 - 28
coffee-system/src/main/java/com/coffee/bus/entity/common/DeviceProperties.java

@@ -22,19 +22,19 @@ import java.math.BigDecimal;
  * @createTime 2022年05月06日 09:06:00
  */
 @Data
-public class DeviceProperties<PK,TN>  extends TenantGenericEntity<PK,TN> {
-    @ApiModelProperty(value = "网络泵id",readOnly = true)
+public class DeviceProperties<K,T>  extends TenantGenericEntity<K,T> {
+    @ApiModelProperty(value = "网络泵id",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private String deviceId;
 
-    @ApiModelProperty(value = "数据分类号,标识某些数据属于同一个输注",readOnly = true)
+    @ApiModelProperty(value = "数据分类号,标识某些数据属于同一个输注",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @JsonIgnoreProperties(allowSetters = true)
     private String classification;
 
-    @ApiModelProperty(value = "数据编号",readOnly = true)
+    @ApiModelProperty(value = "数据编号",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @JsonIgnoreProperties(allowSetters = true)
     private Integer dataNumber;
 
-    @ApiModelProperty(value = "泵类型",readOnly = true)
+    @ApiModelProperty(value = "泵类型",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @TableField(updateStrategy = FieldStrategy.NEVER)
     private DeviceTypeEnum type;
 
@@ -47,103 +47,103 @@ public class DeviceProperties<PK,TN>  extends TenantGenericEntity<PK,TN> {
     @ApiModelProperty(value = "床号")
     private String bedNo;
 
-    @ApiModelProperty(value = "总量",readOnly = true)
+    @ApiModelProperty(value = "总量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 999,message = "总量最大值不得超过999")
     @Min(value = 0,message ="总量最小值不得超过0" )
     private Integer totalDose;
 
-    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-首次量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 50,message = "首次量最大值不得超过50")
     @Min(value = 0,message ="首次量最小值不得超过0" )
     private Integer firstDose;
 
 
-    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-剩余量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private BigDecimal remainDose;
 
-    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-已输入量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private BigDecimal inputDose;
 
-    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-追加量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
     @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
     private BigDecimal appendDose;
 
-    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
+    @ApiModelProperty(value = "公共参数-追加锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
     @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
     private BigDecimal appendLockTime;
 
-    @ApiModelProperty(value = "公共参数-极限量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-极限量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "90",message = "PCA追加量最大值不得超过90")
     @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
     private BigDecimal maxDose;
 
-    @ApiModelProperty(value = "公共参数-自控锁时",readOnly = true)
+    @ApiModelProperty(value = "公共参数-自控锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer selfControlLockTime;
 
-    @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
+    @ApiModelProperty(value = "公共参数-自控次数",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer selfControlCount;
 
-    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
+    @ApiModelProperty(value = "公共参数-pca有效次数",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer pcaValidCount;
 
-    @ApiModelProperty(value = "公共参数-pca无效次数",readOnly = true)
+    @ApiModelProperty(value = "公共参数-pca无效次数",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer pcaInvalidCount;
 
-    @ApiModelProperty(value = "公共参数-pca总按次数",readOnly = true)
+    @ApiModelProperty(value = "公共参数-pca总按次数",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer pcaTotalCount;
 
-    @ApiModelProperty(value = "持续泵参数-持续量",readOnly = true)
+    @ApiModelProperty(value = "持续泵参数-持续量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "50",message = "持续给液量最大值不得超过50")
     @DecimalMin(value = "0",message ="持续给液量最小值不得超过0" )
     private BigDecimal continueDose;
 
-    @ApiModelProperty(value = "脉冲泵参数-脉冲量",readOnly = true)
+    @ApiModelProperty(value = "脉冲泵参数-脉冲量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 20,message = "脉冲量最大值不得超过20")
     @Min(value = 0,message ="脉冲量最小值不得超过0" )
     private Integer pulseDose;
 
-    @ApiModelProperty(value = "脉冲泵参数-脉冲锁时",readOnly = true)
+    @ApiModelProperty(value = "脉冲泵参数-脉冲锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 90,message = "脉冲锁时最大值不得超过90")
     @Min(value = 30,message ="脉冲锁时最小值不得超过30" )
     private Integer pulseLockTime;
 
-    @ApiModelProperty(value = "脉冲泵参数-脉冲首次锁时",readOnly = true)
+    @ApiModelProperty(value = "脉冲泵参数-脉冲首次锁时",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @Max(value = 60,message = "脉冲首次锁时最大值不得超过60")
     @Min(value = 0,message ="脉冲首次锁时最小值不得超过0" )
     private Integer pulseFirstLockTime;
 
-    @ApiModelProperty(value = "智能泵参数-加档周期",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-加档周期",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "10",message = "加档周期最大值不得超过10")
     @DecimalMin(value = "0.5",message ="加档周期最小值不得超过0.5" )
     private BigDecimal flowUpCycle;
 
-    @ApiModelProperty(value = "智能泵参数-减档周期",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-减档周期",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "10",message = "减档周期最大值不得超过10")
     @DecimalMin(value = "0.5",message ="减档周期最小值不得超过0.5" )
     private BigDecimal flowDownCycle;
 
-    @ApiModelProperty(value = "智能泵参数-计次",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-计次",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
     @DecimalMin(value = "1",message ="PCA追加量最小值不得超过1" )
     private BigDecimal flowCount;
 
-    @ApiModelProperty(value = "智能泵参数-上限",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-上限",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "50",message = "智能泵上限值最大值不得超过90")
     @DecimalMin(value = "1",message ="智能泵上限值最小值不得超过0" )
     private BigDecimal flowUpLimit;
 
-    @ApiModelProperty(value = "智能泵参数-下限",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-下限",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "50",message = "智能泵下限值最大值不得超过50")
     @DecimalMin(value = "0.1",message ="智能泵下限值最小值不得超过0.1" )
     private BigDecimal flowDownLimit;
 
-    @ApiModelProperty(value = "智能泵参数-自调比例",readOnly = true)
+    @ApiModelProperty(value = "智能泵参数-自调比例",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @DecimalMax(value = "95",message = "自调比例不得超过95")
     @DecimalMin(value = "0",message ="自调比例最小值不得超过0" )
     private BigDecimal flowAdjustRate;
 
-    @ApiModelProperty(value = "公共参数-电量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-电量",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Integer electricQuantity;
 }

+ 1 - 1
coffee-system/src/main/java/com/coffee/bus/enums/DeviceAlarmEnum.java

@@ -26,7 +26,7 @@ public enum DeviceAlarmEnum  implements IEnum<Integer> {
     Bubble(1,"气泡报警"),
     Jam(2,"堵塞报警"),
     NotBox(3,"未装药盒报警"),
-    InfusionMax(4,"输入总量报警"),
+    InfusionMax(4,"返厂维修"),
     Limit(5,"极限报警"),
     Finished(6,"输液结束"),
     LowBattery(7,"电量耗尽报警"),

+ 0 - 2
coffee-system/src/main/java/com/coffee/bus/hospital/config/AbstractHospitalConfigHandler.java

@@ -1,9 +1,7 @@
 package com.coffee.bus.hospital.config;
 
 import com.coffee.bus.registry.device.DeviceRegistry;
-import com.coffee.bus.registry.patient.PatientRegistry;
 import com.coffee.bus.service.LocalBusInfusionHistoryService;
-import com.coffee.bus.service.LocalBusPatientService;
 import com.coffee.bus.utils.WsPublishUtils;
 import com.coffee.common.cache.ConfigStorage;
 import com.coffee.common.cache.value.Value;

+ 11 - 15
coffee-system/src/main/java/com/coffee/bus/hospital/his/strategy/part/DefaultHisPartStrategyHandler.java

@@ -1,6 +1,6 @@
 package com.coffee.bus.hospital.his.strategy.part;
 
-import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.coffee.bus.entity.BusClinicEntity;
@@ -19,7 +19,7 @@ import java.util.List;
  * @author lifang
  * @version 1.0.0
  * @ClassName DefaultHisPartStrategyHandler.java
- * @Description TODO
+ * @Description
  * @createTime 2022年05月12日 15:01:00
  */
 @Component
@@ -41,13 +41,13 @@ public class DefaultHisPartStrategyHandler implements HisNewStrategyHandler {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void handle(List<BusClinicEntity> source, List<BusClinicEntity> target) {
-        if(CollectionUtil.isEmpty(source)){
+        if(CollUtil.isEmpty(source)){
             return;
         }
         //source.size()<target.size()
         log.info("拉取his只获取一部分病人数据,拉取手术信息{},数据库数据{}", JSONUtil.toJsonStr(source),JSONUtil.toJsonStr(target));
         source.sort(Comparator.comparing(BusClinicEntity::getStartTime));
-        if(CollectionUtil.isEmpty(target)){
+        if(CollUtil.isEmpty(target)){
             //只插入
             insert(target);
         }else {
@@ -96,8 +96,8 @@ public class DefaultHisPartStrategyHandler implements HisNewStrategyHandler {
     private void compareHandler(List<BusClinicEntity> source,List<BusClinicEntity> subTarget){
         source.sort((t1,t2)->t2.getStartTime().compareTo(t1.getStartTime()));
         subTarget.sort((t1,t2)->t2.getStartTime().compareTo(t1.getStartTime()));
-        int sourceSize = CollectionUtil.size(source);
-        int subTargetSize = CollectionUtil.size(subTarget);
+        int sourceSize = CollUtil.size(source);
+        int subTargetSize = CollUtil.size(subTarget);
         int subSize=Math.abs(Math.subtractExact(sourceSize,subTargetSize));
         int minSize=Math.min(sourceSize,subTargetSize);
         for (int i = minSize-1; i >=0; i--) {
@@ -108,8 +108,8 @@ public class DefaultHisPartStrategyHandler implements HisNewStrategyHandler {
                 clinicService.compareFromHis(source.get(i),subTarget.get(i+subSize));
             }
         }
-        if (minSize < CollectionUtil.size(source)) {
-            BusClinicEntity first = CollectionUtil.getFirst(source.iterator());
+        if (minSize < CollUtil.size(source)) {
+            BusClinicEntity first = CollUtil.getFirst(source.iterator());
             clinicService.update(new UpdateWrapper<BusClinicEntity>().lambda()
                     .eq(BusClinicEntity::getPatientCode,first.getPatientCode())
                     .eq(BusClinicEntity::getTenantId,first.getTenantId())
@@ -124,18 +124,14 @@ public class DefaultHisPartStrategyHandler implements HisNewStrategyHandler {
         source.sort((t1,t2)->t2.getStartTime().compareTo(t1.getStartTime()));
         for (int i = 0; i < source.size(); i++) {
             BusClinicEntity clinic = source.get(i);
-            if(i==0){
-                clinic.setFinished(false);
-            }else {
-                clinic.setFinished(true);
-            }
+            clinic.setFinished(i!=0);
             clinicService.insertFromHis(clinic);
         }
-        clinicService.setCurrentClinicByHis(CollectionUtil.getFirst(source.iterator()));
+        clinicService.setCurrentClinicByHis(CollUtil.getFirst(source.iterator()));
     }
 
     @Override
     public boolean apply(List<BusClinicEntity> source, List<BusClinicEntity> target) {
-        return CollectionUtil.isNotEmpty(source);
+        return CollUtil.isNotEmpty(source);
     }
 }

+ 1 - 2
coffee-system/src/main/java/com/coffee/bus/mapper/BusDeviceAlarmMapper.java

@@ -3,7 +3,6 @@ package com.coffee.bus.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.coffee.bus.entity.BusClinicEntity;
 import com.coffee.bus.entity.BusDeviceAlarmEntity;
 import com.coffee.bus.service.dto.*;
 import org.apache.ibatis.annotations.Mapper;
@@ -15,7 +14,7 @@ import java.util.List;
  * @author lifang
  * @version 1.0.0
  * @ClassName BusHospitalMapper.java
- * @Description TODO
+ * @Description
  * @createTime 2022年03月19日 09:15:00
  */
 @Mapper

+ 1 - 1
coffee-system/src/main/java/com/coffee/bus/mapper/BusDeviceRunningMapper.java

@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
  * @author lifang
  * @version 1.0.0
  * @ClassName BusHospitalMapper.java
- * @Description TODO
+ * @Description
  * @createTime 2022年03月19日 09:15:00
  */
 @Mapper

+ 0 - 1
coffee-system/src/main/java/com/coffee/bus/registry/CacheInfo.java

@@ -1,6 +1,5 @@
 package com.coffee.bus.registry;
 
-import org.python.antlr.ast.Str;
 
 /**
  * @author lifang

+ 0 - 3
coffee-system/src/main/java/com/coffee/bus/service/LocalBusDeviceManualService.java

@@ -2,9 +2,6 @@ package com.coffee.bus.service;
 
 import cn.hutool.core.date.LocalDateTimeUtil;
 import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONUtil;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

+ 7 - 5
coffee-system/src/main/java/com/coffee/bus/service/LocalBusDeviceService.java

@@ -1,5 +1,7 @@
 package com.coffee.bus.service;
 
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.core.util.StrUtil;
 import com.aliyuncs.iot.model.v20180120.QueryDeviceDetailResponse;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -79,13 +81,13 @@ public class LocalBusDeviceService extends BaseService<BusDeviceMapper, BusDevic
         if(deviceOperator==null){
             return;
         }
-        if(StrUtil.isNotEmpty(entity.getAlias())){
+        if(CharSequenceUtil.isNotEmpty(entity.getAlias())){
             deviceOperator.setAlias(entity.getAlias());
         }
         if(entity.getEnable()!=null){
             deviceOperator.setEnable(entity.getEnable());
         }
-        if(StrUtil.isNotEmpty(entity.getTenantId())){
+        if(CharSequenceUtil.isNotEmpty(entity.getTenantId())){
             deviceOperator.setTenantId(entity.getTenantId());
         }
     }
@@ -161,7 +163,7 @@ public class LocalBusDeviceService extends BaseService<BusDeviceMapper, BusDevic
         // 从阿里云物联网查询设备
         QueryDeviceDetailResponse response = aliyunIotSdk.queryDeviceDetail(deviceId);
         // 设备存在
-        if (response.getSuccess()){
+        if (Boolean.TRUE.equals(response.getSuccess())){
             // 更新设备参数
             device.updateFields(response.getData());
             // 更新设备
@@ -196,7 +198,7 @@ public class LocalBusDeviceService extends BaseService<BusDeviceMapper, BusDevic
         // 从阿里云物联网查询设备
         QueryDeviceDetailResponse response = aliyunIotSdk.queryDeviceDetail(deviceId);
         // 设备存在
-        if (response.getSuccess()){
+        if (Boolean.TRUE.equals(response.getSuccess())){
             device.updateFields(response.getData());
             // 存储设备
             this.saveDevice(device);
@@ -247,7 +249,7 @@ public class LocalBusDeviceService extends BaseService<BusDeviceMapper, BusDevic
     public int syncDevice(List<String> ids) {
         AtomicReference<Integer> n = new AtomicReference<>(0);
         // ids不能为空
-        if (Objects.isNull(ids) || ids.size() <= 0){
+        if (CollUtil.isEmpty(ids)){
             throw new CustomException("设备id不能为空");
         }
         // 同步指定的设备

+ 5 - 3
coffee-system/src/main/java/com/coffee/bus/service/LocalBusHospitalConfigService.java

@@ -19,7 +19,7 @@ import java.util.Map;
  * @author lifang
  * @version 1.0.0
  * @ClassName LocalBusHospitalService.java
- * @Description TODO
+ * @Description
  * @createTime 2022年03月19日 09:27:00
  */
 @Service
@@ -90,7 +90,8 @@ public class LocalBusHospitalConfigService extends BaseService<BusHospitalConfig
 
         try {
             this.save(otherConfig);
-        } catch (Exception e){
+        } finally {
+
         }
 
         BusHospitalConfigEntity undoConfig = new BusHospitalConfigEntity();
@@ -99,7 +100,8 @@ public class LocalBusHospitalConfigService extends BaseService<BusHospitalConfig
         undoConfig.setConfig(getUndoDefault());
         try {
             this.save(undoConfig);
-        } catch (Exception e){
+        } finally {
+
         }
     }
 

+ 1 - 1
coffee-system/src/main/java/com/coffee/bus/service/constant/AbstractConstantService.java

@@ -13,7 +13,7 @@ import java.io.Serializable;
  * @Description 常量继承类
  * @createTime 2022年04月09日 10:19:00
  */
-public abstract class AbstractConstantService<M extends BaseMapper<E>, E,PK extends Serializable> extends BaseService<M,E,PK>{
+public abstract class AbstractConstantService<M extends BaseMapper<E>, E,K extends Serializable> extends BaseService<M,E,K>{
     /**
      * 获取常量名称
      * @return

+ 1 - 1
coffee-system/src/main/java/com/coffee/bus/service/dto/AlarmQuery.java

@@ -12,7 +12,7 @@ import javax.validation.constraints.NotNull;
  * @author lifang
  * @version 1.0.0
  * @ClassName AlarmQuery.java
- * @Description TODO
+ * @Description
  * @createTime 2022年05月16日 21:28:00
  */
 @Data

+ 0 - 3
coffee-system/src/main/java/com/coffee/bus/service/dto/ClinicAnalClinicRecord.java

@@ -1,7 +1,5 @@
 package com.coffee.bus.service.dto;
 
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
 import com.coffee.bus.entity.BusClinicEntity;
 import com.coffee.common.enums.SexEnum;
 import io.swagger.annotations.ApiModel;
@@ -10,7 +8,6 @@ import lombok.Data;
 import org.hibernate.validator.constraints.Length;
 
 import java.io.Serializable;
-import java.util.List;
 
 /**
  * @author lifang

+ 0 - 1
coffee-system/src/main/java/com/coffee/bus/service/dto/ClinicAnalInfusionModify.java

@@ -8,7 +8,6 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.Date;
-import java.util.List;
 
 /**
  * 访视记录单中返回的输注数据

+ 2 - 4
coffee-system/src/main/java/com/coffee/bus/service/dto/ClinicAnalInfusionRecord.java

@@ -1,10 +1,8 @@
 package com.coffee.bus.service.dto;
 
 import cn.hutool.core.bean.BeanUtil;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.coffee.bus.entity.BusInfusionHistoryEntity;
 import com.coffee.bus.entity.common.DeviceProperties;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -32,10 +30,10 @@ public class ClinicAnalInfusionRecord extends DeviceProperties<String,String> {
     @ApiModelProperty(value = "该次输注是否已结束")
     private Boolean finished;
 
-    @ApiModelProperty(value = "当前输注记录数据最后上传时间",readOnly = true,hidden = true)
+    @ApiModelProperty(value = "当前输注记录数据最后上传时间",hidden = true)
     private Date lastUploadTime;
 
-    @ApiModelProperty(value = "输注开始时间,即本次运行开机时间",readOnly = true)
+    @ApiModelProperty(value = "输注开始时间,即本次运行开机时间")
     private Date startTime;
 
     public static ClinicAnalInfusionRecord parse(BusInfusionHistoryEntity source){

+ 0 - 1
coffee-system/src/main/java/com/coffee/bus/service/dto/ClinicAnalRecordResult.java

@@ -7,7 +7,6 @@ import com.coffee.bus.entity.BusInfusionHistoryEntity;
 import com.coffee.bus.entity.BusInfusionModifyEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
 import lombok.Getter;
 import lombok.Setter;
 

+ 6 - 6
coffee-system/src/main/java/com/coffee/bus/service/dto/DeviceResult.java

@@ -16,7 +16,7 @@ import java.util.Date;
  * @author lifang
  * @version 1.0.0
  * @ClassName DeviceResult.java
- * @Description TODO
+ * @Description
  * @createTime 2022年05月11日 13:38:00
  */
 @Data
@@ -32,10 +32,10 @@ public class DeviceResult  implements Serializable {
     @ApiModelProperty(value = "设备类型")
     private DeviceTypeEnum type;
 
-    @ApiModelProperty(value = "运行状态",readOnly = true)
+    @ApiModelProperty(value = "运行状态",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private DeviceStatusEnum runState;
 
-    @ApiModelProperty(value = "报警信息",readOnly = true)
+    @ApiModelProperty(value = "报警信息",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private DeviceAlarmEnum alarm;
 
     @ApiModelProperty(value = "第三方平台返回配置")
@@ -50,13 +50,13 @@ public class DeviceResult  implements Serializable {
     @ApiModelProperty(value = "是否启用,0、不启用 1、启用 ")
     private Boolean enable;
 
-    @ApiModelProperty(value = "设备在线状态,0未激活,1在线,2离线",readOnly = true)
+    @ApiModelProperty(value = "设备在线状态,0未激活,1在线,2离线",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private DeviceStatusEnum2 status;
 
-    @ApiModelProperty(value = "创建时间",readOnly = true)
+    @ApiModelProperty(value = "创建时间",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Date createTime;
 
-    @ApiModelProperty(value = "修改时间",readOnly = true)
+    @ApiModelProperty(value = "修改时间",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     private Date updateTime;
 
     private String tenantName;

+ 6 - 8
coffee-system/src/main/java/com/coffee/bus/service/dto/PatientMonitorResult.java

@@ -1,8 +1,6 @@
 package com.coffee.bus.service.dto;
 
-import cn.hutool.core.util.StrUtil;
-import com.coffee.bus.entity.BusHospitalConfigEntity;
-import com.coffee.bus.entity.BusInfusionHistoryEntity;
+import cn.hutool.core.text.CharSequenceUtil;
 import com.coffee.bus.enums.*;
 import com.coffee.common.enums.SexEnum;
 import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -186,7 +184,7 @@ public class PatientMonitorResult implements Serializable {
     @JsonIgnore
     private Boolean warnLowBattery;
 
-    @ApiModelProperty(value = "加减档提示",readOnly = true)
+    @ApiModelProperty(value = "加减档提示",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
     @JsonIgnore
     private FlowStatusEnum warnFlow;
 
@@ -198,7 +196,7 @@ public class PatientMonitorResult implements Serializable {
         if(!Boolean.TRUE.equals(this.warnWillFinished)){
            return;
         }
-        if (StrUtil.isEmpty(this.warns)) {
+        if (CharSequenceUtil.isEmpty(this.warns)) {
             this.warns="输注即将结束;";
         }else {
             this.warns=this.warns+"输注即将结束;";
@@ -209,7 +207,7 @@ public class PatientMonitorResult implements Serializable {
         if(!Boolean.TRUE.equals(this.warnAnalgesicPoor)){
             return;
         }
-        if (StrUtil.isEmpty(this.warns)) {
+        if (CharSequenceUtil.isEmpty(this.warns)) {
             this.warns="镇痛不足;";
         }else {
             this.warns=this.warns+"镇痛不足;";
@@ -220,7 +218,7 @@ public class PatientMonitorResult implements Serializable {
         if(!Boolean.TRUE.equals(this.warnLowBattery)){
             return;
         }
-        if (StrUtil.isEmpty(this.warns)) {
+        if (CharSequenceUtil.isEmpty(this.warns)) {
             this.warns="电量偏低;";
         }else {
             this.warns=this.warns+"电量偏低;";
@@ -231,7 +229,7 @@ public class PatientMonitorResult implements Serializable {
         if(this.warnFlow==null){
             return;
         }
-        if (StrUtil.isEmpty(this.warns)) {
+        if (CharSequenceUtil.isEmpty(this.warns)) {
             this.warns=warnFlow.getText()+";";
         }else {
             this.warns=this.warns+warnFlow.getText()+";";

+ 8 - 10
coffee-system/src/main/java/com/coffee/bus/stats/analyse/AlarmStatsAnalyse.java

@@ -1,7 +1,7 @@
 package com.coffee.bus.stats.analyse;
 
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import com.coffee.bus.enums.DeviceAlarmEnum;
 import com.coffee.bus.enums.StatsAnalyseEnum;
 import com.coffee.bus.enums.StatsTimeUnit;
@@ -139,7 +139,7 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
             lineContentMap.computeIfAbsent("低输注",k->new LineResult.LineContent<>("低输注")).getValue().add(totalResult.getLowInfusion().getValue());
         });
         result.setContent(new ArrayList<>(lineContentMap.values()));
-        result.setSampleCount(CollectionUtil.size(results));
+        result.setSampleCount(CollUtil.size(results));
         return result;
     }
 
@@ -242,7 +242,7 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
      * @return List<PieResult>
      */
     private List<PieResult> alarmAnalysePie(List<CombineAlarmResult> results){
-        Map<DeviceAlarmEnum, PieResult> resultMap = new HashMap<>();
+        Map<DeviceAlarmEnum, PieResult> resultMap = new EnumMap<>(DeviceAlarmEnum.class);
         resultMap.put(DeviceAlarmEnum.Jam,PieResult.of("jam","堵塞报警原因分析饼图"));
         resultMap.put(DeviceAlarmEnum.Limit,PieResult.of("limit","极限报警原因分析饼图"));
         resultMap.put(DeviceAlarmEnum.NotBox,PieResult.of("noBox","未装药盒报警原因分析饼图"));
@@ -254,7 +254,7 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
         //按照报警类型分类
         Map<DeviceAlarmEnum, List<CombineAlarmResult>> alarmMap = results.stream()
                 .peek(r->{
-                    if(StrUtil.isBlank(r.getCause())){
+                    if(CharSequenceUtil.isBlank(r.getCause())){
                         r.setCause("未填写");
                     }
                 })
@@ -262,11 +262,9 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
 
         resultMap.forEach((alarmType,result)->{
             List<CombineAlarmResult> alarmResults = alarmMap.get(alarmType);
-            if (CollectionUtil.isNotEmpty(alarmResults)) {
-                Map<String, List<CombineAlarmResult>> causeMap = alarmResults.stream().collect(Collectors.groupingBy(CombineAlarmResult::getCause));
-                causeMap.forEach((cause,alarmCauses)->{
-                    result.addContent(cause,Long.valueOf(CollectionUtil.size(alarmCauses)));
-                });
+            if (CollUtil.isNotEmpty(alarmResults)) {
+                Map<String, Long> causeMap = alarmResults.stream().collect(Collectors.groupingBy(CombineAlarmResult::getCause,Collectors.counting()));
+                causeMap.forEach(result::addContent);
             }else {
                 result.addContent("未填写",0);
             }

+ 15 - 14
coffee-system/src/main/java/com/coffee/bus/stats/entity/AlarmTotalPieResult.java

@@ -6,9 +6,9 @@ import com.coffee.bus.enums.FlowStatusEnum;
 import com.coffee.bus.service.dto.CombineAlarmResult;
 import com.coffee.bus.stats.entity.PieResult.*;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.Setter;
-import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
 
@@ -16,36 +16,37 @@ import java.util.HashMap;
  * @author lifang
  * @version 1.0.0
  * @ClassName AlarmTotalPieResult.java
- * @Description TODO
+ * @Description
  * @createTime 2022年06月07日 10:26:00
  */
+@EqualsAndHashCode(callSuper = true)
 public class AlarmTotalPieResult extends HashMap<String,PieContent> {
-    @ApiModelProperty(value = "堵塞报警",readOnly = true)
+    @ApiModelProperty(value = "堵塞报警")
     private PieContent jam;
-    @ApiModelProperty(value = "极限报警",readOnly = true)
+    @ApiModelProperty(value = "极限报警")
     private PieContent limit;
-    @ApiModelProperty(value = "未装药盒报警",readOnly = true)
+    @ApiModelProperty(value = "未装药盒报警")
     private PieContent noBox;
-    @ApiModelProperty(value = "电机失控报警",readOnly = true)
+    @ApiModelProperty(value = "电机失控报警")
     private PieContent outOfControl;
-    @ApiModelProperty(value = "镇痛不足报警",readOnly = true)
+    @ApiModelProperty(value = "镇痛不足报警")
     private PieContent analgesicPoor;
-    @ApiModelProperty(value = "不在服务区报警",readOnly = true)
+    @ApiModelProperty(value = "不在服务区报警")
     private PieContent noSignal;
-    @ApiModelProperty(value = "机械故障报警",readOnly = true)
+    @ApiModelProperty(value = "机械故障报警")
     private PieContent machine;
-    @ApiModelProperty(value = "电量耗尽报警",readOnly = true)
+    @ApiModelProperty(value = "电量耗尽报警")
     private PieContent lowBattery;
-    @ApiModelProperty(value = "气泡无液报警",readOnly = true)
+    @ApiModelProperty(value = "气泡无液报警")
     private PieContent bubble;
-    @ApiModelProperty(value = "低输注状态",readOnly = true)
+    @ApiModelProperty(value = "低输注状态")
     private PieContent lowInfusion;
 
-    @ApiModelProperty(value = "该报警集总数",readOnly = true)
+    @ApiModelProperty(value = "该报警集总数")
     @Getter
     private long total=0;
 
-    @ApiModelProperty(value = "输注总数",readOnly = true)
+    @ApiModelProperty(value = "输注总数")
     @Getter
     @Setter
     private long infusionCount;

+ 2 - 1
coffee-system/src/main/java/com/coffee/bus/stats/entity/PieResult.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 
+import java.io.Serializable;
 import java.util.*;
 /**
  * @author lifang
@@ -35,7 +36,7 @@ public class PieResult {
     }
     @Data
     @AllArgsConstructor(staticName = "of")
-    public static class  PieContent{
+    public static class  PieContent implements Serializable {
         private String name;
         private Long value;
     }

+ 3 - 3
coffee-system/src/main/java/com/coffee/bus/stats/report/AgeAndGenderStatsReport.java

@@ -49,8 +49,8 @@ public class AgeAndGenderStatsReport implements CommonStats<CombineResult> {
     public List<PieResult> handlePie(List<CombineResult> results) {
         PieResult manResult = PieResult.of("man","男性统计饼图");
         PieResult womanResult = PieResult.of("woman","女性统计饼图");
-        Map<AgeStatsEnum, Integer> manAgeMap = new HashMap<>();
-        Map<AgeStatsEnum, Integer> womanAgeMap = new HashMap<>();
+        Map<AgeStatsEnum, Integer> manAgeMap = new EnumMap<>(AgeStatsEnum.class);
+        Map<AgeStatsEnum, Integer> womanAgeMap = new EnumMap<>(AgeStatsEnum.class);
         for (AgeStatsEnum value : AgeStatsEnum.values()) {
             manAgeMap.put(value,0);
             womanAgeMap.put(value,0);
@@ -140,7 +140,7 @@ public class AgeAndGenderStatsReport implements CommonStats<CombineResult> {
         result.setColumn(allColumn);
         groupByTime.forEach((timeRange,combineResults)->{
             LinkedHashMap<String, Object> contentValues = new LinkedHashMap<>();
-            Map<AgeStatsEnum, Integer> ageMap = new HashMap<>();
+            Map<AgeStatsEnum, Integer> ageMap = new EnumMap<>(AgeStatsEnum.class);
             long total=0;
             for (AgeStatsEnum value : AgeStatsEnum.values()) {
                 ageMap.put(value,0);

+ 3 - 3
coffee-system/src/main/java/com/coffee/bus/stats/report/AgeStatsReport.java

@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
  * @author lifang
  * @version 1.0.0
  * @ClassName AgeStatsReport.java
- * @Description TODO
+ * @Description
  * @createTime 2022年06月08日 10:07:00
  */
 @AllArgsConstructor
@@ -65,7 +65,7 @@ public class AgeStatsReport implements CommonStats<CombineResult> {
     @Override
     public List<PieResult> handlePie(List<CombineResult> results) {
         PieResult result = PieResult.of(PieEnum.total.name(),PieEnum.total.getText());
-        Map<AgeStatsEnum, Integer> ageMap = new HashMap<>();
+        Map<AgeStatsEnum, Integer> ageMap = new EnumMap< >(AgeStatsEnum.class);
         for (AgeStatsEnum value : AgeStatsEnum.values()) {
             ageMap.put(value,0);
         }
@@ -132,7 +132,7 @@ public class AgeStatsReport implements CommonStats<CombineResult> {
         result.setColumn(allColumn);
         groupByTime.forEach((timeRange,combineResults)->{
             LinkedHashMap<String, Object> contentValues = new LinkedHashMap<>();
-            Map<AgeStatsEnum, Integer> ageMap = new HashMap<>();
+            Map<AgeStatsEnum, Integer> ageMap =  new EnumMap< >(AgeStatsEnum.class);
             BigDecimal total=BigDecimal.valueOf(CollectionUtil.size(combineResults));
             for (AgeStatsEnum value : AgeStatsEnum.values()) {
                 ageMap.put(value,0);

+ 10 - 21
coffee-system/src/main/java/com/coffee/bus/stats/report/WeightStatsReport.java

@@ -1,7 +1,6 @@
 package com.coffee.bus.stats.report;
 
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import com.coffee.bus.enums.StatsAnalyseEnum;
 import com.coffee.bus.enums.StatsTimeUnit;
 import com.coffee.bus.service.LocalBusInfusionHistoryService;
@@ -17,9 +16,7 @@ import com.coffee.common.enums.SexEnum;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
-
 import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -63,13 +60,13 @@ public class WeightStatsReport implements CommonStats<CombineResult> {
     private PieResult genderPie(List<CombineResult> results,SexEnum sex,PieResult result) {
         List<CombineResult> genderResults = results.stream().filter(combineResult -> sex.equals(combineResult.getPatientGender()))
                 .collect(Collectors.toList());
-        Map<WeightRangeEnum, Integer> ageMap = new HashMap<>();
+        Map<WeightRangeEnum, Integer> ageMap = new EnumMap<>(WeightRangeEnum.class);
         for (WeightRangeEnum value : WeightRangeEnum.values()) {
             ageMap.put(value,0);
         }
         for (CombineResult combineResult : genderResults) {
             String weight = combineResult.getWeight();
-            if(StrUtil.isBlank(weight)){
+            if(CharSequenceUtil.isBlank(weight)){
                 ageMap.merge(WeightRangeEnum.unkown,1,(t1, t2)->t1+t2);
             }
             try {
@@ -94,13 +91,13 @@ public class WeightStatsReport implements CommonStats<CombineResult> {
      */
     private PieResult totalPie(List<CombineResult> results) {
         PieResult result = PieResult.of(PieEnum.total.name(),PieEnum.total.getText());
-        Map<WeightRangeEnum, Integer> ageMap = new HashMap<>();
+        Map<WeightRangeEnum, Integer> ageMap = new EnumMap<>(WeightRangeEnum.class);
         for (WeightRangeEnum value : WeightRangeEnum.values()) {
             ageMap.put(value,0);
         }
         for (CombineResult combineResult : results) {
             String weight = combineResult.getWeight();
-            if(StrUtil.isBlank(weight)){
+            if(CharSequenceUtil.isBlank(weight)){
                 ageMap.merge(WeightRangeEnum.unkown,1,(t1, t2)->t1+t2);
             }
             try {
@@ -129,16 +126,12 @@ public class WeightStatsReport implements CommonStats<CombineResult> {
                         return false;
                     }
                     try {
-                        Double test = Double.valueOf(filter.getWeight());
+                         Double.valueOf(filter.getWeight());
                     }catch (Exception e){
                         log.error("临床【{}】体重【{}】格式错误",filter.getClinicId(),filter.getWeight());
                         return false;
                     }
-                    if (SexEnum.MAN.equals(filter.getPatientGender())) {
-                        return true;
-                    }
-                    return false;
-
+                    return SexEnum.MAN.equals(filter.getPatientGender());
                 },
                 map->BigDecimal.valueOf(Long.valueOf(map.getWeight()))
         );
@@ -150,16 +143,12 @@ public class WeightStatsReport implements CommonStats<CombineResult> {
                         return false;
                     }
                     try {
-                        Double test = Double.valueOf(filter.getWeight());
+                         Double.valueOf(filter.getWeight());
                     }catch (Exception e){
                         log.error("临床【{}】体重【{}】格式错误",filter.getClinicId(),filter.getWeight());
                         return false;
                     }
-                    if (SexEnum.WOMAN.equals(filter.getPatientGender())) {
-                        return true;
-                    }
-                    return false;
-
+                    return SexEnum.WOMAN.equals(filter.getPatientGender());
                 },
                 map->BigDecimal.valueOf(Long.valueOf(map.getWeight()))
         );
@@ -171,6 +160,6 @@ public class WeightStatsReport implements CommonStats<CombineResult> {
 
     @Override
     public  List<TableResult> handleTable(List<CombineResult> results, StatsTimeUnit unit) {
-        return null;
+        return Collections.emptyList();
     }
 }

+ 0 - 3
coffee-system/src/main/java/com/coffee/bus/utils/WsPublishUtils.java

@@ -2,10 +2,7 @@ package com.coffee.bus.utils;
 
 
 import cn.hutool.json.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.coffee.bus.entity.BusClinicEntity;
 import com.coffee.bus.enums.PatientAlarmEnum;
-import com.coffee.bus.service.LocalBusClinicService;
 import com.coffee.bus.service.LocalBusPatientService;
 import com.coffee.bus.service.dto.MonitorStatusStatsCountResult;
 import com.coffee.bus.service.dto.PatientMonitorResult;

+ 2 - 4
coffee-system/src/main/java/com/coffee/bus/web/handler/CheckRequestHandler.java

@@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit;
  * @author lifang
  * @version 1.0.0
  * @ClassName CheckRequestHandler.java
- * @Description TODO
+ * @Description
  * @createTime 2022年06月09日 14:11:00
  */
 @Configuration
@@ -44,9 +44,7 @@ public class CheckRequestHandler  implements HandlerInterceptor {
             String timestamp = request.getHeader("Timestamp");
             String authorization = request.getHeader("Authorization");
             String body = IoUtil.read(request.getInputStream(), Charset.defaultCharset());
-            if(StrUtil.isBlank(sign)
-                    ||StrUtil.isBlank(timestamp)
-                    ||StrUtil.isBlank(authorization)){
+            if(StrUtil.hasBlank(sign,timestamp,authorization)){
                 throw new RequestParmErrorException();
             }
             try {

+ 15 - 17
coffee-system/src/main/java/com/coffee/bus/websocket/DefaultWebSocketMsgHandler.java

@@ -1,9 +1,9 @@
 package com.coffee.bus.websocket;
 
 import cn.dev33.satoken.stp.StpUtil;
-import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.coffee.bus.hospital.his.HisResponse;
 import com.coffee.bus.hospital.his.HisScriptSession;
@@ -23,6 +23,7 @@ import org.tio.core.ChannelContext;
 import org.tio.core.Tio;
 import org.tio.http.common.HttpRequest;
 import org.tio.http.common.HttpResponse;
+import org.tio.websocket.common.WsPacket;
 import org.tio.websocket.common.WsRequest;
 import org.tio.websocket.common.WsResponse;
 import org.tio.websocket.server.handler.IWsMsgHandler;
@@ -51,20 +52,20 @@ public class DefaultWebSocketMsgHandler implements IWsMsgHandler {
         if(log.isDebugEnabled()){
             log.debug("websocket 握手成功,开始进行权限校验,Authorization:{}",authorization);
         }
-        if(StrUtil.isNullOrUndefined(authorization)){
-            Tio.send(channelContext,WsResponse.fromText(JSONUtil.toJsonStr(R.fail("授权失败")),"utf-8"));
+        if(CharSequenceUtil.isNullOrUndefined(authorization)){
+            Tio.send(channelContext,WsResponse.fromText(JSONUtil.toJsonStr(R.fail("授权失败")), WsPacket.CHARSET_NAME));
             //给返回信息一些时间
             Thread.sleep(50);
             channelContext.setClosed(true);
             Tio.remove(channelContext,  "接受数据不符合业务规范");
             return;
         }
-        if (StrUtil.isNotEmpty(authorization)) {
+        if (CharSequenceUtil.isNotEmpty(authorization)) {
             Object result = StpUtil.getTokenSessionByToken(authorization).get(Constants.LOGIN_USER_KEY);
             if(null==result){
                 //尝试医院请求登录
                 String hospitalId = codeCheck.getHospitalId(authorization);
-                if (StrUtil.isNotBlank(hospitalId)) {
+                if (CharSequenceUtil.isNotBlank(hospitalId)) {
                     channelContext.set(Constants.HOSPITAL_ID,hospitalId);
                     HisScriptSession hisScriptSession = scriptSessionManager.get(hospitalId);
                     //绑定
@@ -104,26 +105,26 @@ public class DefaultWebSocketMsgHandler implements IWsMsgHandler {
 
     @Override
     public Object onText(WsRequest wsRequest, String message, ChannelContext channelContext) {
-        if (StrUtil.isEmpty(message)) {
+        if (CharSequenceUtil.isEmpty(message)) {
             channelContext.setClosed(true);
             Tio.remove(channelContext,  "接受数据不符合业务规范");
             return null;
         }
         //心跳请求
-        if("ping".equals(message.trim().toLowerCase())){
+        if("ping".equalsIgnoreCase(message.trim())){
             Tio.send(channelContext,WsResponse.fromText("pong","utf-8"));
             return null;
         }
         try {
-            synchronized (channelContext){
+            synchronized (channelContext.getId()){
                 if(log.isDebugEnabled()){
                     log.debug("websocket 接收到消息,message:{},token:{},userId:{}",message,channelContext.getToken(),JSONUtil.toJsonStr(channelContext.get(Constants.LOGIN_USER_KEY)));
                 }
                 Object user = channelContext.get(Constants.LOGIN_USER_KEY);
                 if(ObjectUtil.isNotNull(user)){
-                    handleUserMessage(wsRequest,message,channelContext);
+                    handleUserMessage(message,channelContext);
                 }else {
-                    handleHospitalMessage(wsRequest,message,channelContext,String.valueOf(channelContext.get(Constants.HOSPITAL_ID)));
+                    handleHospitalMessage(message,String.valueOf(channelContext.get(Constants.HOSPITAL_ID)));
                 }
             }
         }catch (Exception e){
@@ -140,12 +141,11 @@ public class DefaultWebSocketMsgHandler implements IWsMsgHandler {
      * 描述: 处理用户请求
      * @author lifang
      * @date 2022/5/27 9:54
-     * @param wsRequest
      * @param message
      * @param channelContext
      * @return void
      */
-    private void handleUserMessage(WsRequest wsRequest, String message, ChannelContext channelContext){
+    private void handleUserMessage( String message, ChannelContext channelContext){
         MessagingRequest messagingRequest = JSONUtil.toBean(message, MessagingRequest.class);
         messagingRequest.validate();
         List<WsHandler> collect = messageHandlers
@@ -153,7 +153,7 @@ public class DefaultWebSocketMsgHandler implements IWsMsgHandler {
                 .filter(handler -> messagingRequest.getId().equals(handler.getId()))
                 .collect(Collectors.toList());
         //传入格式错误,不支持该订阅id
-        if(CollectionUtil.isEmpty(collect)){
+        if(CollUtil.isEmpty(collect)){
             channelContext.setClosed(true);
             Tio.remove(channelContext,  "接受数据不符合业务规范");
             return;
@@ -165,12 +165,10 @@ public class DefaultWebSocketMsgHandler implements IWsMsgHandler {
      * 描述: 处理医院响应请求
      * @author lifang
      * @date 2022/5/27 9:54
-     * @param wsRequest
      * @param message
-     * @param channelContext
      * @return void
      */
-    private void handleHospitalMessage(WsRequest wsRequest, String message, ChannelContext channelContext,String hospitalId){
+    private void handleHospitalMessage(String message,String hospitalId){
         MessagingRequest messagingRequest = JSONUtil.toBean(message, MessagingRequest.class);
         try {
             //医院主题请求